web/res/js/client.js
changeset 1583 459a88818bec
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/web/res/js/client.js	Wed Dec 18 12:52:21 2024 +0100
@@ -0,0 +1,2 @@
+/*! For license information please see client.js.LICENSE.txt */
+(()=>{var e={3490:(e,t,n)=>{"use strict";var r=n(8908);e.exports=function(e,t){return void 0===t&&(t=!1),function(n,i,a){if(n)e(n);else if(i.statusCode>=400&&i.statusCode<=599){var s=a;if(t)if(r.TextDecoder){var o=(void 0===(l=i.headers&&i.headers["content-type"])&&(l=""),l.toLowerCase().split(";").reduce((function(e,t){var n=t.split("="),r=n[0],i=n[1];return"charset"===r.trim()?i.trim():e}),"utf-8"));try{s=new TextDecoder(o).decode(a)}catch(e){}}else s=String.fromCharCode.apply(null,new Uint8Array(a));e({cause:s})}else e(null,a);var l}}},9603:(e,t,n)=>{"use strict";var r=n(8908),i=n(434),a=n(7376);l.httpHandler=n(3490);var s=function(e){var t={};return e?(e.trim().split("\n").forEach((function(e){var n=e.indexOf(":"),r=e.slice(0,n).trim().toLowerCase(),i=e.slice(n+1).trim();void 0===t[r]?t[r]=i:Array.isArray(t[r])?t[r].push(i):t[r]=[t[r],i]})),t):t};function o(e,t,n){var r=e;return a(t)?(n=t,"string"==typeof e&&(r={uri:e})):r=i({},t,{uri:e}),r.callback=n,r}function l(e,t,n){return u(t=o(e,t,n))}function u(e){if(void 0===e.callback)throw new Error("callback argument missing");var t=!1,n=function(n,r,i){t||(t=!0,e.callback(n,r,i))};function r(){var e=void 0;if(e=c.response?c.response:c.responseText||function(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(e){}return null}(c),y)try{e=JSON.parse(e)}catch(e){}return e}function i(e){return clearTimeout(d),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,n(e,v)}function a(){if(!u){var t;clearTimeout(d),t=e.useXDR&&void 0===c.status?200:1223===c.status?204:c.status;var i=v,a=null;return 0!==t?(i={body:r(),statusCode:t,method:h,headers:{},url:f,rawRequest:c},c.getAllResponseHeaders&&(i.headers=s(c.getAllResponseHeaders()))):a=new Error("Internal XMLHttpRequest Error"),n(a,i,i.body)}}var o,u,c=e.xhr||null;c||(c=e.cors||e.useXDR?new l.XDomainRequest:new l.XMLHttpRequest);var d,f=c.url=e.uri||e.url,h=c.method=e.method||"GET",p=e.body||e.data,g=c.headers=e.headers||{},m=!!e.sync,y=!1,v={body:void 0,headers:{},statusCode:0,method:h,url:f,rawRequest:c};if("json"in e&&!1!==e.json&&(y=!0,g.accept||g.Accept||(g.Accept="application/json"),"GET"!==h&&"HEAD"!==h&&(g["content-type"]||g["Content-Type"]||(g["Content-Type"]="application/json"),p=JSON.stringify(!0===e.json?p:e.json))),c.onreadystatechange=function(){4===c.readyState&&setTimeout(a,0)},c.onload=a,c.onerror=i,c.onprogress=function(){},c.onabort=function(){u=!0},c.ontimeout=i,c.open(h,f,!m,e.username,e.password),m||(c.withCredentials=!!e.withCredentials),!m&&e.timeout>0&&(d=setTimeout((function(){if(!u){u=!0,c.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",i(e)}}),e.timeout)),c.setRequestHeader)for(o in g)g.hasOwnProperty(o)&&c.setRequestHeader(o,g[o]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(c.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(c),c.send(p||null),c}e.exports=l,e.exports.default=l,l.XMLHttpRequest=r.XMLHttpRequest||function(){},l.XDomainRequest="withCredentials"in new l.XMLHttpRequest?l.XMLHttpRequest:r.XDomainRequest,function(e,t){for(var n=0;n<e.length;n++)t(e[n])}(["get","put","post","patch","head","delete"],(function(e){l["delete"===e?"del":e]=function(t,n,r){return(n=o(t,n,r)).method=e.toUpperCase(),u(n)}}))},2167:(e,t)=>{"use strict";function n(e,t){return void 0===t&&(t=Object),t&&"function"==typeof t.freeze?t.freeze(e):e}var r=n({HTML:"text/html",isHTML:function(e){return e===r.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),i=n({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===i.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});t.assign=function(e,t){if(null===e||"object"!=typeof e)throw new TypeError("target is not an object");for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},t.find=function(e,t,n){if(void 0===n&&(n=Array.prototype),e&&"function"==typeof n.find)return n.find.call(e,t);for(var r=0;r<e.length;r++)if(Object.prototype.hasOwnProperty.call(e,r)){var i=e[r];if(t.call(void 0,i,r,e))return i}},t.freeze=n,t.MIME_TYPE=r,t.NAMESPACE=i},6129:(e,t,n)=>{var r=n(2167),i=n(1146),a=n(1045),s=n(6925),o=i.DOMImplementation,l=r.NAMESPACE,u=s.ParseError,c=s.XMLReader;function d(e){return e.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function f(e){this.options=e||{locator:{}}}function h(){this.cdata=!1}function p(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function g(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function m(e,t,n){return"string"==typeof e?e.substr(t,n):e.length>=t+n||t?new java.lang.String(e,t,n)+"":e}function y(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}f.prototype.parseFromString=function(e,t){var n=this.options,r=new c,i=n.domBuilder||new h,s=n.errorHandler,o=n.locator,u=n.xmlns||{},f=/\/x?html?$/.test(t),p=f?a.HTML_ENTITIES:a.XML_ENTITIES;o&&i.setDocumentLocator(o),r.errorHandler=function(e,t,n){if(!e){if(t instanceof h)return t;e=t}var r={},i=e instanceof Function;function a(t){var a=e[t];!a&&i&&(a=2==e.length?function(n){e(t,n)}:e),r[t]=a&&function(e){a("[xmldom "+t+"]\t"+e+g(n))}||function(){}}return n=n||{},a("warning"),a("error"),a("fatalError"),r}(s,i,o),r.domBuilder=n.domBuilder||i,f&&(u[""]=l.HTML),u.xml=u.xml||l.XML;var m=n.normalizeLineEndings||d;return e&&"string"==typeof e?r.parse(m(e),u,p):r.errorHandler.error("invalid doc source"),i.doc},h.prototype={startDocument:function(){this.doc=(new o).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,r){var i=this.doc,a=i.createElementNS(e,n||t),s=r.length;y(this,a),this.currentElement=a,this.locator&&p(this.locator,a);for(var o=0;o<s;o++){e=r.getURI(o);var l=r.getValue(o),u=(n=r.getQName(o),i.createAttributeNS(e,n));this.locator&&p(r.getLocator(o),u),u.value=u.nodeValue=l,a.setAttributeNode(u)}},endElement:function(e,t,n){var r=this.currentElement;r.tagName,this.currentElement=r.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var n=this.doc.createProcessingInstruction(e,t);this.locator&&p(this.locator,n),y(this,n)},ignorableWhitespace:function(e,t,n){},characters:function(e,t,n){if(e=m.apply(this,arguments)){if(this.cdata)var r=this.doc.createCDATASection(e);else r=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(r):/^\s*$/.test(e)&&this.doc.appendChild(r),this.locator&&p(this.locator,r)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,n){e=m.apply(this,arguments);var r=this.doc.createComment(e);this.locator&&p(this.locator,r),y(this,r)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,n){var r=this.doc.implementation;if(r&&r.createDocumentType){var i=r.createDocumentType(e,t,n);this.locator&&p(this.locator,i),y(this,i),this.doc.doctype=i}},warning:function(e){console.warn("[xmldom warning]\t"+e,g(this.locator))},error:function(e){console.error("[xmldom error]\t"+e,g(this.locator))},fatalError:function(e){throw new u(e,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(e){h.prototype[e]=function(){return null}})),t.DOMParser=f},1146:(e,t,n)=>{var r=n(2167),i=r.find,a=r.NAMESPACE;function s(e){return""!==e}function o(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function l(e){if(!e)return[];var t=function(e){return e?e.split(/[\t\n\f\r ]+/).filter(s):[]}(e);return Object.keys(t.reduce(o,{}))}function u(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}function c(e,t){var n=e.prototype;if(!(n instanceof t)){function r(){}r.prototype=t.prototype,u(n,r=new r),e.prototype=n=r}n.constructor!=e&&("function"!=typeof e&&console.error("unknown Class:"+e),n.constructor=e)}var d={},f=d.ELEMENT_NODE=1,h=d.ATTRIBUTE_NODE=2,p=d.TEXT_NODE=3,g=d.CDATA_SECTION_NODE=4,m=d.ENTITY_REFERENCE_NODE=5,y=d.ENTITY_NODE=6,v=d.PROCESSING_INSTRUCTION_NODE=7,_=d.COMMENT_NODE=8,T=d.DOCUMENT_NODE=9,E=d.DOCUMENT_TYPE_NODE=10,b=d.DOCUMENT_FRAGMENT_NODE=11,S=d.NOTATION_NODE=12,A={},w={},I=(A.INDEX_SIZE_ERR=(w[1]="Index size error",1),A.DOMSTRING_SIZE_ERR=(w[2]="DOMString size error",2),A.HIERARCHY_REQUEST_ERR=(w[3]="Hierarchy request error",3)),C=(A.WRONG_DOCUMENT_ERR=(w[4]="Wrong document",4),A.INVALID_CHARACTER_ERR=(w[5]="Invalid character",5),A.NO_DATA_ALLOWED_ERR=(w[6]="No data allowed",6),A.NO_MODIFICATION_ALLOWED_ERR=(w[7]="No modification allowed",7),A.NOT_FOUND_ERR=(w[8]="Not found",8)),R=(A.NOT_SUPPORTED_ERR=(w[9]="Not supported",9),A.INUSE_ATTRIBUTE_ERR=(w[10]="Attribute in use",10));function D(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,w[e]),this.message=w[e],Error.captureStackTrace&&Error.captureStackTrace(this,D);return n.code=e,t&&(this.message=this.message+": "+t),n}function N(){}function O(e,t){this._node=e,this._refresh=t,P(this)}function P(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var n=e._refresh(e._node);if(ve(e,"length",n.length),!e.$$length||n.length<e.$$length)for(var r=n.length;r in e;r++)Object.prototype.hasOwnProperty.call(e,r)&&delete e[r];u(n,e),e._inc=t}}function M(){}function x(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function L(e,t,n,r){if(r?t[x(t,r)]=n:t[t.length++]=n,e){n.ownerElement=e;var i=e.ownerDocument;i&&(r&&H(i,e,r),function(e,t,n){e&&e._inc++,n.namespaceURI===a.XMLNS&&(t._nsMap[n.prefix?n.localName:""]=n.value)}(i,e,n))}}function k(e,t,n){var r=x(t,n);if(!(r>=0))throw new D(C,new Error(e.tagName+"@"+n));for(var i=t.length-1;r<i;)t[r]=t[++r];if(t.length=i,e){var a=e.ownerDocument;a&&(H(a,e,n),n.ownerElement=null)}}function F(){}function U(){}function B(e){return("<"==e?"&lt;":">"==e&&"&gt;")||"&"==e&&"&amp;"||'"'==e&&"&quot;"||"&#"+e.charCodeAt()+";"}function j(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(j(e,t))return!0}while(e=e.nextSibling)}function q(){this.ownerDocument=this}function H(e,t,n,r){e&&e._inc++,n.namespaceURI===a.XMLNS&&delete t._nsMap[n.prefix?n.localName:""]}function G(e,t,n){if(e&&e._inc){e._inc++;var r=t.childNodes;if(n)r[r.length++]=n;else{for(var i=t.firstChild,a=0;i;)r[a++]=i,i=i.nextSibling;r.length=a,delete r[r.length]}}}function V(e,t){var n=t.previousSibling,r=t.nextSibling;return n?n.nextSibling=r:e.firstChild=r,r?r.previousSibling=n:e.lastChild=n,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,G(e.ownerDocument,e),t}function Y(e){return e&&e.nodeType===U.DOCUMENT_TYPE_NODE}function Z(e){return e&&e.nodeType===U.ELEMENT_NODE}function K(e){return e&&e.nodeType===U.TEXT_NODE}function z(e,t){var n=e.childNodes||[];if(i(n,Z)||Y(t))return!1;var r=i(n,Y);return!(t&&r&&n.indexOf(r)>n.indexOf(t))}function W(e,t){var n=e.childNodes||[];if(i(n,(function(e){return Z(e)&&e!==t})))return!1;var r=i(n,Y);return!(t&&r&&n.indexOf(r)>n.indexOf(t))}function X(e,t,n){var r=e.childNodes||[],a=t.childNodes||[];if(t.nodeType===U.DOCUMENT_FRAGMENT_NODE){var s=a.filter(Z);if(s.length>1||i(a,K))throw new D(I,"More than one element or text in fragment");if(1===s.length&&!z(e,n))throw new D(I,"Element in fragment can not be inserted before doctype")}if(Z(t)&&!z(e,n))throw new D(I,"Only one element can be added and only after doctype");if(Y(t)){if(i(r,Y))throw new D(I,"Only one doctype is allowed");var o=i(r,Z);if(n&&r.indexOf(o)<r.indexOf(n))throw new D(I,"Doctype can only be inserted before an element");if(!n&&o)throw new D(I,"Doctype can not be appended since element is present")}}function $(e,t,n){var r=e.childNodes||[],a=t.childNodes||[];if(t.nodeType===U.DOCUMENT_FRAGMENT_NODE){var s=a.filter(Z);if(s.length>1||i(a,K))throw new D(I,"More than one element or text in fragment");if(1===s.length&&!W(e,n))throw new D(I,"Element in fragment can not be inserted before doctype")}if(Z(t)&&!W(e,n))throw new D(I,"Only one element can be added and only after doctype");if(Y(t)){if(i(r,(function(e){return Y(e)&&e!==n})))throw new D(I,"Only one doctype is allowed");var o=i(r,Z);if(n&&r.indexOf(o)<r.indexOf(n))throw new D(I,"Doctype can only be inserted before an element")}}function Q(e,t,n,r){(function(e,t,n){if(!function(e){return e&&(e.nodeType===U.DOCUMENT_NODE||e.nodeType===U.DOCUMENT_FRAGMENT_NODE||e.nodeType===U.ELEMENT_NODE)}(e))throw new D(I,"Unexpected parent node type "+e.nodeType);if(n&&n.parentNode!==e)throw new D(C,"child not in parent");if(!function(e){return e&&(Z(e)||K(e)||Y(e)||e.nodeType===U.DOCUMENT_FRAGMENT_NODE||e.nodeType===U.COMMENT_NODE||e.nodeType===U.PROCESSING_INSTRUCTION_NODE)}(t)||Y(t)&&e.nodeType!==U.DOCUMENT_NODE)throw new D(I,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)})(e,t,n),e.nodeType===U.DOCUMENT_NODE&&(r||X)(e,t,n);var i=t.parentNode;if(i&&i.removeChild(t),t.nodeType===b){var a=t.firstChild;if(null==a)return t;var s=t.lastChild}else a=s=t;var o=n?n.previousSibling:e.lastChild;a.previousSibling=o,s.nextSibling=n,o?o.nextSibling=a:e.firstChild=a,null==n?e.lastChild=s:n.previousSibling=s;do{a.parentNode=e}while(a!==s&&(a=a.nextSibling));return G(e.ownerDocument||e,e),t.nodeType==b&&(t.firstChild=t.lastChild=null),t}function J(){this._nsMap={}}function ee(){}function te(){}function ne(){}function re(){}function ie(){}function ae(){}function se(){}function oe(){}function le(){}function ue(){}function ce(){}function de(){}function fe(e,t){var n=[],r=9==this.nodeType&&this.documentElement||this,i=r.prefix,a=r.namespaceURI;if(a&&null==i&&null==(i=r.lookupPrefix(a)))var s=[{namespace:a,prefix:null}];return ge(this,n,e,t,s),n.join("")}function he(e,t,n){var r=e.prefix||"",i=e.namespaceURI;if(!i)return!1;if("xml"===r&&i===a.XML||i===a.XMLNS)return!1;for(var s=n.length;s--;){var o=n[s];if(o.prefix===r)return o.namespace!==i}return!0}function pe(e,t,n){e.push(" ",t,'="',n.replace(/[<>&"\t\n\r]/g,B),'"')}function ge(e,t,n,r,i){if(i||(i=[]),r){if(!(e=r(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case f:var s=e.attributes,o=s.length,l=e.firstChild,u=e.tagName,c=u;if(!(n=a.isHTML(e.namespaceURI)||n)&&!e.prefix&&e.namespaceURI){for(var d,y=0;y<s.length;y++)if("xmlns"===s.item(y).name){d=s.item(y).value;break}if(!d)for(var S=i.length-1;S>=0;S--)if(""===(A=i[S]).prefix&&A.namespace===e.namespaceURI){d=A.namespace;break}if(d!==e.namespaceURI)for(S=i.length-1;S>=0;S--){var A;if((A=i[S]).namespace===e.namespaceURI){A.prefix&&(c=A.prefix+":"+u);break}}}t.push("<",c);for(var w=0;w<o;w++)"xmlns"==(I=s.item(w)).prefix?i.push({prefix:I.localName,namespace:I.value}):"xmlns"==I.nodeName&&i.push({prefix:"",namespace:I.value});for(w=0;w<o;w++){var I,C,R;he(I=s.item(w),0,i)&&(pe(t,(C=I.prefix||"")?"xmlns:"+C:"xmlns",R=I.namespaceURI),i.push({prefix:C,namespace:R})),ge(I,t,n,r,i)}if(u===c&&he(e,0,i)&&(pe(t,(C=e.prefix||"")?"xmlns:"+C:"xmlns",R=e.namespaceURI),i.push({prefix:C,namespace:R})),l||n&&!/^(?:meta|link|img|br|hr|input)$/i.test(u)){if(t.push(">"),n&&/^script$/i.test(u))for(;l;)l.data?t.push(l.data):ge(l,t,n,r,i.slice()),l=l.nextSibling;else for(;l;)ge(l,t,n,r,i.slice()),l=l.nextSibling;t.push("</",c,">")}else t.push("/>");return;case T:case b:for(l=e.firstChild;l;)ge(l,t,n,r,i.slice()),l=l.nextSibling;return;case h:return pe(t,e.name,e.value);case p:return t.push(e.data.replace(/[<&>]/g,B));case g:return t.push("<![CDATA[",e.data,"]]>");case _:return t.push("\x3c!--",e.data,"--\x3e");case E:var D=e.publicId,N=e.systemId;if(t.push("<!DOCTYPE ",e.name),D)t.push(" PUBLIC ",D),N&&"."!=N&&t.push(" ",N),t.push(">");else if(N&&"."!=N)t.push(" SYSTEM ",N,">");else{var O=e.internalSubset;O&&t.push(" [",O,"]"),t.push(">")}return;case v:return t.push("<?",e.target," ",e.data,"?>");case m:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function me(e,t,n){var r;switch(t.nodeType){case f:(r=t.cloneNode(!1)).ownerDocument=e;case b:break;case h:n=!0}if(r||(r=t.cloneNode(!1)),r.ownerDocument=e,r.parentNode=null,n)for(var i=t.firstChild;i;)r.appendChild(me(e,i,n)),i=i.nextSibling;return r}function ye(e,t,n){var r=new t.constructor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var a=t[i];"object"!=typeof a&&a!=r[i]&&(r[i]=a)}switch(t.childNodes&&(r.childNodes=new N),r.ownerDocument=e,r.nodeType){case f:var s=t.attributes,o=r.attributes=new M,l=s.length;o._ownerElement=r;for(var u=0;u<l;u++)r.setAttributeNode(ye(e,s.item(u),!0));break;case h:n=!0}if(n)for(var c=t.firstChild;c;)r.appendChild(ye(e,c,n)),c=c.nextSibling;return r}function ve(e,t,n){e[t]=n}A.INVALID_STATE_ERR=(w[11]="Invalid state",11),A.SYNTAX_ERR=(w[12]="Syntax error",12),A.INVALID_MODIFICATION_ERR=(w[13]="Invalid modification",13),A.NAMESPACE_ERR=(w[14]="Invalid namespace",14),A.INVALID_ACCESS_ERR=(w[15]="Invalid access",15),D.prototype=Error.prototype,u(A,D),N.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e,t){for(var n=[],r=0;r<this.length;r++)ge(this[r],n,e,t);return n.join("")},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}},O.prototype.item=function(e){return P(this),this[e]||null},c(O,N),M.prototype={length:0,item:N.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var n=this[t];if(n.nodeName==e)return n}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new D(R);var n=this.getNamedItem(e.nodeName);return L(this._ownerElement,this,e,n),n},setNamedItemNS:function(e){var t,n=e.ownerElement;if(n&&n!=this._ownerElement)throw new D(R);return t=this.getNamedItemNS(e.namespaceURI,e.localName),L(this._ownerElement,this,e,t),t},removeNamedItem:function(e){var t=this.getNamedItem(e);return k(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var n=this.getNamedItemNS(e,t);return k(this._ownerElement,this,n),n},getNamedItemNS:function(e,t){for(var n=this.length;n--;){var r=this[n];if(r.localName==t&&r.namespaceURI==e)return r}return null}},F.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,n){var r=new q;if(r.implementation=this,r.childNodes=new N,r.doctype=n||null,n&&r.appendChild(n),t){var i=r.createElementNS(e,t);r.appendChild(i)}return r},createDocumentType:function(e,t,n){var r=new ae;return r.name=e,r.nodeName=e,r.publicId=t||"",r.systemId=n||"",r}},U.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return Q(this,e,t)},replaceChild:function(e,t){Q(this,e,t,$),t&&this.removeChild(t)},removeChild:function(e){return V(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return ye(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;t&&t.nodeType==p&&e.nodeType==p?(this.removeChild(t),e.appendData(t.data)):(e.normalize(),e=t)}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n)for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)&&n[r]===e)return r;t=t.nodeType==h?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&Object.prototype.hasOwnProperty.call(n,e))return n[e];t=t.nodeType==h?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},u(d,U),u(d,U.prototype),q.prototype={nodeName:"#document",nodeType:T,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==b){for(var n=e.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,t),n=r}return e}return Q(this,e,t),e.ownerDocument=this,null===this.documentElement&&e.nodeType===f&&(this.documentElement=e),e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),V(this,e)},replaceChild:function(e,t){Q(this,e,t,$),e.ownerDocument=this,t&&this.removeChild(t),Z(e)&&(this.documentElement=e)},importNode:function(e,t){return me(this,e,t)},getElementById:function(e){var t=null;return j(this.documentElement,(function(n){if(n.nodeType==f&&n.getAttribute("id")==e)return t=n,!0})),t},getElementsByClassName:function(e){var t=l(e);return new O(this,(function(n){var r=[];return t.length>0&&j(n.documentElement,(function(i){if(i!==n&&i.nodeType===f){var a=i.getAttribute("class");if(a){var s=e===a;if(!s){var o=l(a);s=t.every((u=o,function(e){return u&&-1!==u.indexOf(e)}))}s&&r.push(i)}}var u})),r}))},createElement:function(e){var t=new J;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new N,(t.attributes=new M)._ownerElement=t,t},createDocumentFragment:function(){var e=new ue;return e.ownerDocument=this,e.childNodes=new N,e},createTextNode:function(e){var t=new ne;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new re;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new ie;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new ce;return n.ownerDocument=this,n.tagName=n.nodeName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new ee;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new le;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new J,r=t.split(":"),i=n.attributes=new M;return n.childNodes=new N,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=t,i._ownerElement=n,n},createAttributeNS:function(e,t){var n=new ee,r=t.split(":");return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=t,n}},c(q,U),J.prototype={nodeType:f,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===b?this.insertBefore(e,null):function(e,t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=e,t.previousSibling=e.lastChild,t.nextSibling=null,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,e.lastChild=t,G(e.ownerDocument,e,t),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||""},setAttributeNS:function(e,t,n){var r=this.ownerDocument.createAttributeNS(e,t);r.value=r.nodeValue=""+n,this.setAttributeNode(r)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new O(this,(function(t){var n=[];return j(t,(function(r){r===t||r.nodeType!=f||"*"!==e&&r.tagName!=e||n.push(r)})),n}))},getElementsByTagNameNS:function(e,t){return new O(this,(function(n){var r=[];return j(n,(function(i){i===n||i.nodeType!==f||"*"!==e&&i.namespaceURI!==e||"*"!==t&&i.localName!=t||r.push(i)})),r}))}},q.prototype.getElementsByTagName=J.prototype.getElementsByTagName,q.prototype.getElementsByTagNameNS=J.prototype.getElementsByTagNameNS,c(J,U),ee.prototype.nodeType=h,c(ee,U),te.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(w[I])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,n){n=this.data.substring(0,e)+n+this.data.substring(e+t),this.nodeValue=this.data=n,this.length=n.length}},c(te,U),ne.prototype={nodeName:"#text",nodeType:p,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},c(ne,te),re.prototype={nodeName:"#comment",nodeType:_},c(re,te),ie.prototype={nodeName:"#cdata-section",nodeType:g},c(ie,te),ae.prototype.nodeType=E,c(ae,U),se.prototype.nodeType=S,c(se,U),oe.prototype.nodeType=y,c(oe,U),le.prototype.nodeType=m,c(le,U),ue.prototype.nodeName="#document-fragment",ue.prototype.nodeType=b,c(ue,U),ce.prototype.nodeType=v,c(ce,U),de.prototype.serializeToString=function(e,t,n){return fe.call(e,t,n)},U.prototype.toString=fe;try{if(Object.defineProperty){function _e(e){switch(e.nodeType){case f:case b:var t=[];for(e=e.firstChild;e;)7!==e.nodeType&&8!==e.nodeType&&t.push(_e(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}}Object.defineProperty(O.prototype,"length",{get:function(){return P(this),this.$$length}}),Object.defineProperty(U.prototype,"textContent",{get:function(){return _e(this)},set:function(e){switch(this.nodeType){case f:case b:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),ve=function(e,t,n){e["$$"+t]=n}}}catch(Te){}t.DocumentType=ae,t.DOMException=D,t.DOMImplementation=F,t.Element=J,t.Node=U,t.NodeList=N,t.XMLSerializer=de},1045:(e,t,n)=>{"use strict";var r=n(2167).freeze;t.XML_ENTITIES=r({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),t.HTML_ENTITIES=r({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),t.entityMap=t.HTML_ENTITIES},3969:(e,t,n)=>{var r=n(1146);r.DOMImplementation,r.XMLSerializer,t.DOMParser=n(6129).DOMParser},6925:(e,t,n)=>{var r=n(2167).NAMESPACE,i=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,a=new RegExp("[\\-\\.0-9"+i.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),s=new RegExp("^"+i.source+a.source+"*(?::"+i.source+a.source+"*)?$");function o(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,o)}function l(){}function u(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function c(e,t,n,i,a,s){function o(e,t,r){n.attributeNames.hasOwnProperty(e)&&s.fatalError("Attribute "+e+" redefined"),n.addValue(e,t.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,a),r)}for(var l,u=++t,c=0;;){var d=e.charAt(u);switch(d){case"=":if(1===c)l=e.slice(t,u),c=3;else{if(2!==c)throw new Error("attribute equal must after attrName");c=3}break;case"'":case'"':if(3===c||1===c){if(1===c&&(s.warning('attribute value must after "="'),l=e.slice(t,u)),t=u+1,!((u=e.indexOf(d,t))>0))throw new Error("attribute value no end '"+d+"' match");o(l,f=e.slice(t,u),t-1),c=5}else{if(4!=c)throw new Error('attribute value must after "="');o(l,f=e.slice(t,u),t),s.warning('attribute "'+l+'" missed start quot('+d+")!!"),t=u+1,c=5}break;case"/":switch(c){case 0:n.setTagName(e.slice(t,u));case 5:case 6:case 7:c=7,n.closed=!0;case 4:case 1:break;case 2:n.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return s.error("unexpected end of input"),0==c&&n.setTagName(e.slice(t,u)),u;case">":switch(c){case 0:n.setTagName(e.slice(t,u));case 5:case 6:case 7:break;case 4:case 1:"/"===(f=e.slice(t,u)).slice(-1)&&(n.closed=!0,f=f.slice(0,-1));case 2:2===c&&(f=l),4==c?(s.warning('attribute "'+f+'" missed quot(")!'),o(l,f,t)):(r.isHTML(i[""])&&f.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+f+'" missed value!! "'+f+'" instead!!'),o(f,f,t));break;case 3:throw new Error("attribute value missed!!")}return u;case"€":d=" ";default:if(d<=" ")switch(c){case 0:n.setTagName(e.slice(t,u)),c=6;break;case 1:l=e.slice(t,u),c=2;break;case 4:var f=e.slice(t,u);s.warning('attribute "'+f+'" missed quot(")!!'),o(l,f,t);case 5:c=6}else switch(c){case 2:n.tagName,r.isHTML(i[""])&&l.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+l+'" missed value!! "'+l+'" instead2!!'),o(l,l,t),t=u,c=1;break;case 5:s.warning('attribute space is required"'+l+'"!!');case 6:c=1,t=u;break;case 3:c=4,t=u;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}u++}}function d(e,t,n){for(var i=e.tagName,a=null,s=e.length;s--;){var o=e[s],l=o.qName,u=o.value;if((h=l.indexOf(":"))>0)var c=o.prefix=l.slice(0,h),d=l.slice(h+1),f="xmlns"===c&&d;else d=l,c=null,f="xmlns"===l&&"";o.localName=d,!1!==f&&(null==a&&(a={},p(n,n={})),n[f]=a[f]=u,o.uri=r.XMLNS,t.startPrefixMapping(f,u))}for(s=e.length;s--;)(c=(o=e[s]).prefix)&&("xml"===c&&(o.uri=r.XML),"xmlns"!==c&&(o.uri=n[c||""]));var h;(h=i.indexOf(":"))>0?(c=e.prefix=i.slice(0,h),d=e.localName=i.slice(h+1)):(c=null,d=e.localName=i);var g=e.uri=n[c||""];if(t.startElement(g,d,i,e),!e.closed)return e.currentNSMap=n,e.localNSMap=a,!0;if(t.endElement(g,d,i),a)for(c in a)Object.prototype.hasOwnProperty.call(a,c)&&t.endPrefixMapping(c)}function f(e,t,n,r,i){if(/^(?:script|textarea)$/i.test(n)){var a=e.indexOf("</"+n+">",t),s=e.substring(t+1,a);if(/[&<]/.test(s))return/^script$/i.test(n)?(i.characters(s,0,s.length),a):(s=s.replace(/&#?\w+;/g,r),i.characters(s,0,s.length),a)}return t+1}function h(e,t,n,r){var i=r[n];return null==i&&((i=e.lastIndexOf("</"+n+">"))<t&&(i=e.lastIndexOf("</"+n)),r[n]=i),i<t}function p(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}function g(e,t,n,r){if("-"===e.charAt(t+2))return"-"===e.charAt(t+3)?(i=e.indexOf("--\x3e",t+4))>t?(n.comment(e,t+4,i-t-4),i+3):(r.error("Unclosed comment"),-1):-1;if("CDATA["==e.substr(t+3,6)){var i=e.indexOf("]]>",t+9);return n.startCDATA(),n.characters(e,t+9,i-t-9),n.endCDATA(),i+3}var a=function(e,t){var n,r=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(i.lastIndex=t,i.exec(e);n=i.exec(e);)if(r.push(n),n[1])return r}(e,t),s=a.length;if(s>1&&/!doctype/i.test(a[0][0])){var o=a[1][0],l=!1,u=!1;s>3&&(/^public$/i.test(a[2][0])?(l=a[3][0],u=s>4&&a[4][0]):/^system$/i.test(a[2][0])&&(u=a[3][0]));var c=a[s-1];return n.startDTD(o,l,u),n.endDTD(),c.index+c[0].length}return-1}function m(e,t,n){var r=e.indexOf("?>",t);if(r){var i=e.substring(t,r).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return i?(i[0].length,n.processingInstruction(i[1],i[2]),r+2):-1}return-1}function y(){this.attributeNames={}}o.prototype=new Error,o.prototype.name=o.name,l.prototype={parse:function(e,t,n){var i=this.domBuilder;i.startDocument(),p(t,t={}),function(e,t,n,i,a){function s(e){var t=e.slice(1,-1);return Object.hasOwnProperty.call(n,t)?n[t]:"#"===t.charAt(0)?function(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}(parseInt(t.substr(1).replace("x","0x"))):(a.error("entity not found:"+e),e)}function l(t){if(t>A){var n=e.substring(A,t).replace(/&#?\w+;/g,s);E&&p(A),i.characters(n,0,t-A),A=t}}function p(t,n){for(;t>=_&&(n=T.exec(e));)v=n.index,_=v+n[0].length,E.lineNumber++;E.columnNumber=t-v+1}for(var v=0,_=0,T=/.*(?:\r\n?|\n)|.*$/g,E=i.locator,b=[{currentNSMap:t}],S={},A=0;;){try{var w=e.indexOf("<",A);if(w<0){if(!e.substr(A).match(/^\s*$/)){var I=i.doc,C=I.createTextNode(e.substr(A));I.appendChild(C),i.currentElement=C}return}switch(w>A&&l(w),e.charAt(w+1)){case"/":var R=e.indexOf(">",w+3),D=e.substring(w+2,R).replace(/[ \t\n\r]+$/g,""),N=b.pop();R<0?(D=e.substring(w+2).replace(/[\s<].*/,""),a.error("end tag name: "+D+" is not complete:"+N.tagName),R=w+1+D.length):D.match(/\s</)&&(D=D.replace(/[\s<].*/,""),a.error("end tag name: "+D+" maybe not complete"),R=w+1+D.length);var O=N.localNSMap,P=N.tagName==D;if(P||N.tagName&&N.tagName.toLowerCase()==D.toLowerCase()){if(i.endElement(N.uri,N.localName,D),O)for(var M in O)Object.prototype.hasOwnProperty.call(O,M)&&i.endPrefixMapping(M);P||a.fatalError("end tag name: "+D+" is not match the current start tagName:"+N.tagName)}else b.push(N);R++;break;case"?":E&&p(w),R=m(e,w,i);break;case"!":E&&p(w),R=g(e,w,i,a);break;default:E&&p(w);var x=new y,L=b[b.length-1].currentNSMap,k=(R=c(e,w,x,L,s,a),x.length);if(!x.closed&&h(e,R,x.tagName,S)&&(x.closed=!0,n.nbsp||a.warning("unclosed xml attribute")),E&&k){for(var F=u(E,{}),U=0;U<k;U++){var B=x[U];p(B.offset),B.locator=u(E,{})}i.locator=F,d(x,i,L)&&b.push(x),i.locator=E}else d(x,i,L)&&b.push(x);r.isHTML(x.uri)&&!x.closed?R=f(e,R,x.tagName,s,i):R++}}catch(e){if(e instanceof o)throw e;a.error("element parse error: "+e),R=-1}R>A?A=R:l(Math.max(w,A)+1)}}(e,t,n,i,this.errorHandler),i.endDocument()}},y.prototype={setTagName:function(e){if(!s.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,n){if(!s.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:n}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},t.XMLReader=l,t.ParseError=o},5176:e=>{self,e.exports=function(){var e={4593:function(e,t){var n,r,i,o,l,u={};n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=function(e){for(var t=0,r=[],i=0|e.length/3;0<i--;){var a=(e[t]<<16)+(e[t+1]<<8)+e[t+2];t+=3,r.push(n.charAt(63&a>>18)),r.push(n.charAt(63&a>>12)),r.push(n.charAt(63&a>>6)),r.push(n.charAt(63&a))}return 2==e.length-t?(a=(e[t]<<16)+(e[t+1]<<8),r.push(n.charAt(63&a>>18)),r.push(n.charAt(63&a>>12)),r.push(n.charAt(63&a>>6)),r.push("=")):1==e.length-t&&(a=e[t]<<16,r.push(n.charAt(63&a>>18)),r.push(n.charAt(63&a>>12)),r.push("==")),r.join("")},i=function(){for(var e=[],t=0;t<64;++t)e[n.charCodeAt(t)]=t;return e["=".charCodeAt(0)]=0,e}(),o=function(e){for(var t=0,n=[],r=0|e.length/4;0<r--;){var a=(i[e.charCodeAt(t)]<<18)+(i[e.charCodeAt(t+1)]<<12)+(i[e.charCodeAt(t+2)]<<6)+i[e.charCodeAt(t+3)];n.push(255&a>>16),n.push(255&a>>8),n.push(255&a),t+=4}return n&&("="==e.charAt(t-2)?(n.pop(),n.pop()):"="==e.charAt(t-1)&&n.pop()),n},l={encode:function(e){for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t},decode:function(e){for(var t=0;t<s.length;++t)a[t]=String.fromCharCode(a[t]);return a.join("")}},u.decodeArray=function(e){var t=o(e);return new Uint8Array(t)},u.encodeASCII=function(e){var t=l.encode(e);return r(t)},u.decodeASCII=function(e){var t=o(e);return l.decode(t)},u.encode=function(e){var t=function(e){for(var t=[],n=0;n<e.length;++n){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?(t.push(192|r>>6),t.push(128|63&r)):r<65536?(t.push(224|r>>12),t.push(128|63&r>>6),t.push(128|63&r)):(t.push(240|r>>18),t.push(128|63&r>>12),t.push(128|63&r>>6),t.push(128|63&r))}return t}(e);return r(t)},u.decode=function(e){return function(e){for(var t=[],n=0;n<e.length;){var r=e[n++];r<128||(r<224?(r=(31&r)<<6,r|=63&e[n++]):r<240?(r=(15&r)<<12,r|=(63&e[n++])<<6,r|=63&e[n++]):(r=(7&r)<<18,r|=(63&e[n++])<<12,r|=(63&e[n++])<<6,r|=63&e[n++])),t.push(String.fromCharCode(r))}return t.join("")}(o(e))},t.decode=u.decode,t.decodeArray=u.decodeArray,t.encode=u.encode,t.encodeASCII=u.encodeASCII},452:function(e,t){!function(e){"use strict";var t={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},n=function(e){var n=e;return t.hasOwnProperty(e)&&(n=t[e]),String.fromCharCode(n)},r=15,i=32,a={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},s={17:2,18:4,21:6,22:8,23:10,19:13,20:15},o={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},l={25:2,26:4,29:6,30:8,31:10,27:13,28:15},u=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],c={verboseFilter:{DATA:3,DEBUG:3,INFO:2,WARNING:2,TEXT:1,ERROR:0},time:null,verboseLevel:0,setTime:function(e){this.time=e},log:function(e,t){var n=this.verboseFilter[e];this.verboseLevel>=n&&console.log(this.time+" ["+e+"] "+t)}},d=function(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n].toString(16));return t},f=function(e,t,n,r,i){this.foreground=e||"white",this.underline=t||!1,this.italics=n||!1,this.background=r||"black",this.flash=i||!1};f.prototype={reset:function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},setStyles:function(e){for(var t=["foreground","underline","italics","background","flash"],n=0;n<t.length;n++){var r=t[n];e.hasOwnProperty(r)&&(this[r]=e[r])}},isDefault:function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash},equals:function(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash},copy:function(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash},toString:function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}};var h=function(e,t,n,r,i,a){this.uchar=e||" ",this.penState=new f(t,n,r,i,a)};h.prototype={reset:function(){this.uchar=" ",this.penState.reset()},setChar:function(e,t){this.uchar=e,this.penState.copy(t)},setPenState:function(e){this.penState.copy(e)},equals:function(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)},copy:function(e){this.uchar=e.uchar,this.penState.copy(e.penState)},isEmpty:function(){return" "===this.uchar&&this.penState.isDefault()}};var p=function(){this.chars=[];for(var e=0;e<i;e++)this.chars.push(new h);this.pos=0,this.currPenState=new f};p.prototype={equals:function(e){for(var t=!0,n=0;n<i;n++)if(!this.chars[n].equals(e.chars[n])){t=!1;break}return t},copy:function(e){for(var t=0;t<i;t++)this.chars[t].copy(e.chars[t])},isEmpty:function(){for(var e=!0,t=0;t<i;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e},setCursor:function(e){this.pos!==e&&(this.pos=e),this.pos<0?(c.log("ERROR","Negative cursor position "+this.pos),this.pos=0):this.pos>i&&(c.log("ERROR","Too large cursor position "+this.pos),this.pos=i)},moveCursor:function(e){var t=this.pos+e;if(e>1)for(var n=this.pos+1;n<t+1;n++)this.chars[n].setPenState(this.currPenState);this.setCursor(t)},backSpace:function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},insertChar:function(e){e>=144&&this.backSpace();var t=n(e);this.pos>=i?c.log("ERROR","Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))},clearFromPos:function(e){var t;for(t=e;t<i;t++)this.chars[t].reset()},clear:function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},clearToEndOfRow:function(){this.clearFromPos(this.pos)},getTextString:function(){for(var e=[],t=!0,n=0;n<i;n++){var r=this.chars[n].uchar;" "!==r&&(t=!1),e.push(r)}return t?"":e.join("")},setPenStyles:function(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}};var g=function(){this.rows=[];for(var e=0;e<r;e++)this.rows.push(new p);this.currRow=14,this.nrRollUpRows=null,this.reset()};g.prototype={reset:function(){for(var e=0;e<r;e++)this.rows[e].clear();this.currRow=14},equals:function(e){for(var t=!0,n=0;n<r;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t},copy:function(e){for(var t=0;t<r;t++)this.rows[t].copy(e.rows[t])},isEmpty:function(){for(var e=!0,t=0;t<r;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e},backSpace:function(){this.rows[this.currRow].backSpace()},clearToEndOfRow:function(){this.rows[this.currRow].clearToEndOfRow()},insertChar:function(e){this.rows[this.currRow].insertChar(e)},setPen:function(e){this.rows[this.currRow].setPenStyles(e)},moveCursor:function(e){this.rows[this.currRow].moveCursor(e)},setCursor:function(e){c.log("INFO","setCursor: "+e),this.rows[this.currRow].setCursor(e)},setPAC:function(e){c.log("INFO","pacData = "+JSON.stringify(e));var t=e.row-1;this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.currRow=t;var n=this.rows[this.currRow];if(null!==e.indent){var r=e.indent,i=Math.max(r-1,0);n.setCursor(e.indent),e.color=n.chars[i].penState.foreground}var a={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(a)},setBkgData:function(e){c.log("INFO","bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)},setRollUpRows:function(e){this.nrRollUpRows=e},rollUp:function(){if(null!==this.nrRollUpRows){c.log("TEXT",this.getDisplayText());var e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),c.log("INFO","Rolling up")}else c.log("DEBUG","roll_up but nrRollUpRows not set yet")},getDisplayText:function(e){e=e||!1;for(var t=[],n="",i=-1,a=0;a<r;a++){var s=this.rows[a].getTextString();s&&(i=a+1,e?t.push("Row "+i+': "'+s+'"'):t.push(s.trim()))}return t.length>0&&(n=e?"["+t.join(" | ")+"]":t.join("\n")),n},getTextAndFormat:function(){return this.rows}};var m=function(e,t){this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new g,this.nonDisplayedMemory=new g,this.lastOutputScreen=new g,this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null};m.prototype={modes:["MODE_ROLL-UP","MODE_POP-ON","MODE_PAINT-ON","MODE_TEXT"],reset:function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null},getHandler:function(){return this.outputFilter},setHandler:function(e){this.outputFilter=e},setPAC:function(e){this.writeScreen.setPAC(e)},setBkgData:function(e){this.writeScreen.setBkgData(e)},setMode:function(e){e!==this.mode&&(this.mode=e,c.log("INFO","MODE="+e),"MODE_POP-ON"==this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)},insertChars:function(e){for(var t=0;t<e.length;t++)this.writeScreen.insertChar(e[t]);var n=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";c.log("INFO",n+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(c.log("TEXT","DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},cc_RCL:function(){c.log("INFO","RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},cc_BS:function(){c.log("INFO","BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},cc_AOF:function(){},cc_AON:function(){},cc_DER:function(){c.log("INFO","DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},cc_RU:function(e){c.log("INFO","RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)},cc_FON:function(){c.log("INFO","FON - Flash On"),this.writeScreen.setPen({flash:!0})},cc_RDC:function(){c.log("INFO","RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},cc_TR:function(){c.log("INFO","TR"),this.setMode("MODE_TEXT")},cc_RTD:function(){c.log("INFO","RTD"),this.setMode("MODE_TEXT")},cc_EDM:function(){c.log("INFO","EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate()},cc_CR:function(){c.log("CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate()},cc_ENM:function(){c.log("INFO","ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},cc_EOC:function(){if(c.log("INFO","EOC - End Of Caption"),"MODE_POP-ON"===this.mode){var e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,c.log("TEXT","DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate()},cc_TO:function(e){c.log("INFO","TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)},cc_MIDROW:function(e){var t={flash:!1};if(t.underline=e%2==1,t.italics=e>=46,t.italics)t.foreground="white";else{var n=Math.floor(e/2)-16;t.foreground=["white","green","blue","cyan","red","yellow","magenta"][n]}c.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},outputDataUpdate:function(){var e=c.time;null!==e&&this.outputFilter&&(this.outputFilter.updateData&&this.outputFilter.updateData(e,this.displayedMemory),null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))},cueSplitAtTime:function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}};var y=function(e,t,n){this.field=e||1,this.outputs=[t,n],this.channels=[new m(1,t),new m(2,n)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.bufferedData=[],this.startTime=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}};y.prototype={getHandler:function(e){return this.channels[e].getHandler()},setHandler:function(e,t){this.channels[e].setHandler(t)},addData:function(e,t){var n,r,i,a=!1;this.lastTime=e,c.setTime(e);for(var s=0;s<t.length;s+=2)r=127&t[s],i=127&t[s+1],r>=16&&r<=31&&r===this.lastCmdA&&i===this.lastCmdB?(this.lastCmdA=null,this.lastCmdB=null,c.log("DEBUG","Repeated command ("+d([r,i])+") is dropped")):0!==r||0!==i?(c.log("DATA","["+d([t[s],t[s+1]])+"] -> ("+d([r,i])+")"),(n=this.parseCmd(r,i))||(n=this.parseMidrow(r,i)),n||(n=this.parsePAC(r,i)),n||(n=this.parseBackgroundAttributes(r,i)),n||(a=this.parseChars(r,i))&&(this.currChNr&&this.currChNr>=0?this.channels[this.currChNr-1].insertChars(a):c.log("WARNING","No channel found yet. TEXT-MODE?")),n?this.dataCounters.cmd+=2:a?this.dataCounters.char+=2:(this.dataCounters.other+=2,c.log("WARNING","Couldn't parse cleaned data "+d([r,i])+" orig: "+d([t[s],t[s+1]])))):this.dataCounters.padding+=2},parseCmd:function(e,t){var n;if(!((20===e||21===e||28===e||29===e)&&32<=t&&t<=47||(23===e||31===e)&&33<=t&&t<=35))return!1;n=20===e||21===e||23===e?1:2;var r=this.channels[n-1];return 20===e||21===e||28===e||29===e?32===t?r.cc_RCL():33===t?r.cc_BS():34===t?r.cc_AOF():35===t?r.cc_AON():36===t?r.cc_DER():37===t?r.cc_RU(2):38===t?r.cc_RU(3):39===t?r.cc_RU(4):40===t?r.cc_FON():41===t?r.cc_RDC():42===t?r.cc_TR():43===t?r.cc_RTD():44===t?r.cc_EDM():45===t?r.cc_CR():46===t?r.cc_ENM():47===t&&r.cc_EOC():r.cc_TO(t-32),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=n,!0},parseMidrow:function(e,t){var n=null;if((17===e||25===e)&&32<=t&&t<=47){if((n=17===e?1:2)!==this.currChNr)return c.log("ERROR","Mismatch channel in midrow parsing"),!1;var r=this.channels[n-1];return r.insertChars([32]),r.cc_MIDROW(t),c.log("DEBUG","MIDROW ("+d([e,t])+")"),this.lastCmdA=e,this.lastCmdB=t,!0}return!1},parsePAC:function(e,t){var n,r;if(!((17<=e&&e<=23||25<=e&&e<=31)&&64<=t&&t<=127||(16===e||24===e)&&64<=t&&t<=95))return!1;n=e<=23?1:2,r=64<=t&&t<=95?1===n?a[e]:o[e]:1===n?s[e]:l[e];var i=this.interpretPAC(r,t);return this.channels[n-1].setPAC(i),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=n,!0},interpretPAC:function(e,t){var n,r={color:null,italics:!1,indent:null,underline:!1,row:e};return n=t>95?t-96:t-64,r.underline=1==(1&n),n<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(r.italics=!0,r.color="white"):r.indent=4*Math.floor((n-16)/2),r},parseChars:function(e,t){var r,i=null,a=null,s=null;if(e>=25?(i=2,s=e-8):(i=1,s=e),17<=s&&s<=19?(r=17===s?t+80:18===s?t+112:t+144,c.log("INFO","Special char '"+n(r)+"' in channel "+i),a=[r],this.lastCmdA=e,this.lastCmdB=t):32<=e&&e<=127&&(a=0===t?[e]:[e,t],this.lastCmdA=null,this.lastCmdB=null),a){var o=d(a);c.log("DEBUG","Char codes =  "+o.join(","))}return a},parseBackgroundAttributes:function(e,t){var n,r,i;return((16===e||24===e)&&32<=t&&t<=47||(23===e||31===e)&&45<=t&&t<=47)&&(n={},16===e||24===e?(r=Math.floor((t-32)/2),n.background=u[r],t%2==1&&(n.background=n.background+"_semi")):45===t?n.background="transparent":(n.foreground="black",47===t&&(n.underline=!0)),i=e<24?1:2,this.channels[i-1].setBkgData(n),this.lastCmdA=e,this.lastCmdB=t,!0)},reset:function(){for(var e=0;e<this.channels.length;e++)this.channels[e]&&this.channels[e].reset();this.lastCmdA=null,this.lastCmdB=null},cueSplitAtTime:function(e){for(var t=0;t<this.channels.length;t++)this.channels[t]&&this.channels[t].cueSplitAtTime(e)}},e.logger=c,e.PenState=f,e.CaptionScreen=g,e.Cea608Parser=y,e.findCea608Nalus=function(e,t,n){for(var r=0,i=t,a=[],s=function(e,t,n,r){if(4!==e||t<8)return null;var i=n.getUint8(r),a=n.getUint16(r+1),s=n.getUint32(r+3),o=n.getUint8(r+7);return 181==i&&49==a&&1195456820==s&&3==o};i<t+n;){if(r=e.getUint32(i),6==(31&e.getUint8(i+4)))for(var o=i+5,l=-1;o<i+4+r-1;){l=0;for(var u=255;255===u;)l+=u=e.getUint8(o),o++;var c=0;for(u=255;255===u;)c+=u=e.getUint8(o),o++;s(l,c,e,o)&&a.push([o,c]),o+=c}i+=r+4}return a},e.extractCea608DataFromRange=function(e,t){var n=t[0],r=[[],[]];n+=8;var i=31&e.getUint8(n);n+=2;for(var a=0;a<i;a++){var s=e.getUint8(n),o=4&s,l=3&s;n++;var u=e.getUint8(n);n++;var c=e.getUint8(n);n++,o&&(127&u)+(127&c)!=0&&(0===l?(r[0].push(u),r[0].push(c)):1===l&&(r[1].push(u),r[1].push(c)))}return r}}(t)},8416:function(e,t,n){"use strict";var r=n(1139),i=n(5448),a=n(6398),s=n(2032),o=(n(5530),"undefined"!=typeof window&&window||n.g),l=o.dashjs;l||(l=o.dashjs={}),l.MediaPlayer=r.Z,l.FactoryMaker=i.Z,l.Debug=a.Z,l.Version=(0,s.e)()},6398:function(e,t,n){"use strict";var r=n(5595),i=n(8512),a=n(5448),s=1,o=2,l=3,u=4,c=5;function d(e){e=e||{};var t,n,a,d,f=this.context,h=(0,r.Z)(f).getInstance(),p=e.settings,g=[];function m(e){return e&&e.bind?e.bind(window.console):window.console.log.bind(window.console)}function y(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[s,this].concat(t))}function v(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[o,this].concat(t))}function _(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[l,this].concat(t))}function T(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[u,this].concat(t))}function E(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[c,this].concat(t))}function b(e,t){var r="",s=null;n&&(s=(new Date).getTime(),r+="["+(s-d)+"]"),a&&t&&t.getClassName&&(r+="["+t.getClassName()+"]",t.getType&&(r+="["+t.getType()+"]")),r.length>0&&(r+=" ");for(var o=arguments.length,l=new Array(o>2?o-2:0),u=2;u<o;u++)l[u-2]=arguments[u];Array.apply(null,l).forEach((function(e){r+=e+" "})),g[e]&&p&&p.get().debug.logLevel>=e&&g[e](r),p&&p.get().debug.dispatchEvent&&h.trigger(i.Z.LOG,{message:r,level:e})}return t={getLogger:function(e){return{fatal:y.bind(e),error:v.bind(e),warn:_.bind(e),info:T.bind(e),debug:E.bind(e)}},setLogTimestampVisible:function(e){n=e},setCalleeNameVisible:function(e){a=e}},n=!0,a=!0,d=(new Date).getTime(),"undefined"!=typeof window&&window.console&&(g[s]=m(window.console.error),g[o]=m(window.console.error),g[l]=m(window.console.warn),g[u]=m(window.console.info),g[c]=m(window.console.debug)),t}d.__dashjs_factory_name="Debug";var f=a.Z.getSingletonFactory(d);f.LOG_LEVEL_NONE=0,f.LOG_LEVEL_FATAL=s,f.LOG_LEVEL_ERROR=o,f.LOG_LEVEL_WARNING=l,f.LOG_LEVEL_INFO=u,f.LOG_LEVEL_DEBUG=c,a.Z.updateSingletonFactory(d.__dashjs_factory_name,f),t.Z=f},5595:function(e,t,n){"use strict";var r=n(5448),i=n(8825);function a(){var e={};function t(t,n,r){var i=-1;return e[t]?(e[t].some((function(e,t){if(e&&e.callback===n&&(!r||r===e.scope))return i=t,!0})),i):i}var n={on:function(n,r,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!n)throw new Error("event type cannot be null or undefined");if(!r||"function"!=typeof r)throw new Error("listener must be a function: "+r);var s=a.priority||0;if(!(t(n,r,i)>=0)){e[n]=e[n]||[];var o={callback:r,scope:i,priority:s};i&&i.getStreamId&&(o.streamId=i.getStreamId()),i&&i.getType&&(o.mediaType=i.getType()),a&&a.mode&&(o.mode=a.mode);var l=e[n].some((function(t,r){if(t&&s>t.priority)return e[n].splice(r,0,o),!0}));l||e[n].push(o)}},off:function(n,r,i){if(n&&r&&e[n]){var a=t(n,r,i);a<0||(e[n][a]=null)}},trigger:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t&&e[t]){if((n=n||{}).hasOwnProperty("type"))throw new Error("'type' is a reserved word for event dispatching");n.type=t,r.streamId&&(n.streamId=r.streamId),r.mediaType&&(n.mediaType=r.mediaType),e[t].filter((function(e){return!(!e||r.streamId&&e.streamId&&e.streamId!==r.streamId||r.mediaType&&e.mediaType&&e.mediaType!==r.mediaType||r.mode&&e.mode&&e.mode!==r.mode||!e.mode&&r.mode&&r.mode===i.Z.EVENT_MODE_ON_RECEIVE)})).forEach((function(e){return e&&e.callback.call(e.scope,n)}))}},reset:function(){e={}}};return n}a.__dashjs_factory_name="EventBus";var s=r.Z.getSingletonFactory(a);s.EVENT_PRIORITY_LOW=0,s.EVENT_PRIORITY_HIGH=5e3,r.Z.updateSingletonFactory(a.__dashjs_factory_name,s),t.Z=s},5448:function(e,t){"use strict";var n=function(){var e,t=[],n={},r={};function i(e,n){for(var r in t){var i=t[r];if(i.context===e&&i.name===n)return i.instance}return null}function a(e,t){return t[e]}function s(e,t,n){e in n&&(n[e]=t)}function o(t,n,r){var i,a=t.__dashjs_factory_name,s=n[a];if(s){var o=s.instance;if(!s.override)return o.apply({context:n,factory:e},r);for(var l in i=t.apply({context:n},r),o=o.apply({context:n,factory:e,parent:i},r))i.hasOwnProperty(l)&&(i[l]=o[l])}else i=t.apply({context:n},r);return i.getClassName=function(){return a},i}return e={extend:function(e,t,n,r){!r[e]&&t&&(r[e]={instance:t,override:n})},getSingletonInstance:i,setSingletonInstance:function(e,n,r){for(var i in t){var a=t[i];if(a.context===e&&a.name===n)return void(t[i].instance=r)}t.push({name:n,context:e,instance:r})},deleteSingletonInstances:function(e){t=t.filter((function(t){return t.context!==e}))},getSingletonFactory:function(e){var r=a(e.__dashjs_factory_name,n);return r||(r=function(n){var r;return void 0===n&&(n={}),{getInstance:function(){return r||(r=i(n,e.__dashjs_factory_name)),r||(r=o(e,n,arguments),t.push({name:e.__dashjs_factory_name,context:n,instance:r})),r}}},n[e.__dashjs_factory_name]=r),r},getSingletonFactoryByName:function(e){return a(e,n)},updateSingletonFactory:function(e,t){s(e,t,n)},getClassFactory:function(e){var t=a(e.__dashjs_factory_name,r);return t||(t=function(t){return void 0===t&&(t={}),{create:function(){return o(e,t,arguments)}}},r[e.__dashjs_factory_name]=t),t},getClassFactoryByName:function(e){return a(e,r)},updateClassFactory:function(e,t){s(e,t,r)}},e}();t.Z=n},1264:function(e,t,n){"use strict";var r=n(5448),i=n(703),a=n(6398),s=n(3393),o=n(7855),l=n(5595),u=n(8512);function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(){var e,t,n=this.context,r=(0,l.Z)(n).getInstance(),f={"streaming.delay.liveDelay":u.Z.SETTING_UPDATED_LIVE_DELAY,"streaming.delay.liveDelayFragmentCount":u.Z.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT,"streaming.liveCatchup.enabled":u.Z.SETTING_UPDATED_CATCHUP_ENABLED,"streaming.liveCatchup.playbackRate.min":u.Z.SETTING_UPDATED_PLAYBACK_RATE_MIN,"streaming.liveCatchup.playbackRate.max":u.Z.SETTING_UPDATED_PLAYBACK_RATE_MAX},h={debug:{logLevel:a.Z.LOG_LEVEL_WARNING,dispatchEvent:!1},streaming:{abandonLoadTimeout:1e4,wallclockTimeUpdateInterval:100,manifestUpdateRetryInterval:100,liveUpdateTimeThresholdInMilliseconds:0,cacheInitSegments:!1,applyServiceDescription:!0,applyProducerReferenceTime:!0,applyContentSteering:!0,eventControllerRefreshDelay:100,enableManifestDurationMismatchFix:!0,parseInbandPrft:!1,enableManifestTimescaleMismatchFix:!1,capabilities:{filterUnsupportedEssentialProperties:!0,useMediaCapabilitiesApi:!1},timeShiftBuffer:{calcFromSegmentTimeline:!1,fallbackToSegmentTimeline:!0},metrics:{maxListDepth:100},delay:{liveDelayFragmentCount:NaN,liveDelay:NaN,useSuggestedPresentationDelay:!0},protection:{keepProtectionMediaKeys:!1,ignoreEmeEncryptedEvent:!1,detectPlayreadyMessageFormat:!0},buffer:{enableSeekDecorrelationFix:!1,fastSwitchEnabled:!0,flushBufferAtTrackSwitch:!1,reuseExistingSourceBuffers:!0,bufferPruningInterval:10,bufferToKeep:20,bufferTimeAtTopQuality:30,bufferTimeAtTopQualityLongForm:60,initialBufferLevel:NaN,stableBufferTime:12,longFormContentDurationThreshold:600,stallThreshold:.3,useAppendWindow:!0,setStallState:!0,avoidCurrentTimeRangePruning:!1,useChangeTypeForTrackSwitch:!0,mediaSourceDurationInfinity:!0,resetSourceBuffersForTrackSwitch:!1},gaps:{jumpGaps:!0,jumpLargeGaps:!0,smallGapLimit:1.5,threshold:.3,enableSeekFix:!0,enableStallFix:!1,stallSeek:.1},utcSynchronization:{enabled:!0,useManifestDateHeaderTimeSource:!0,backgroundAttempts:2,timeBetweenSyncAttempts:30,maximumTimeBetweenSyncAttempts:600,minimumTimeBetweenSyncAttempts:2,timeBetweenSyncAttemptsAdjustmentFactor:2,maximumAllowedDrift:100,enableBackgroundSyncAfterSegmentDownloadError:!0,defaultTimingSource:{scheme:"urn:mpeg:dash:utc:http-xsdate:2014",value:"https://time.akamai.com/?iso&ms"}},scheduling:{defaultTimeout:500,lowLatencyTimeout:0,scheduleWhilePaused:!0},text:{defaultEnabled:!0,dispatchForManualRendering:!1,extendSegmentedCues:!0,imsc:{displayForcedOnlyMode:!1,enableRollUp:!0},webvtt:{customRenderingEnabled:!1}},liveCatchup:{maxDrift:NaN,playbackRate:{min:NaN,max:NaN},playbackBufferMin:.5,enabled:null,mode:s.Z.LIVE_CATCHUP_MODE_DEFAULT},lastBitrateCachingInfo:{enabled:!0,ttl:36e4},lastMediaSettingsCachingInfo:{enabled:!0,ttl:36e4},saveLastMediaSettingsForCurrentStreamingSession:!0,cacheLoadThresholds:{video:50,audio:5},trackSwitchMode:{audio:s.Z.TRACK_SWITCH_MODE_ALWAYS_REPLACE,video:s.Z.TRACK_SWITCH_MODE_NEVER_REPLACE},selectionModeForInitialTrack:s.Z.TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY,fragmentRequestTimeout:2e4,fragmentRequestProgressTimeout:-1,manifestRequestTimeout:1e4,retryIntervals:(e={},d(e,o.w.MPD_TYPE,500),d(e,o.w.XLINK_EXPANSION_TYPE,500),d(e,o.w.MEDIA_SEGMENT_TYPE,1e3),d(e,o.w.INIT_SEGMENT_TYPE,1e3),d(e,o.w.BITSTREAM_SWITCHING_SEGMENT_TYPE,1e3),d(e,o.w.INDEX_SEGMENT_TYPE,1e3),d(e,o.w.MSS_FRAGMENT_INFO_SEGMENT_TYPE,1e3),d(e,o.w.LICENSE,1e3),d(e,o.w.OTHER_TYPE,1e3),d(e,"lowLatencyReductionFactor",10),e),retryAttempts:(t={},d(t,o.w.MPD_TYPE,3),d(t,o.w.XLINK_EXPANSION_TYPE,1),d(t,o.w.MEDIA_SEGMENT_TYPE,3),d(t,o.w.INIT_SEGMENT_TYPE,3),d(t,o.w.BITSTREAM_SWITCHING_SEGMENT_TYPE,3),d(t,o.w.INDEX_SEGMENT_TYPE,3),d(t,o.w.MSS_FRAGMENT_INFO_SEGMENT_TYPE,3),d(t,o.w.LICENSE,3),d(t,o.w.OTHER_TYPE,3),d(t,"lowLatencyMultiplyFactor",5),t),abr:{movingAverageMethod:s.Z.MOVING_AVERAGE_SLIDING_WINDOW,ABRStrategy:s.Z.ABR_STRATEGY_DYNAMIC,additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0,abandonRequestsRule:!0},abrRulesParameters:{abandonRequestsRule:{graceTimeThreshold:500,abandonMultiplier:1.8,minLengthToAverage:5}},bandwidthSafetyFactor:.9,useDefaultABRRules:!0,useDeadTimeLatency:!0,limitBitrateByPortal:!1,usePixelRatioInLimitBitrateByPortal:!1,maxBitrate:{audio:-1,video:-1},minBitrate:{audio:-1,video:-1},maxRepresentationRatio:{audio:1,video:1},initialBitrate:{audio:-1,video:-1},initialRepresentationRatio:{audio:-1,video:-1},autoSwitchBitrate:{audio:!0,video:!0},fetchThroughputCalculationMode:s.Z.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING},cmcd:{enabled:!1,sid:null,cid:null,rtp:null,rtpSafetyFactor:5,mode:s.Z.CMCD_MODE_QUERY,enabledKeys:["br","d","ot","tb","bl","dl","mtp","nor","nrr","su","bs","rtp","cid","pr","sf","sid","st","v"]},cmsd:{enabled:!1,abr:{applyMb:!1,etpWeightRatio:0}}},errors:{recoverAttempts:{mediaErrorDecode:5}}},p=i.Z.clone(h);function g(e,t,n){for(var a in e)e.hasOwnProperty(a)&&(t.hasOwnProperty(a)?"object"!==c(e[a])||e[a]instanceof Array||null===e[a]?(t[a]=i.Z.clone(e[a]),f[n+a]&&r.trigger(f[n+a])):g(e[a],t[a],n.slice()+a+"."):console.error("Settings parameter "+n+a+" is not supported"))}return{get:function(){return p},update:function(e){"object"===c(e)&&g(e,p,"")},reset:function(){p=i.Z.clone(h)}}}f.__dashjs_factory_name="Settings";var h=r.Z.getSingletonFactory(f);t.Z=h},703:function(e,t,n){"use strict";var r=n(3875),i=n.n(r),a=n(1067);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t;return t=[{key:"mixin",value:function(t,n,r){var i,a={};if(t)for(var o in n)n.hasOwnProperty(o)&&(i=n[o],o in t&&(t[o]===i||o in a&&a[o]===i)||("object"===s(t[o])&&null!==t[o]?t[o]=e.mixin(t[o],i,r):t[o]=r(i)));return t}},{key:"clone",value:function(t){if(!t||"object"!==s(t))return t;var n;if(t instanceof Array){n=[];for(var r=0,i=t.length;r<i;++r)r in t&&n.push(e.clone(t[r]))}else n={};return e.mixin(n,t,e.clone)}},{key:"addAditionalQueryParameterToUrl",value:function(e,t){try{if(!t||0===t.length)return e;var n=new URL(e);return t.forEach((function(e){e.key&&e.value&&n.searchParams.set(e.key,e.value)})),n.href}catch(t){return e}}},{key:"parseHttpHeaders",value:function(e){var t={};if(!e)return t;for(var n=e.trim().split("\r\n"),r=0,i=n.length;r<i;r++){var a=n[r],s=a.indexOf(": ");s>0&&(t[a.substring(0,s)]=a.substring(s+2))}return t}},{key:"generateUuid",value:function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?n:3&n|8).toString(16)}))}},{key:"generateHashCode",value:function(e){var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t}},{key:"getRelativeUrl",value:function(e,t){try{var n=new URL(e),r=new URL(t);if(n.protocol=r.protocol,n.origin!==r.origin)return t;var a=i().relative(n.pathname.substr(0,n.pathname.lastIndexOf("/")),r.pathname.substr(0,r.pathname.lastIndexOf("/"))),s=0===a.length?1:0;return a+=r.pathname.substr(r.pathname.lastIndexOf("/")+s,r.pathname.length-1),r.pathname.length<a.length?r.pathname:a}catch(e){return t}}},{key:"parseUserAgent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;try{var t=null===e&&"undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"";return(0,a.UAParser)(t)}catch(e){return{}}}},{key:"stringHasProtocol",value:function(e){return/(http(s?)):\/\//i.test(e)}}],t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e,t),e}();t.Z=o},2032:function(e,t,n){"use strict";function r(){return"4.7.4"}n.d(t,{e:function(){return r}})},2230:function(e,t){"use strict";var n=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t;return(t=[{key:"extend",value:function(e,t){if(e){var n=!!t&&t.override,r=!!t&&t.publicOnly;for(var i in e)!e.hasOwnProperty(i)||this[i]&&!n||r&&-1===e[i].indexOf("public_")||(this[i]=e[i])}}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();t.Z=n},4351:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}var o=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=s(t);if(n){var i=s(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return a(this,e)});function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=r.call(this)).ATTEMPT_BACKGROUND_SYNC="attemptBackgroundSync",e.BUFFERING_COMPLETED="bufferingCompleted",e.BUFFER_CLEARED="bufferCleared",e.BYTES_APPENDED_END_FRAGMENT="bytesAppendedEndFragment",e.BUFFER_REPLACEMENT_STARTED="bufferReplacementStarted",e.CHECK_FOR_EXISTENCE_COMPLETED="checkForExistenceCompleted",e.CMSD_STATIC_HEADER="cmsdStaticHeader",e.CURRENT_TRACK_CHANGED="currentTrackChanged",e.DATA_UPDATE_COMPLETED="dataUpdateCompleted",e.INBAND_EVENTS="inbandEvents",e.INITIAL_STREAM_SWITCH="initialStreamSwitch",e.INIT_FRAGMENT_LOADED="initFragmentLoaded",e.INIT_FRAGMENT_NEEDED="initFragmentNeeded",e.INTERNAL_MANIFEST_LOADED="internalManifestLoaded",e.ORIGINAL_MANIFEST_LOADED="originalManifestLoaded",e.LOADING_COMPLETED="loadingCompleted",e.LOADING_PROGRESS="loadingProgress",e.LOADING_DATA_PROGRESS="loadingDataProgress",e.LOADING_ABANDONED="loadingAborted",e.MANIFEST_UPDATED="manifestUpdated",e.MEDIA_FRAGMENT_LOADED="mediaFragmentLoaded",e.MEDIA_FRAGMENT_NEEDED="mediaFragmentNeeded",e.QUOTA_EXCEEDED="quotaExceeded",e.SEGMENT_LOCATION_BLACKLIST_ADD="segmentLocationBlacklistAdd",e.SEGMENT_LOCATION_BLACKLIST_CHANGED="segmentLocationBlacklistChanged",e.SERVICE_LOCATION_BASE_URL_BLACKLIST_ADD="serviceLocationBlacklistAdd",e.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED="serviceLocationBlacklistChanged",e.SERVICE_LOCATION_LOCATION_BLACKLIST_ADD="serviceLocationLocationBlacklistAdd",e.SERVICE_LOCATION_LOCATION_BLACKLIST_CHANGED="serviceLocationLocationBlacklistChanged",e.SET_FRAGMENTED_TEXT_AFTER_DISABLED="setFragmentedTextAfterDisabled",e.SET_NON_FRAGMENTED_TEXT="setNonFragmentedText",e.SOURCE_BUFFER_ERROR="sourceBufferError",e.STREAMS_COMPOSED="streamsComposed",e.STREAM_BUFFERING_COMPLETED="streamBufferingCompleted",e.STREAM_REQUESTING_COMPLETED="streamRequestingCompleted",e.TEXT_TRACKS_QUEUE_INITIALIZED="textTracksQueueInitialized",e.TIME_SYNCHRONIZATION_COMPLETED="timeSynchronizationComplete",e.UPDATE_TIME_SYNC_OFFSET="updateTimeSyncOffset",e.URL_RESOLUTION_FAILED="urlResolutionFailed",e.VIDEO_CHUNK_RECEIVED="videoChunkReceived",e.WALLCLOCK_TIME_UPDATED="wallclockTimeUpdated",e.XLINK_ELEMENT_LOADED="xlinkElementLoaded",e.XLINK_READY="xlinkReady",e.SEEK_TARGET="seekTarget",e.SETTING_UPDATED_LIVE_DELAY="settingUpdatedLiveDelay",e.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT="settingUpdatedLiveDelayFragmentCount",e.SETTING_UPDATED_CATCHUP_ENABLED="settingUpdatedCatchupEnabled",e.SETTING_UPDATED_PLAYBACK_RATE_MIN="settingUpdatedPlaybackRateMin",e.SETTING_UPDATED_PLAYBACK_RATE_MAX="settingUpdatedPlaybackRateMax",e}return o}(n(8342).Z);t.Z=o},8512:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}var o=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=s(t);if(n){var i=s(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return a(this,e)});function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),r.apply(this,arguments)}return o}(n(4351).Z),l=new o;t.Z=l},8342:function(e,t){"use strict";var n=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t;return(t=[{key:"extend",value:function(e,t){if(e){var n=!!t&&t.override,r=!!t&&t.publicOnly;for(var i in e)!e.hasOwnProperty(i)||this[i]&&!n||r&&-1===e[i].indexOf("public_")||(this[i]=e[i])}}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();t.Z=n},9326:function(e,t,n){"use strict";var r=n(3186),i=n(7855),a=n(5448),s=n(8825),o=n(7387),l=n(1553);function u(e){var t,n,a,u,c,d=(e=e||{}).eventBus,f=e.debug,h=e.urlUtils,p=e.type,g=e.streamInfo,m=e.segmentsController,y=e.timelineConverter,v=e.baseURLController;function _(){return p}function T(){a=null}function E(e,t,n){var r,i,a=v.resolve(n.path),s={};return a&&t!==a.url&&h.isRelative(t)?(r=a.url,i=a.serviceLocation,s=a.queryParams,t&&(r=h.resolve(t,r))):r=t,!h.isRelative(r)&&(e.url=r,e.serviceLocation=i,e.queryParams=s,!0)}function b(e,t){if(null==t)return null;var n=new r.Z,a=t.representation,s=a.adaptation.period.mpd.manifest.Period_asArray[a.adaptation.period.index].AdaptationSet_asArray[a.adaptation.index].Representation_asArray[a.index].bandwidth,l=t.media;return l=(0,o.vi)(l,"Number",t.replacementNumber),l=(0,o.vi)(l,"Time",t.replacementTime),l=(0,o.vi)(l,"Bandwidth",s),l=(0,o.Aj)(l,a.id),l=(0,o.eR)(l),n.mediaType=_(),n.type=i.w.MEDIA_SEGMENT_TYPE,n.range=t.mediaRange,n.startTime=t.presentationStartTime,n.mediaStartTime=t.mediaStartTime,n.duration=t.duration,n.timescale=a.timescale,n.availabilityStartTime=t.availabilityStartTime,n.availabilityEndTime=t.availabilityEndTime,n.availabilityTimeComplete=a.availabilityTimeComplete,n.wallStartTime=t.wallStartTime,n.quality=a.index,n.index=t.index,n.mediaInfo=e,n.adaptationIndex=a.adaptation.index,n.representationId=a.id,E(n,l,a)?n:void 0}function S(e,t,r){var i=null;if(!t||!t.segmentInfoType)return i;var s=m.getSegmentByTime(t,r);return s&&(a=s,n.debug("Index for time "+r+" is "+s.index),i=b(e,s)),i}function A(e,t,r){var i=null,s=m.getSegmentByIndex(t,r,a?a.mediaStartTime:-1);if(s)i=b(e,s),a=s;else{if(u&&!c)return n.debug(_()+" No segment found at index: "+r+". Wait for next loop"),null;c=!0}return i}function w(){n.debug("Dynamic stream complete"),c=!0}return t={getCurrentIndex:function(){return a?a.index:-1},getInitRequest:function(e,t){return t?function(e,t,n){var a=new r.Z,s=t.adaptation.period,l=s.start;if(a.mediaType=n,a.type=i.w.INIT_SEGMENT_TYPE,a.range=t.range,a.availabilityStartTime=y.calcAvailabilityStartTimeFromPresentationTime(l,t,u),a.availabilityEndTime=y.calcAvailabilityEndTimeFromPresentationTime(l+s.duration,t,u),a.quality=t.index,a.mediaInfo=e,a.representationId=t.id,E(a,t.initialization,t))return a.url=(0,o.vi)(a.url,"Bandwidth",t.bandwidth),a}(e,t,_()):null},getNextSegmentRequest:function(e,t){return t&&t.segmentInfoType?A(e,t,a?a.index+1:0):null},getNextSegmentRequestIdempotent:function(e,t){var n=a?a.index+1:0,r=m.getSegmentByIndex(t,n,a?a.mediaStartTime:-1);return r?b(e,r):null},getSegmentRequestForTime:S,getStreamId:function(){return g.id},getStreamInfo:function(){return g},getType:_,getValidTimeAheadOfTargetTime:function(e,t,n,r){try{if(isNaN(e)||!t||!n)return NaN;if(e<0&&(e=0),isNaN(r)&&(r=.5),S(t,n,e))return e;if(n.adaptation.period.start+n.adaptation.period.duration<e)return NaN;for(var i=isFinite(n.adaptation.period.duration)?n.adaptation.period.start+n.adaptation.period.duration:e+30,a=Math.min(e+r,i),s=NaN,o=null;a<=i;){var l=null;if(a<=i&&(l=S(t,n,a)),l){s=a,o=l;break}a+=r}if(o){var u=o.startTime+o.duration;return e>o.startTime&&u-e>r?e:!isNaN(o.startTime)&&e<o.startTime&&s>o.startTime?o.startTime+.001:Math.min(u-r,s)}return s}catch(e){return NaN}},initialize:function(e){u=e,c=!1,m.initialize(e)},isLastSegmentRequested:function(e,t){if(!e||!a)return!1;if(c)return!0;if(!isFinite(e.adaptation.period.duration))return!1;if(a.presentationStartTime+a.duration>t)return!1;if(e.mediaFinishedInformation&&!isNaN(e.mediaFinishedInformation.numberOfSegments)&&!isNaN(a.index)&&a.index>=e.mediaFinishedInformation.numberOfSegments-1){if(!u||e.segmentInfoType===l.Z.SEGMENT_TEMPLATE)return!0;if(u&&e.segmentInfoType===l.Z.SEGMENT_LIST&&e.adaptation.period.nextPeriodId)return!0}return!!(u&&e.adaptation.period.nextPeriodId&&e.segmentInfoType===l.Z.SEGMENT_TIMELINE&&e.mediaFinishedInformation&&!isNaN(e.mediaFinishedInformation.mediaTimeOfLastSignaledSegment)&&a&&!isNaN(a.mediaStartTime)&&!isNaN(a.duration)&&a.mediaStartTime+a.duration>=e.mediaFinishedInformation.mediaTimeOfLastSignaledSegment-.05)},repeatSegmentRequest:function(e,t){return t&&t.segmentInfoType?A(e,t,a?a.index:0):null},reset:function(){T(),d.off(s.Z.DYNAMIC_TO_STATIC,w,t)}},n=f.getLogger(t),T(),d.on(s.Z.DYNAMIC_TO_STATIC,w,t),t}u.__dashjs_factory_name="DashHandler",t.Z=a.Z.getClassFactory(u)},1553:function(e,t){"use strict";var n=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t;return(t=[{key:"init",value:function(){this.BASE_URL="BaseURL",this.SEGMENT_BASE="SegmentBase",this.SEGMENT_TEMPLATE="SegmentTemplate",this.SEGMENT_LIST="SegmentList",this.SEGMENT_URL="SegmentURL",this.SEGMENT_TIMELINE="SegmentTimeline",this.SEGMENT_PROFILES="segmentProfiles",this.ADAPTATION_SET="AdaptationSet",this.REPRESENTATION="Representation",this.REPRESENTATION_INDEX="RepresentationIndex",this.SUB_REPRESENTATION="SubRepresentation",this.INITIALIZATION="Initialization",this.INITIALIZATION_MINUS="initialization",this.MPD="MPD",this.PERIOD="Period",this.ASSET_IDENTIFIER="AssetIdentifier",this.EVENT_STREAM="EventStream",this.ID="id",this.PROFILES="profiles",this.SERVICE_LOCATION="serviceLocation",this.RANGE="range",this.INDEX="index",this.MEDIA="media",this.BYTE_RANGE="byteRange",this.INDEX_RANGE="indexRange",this.MEDIA_RANGE="mediaRange",this.VALUE="value",this.CONTENT_TYPE="contentType",this.MIME_TYPE="mimeType",this.BITSTREAM_SWITCHING="BitstreamSwitching",this.BITSTREAM_SWITCHING_MINUS="bitstreamSwitching",this.CODECS="codecs",this.DEPENDENCY_ID="dependencyId",this.MEDIA_STREAM_STRUCTURE_ID="mediaStreamStructureId",this.METRICS="Metrics",this.METRICS_MINUS="metrics",this.REPORTING="Reporting",this.WIDTH="width",this.HEIGHT="height",this.SAR="sar",this.FRAMERATE="frameRate",this.AUDIO_SAMPLING_RATE="audioSamplingRate",this.MAXIMUM_SAP_PERIOD="maximumSAPPeriod",this.START_WITH_SAP="startWithSAP",this.MAX_PLAYOUT_RATE="maxPlayoutRate",this.CODING_DEPENDENCY="codingDependency",this.SCAN_TYPE="scanType",this.FRAME_PACKING="FramePacking",this.AUDIO_CHANNEL_CONFIGURATION="AudioChannelConfiguration",this.CONTENT_PROTECTION="ContentProtection",this.ESSENTIAL_PROPERTY="EssentialProperty",this.ESSENTIAL_PROPERTY_ASARRAY="EssentialProperty_asArray",this.SUPPLEMENTAL_PROPERTY="SupplementalProperty",this.SUPPLEMENTAL_PROPERTY_ASARRAY="SupplementalProperty_asArray",this.INBAND_EVENT_STREAM="InbandEventStream",this.PRODUCER_REFERENCE_TIME="ProducerReferenceTime",this.INBAND="inband",this.TYPE="type",this.ACCESSIBILITY="Accessibility",this.ROLE="Role",this.RATING="Rating",this.CONTENT_COMPONENT="ContentComponent",this.SUBSET="Subset",this.LANG="lang",this.VIEWPOINT="Viewpoint",this.VIEWPOINT_ASARRAY="Viewpoint_asArray",this.ROLE_ASARRAY="Role_asArray",this.REPRESENTATION_ASARRAY="Representation_asArray",this.PRODUCERREFERENCETIME_ASARRAY="ProducerReferenceTime_asArray",this.ACCESSIBILITY_ASARRAY="Accessibility_asArray",this.AUDIOCHANNELCONFIGURATION_ASARRAY="AudioChannelConfiguration_asArray",this.CONTENTPROTECTION_ASARRAY="ContentProtection_asArray",this.MAIN="main",this.DYNAMIC="dynamic",this.STATIC="static",this.MEDIA_PRESENTATION_DURATION="mediaPresentationDuration",this.MINIMUM_UPDATE_PERIOD="minimumUpdatePeriod",this.CODEC_PRIVATE_DATA="codecPrivateData",this.BANDWITH="bandwidth",this.SOURCE_URL="sourceURL",this.TIMESCALE="timescale",this.DURATION="duration",this.START_NUMBER="startNumber",this.PRESENTATION_TIME_OFFSET="presentationTimeOffset",this.AVAILABILITY_START_TIME="availabilityStartTime",this.AVAILABILITY_END_TIME="availabilityEndTime",this.TIMESHIFT_BUFFER_DEPTH="timeShiftBufferDepth",this.MAX_SEGMENT_DURATION="maxSegmentDuration",this.PRESENTATION_TIME="presentationTime",this.MIN_BUFFER_TIME="minBufferTime",this.MAX_SUBSEGMENT_DURATION="maxSubsegmentDuration",this.START="start",this.AVAILABILITY_TIME_OFFSET="availabilityTimeOffset",this.AVAILABILITY_TIME_COMPLETE="availabilityTimeComplete",this.CENC_DEFAULT_KID="cenc:default_KID",this.DVB_PRIORITY="dvb:priority",this.DVB_WEIGHT="dvb:weight",this.DVB_URL="dvb:url",this.DVB_MIMETYPE="dvb:mimeType",this.DVB_FONTFAMILY="dvb:fontFamily",this.SUGGESTED_PRESENTATION_DELAY="suggestedPresentationDelay",this.SERVICE_DESCRIPTION="ServiceDescription",this.SERVICE_DESCRIPTION_SCOPE="Scope",this.SERVICE_DESCRIPTION_LATENCY="Latency",this.SERVICE_DESCRIPTION_PLAYBACK_RATE="PlaybackRate",this.SERVICE_DESCRIPTION_OPERATING_QUALITY="OperatingQuality",this.SERVICE_DESCRIPTION_OPERATING_BANDWIDTH="OperatingBandwidth",this.PATCH_LOCATION="PatchLocation",this.PATCH_LOCATION_AS_ARRAY="PatchLocation_asArray",this.LOCATION="Location",this.LOCATION_AS_ARRAY="Location_asArray",this.PUBLISH_TIME="publishTime",this.ORIGINAL_PUBLISH_TIME="originalPublishTime",this.ORIGINAL_MPD_ID="mpdId",this.WALL_CLOCK_TIME="wallClockTime",this.PRESENTATION_TIME="presentationTime",this.LABEL="Label",this.GROUP_LABEL="GroupLabel",this.CONTENT_STEERING="ContentSteering",this.CONTENT_STEERING_AS_ARRAY="ContentSteering_asArray",this.DEFAULT_SERVICE_LOCATION="defaultServiceLocation",this.QUERY_BEFORE_START="queryBeforeStart",this.CLIENT_REQUIREMENT="clientRequirement",this.TTL="ttl",this.CONTENT_STEERING_RESPONSE={VERSION:"VERSION",TTL:"TTL",RELOAD_URI:"RELOAD-URI",PATHWAY_PRIORITY:"PATHWAY-PRIORITY",PATHWAY_CLONES:"PATHWAY-CLONES",BASE_ID:"BASE-ID",ID:"ID",URI_REPLACEMENT:"URI-REPLACEMENT",HOST:"HOST",PARAMS:"PARAMS"},this.PRODUCER_REFERENCE_TIME_TYPE={ENCODER:"encoder",CAPTURED:"captured",APPLICATION:"application"},this.SEGMENT_ALIGNMENT="segmentAlignment",this.SUB_SEGMENT_ALIGNMENT="subsegmentAlignment"}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}());t.Z=n},7802:function(e,t,n){"use strict";var r=n(5448),i=n(1724),a=n(3636),s=n(1736),o=n(5246);function l(e){e=e||{};var t,n,r=this.context,l=e.dashConstants,u=e.type,c=e.segmentBaseController;function d(e){return e?e.segments?n[l.SEGMENT_BASE]:n[e.segmentInfoType]:null}return t={initialize:function(t){n[l.SEGMENT_TIMELINE]=(0,i.Z)(r).create(e,t),n[l.SEGMENT_TEMPLATE]=(0,a.Z)(r).create(e,t),n[l.SEGMENT_LIST]=(0,s.Z)(r).create(e,t),n[l.SEGMENT_BASE]=(0,o.Z)(r).create(e,t)},updateInitData:function(e,t){return t?Promise.resolve():c.getSegmentBaseInitSegment({representation:e,mediaType:u})},updateSegmentData:function(e,t){return t?Promise.resolve():c.getSegmentList({mimeType:e.mimeType,representation:e,mediaType:u})},getSegmentByIndex:function(e,t,n){var r=d(e);return r?r.getSegmentByIndex(e,t,n):null},getSegmentByTime:function(e,t){var n=d(e);return n?n.getSegmentByTime(e,t):null},getMediaFinishedInformation:function(e){var t=d(e);return t?t.getMediaFinishedInformation(e):{numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN}}},n={},t}l.__dashjs_factory_name="SegmentsController";var u=r.Z.getClassFactory(l);t.Z=u},1736:function(e,t,n){"use strict";var r=n(5448),i=n(3393),a=n(7387);function s(e,t){var n=(e=e||{}).timelineConverter;function r(){if(!n||!n.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(i.Z.MISSING_CONFIG_ERROR)}function s(e,i){if(r(),!e)return null;var s=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,o=s.SegmentURL_asArray.length,l=e&&!isNaN(e.startNumber)?e.startNumber:1,u=Math.max(l-1,0),c=Math.max(i-u,0),d=null;if(c<o){var f=s.SegmentURL_asArray[c];(d=(0,a.NF)(n,t,e,i))&&(d.replacementTime=(l+i-1)*e.segmentDuration,d.media=f.media?f.media:"",d.mediaRange=f.mediaRange,d.indexRange=f.indexRange)}return d}return{getSegmentByIndex:s,getSegmentByTime:function(e,t){if(r(),!e)return null;var i=e.segmentDuration;if(isNaN(i))return null;var a=n.calcPeriodRelativeTimeFromMpdRelativeTime(e,t);return s(e,Math.floor(a/i))},getMediaFinishedInformation:function(e){var t={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};if(!e)return t;var n=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,r=e&&!isNaN(e.startNumber)?e.startNumber:1,i=Math.max(r-1,0);return t.numberOfSegments=i+n.SegmentURL_asArray.length,t}}}s.__dashjs_factory_name="ListSegmentsGetter";var o=r.Z.getClassFactory(s);t.Z=o},5246:function(e,t,n){"use strict";var r=n(5448),i=n(3393);function a(e){var t=(e=e||{}).timelineConverter;function n(){if(!t||!t.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(i.Z.MISSING_CONFIG_ERROR)}function r(e,t){if(n(),!e)return null;var r,i=e.segments?e.segments.length:-1;if(t<i&&(r=e.segments[t])&&r.index===t)return r;for(var a=0;a<i;a++)if((r=e.segments[a])&&r.index===t)return r;return null}return{getSegmentByIndex:r,getSegmentByTime:function(e,t){n();var i=function(e,t){if(!e)return-1;var n,r,i,a,s,o=e.segments,l=o?o.length:null,u=-1;if(o&&l>0)for(s=0;s<l;s++)if(i=(r=o[s]).presentationStartTime,t+(n=(a=r.duration)/2)>=i&&t-n<i+a){u=r.index;break}return u}(e,t);return r(e,i)},getMediaFinishedInformation:function(e){var t={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};return e&&e.segments?(t.numberOfSegments=e.segments.length,t):t}}}a.__dashjs_factory_name="SegmentBaseGetter";var s=r.Z.getClassFactory(a);t.Z=s},7387:function(e,t,n){"use strict";n.d(t,{Aj:function(){return s},NF:function(){return c},TJ:function(){return d},eR:function(){return a},vi:function(){return o}});var r=n(2011);function i(e,t){for(;e.length<t;)e="0"+e;return e}function a(e){return e?e.split("$$").join("$"):e}function s(e,t){if(!t||!e||-1===e.indexOf("$RepresentationID$"))return e;var n=t.toString();return e.split("$RepresentationID$").join(n)}function o(e,t,n){var r,a,s,o,l,u,c=t.length;if(!e)return e;for(;;){if((r=e.indexOf("$"+t))<0)return e;if((a=e.indexOf("$",r+c))<0)return e;if((s=e.indexOf("%0",r+c))>r&&s<a)switch(o=e.charAt(a-1),l=parseInt(e.substring(s+2,a-1),10),o){case"d":case"i":case"u":u=i(n.toString(),l);break;case"x":u=i(n.toString(16),l);break;case"X":u=i(n.toString(16),l).toUpperCase();break;case"o":u=i(n.toString(8),l);break;default:return e}else u=n;e=e.substring(0,r)+u+e.substring(a+1)}}function l(e,t,n,i,a,s,o,l){var u,c=new r.Z;return c.representation=e,c.duration=t,c.presentationStartTime=n,c.mediaStartTime=i,c.availabilityStartTime=a.calcAvailabilityStartTimeFromPresentationTime(s,e,o),c.availabilityEndTime=a.calcAvailabilityEndTimeFromPresentationTime(s+t,e,o),c.wallStartTime=a.calcWallTimeForSegment(c,o),c.replacementNumber=(u=l,c.representation.startNumber+u),c.index=l,c}function u(e,t,n,r){var i=t.adaptation.period;if(isFinite(i.duration)&&i.start+i.duration<=n.presentationStartTime)return!1;if(r){if("INF"===t.availabilityTimeOffset)return!0;var a=e.getClientReferenceTime();return n.availabilityStartTime.getTime()<=a&&(!isFinite(n.availabilityEndTime)||n.availabilityEndTime.getTime()>=a)}return!0}function c(e,t,n,r){var i,a,s;i=n.segmentDuration,isNaN(i)&&(i=n.adaptation.period.duration),a=parseFloat((n.adaptation.period.start+r*i).toFixed(5)),s=parseFloat((a+i).toFixed(5));var o=l(n,i,a,e.calcMediaTimeFromPresentationTime(a,n),e,s,t,r);return u(e,n,o,t)?o:null}function d(e,t,n,r,i,a,s,c,d,f){var h,p,g=r/a,m=i/a;return h=e.calcPresentationTimeFromMediaTime(g,n),u(e,n,p=l(n,m,h,g,e,h+m,t,d),t)?(p.replacementTime=f||r,s=o(s,"Number",p.replacementNumber),s=o(s,"Time",p.replacementTime),p.media=s,p.mediaRange=c,p):null}},3636:function(e,t,n){"use strict";var r=n(5448),i=n(3393),a=n(7387);function s(e,t){var n=(e=e||{}).timelineConverter;function r(){if(!n||!n.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(i.Z.MISSING_CONFIG_ERROR)}function s(e,i){if(r(),!e)return null;var s=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate;i=Math.max(i,0);var o=(0,a.NF)(n,t,e,i);if(o){o.replacementTime=Math.round((i-1)*e.segmentDuration*e.timescale,10);var l=s.media;l=(0,a.vi)(l,"Number",o.replacementNumber),l=(0,a.vi)(l,"Time",o.replacementTime),o.media=l}return o}return{getSegmentByIndex:s,getSegmentByTime:function(e,t){if(r(),!e)return null;var i=e.segmentDuration;if(isNaN(i))return null;var a=n.calcPeriodRelativeTimeFromMpdRelativeTime(e,t);return s(e,Math.floor(a/i))},getMediaFinishedInformation:function(e){var t={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};if(!e)return t;var n=e.segmentDuration;return isNaN(n)?t.numberOfSegments=1:t.numberOfSegments=Math.ceil(e.adaptation.period.duration/n),t}}}s.__dashjs_factory_name="TemplateSegmentsGetter";var o=r.Z.getClassFactory(s);t.Z=o},1724:function(e,t,n){"use strict";var r=n(5448),i=n(3393),a=n(7387);function s(e,t){var n=(e=e||{}).timelineConverter,r=e.dashMetrics;function s(){if(!n)throw new Error(i.Z.MISSING_CONFIG_ERROR)}function o(e,t){var n,r,i,a,s,o,u,c=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate||e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,d=c.SegmentTimeline,f=c.SegmentURL_asArray,h=0,p=-1;u=e.timescale;var g=!1;for(i=0,a=(n=d.S_asArray).length;i<a&&!g;i++)for(o=0,(r=n[i]).hasOwnProperty("r")&&(o=r.r),r.hasOwnProperty("t")&&(h=r.t),o<0&&(o=l(e,n[i+1],r,u,h/u)),s=0;s<=o&&!g;s++)(g=t(h,c,f,r,u,++p,i))&&(e.segmentDuration=r.d/u),h+=r.d}function l(e,t,i,a,s){var o;if(t&&t.hasOwnProperty("t"))o=t.t/a;else try{var l=0;if(isNaN(e.adaptation.period.start)||isNaN(e.adaptation.period.duration)||!isFinite(e.adaptation.period.duration)){var u=r.getCurrentDVRInfo();l=isNaN(u.end)?0:u.end}else l=e.adaptation.period.start+e.adaptation.period.duration;o=n.calcMediaTimeFromPresentationTime(l,e),e.segmentDuration=i.d/a}catch(e){o=0}return Math.max(Math.ceil((o-s)/(i.d/a))-1,0)}return{getSegmentByIndex:function(e,r,i){if(s(),!e)return null;var l=null,u=!1;return o(e,(function(r,s,o,c,d,f,h){if(u||i<0){var p=s.media,g=c.mediaRange;return o&&(p=o[h].media||"",g=o[h].mediaRange),l=(0,a.TJ)(n,t,e,r,c.d,d,p,g,f,c.tManifest),!0}return r>=i*d-.5*c.d&&(u=!0),!1})),l},getSegmentByTime:function(e,r){if(s(),!e)return null;void 0===r&&(r=null);var i=null,l=n.calcMediaTimeFromPresentationTime(r,e);return o(e,(function(r,s,o,u,c,d,f){var h=parseFloat((l*c).toPrecision(15));if(h<r+u.d&&h>=r){var p=s.media,g=u.mediaRange;return o&&(p=o[f].media||"",g=o[f].mediaRange),i=(0,a.TJ)(n,t,e,r,u.d,c,p,g,d,u.tManifest),!0}return!1})),i},getMediaFinishedInformation:function(e){if(!e)return 0;var t,n,r,i,a,s,o,u=(e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate||e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList).SegmentTimeline,c=0,d=0,f=0;for(o=e.timescale,i=(t=u.S_asArray).length,r=0;r<i;r++)for(s=0,(n=t[r]).hasOwnProperty("r")&&(s=n.r),n.hasOwnProperty("t")&&(d=(c=n.t)/o),s<0&&(s=l(e,t[r+1],n,o,d)),a=0;a<=s;a++)f++,d=(c+=n.d)/o;return{numberOfSegments:f,mediaTimeOfLastSignaledSegment:d}}}}s.__dashjs_factory_name="TimelineSegmentsGetter";var o=r.Z.getClassFactory(s);t.Z=o},2011:function(e,t){"use strict";t.Z=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.indexRange=null,this.index=null,this.mediaRange=null,this.media=null,this.duration=NaN,this.replacementTime=null,this.replacementNumber=NaN,this.mediaStartTime=NaN,this.presentationStartTime=NaN,this.availabilityStartTime=NaN,this.availabilityEndTime=NaN,this.wallStartTime=NaN,this.representation=null}},2610:function(e,t){"use strict";t.Z=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.schemeIdUri="",this.value=""}},1139:function(e,t,n){"use strict";n.d(t,{Z:function(){return Pa}});var r=n(452),i=n.n(r),a=n(3393),s=n(1553),o=n(3860),l=n(5595),u=n(8512),c=n(5448),d=n(6398),f=n(8825);function h(){var e,t,n,r,i,s,c,h,p,g,m,y,v,_,T,E,b,S,A,w,I,C,R,D,N,O=this.context,P=(0,l.Z)(O).getInstance();function M(){F(),_=!1,g=0,m=0,b=0,R=!1,S=!0,A=!1,D=!1,w=NaN,E=NaN,c&&(P.off(u.Z.DATA_UPDATE_COMPLETED,Q,e),P.off(u.Z.LOADING_PROGRESS,ve,e),P.off(u.Z.MANIFEST_UPDATED,be,e),P.off(u.Z.STREAMS_COMPOSED,Se,e),P.off(f.Z.PLAYBACK_ENDED,ge,e),P.off(f.Z.STREAM_INITIALIZING,Te,e),P.off(f.Z.REPRESENTATION_SWITCH,Ee,e),P.off(f.Z.BUFFER_LEVEL_STATE_CHANGED,te,e),$(),c.removeEventListener("canplay",J),c.removeEventListener("canplaythrough",ee),c.removeEventListener("play",ne),c.removeEventListener("waiting",re),c.removeEventListener("playing",ie),c.removeEventListener("pause",ae),c.removeEventListener("error",me),c.removeEventListener("seeking",se),c.removeEventListener("seeked",oe),c.removeEventListener("timeupdate",le),c.removeEventListener("progress",ue),c.removeEventListener("ratechange",ce),c.removeEventListener("loadedmetadata",de),c.removeEventListener("loadeddata",fe),c.removeEventListener("stalled",_e),c.removeEventListener("ended",he),c.removeEventListener("volumechange",pe)),p=null,c=null,y=null,v=null}function x(){return parseFloat((L(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)-q()).toFixed(5))}function L(e){var t=e||y;return t.start+t.duration}function k(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];y&&c&&c.getElement()?(e&&v&&j(q()),c.play()):_=!0}function F(){y&&c&&c.pause()}function U(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];y&&c&&c.getElement()&&e!==(isNaN(w)?c.getTime():w)&&((I=!0===r)||(w=e),t.info("Requesting seek to time: "+e+(I?" (internal)":"")),v&&i&&j(e),c.setCurrentTime(e,n))}function B(){if(y&&c&&v){var e=n&&n.hasVideoTrack()?a.Z.VIDEO:a.Z.AUDIO,t=i.getCurrentDVRInfo(e);return t&&t.range?t.range.end:0}}function j(e){var t=new Date(h.getClientReferenceTime()),n=s.getRegularPeriods()[0],r=h.calcPresentationTimeFromWallTime(t,n);g=r-e}function q(){return y&&c?c.getTime():null}function H(){return y&&c?c.isPaused():null}function G(){return y&&c?c.isSeeking():null}function V(){return y&&c?c.isStalled():null}function Y(){return y&&c?c.getPlaybackRate():null}function Z(){return y&&c?c.getEnded():null}function K(){return v}function z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!H()&&v&&0!==c.getReadyState()&&!G()&&!R){e||(e=n.hasVideoTrack()?a.Z.VIDEO:a.Z.AUDIO);var r=q(),i=W(r,e);!isNaN(i)&&i!==r&&!G()&&(V()||C||1===c.getReadyState())&&(t.debug("UpdateCurrentTime: Seek to actual time: ".concat(i," from currentTime: ").concat(r)),U(i,!1,!1))}}function W(e,t){var n=i.getCurrentDVRInfo(t),r=n?n.range:null;return r?e>r.end?Math.max(r.end-g,r.start):e>0&&e+.25<r.start&&Math.abs(e-r.start)<31536e4?A?Math.max(r.end-g,r.start):r.start:e:NaN}function X(){null===p&&(p=setInterval((function(){!function(){if(P.trigger(u.Z.WALLCLOCK_TIME_UPDATED,{isDynamic:v,time:new Date}),K()){var e=Date.now();(isNaN(E)||e>E+N.get().streaming.liveUpdateTimeThresholdInMilliseconds)&&(n.addDVRMetric(),H()?function(){var e=Date.now();(!T||e>T+500)&&(T=e,le())}():z(),E=e)}}()}),N.get().streaming.wallclockTimeUpdateInterval))}function $(){clearInterval(p),p=null}function Q(e){var t=s.convertRepresentationToRepresentationInfo(e.currentRepresentation),n=t?t.mediaInfo.streamInfo:null;null!==n&&y.id===n.id&&(y=n)}function J(){P.trigger(u.Z.CAN_PLAY)}function ee(){P.trigger(u.Z.CAN_PLAY_THROUGH)}function te(e){e.streamId===n.getActiveStreamInfo().id&&(C=e.state===o.Z.BUFFER_EMPTY,N.get().streaming.buffer.setStallState&&c.setStallState(e.mediaType,e.state===o.Z.BUFFER_EMPTY))}function ne(){t.info("Native video element event: play"),z(),X(),P.trigger(u.Z.PLAYBACK_STARTED,{startTime:q()})}function re(){t.info("Native video element event: waiting"),P.trigger(u.Z.PLAYBACK_WAITING,{playingTime:q()})}function ie(){t.info("Native video element event: playing"),I=!1,P.trigger(u.Z.PLAYBACK_PLAYING,{playingTime:q()})}function ae(){t.info("Native video element event: pause"),P.trigger(u.Z.PLAYBACK_PAUSED,{ended:Z()})}function se(){if(!I){var e=q();isNaN(w)||w===e||(e=w),w=NaN,t.info("Seeking to: "+e),X(),P.trigger(u.Z.PLAYBACK_SEEKING,{seekTime:e,streamId:y.id})}}function oe(){t.info("Native video element event: seeked"),I=!1,P.trigger(u.Z.PLAYBACK_SEEKED)}function le(){y&&P.trigger(u.Z.PLAYBACK_TIME_UPDATED,{timeToEnd:x(),time:q(),streamId:y.id})}function ue(){P.trigger(u.Z.PLAYBACK_PROGRESS,{streamId:y.id})}function ce(){var e=Y();t.info("Native video element event: ratechange: ",e),P.trigger(u.Z.PLAYBACK_RATE_CHANGED,{playbackRate:e})}function de(){t.info("Native video element event: loadedmetadata"),P.trigger(u.Z.PLAYBACK_METADATA_LOADED),X()}function fe(){t.info("Native video element event: loadeddata"),P.trigger(u.Z.PLAYBACK_LOADED_DATA)}function he(){t.info("Native video element event: ended"),F(),$();var e=n?n.getActiveStreamInfo():null;e&&P.trigger(u.Z.PLAYBACK_ENDED,{isLast:e.isLast})}function pe(){P.trigger(u.Z.PLAYBACK_VOLUME_CHANGED)}function ge(e){if(p&&e.isLast){t.info("onPlaybackEnded -- PLAYBACK_ENDED but native video element didn't fire ended");var n=e.seekTime?e.seekTime:L();c.setCurrentTime(n),F(),$()}}function me(e){var t=e.target||e.srcElement;P.trigger(u.Z.PLAYBACK_ERROR,{error:t.error})}function ye(){v=!1}function ve(e){if(!1===e.stream&&A&&!isNaN(e.request.duration)){var n=1.2*e.request.duration;n>g&&(t.warn("Browser does not support fetch API with StreamReader. Increasing live delay to be 20% higher than segment duration:",n.toFixed(2)),g=n,m=n)}}function _e(e){P.trigger(u.Z.PLAYBACK_STALLED,{e})}function Te(e){var n;(n=e.mediaInfo)&&n.supplementalProperties&&n.supplementalProperties[a.Z.SUPPLEMENTAL_PROPERTY_DVB_LL_SCHEME]&&"true"===n.supplementalProperties[a.Z.SUPPLEMENTAL_PROPERTY_DVB_LL_SCHEME].value&&(t.debug("Low Latency critical SupplementalProperty set: Enabling low Latency"),A=!0)}function Ee(e){var t=n.getActiveStreamInfo();e&&t&&e.currentRepresentation&&e.streamId&&e.streamId===t.id&&e.mediaType&&(e.mediaType===a.Z.VIDEO||e.mediaType===a.Z.AUDIO)&&(S=e.currentRepresentation.availabilityTimeComplete,(A=!S)&&!D&&(D=!0))}function be(){R=!0}function Se(){R=!1}return e={initialize:function(t,n){y=t,!0!==n&&(c.addEventListener("canplay",J),c.addEventListener("canplaythrough",ee),c.addEventListener("play",ne),c.addEventListener("waiting",re),c.addEventListener("playing",ie),c.addEventListener("pause",ae),c.addEventListener("error",me),c.addEventListener("seeking",se),c.addEventListener("seeked",oe),c.addEventListener("timeupdate",le),c.addEventListener("progress",ue),c.addEventListener("ratechange",ce),c.addEventListener("loadedmetadata",de),c.addEventListener("loadeddata",fe),c.addEventListener("stalled",_e),c.addEventListener("ended",he),c.addEventListener("volumechange",pe),v=y.manifestInfo.isDynamic,C=!1,I=!1,P.on(u.Z.DATA_UPDATE_COMPLETED,Q,e),P.on(u.Z.LOADING_PROGRESS,ve,e),P.on(u.Z.MANIFEST_UPDATED,be,e),P.on(u.Z.STREAMS_COMPOSED,Se,e),P.on(f.Z.PLAYBACK_ENDED,ge,e,{priority:l.Z.EVENT_PRIORITY_HIGH}),P.on(f.Z.STREAM_INITIALIZING,Te,e),P.on(f.Z.REPRESENTATION_SWITCH,Ee,e),P.on(f.Z.BUFFER_LEVEL_STATE_CHANGED,te,e),P.on(f.Z.DYNAMIC_TO_STATIC,ye,e),_&&(_=!1,k()))},setConfig:function(e){e&&(e.streamController&&(n=e.streamController),e.serviceDescriptionController&&(r=e.serviceDescriptionController),e.dashMetrics&&(i=e.dashMetrics),e.adapter&&(s=e.adapter),e.videoModel&&(c=e.videoModel),e.timelineConverter&&(h=e.timelineConverter),e.settings&&(N=e.settings))},getTimeToStreamEnd:x,getBufferLevel:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=null;return n.getActiveStreamProcessors().forEach((function(n){if(!e||0===e.length||-1===e.indexOf(n.getType())){var r=n.getBufferLevel();t=null===t?r:Math.min(t,r)}})),t},getPlaybackStalled:function(){return C},getTime:q,getLowLatencyModeEnabled:function(){return A},getInitialCatchupModeActivated:function(){return D},getIsManifestUpdateInProgress:function(){return R},getPlaybackRate:Y,getPlayedRanges:function(){return y&&c?c.getPlayedRanges():null},getEnded:Z,getIsDynamic:K,getStreamController:function(){return n},computeAndSetLiveDelay:function(e,t){var n,i,a,o=!isNaN(e)&&isFinite(e)?e:NaN,l=s.getSuggestedPresentationDelay(),u=r.getServiceDescriptionSettings();return n=isNaN(N.get().streaming.delay.liveDelay)?null===N.get().streaming.delay.liveDelayFragmentCount||isNaN(N.get().streaming.delay.liveDelayFragmentCount)||isNaN(o)?u&&!isNaN(u.liveDelay)&&u.liveDelay>0?u.liveDelay:!0===N.get().streaming.delay.useSuggestedPresentationDelay&&null!==l&&!isNaN(l)&&l>0?l:isNaN(o)?t&&!isNaN(t.minBufferTime)?4*t.minBufferTime:4*y.manifestInfo.minBufferTime:4*o:o*N.get().streaming.delay.liveDelayFragmentCount:N.get().streaming.delay.liveDelay,null!==(a=s.getAvailabilityStartTime())&&(b=a),i=t&&t.dvrWindowSize>0?Math.min(n,t.dvrWindowSize):n,g=i,m=i,i},getLiveDelay:function(){return g},getOriginalLiveDelay:function(){return m},getCurrentLiveLatency:function(){if(!v||isNaN(b))return NaN;var e=q();if(isNaN(e)||0===e)return 0;var t=(new Date).getTime()+1e3*h.getClientTimeOffset();return Math.max(((t-b-1e3*e)/1e3).toFixed(3),0)},play:k,isPaused:H,isStalled:V,pause:F,isSeeking:G,getStreamEndTime:L,seek:U,seekToOriginalLive:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=B();0!==r&&U(r-(g=m),e,t,n)},seekToCurrentLive:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=B();0!==r&&U(r-g,e,t,n)},reset:M,updateCurrentTime:z,getAvailabilityStartTime:function(){return b}},t=(0,d.Z)(O).getInstance().getLogger(e),M(),e}h.__dashjs_factory_name="PlaybackController";var p=c.Z.getSingletonFactory(h),g=n(3186),m="loading",y="executed",v="failed";function _(e){var t,n,r,i,a=(e=e||{}).eventBus,s=e.events,o=e.dashMetrics,l=e.fragmentLoader,u=e.debug,c=e.streamInfo,d=e.type;function f(e){var t;return!!e&&(t=!1,r.some((function(n){if(r=e,i=n,!isNaN(r.index)&&r.startTime===i.startTime&&r.adaptationIndex===i.adaptationIndex&&r.type===i.type||function(e,t){return isNaN(e.index)&&isNaN(t.index)&&e.quality===t.quality}(e,n)||function(e,t){return e.action===g.Z.ACTION_COMPLETE&&e.action===t.action}(e,n))return t=!0;var r,i})),t)}function h(e){return isNaN(e.duration)?.25:Math.min(e.duration/8,.5)}function p(e){r=r.filter((function(t){var n=h(t);return isNaN(t.startTime)||void 0!==e&&t.startTime>=e-n}))}function _(e,t){t<=e+.5||(r=r.filter((function(n){var r=h(n);return isNaN(n.startTime)||n.startTime>=t-r||isNaN(n.duration)||n.startTime+n.duration<=e+r})))}function T(e,t,n){for(var r=e.length-1;r>=0;r--){var i=e[r],a=i.startTime,s=a+i.duration;if(n=isNaN(n)?h(i):n,!isNaN(a)&&!isNaN(s)&&t+n>=a&&t-n<s||isNaN(a)&&isNaN(t))return i}return null}function E(e,t){o.addSchedulingInfo(e,t),o.addRequestsQueue(e.mediaType,i,r)}function b(e){e.sender===l&&(i.splice(i.indexOf(e.request),1),e.response&&!e.error&&r.push(e.request),E(e.request,e.error?v:y),a.trigger(s.FRAGMENT_LOADING_COMPLETED,{request:e.request,response:e.response,error:e.error,sender:this},{streamId:c.id,mediaType:d}))}function S(e){e.sender===l&&a.trigger(s.FRAGMENT_LOADING_PROGRESS,{request:e.request,response:e.response,error:e.error,sender:this},{streamId:c.id,mediaType:d})}function A(e){e.sender===l&&a.trigger(s.FRAGMENT_LOADING_ABANDONED,{request:e.request},{streamId:c.id,mediaType:d})}function w(){r=[],i=[]}return t={getStreamId:function(){return c.id},getType:function(){return d},getRequests:function(e){var t=e?e.state instanceof Array?e.state:[e.state]:[],n=[];return t.forEach((function(t){var a=function(e){var t;switch(e){case m:t=i;break;case y:t=r;break;default:t=[]}return t}(t);n=n.concat(function(e,t){return t.hasOwnProperty("time")?[T(e,t.time,t.threshold)]:e.filter((function(e){for(var n in t)if("state"!==n&&t.hasOwnProperty(n)&&e[n]!=t[n])return!1;return!0}))}(a,e))})),n},isFragmentLoaded:f,isFragmentLoadedOrPending:function(e){var t,n=!1,r=0;if(!(n=f(e)))for(r=0;r<i.length;r++)t=i[r],e.url===t.url&&e.startTime===t.startTime&&(n=!0);return n},removeExecutedRequestsBeforeTime:p,removeExecutedRequestsAfterTime:function(e){r=r.filter((function(t){return isNaN(t.startTime)||void 0!==e&&t.startTime<e}))},syncExecutedRequestsWithBufferedRange:function(e,t){if(e&&0!==e.length){for(var n=0,r=0,i=e.length;r<i;r++)_(n,e.start(r)),n=e.end(r);t>0&&_(n,t)}else p()},abortRequests:function(){n.debug("abort requests"),l.abort(),i=[]},executeRequest:function(e){e.action===g.Z.ACTION_DOWNLOAD?(E(e,m),i.push(e),function(e){a.trigger(s.FRAGMENT_LOADING_STARTED,{request:e},{streamId:c.id,mediaType:d}),l.load(e)}(e)):n.warn("Unknown request action.")},reset:function(){a.off(s.LOADING_COMPLETED,b,this),a.off(s.LOADING_DATA_PROGRESS,S,this),a.off(s.LOADING_ABANDONED,A,this),l&&l.reset(),w()},resetInitialSettings:w,addExecutedRequest:function(e){r.push(e)}},n=u.getLogger(t),w(),a.on(s.LOADING_COMPLETED,b,t),a.on(s.LOADING_DATA_PROGRESS,S,t),a.on(s.LOADING_ABANDONED,A,t),t}_.__dashjs_factory_name="FragmentModel";var T=c.Z.getClassFactory(_);T.FRAGMENT_MODEL_LOADING=m,T.FRAGMENT_MODEL_EXECUTED=y,T.FRAGMENT_MODEL_CANCELED="canceled",T.FRAGMENT_MODEL_FAILED=v,c.Z.updateClassFactory(_.__dashjs_factory_name,T);var E=T,b=n(5459);function S(e){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},S(e)}function A(e,t){return A=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},A(e,t)}function w(e){return w=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},w(e)}var I=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&A(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=w(t);if(n){var i=w(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(e,t){return!t||"object"!==S(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function i(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(e=r.call(this)).MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE=10,e.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE=11,e.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE=12,e.SEGMENT_BASE_LOADER_ERROR_CODE=15,e.TIME_SYNC_FAILED_ERROR_CODE=16,e.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE=17,e.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE=18,e.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE=19,e.APPEND_ERROR_CODE=20,e.REMOVE_ERROR_CODE=21,e.DATA_UPDATE_FAILED_ERROR_CODE=22,e.CAPABILITY_MEDIASOURCE_ERROR_CODE=23,e.CAPABILITY_MEDIAKEYS_ERROR_CODE=24,e.DOWNLOAD_ERROR_ID_MANIFEST_CODE=25,e.DOWNLOAD_ERROR_ID_SIDX_CODE=26,e.DOWNLOAD_ERROR_ID_CONTENT_CODE=27,e.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE=28,e.DOWNLOAD_ERROR_ID_XLINK_CODE=29,e.MANIFEST_ERROR_ID_PARSE_CODE=31,e.MANIFEST_ERROR_ID_NOSTREAMS_CODE=32,e.TIMED_TEXT_ERROR_ID_PARSE_CODE=33,e.MANIFEST_ERROR_ID_MULTIPLEXED_CODE=34,e.MEDIASOURCE_TYPE_UNSUPPORTED_CODE=35,e.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE="parsing failed for ",e.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE="Failed loading manifest: ",e.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE="Failed loading Xlink element: ",e.SEGMENTS_UPDATE_FAILED_ERROR_MESSAGE="Segments update failed",e.SEGMENTS_UNAVAILABLE_ERROR_MESSAGE="no segments are available yet",e.SEGMENT_BASE_LOADER_ERROR_MESSAGE="error loading segment ranges from sidx",e.TIME_SYNC_FAILED_ERROR_MESSAGE="Failed to synchronize client and server time",e.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE="request is null",e.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE="Failed to resolve a valid URL",e.APPEND_ERROR_MESSAGE="chunk is not defined",e.REMOVE_ERROR_MESSAGE="Removing data from the SourceBuffer",e.DATA_UPDATE_FAILED_ERROR_MESSAGE="Data update failed",e.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE="mediasource is not supported",e.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE="mediakeys is not supported",e.TIMED_TEXT_ERROR_MESSAGE_PARSE="parsing error :",e.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE="Error creating source buffer of type : ",e}return i}(n(2230).Z)),C=n(1264),R=n(7855);function D(e){var t,n,r,i,s,o,l=this.context,c=(0,C.Z)(l).getInstance(),f=e.textController,h=e.eventBus,p=[],g=[],m=!1,y=e.mediaSource,v=null;function _(e){return new Promise((function(t){P((function(){i.changeType&&i.changeType(e),t()}))}))}function T(e){return i=f.getTextSourceBuffer(e),Promise.resolve()}function E(){if("function"==typeof i.addEventListener)try{i.addEventListener("updateend",N,!1),i.addEventListener("error",O,!1),i.addEventListener("abort",O,!1)}catch(e){o=setInterval(N,50)}else o=setInterval(N,50)}function S(e){return new Promise((function(t){i&&c.get().streaming.buffer.useAppendWindow?P((function(){try{if(!i)return void t();var n=y.duration,a=0;e&&!isNaN(e.start)&&!isNaN(e.duration)&&isFinite(e.duration)&&(n=e.start+e.duration),e&&!isNaN(e.start)&&(a=e.start),i.appendWindowEnd===n&&i.appendWindowStart===a||(i.appendWindowStart=0,i.appendWindowEnd=n+.01,i.appendWindowStart=Math.max(a-.1,0),r.debug("Updated append window for ".concat(s.type,". Set start to ").concat(i.appendWindowStart," and end to ").concat(i.appendWindowEnd))),t()}catch(e){r.warn("Failed to set append window"),t()}})):t()}))}function A(e){return new Promise((function(t){i?P((function(){try{i.timestampOffset===e||isNaN(e)||(i.timestampOffset=e,r.debug("Set MSE timestamp offset to ".concat(e))),t()}catch(e){t()}})):t()}))}function w(){if(!m&&g.length>0){m=!0;var e=g[0];g.splice(0,1);var t=function(){m=!1,g.length>0&&w.call(this),e&&e.data&&e.data.segmentType&&e.data.segmentType!==R.w.INIT_SEGMENT_TYPE&&delete e.data.bytes,e.promise.resolve({chunk:e.data})};try{v=e.request,0===e.data.bytes.byteLength?t.call(this):(i.appendBuffer?i.appendBuffer(e.data.bytes):i.append(e.data.bytes,e.data),P(t.bind(this)))}catch(t){r.fatal('SourceBuffer append failed "'+t+'"'),g.length>0?w():m=!1,delete e.data.bytes,e.promise.reject({chunk:e.data,error:new b.Z(t.code,t.message)})}}}function D(){p.length>0&&(i.updating||(p.shift()(),D()))}function N(){i.updating||D()}function O(e){var t,r,i=e.target||{};t=u.Z.SOURCE_BUFFER_ERROR,r={error:i,lastRequestAppended:v}||{},h.trigger(t,r,{streamId:s.streamInfo.id,mediaType:n})}function P(e){p.push(e),i.updating||D()}return t={getType:function(){return n},getAllBufferRanges:function(){try{return i.buffered}catch(e){return r.error("getAllBufferRanges exception: "+e.message),null}},getBuffer:function(){return i},append:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new Promise((function(r,i){e?(g.push({data:e,promise:{resolve:r,reject:i},request:n}),P(w.bind(t))):i({chunk:e,error:new b.Z(I.APPEND_ERROR_CODE,I.APPEND_ERROR_MESSAGE)})}))},remove:function(e){return new Promise((function(t,n){var r=e.start,a=e.end;r>=0&&a>r?P((function(){try{i.remove(r,a),P((function(){t({from:r,to:a,unintended:!1}),e.resolve&&e.resolve()}))}catch(t){n({from:r,to:a,unintended:!1,error:new b.Z(I.REMOVE_ERROR_CODE,I.REMOVE_ERROR_MESSAGE)}),e.reject&&e.reject(t)}})):t()}))},abort:function(){return new Promise((function(e){try{g=[],"open"===y.readyState?P((function(){try{i&&i.abort(),e()}catch(t){e()}})):i&&i.setTextTrack&&"ended"===y.readyState?(i.abort(),e()):e()}catch(t){e()}}))},reset:function(){if(i){try{p=[],function(){try{"function"==typeof i.removeEventListener&&(i.removeEventListener("updateend",N,!1),i.removeEventListener("error",O,!1),i.removeEventListener("abort",O,!1)),clearInterval(o)}catch(e){r.error(e)}}(),m=!1,g=[],i.getClassName&&"TextSourceBuffer"===i.getClassName()||(r.debug("Removing sourcebuffer from media source"),y.removeSourceBuffer(i))}catch(e){}i=null}v=null},updateTimestampOffset:A,initializeForStreamSwitch:function(e,t,r){n=(s=e).type;var a=s.codec;!function(e){i=e.getBuffer()}(r),E();var o=[];return o.push(new Promise((function(e){P((function(){var t=i.appendWindowStart,n=i.appendWindowEnd;i&&(i.abort(),i.appendWindowStart=t,i.appendWindowEnd=n),e()}))}))),o.push(S(s.streamInfo)),c.get().streaming.buffer.useChangeTypeForTrackSwitch&&o.push(_(a)),t&&void 0!==t.MSETimeOffset&&o.push(A(t.MSETimeOffset)),Promise.all(o)},initializeForFirstUse:function(e,t,r){n=(s=t).type;var o=s.codec;try{if(o.match(/application\/mp4;\s*codecs="(stpp|wvtt).*"/i))return T(e);i=y.addSourceBuffer(o),E();var l=[];return l.push(S(s.streamInfo)),r&&void 0!==r.MSETimeOffset&&l.push(A(r.MSETimeOffset)),Promise.all(l)}catch(t){return s.type==a.Z.TEXT&&!s.isFragmented||-1!==o.indexOf('codecs="stpp')||-1!==o.indexOf('codecs="vtt')||-1!==o.indexOf("text/vtt")?T(e):Promise.reject(t)}},updateAppendWindow:S,changeType:_},r=(0,d.Z)(l).getInstance().getLogger(t),t}D.__dashjs_factory_name="SourceBufferSink";var N=c.Z.getClassFactory(D);function O(e){var t,n,r,i=this.context,a=[],s=e;function o(e,t){return a=a.filter((function(n){return!((isNaN(t)||n.start<t)&&(isNaN(e)||n.end>e))})),Promise.resolve()}return t={getAllBufferRanges:function(){for(var e=[],t=0;t<a.length;t++){var n=a[t];0===e.length||n.start>e[e.length-1].end?e.push({start:n.start,end:n.end}):e[e.length-1].end=n.end}var r={start:function(t){return e[t].start},end:function(t){return e[t].end}};return Object.defineProperty(r,"length",{get:function(){return e.length}}),r},append:function(e){return"InitializationSegment"!==e.segmentType?(a.push(e),a.sort((function(e,t){return e.start-t.start})),r=null):r=e,n.debug("PreBufferSink appended chunk s: "+e.start+"; e: "+e.end),s&&s({chunk:e}),Promise.resolve()},remove:o,abort:function(){return Promise.resolve()},discharge:function(e,t){var n=function(e,t){return a.filter((function(n){return(isNaN(t)||n.start<t)&&(isNaN(e)||n.end>e)}))}(e,t);return r&&(n.push(r),r=null),o(e,t),n},reset:function(){a=[],r=null,s=null},updateTimestampOffset:function(){return Promise.resolve()},waitForUpdateEnd:function(e){e()},getBuffer:function(){return this}},n=(0,d.Z)(i).getInstance().getLogger(t),t}O.__dashjs_factory_name="PreBufferSink";var P=c.Z.getClassFactory(O);function M(){var e={};return{save:function(t){var n=t.streamId,r=t.representationId;e[n]=e[n]||{},e[n][r]=t},extract:function(t,n){return e&&e[t]&&e[t][n]?e[t][n]:null},reset:function(){e={}}}}M.__dashjs_factory_name="InitCache";var x=c.Z.getSingletonFactory(M),L=.01,k="BufferController";function F(e){e=e||{};var t,n,r,i,s,c,h,p,g,m,y,v,_,T,S,A,w,C,D,O,M,F=this.context,U=(0,l.Z)(F).getInstance(),B=e.errHandler,j=e.fragmentModel,q=e.representationController,H=e.adapter,G=e.textController,V=e.abrController,Y=e.playbackController,Z=e.streamInfo,K=e.type,z=e.settings;function W(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new Promise((function(n,r){c=e,g&&t&&"function"==typeof g.discharge?(m=g,$(t).then((function(){n()})).catch((function(e){r(e)}))):n()}))}function X(e){return H.convertRepresentationToRepresentationInfo(q.getRepresentationForQuality(e))}function $(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return new Promise((function(n,r){C&&e?c?(y=!1,Q(e,t).then((function(e){n(e)})).catch((function(e){r(e)}))):(y=!0,function(){var e=this;return new Promise((function(t,n){var r=V.getQualityFor(K,Z.id);g=P(F).create(re.bind(e)),_e(X(r)).then((function(){t(g)})).catch((function(){n()}))}))}().then((function(e){n(e)})).catch((function(e){r(e)}))):n(null)}))}function Q(e,t){return new Promise((function(r,i){var s=V.getQualityFor(K,Z.id);g=N(F).create({mediaSource:c,textController:G,eventBus:U}),function(e,t,n){var r=X(n);return t&&t[K]&&(K===a.Z.VIDEO||K===a.Z.AUDIO)?g.initializeForStreamSwitch(e,r,t[K]):g.initializeForFirstUse(Z,e,r)}(e,t,s).then((function(){return _e(X(s))})).then((function(){r(g)})).catch((function(e){n.fatal("Caught error on create SourceBuffer: "+e),B.error(new b.Z(I.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,I.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+K)),i(e)}))}))}function J(e){z.get().streaming.cacheInitSegments&&(n.info("Init fragment finished loading saving to",K+"'s init cache"),C.save(e.chunk)),n.debug("Append Init fragment",K," with representationId:",e.chunk.representationId," and quality:",e.chunk.quality,", data size:",e.chunk.bytes.byteLength),te(e.chunk)}function ee(e){te(e.chunk,e.request)}function te(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;g&&(g.append(e,t).then((function(e){re(e)})).catch((function(e){re(e)})),e.mediaInfo.type===a.Z.VIDEO&&Ce(u.Z.VIDEO_CHUNK_RECEIVED,{chunk:e}))}function ne(e){if(e&&e.length>0)for(var t=0,r=e.length;t<r;t++)n.debug("Buffered range: "+e.start(t)+" - "+e.end(t)+", currentTime = ",Y.getTime())}function re(e){if(e.error)return 22===e.error.code&&function(){if(w=!0,s=.8*Ae(),n.warn("Quota exceeded, Critical Buffer: "+s),s>0){var e=Math.max(.2*s,1),t=s-e,r=Math.min(z.get().streaming.buffer.bufferTimeAtTopQuality,.9*t),i=Math.min(z.get().streaming.buffer.bufferTimeAtTopQualityLongForm,.9*t),a={streaming:{buffer:{bufferToKeep:parseFloat(e.toFixed(5)),bufferTimeAtTopQuality:parseFloat(r.toFixed(5)),bufferTimeAtTopQualityLongForm:parseFloat(i.toFixed(5))}}};z.update(a)}}(),void(22!==e.error.code&&Ie()||(n.warn("Clearing playback buffer to overcome quota exceed situation"),Ce(u.Z.QUOTA_EXCEEDED,{criticalBufferLevel:s,quotaExceededTime:e.chunk.start}),me(ge())));if(g&&(ce(),w=!1,(T=e.chunk)&&T.endFragment)){T&&!isNaN(T.index)&&(h=Math.max(T.index,h),de());var t=g.getAllBufferRanges();T.segmentType===R.w.MEDIA_SEGMENT_TYPE&&(ne(t),se(),function(){if(!isNaN(M)&&!y)if(K===a.Z.AUDIO||K===a.Z.VIDEO){var e=Y.getTime(),t=ue(e,0),n=ue(M,0);if(t&&n&&t.start===n.start)M=NaN;else{var r=q.getCurrentRepresentation().segmentDuration,i=ue(M,r);i&&(z.get().streaming.buffer.enableSeekDecorrelationFix&&Math.abs(e-M)>r?M<=i.end&&Y.seek(Math.max(M,i.start),!1,!0):e<i.start&&Y.seek(i.start,!1,!0))}}else M=NaN}());var r=!1;v&&(v.indexOf(T)>0&&(r=!0),v=null),T&&!r&&Ce(u.Z.BYTES_APPENDED_END_FRAGMENT,{quality:T.quality,startTime:T.start,index:T.index,bufferedRanges:t,segmentType:T.segmentType,mediaType:K})}}function ie(){return new Promise((function(e,t){var n=ae();if(!n||0===n.length)return se(),void e();me(n).then((function(){e()})).catch((function(e){t(e)}))}))}function ae(e){var t=[],r=g.getAllBufferRanges();if(!r||0===r.length)return t;if(!e&&0!==e||isNaN(e))t.push({start:r.start(0),end:r.end(r.length-1)+.5});else{var i=function(e,t){var n=z.get().streaming.buffer.bufferToKeep,r=t.start(0);if(e-r>n){var i=Math.max(0,e-n),a=j.getRequests({state:E.FRAGMENT_MODEL_EXECUTED,time:e,threshold:L})[0];if(a&&(i=Math.min(a.startTime,i)),i>0)return{start:r,end:i}}return null}(e,r),a=function(e,t){var r=t.end(t.length-1)+.5,i=we(e),a=Z.manifestInfo.duration>=z.get().streaming.buffer.longFormContentDurationThreshold?z.get().streaming.buffer.bufferTimeAtTopQualityLongForm:z.get().streaming.buffer.bufferTimeAtTopQuality,s=isNaN(i)?e:Math.min(i,e+a);if(s>=t.end(t.length-1))return null;var o=j.getRequests({state:E.FRAGMENT_MODEL_EXECUTED,time:e,threshold:L})[0];if(o&&(s=Math.max(o.startTime+o.duration,s)),z.get().streaming.buffer.avoidCurrentTimeRangePruning)for(var l=0;l<t.length;l++)if(t.start(l)<=e&&e<=t.end(l)&&t.start(l)<=s&&s<=t.end(l)){var u=s;s=l+1<t.length?t.start(l+1):t.end(l)+1,n.debug("Buffered range ["+t.start(l)+", "+t.end(l)+"] overlaps with targetTime "+e+" and range to be pruned ["+u+", "+r+"], using ["+s+", "+r+"] instead"+(s<r?"":" (no actual pruning)"));break}return s<t.end(t.length-1)?{start:s,end:r}:null}(e,r);i&&t.push(i),a&&t.push(a)}return t}function se(){(!O||K===a.Z.TEXT&&G.isTextEnabled())&&ce()}function oe(){fe()}function le(){fe(),M=NaN}function ue(e,t){if(!g)return null;var n,r,i=g.getAllBufferRanges(),a=0,s=0,o=null,l=null,u=0,c=isNaN(t)?.15:t;if(null!=i){for(r=0,n=i.length;r<n;r++)if(a=i.start(r),s=i.end(r),null===o)u=Math.abs(a-e),(e>=a&&e<s||u<=c)&&(o=a,l=s);else{if(!((u=a-l)<=c))break;l=s}if(null!==o)return{start:o,end:l}}return null}function ce(){if(Y){var e=Y.getTime()||0;y&&(e=isNaN(M)?0:M);var t=z.get().streaming.gaps.jumpGaps&&!isNaN(z.get().streaming.gaps.smallGapLimit)?z.get().streaming.gaps.smallGapLimit:NaN;i=Math.max(function(e,t){var n;return z.get().streaming.gaps.jumpGaps&&(t=z.get().streaming.gaps.smallGapLimit),null===(n=ue(e,t))?0:n.end-e}(e,t),0),Ce(u.Z.BUFFER_LEVEL_UPDATED,{mediaType:K,bufferLevel:i}),fe()}}function de(){var e=h>=p-1,t=Y.getTimeToStreamEnd(Z)-i<1e-5;!e&&!t||r||(Se(!0),n.debug("checkIfBufferingCompleted trigger BUFFERING_COMPLETED for stream id ".concat(Z.id," and type ").concat(K)))}function fe(){K!==a.Z.AUDIO&&K!==a.Z.VIDEO||((!Y.getLowLatencyModeEnabled()&&i<z.get().streaming.buffer.stallThreshold||0===i)&&!r?he(o.Z.BUFFER_EMPTY):(r||i>=z.get().streaming.buffer.stallThreshold||Y.getLowLatencyModeEnabled()&&i>0)&&he(o.Z.BUFFER_LOADED))}function he(e){_===e||e===o.Z.BUFFER_EMPTY&&0===Y.getTime()||K===a.Z.TEXT&&!G.isTextEnabled()||(_=e,Ce(u.Z.BUFFER_LEVEL_STATE_CHANGED,{state:e}),Ce(e===o.Z.BUFFER_LOADED?u.Z.BUFFER_LOADED:u.Z.BUFFER_EMPTY),n.debug(e===o.Z.BUFFER_LOADED?"Got enough buffer to start":"Waiting for more buffer before starting playback"))}function pe(){g&&K!==a.Z.TEXT&&(r||me(ge()))}function ge(){var e=[],t=g.getAllBufferRanges();if(!t||0===t.length)return e;var n=Y.getTime(),r=Math.max(0,n-z.get().streaming.buffer.bufferToKeep),i=j.getRequests({state:E.FRAGMENT_MODEL_EXECUTED,time:n,threshold:L})[0];if(i)r=Math.min(i.startTime,r);else if(0===n&&Y.getIsDynamic())return[];if(t.start(0)<=r){for(var a={start:0,end:r},s=0;s<t.length&&t.end(s)<=r;s++)a.end=t.end(s);a.start<a.end&&e.push(a)}return e}function me(e){return new Promise((function(t,n){if(e&&g&&0!==e.length){var r=[];e.forEach((function(e){r.push(function(e){return new Promise((function(t,n){e.resolve=t,e.reject=n,D.push(e)}))}(e))})),A||ye(),Promise.all(r).then((function(){t()})).catch((function(e){n(e)}))}else t()}))}function ye(){try{if(0===D.length||!g)return n.debug("Nothing to prune, halt pruning"),D=[],void(A=!1);var e=g.getBuffer();if(!e||!e.buffered||0===e.buffered.length)return n.debug("SourceBuffer is empty (or does not exist), halt pruning"),D=[],void(A=!1);var t=D.shift();n.debug("".concat(K,": Removing buffer from: ").concat(t.start," to ").concat(t.end)),A=!0,Y.getTime()<t.end&&Se(!1),g.remove(t).then((function(e){ve(e)})).catch((function(e){ve(e)}))}catch(e){A=!1}}function ve(e){n.debug("onRemoved buffer from:",e.from,"to",e.to),g&&(ne(g.getAllBufferRanges()),0===D.length&&(A=!1,ce()),e.unintended&&(n.warn("Detected unintended removal from:",e.from,"to",e.to,"setting streamprocessor time to",e.from),Ce(u.Z.SEEK_TARGET,{time:e.from})),A?ye():(O?O=!1:ce(),Ce(u.Z.BUFFER_CLEARED,{from:e.from,to:e.to,unintended:e.unintended,hasEnoughSpaceToAppend:Ie(),quotaExceeded:w})))}function _e(e){return new Promise((function(t){e&&void 0!==e.MSETimeOffset&&g&&g.updateTimestampOffset?g.updateTimestampOffset(e.MSETimeOffset).then((function(){t()})).catch((function(){t()})):t()}))}function Te(){return g&&!r?g.updateAppendWindow(Z):Promise.resolve()}function Ee(){++S*(z.get().streaming.wallclockTimeUpdateInterval/1e3)>=z.get().streaming.buffer.bufferPruningInterval&&(S=0,pe())}function be(){fe()}function Se(e){(r=e)?Ce(u.Z.BUFFERING_COMPLETED):p=Number.POSITIVE_INFINITY}function Ae(){try{var e,t,n=g.getAllBufferRanges(),r=0;if(!n)return r;for(t=0,e=n.length;t<e;t++)r+=n.end(t)-n.start(t);return r}catch(e){return 0}}function we(e){try{var t=e,n=g.getAllBufferRanges();if(!n||0===n.length)return NaN;for(var r=0;t===e&&r<n.length;){var i=n.start(r),a=n.end(r);t>=i&&t<=a&&(t=a),r+=1}return t===e?NaN:t}catch(e){}}function Ie(){var e=Ae();return isNaN(e)||e<s}function Ce(e,t){var n=t||{};U.trigger(e,n,{streamId:Z.id,mediaType:K})}function Re(e,t){if(s=Number.POSITIVE_INFINITY,_=void 0,p=Number.POSITIVE_INFINITY,h=0,T=null,r=!1,A=!1,w=!1,i=0,S=0,D=[],M=NaN,y=!1,g){var n=g;g=null,e||t||n.abort().then((function(){n.reset(t),n=null}))}O=!1}return t={initialize:function(e){W(e),U.on(u.Z.INIT_FRAGMENT_LOADED,J,t),U.on(u.Z.MEDIA_FRAGMENT_LOADED,ee,t),U.on(u.Z.WALLCLOCK_TIME_UPDATED,Ee,t),U.on(f.Z.PLAYBACK_PLAYING,le,t),U.on(f.Z.PLAYBACK_PROGRESS,se,t),U.on(f.Z.PLAYBACK_TIME_UPDATED,se,t),U.on(f.Z.PLAYBACK_RATE_CHANGED,be,t),U.on(f.Z.PLAYBACK_STALLED,oe,t)},getStreamId:function(){return Z.id},getType:function(){return K},getBufferControllerType:function(){return k},createBufferSink:$,dischargePreBuffer:function(){if(g&&m&&"function"==typeof m.discharge){var e=m.getAllBufferRanges();if(e.length>0){for(var t="Beginning "+K+"PreBuffer discharge, adding buffer for:",r=0;r<e.length;r++)t+=" start: "+e.start(r)+", end: "+e.end(r)+";";n.debug(t)}else n.debug("PreBuffer discharge requested, but there were no media segments in the PreBuffer.");v=[];for(var i=m.discharge(),a=null,s=0;s<i.length;s++){var o=i[s];if(o.segmentType!==R.w.INIT_SEGMENT_TYPE){var l=C.extract(o.streamId,o.representationId);l&&a!==l&&(v.push(l),g.append(l),a=l)}v.push(o),g.append(o)}m.reset(),m=null}},getBuffer:function(){return g},getBufferLevel:function(){return i},getRangeAt:ue,hasBufferAtTime:function(e){try{var t=g.getAllBufferRanges();if(!t||0===t.length)return!1;for(var r=0;r<t.length;){var i=t.start(r),a=t.end(r);if(e>=i&&e<=a)return!0;r+=1}return!1}catch(e){return n.error(e),!1}},pruneBuffer:pe,setMediaSource:W,getMediaSource:function(){return c},appendInitSegmentFromCache:function(e){var t=C.extract(Z.id,e);return!!t&&(n.info("Append Init fragment",K," with representationId:",t.representationId," and quality:",t.quality,", data size:",t.bytes.byteLength),te(t),!0)},getIsBufferingCompleted:function(){return r},setIsBufferingCompleted:Se,getIsPruningInProgress:function(){return A},reset:function(e,t){U.off(u.Z.INIT_FRAGMENT_LOADED,J,this),U.off(u.Z.MEDIA_FRAGMENT_LOADED,ee,this),U.off(u.Z.WALLCLOCK_TIME_UPDATED,Ee,this),U.off(f.Z.PLAYBACK_PLAYING,le,this),U.off(f.Z.PLAYBACK_PROGRESS,se,this),U.off(f.Z.PLAYBACK_TIME_UPDATED,se,this),U.off(f.Z.PLAYBACK_RATE_CHANGED,be,this),U.off(f.Z.PLAYBACK_STALLED,oe,this),Re(e,t)},prepareForPlaybackSeek:function(){return r&&Se(!1),g.abort()},prepareForReplacementTrackSwitch:function(e){return new Promise((function(t,n){g.abort().then((function(){return Te()})).then((function(){return z.get().streaming.buffer.useChangeTypeForTrackSwitch?g.changeType(e):Promise.resolve()})).then((function(){return ie()})).then((function(){Se(!1),t()})).catch((function(e){n(e)}))}))},prepareForNonReplacementTrackSwitch:function(e){return new Promise((function(t,n){Te().then((function(){return z.get().streaming.buffer.useChangeTypeForTrackSwitch?g.changeType(e):Promise.resolve()})).then((function(){t()})).catch((function(e){n(e)}))}))},prepareForForceReplacementQualitySwitch:function(e){return new Promise((function(t,n){g.abort().then((function(){return Te()})).then((function(){return ie()})).then((function(){return _e(e)})).then((function(){Se(!1),t()})).catch((function(e){n(e)}))}))},updateAppendWindow:Te,getAllRangesWithSafetyFactor:ae,getContinuousBufferTimeForTargetTime:we,clearBuffers:me,pruneAllSafely:ie,updateBufferTimestampOffset:_e,setSeekTarget:function(e){M=e},segmentRequestingCompleted:function(e){isNaN(e)||(p=e,de())}},n=(0,d.Z)(F).getInstance().getLogger(t),C=x(F).getInstance(),Re(),t}F.__dashjs_factory_name=k;var U=c.Z.getClassFactory(F),B="NotFragmentedTextBufferController";function j(e){e=e||{};var t,n,r,i,a,s,o=this.context,c=(0,l.Z)(o).getInstance(),d=e.textController,f=e.errHandler,h=e.streamInfo,p=e.type;function g(e){i=e}function m(e){var t,r;n!==e&&(n=e)&&(t=u.Z.BUFFERING_COMPLETED,r={},c.trigger(t,r,{streamId:h.id,mediaType:p}))}function y(e){e.chunk.bytes&&!n&&(s.save(e.chunk),a.append(e.chunk),m(!0))}return t={initialize:function(e){g(e)},getStreamId:function(){return h.id},getType:function(){return p},getBufferControllerType:function(){return B},createBufferSink:function(e){return new Promise((function(t,n){try{(a=N(o).create({mediaSource:i,textController:d,eventBus:c})).initializeForFirstUse(h,e),r||(a.getBuffer()&&"function"==typeof a.getBuffer().initialize&&a.getBuffer().initialize(),r=!0),t(a)}catch(e){f.error(new b.Z(I.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,I.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+p)),n(e)}}))},dischargePreBuffer:function(){},getBuffer:function(){return a},getBufferLevel:function(){return 0},getRangeAt:function(){return null},pruneBuffer:function(){},hasBufferAtTime:function(){return!0},getAllRangesWithSafetyFactor:function(){return[]},getContinuousBufferTimeForTargetTime:function(){return Number.POSITIVE_INFINITY},setMediaSource:g,getMediaSource:function(){return i},appendInitSegmentFromCache:function(e){return null!==s.extract(h.id,e)},getIsBufferingCompleted:function(){return n},setIsBufferingCompleted:m,getIsPruningInProgress:function(){return!1},reset:function(e){c.off(u.Z.INIT_FRAGMENT_LOADED,y,t),!e&&a&&(a.abort(),a.reset(),a=null)},clearBuffers:function(){return Promise.resolve()},prepareForPlaybackSeek:function(){return Promise.resolve()},prepareForReplacementTrackSwitch:function(){return n=!1,Promise.resolve()},setSeekTarget:function(){},updateAppendWindow:function(){return Promise.resolve()},pruneAllSafely:function(){return Promise.resolve()},updateBufferTimestampOffset:function(){return Promise.resolve()},segmentRequestingCompleted:function(){}},r=!1,i=null,n=!1,s=x(o).getInstance(),c.on(u.Z.INIT_FRAGMENT_LOADED,y,t),t}j.__dashjs_factory_name=B;var q=c.Z.getClassFactory(j);function H(e){e=e||{};var t,n,r,i,s,c,h,p,g,m,y,v,_,T=this.context,b=(0,l.Z)(T).getInstance(),S=e.dashMetrics,A=e.mediaPlayerModel,w=e.fragmentModel,I=e.abrController,C=e.playbackController,R=e.textController,D=e.type,N=e.bufferController,O=e.representationController,P=e.settings;function M(){v=!0}function x(){v=!1}function L(e){if(!N.getIsBufferingCompleted()){k();var t=isNaN(e)?0:e;s=setTimeout(F,t)}}function k(){s&&(clearTimeout(s),s=null)}function F(){try{if(function(){try{return D===a.Z.TEXT&&!R.isTextEnabled()||C.isPaused()&&(!C.getStreamController().getInitialPlayback()||!C.getStreamController().getAutoPlay())&&!P.get().streaming.scheduling.scheduleWhilePaused}catch(e){return!1}}())return void k();if(function(){try{return!!v&&O.getCurrentRepresentationInfo()&&(isNaN(g)||m||(e=n.id,t=I.getMaxAllowedIndexFor(D,e),!(!isNaN(p)&&p==t||(r.info("Top quality "+D+" index has changed from "+p+" to "+t),p=t,0)))||function(){var e=O.getCurrentRepresentationInfo();return!D||!e||S.getCurrentBufferLevel(D)<U()}())}catch(e){return!1}var e,t}()){var e=!1;_&&(e=I.checkPlaybackQuality(D,n.id)),e||(i=O.getCurrentRepresentationInfo(),y||i.quality!==g||m?(m?(r.debug("Switch track for "+D+", representation id = "+i.id),m=!1):r.debug("Quality has changed, get init request for representationid = "+i.id),b.trigger(u.Z.INIT_FRAGMENT_NEEDED,{representationId:i.id,sender:t},{streamId:n.id,mediaType:D}),_=!1,y=!1):(r.debug("Media segment needed for ".concat(D," and stream id ").concat(n.id)),b.trigger(u.Z.MEDIA_FRAGMENT_NEEDED,{},{streamId:n.id,mediaType:D}),_=!0))}else L(C.getLowLatencyModeEnabled()?P.get().streaming.scheduling.lowLatencyTimeout:P.get().streaming.scheduling.defaultTimeout)}catch(e){L(C.getLowLatencyModeEnabled()?P.get().streaming.scheduling.lowLatencyTimeout:P.get().streaming.scheduling.defaultTimeout)}var i}function U(){var e=NaN,t=O.getCurrentRepresentationInfo();return D&&t?(e=D===a.Z.TEXT?function(){try{if(R.isTextEnabled()){var e=O.getCurrentRepresentationInfo();if(isNaN(e.fragmentDuration)){var t=S.getCurrentSchedulingInfo(o.Z.SCHEDULING_INFO);return t?t.duration:0}return e.fragmentDuration}return 0}catch(e){return 0}}():D===a.Z.AUDIO&&c?function(){try{var e=S.getCurrentBufferLevel(a.Z.VIDEO),t=O.getCurrentRepresentationInfo();return isNaN(t.fragmentDuration)?e+1:Math.max(e+1,t.fragmentDuration)}catch(e){return 0}}():function(){try{var e=O.getCurrentRepresentationInfo().mediaInfo.streamInfo;return I.isPlayingAtTopQuality(e)?e.manifestInfo.duration>=P.get().streaming.buffer.longFormContentDurationThreshold?P.get().streaming.buffer.bufferTimeAtTopQualityLongForm:P.get().streaming.buffer.bufferTimeAtTopQuality:A.getStableBufferTime()}catch(e){return A.getStableBufferTime()}}(),e):e}function B(){j(!0)}function j(e){if(C&&w){var t=w.getRequests({state:E.FRAGMENT_MODEL_EXECUTED,time:C.getTime(),threshold:0})[0];t&&C.getTime()>=t.startTime&&((!h.mediaInfo||t.mediaInfo.type===h.mediaInfo.type&&t.mediaInfo.index!==h.mediaInfo.index)&&e&&b.trigger(u.Z.TRACK_CHANGE_RENDERED,{mediaType:D,oldMediaInfo:h.mediaInfo,newMediaInfo:t.mediaInfo,streamId:n.id}),t.quality===h.quality&&t.adaptationIndex===h.adaptationIndex||!e||(r.debug("Quality change rendered for streamId ".concat(n.id," and type ").concat(D)),b.trigger(u.Z.QUALITY_CHANGE_RENDERED,{mediaType:D,oldQuality:h.quality,newQuality:t.quality,streamId:n.id})),h={mediaInfo:t.mediaInfo,quality:t.quality,adaptationIndex:t.adaptationIndex})}}function q(){w.abortRequests(),k()}function H(){P.get().streaming.scheduling.scheduleWhilePaused||L()}function G(e){S.updatePlayListTraceMetrics({playbackspeed:e.playbackRate.toString()})}function V(){_=!0,i=0,g=NaN,h={mediaInfo:void 0,quality:NaN,adaptationIndex:NaN},p=NaN,m=!1,y=!1,v=!0}return t={initialize:function(e){c=e,b.on(u.Z.URL_RESOLUTION_FAILED,q,t),b.on(f.Z.PLAYBACK_STARTED,H,t),b.on(f.Z.PLAYBACK_RATE_CHANGED,G,t),b.on(f.Z.PLAYBACK_TIME_UPDATED,B,t),b.on(f.Z.MANAGED_MEDIA_SOURCE_START_STREAMING,M,t),b.on(f.Z.MANAGED_MEDIA_SOURCE_END_STREAMING,x,t)},getType:function(){return D},getStreamId:function(){return n.id},setTimeToLoadDelay:function(e){i=e},getTimeToLoadDelay:function(){return i},setSwitchTrack:function(e){m=e},getSwitchTrack:function(){return m},startScheduleTimer:L,clearScheduleTimer:k,reset:function(){b.off(u.Z.URL_RESOLUTION_FAILED,q,t),b.off(f.Z.PLAYBACK_STARTED,H,t),b.off(f.Z.PLAYBACK_RATE_CHANGED,G,t),b.off(f.Z.PLAYBACK_TIME_UPDATED,B,t),b.off(f.Z.MANAGED_MEDIA_SOURCE_START_STREAMING,M,t),b.off(f.Z.MANAGED_MEDIA_SOURCE_END_STREAMING,x,t),k(),j(!1),V(),n=null},getBufferTarget:U,getPlaybackController:function(){return C},setCheckPlaybackQuality:function(e){_=e},setInitSegmentRequired:function(e){y=e},setLastInitializedQuality:function(e){g=e}},r=(0,d.Z)(T).getInstance().getLogger(t),V(),n=e.streamInfo,t}H.__dashjs_factory_name="ScheduleController";var G=c.Z.getClassFactory(H),V=n(7387);function Y(e){var t,n,r,i,s,o,l=(e=e||{}).eventBus,u=e.events,c=e.abrController,d=e.dashMetrics,h=e.playbackController,p=e.timelineConverter,g=e.type,m=e.streamInfo,y=e.dashConstants,v=e.segmentsController,_=e.isDynamic,T=e.adapter;function E(){return g}function b(){return r}function S(){return o}function A(){n=null,r=!0,i=[],s=null}function w(e){return new Promise((function(t,n){var r=e.hasInitialization(),a=e.hasSegments(),s=[];s.push(v.updateInitData(e,r)),s.push(v.updateSegmentData(e,a)),Promise.all(s).then((function(n){var r;n[0]&&!n[0].error&&(e=function(e,t){return t&&!t.error&&t.representation?t.representation:e}(e,n[0])),n[1]&&!n[1].error&&(e=function(e,t){if(t&&!t.error){var n,r,i,a,s=t.segments,o=[],l=0;for(n=0,r=s?s.length:0;n<r;n++)i=s[n],(a=(0,V.TJ)(p,_,e,i.startTime,i.duration,i.timescale,i.media,i.mediaRange,l))&&(o.push(a),a=null,l++);return o.length>0&&(e.segments=o),e}}(e,n[1])),(r=e).mediaFinishedInformation=v.getMediaFinishedInformation(r),function(e){if(b()){var t,n,r=d.getCurrentManifestUpdate(),a=!1;if(r){for(var s=0;s<r.representationInfo.length;s++)if((t=r.representationInfo[s]).index===e.index&&t.mediaType===E()){a=!0;break}a||d.addManifestUpdateRepresentationInfo(e,E())}if(function(){for(var e=0,t=i.length;e<t;e++){var n=i[e].segmentInfoType;if(!i[e].hasInitialization()||(n===y.SEGMENT_BASE||n===y.BASE_URL)&&!i[e].segments)return!1}return!0}()){c.setPlaybackQuality(g,m,(n=o,i.indexOf(n)));var l=d.getCurrentDVRInfo(g);l&&d.updateManifestUpdateInfo({latency:l.range.end-h.getTime()}),d.getCurrentRepresentationSwitch(S().adaptation.type)||I(),R()}}}(e),t()})).catch((function(e){n(e)}))}))}function I(){!function(){if(!(c&&d&&h&&p))throw new Error(a.Z.MISSING_CONFIG_ERROR)}();var e=new Date,t=S(),n=1e3*h.getTime();t&&d.addRepresentationSwitch(t.adaptation.type,e,n,t.id),l.trigger(f.Z.REPRESENTATION_SWITCH,{mediaType:g,streamId:m.id,currentRepresentation:t,numberOfRepresentations:i.length},{streamId:m.id,mediaType:g})}function C(e){return null==e||e>=i.length?null:i[e]}function R(e){r=!1,l.trigger(u.DATA_UPDATE_COMPLETED,{data:n,currentRepresentation:o,error:e},{streamId:m.id,mediaType:g})}function D(e){o=e,s=T.convertRepresentationToRepresentationInfo(o)}function N(e){if(e.newDuration){var t=S();t&&t.adaptation.period&&(t.adaptation.period.duration=e.newDuration)}}return t={getStreamId:function(){return m.id},getType:E,getData:function(){return n},isUpdating:b,updateData:function(e,t,s,o,l){return new Promise((function(u,c){if(r=!0,i=t,n=e,D(C(l)),s!==a.Z.VIDEO&&s!==a.Z.AUDIO&&(s!==a.Z.TEXT||!o))return R(),void u();for(var d=[],f=0,h=i.length;f<h;f++){var p=i[f];d.push(w(p))}Promise.all(d).then((function(){D(C(l)),u()})).catch((function(e){c(e)}))}))},getCurrentRepresentation:S,getCurrentRepresentationInfo:function(){return s},getRepresentationForQuality:C,prepareQualityChange:function(e){D(C(e)),I()},reset:function(){l.off(f.Z.MANIFEST_VALIDITY_CHANGED,N,t),A()}},A(),l.on(f.Z.MANIFEST_VALIDITY_CHANGED,N,t),t}Y.__dashjs_factory_name="RepresentationController";var Z=c.Z.getClassFactory(Y),K=n(3106),z=n(9326),W=n(7473),X=n(2594);function $(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Q=function e(){$(this,e),this.start=null,this.mstart=null,this.starttype=null,this.trace=[]};Q.INITIAL_PLAYOUT_START_REASON="initial_playout",Q.SEEK_START_REASON="seek",Q.RESUME_FROM_PAUSE_START_REASON="resume",Q.METRICS_COLLECTION_START_REASON="metrics_collection_start";var J=function e(){$(this,e),this.representationid=null,this.subreplevel=null,this.start=null,this.mstart=null,this.duration=null,this.playbackspeed=null,this.stopreason=null};J.REPRESENTATION_SWITCH_STOP_REASON="representation_switch",J.REBUFFERING_REASON="rebuffering",J.USER_REQUEST_STOP_REASON="user_request",J.END_OF_PERIOD_STOP_REASON="end_of_period",J.END_OF_CONTENT_STOP_REASON="end_of_content",J.METRICS_COLLECTION_STOP_REASON="metrics_collection_end",J.FAILURE_STOP_REASON="failure";var ee=n(7802);function te(){return{ntpToUTC:function(e){var t=new Date(Date.UTC(1900,0,1,0,0,0));return new Date(t.getTime()+e).getTime()}}}te.__dashjs_factory_name="TimeUtils";var ne=c.Z.getSingletonFactory(te);function re(e){e=e||{};var t,n,r,i,c,h,p,g,m,y,v,_,T,S,A,w=this.context,C=(0,l.Z)(w).getInstance(),D=e.streamInfo,N=e.type,O=e.errHandler,P=e.mimeType,M=e.timelineConverter,x=e.adapter,L=e.manifestModel,k=e.mediaPlayerModel,F=e.fragmentModel,B=e.abrController,j=e.playbackController,H=e.mediaController,V=e.textController,Y=e.dashMetrics,$=e.settings,Q=e.boxParser,te=e.segmentBlacklistController;function re(){return D.id}function ie(){return N}function ae(){return x.getIsTextTrack(g.getData())}function se(){c=[],i=null,S=0,m=!1,y=!1,v=!1,A=null}function oe(e){return!isNaN(e)&&!isNaN(D.duration)&&isFinite(D.duration)&&e>=D.start+D.duration}function le(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e.sender)if(j.getIsManifestUpdateInProgress())fe();else if((!ae()||V.isTextEnabled())&&h&&e.representationId&&!h.appendInitSegmentFromCache(e.representationId)){var n=g.getCurrentRepresentation();if(0===n.range)return void ue();var r=_?_.getInitRequest(i,n):null;r?F.executeRequest(r):t&&(p.setInitSegmentRequired(!0),fe())}}function ue(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(j.getIsManifestUpdateInProgress()||h.getIsPruningInProgress())fe();else{var n=function(){var e,t=Ce();if(isNaN(S)||ie()===a.Z.TEXT&&!V.isTextEnabled())return null;if(_){var n=g&&t?g.getRepresentationForQuality(t.quality):null;e=m?_.getSegmentRequestForTime(i,n,S):y?_.repeatSegmentRequest(i,n):_.getNextSegmentRequest(i,n)}return e}();n?(m=!1,y=!1,ce(n)):de(t)}}function ce(e){isNaN(e.startTime+e.duration)||(S=e.startTime+e.duration),e.delayLoadingTime=(new Date).getTime()+p.getTimeToLoadDelay(),p.setTimeToLoadDelay(0),function(e){var t=e.url;return e.range&&(t=t.concat("_",e.range)),te.contains(t)}(e)?(n.warn("Fragment request url ".concat(e.url," for stream id ").concat(D.id," and media type ").concat(N," is on the ignore list and will be skipped")),fe()):(n.debug("Next fragment request url for stream id ".concat(D.id," and media type ").concat(N," is ").concat(e.url)),F.executeRequest(e))}function de(e){var t,a=g.getCurrentRepresentation();if(!$.get().streaming.gaps.enableSeekFix||!m&&0!==j.getTime()||(r?r&&a.segmentInfoType===s.Z.SEGMENT_TIMELINE&&(t=_.getValidTimeAheadOfTargetTime(S,i,a,$.get().streaming.gaps.threshold)):t=_.getValidTimeAheadOfTargetTime(S,i,a,$.get().streaming.gaps.threshold),isNaN(t)||t===S)){if(_.isLastSegmentRequested(a,S)){var o=_.getCurrentIndex();return n.debug("Segment requesting for stream ".concat(D.id," has finished")),C.trigger(u.Z.STREAM_REQUESTING_COMPLETED,{segmentIndex:o},{streamId:D.id,mediaType:N}),h.segmentRequestingCompleted(o),void p.clearScheduleTimer()}e&&fe()}else j.isSeeking()||0===j.getTime()?(n.warn("Adjusting playback time ".concat(t," because of gap in the manifest. Seeking by ").concat(t-S)),j.seek(t,!1,!1)):(n.warn("Adjusting buffering time ".concat(t," because of gap in the manifest. Adjusting time by ").concat(t-S)),xe(t),e&&fe())}function fe(){p.startScheduleTimer(j.getLowLatencyModeEnabled()?$.get().streaming.scheduling.lowLatencyTimeout:$.get().streaming.scheduling.defaultTimeout)}function he(e){e.error||h.getIsBufferingCompleted()||h.updateBufferTimestampOffset(e.currentRepresentation)}function pe(e){Y.addBufferState(N,e.state,p.getBufferTarget()),e.state!==o.Z.BUFFER_EMPTY||j.isSeeking()||(n.info("Buffer is empty! Stalling!"),Y.pushPlayListTraceMetrics(new Date,J.REBUFFERING_REASON))}function ge(e){F.syncExecutedRequestsWithBufferedRange(h.getBuffer().getAllBufferRanges(),D.duration),e.quotaExceeded&&e.from>j.getTime()&&xe(e.from),e.hasEnoughSpaceToAppend&&e.quotaExceeded&&p.startScheduleTimer()}function me(e){if(e&&e.lastRequestAppended&&e.lastRequestAppended.url){var t=e.lastRequestAppended.url;e.lastRequestAppended.range&&(t=t.concat("_",e.lastRequestAppended.range)),n.warn("Blacklisting segment with url ".concat(t)),te.add(t)}}function ye(e){if(n.debug("Appended bytes for ".concat(e.mediaType," and stream id ").concat(e.streamId)),e.segmentType===R.w.INIT_SEGMENT_TYPE){var t=e.quality;p.setLastInitializedQuality(t),n.info("["+N+"] lastInitializedRepresentationInfo changed to "+e.quality)}A?ve(A):p.startScheduleTimer(0)}function ve(e){var t=F.getRequests({state:E.FRAGMENT_MODEL_LOADING});if(t&&t.length>0)return n.debug("Preparing for default quality switch: Waiting for ongoing segment request to be finished before applying switch."),void(A=e);h.updateBufferTimestampOffset(e).then((function(){p.setCheckPlaybackQuality(!1),i.segmentAlignment||i.subSegmentAlignment?p.startScheduleTimer():Pe(),A=null,v=!1})).catch((function(){A=null,v=!1}))}function _e(e){n.info("onFragmentLoadingAbandoned request: "+e.request.url+" has been aborted"),j.isSeeking()||p.getSwitchTrack()||v||(n.info("onFragmentLoadingAbandoned request: "+e.request.url+" has to be downloaded again, origin is not seeking process or switch track call"),e.request&&e.request.isInitializationRequest()?p.setInitSegmentRequired(!0):xe(e.request.startTime+e.request.duration/2),p.startScheduleTimer(0))}function Te(e){n.info("OnFragmentLoadingCompleted for stream id "+D.id+" and media type "+N+" - Url:",e.request?e.request.url:"undefined",e.request.range?", Range:"+e.request.range:""),ae()&&p.startScheduleTimer(0),e.error&&e.request.serviceLocation&&function(e){n.info("Fragment loading completed with an error"),e&&e.request&&e.request.type&&(e.request.type===R.w.INIT_SEGMENT_TYPE?le({representationId:e.request.representationId,sender:{}},!1):e.request.type===R.w.MEDIA_SEGMENT_TYPE&&(xe(e.request.startTime+e.request.duration/2),ue({},!1)))}(e)}function Ee(){xe(j.getTime()),Ie().startScheduleTimer()}function be(e){var t=e.currentTrackInfo;if(t){var n=c.find((function(e){return e.index===t.index&&e.lang===t.lang}));n&&we(n).then((function(){h.setIsBufferingCompleted(!1),xe(j.getTime()),p.setInitSegmentRequired(!0),p.startScheduleTimer()}))}}function Se(e){xe(e.quotaExceededTime),p.clearScheduleTimer()}function Ae(){return h?h.getBuffer():null}function we(e){e===i||e&&i&&e.type!==i.type||(i=e);var t=x.getRealAdaptation(D,i),n=x.getVoRepresentations(i);if(g){var s,o=g.getData(),l=B.getMaxAllowedIndexFor(N,D.id),u=B.getMinAllowedIndexFor(N,D.id),c=null;return null!==o&&o.id===t.id||N===a.Z.TEXT?s=B.getQualityFor(N,D.id):(c=B.getThroughputHistory().getAverageThroughput(N,r)||B.getInitialBitrateFor(N,D.id),s=B.getQualityForBitrate(i,c,D.id)),void 0!==u&&s<u&&(s=u),s>l&&(s=l),g.updateData(t,n,N,i.isFragmented,s)}return Promise.resolve()}function Ie(){return p}function Ce(e){var t;return void 0!==e?((0,K.SE)(e),t=g?g.getRepresentationForQuality(e):null):t=g?g.getCurrentRepresentation():null,x.convertRepresentationToRepresentationInfo(t)}function Re(){return!!h&&h.getIsBufferingCompleted()}function De(e){if($.get().streaming.enableManifestTimescaleMismatchFix){var t=e.chunk,n=t.bytes,r=Ce(t.quality),i=g&&r?g.getRepresentationForQuality(r.quality):null;r&&i&&(i.timescale=Q.getMediaTimescaleFromMoov(n))}}function Ne(e){var t=e.chunk,n=t.bytes,r=t.quality,i=Ce(r),a=g&&i?g.getRepresentationForQuality(i.quality):null;if(i&&a){var o;if($.get().streaming.parseInbandPrft&&e.request.type===R.w.MEDIA_SEGMENT_TYPE){var l=function(e,t){var n=e.getBoxes("prft"),r=[];return n.forEach((function(e){r.push(function(e,t){var n="unknown";switch(e.flags){case 0:n=s.Z.PRODUCER_REFERENCE_TIME_TYPE.ENCODER;break;case 16:n=s.Z.PRODUCER_REFERENCE_TIME_TYPE.APPLICATION;break;case 24:n=s.Z.PRODUCER_REFERENCE_TIME_TYPE.CAPTURED}var r=1e3*e.ntp_timestamp_sec+e.ntp_timestamp_frac/Math.pow(2,32)*1e3;return{type:n,ntpTimestamp:r=ne(w).getInstance().ntpToUTC(r),mediaTime:e.media_time/t}}(e,t))})),r}(o=o||Q.parse(n),a.timescale);l&&l.length&&C.trigger(f.Z.INBAND_PRFT,{data:l},{streamId:D.id,mediaType:N})}var c=x.getEventsFor(i.mediaInfo,null,D),d=x.getEventsFor(i,a,D);if(c&&c.length>0||d&&d.length>0){var h=F.getRequests({state:E.FRAGMENT_MODEL_EXECUTED,quality:r,index:t.index})[0],p=function(e,t,n,r){try{for(var i={},a=[],s=n.concat(r),o=0,l=s.length;o<l;o++)i[s[o].schemeIdUri+"/"+s[o].value]=s[o];var u=e.getBoxes("emsg");if(!u||0===u.length)return a;for(var c=e.getBox("sidx"),d=!c||isNaN(c.earliest_presentation_time)||isNaN(c.timescale)?t&&!isNaN(t.mediaStartTime)?t.mediaStartTime:0:c.earliest_presentation_time/c.timescale,f=Math.max(d,0),h=g.getCurrentRepresentation(),p=0,m=u.length;p<m;p++){var y=x.getEvent(u[p],i,f,h);y&&a.push(y)}return a}catch(e){return[]}}(o=o||Q.parse(n),h,c,d);C.trigger(u.Z.INBAND_EVENTS,{events:p},{streamId:D.id})}}}function Oe(){var e=j.getTime();$.get().streaming.buffer.flushBufferAtTrackSwitch&&j.seek(e+.001,!1,!0),xe(e),h.setSeekTarget(e),p.startScheduleTimer()}function Pe(){var e=j.getTime(),t=h.getContinuousBufferTimeForTargetTime(e);xe(isNaN(t)?e:t),p.startScheduleTimer()}function Me(e){e&&!isNaN(e.time)&&(xe(e.time),h.setSeekTarget(e.time))}function xe(e){S=e,m=!0}return t={initialize:function(n,i,o){T=(0,ee.Z)(w).create({events:u.Z,eventBus:C,streamInfo:D,timelineConverter:M,dashConstants:s.Z,segmentBaseController:e.segmentBaseController,type:N}),_=(0,z.Z)(w).create({streamInfo:D,type:N,timelineConverter:M,dashMetrics:Y,mediaPlayerModel:k,baseURLController:e.baseURLController,errHandler:O,segmentsController:T,settings:$,boxParser:Q,events:u.Z,eventBus:C,errors:I,debug:(0,d.Z)(w).getInstance(),requestModifier:(0,W.Z)(w).getInstance(),dashConstants:s.Z,constants:a.Z,urlUtils:(0,X.Z)(w).getInstance()}),r=D.manifestInfo.isDynamic,_.initialize(r),B.registerStreamType(N,t),g=Z(w).create({streamInfo:D,type:N,abrController:B,dashMetrics:Y,playbackController:j,timelineConverter:M,dashConstants:s.Z,events:u.Z,eventBus:C,errors:I,isDynamic:r,adapter:x,segmentsController:T}),h=function(e,t){return e?e!==a.Z.TEXT||t?U(w).create({streamInfo:D,type:e,mediaPlayerModel:k,manifestModel:L,fragmentModel:F,errHandler:O,mediaController:H,representationController:g,adapter:x,textController:V,abrController:B,playbackController:j,settings:$}):q(w).create({streamInfo:D,type:e,mimeType:P,fragmentModel:F,textController:V,errHandler:O,settings:$}):(O.error(new b.Z(I.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,I.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+"not properly defined")),null)}(N,o),h&&h.initialize(n),(p=G(w).create({streamInfo:D,type:N,mimeType:P,adapter:x,dashMetrics:Y,mediaPlayerModel:k,fragmentModel:F,abrController:B,playbackController:j,textController:V,mediaController:H,bufferController:h,representationController:g,settings:$})).initialize(i),S=0,m=!1,y=!1},getStreamId:re,getType:ie,isUpdating:function(){return!!g&&g.isUpdating()},getBufferController:function(){return h},dischargePreBuffer:function(){h.dischargePreBuffer()},getFragmentModel:function(){return F},getScheduleController:Ie,getRepresentationController:function(){return g},getRepresentationInfo:Ce,getBufferLevel:function(){return h?h.getBufferLevel():0},isBufferingCompleted:Re,createBufferSinks:function(e){var t=Ae();return t?Promise.resolve(t):h?h.createBufferSink(i,e):Promise.resolve(null)},updateStreamInfo:function(e){return D=e,Re()?Promise.resolve():h.updateAppendWindow()},getStreamInfo:function(){return D},selectMediaInfo:we,clearMediaInfoArray:function(){c=[]},addMediaInfo:function(e){-1===c.indexOf(e)&&c.push(e)},prepareTrackSwitch:function(){return new Promise((function(e){n.debug("Preparing track switch for type ".concat(N));var t=N===a.Z.TEXT||$.get().streaming.trackSwitchMode[N]===a.Z.TRACK_SWITCH_MODE_ALWAYS_REPLACE&&j.getTimeToStreamEnd(D)>$.get().streaming.buffer.stallThreshold;if(h.getIsBufferingCompleted()&&!t)return h.prepareForNonReplacementTrackSwitch(i.codec).then((function(){C.trigger(u.Z.BUFFERING_COMPLETED,{},{streamId:D.id,mediaType:N})})).catch((function(){C.trigger(u.Z.BUFFERING_COMPLETED,{},{streamId:D.id,mediaType:N})})),void e();p.clearScheduleTimer(),p.setSwitchTrack(!0),t?(C.trigger(u.Z.BUFFER_REPLACEMENT_STARTED,{mediaType:N,streamId:D.id},{mediaType:N,streamId:D.id}),F.abortRequests(),h.prepareForReplacementTrackSwitch(i.codec).then((function(){var e=Ce();return h.updateBufferTimestampOffset(e)})).then((function(){Oe(),e()})).catch((function(){Oe(),e()}))):h.prepareForNonReplacementTrackSwitch(i.codec).then((function(){Pe(),e()})).catch((function(){Pe(),e()}))}))},prepareQualityChange:function(e){A&&n.warn("Canceling queued representation switch to ".concat(A.quality," for ").concat(N)),n.debug("Preparing quality switch for type ".concat(N));var t=e.newQuality;v=!0,p.clearScheduleTimer(),g.prepareQualityChange(t);var r=Ce(t);e.reason&&e.reason.forceReplace?function(e){F.abortRequests(),C.trigger(u.Z.BUFFER_REPLACEMENT_STARTED,{mediaType:N,streamId:D.id},{mediaType:N,streamId:D.id}),p.setCheckPlaybackQuality(!1),h.prepareForForceReplacementQualitySwitch(e).then((function(){Oe(),A=null,v=!1})).catch((function(){Oe(),A=null,v=!1}))}(r):e&&e.reason&&e.reason.forceAbandon?function(e){h.updateBufferTimestampOffset(e).then((function(){F.abortRequests(),y=!0,p.setCheckPlaybackQuality(!1),p.startScheduleTimer(),v=!1,A=null})).catch((function(){A=null,v=!1}))}(r):$.get().streaming.buffer.fastSwitchEnabled?function(e){var t=j.getTime(),n=1.5*(isNaN(e.fragmentDuration)?1:e.fragmentDuration),r=F.getRequests({state:E.FRAGMENT_MODEL_EXECUTED,time:t+n,threshold:0})[0];if(r&&!ae()){var i=h.getBufferLevel(),a=B.getAbandonmentStateFor(D.id,N);r.quality<e.quality&&i>=n&&a!==o.Z.ABANDON_LOAD?h.updateBufferTimestampOffset(e).then((function(){F.abortRequests(),xe(t+n),p.setCheckPlaybackQuality(!1),p.startScheduleTimer(),v=!1})).catch((function(){v=!1})):ve(e)}else ve(e)}(r):ve(r),Y.pushPlayListTraceMetrics(new Date,J.REPRESENTATION_SWITCH_STOP_REASON),Y.createPlaylistTraceMetrics(r.id,1e3*j.getTime(),j.getPlaybackRate())},getMediaInfo:function(){return i},getMediaSource:function(){return h.getMediaSource()},setMediaSource:function(e){return h.setMediaSource(e,i)},getBuffer:Ae,setExplicitBufferingTime:xe,finalisePlayList:function(e,t){Y.pushPlayListTraceMetrics(e,t)},probeNextRequest:function(){var e=Ce(),t=g&&e?g.getRepresentationForQuality(e.quality):null;return _.getNextSegmentRequestIdempotent(i,t)},prepareInnerPeriodPlaybackSeeking:function(e){return new Promise((function(t){if(h.hasBufferAtTime(e.seekTime))return h.pruneBuffer(),oe(h.getContinuousBufferTimeForTargetTime(e.seekTime))&&h.setIsBufferingCompleted(!0),void t();p.clearScheduleTimer(),F.abortRequests(),h.prepareForPlaybackSeek().then((function(){var t=h.getAllRangesWithSafetyFactor(e.seekTime);return h.clearBuffers(t)})).then((function(){var n=h.getContinuousBufferTimeForTargetTime(e.seekTime);if(oe(n))h.setIsBufferingCompleted(!0),t();else{var r=isNaN(n)?e.seekTime:n;xe(r),h.setSeekTarget(r);var i=[];i.push(h.updateAppendWindow());var a=Ce();i.push(h.updateBufferTimestampOffset(a)),Promise.all(i).then((function(){p.setInitSegmentRequired(!0),p.setCheckPlaybackQuality(!1),p.startScheduleTimer(),t()}))}})).catch((function(e){n.error(e)}))}))},prepareOuterPeriodPlaybackSeeking:function(){return new Promise((function(e,t){try{p.clearScheduleTimer(),F.abortRequests(),h.prepareForPlaybackSeek().then((function(){return h.pruneAllSafely()})).then((function(){e()}))}catch(e){t(e)}}))},reset:function(e,n){_&&_.reset(),h&&(h.reset(e,n),h=null),p&&(p.reset(),p=null),g&&(g.reset(),g=null),T&&(T=null),B&&B.unRegisterStreamType(re(),N),C.off(u.Z.DATA_UPDATE_COMPLETED,he,t),C.off(u.Z.INIT_FRAGMENT_NEEDED,le,t),C.off(u.Z.MEDIA_FRAGMENT_NEEDED,ue,t),C.off(u.Z.INIT_FRAGMENT_LOADED,De,t),C.off(u.Z.MEDIA_FRAGMENT_LOADED,Ne,t),C.off(u.Z.BUFFER_LEVEL_STATE_CHANGED,pe,t),C.off(u.Z.BUFFER_CLEARED,ge,t),C.off(u.Z.SEEK_TARGET,Me,t),C.off(u.Z.FRAGMENT_LOADING_ABANDONED,_e,t),C.off(u.Z.FRAGMENT_LOADING_COMPLETED,Te,t),C.off(u.Z.SET_FRAGMENTED_TEXT_AFTER_DISABLED,Ee,t),C.off(u.Z.SET_NON_FRAGMENTED_TEXT,be,t),C.off(u.Z.QUOTA_EXCEEDED,Se,t),C.off(u.Z.SOURCE_BUFFER_ERROR,me,t),C.off(u.Z.BYTES_APPENDED_END_FRAGMENT,ye,t),se(),N=null,D=null}},n=(0,d.Z)(w).getInstance().getLogger(t),se(),C.on(u.Z.DATA_UPDATE_COMPLETED,he,t,{priority:l.Z.EVENT_PRIORITY_HIGH}),C.on(u.Z.INIT_FRAGMENT_NEEDED,le,t),C.on(u.Z.MEDIA_FRAGMENT_NEEDED,ue,t),C.on(u.Z.INIT_FRAGMENT_LOADED,De,t),C.on(u.Z.MEDIA_FRAGMENT_LOADED,Ne,t),C.on(u.Z.BUFFER_LEVEL_STATE_CHANGED,pe,t),C.on(u.Z.BUFFER_CLEARED,ge,t),C.on(u.Z.SEEK_TARGET,Me,t),C.on(u.Z.FRAGMENT_LOADING_ABANDONED,_e,t),C.on(u.Z.FRAGMENT_LOADING_COMPLETED,Te,t),C.on(u.Z.QUOTA_EXCEEDED,Se,t),C.on(u.Z.SET_FRAGMENTED_TEXT_AFTER_DISABLED,Ee,t),C.on(u.Z.SET_NON_FRAGMENTED_TEXT,be,t),C.on(u.Z.SOURCE_BUFFER_ERROR,me,t),C.on(u.Z.BYTES_APPENDED_END_FRAGMENT,ye,t),t}re.__dashjs_factory_name="StreamProcessor";var ie=c.Z.getClassFactory(re),ae=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.streamId=null,this.mediaInfo=null,this.segmentType=null,this.quality=NaN,this.index=NaN,this.bytes=null,this.start=NaN,this.end=NaN,this.duration=NaN,this.representationId=null,this.endFragment=null},se=n(9032);function oe(e,t){if(e){if("string"==typeof e)return le(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?le(e,t):void 0}}function le(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ue(e){e=e||{};var t,n,r=this.context,i=e.requestModifier,s=e.lowLatencyThroughputModel,o=e.boxParser,l=(0,C.Z)(r).getInstance();function u(e){var t,r=new Date,u=e.request,f=new Headers;if(u.range&&f.append("Range","bytes="+u.range),e.headers)for(var h in e.headers){var p=e.headers[h];p&&f.append(h,p)}u.requestStartDate||(u.requestStartDate=r),i&&i.modifyRequestHeader&&i.modifyRequestHeader({setRequestHeader:function(e,t){f.append(e,t)}},{url:e.url}),"function"==typeof window.AbortController&&(t=new AbortController,e.abortController=t,t.signal.onabort=e.onabort);var g={method:e.method,headers:f,credentials:e.withCredentials?"include":void 0,signal:t?t.signal:void 0},m=l.get().streaming.abr.fetchThroughputCalculationMode,y=Date.now(),v=0;new Promise((function(e){if(m===a.Z.ABR_FETCH_THROUGHPUT_CALCULATION_AAST&&s&&(v=s.getThroughputCapacityDelayMS(u,1e3*n.getCurrentBufferLevel(u.mediaType))))return setTimeout(e,v);e()})).then((function(){var t=Date.now();fetch(e.url,g).then((function(r){e.response||(e.response={}),e.response.status=r.status,e.response.statusText=r.statusText,e.response.responseURL=r.url,r.ok||e.onerror();var i,l="",f=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=oe(e))){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}(r.headers.keys());try{for(f.s();!(i=f.n()).done;){var h=i.value;l+=h+": "+r.headers.get(h)+"\r\n"}}catch(e){f.e(e)}finally{f.f()}if(e.response.responseHeaders=l,!r.body)return r.arrayBuffer().then((function(t){e.response.response=t;var n={loaded:t.byteLength,total:t.byteLength,stream:!1};e.progress(n),e.onload(),e.onend()}));var p,g,_,T=parseInt(r.headers.get("Content-Length"),10),E=0,b=!1,S=new Uint8Array,A=0;if(m===a.Z.ABR_FETCH_THROUGHPUT_CALCULATION_AAST&&s){var w=t,I=0,C=(2,function(e){if(Array.isArray(e))return e}(_=r.body.tee())||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,a=void 0;try{for(var s,o=e[Symbol.iterator]();!(r=(s=o.next()).done)&&(n.push(s.value),2!==n.length);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==o.return||o.return()}finally{if(i)throw a}}return n}}(_)||oe(_,2)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),R=C[0],D=C[1];p=R.getReader(),g=[],p.read().then((function r(i){var a=i.value,o=i.done;if(I=Date.now(),a&&a.length){var c=I-w,d=a.length;g.push({chunkDownloadTimeRelativeMS:I-t,chunkDownloadDurationMS:c,chunkBytes:d,kbps:Math.round(8*d/(c/1e3)),bufferLevel:n.getCurrentBufferLevel(u.mediaType)})}if(o){var f=I-t,h=g.reduce((function(e,t){return e+t.chunkBytes}),0);return s.addMeasurement(u,f,g,y,v,l),void e.progress({loaded:h,total:h,lengthComputable:!0,time:s.getEstimatedDownloadDurationMS(u),stream:!0})}return w=Date.now(),p.read().then(r)})),e.reader=D.getReader()}else e.reader=r.body.getReader();var N=[],O=[],P=[],M=!0;c(e,(function t(n){var r=n.value;if(n.done){if(S){if(m!==a.Z.ABR_FETCH_THROUGHPUT_CALCULATION_AAST){var i=null,s=null;m===a.Z.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING?(i=function(e,t){try{var n,r;n=e.filter((function(t,n){return n<e.length-1})),r=t.filter((function(e,n){return n<t.length-1}));var i=[];if(n.length>1){for(var a=0,s=0,o=0;o<n.length;o++)if(n[o]&&r[o]){var l=r[o].ts-n[o].ts;if(l>1)i.push(8*r[o].bytes/l),s=0;else{0===s&&(s=n[o].ts,a=0);var u=r[o].ts-s;u>1?(a+=r[o].bytes,i.push(8*a/u),s=0):a+=r[o].bytes}}if(i.length>0)return i.reduce((function(e,t){return e+t}),0)/i.length}return null}catch(e){return null}}(O,P),i&&(s=8*E/i)):m===a.Z.ABR_FETCH_THROUGHPUT_CALCULATION_DOWNLOADED_DATA&&(s=d(N,E)),e.progress({loaded:E,total:isNaN(T)?E:T,lengthComputable:!0,time:s,stream:!0})}e.response.response=S.buffer}return e.onload(),void e.onend()}if(r&&r.length>0){S=function(e,t){if(0===e.length)return t;var n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}(S,r),E+=r.length,N.push({ts:Date.now(),bytes:r.length}),m===a.Z.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING&&M&&o.findLastTopIsoBoxCompleted(["moof"],S,A).found&&(M=!1,O.push({ts:performance.now(),bytes:r.length}));var l=o.findLastTopIsoBoxCompleted(["moov","mdat"],S,A);if(l.found){var u,f=l.lastCompletedOffset+l.size;m!==a.Z.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING||M||(M=!0,P.push({ts:performance.now(),bytes:S.length})),f===S.length?(u=S,S=new Uint8Array):(u=new Uint8Array(S.subarray(0,f)),S=S.subarray(f)),e.progress({data:u.buffer,lengthComputable:!1,noTrace:!0}),A=0}else A=l.lastCompletedOffset,b||(e.progress({lengthComputable:!1,noTrace:!0}),b=!0)}c(e,t)}))})).catch((function(t){e.onerror&&e.onerror(t)}))}))}function c(e,t){e.reader.read().then(t).catch((function(t){e.onerror&&200===e.response.status&&e.onerror(t)}))}function d(e,t){try{if((e=e.filter((function(n){return n.bytes>t/4/e.length}))).length>1){var n=0,r=(e[e.length-1].ts-e[0].ts)/e.length;return e.forEach((function(t,i){var a=e[i+1];if(a){var s=a.ts-t.ts;n+=s<r?s:0}})),n}return null}catch(e){return null}}return t={load:function(e){i&&i.modifyRequest?(0,W.k)(e,i).then((function(){return u(e)})):u(e)},abort:function(e){if(e.abortController)e.abortController.abort();else if(e.reader)try{e.reader.cancel(),e.onabort()}catch(e){}},calculateDownloadedTime:d,setup:function(e){n=e.dashMetrics}},t}ue.__dashjs_factory_name="FetchLoader";var ce=c.Z.getClassFactory(ue),de=n(1180);var fe=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=-1,this.adaptation=null,this.segmentInfoType=null,this.initialization=null,this.codecs=null,this.mimeType=null,this.codecPrivateData=null,this.segmentDuration=NaN,this.timescale=1,this.startNumber=1,this.indexRange=null,this.range=null,this.presentationTimeOffset=0,this.MSETimeOffset=NaN,this.mediaFinishedInformation={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN},this.bandwidth=NaN,this.width=NaN,this.height=NaN,this.scanType=null,this.maxPlayoutRate=NaN,this.availabilityTimeOffset=0,this.availabilityTimeComplete=!0,this.frameRate=null}var t;return(t=[{key:"hasInitialization",value:function(){return null!==this.initialization||null!==this.range}},{key:"hasSegments",value:function(){return this.segmentInfoType!==s.Z.BASE_URL&&this.segmentInfoType!==s.Z.SEGMENT_BASE&&!this.indexRange}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}(),he=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.period=null,this.index=-1,this.type=null},pe=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=-1,this.duration=NaN,this.start=NaN,this.mpd=null,this.nextPeriodId=null};pe.DEFAULT_ID="defaultId";var ge=pe,me=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.manifest=null,this.suggestedPresentationDelay=0,this.availabilityStartTime=null,this.availabilityEndTime=Number.POSITIVE_INFINITY,this.timeShiftBufferDepth=Number.POSITIVE_INFINITY,this.maxSegmentDuration=Number.POSITIVE_INFINITY,this.publishTime=null,this.minimumUpdatePeriod=NaN,this.mediaPresentationDuration=NaN},ye=n(2610),ve=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type="",this.duration=NaN,this.presentationTime=NaN,this.id=NaN,this.messageData="",this.eventStream=null,this.presentationTimeDelta=NaN},_e=function e(t,n,r,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t||"",this.serviceLocation=n||t||"",this.dvbPriority=r||1,this.dvbWeight=i||1,this.availabilityTimeOffset=0,this.availabilityTimeComplete=!0,this.queryParams={}};_e.DEFAULT_DVB_PRIORITY=1,_e.DEFAULT_DVB_WEIGHT=1;var Te=_e,Ee=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.adaptionSet=null,this.representation=null,this.period=null,this.timescale=1,this.value="",this.schemeIdUri="",this.presentationTimeOffset=0},be=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.inband=!1,this.type="encoder",this.applicationScheme=null,this.wallClockTime=null,this.presentationTime=NaN,this.UTCTiming=null},Se=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.defaultServiceLocation=null,this.defaultServiceLocationArray=[],this.queryBeforeStart=!1,this.serverUrl=null,this.clientRequirement=!0};var Ae=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.schemeIdUri=null,this.value=null,this.id=null}var t;return(t=[{key:"init",value:function(e){return e&&(this.schemeIdUri=e.schemeIdUri?e.schemeIdUri:null,this.value=e.value?e.value:null,this.id=e.id?e.id:null,e[s.Z.DVB_URL]&&(this.dvbUrl=e[s.Z.DVB_URL]),e[s.Z.DVB_MIMETYPE]&&(this.dvbMimeType=e[s.Z.DVB_MIMETYPE]),e[s.Z.DVB_FONTFAMILY]&&(this.dvbFontFamily=e[s.Z.DVB_FONTFAMILY])),this}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}(),we=n(3101),Ie=n.n(we);function Ce(){return{areEqual:function(e,t){return Ie()(e,t)}}}Ce.__dashjs_factory_name="ObjectUtils";var Re=c.Z.getSingletonFactory(Ce),De=n(7803),Ne=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t||"",this.serviceLocation=n||null,this.queryParams={}},Oe=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t||"",this.serviceLocation=n||null,this.ttl=r||NaN,this.queryParams={}};function Pe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Me(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pe(Object(n),!0).forEach((function(t){xe(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Le(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=ke(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}function ke(e,t){if(e){if("string"==typeof e)return Fe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fe(e,t):void 0}}function Fe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ue(){var e,t,n,r,i=this.context,o=(0,X.Z)(i).getInstance(),l=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function u(e,t){if(!e)throw new Error("adaptation is not defined");if(!t)throw new Error("type is not defined");if(e.Representation_asArray&&e.Representation_asArray.length){var n=_(e.Representation_asArray[0]);if(n&&n.length>0&&De.Y.indexOf(n[0].schemeIdUri)>=0)return t===a.Z.IMAGE}if(e.ContentComponent_asArray&&e.ContentComponent_asArray.length>0){if(e.ContentComponent_asArray.length>1)return t===a.Z.MUXED;if(e.ContentComponent_asArray[0].contentType===t)return!0}var r=t===a.Z.TEXT?new RegExp("(ttml|vtt|wvtt|stpp)"):new RegExp(t);if(e.Representation_asArray&&e.Representation_asArray.length){var i=e.Representation_asArray[0].codecs;if(r.test(i))return!0}if(e.hasOwnProperty(s.Z.MIME_TYPE))return r.test(e.mimeType);if(e.Representation_asArray)for(var o,l=0;l<e.Representation_asArray.length;l++)if((o=e.Representation_asArray[l]).hasOwnProperty(s.Z.MIME_TYPE))return r.test(o.mimeType);return!1}function c(e){if(!e)throw new Error("adaptation is not defined");if(e.hasOwnProperty(s.Z.SEGMENT_TEMPLATE)||e.hasOwnProperty(s.Z.SEGMENT_TIMELINE)||e.hasOwnProperty(s.Z.SEGMENT_LIST)||e.hasOwnProperty(s.Z.SEGMENT_BASE))return!0;if(e.Representation_asArray&&e.Representation_asArray.length>0){var t=e.Representation_asArray[0];if(t.hasOwnProperty(s.Z.SEGMENT_TEMPLATE)||t.hasOwnProperty(s.Z.SEGMENT_TIMELINE)||t.hasOwnProperty(s.Z.SEGMENT_LIST)||t.hasOwnProperty(s.Z.SEGMENT_BASE))return!0}return!1}function f(e){return u(e,a.Z.VIDEO)}function h(e){return u(e,a.Z.TEXT)}function p(e){return u(e,a.Z.IMAGE)}function g(e){return e&&Array.isArray(e.Representation_asArray)&&e.Representation_asArray.sort((function(e,t){return e.bandwidth-t.bandwidth})),e}function m(e,t){return e&&e.Period_asArray&&l(t)&&e.Period_asArray[t]?e.Period_asArray[t].AdaptationSet_asArray:[]}function y(e){return e&&e.Period_asArray?e.Period_asArray:[]}function v(e){var t=!1;return e&&e.hasOwnProperty("type")&&(t=e.type===s.Z.DYNAMIC),t}function _(e){return e&&e.EssentialProperty_asArray&&e.EssentialProperty_asArray.length?e.EssentialProperty_asArray.map((function(e){return{schemeIdUri:e.schemeIdUri,value:e.value}})):null}function T(e){if(!e||!e.S_asArray)return NaN;var t=e.S_asArray[0],n=e.S_asArray[1];return t.hasOwnProperty("d")?t.d:n.t-t.t}function E(e,t){if(!e)throw new Error("Period cannot be null or undefined");var n=ge.DEFAULT_ID+"_"+t;return e.hasOwnProperty(s.Z.ID)&&e.id.length>0&&"__proto__"!==e.id&&(n=e.id),n}function S(e,t,n){var r,i=[];if(!e)return i;for(r=0;r<e.length;r++){var o=new Ee;if(o.timescale=1,o.representation=t,!e[r].hasOwnProperty(a.Z.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");o.schemeIdUri=e[r].schemeIdUri,e[r].hasOwnProperty(s.Z.TIMESCALE)&&(o.timescale=e[r].timescale),e[r].hasOwnProperty(s.Z.VALUE)&&(o.value=e[r].value),i.push(o),o.period=n}return i}function A(e){var t=[],n=e.BaseURL_asArray||[e.baseUri],r=!1;return n.some((function(n){if(n){var i=new Te,a=n.__text||n;return o.isRelative(a)&&(r=!0,e.baseUri&&(a=o.resolve(a,e.baseUri))),i.url=a,n.hasOwnProperty(s.Z.SERVICE_LOCATION)&&n.serviceLocation.length?i.serviceLocation=n.serviceLocation:i.serviceLocation=a,n.hasOwnProperty(s.Z.DVB_PRIORITY)&&(i.dvbPriority=n[s.Z.DVB_PRIORITY]),n.hasOwnProperty(s.Z.DVB_WEIGHT)&&(i.dvbWeight=n[s.Z.DVB_WEIGHT]),n.hasOwnProperty(s.Z.AVAILABILITY_TIME_OFFSET)&&(i.availabilityTimeOffset=n[s.Z.AVAILABILITY_TIME_OFFSET]),n.hasOwnProperty(s.Z.AVAILABILITY_TIME_COMPLETE)&&(i.availabilityTimeComplete="false"!==n[s.Z.AVAILABILITY_TIME_COMPLETE]),t.push(i),r}})),t}function w(e){var t=new Se;return t.serverUrl=e.__text,e.hasOwnProperty(s.Z.DEFAULT_SERVICE_LOCATION)&&(t.defaultServiceLocation=e[s.Z.DEFAULT_SERVICE_LOCATION],t.defaultServiceLocationArray=t.defaultServiceLocation.split(" ")),e.hasOwnProperty(s.Z.QUERY_BEFORE_START)&&(t.queryBeforeStart="true"===e[s.Z.QUERY_BEFORE_START].toLowerCase()),e.hasOwnProperty(s.Z.CLIENT_REQUIREMENT)&&(t.clientRequirement="false"!==e[s.Z.CLIENT_REQUIREMENT].toLowerCase()),t}return e={getIsTypeOf:u,getIsText:h,getIsFragmented:c,getProducerReferenceTimesForAdaptation:function(e){var t=e&&e.hasOwnProperty(s.Z.PRODUCERREFERENCETIME_ASARRAY)?e[s.Z.PRODUCERREFERENCETIME_ASARRAY]:[];(e&&e.hasOwnProperty(s.Z.REPRESENTATION_ASARRAY)?e[s.Z.REPRESENTATION_ASARRAY]:[]).forEach((function(e){var n;e.hasOwnProperty(s.Z.PRODUCERREFERENCETIME_ASARRAY)&&t.push.apply(t,function(e){if(Array.isArray(e))return Fe(e)}(n=e[s.Z.PRODUCERREFERENCETIME_ASARRAY])||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(n)||ke(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}));var n=[];return t.forEach((function(e){var t=new be;e.hasOwnProperty(s.Z.ID)&&(t[s.Z.ID]=e[s.Z.ID],e.hasOwnProperty(s.Z.WALL_CLOCK_TIME)&&(t[s.Z.WALL_CLOCK_TIME]=e[s.Z.WALL_CLOCK_TIME],e.hasOwnProperty(s.Z.PRESENTATION_TIME)&&(t[s.Z.PRESENTATION_TIME]=e[s.Z.PRESENTATION_TIME],e.hasOwnProperty(s.Z.INBAND)&&(t[s.Z.INBAND]="false"!==e[s.Z.INBAND]),e.hasOwnProperty(s.Z.TYPE)&&(t[s.Z.TYPE]=e[s.Z.TYPE]),n.push(t))))})),n},getLanguageForAdaptation:function(e){var t="";return e&&e.hasOwnProperty(s.Z.LANG)&&(t=e.lang),t},getViewpointForAdaptation:function(e){return e&&e.hasOwnProperty(s.Z.VIEWPOINT_ASARRAY)&&e[s.Z.VIEWPOINT_ASARRAY].length?e[s.Z.VIEWPOINT_ASARRAY].map((function(e){return(new Ae).init(e)})):[]},getRolesForAdaptation:function(e){return e&&e.hasOwnProperty(s.Z.ROLE_ASARRAY)&&e[s.Z.ROLE_ASARRAY].length?e[s.Z.ROLE_ASARRAY].map((function(e){return(new Ae).init(e)})):[]},getAccessibilityForAdaptation:function(e){return e&&e.hasOwnProperty(s.Z.ACCESSIBILITY_ASARRAY)&&e[s.Z.ACCESSIBILITY_ASARRAY].length?e[s.Z.ACCESSIBILITY_ASARRAY].map((function(e){return(new Ae).init(e)})):[]},getAudioChannelConfigurationForAdaptation:function(e){return e&&e.hasOwnProperty(s.Z.AUDIOCHANNELCONFIGURATION_ASARRAY)&&e[s.Z.AUDIOCHANNELCONFIGURATION_ASARRAY].length?e[s.Z.AUDIOCHANNELCONFIGURATION_ASARRAY].map((function(e){return(new Ae).init(e)})):[]},getAudioChannelConfigurationForRepresentation:function(e){return e&&e.hasOwnProperty(s.Z.AUDIOCHANNELCONFIGURATION_ASARRAY)&&e[s.Z.AUDIOCHANNELCONFIGURATION_ASARRAY].length?e[s.Z.AUDIOCHANNELCONFIGURATION_ASARRAY].map((function(e){return(new Ae).init(e)})):[]},getAdaptationForIndex:function(e,t,n){var r=m(t,n);return r.length>0&&l(e)?r[e]:null},getIndexForAdaptation:function(e,t,n){if(!e)return-1;for(var r=m(t,n),a=0;a<r.length;a++)if(Re(i).getInstance().areEqual(r[a],e))return a;return-1},getAdaptationForId:function(e,t,n){var r,i,a=m(t,n);for(r=0,i=a.length;r<i;r++)if(a[r].hasOwnProperty(s.Z.ID)&&a[r].id===e)return a[r];return null},getAdaptationsForType:function(e,t,n){var r,i,a=m(e,t),s=[];for(r=0,i=a.length;r<i;r++)u(a[r],n)&&s.push(g(a[r]));return s},getRealPeriods:y,getRealPeriodForIndex:function(e,t){var n=y(t);return n.length>0&&l(e)?n[e]:null},getCodec:function(e,t,n){var r=null;if(e&&e.Representation_asArray&&e.Representation_asArray.length>0){var i=l(t)&&t>=0&&t<e.Representation_asArray.length?e.Representation_asArray[t]:e.Representation_asArray[0];i&&(r=i.mimeType+';codecs="'+i.codecs+'"',n&&void 0!==i.width&&(r+=';width="'+i.width+'";height="'+i.height+'"'))}return r&&(r=r.replace(/\sprofiles=[^;]*/g,"")),r},getSelectionPriority:function(e){try{var t=e&&void 0!==e.selectionPriority?parseInt(e.selectionPriority):1;return isNaN(t)?1:t}catch(e){return 1}},getMimeType:function(e){return e&&e.Representation_asArray&&e.Representation_asArray.length>0?e.Representation_asArray[0].mimeType:null},getKID:function(e){return e&&e.hasOwnProperty(s.Z.CENC_DEFAULT_KID)?e[s.Z.CENC_DEFAULT_KID]:null},getLabelsForAdaptation:function(e){if(!e||!Array.isArray(e.Label_asArray))return[];for(var t=[],n=0;n<e.Label_asArray.length;n++)t.push({lang:e.Label_asArray[n].lang,text:e.Label_asArray[n].__text||e.Label_asArray[n]});return t},getContentProtectionData:function(e){return e&&e.hasOwnProperty(s.Z.CONTENTPROTECTION_ASARRAY)&&0!==e.ContentProtection_asArray.length?e.ContentProtection_asArray:null},getIsDynamic:v,getId:function(e){return e&&e[s.Z.ID]||null},hasProfile:function(e,t){var n=!1;return e&&e.profiles&&e.profiles.length>0&&(n=-1!==e.profiles.indexOf(t)),n},getDuration:function(e){return e&&e.hasOwnProperty(s.Z.MEDIA_PRESENTATION_DURATION)?e.mediaPresentationDuration:e&&"dynamic"==e.type?Number.POSITIVE_INFINITY:Number.MAX_SAFE_INTEGER||Number.MAX_VALUE},getBandwidth:function(e){return e&&e.bandwidth?e.bandwidth:NaN},getManifestUpdatePeriod:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=NaN;return e&&e.hasOwnProperty(s.Z.MINIMUM_UPDATE_PERIOD)&&(n=e.minimumUpdatePeriod),isNaN(n)?n:Math.max(n-t,1)},getPublishTime:function(e){return e&&e.hasOwnProperty(s.Z.PUBLISH_TIME)?new Date(e[s.Z.PUBLISH_TIME]):null},getRepresentationCount:function(e){return e&&Array.isArray(e.Representation_asArray)?e.Representation_asArray.length:0},getBitrateListForAdaptation:function(e){var t=g(e);return(t&&Array.isArray(t.Representation_asArray)?t.Representation_asArray:[]).map((function(e){return{bandwidth:e.bandwidth,width:e.width||0,height:e.height||0,scanType:e.scanType||null,id:e.id||null}}))},getRepresentationFor:function(e,t){return t&&t.Representation_asArray&&t.Representation_asArray.length>0&&l(e)?t.Representation_asArray[e]:null},getRepresentationsForAdaptation:function(e){var t,n,r,i,a=[],o=function(e){if(e&&e.period&&l(e.period.index)){var t=e.period.mpd.manifest.Period_asArray[e.period.index];if(t&&t.AdaptationSet_asArray&&l(e.index))return g(t.AdaptationSet_asArray[e.index])}}(e);if(o&&o.Representation_asArray){if(e&&e.period&&l(e.period.index)){var u=A(e.period.mpd.manifest);u&&(n=u[0])}for(var d=0,f=o.Representation_asArray.length;d<f;++d){var p=o.Representation_asArray[d],m=new fe;if(m.index=d,m.adaptation=e,p.hasOwnProperty(s.Z.ID)&&(m.id=p.id),p.hasOwnProperty(s.Z.CODECS)&&(m.codecs=p.codecs),p.hasOwnProperty(s.Z.MIME_TYPE)&&(m.mimeType=p[s.Z.MIME_TYPE]),p.hasOwnProperty(s.Z.CODEC_PRIVATE_DATA)&&(m.codecPrivateData=p.codecPrivateData),p.hasOwnProperty(s.Z.BANDWITH)&&(m.bandwidth=p.bandwidth),p.hasOwnProperty(s.Z.WIDTH)&&(m.width=p.width),p.hasOwnProperty(s.Z.HEIGHT)&&(m.height=p.height),p.hasOwnProperty(s.Z.SCAN_TYPE)&&(m.scanType=p.scanType),p.hasOwnProperty(s.Z.MAX_PLAYOUT_RATE)&&(m.maxPlayoutRate=p.maxPlayoutRate),p.hasOwnProperty(s.Z.SEGMENT_BASE)?(t=p.SegmentBase,m.segmentInfoType=s.Z.SEGMENT_BASE):p.hasOwnProperty(s.Z.SEGMENT_LIST)?(t=p.SegmentList).hasOwnProperty(s.Z.SEGMENT_TIMELINE)?m.segmentInfoType=s.Z.SEGMENT_TIMELINE:m.segmentInfoType=s.Z.SEGMENT_LIST:p.hasOwnProperty(s.Z.SEGMENT_TEMPLATE)?((t=p.SegmentTemplate).hasOwnProperty(s.Z.SEGMENT_TIMELINE)?m.segmentInfoType=s.Z.SEGMENT_TIMELINE:m.segmentInfoType=s.Z.SEGMENT_TEMPLATE,t.hasOwnProperty(s.Z.INITIALIZATION_MINUS)&&(m.initialization=t.initialization.split("$Bandwidth$").join(p.bandwidth).split("$RepresentationID$").join(p.id))):m.segmentInfoType=s.Z.BASE_URL,m.essentialProperties=_(p),t){if(t.hasOwnProperty(s.Z.INITIALIZATION)){var y=t.Initialization;y.hasOwnProperty(s.Z.SOURCE_URL)&&(m.initialization=y.sourceURL),y.hasOwnProperty(s.Z.RANGE)&&(m.range=y.range)}else h(o)&&c(o)&&o.mimeType&&-1===o.mimeType.indexOf("application/mp4")&&(m.range=0);t.hasOwnProperty(s.Z.TIMESCALE)&&(m.timescale=t.timescale),t.hasOwnProperty(s.Z.DURATION)?m.segmentDuration=t.duration/m.timescale:p.hasOwnProperty(s.Z.SEGMENT_TEMPLATE)&&(t=p.SegmentTemplate).hasOwnProperty(s.Z.SEGMENT_TIMELINE)&&(m.segmentDuration=T(t.SegmentTimeline)/m.timescale),t.hasOwnProperty(s.Z.MEDIA)&&(m.media=t.media),t.hasOwnProperty(s.Z.START_NUMBER)&&(m.startNumber=t.startNumber),t.hasOwnProperty(s.Z.INDEX_RANGE)&&(m.indexRange=t.indexRange),t.hasOwnProperty(s.Z.PRESENTATION_TIME_OFFSET)&&(m.presentationTimeOffset=t.presentationTimeOffset/m.timescale),t.hasOwnProperty(s.Z.AVAILABILITY_TIME_OFFSET)?m.availabilityTimeOffset=t.availabilityTimeOffset:n&&void 0!==n.availabilityTimeOffset&&(m.availabilityTimeOffset=n.availabilityTimeOffset),t.hasOwnProperty(s.Z.AVAILABILITY_TIME_COMPLETE)?m.availabilityTimeComplete="false"!==t.availabilityTimeComplete:n&&void 0!==n.availabilityTimeComplete&&(m.availabilityTimeComplete=n.availabilityTimeComplete)}m.MSETimeOffset=(i=(r=m).presentationTimeOffset,r.adaptation.period.start-i),m.path=[e.period.index,e.index,d],a.push(m)}}return a},getAdaptationsForPeriod:function(e){var n,r,i,o=e&&l(e.index)?e.mpd.manifest.Period_asArray[e.index]:null,c=[];if(o&&o.AdaptationSet_asArray)for(i=0;i<o.AdaptationSet_asArray.length;i++)r=o.AdaptationSet_asArray[i],n=new he,r.hasOwnProperty(s.Z.ID)&&(n.id=r.id),n.index=i,n.period=e,u(r,a.Z.MUXED)?n.type=a.Z.MUXED:u(r,a.Z.AUDIO)?n.type=a.Z.AUDIO:f(r)?n.type=a.Z.VIDEO:h(r)?n.type=a.Z.TEXT:p(r)?n.type=a.Z.IMAGE:t.warn("Unknown Adaptation stream type"),c.push(n);return c},getRegularPeriods:function(e){var r,i,o=!!e&&v(e.manifest),l=[],u=null,c=null,d=null,f=null;for(i=0,r=e&&e.manifest&&e.manifest.Period_asArray?e.manifest.Period_asArray.length:0;i<r;i++)(c=e.manifest.Period_asArray[i]).hasOwnProperty(s.Z.START)?(f=new ge).start=c.start:null!==u&&u.hasOwnProperty(s.Z.DURATION)&&null!==d?(f=new ge).start=parseFloat((d.start+d.duration).toFixed(5)):0!==i||o||((f=new ge).start=0),null!==d&&isNaN(d.duration)&&(null!==f?d.duration=parseFloat((f.start-d.start).toFixed(5)):t.warn("First period duration could not be calculated because lack of start and duration period properties. This will cause timing issues during playback")),null!==f&&(f.id=E(c,i),f.index=i,f.mpd=e,c.hasOwnProperty(s.Z.DURATION)&&(f.duration=c.duration),d&&(d.nextPeriodId=f.id),l.push(f),u=c,d=f),c=null,f=null;return 0===l.length||null!==d&&isNaN(d.duration)&&(d.duration=parseFloat((function(e){!function(){if(!n||!n.hasOwnProperty("error"))throw new Error(a.Z.MISSING_CONFIG_ERROR)}();var t,r=v(e.mpd.manifest);return e.mpd.manifest.mediaPresentationDuration?t=e.mpd.manifest.mediaPresentationDuration:e.duration?t=e.duration:r?t=Number.POSITIVE_INFINITY:n.error(new b.Z(I.MANIFEST_ERROR_ID_PARSE_CODE,"Must have @mediaPresentationDuration on MPD or an explicit @duration on the last period.",e)),t}(d)-d.start).toFixed(5))),l},getMpd:function(e){var t=new me;return e&&(t.manifest=e,e.hasOwnProperty(s.Z.AVAILABILITY_START_TIME)?t.availabilityStartTime=new Date(e.availabilityStartTime.getTime()):e.loadedTime&&(t.availabilityStartTime=new Date(e.loadedTime.getTime())),e.hasOwnProperty(s.Z.AVAILABILITY_END_TIME)&&(t.availabilityEndTime=new Date(e.availabilityEndTime.getTime())),e.hasOwnProperty(s.Z.MINIMUM_UPDATE_PERIOD)&&(t.minimumUpdatePeriod=e.minimumUpdatePeriod),e.hasOwnProperty(s.Z.MEDIA_PRESENTATION_DURATION)&&(t.mediaPresentationDuration=e.mediaPresentationDuration),e.hasOwnProperty(s.Z.SUGGESTED_PRESENTATION_DELAY)&&(t.suggestedPresentationDelay=e.suggestedPresentationDelay),e.hasOwnProperty(s.Z.TIMESHIFT_BUFFER_DEPTH)&&(t.timeShiftBufferDepth=e.timeShiftBufferDepth),e.hasOwnProperty(s.Z.MAX_SEGMENT_DURATION)&&(t.maxSegmentDuration=e.maxSegmentDuration),e.hasOwnProperty(s.Z.PUBLISH_TIME)&&(t.publishTime=new Date(e.publishTime))),t},getEventsForPeriod:function(e){var t,n,i=e&&e.mpd&&e.mpd.manifest?e.mpd.manifest:null,o=i?i.Period_asArray:null,u=o&&e&&l(e.index)?o[e.index].EventStream_asArray:null,c=[];if(u)for(t=0;t<u.length;t++){var d=new Ee;if(d.period=e,d.timescale=1,!u[t].hasOwnProperty(a.Z.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");for(d.schemeIdUri=u[t][a.Z.SCHEME_ID_URI],u[t].hasOwnProperty(s.Z.TIMESCALE)&&(d.timescale=u[t][s.Z.TIMESCALE]),u[t].hasOwnProperty(s.Z.VALUE)&&(d.value=u[t][s.Z.VALUE]),u[t].hasOwnProperty(s.Z.PRESENTATION_TIME_OFFSET)&&(d.presentationTimeOffset=u[t][s.Z.PRESENTATION_TIME_OFFSET]),n=0;u[t].Event_asArray&&n<u[t].Event_asArray.length;n++){var f=u[t].Event_asArray[n],h=new ve;h.presentationTime=0,h.eventStream=d,f.hasOwnProperty(s.Z.PRESENTATION_TIME)&&(h.presentationTime=f.presentationTime);var p=d.presentationTimeOffset?d.presentationTimeOffset/d.timescale:0;h.calculatedPresentationTime=h.presentationTime/d.timescale+e.start-p,f.hasOwnProperty(s.Z.DURATION)&&(h.duration=f.duration/d.timescale),f.hasOwnProperty(s.Z.ID)?h.id=f.id:h.id=null,f.Signal&&f.Signal.Binary?h.messageData=r.decodeArray(f.Signal.Binary.toString()):h.messageData=f.messageData||f.__cdata||f.__text,c.push(h)}}return c},getEssentialPropertiesForAdaptation:function(e){var t={};if(e&&e.hasOwnProperty(s.Z.ESSENTIAL_PROPERTY_ASARRAY)){var n,r=Le(e.EssentialProperty_asArray);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.hasOwnProperty(a.Z.SCHEME_ID_URI)&&(t[i[a.Z.SCHEME_ID_URI]]=Me({},i))}}catch(e){r.e(e)}finally{r.f()}}return t},getEssentialPropertiesAsArrayForAdaptation:function(e){return e&&e.hasOwnProperty(s.Z.ESSENTIAL_PROPERTY_ASARRAY)&&e.EssentialProperty_asArray.length?e.EssentialProperty_asArray.map((function(e){return(new Ae).init(e)})):[]},getEssentialPropertiesForRepresentation:_,getEventStreamForAdaptationSet:function(e,t,n){var r,i,a;return e&&e.Period_asArray&&t&&t.period&&l(t.period.index)&&(i=e.Period_asArray[t.period.index])&&i.AdaptationSet_asArray&&l(t.index)&&(a=i.AdaptationSet_asArray[t.index])&&(r=a.InbandEventStream_asArray),S(r,null,n)},getEventStreamForRepresentation:function(e,t,n){var r,i,a,s;return e&&e.Period_asArray&&t&&t.adaptation&&t.adaptation.period&&l(t.adaptation.period.index)&&(i=e.Period_asArray[t.adaptation.period.index])&&i.AdaptationSet_asArray&&l(t.adaptation.index)&&(a=i.AdaptationSet_asArray[t.adaptation.index])&&a.Representation_asArray&&l(t.index)&&(s=a.Representation_asArray[t.index])&&(r=s.InbandEventStream_asArray),S(r,t,n)},getUTCTimingSources:function(e){var t=v(e),n=!!e&&e.hasOwnProperty(s.Z.AVAILABILITY_START_TIME),r=e?e.UTCTiming_asArray:null,i=[];return(t||n)&&r&&r.forEach((function(e){var t=new ye.Z;e.hasOwnProperty(a.Z.SCHEME_ID_URI)&&(t.schemeIdUri=e.schemeIdUri,e.hasOwnProperty(s.Z.VALUE)&&(t.value=e.value.toString(),i.push(t)))})),i},getBaseURLsFromElement:A,getRepresentationSortFunction:function(){return function(e,t){return e.bandwidth-t.bandwidth}},getContentSteering:function(e){if(e&&e.hasOwnProperty(s.Z.CONTENT_STEERING_AS_ARRAY))return w(e[s.Z.CONTENT_STEERING_AS_ARRAY][0])},getLocation:function(e){return e&&e.hasOwnProperty(s.Z.LOCATION_AS_ARRAY)?e[s.Z.LOCATION_AS_ARRAY].map((function(e){var t=e.__text||e,n=e.hasOwnProperty(s.Z.SERVICE_LOCATION)?e[s.Z.SERVICE_LOCATION]:null;return new Ne(t,n)})):[]},getPatchLocation:function(e){return e&&e.hasOwnProperty(s.Z.PATCH_LOCATION_AS_ARRAY)?e[s.Z.PATCH_LOCATION_AS_ARRAY].map((function(e){var t=e.__text||e,n=e.hasOwnProperty(s.Z.SERVICE_LOCATION)?e[s.Z.SERVICE_LOCATION]:null,r=e.hasOwnProperty(s.Z.TTL)?1e3*parseFloat(e[s.Z.TTL]):NaN;return new Oe(t,n,r)})):[]},getSuggestedPresentationDelay:function(e){return e&&e.hasOwnProperty(s.Z.SUGGESTED_PRESENTATION_DELAY)?e.suggestedPresentationDelay:null},getAvailabilityStartTime:function(e){return e&&e.hasOwnProperty(s.Z.AVAILABILITY_START_TIME)&&null!==e.availabilityStartTime?e.availabilityStartTime.getTime():null},getServiceDescriptions:function(e){var t=[];if(e&&e.hasOwnProperty(s.Z.SERVICE_DESCRIPTION)){var n,r=Le(e.ServiceDescription_asArray);try{for(r.s();!(n=r.n()).done;){var i=n.value,a=null,o=null,l=null,u=null,c=null,d=null,f=null;for(var h in i)i.hasOwnProperty(h)&&(h===s.Z.ID?a=i[h]:h===s.Z.SERVICE_DESCRIPTION_SCOPE?o=i[h].schemeIdUri:h===s.Z.SERVICE_DESCRIPTION_LATENCY?l={target:parseInt(i[h].target),max:parseInt(i[h].max),min:parseInt(i[h].min),referenceId:parseInt(i[h].referenceId)}:h===s.Z.SERVICE_DESCRIPTION_PLAYBACK_RATE?u={max:parseFloat(i[h].max),min:parseFloat(i[h].min)}:h===s.Z.SERVICE_DESCRIPTION_OPERATING_QUALITY?c={mediaType:i[h].mediaType,max:parseInt(i[h].max),min:parseInt(i[h].min),target:parseInt(i[h].target),type:i[h].type,maxQualityDifference:parseInt(i[h].maxQualityDifference)}:h===s.Z.SERVICE_DESCRIPTION_OPERATING_BANDWIDTH?d={mediaType:i[h].mediaType,max:parseInt(i[h].max),min:parseInt(i[h].min),target:parseInt(i[h].target)}:h===s.Z.CONTENT_STEERING&&(f=w(i[h])));t.push({id:a,schemeIdUri:o,latency:l,playbackRate:u,operatingQuality:c,operatingBandwidth:d,contentSteering:f})}}catch(e){r.e(e)}finally{r.f()}}return t},getSegmentAlignment:function(e){return!(!e||!e.hasOwnProperty(s.Z.SEGMENT_ALIGNMENT))&&"true"===e[s.Z.SEGMENT_ALIGNMENT]},getSubSegmentAlignment:function(e){return!(!e||!e.hasOwnProperty(s.Z.SUB_SEGMENT_ALIGNMENT))&&"true"===e[s.Z.SUB_SEGMENT_ALIGNMENT]},getSupplementalPropertiesForAdaptation:function(e){var t={};if(e&&e.hasOwnProperty(s.Z.SUPPLEMENTAL_PROPERTY_ASARRAY)){var n,r=Le(e.SupplementalProperty_asArray);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.hasOwnProperty(a.Z.SCHEME_ID_URI)&&(t[i[a.Z.SCHEME_ID_URI]]=Me({},i))}}catch(e){r.e(e)}finally{r.f()}}return t},getSupplementalPropertiesAsArrayForAdaptation:function(e){return e&&e.hasOwnProperty(s.Z.SUPPLEMENTAL_PROPERTY_ASARRAY)&&e.SupplementalProperty_asArray.length?e.SupplementalProperty_asArray.map((function(e){return(new Ae).init(e)})):[]},getSupplementalPropertiesForRepresentation:function(e){var t={};if(e&&e.hasOwnProperty(s.Z.SUPPLEMENTAL_PROPERTY_ASARRAY)){var n,r=Le(e.SupplementalProperty_asArray);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.hasOwnProperty(a.Z.SCHEME_ID_URI)&&(t[i[a.Z.SCHEME_ID_URI]]=Me({},i))}}catch(e){r.e(e)}finally{r.f()}}return t},getSupplementalPropertiesAsArrayForRepresentation:function(e){return e&&e.hasOwnProperty(s.Z.SUPPLEMENTAL_PROPERTY_ASARRAY)&&e.SupplementalProperty_asArray.length?e.SupplementalProperty_asArray.map((function(e){return(new Ae).init(e)})):[]},setConfig:function(e){e&&(e.errHandler&&(n=e.errHandler),e.BASE64&&(r=e.BASE64))}},t=(0,d.Z)(i).getInstance().getLogger(e),e}Ue.__dashjs_factory_name="DashManifestModel";var Be=c.Z.getSingletonFactory(Ue),je=n(703);function qe(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return He(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?He(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}function He(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ge(){var e,t,n,r,i,s,o,u,c,d,h=this.context,p=(0,l.Z)(h).getInstance(),g=(0,C.Z)(h).getInstance();function m(){n={pr:1,nor:null,st:null,sf:null,sid:"".concat(je.Z.generateUuid()),cid:null},c={},u={},d={},v()}function y(){v()}function v(){if(s){var e=s.getStreamController();if(e&&"function"==typeof e.getActiveStream){var t=e.getActiveStream();t&&(o=t.getProcessors())}}}function _(e,t){var n,r={},i=qe(t);try{for(i.s();!(n=i.n()).done;){var a=n.value;e[a]&&(r[a]=e[a])}}catch(e){i.e(e)}finally{i.f()}return r}function T(e){var t=g.get().streaming.cmcd.enabledKeys;return e.filter((function(e){return t.includes(e)}))}function E(e){try{return e.type===R.w.MPD_TYPE?((l=b()).ot="m",l):e.type===R.w.MEDIA_SEGMENT_TYPE?(t=e.mediaType,d.hasOwnProperty(t)||(d[t]=!1),u.hasOwnProperty(t)||(u[t]=!1),c.hasOwnProperty(t)||(c[t]=!1),function(e){var t,l=b(),f=function(e){try{var t=e.quality,n=e.mediaInfo.bitrateList;return parseInt(n[t].bandwidth/1e3)}catch(e){return null}}(e),h=function(e){try{return isNaN(e.duration)?NaN:Math.round(1e3*e.duration)}catch(e){return null}}(e),p=function(e){try{return 100*parseInt(r.getThroughputHistory().getSafeAverageThroughput(e)/100)}catch(e){return null}}(e.mediaType),m=function(e){try{var t=n.pr,r=i.getCurrentBufferLevel(e);return isNaN(t)||isNaN(r)?null:100*parseInt(r/t*10)}catch(e){return null}}(e.mediaType),y=S(e.mediaType),v=function(e){try{var t=r.getTopBitrateInfoFor(e);return Math.round(t.bitrate/1e3)}catch(e){return null}}(e.mediaType),_=n.pr,T=function(e){if(o&&0!==o.length){var t,n=qe(o);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r.getType()===e)return r.probeNextRequest()}}catch(e){n.e(e)}finally{n.f()}}}(e.mediaType);e.mediaType===a.Z.VIDEO&&(t="v"),e.mediaType===a.Z.AUDIO&&(t="a"),e.mediaType===a.Z.TEXT&&(t="application/mp4"===e.mediaInfo.mimeType?"tt":"c");var E=g.get().streaming.cmcd.rtp;return E||(E=function(e){try{var t=s.getPlaybackRate();t||(t=1);var n=e.quality,r=e.mediaType,i=e.mediaInfo,a=e.duration;if(!i)return NaN;var o=S(r);0===o&&(o=500);var l=i.bitrateList[n].bandwidth*a/1e3/(o/t/1e3),u=g.get().streaming.cmcd.rtpSafetyFactor&&!isNaN(g.get().streaming.cmcd.rtpSafetyFactor)?g.get().streaming.cmcd.rtpSafetyFactor:5;return 100*(parseInt(l*u/100)+1)}catch(e){return NaN}}(e)),isNaN(E)||(l.rtp=E),T&&(e.url!==T.url?l.nor=encodeURIComponent(je.Z.getRelativeUrl(e.url,T.url)):T.range&&(l.nrr=T.range)),f&&(l.br=f),t&&(l.ot=t),isNaN(h)||(l.d=h),isNaN(p)||(l.mtp=p),isNaN(m)||(l.dl=m),isNaN(y)||(l.bl=y),isNaN(v)||(l.tb=v),isNaN(_)||1===_||(l.pr=_),c[e.mediaType]&&(l.bs=!0,c[e.mediaType]=!1),!u[e.mediaType]&&d[e.mediaType]||(l.su=!0,u[e.mediaType]=!1,d[e.mediaType]=!0),l}(e)):e.type===R.w.INIT_SEGMENT_TYPE?function(){var e=b();return e.ot="i",e.su=!0,e}():e.type===R.w.OTHER_TYPE||e.type===R.w.XLINK_EXPANSION_TYPE?function(){var e=b();return e.ot="o",e}():e.type===R.w.LICENSE?function(e){var t=b();return t.ot="k",t}():null}catch(e){return null}var t,l}function b(){var e={},t=g.get().streaming.cmcd.cid?g.get().streaming.cmcd.cid:n.cid;return e.v=1,e.sid=g.get().streaming.cmcd.sid?g.get().streaming.cmcd.sid:n.sid,e.sid="".concat(e.sid),t&&(e.cid="".concat(t)),isNaN(n.pr)||1===n.pr||null===n.pr||(e.pr=n.pr),n.st&&(e.st=n.st),n.sf&&(e.sf=n.sf),e}function S(e){try{var t=i.getCurrentBufferLevel(e);return isNaN(t)?null:100*parseInt(10*t)}catch(e){return null}}function A(e){try{n.pr=e.playbackRate}catch(e){}}function w(t){try{var r=e.getIsDynamic(t.data)?"l":"v",i=t.protocol&&"MSS"===t.protocol?"s":"d";n.st="".concat(r),n.sf="".concat(i)}catch(e){}}function I(e){try{e.state&&e.mediaType&&e.state===f.Z.BUFFER_EMPTY&&(c[e.mediaType]||(c[e.mediaType]=!0),u[e.mediaType]||(u[e.mediaType]=!0))}catch(e){}}function D(){for(var e in c)c.hasOwnProperty(e)&&(c[e]=!0);for(var t in u)u.hasOwnProperty(t)&&(u[t]=!0)}function N(e){try{if(!e)return null;var t=Object.keys(e).sort((function(e,t){return e.localeCompare(t)})),n=t.length,r=t.reduce((function(t,r,i){return"v"===r&&1===e[r]||("string"==typeof e[r]&&"ot"!==r&&"sf"!==r&&"st"!==r?t+="".concat(r,"=").concat(JSON.stringify(e[r])):t+="".concat(r,"=").concat(e[r]),i<n-1&&(t+=",")),t}),"");return(r=r.replace(/=true/g,"")).replace(/,\s*$/,"")}catch(e){return null}}return t={getQueryParameter:function(e){try{if(g.get().streaming.cmcd&&g.get().streaming.cmcd.enabled){var t=E(e),n=function(e){try{var t=g.get().streaming.cmcd.enabledKeys;return Object.keys(e).filter((function(e){return t.includes(e)})).reduce((function(t,n){return t[n]=e[n],t}),{})}catch(t){return e}}(t),r=N(n);return p.trigger(de.Z.CMCD_DATA_GENERATED,{url:e.url,mediaType:e.mediaType,cmcdData:t,cmcdString:r}),{key:"CMCD",value:r}}return null}catch(e){return null}},getHeaderParameters:function(e){try{if(g.get().streaming.cmcd&&g.get().streaming.cmcd.enabled){var t=E(e),n=_(t,T(["br","d","ot","tb"])),r=_(t,T(["bl","dl","mtp","nor","nrr","su"])),i=_(t,T(["bs","rtp"])),a=_(t,T(["cid","pr","sf","sid","st","v"])),s={"CMCD-Object":N(n),"CMCD-Request":N(r),"CMCD-Status":N(i),"CMCD-Session":N(a)};return p.trigger(de.Z.CMCD_DATA_GENERATED,{url:e.url,mediaType:e.mediaType,cmcdData:t,headers:s}),s}return null}catch(e){return null}},setConfig:function(e){e&&(e.abrController&&(r=e.abrController),e.dashMetrics&&(i=e.dashMetrics),e.playbackController&&(s=e.playbackController))},reset:function(){p.off(f.Z.PLAYBACK_RATE_CHANGED,A,this),p.off(f.Z.MANIFEST_LOADED,w,this),p.off(f.Z.BUFFER_LEVEL_STATE_CHANGED,I,t),p.off(f.Z.PLAYBACK_SEEKED,D,t),m()},initialize:function(){p.on(f.Z.PLAYBACK_RATE_CHANGED,A,t),p.on(f.Z.MANIFEST_LOADED,w,t),p.on(f.Z.BUFFER_LEVEL_STATE_CHANGED,I,t),p.on(f.Z.PLAYBACK_SEEKED,D,t),p.on(f.Z.PERIOD_SWITCH_COMPLETED,y,t)}},e=Be(h).getInstance(),m(),t}Ge.__dashjs_factory_name="CmcdModel";var Ve=c.Z.getSingletonFactory(Ge);function Ye(e){return Ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ye(e)}function Ze(e,t){Ze=function(e,t){return new a(e,void 0,t)};var n=Ke(RegExp),r=RegExp.prototype,i=new WeakMap;function a(e,t,r){var a=n.call(this,e,t);return i.set(a,r||i.get(e)),a}function s(e,t){var n=i.get(t);return Object.keys(n).reduce((function(t,r){return t[r]=e[n[r]],t}),Object.create(null))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&We(e,t)}(a,n),a.prototype.exec=function(e){var t=r.exec.call(this,e);return t&&(t.groups=s(t,this)),t},a.prototype[Symbol.replace]=function(e,t){if("string"==typeof t){var n=i.get(this);return r[Symbol.replace].call(this,e,t.replace(/\$<([^>]+)>/g,(function(e,t){return"$"+n[t]})))}if("function"==typeof t){var a=this;return r[Symbol.replace].call(this,e,(function(){var e=[];return e.push.apply(e,arguments),"object"!==Ye(e[e.length-1])&&e.push(s(e,a)),t.apply(this,e)}))}return r[Symbol.replace].call(this,e,t)},Ze.apply(this,arguments)}function Ke(e){var t="function"==typeof Map?new Map:void 0;return Ke=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return ze(e,arguments,Xe(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),We(r,e)},Ke(e)}function ze(e,t,n){return ze=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&We(i,n.prototype),i},ze.apply(null,arguments)}function We(e,t){return We=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},We(e,t)}function Xe(e){return Xe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Xe(e)}var $e="static",Qe="dynamic",Je="cmsd-",et=Je+$e,tt=Je+Qe,nt="stream",rt=["mb","st","sf","v"],it={video:"v",audio:"a",text:"tt",stream:nt},at=/^[-0-9]/;function st(){var e,t,n,r,i=this.context,a=(0,l.Z)(i).getInstance();function s(){n={},r={}}function o(e){e&&Object.keys(e).forEach((function(t){rt.includes(t)||delete e[t]}))}function c(e){return!e||"false"!==e.toLowerCase()&&(at.test(e)?parseInt(e,10):e.replace(/["]+/g,""))}function f(e){try{for(var n={},r=e.split(","),i=0;i<r.length;i++){var a=r[i].split("="),s=a[0],o=c(a[1]);n[s]=o}return n}catch(e){t.error("Failed to parse CMSD-Static response header value:",e)}}function h(e){try{for(var n={},r=e.split(","),i=r[r.length-1].split(";"),a=1;a<i.length;a++){var s=i[a].split("="),o=s[0],l=c(s[1]);n[o]=l}return n}catch(e){return t.error("Failed to parse CMSD-Dynamic response header value:",e),[]}}function p(e){return it[e]||"o"}function g(e,t,i){var a=e===$e?n:r,s=a[t]||{},o=a[nt]||{};return s[i]||o[i]}return e={setConfig:function(){},initialize:function(){},reset:function(){s()},parseResponseHeaders:function(e,t){for(var i=null,s=null,l=e.split("\r\n"),c=l.length-1;c>=0;c--){var d=l[c].match(Ze(/^((?:(?!:)[\s\S])*):[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(.*)$/,{key:1,value:2}));if(d&&d.groups){var g=d.groups.key.toLowerCase(),m=d.groups.value;switch(g){case et:i=f(m),a.trigger(u.Z.CMSD_STATIC_HEADER,i);break;case tt:s||(s=h(m))}}}var y=nt;return i&&i.ot?y=i.ot:t&&(y=p(t)),o(n[y]),o(r[y]),i&&(n[y]=Object.assign(n[y]||{},i)),s&&(r[y]=Object.assign(r[y]||{},s)),{static:i,dynamic:s}},getMaxBitrate:function(e){var t=p(e);return g(Qe,t,"mb")||-1},getEstimatedThroughput:function(e){var t=p(e);return g(Qe,t,"etp")||null},getResponseDelay:function(e){var t=p(e);return g(Qe,t,"rd")||null},getRoundTripTime:function(e){var t=p(e);return g(Qe,t,"rtt")||null}},t=(0,d.Z)(i).getInstance().getLogger(e),s(),e}st.__dashjs_factory_name="CmsdModel";var ot=c.Z.getSingletonFactory(st);function lt(){var e,t,n=this.context,r={};function i(){t=(0,d.Z)(n).getInstance().getLogger(e)}function a(e){for(var t={},n=0,r=0,i=0,a=0,s=e.length,o=0;o<s;++o)n+=e[o].chunkDownloadTimeRelativeMS,r+=e[o].bufferLevel,i+=e[o].chunkDownloadTimeRelativeMS*e[o].bufferLevel,a+=e[o].chunkDownloadTimeRelativeMS*e[o].chunkDownloadTimeRelativeMS;return t.m=(i-n*r/s)/(a-n*n/s),t.b=r/s-t.m*n/s,function(e){return t.m*e+t.b}}function s(e){var t,n=!0,r=e.reduce((function(e,t){return e+t.bufferLevelAtSegmentEnd}),0)/e.length;return e.forEach((function(e){Math.abs(e.bufferLevelAtSegmentEnd/e.bufferLevelAtSegmentStart)<.95&&(n=!1),e.bufferLevelAtSegmentEnd/r<.8&&(n=!1),t?t>e.bitrate&&(n=!1):t=e.bitrate})),n}return e={setup:i,addMeasurement:function(e,t,n,i,s){e&&e.mediaType&&!r[e.mediaType]&&(r[e.mediaType]=[]);var o=e.mediaInfo.bitrateList.find((function(t){return t.id===e.representationId}));r[e.mediaType].push({index:e.index,repId:e.representationId,mediaType:e.mediaType,requestTimeMS:i,adjustedAvailabilityStartTimeMS:e.availabilityStartTime.getTime(),segDurationMS:1e3*e.duration,chunksDurationMS:n.reduce((function(e,t){return e+t.chunkDownloadDurationMS}),0),segmentBytes:n.reduce((function(e,t){return e+t.chunkBytes}),0),bitrate:o&&o.bandwidth,bitrateList:e.mediaInfo.bitrateList,chunkMeasurements:n,fetchDownloadDurationMS:t,throughputCapacityDelayMS:s,getEstimatedBufferLevel:a(n.slice(1))}),r[e.mediaType].length>10&&r[e.mediaType].shift()},getThroughputCapacityDelayMS:function(e,t){var n=r[e.mediaType]&&r[e.mediaType].slice(-3);return!n||n.length<3?0:s(n)?t/4>250?250:t/4:0},getEstimatedDownloadDurationMS:function(e){var n=r[e.mediaType].slice(-1).pop(),i=r[e.mediaType].slice(-3),a=n.chunkMeasurements.slice(-1).pop().chunkDownloadTimeRelativeMS;n.bufferLevelAtSegmentStart=n.getEstimatedBufferLevel(a/2),n.bufferLevelAtSegmentEnd=n.getEstimatedBufferLevel(a);var o=s(i),l=o?.6:.8;if(n.isBufferStable&&1.05*n.segDurationMS<n.fetchDownloadDurationMS)return n.fetchDownloadDurationMS;if(!o||n.segDurationMS<n.fetchDownloadDurationMS)return.8*n.fetchDownloadDurationMS;if(n.adjustedAvailabilityStartTimeMS<=n.requestTimeMS+n.throughputCapacityDelayMS-n.segDurationMS)return.8*n.fetchDownloadDurationMS;for(var u=n.requestTimeMS+n.throughputCapacityDelayMS-n.adjustedAvailabilityStartTimeMS,c=0,d=0,f=0,h=0;h<n.chunkMeasurements.length;h++){var p=n.chunkMeasurements[h];if(u<d+p.chunkDownloadDurationMS)break;d+=p.chunkDownloadDurationMS,c+=p.chunkBytes,f++}if(u<0&&t.warn("request time was before adjusted availibitly start time"),c&&d&&f>.2*n.chunkMeasurements.length){var g=c/d,m=n.segmentBytes/g;return n.fetchDownloadDurationMS<m?n.fetchDownloadDurationMS*l:m*l}var y=n.bitrate;return n.bitrateList.some((function(e){if(e.bandwidth>n.bitrate)return y=e.bandwidth,!0})),y===n.bitrate?n.fetchDownloadDurationMS*l:l*n.segmentBytes*8*1e3/y}},i(),e}lt.__dashjs_factory_name="LowLatencyThroughputModel";var ut=c.Z.getSingletonFactory(lt),ct=n(5717);function dt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ft(e){e=e||{};var t,n,r,i,s,o,c,f,h,p,g,m=this.context,y=e.errHandler,v=e.dashMetrics,_=e.mediaPlayerModel,T=e.requestModifier,E=e.boxParser,S=e.errors,A=e.requestTimeout||0,w=(0,l.Z)(m).getInstance(),I=(0,C.Z)(m).getInstance();function D(e,t){var l,d=e.request,g=[],S=!0,C=!0,N=new Date,O=N,P=0,M=null,x=null;if(!T||!v||!y)throw new Error("config object is not correct or missing");var L,k=function(e){d.requestStartDate=N,d.requestEndDate=new Date,d.firstByteDate=d.firstByteDate||N,d.fileLoaderType=x;var t=l.response?l.response.responseURL:null,n=l.response?l.response.status:null,r=l.response&&l.response.getAllResponseHeaders?l.response.getAllResponseHeaders():l.response?l.response.responseHeaders:null,i=r&&I.get().streaming.cmsd&&I.get().streaming.cmsd.enabled?c.parseResponseHeaders(r,d.mediaType):null;v.addHttpRequest(d,t,n,r,e?g:null,i)},F=function(e){C=!1,k(e),d.type===R.w.MPD_TYPE&&(v.addManifestUpdate(d),w.trigger(u.Z.MANIFEST_LOADING_FINISHED,{request:d}))},U=function(){if(M&&(clearTimeout(M),M=null),-1!==n.indexOf(l)&&(n.splice(n.indexOf(l),1),C))if(F(!1),t>0){try{I.get().streaming.utcSynchronization.enableBackgroundSyncAfterSegmentDownloadError&&d.type===R.w.MEDIA_SEGMENT_TYPE&&_.getRetryAttemptsForType(R.w.MEDIA_SEGMENT_TYPE)===t&&w.trigger(u.Z.ATTEMPT_BACKGROUND_SYNC)}catch(e){}t--;var r={config:e};i.push(r),r.timeout=setTimeout((function(){-1!==i.indexOf(r)&&(i.splice(i.indexOf(r),1),D(e,t))}),_.getRetryIntervalsForType(d.type))}else{if(d.type===R.w.MSS_FRAGMENT_INFO_SEGMENT_TYPE)return;y.error(new b.Z(s[d.type],d.url+" is not available",{request:d,response:l.response})),e.error&&e.error(d,"error",l.response.statusText,l.response),e.complete&&e.complete(d,l.response.statusText)}};d.hasOwnProperty("availabilityTimeComplete")&&!1===d.availabilityTimeComplete&&window.fetch&&"arraybuffer"===d.responseType&&d.type===R.w.MEDIA_SEGMENT_TYPE?((L=ce(m).create({requestModifier:T,lowLatencyThroughputModel:h,boxParser:E})).setup({dashMetrics:v}),x=a.Z.FILE_LOADER_TYPES.FETCH):(L=(0,se.Z)(m).create({requestModifier:T}),x=a.Z.FILE_LOADER_TYPES.XHR);var B=null,j=T.modifyRequestURL?T.modifyRequestURL(d.url):d.url;if(I.get().streaming.cmcd&&I.get().streaming.cmcd.enabled){var q=I.get().streaming.cmcd.mode;if(q===a.Z.CMCD_MODE_QUERY){var H=function(e){try{var t=[],n=o.getQueryParameter(e);return n&&t.push(n),t}catch(e){return[]}}(d);j=je.Z.addAditionalQueryParameterToUrl(j,H)}else q===a.Z.CMCD_MODE_HEADER&&(B=o.getHeaderParameters(d))}var G=f.getXHRWithCredentialsForType(d.type);if(d.queryParams){var V=Object.keys(d.queryParams).map((function(e){return{key:e,value:d.queryParams[e]}}));j=je.Z.addAditionalQueryParameterToUrl(j,V)}d.url=j,l={url:j,method:R.w.GET,withCredentials:G,request:d,onload:function(){l.response.status>=200&&l.response.status<=299&&(F(!0),e.success&&e.success(l.response.response,l.response.statusText,l.response.responseURL),e.complete&&e.complete(d,l.response.statusText))},onend:U,onerror:U,progress:function(t){var n=new Date;S&&(S=!1,(!t.lengthComputable||t.lengthComputable&&t.total!==t.loaded)&&(d.firstByteDate=n)),t.lengthComputable&&(d.bytesLoaded=t.loaded,d.bytesTotal=t.total),t.noTrace||(g.push({s:O,d:t.time?t.time:n.getTime()-O.getTime(),b:[t.loaded?t.loaded-P:0]}),O=n,P=t.loaded),M&&(clearTimeout(M),M=null),I.get().streaming.fragmentRequestProgressTimeout>0&&(M=setTimeout((function(){p.warn("Abort request "+l.url+" due to progress timeout"),l.response.onabort=null,l.loader.abort(l),U()}),I.get().streaming.fragmentRequestProgressTimeout)),e.progress&&t&&e.progress(t)},onabort:function(){k(!0),M&&(clearTimeout(M),M=null),e.abort&&e.abort(d)},ontimeout:function(e){var t;if(e.lengthComputable){var n=e.loaded/e.total*100;t="Request timeout: loaded: "+e.loaded+", out of: "+e.total+" : "+n.toFixed(3)+"% Completed"}else t="Request timeout: non-computable download size";p.warn(t)},loader:L,timeout:A,headers:B};var Y=(new Date).getTime();if(isNaN(d.delayLoadingTime)||Y>=d.delayLoadingTime)n.push(l),L.load(l);else{var Z={httpRequest:l};r.push(Z),Z.delayTimeout=setTimeout((function(){if(-1!==r.indexOf(Z)){r.splice(r.indexOf(Z),1);try{N=new Date,O=N,n.push(Z.httpRequest),L.load(Z.httpRequest)}catch(e){Z.httpRequest.onerror()}}}),d.delayLoadingTime-Y)}}return t={load:function(e){e.request?D(e,_.getRetryAttemptsForType(e.request.type)):e.error&&e.error(e.request,"error")},abort:function(){i.forEach((function(e){clearTimeout(e.timeout),e.config.request&&e.config.abort&&e.config.abort(e.config.request)})),i=[],r.forEach((function(e){return clearTimeout(e.delayTimeout)})),r=[],n.forEach((function(e){e.request.type!==R.w.MSS_FRAGMENT_INFO_SEGMENT_TYPE&&(e.onloadend=e.onerror=e.onprogress=void 0,e.loader.abort(e))})),n=[]}},p=(0,d.Z)(m).getInstance().getLogger(t),n=[],r=[],i=[],o=Ve(m).getInstance(),c=ot(m).getInstance(),h=ut(m).getInstance(),f=(0,ct.Z)(m).getInstance(),dt(g={},R.w.MPD_TYPE,S.DOWNLOAD_ERROR_ID_MANIFEST_CODE),dt(g,R.w.XLINK_EXPANSION_TYPE,S.DOWNLOAD_ERROR_ID_XLINK_CODE),dt(g,R.w.INIT_SEGMENT_TYPE,S.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE),dt(g,R.w.MEDIA_SEGMENT_TYPE,S.DOWNLOAD_ERROR_ID_CONTENT_CODE),dt(g,R.w.INDEX_SEGMENT_TYPE,S.DOWNLOAD_ERROR_ID_CONTENT_CODE),dt(g,R.w.BITSTREAM_SWITCHING_SEGMENT_TYPE,S.DOWNLOAD_ERROR_ID_CONTENT_CODE),dt(g,R.w.OTHER_TYPE,S.DOWNLOAD_ERROR_ID_CONTENT_CODE),s=g,t}ft.__dashjs_factory_name="HTTPLoader";var ht=c.Z.getClassFactory(ft);function pt(){var e;function t(){e={}}function n(){t()}return n(),{getLoader:function(t){for(var n in e)if(e.hasOwnProperty(n)&&t.startsWith(n))return e[n];return ht},registerLoader:function(t,n){e[t]=n},unregisterLoader:function(t){e[t]&&delete e[t]},unregisterAllLoader:t,reset:n}}pt.__dashjs_factory_name="SchemeLoaderFactory";var gt=c.Z.getSingletonFactory(pt);function mt(e){e=e||{};var t,n,r=this.context;return t=gt(r).getInstance(),{load:function(i){if(!n){var a=t.getLoader(i&&i.request?i.request.url:null);n=a(r).create({errHandler:e.errHandler,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,dashMetrics:e.dashMetrics,boxParser:e.boxParser?e.boxParser:null,constants:e.constants?e.constants:null,dashConstants:e.dashConstants?e.dashConstants:null,urlUtils:e.urlUtils?e.urlUtils:null,requestTimeout:isNaN(e.requestTimeout)?0:e.requestTimeout,errors:e.errors})}n.load(i)},abort:function(){n&&n.abort()}}}mt.__dashjs_factory_name="URLLoader";var yt=c.Z.getClassFactory(mt);function vt(e){return vt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vt(e)}function _t(e,t){return _t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_t(e,t)}function Tt(e){return Tt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Tt(e)}var Et=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_t(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Tt(t);if(n){var i=Tt(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(e,t){return!t||"object"!==vt(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=r.call(this,e)).checkForExistenceOnly=!0,t}return i}(g.Z);function bt(e){e=e||{};var t,n,r=this.context,i=e.eventBus,s=e.events,o=e.urlUtils,l=e.errors,u=e.streamId;return t={checkForExistence:function(e){var t=function(t){i.trigger(s.CHECK_FOR_EXISTENCE_COMPLETED,{request:e,exists:t})};if(e){var r=new Et(e.url);n.load({request:r,success:function(){t(!0)},error:function(){t(!1)}})}else t(!1)},load:function(e){var r=function(n,r){i.trigger(s.LOADING_COMPLETED,{request:e,response:n||null,error:r||null,sender:t})};e?n.load({request:e,progress:function(n){i.trigger(s.LOADING_PROGRESS,{request:e,stream:n.stream,streamId:u}),n.data&&i.trigger(s.LOADING_DATA_PROGRESS,{request:e,response:n.data||null,error:null,sender:t})},success:function(e){r(e)},error:function(e,t,n){r(void 0,new b.Z(l.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE,n,t))},abort:function(e){e&&i.trigger(s.LOADING_ABANDONED,{mediaType:e.mediaType,request:e,sender:t})}}):r(void 0,new b.Z(l.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE,l.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE))},abort:function(){n&&n.abort()},reset:function(){n&&(n.abort(),n=null)}},n=yt(r).create({errHandler:e.errHandler,errors:l,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,urlUtils:o,constants:a.Z,boxParser:e.boxParser,dashConstants:e.dashConstants,requestTimeout:e.settings.get().streaming.fragmentRequestTimeout}),t}bt.__dashjs_factory_name="FragmentLoader";var St=c.Z.getClassFactory(bt);function At(){return{modifyResponseAsync:function(e){return Promise.resolve(e)}}}At.__dashjs_factory_name="SegmentResponseModifier";var wt=c.Z.getSingletonFactory(At);function It(e){e=e||{};var t,n,r,i=this.context,s=(0,l.Z)(i).getInstance(),o=e.errHandler,c=e.mediaPlayerModel,h=e.dashMetrics,p=(0,d.Z)(i).getInstance(),g=wt(i).getInstance(),m=e.streamInfo;function y(){return m.id}function v(){for(var e in r)r[e].reset();r={}}function _(e){if(e.sender){var t=e.request,r=e.response,i=t.isInitializationRequest(),o=t.mediaInfo.streamInfo;if(e.error&&(t.mediaType===a.Z.AUDIO||t.mediaType===a.Z.VIDEO||t.mediaType===a.Z.TEXT&&t.mediaInfo.isFragmented)&&s.trigger(u.Z.SERVICE_LOCATION_BASE_URL_BLACKLIST_ADD,{entry:e.request.serviceLocation}),r&&o){var l=function(e,t,n,r){var i=new ae;return i.streamId=n,i.mediaInfo=t.mediaInfo,i.segmentType=t.type,i.start=t.startTime,i.duration=t.duration,i.end=i.start+i.duration,i.bytes=e,i.index=t.index,i.quality=t.quality,i.representationId=t.representationId,i.endFragment=r,i}(r,t,m.id,e.type!==u.Z.FRAGMENT_LOADING_PROGRESS);g.modifyResponseAsync(l).then((function(e){s.trigger(i?u.Z.INIT_FRAGMENT_LOADED:u.Z.MEDIA_FRAGMENT_LOADED,{chunk:e,request:t},{streamId:o.id,mediaType:t.mediaType})})).catch((function(e){n.error(e),s.trigger(i?u.Z.INIT_FRAGMENT_LOADED:u.Z.MEDIA_FRAGMENT_LOADED,{chunk:l,request:t},{streamId:o.id,mediaType:t.mediaType})}))}else n.warn("No "+t.mediaType+" bytes to push or stream is inactive.")}}return t={getStreamId:y,getModel:function(t){var n=r[t];return n||(n=E(i).create({streamInfo:m,type:t,dashMetrics:h,fragmentLoader:St(i).create({dashMetrics:h,mediaPlayerModel:c,errHandler:o,requestModifier:(0,W.Z)(i).getInstance(),settings:e.settings,boxParser:e.boxParser,eventBus:s,events:u.Z,errors:I,dashConstants:e.dashConstants,urlUtils:e.urlUtils,streamId:y()}),debug:p,eventBus:s,events:u.Z}),r[t]=n),n},reset:function(){s.off(f.Z.FRAGMENT_LOADING_COMPLETED,_,this),s.off(f.Z.FRAGMENT_LOADING_PROGRESS,_,this),v()}},n=p.getLogger(t),v(),s.on(f.Z.FRAGMENT_LOADING_COMPLETED,_,t),s.on(f.Z.FRAGMENT_LOADING_PROGRESS,_,t),t}It.__dashjs_factory_name="FragmentController";var Ct=c.Z.getClassFactory(It),Rt=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=null,this.width=null,this.height=null,this.x=null,this.y=null},Dt=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mediaType=null,this.bitrate=null,this.width=null,this.height=null,this.scanType=null,this.qualityIndex=NaN};function Nt(e){var t,n,r=this.context,i=e.streamInfo;function s(e){n.setTrackByIndex(e)}function o(){n&&n.reset()}return t={getStreamId:function(){return i.id},initialize:function(){n.addTracks();var e=n.getTracks();e&&e.length>0&&s(0)},provide:function(e,t){if("function"==typeof t){var r,i,a=n.getCurrentTrack();if(!a||a.segmentDuration<=0||null==e)t(null);else{(i=n.getThumbnailRequestForTime(e))&&(a.segmentDuration=i.duration),r=e%a.segmentDuration;var s=Math.floor(r*a.tilesHor*a.tilesVert/a.segmentDuration),o=new Rt;if(o.width=Math.floor(a.widthPerTile),o.height=Math.floor(a.heightPerTile),o.x=Math.floor(s%a.tilesHor)*a.widthPerTile,o.y=Math.floor(s/a.tilesHor)*a.heightPerTile,"readThumbnail"in a)return a.readThumbnail(e,(function(e){o.url=e,t(o)}));if(i)o.url=i.url,a.segmentDuration=NaN;else{var l=Math.floor(e/a.segmentDuration);o.url=function(e,t){var n=t+e.startNumber,r=(0,V.vi)(e.templateUrl,"Number",n);return r=(0,V.vi)(r,"Time",(n-1)*e.segmentDuration*e.timescale),r=(0,V.vi)(r,"Bandwidth",e.bandwidth),(0,V.eR)(r)}(a,l)}t(o)}}},setTrackByIndex:s,getCurrentTrackIndex:function(){return n.getCurrentTrackIndex()},getBitrateList:function(){var e=n.getTracks(),t=0;return e.map((function(e){var n=new Dt;return n.mediaType=a.Z.IMAGE,n.qualityIndex=t++,n.bitrate=e.bitrate,n.width=e.width,n.height=e.height,n}))},reset:o},o(),n=(0,De.Z)(r).create({streamInfo:i,adapter:e.adapter,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:e.debug,eventBus:e.eventBus,events:e.events,dashConstants:e.dashConstants,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController}),t}Nt.__dashjs_factory_name="ThumbnailController";var Ot=c.Z.getClassFactory(Nt),Pt=n(7417);function Mt(e){var t;e=e||{};var n=[],r=(0,l.Z)(this.context).getInstance(),i=e.updateEventName,a=e.addBlacklistEventName;function s(e){-1===n.indexOf(e)&&(n.push(e),r.trigger(i,{entry:e}))}return t={add:s,contains:function(e){return!!(n.length&&e&&e.length)&&-1!==n.indexOf(e)},reset:function(){n=[]}},a&&r.on(a,(function(e){s(e.entry)}),t),t}Mt.__dashjs_factory_name="BlackListController";var xt=c.Z.getClassFactory(Mt),Lt=[a.Z.VIDEO,a.Z.AUDIO,a.Z.TEXT,a.Z.MUXED,a.Z.IMAGE];function kt(e){e=e||{};var t,n,r,i,o,c,f,h,p,g,m,y,v,_,T,E,S,A,w=this.context,C=(0,l.Z)(w).getInstance(),R=(0,X.Z)(w).getInstance(),D=e.manifestModel,N=e.mediaPlayerModel,O=e.dashMetrics,P=e.manifestUpdater,M=e.adapter,x=e.timelineConverter,L=e.capabilities,k=e.errHandler,F=e.abrController,U=e.playbackController,B=e.eventController,j=e.mediaController,q=e.protectionController,H=e.textController,G=e.videoModel,V=e.streamInfo,Y=e.settings;function Z(e,t){return new Promise((function(i,s){ne(),g=!0,ae();var o=G.getElement(),l=[];Lt.forEach((function(t){(t!==a.Z.TEXT||e)&&(t!==a.Z.VIDEO||!o||o&&/^VIDEO$/i.test(o.nodeName))&&l.push(K(t,e))})),Promise.all(l).then((function(){return e=t,new Promise((function(t){var n={},i=r.map((function(t){return t.createBufferSinks(e)}));Promise.all(i).then((function(e){e.forEach((function(e){e&&(n[e.getType()]=e)})),t(n)})).catch((function(){t(n)}))}));var e})).then((function(t){if(g=!1,0===r.length){var a="No streams to play.";k.error(new b.Z(I.MANIFEST_ERROR_ID_NOSTREAMS_CODE,a,D.getValue())),n.fatal(a)}else se();e&&H.createTracks(V),i(t)})).catch((function(e){s(e)}))}))}function K(t,i){var o,l=M.getAllMediaInfoForType(V,t),c=[],d=null;if(!l||0===l.length)return n.info("No "+t+" data."),Promise.resolve();t===a.Z.VIDEO&&(f=!0),t===a.Z.AUDIO&&(h=!0);for(var p=0,g=l.length;p<g;p++)d=l[p],t===a.Z.TEXT&&d.isEmbedded&&(H.addEmbeddedTrack(V,d),c.push(d)),z(d)&&j.addTrack(d);if(c.length>0&&(j.setInitialMediaSettingsForType(t,V),H.addMediaInfosToBuffer(V,t,c)),l=l.filter((function(e){return!e.isEmbedded})),0===l.length)return Promise.resolve();if(t===a.Z.IMAGE)return(y=Ot(w).create({streamInfo:V,adapter:M,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:E,eventBus:C,events:u.Z,dashConstants:s.Z,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController})).initialize(),Promise.resolve();C.trigger(u.Z.STREAM_INITIALIZING,{streamInfo:V,mediaInfo:d}),j.setInitialMediaSettingsForType(t,V);var _=function(t,n){var i=t&&t.length>0?t[0]:null,s=m.getModel(i?i.type:null),o=i?i.type:null,l=i?i.mimeType:null,u=i?i.isFragmented:null,c=ie(w).create({streamInfo:V,type:o,mimeType:l,timelineConverter:x,adapter:M,manifestModel:D,mediaPlayerModel:N,fragmentModel:s,dashMetrics:e.dashMetrics,baseURLController:e.baseURLController,segmentBaseController:e.segmentBaseController,abrController:F,playbackController:U,mediaController:j,textController:H,errHandler:k,settings:Y,boxParser:T,segmentBlacklistController:v});c.initialize(n,f,u),r.push(c);for(var d=0;d<t.length;d++)c.addMediaInfo(t[d]);return o===a.Z.TEXT&&H.addMediaInfosToBuffer(V,o,t,s),c}(l,i);return(o=j.getCurrentTrackFor(t,V.id))?(F.updateTopQualityIndex(o),_.selectMediaInfo(t===a.Z.TEXT&&o.isEmbedded?l[0]:o)):Promise.resolve()}function z(e){var t,r=e?e.type:null;return r===a.Z.MUXED?(t="Multiplexed representations are intentionally not supported, as they are not compliant with the DASH-AVC/264 guidelines",n.fatal(t),k.error(new b.Z(I.MANIFEST_ERROR_ID_MULTIPLEXED_CODE,t,D.getValue())),!1):!(r!==a.Z.TEXT&&r!==a.Z.IMAGE&&e.contentProtection&&!L.supportsEncryptedMedia()&&(k.error(new b.Z(I.CAPABILITY_MEDIAKEYS_ERROR_CODE,I.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE)),1))}function W(e){for(var t=r?r.length:0,n=0;n<t;n++){var i=r[n].getFragmentModel();i.abortRequests(),i.resetInitialSettings(),r[n].reset(!1,e)}H&&H.deactivateStream(V),r=[],o=!1,c=!1,me(!1),Q(!1),C.trigger(u.Z.STREAM_DEACTIVATED,{streamInfo:V})}function $(e){W(e),i=!1,f=!1,h=!1,p={},g=!1,S=!1,A=[]}function Q(e){S=e}function J(){return V?V.start:NaN}function ee(){return V?V.id:null}function te(){return V}function ne(){if(!G||!F)throw new Error(a.Z.MISSING_CONFIG_ERROR)}function re(e){e.error&&(k.error(e.error),n.fatal(e.error.message))}function ae(){if(B){var e=M.getEventsFor(V);e&&e.length>0&&B.addInlineEvents(e,V.id)}}function se(){for(var e=r.length,t=p.audio||p.video?new b.Z(I.DATA_UPDATE_FAILED_ERROR_CODE,I.DATA_UPDATE_FAILED_ERROR_MESSAGE):null,n=0;n<e;n++)if(r[n].isUpdating()||g)return;if(q){q.clearMediaInfoArray();for(var s=0;s<e&&r[s];s++){var o=r[s].getType(),l=r[s].getMediaInfo();if(o===a.Z.AUDIO||o===a.Z.VIDEO||o===a.Z.TEXT&&l.isFragmented){var c=r[s].getMediaInfo();c&&q.initializeForMedia(c)}}q.handleKeySystemFromManifest()}t?k.error(t):i||(i=!0,G.waitForReadyState(a.Z.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,(function(){C.trigger(u.Z.STREAM_INITIALIZED,{streamInfo:V})})))}function oe(){var e=fe(),t=e.length;if(0!==t){for(var r=0;r<t;r++)if(!e[r].isBufferingCompleted()&&(e[r].getType()===a.Z.AUDIO||e[r].getType()===a.Z.VIDEO))return void n.debug("onBufferingCompleted - One streamProcessor has finished but",e[r].getType(),"one is not buffering completed");n.debug("onBufferingCompleted - trigger STREAM_BUFFERING_COMPLETED"),c=!0,C.trigger(u.Z.STREAM_BUFFERING_COMPLETED,{streamInfo:V},{streamInfo:V})}else n.warn("onBufferingCompleted - can't trigger STREAM_BUFFERING_COMPLETED because no streamProcessor is defined")}function le(e){p[e.mediaType]=e.error,se()}function ue(e){B&&B.addInbandEvents(e.events,V.id)}function ce(e){return e&&e.type?de(e.type):null}function de(e){return e?fe().filter((function(t){return t.getType()===e}))[0]:null}function fe(){for(var e,t,n=[],i=0;i<r.length;i++)(e=(t=r[i]).getType())!==a.Z.AUDIO&&e!==a.Z.VIDEO&&e!==a.Z.TEXT||n.push(t);return n}function he(e,t){var n=te(),r=t.getStreamInfo();if(!r||!n)return!0;var i=M.getAdaptationForType(r.index,e,r),a=M.getAdaptationForType(n.index,e,n);return i&&a?!(!pe(a)&&pe(i)):!i&&!a}function pe(e){return!!e&&!!(e.ContentProtection||e.Representation_asArray&&e.Representation_asArray.length>0&&e.Representation_asArray[0].ContentProtection)}function ge(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e||!e.hasOwnProperty("getStreamInfo"))return!1;var r=e.getStreamInfo(),i=n?n.getStreamInfo():te();if(!r||!i)return!1;var a=M.getAdaptationForType(r.index,t,r),s=M.getAdaptationForType(i.index,t,i);if(!a||!s)return!a&&!s;var o=a&&s&&a.mimeType===s.mimeType,l=s.Representation_asArray.map((function(e){return e.codecs})),u=a.Representation_asArray.map((function(e){return e.codecs})),c=u.some((function(e){return l.indexOf(e)>-1})),d=u.some((function(e){return l.some((function(t){return L.codecRootCompatibleWithCodec(t,e)}))}));return c||d&&o}function me(e){_=e}function ye(){return _}return t={initialize:function(){C.on(u.Z.BUFFERING_COMPLETED,oe,t),C.on(u.Z.DATA_UPDATE_COMPLETED,le,t),C.on(u.Z.INBAND_EVENTS,ue,t),q&&(C.on(u.Z.KEY_ERROR,re,t),C.on(u.Z.SERVER_CERTIFICATE_UPDATED,re,t),C.on(u.Z.LICENSE_REQUEST_COMPLETE,re,t),C.on(u.Z.KEY_SYSTEM_SELECTED,re,t),C.on(u.Z.KEY_SESSION_CREATED,re,t),C.on(u.Z.KEY_STATUSES_CHANGED,re,t)),H.initializeForStream(V),C.trigger(u.Z.STREAM_UPDATED,{streamInfo:V})},getStreamId:function(){return V?V.id:null},activate:function(e,t){return new Promise((function(n,r){if(!o)return ye()?(o=!0,C.trigger(u.Z.STREAM_ACTIVATED,{streamInfo:V}),void n(t)):void function(e,t){return Z(e,t)}(e,t).then((function(e){o=!0,C.trigger(u.Z.STREAM_ACTIVATED,{streamInfo:V}),n(e)})).catch((function(e){r(e)}));n(t)}))},deactivate:W,getIsActive:function(){return o},getDuration:function(){return V?V.duration:NaN},getStartTime:J,getId:ee,getStreamInfo:te,getHasAudioTrack:function(){return h},getHasVideoTrack:function(){return f},startPreloading:function(e,t){return new Promise((function(i,a){ye()?a():(n.info("[startPreloading] Preloading next stream with id ".concat(ee())),me(!0),Z(e,t).then((function(){for(var e=0;e<r.length&&r[e];e++)r[e].setExplicitBufferingTime(J()),r[e].getScheduleController().startScheduleTimer();i()})).catch((function(){me(!1),a()})))}))},initializeForTextWithMediaSource:function(e){return new Promise((function(t,n){K(a.Z.TEXT,e).then((function(){return(e=de(a.Z.TEXT))?e.createBufferSinks():Promise.resolve();var e})).then((function(){H.createTracks(V),t()})).catch((function(e){n(e)}))}))},getThumbnailController:function(){return y},getBitrateListFor:function(e){if(ne(),e===a.Z.IMAGE)return y?y.getBitrateList():[];var t=function(e){for(var t=null,n=0;n<r.length;n++)if((t=r[n]).getType()===e)return t.getMediaInfo();return null}(e);return F.getBitrateList(t)},updateData:function(e){return new Promise((function(t){g=!0,V=e,B&&ae();for(var n=[],i=0,a=r.length;i<a;i++){var s=r[i],o=s.getMediaInfo();n.push(s.updateStreamInfo(V));var l=M.getAllMediaInfoForType(V,s.getType());if(l=l.filter((function(e){return!e.isEmbedded}))){s.clearMediaInfoArray();for(var c=0;c<l.length;c++){var d=l[c];s.addMediaInfo(l[c]),M.areMediaInfosEqual(o,d)&&(F.updateTopQualityIndex(d),n.push(s.selectMediaInfo(d)))}}}Promise.all(n).then((function(){for(n=[];A.length>0;){var e=A.pop(),t=e.newMediaInfo,r=ce(e.oldMediaInfo);if(!r)return;n.push(r.prepareTrackSwitch()),n.push(r.selectMediaInfo(t))}return Promise.all(n)})).then((function(){g=!1,se(),C.trigger(u.Z.STREAM_UPDATED,{streamInfo:V}),t()}))}))},reset:function(e){m&&(m.reset(),m=null),F&&V&&F.clearDataForStream(V.id),v&&(v.reset(),v=null),$(e),V=null,C.off(u.Z.DATA_UPDATE_COMPLETED,le,t),C.off(u.Z.BUFFERING_COMPLETED,oe,t),C.off(u.Z.INBAND_EVENTS,ue,t),q&&(C.off(u.Z.KEY_ERROR,re,t),C.off(u.Z.SERVER_CERTIFICATE_UPDATED,re,t),C.off(u.Z.LICENSE_REQUEST_COMPLETE,re,t),C.off(u.Z.KEY_SYSTEM_SELECTED,re,t),C.off(u.Z.KEY_SESSION_CREATED,re,t),C.off(u.Z.KEY_STATUSES_CHANGED,re,t))},getProcessors:fe,setMediaSource:function(e){return new Promise((function(t,i){for(var a=[],s=0;s<r.length;)z(r[s].getMediaInfo())?(a.push(r[s].setMediaSource(e)),s++):(r[s].reset(),r.splice(s,1));Promise.all(a).then((function(){for(var e=0;e<r.length;e++)r[e].dischargePreBuffer();if(0===r.length){var i="No streams to play.";k.error(new b.Z(I.MANIFEST_ERROR_ID_NOSTREAMS_CODE,i+"nostreams",D.getValue())),n.fatal(i)}t()})).catch((function(e){n.error(e),i(e)}))}))},isMediaCodecCompatible:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return ge(e,a.Z.VIDEO,t)&&ge(e,a.Z.AUDIO,t)},isProtectionCompatible:function(e){return!e||he(a.Z.VIDEO,e)&&he(a.Z.AUDIO,e)},getPreloaded:ye,getIsEndedEventSignaled:function(){return S},setIsEndedEventSignaled:Q,getAdapter:function(){return M},getHasFinishedBuffering:function(){return c},setPreloaded:me,startScheduleControllers:function(){for(var e=r.length,t=0;t<e&&r[t];t++)r[t].getScheduleController().startScheduleTimer()},prepareTrackChange:function(e){if(o&&V){c=!1;var t=e.newMediaInfo,r=D.getValue();M.setCurrentMediaInfo(V.id,t.type,t);var i=ce(t);if(i){var s=U.getTime();n.info("Stream -  Process track changed at current time "+s),r.refreshManifestOnSwitchTrack?(A.push(e),P.getIsUpdating()||(n.debug("Stream -  Refreshing manifest for switch track"),P.refreshManifest())):i.selectMediaInfo(t).then((function(){t.type!==a.Z.VIDEO&&t.type!==a.Z.AUDIO||F.updateTopQualityIndex(t),i.prepareTrackSwitch()}))}}},prepareQualityChange:function(e){var t=de(e.mediaType);t&&t.prepareQualityChange(e)}},function(){try{E=(0,d.Z)(w).getInstance(),n=E.getLogger(t),$(),T=(0,Pt.Z)(w).getInstance(),v=xt(w).create({updateEventName:u.Z.SEGMENT_LOCATION_BLACKLIST_CHANGED,addBlacklistEventName:u.Z.SEGMENT_LOCATION_BLACKLIST_ADD}),m=Ct(w).create({streamInfo:V,mediaPlayerModel:N,dashMetrics:O,errHandler:k,settings:Y,boxParser:T,dashConstants:s.Z,urlUtils:R})}catch(e){throw e}}(),t}kt.__dashjs_factory_name="Stream";var Ft=c.Z.getClassFactory(kt),Ut=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t||null,this.type=R.w.CONTENT_STEERING_TYPE,this.responseType="json"},Bt=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.version=null,this.ttl=300,this.reloadUri=null,this.pathwayPriority=[],this.pathwayClones=[]};function jt(){var e,t,n,r,i,a,o,l,u,c,h,p,g,m,y,v=this.context,_=(0,X.Z)(v).getInstance();function T(e){w(e,"baseUrl")}function E(e){w(e,"location")}function b(e){if(e&&e.request&&e.request.serviceLocation&&e.request.requestStartDate&&e.request.requestEndDate&&!isNaN(e.request.bytesTotal)){var t=e.request.serviceLocation,n=e.request.requestEndDate.getTime()-e.request.requestStartDate.getTime();A(t,parseInt(8*e.request.bytesTotal/n*1e3))}}function S(e){e&&e.httpRequest&&e.httpRequest._serviceLocation&&!isNaN(e.throughput)&&A(e.httpRequest._serviceLocation,1e3*e.throughput)}function A(e,t){i[e]||(i[e]=[]),i[e].push(t),i[e].length>4&&i[e].shift()}function w(e,t){if(e&&e.request&&e.request.serviceLocation){var n=e.request.serviceLocation;-1===r[t].all.indexOf(n)&&r[t].all.push(n),r[t].current=n}}function C(){var e=h.getValue(),t=y.getContentSteering(e);return t||(t=g.getServiceDescriptionSettings().contentSteering),t}function R(){return new Promise((function(e){try{var a=C();if(!a||!a.serverUrl)return void e();var l=function(e){var t=e.serverUrl;n&&n.reloadUri&&(t=_.isRelative(n.reloadUri)?_.resolve(n.reloadUri,e.serverUrl):n.reloadUri);var a=[],s=r.baseUrl.all.concat(r.location.all);if(s.length>0){var o=s.map((function(e){var t=function(e){if(!e||!i[e]||0===i[e].length)return-1;var t=i[e].reduce((function(e,t){return e+t}))/i[e].length;return parseInt(t)}(e);return{serviceLocation:e,throughput:t}}));o.sort((function(e,t){return t.throughput-e.throughput}));var l="",u="";o.forEach((function(e,t){0!==t&&(l="".concat(l,","),e.throughput>-1&&(u="".concat(u,","))),l="".concat(l).concat(e.serviceLocation),e.throughput>-1&&(u="".concat(u).concat(e.throughput))})),a.push({key:"_DASH_pathway",value:'"'.concat(l,'"')}),a.push({key:"_DASH_throughput",value:u})}return je.Z.addAditionalQueryParameterToUrl(t,a)}(a),u=new Ut(l);o.load({request:u,success:function(t){!function(e){e&&e[s.Z.CONTENT_STEERING_RESPONSE.VERSION]&&1===parseInt(e[s.Z.CONTENT_STEERING_RESPONSE.VERSION])&&((n=new Bt).version=e[s.Z.CONTENT_STEERING_RESPONSE.VERSION],e[s.Z.CONTENT_STEERING_RESPONSE.TTL]&&!isNaN(e[s.Z.CONTENT_STEERING_RESPONSE.TTL])&&(n.ttl=e[s.Z.CONTENT_STEERING_RESPONSE.TTL]),e[s.Z.CONTENT_STEERING_RESPONSE.RELOAD_URI]&&(n.reloadUri=e[s.Z.CONTENT_STEERING_RESPONSE.RELOAD_URI]),e[s.Z.CONTENT_STEERING_RESPONSE.PATHWAY_PRIORITY]&&(n.pathwayPriority=e[s.Z.CONTENT_STEERING_RESPONSE.PATHWAY_PRIORITY]),e[s.Z.CONTENT_STEERING_RESPONSE.PATHWAY_CLONES]&&(n.pathwayClones=e[s.Z.CONTENT_STEERING_RESPONSE.PATHWAY_CLONES],n.pathwayClones=n.pathwayClones.filter((function(e){return function(e){return e[s.Z.CONTENT_STEERING_RESPONSE.BASE_ID]&&e[s.Z.CONTENT_STEERING_RESPONSE.ID]&&e[s.Z.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT]&&e[s.Z.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT][s.Z.CONTENT_STEERING_RESPONSE.HOST]}(e)}))),O())}(t),m.trigger(f.Z.CONTENT_STEERING_REQUEST_COMPLETED,{currentSteeringResponseData:n,url:l}),e()},error:function(r,i,a,s){!function(e,r){try{switch(t.warn("Error fetching data from content steering server",e),r.status){case 410:break;case 429:var i=r&&r.getResponseHeader?r.getResponseHeader("retry-after"):null;null!==i&&(n||(n={}),n.ttl=parseInt(i)),O();break;default:O()}}catch(e){t.error(e)}}(r,s),e(r)},complete:function(){r.baseUrl.all=D(r.baseUrl),r.location.all=D(r.location)}})}catch(t){e(t)}}))}function D(e){return e.all&&0!==e.all.length&&e.current?e.all.filter((function(t){return t===e.current})):[]}function N(e){try{var r=[];return e&&0!==e.length&&n&&n.pathwayClones&&0!==n.pathwayClones.length?(n.pathwayClones.forEach((function(t){var n=e.filter((function(e){return t[s.Z.CONTENT_STEERING_RESPONSE.BASE_ID]===e.serviceLocation})),i=null;if(n&&n.length>0&&(i=n[0]),i){var a=new URL(i.url),o=t[s.Z.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT][s.Z.CONTENT_STEERING_RESPONSE.HOST];o=je.Z.stringHasProtocol(o)?o:"".concat(a.protocol,"//").concat(o);var l={synthesizedUrl:"".concat(o).concat(a.pathname),serviceLocation:t[s.Z.CONTENT_STEERING_RESPONSE.ID],queryParams:t[s.Z.CONTENT_STEERING_RESPONSE.URI_REPLACEMENT][s.Z.CONTENT_STEERING_RESPONSE.PARAMS],reference:i};r.push(l)}})),r):r}catch(e){return t.error(e),[]}}function O(){n&&n.ttl&&!isNaN(n.ttl)&&(a&&clearTimeout(a),a=setTimeout((function(){R()}),1e3*n.ttl))}function P(){a&&clearTimeout(a),a=null}function M(){n=null,i={},r={baseUrl:{current:null,all:[]},location:{current:null,all:[]}},P()}return e={reset:function(){M(),m.off(f.Z.FRAGMENT_LOADING_STARTED,T,e),m.off(f.Z.MANIFEST_LOADING_STARTED,E,e),m.off(f.Z.MANIFEST_LOADING_FINISHED,b,e),m.off(f.Z.THROUGHPUT_MEASUREMENT_STORED,S,e)},setConfig:function(e){e&&(e.adapter&&(y=e.adapter),e.errHandler&&(l=e.errHandler),e.dashMetrics&&(u=e.dashMetrics),e.mediaPlayerModel&&(c=e.mediaPlayerModel),e.requestModifier&&(p=e.requestModifier),e.manifestModel&&(h=e.manifestModel),e.serviceDescriptionController&&(g=e.serviceDescriptionController),e.eventBus&&(m=e.eventBus))},loadSteeringData:R,getCurrentSteeringResponseData:function(){return n},shouldQueryBeforeStart:function(){var e=C();return!!e&&e.queryBeforeStart},getSteeringDataFromManifest:C,stopSteeringRequestTimer:P,getSynthesizedBaseUrlElements:function(e){try{return N(e).map((function(e){var t=new Te(e.synthesizedUrl,e.serviceLocation);return t.queryParams=e.queryParams,t.dvbPriority=e.reference.dvbPriority,t.dvbWeight=e.reference.dvbWeight,t.availabilityTimeOffset=e.reference.availabilityTimeOffset,t.availabilityTimeComplete=e.reference.availabilityTimeComplete,t}))}catch(e){return t.error(e),[]}},getSynthesizedLocationElements:function(e){try{return N(e).map((function(e){var t=new Ne(e.synthesizedUrl,e.serviceLocation);return t.queryParams=e.queryParams,t}))}catch(e){return t.error(e),[]}},initialize:function(){o=yt(v).create({errHandler:l,dashMetrics:u,mediaPlayerModel:c,requestModifier:p,errors:I}),m.on(f.Z.FRAGMENT_LOADING_STARTED,T,e),m.on(f.Z.MANIFEST_LOADING_STARTED,E,e),m.on(f.Z.MANIFEST_LOADING_FINISHED,b,e),m.on(f.Z.THROUGHPUT_MEASUREMENT_STORED,S,e)}},t=(0,d.Z)(v).getInstance().getLogger(e),M(),e}jt.__dashjs_factory_name="ContentSteeringController";var qt=c.Z.getSingletonFactory(jt);function Ht(){var e,t,n,r=this.context,i=(0,C.Z)(r).getInstance();return e={select:function(e){if(!e||0===e.length)return null;var r=null;return i.get().streaming.applyContentSteering&&(r=function(e){var r=n.getCurrentSteeringResponseData();return r&&r.pathwayPriority&&r.pathwayPriority.length>0?function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=0,i=null,a=function(){var a=e[r],s=n.findIndex((function(e){return e.serviceLocation&&e.serviceLocation===a}));if(-1!==s&&!t.contains(n[s].serviceLocation))return i=n[s],"break";r+=1};r<e.length&&"break"!==a(););return i}(r.pathwayPriority,e):null}(e)),r||(r=function(e){return e[0]}(e)),r},setConfig:function(e){e.blacklistController&&(t=e.blacklistController),e.contentSteeringController&&(n=e.contentSteeringController)},reset:function(){t.reset()}},t=xt(r).create({updateEventName:u.Z.SERVICE_LOCATION_LOCATION_BLACKLIST_CHANGED,addBlacklistEventName:u.Z.SERVICE_LOCATION_LOCATION_BLACKLIST_ADD}),n=qt(r).getInstance(),e}Ht.__dashjs_factory_name="LocationSelector";var Gt=c.Z.getClassFactory(Ht);function Vt(){var e,t,n,r,i,a,o,c,h,p,g,m,y,v,_=this.context,T=(0,l.Z)(_).getInstance(),E=(0,X.Z)(_).getInstance();function b(){n=NaN,o=!1,i=!0,a=!1,S()}function S(){null!==r&&(clearTimeout(r),r=null)}function A(e){S(),a||(isNaN(e)&&!isNaN(n)&&(e=1e3*n),isNaN(e)||(t.debug("Refresh manifest in "+e+" milliseconds."),r=setTimeout(R,e)))}function w(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];o=!0;var t=h.getValue(),n=t.url,r=null,i=g.getPatchLocation(t),a=p.select(i),s=null;if(a&&!e)n=a.url,r=a.serviceLocation,s=a.queryParams;else{var l=function(e){var t=g.getLocation(e),n=y.getSynthesizedLocationElements(t);return t.concat(n)}(t),u=p.select(l);u&&(n=u.url,r=u.serviceLocation,s=u.queryParams)}E.isRelative(n)&&(n=E.resolve(n,t.url)),c.load(n,r,s)}function C(e){if(e){if(g.getIsPatch(e)){var r=e;e=h.getValue();var l=g.isPatchValid(e,r),c=l;if(l){var d=g.getPublishTime(e);c=g.applyPatchToManifest(e,r);var f=g.getPublishTime(e);c=d.getTime()!=f.getTime()}if(!c)return t.debug("Patch provided is invalid, performing full manifest refresh"),void w(!0);e.loadedTime=new Date}}else(e=h.getValue()).loadedTime=new Date;if(h.getValue()&&h.getValue().type===s.Z.DYNAMIC&&e.type===s.Z.STATIC)return T.trigger(u.Z.DYNAMIC_TO_STATIC),o=!1,void(a=!0);h.setValue(e);var p=new Date,m=(p.getTime()-e.loadedTime.getTime())/1e3;1e3*(n=g.getManifestUpdatePeriod(e,m))>2147483647&&(n=2147483.647),T.trigger(u.Z.MANIFEST_UPDATED,{manifest:e}),t.info("Manifest has been refreshed at "+p+"["+p.getTime()/1e3+"] "),i||A()}function R(){i||(o?A(v.get().streaming.manifestUpdateRetryInterval):w())}function D(e){e.error?e.error.code===I.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE&&m.error(e.error):C(e.manifest)}function N(){i=!1,A()}function O(){(i=!v.get().streaming.scheduling.scheduleWhilePaused)&&S()}function P(){o=!1}return e={initialize:function(){b(),T.on(u.Z.STREAMS_COMPOSED,P,this),T.on(f.Z.PLAYBACK_STARTED,N,this),T.on(f.Z.PLAYBACK_PAUSED,O,this),T.on(u.Z.INTERNAL_MANIFEST_LOADED,D,this)},setManifest:function(e){C(e)},refreshManifest:w,getIsUpdating:function(){return o},setConfig:function(e){e&&(e.manifestModel&&(h=e.manifestModel),e.adapter&&(g=e.adapter),e.manifestLoader&&(c=e.manifestLoader),e.errHandler&&(m=e.errHandler),e.locationSelector&&(p=e.locationSelector),e.settings&&(v=e.settings),e.contentSteeringController&&(y=e.contentSteeringController))},reset:function(){T.off(f.Z.PLAYBACK_STARTED,N,this),T.off(f.Z.PLAYBACK_PAUSED,O,this),T.off(u.Z.STREAMS_COMPOSED,P,this),T.off(u.Z.INTERNAL_MANIFEST_LOADED,D,this),b()}},t=(0,d.Z)(_).getInstance().getLogger(e),p=Gt(_).create(),e}Vt.__dashjs_factory_name="ManifestUpdater";var Yt=c.Z.getClassFactory(Vt);function Zt(){var e,t,n,r,i,a,s,o,c,f,h,p,g,m,y,v,_=this.context,T=(0,l.Z)(_).getInstance(),E=(0,X.Z)(_).getInstance();function S(){o=[],c=[],f=null,h=null,g=null,p=NaN,n=!1,r=!1,m=i.get().streaming.utcSynchronization.timeBetweenSyncAttempts}function A(){i.get().streaming.utcSynchronization.enabled&&!n&&!r&&g&&g.value&&g.schemeIdUri&&!isNaN(p)&&!isNaN(i.get().streaming.utcSynchronization.backgroundAttempts)&&(h&&(Date.now()-h)/1e3<30||(o=[],r=!0,w(isNaN(i.get().streaming.utcSynchronization.backgroundAttempts)?2:i.get().streaming.utcSynchronization.backgroundAttempts)))}function w(e){try{if(e<=0)return void B();var t=Date.now();a[g.schemeIdUri](g.value,(function(n){var r=Date.now(),i=D(t,r,n);o.push(i),w(e-1)}),(function(){B()}))}catch(e){B()}}function C(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)||0;if(!c||0===c.length||e>=c.length)N();else{var t=c[e];if(t)if(a.hasOwnProperty(t.schemeIdUri)){var n=(new Date).getTime();a[t.schemeIdUri](t.value,(function(e){var r=(new Date).getTime(),i=D(n,r,e);g=t,N(i)}),(function(){C(e+1)}))}else C(e+1);else N()}}function D(e,t,n){return n-(t-(t-e)/2)}function N(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:NaN,t=isNaN(e);t&&i.get().streaming.utcSynchronization.useManifestDateHeaderTimeSource?function(){var e=s.getLatestMPDRequestHeaderValueByID("Date"),t=null!==e?new Date(e).getTime():Number.NaN;isNaN(t)?U(!0):U(!1,t-Date.now())}():U(t,e)}function O(e){var t=Date.parse(e);return isNaN(t)&&(t=function(e){var t,n,r=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+\-])([0-9]{2})([0-9]{2}))?/.exec(e);return t=Date.UTC(parseInt(r[1],10),parseInt(r[2],10)-1,parseInt(r[3],10),parseInt(r[4],10),parseInt(r[5],10),r[6]&&(parseInt(r[6],10)||0),r[7]&&1e3*parseFloat(r[7])||0),r[9]&&r[10]&&(n=60*parseInt(r[9],10)+parseInt(r[10],10),t+=("+"===r[8]?-1:1)*n*60*1e3),new Date(t).getTime()}(e)),t}function P(e){return Date.parse(e)}function M(e){return Date.parse(e)}function x(e,t,n){n()}function L(e,t,n){var r=O(e);isNaN(r)?n():t(r)}function k(e,t,n,r,i){var a,s,o=!1,l=new XMLHttpRequest,u=i?R.w.HEAD:R.w.GET,c=t.match(/\S+/g);if(t=c.shift(),a=function(){o||(o=!0,c.length?k(e,c.join(" "),n,r,i):r())},s=function(){var t,r;200===l.status&&(t=i?l.getResponseHeader("Date"):l.response,r=e(t),isNaN(r)||(n(r),o=!0))},E.isRelative(t)){var d=v.resolve();d&&(t=E.resolve(t,d.url))}l.open(u,t),l.timeout=5e3,l.onload=s,l.onloadend=a,l.send()}function F(e,t,n){k(M,e,t,n,!0)}function U(e,r){if(isNaN(p)||isNaN(r)||e||function(e){try{var n,r=j(e),a=isNaN(m)?30:m,s=isNaN(i.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor)?2:i.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor,o=isNaN(i.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts)?600:i.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts,l=isNaN(i.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts)?2:i.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts;r?(n=Math.min(a*s,o),t.debug("Increasing timeBetweenSyncAttempts to ".concat(n))):(n=Math.max(a/s,l),t.debug("Decreasing timeBetweenSyncAttempts to ".concat(n))),m=n}catch(e){}}(r),!e&&!isNaN(r)){f=Date.now(),n=!1;var a=isNaN(p);p=r,a&&A(),t.debug("Completed UTC sync. Setting client - server offset to ".concat(r))}e&&(g=null,n=!1,y.error(new b.Z(I.TIME_SYNC_FAILED_ERROR_CODE,I.TIME_SYNC_FAILED_ERROR_MESSAGE))),T.trigger(u.Z.UPDATE_TIME_SYNC_OFFSET,{offset:r}),T.trigger(u.Z.TIME_SYNCHRONIZATION_COMPLETED)}function B(){if(o&&0!==o.length){var e=o.reduce((function(e,t){return e+t}),0)/o.length;j(e)?t.debug("Completed background UTC sync. Offset is within allowed threshold and is not adjusted."):(t.debug("Completed background UTC sync. Setting client - server offset to ".concat(e)),p=e,T.trigger(u.Z.UPDATE_TIME_SYNC_OFFSET,{offset:p})),r=!1,h=Date.now()}}function j(e){try{if(isNaN(p))return!0;var t=i.get().streaming.utcSynchronization.maximumAllowedDrift&&!isNaN(i.get().streaming.utcSynchronization.maximumAllowedDrift)?i.get().streaming.utcSynchronization.maximumAllowedDrift:100;return e>=p-t&&e<=p+t}catch(e){return!0}}return e={initialize:function(){S(),a={"urn:mpeg:dash:utc:http-head:2014":F,"urn:mpeg:dash:utc:http-xsdate:2014":k.bind(null,O),"urn:mpeg:dash:utc:http-iso:2014":k.bind(null,P),"urn:mpeg:dash:utc:direct:2014":L,"urn:mpeg:dash:utc:http-head:2012":F,"urn:mpeg:dash:utc:http-xsdate:2012":k.bind(null,O),"urn:mpeg:dash:utc:http-iso:2012":k.bind(null,P),"urn:mpeg:dash:utc:direct:2012":L,"urn:mpeg:dash:utc:http-ntp:2014":x,"urn:mpeg:dash:utc:ntp:2014":x,"urn:mpeg:dash:utc:sntp:2014":x}},attemptSync:function(e,t){c=e,n||(function(e){try{if(!e||!i.get().streaming.utcSynchronization.enabled)return!1;var t=isNaN(m)?30:m;return!(f&&t&&!isNaN(t))||(Date.now()-f)/1e3>=t}catch(e){return!0}}(t)?(n=!0,C()):T.trigger(u.Z.TIME_SYNCHRONIZATION_COMPLETED))},setConfig:function(e){e&&(e.dashMetrics&&(s=e.dashMetrics),e.baseURLController&&(v=e.baseURLController),e.errHandler&&(y=e.errHandler),e.settings&&(i=e.settings))},reset:function(){S(),T.off(u.Z.ATTEMPT_BACKGROUND_SYNC,A,e)}},t=(0,d.Z)(_).getInstance().getLogger(e),T.on(u.Z.ATTEMPT_BACKGROUND_SYNC,A,e),e}Zt.__dashjs_factory_name="TimeSyncController";var Kt=c.Z.getSingletonFactory(Zt);Kt.HTTP_TIMEOUT_MS=5e3,c.Z.updateSingletonFactory(Zt.__dashjs_factory_name,Kt);var zt=Kt;function Wt(){var e,t,n,r,i,a=this.context,s=(0,l.Z)(a).getInstance();return e={attachMediaSource:function(e){var n=window.URL.createObjectURL(t);return e.setSource(n),"managedMediaSource"===r&&(e.setDisableRemotePlayback(!0),t.addEventListener("startstreaming",(function(){s.trigger(f.Z.MANAGED_MEDIA_SOURCE_START_STREAMING)})),t.addEventListener("endstreaming",(function(){s.trigger(f.Z.MANAGED_MEDIA_SOURCE_END_STREAMING)}))),n},createMediaSource:function(){var e="WebKitMediaSource"in window,n="MediaSource"in window;return"ManagedMediaSource"in window?(t=new ManagedMediaSource,r="managedMediaSource",i.info("Created ManagedMediaSource")):n?(t=new MediaSource,r="mediaSource",i.info("Created MediaSource")):e&&(t=new WebKitMediaSource,i.info("Created WebkitMediaSource")),t},detachMediaSource:function(e){e.setSource(null)},setConfig:function(e){e&&e.settings&&(n=e.settings)},setDuration:function e(r){t&&"open"===t.readyState&&(null===r&&isNaN(r)||t.duration!==r&&(r!==1/0||n.get().streaming.buffer.mediaSourceDurationInfinity||(r=Math.pow(2,32)),function(e){for(var t=e.sourceBuffers,n=0;n<t.length;n++)if(t[n].updating)return!0;return!1}(t)?setTimeout(e.bind(null,r),50):(i.info("Set MediaSource duration:"+r),t.duration=r)))},setSeekable:function(e,n){t&&"function"==typeof t.setLiveSeekableRange&&"function"==typeof t.clearLiveSeekableRange&&"open"===t.readyState&&e>=0&&e<n&&(t.clearLiveSeekableRange(),t.setLiveSeekableRange(e,n))},signalEndOfStream:function(e){if(e&&"open"===e.readyState){for(var t=e.sourceBuffers,n=0;n<t.length;n++){if(t[n].updating)return;if(0===t[n].buffered.length)return}i.info("call to mediaSource endOfStream"),e.endOfStream()}}},i=(0,d.Z)(a).getInstance().getLogger(e),e}Wt.__dashjs_factory_name="MediaSourceController";var Xt=c.Z.getSingletonFactory(Wt);function $t(){var e,t,n,r,i,a,s,o,u,c,h,p="urn:mpeg:dash:event:2012",g="updated",m="added",y=this.context,v=(0,l.Z)(y).getInstance();function _(){if(!s||!o)throw new Error("setConfig function has to be called previously")}function T(){h=!1,n={},r={},i=null,c=!1,a=Date.now()/1e3}function E(){try{if(!c){c=!0;var e=o.getTime(),i=e-a;i=a>0?Math.max(0,i):0,b(r,i,e),b(n,i,e),S(r),S(n),a=e,c=!1}}catch(e){c=!1,t.error(e)}}function b(e,n,r){try{C(e,(function(i){if(void 0!==i){var a=isNaN(i.duration)?0:i.duration;i.calculatedPresentationTime<=r&&i.calculatedPresentationTime+n+a>=r?D(i,f.Z.EVENT_MODE_ON_START):(R(r,a+n,i.calculatedPresentationTime)||function(e){try{var n=e.eventStream.period.start+e.eventStream.period.duration;return e.calculatedPresentationTime>n}catch(e){return t.error(e),!1}}(i))&&(t.debug("Removing event ".concat(i.id," from period ").concat(i.eventStream.period.id," as it is expired or invalid")),function(e,n){try{var r=n.eventStream.schemeIdUri,i=n.eventStream.period.id,a=n.eventStream.value,s=n.id;e[i][r]=e[i][r].filter((function(e){return a&&e.eventStream.value&&e.eventStream.value!==a||e.id!==s})),0===e[i][r].length&&delete e[i][r]}catch(e){t.error(e)}}(e,i))}}))}catch(e){t.error(e)}}function S(e){try{for(var n in e)e.hasOwnProperty(n)&&0===Object.keys(e[n]).length&&delete e[n]}catch(e){t.error(e)}}function A(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e.eventStream.schemeIdUri,i=e.eventStream.value,a=e.id,s="discarded";t[r]||(t[r]=[]);var o=t[r].findIndex((function(e){return(!i||e.eventStream.value&&e.eventStream.value===i)&&e.id===a}));if(-1===o)t[r].push(e),e.triggeredReceivedEvent=!1,e.triggeredStartEvent=!1,s=m;else if(n){var l=t[r][o];e.triggeredReceivedEvent=l.triggeredReceivedEvent,e.triggeredStartEvent=l.triggeredStartEvent,t[r][o]=e,s=g}return s}function w(e){try{if(1==e.eventStream.value){var n,r=e.calculatedPresentationTime;n=4294967295==e.calculatedPresentationTime?NaN:e.calculatedPresentationTime+e.duration,v.trigger(f.Z.MANIFEST_VALIDITY_CHANGED,{id:e.id,validUntil:r,newDuration:n,newManifestValidAfter:NaN},{mode:f.Z.EVENT_MODE_ON_START})}}catch(e){t.error(e)}}function I(e){try{var n=o.getTime();C(e,(function(e){var t=e.eventStream&&e.eventStream.period&&!isNaN(e.eventStream.period.duration)?e.eventStream.period.duration:NaN,r=e.eventStream&&e.eventStream.period&&!isNaN(e.eventStream.period.start)?e.eventStream.period.start:NaN;if(!isNaN(t)&&!isNaN(r)){var i=e.calculatedPresentationTime;Math.abs(i-n)<300&&D(e,f.Z.EVENT_MODE_ON_START)}}))}catch(e){t.error(e)}}function C(e,n){try{if(e)for(var r=Object.keys(e),i=0;i<r.length;i++)for(var a=e[r[i]],s=Object.keys(a),o=0;o<s.length;o++)a[s[o]].forEach((function(e){void 0!==e&&n(e)}))}catch(e){t.error(e)}}function R(e,n,r){try{return e-n>r}catch(e){return t.error(e),!1}}function D(e,n){try{var r=o.getTime(),i=e.id;if(n===f.Z.EVENT_MODE_ON_RECEIVE&&!e.triggeredReceivedEvent)return t.debug("Received event ".concat(i)),e.triggeredReceivedEvent=!0,void v.trigger(e.eventStream.schemeIdUri,{event:e},{mode:n});e.triggeredStartEvent||(e.eventStream.schemeIdUri===p&&1==e.eventStream.value?0===e.duration&&0===e.presentationTimeDelta||(t.debug("Starting manifest refresh event ".concat(i," at ").concat(r)),function(){try{_(),s.refreshManifest()}catch(e){t.error(e)}}()):"urn:mpeg:dash:event:callback:2015"===e.eventStream.schemeIdUri&&1==e.eventStream.value?(t.debug("Starting callback event ".concat(i," at ").concat(r)),function(e){try{(0,se.Z)(y).create({}).load({method:"get",url:e,request:{responseType:"arraybuffer"}})}catch(e){t.error(e)}}(e.messageData)):(t.debug("Starting event ".concat(i," from period ").concat(e.eventStream.period.id," at ").concat(r)),v.trigger(e.eventStream.schemeIdUri,{event:e},{mode:n})),e.triggeredStartEvent=!0)}catch(e){t.error(e)}}return e={addInlineEvents:function(e,r){try{if(_(),n[r]||(n[r]={}),e)for(var i=0;i<e.length;i++){var a=e[i];if(!R(o.getTime(),isNaN(a.duration)?0:a.duration,a.calculatedPresentationTime)){var s=A(a,n[r],!0);s===m?(t.debug("Added inline event with id ".concat(a.id," from period ").concat(r)),D(a,f.Z.EVENT_MODE_ON_RECEIVE)):s===g&&t.debug("Updated inline event with id ".concat(a.id," from period ").concat(r))}}}catch(e){throw e}},addInbandEvents:function(e,n){try{_(),r[n]||(r[n]={});for(var i=0;i<e.length;i++){var a=e[i];R(o.getTime(),isNaN(a.duration)?0:a.duration,a.calculatedPresentationTime)||(A(a,r[n],!1)===m?(a.eventStream.schemeIdUri===p&&w(a),t.debug("Added inband event with id ".concat(a.id," from period ").concat(n)),D(a,f.Z.EVENT_MODE_ON_RECEIVE)):t.debug("Inband event with scheme_id_uri ".concat(a.eventStream.schemeIdUri,", value ").concat(a.eventStream.value,", period id ").concat(n," and event id ").concat(a.id," was ignored because it has been added before.")))}E()}catch(e){throw e}},getInbandEvents:function(){return r},getInlineEvents:function(){return n},start:function(){try{_(),t.debug("Start Event Controller");var e=u.get().streaming.eventControllerRefreshDelay;h||isNaN(e)||(h=!0,i=setInterval(E,e))}catch(e){throw e}},setConfig:function(e){try{if(!e)return;e.manifestUpdater&&(s=e.manifestUpdater),e.playbackController&&(o=e.playbackController),e.settings&&(u=e.settings)}catch(e){throw e}},reset:function(){(function(){try{null!==i&&h&&(clearInterval(i),i=null,h=!1,function(){try{I(r),I(n)}catch(e){t.error(e)}}())}catch(e){throw e}})(),T()}},t=(0,d.Z)(y).getInstance().getLogger(e),T(),e}$t.__dashjs_factory_name="EventController";var Qt=c.Z.getSingletonFactory($t),Jt={LEVELS:{SUGGESTION:"Suggestion",WARNING:"Warning",ERROR:"Error"},EVENTS:{NO_UTC_TIMING_ELEMENT:{key:"NO_UTC_TIMING_ELEMENT",message:"No UTCTiming element is present in the manifest. You may experience playback failures. For a detailed validation use https://conformance.dashif.org/"},NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE:{key:"NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE",message:'SMPTE 2052-1:2013 defines the attribute name as "imageType" and does not define "imagetype"'},INVALID_DVR_WINDOW:{key:"INVALID_DVR_WINDOW",message:"No valid segment found when applying a specification compliant DVR window calculation. Using SegmentTimeline entries as a fallback."}}};function en(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function tn(){var e,t,n,r,i,s,c,h,p,g,m,y,v,_,T,E,S,A,w,C,R,D,N,O,P,M,L,k,F,U,B,j,q,H,G,V,Y,Z,K,z,W,X,$,ee,te,ne,re,ie,ae=this.context,se=(0,l.Z)(ae).getInstance();function oe(){if(!(s&&s.hasOwnProperty("load")&&R&&R.hasOwnProperty("initialize")&&R.hasOwnProperty("reset")&&R.hasOwnProperty("getClientTimeOffset")&&c&&C&&p&&q))throw new Error(a.Z.MISSING_CONFIG_ERROR)}function le(){!function(){try{var e=h.getStreamsInfo();if(!N&&0===e.length)throw new Error("There are no periods in the MPD");N&&e.length>0&&p.updateManifestUpdateInfo({currentTime:q.getTime(),buffered:j.getBufferRange(),presentationStartTime:e[0].start,clientTimeOffset:R.getClientTimeOffset()}),D.length>0&&function(e){0!==e.length?D=D.filter((function(n){var r=e.filter((function(e){return e.id===n.getId()})).length>0||n.getId()===N.getId();return r||(t.debug("Removing stream ".concat(n.getId())),n.reset(!0)),r})):t.warn("No periods included in the current manifest. Skipping the filtering of outdated stream objects.")}(e);for(var n=[],r=0,i=e.length;r<i;r++){var a=e[r];n.push(ce(a)),p.addManifestUpdateStreamInfo(a)}Promise.all(n).then((function(){return new Promise((function(t,n){N?t():de(e,t,n)}))})).then((function(){se.trigger(u.Z.STREAMS_COMPOSED),Oe()})).catch((function(e){throw e}))}catch(e){C.error(new b.Z(I.MANIFEST_ERROR_ID_NOSTREAMS_CODE,e.message+" nostreamscomposed",c.getValue())),U=!0,Xe()}}()}function ue(){te=!0}function ce(e){var t=Ke(e.id);return t?t.updateData(e):(t=Ft(ae).create({manifestModel:c,mediaPlayerModel:G,dashMetrics:p,manifestUpdater:i,adapter:h,timelineConverter:R,capabilities:n,capabilitiesFilter:r,errHandler:C,baseURLController:v,segmentBaseController:_,textController:P,abrController:E,playbackController:q,eventController:A,mediaController:S,protectionController:O,videoModel:j,streamInfo:e,settings:ee}),D.push(t),t.initialize(),Promise.resolve())}function de(e,n,r){try{Se();var i=p.getCurrentDVRInfo().range;if(i.end<i.start){ne&&clearTimeout(ne);var a=Math.min(1e3*(-1*(i.end-i.start)+2),2147483647);return t.debug("Waiting for ".concat(a," ms before playback can start")),se.trigger(u.Z.AST_IN_FUTURE,{delay:a}),void(ne=setTimeout((function(){de(e,n,r)}),a))}ee.get().streaming.applyProducerReferenceTime&&H.calculateProducerReferenceTimeOffsets(e);var s=e[0].manifestInfo;if(ee.get().streaming.applyServiceDescription&&H.applyServiceDescription(s),h.getIsDynamic()){var o=Be(e,s);q.computeAndSetLiveDelay(o,s)}(ee.get().streaming.applyContentSteering&&y.shouldQueryBeforeStart()?y.loadSteeringData():Promise.resolve()).then((function(){var e=c.getValue();e&&v.update(e),fe(),n()})).catch((function(e){t.error(e),fe(),n()}))}catch(e){r(e)}}function fe(){var e=function(){var e;if(h.getIsDynamic()){var n=p.getCurrentDVRInfo();e=(n&&n.range?n.range.end:0)-q.getOriginalLiveDelay();var r=n?n.range:null;if(r){if(isNaN(re)&&-1===re.toString().indexOf("posix:")){var i=ke(!0);isNaN(i)||(t.info("Start time from URI parameters: ".concat(i)),e=Math.min(e,i))}else{t.info("Start time provided by the app: ".concat(re));var a=Fe(!0,re);isNaN(a)||(e=Math.min(e,a))}var s=ee.get().streaming.timeShiftBuffer.calcFromSegmentTimeline?.1:0;e=Math.max(e,r.start+s)}}else if(e=Qe()[0].getStreamInfo().start,isNaN(re)){var o=ke(!1);isNaN(o)||(t.info("Start time from URI parameters: ".concat(o)),e=Math.max(e,o))}else{t.info("Start time provided by the app: ".concat(re));var l=Fe(!1,re);isNaN(l)||(e=Math.max(e,l))}return e}(),n=be(e),r=null!==n?n:D[0];se.trigger(u.Z.INITIAL_STREAM_SWITCH,{startTime:e}),he(r,null,e),z||(z=setInterval((function(){!k&&q.getTimeToStreamEnd()<=0&&!q.isSeeking()&&se.trigger(u.Z.PLAYBACK_ENDED,{isLast:Ze().isLast})}),200))}function he(e,n,r){try{if(k||!e||n===e&&e.getIsActive())return;k=!0,se.trigger(u.Z.PERIOD_SWITCH_STARTED,{fromStreamInfo:n?n.getStreamInfo():null,toStreamInfo:e.getStreamInfo()});var i=!1;N=e,n&&(i=Te(e,n),n.deactivate(i)),r=isNaN(r)?!i&&n?e.getStreamInfo().start:NaN:r,t.info("Switch to stream ".concat(e.getId(),". Seektime is ").concat(r,", current playback time is ").concat(q.getTime(),". Seamless period switch is set to ").concat(i)),X=X.filter((function(e){return e.getId()!==N.getId()})),q.initialize(Ze(),!!n),j.getElement()?pe(r,i,!1):ge(r,i)}catch(e){k=!1}}function pe(e,n){var r,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];function a(){if(B&&"open"===B.readyState){t.debug("MediaSource is open!"),window.URL.revokeObjectURL(r),B.removeEventListener("sourceopen",a),B.removeEventListener("webkitsourceopen",a),Le();var s=p.getCurrentDVRInfo();g.setSeekable(s.range.start,s.range.end),i?(isNaN(e)||q.seek(e,!0,!0),N.setMediaSource(B).then((function(){N.initializeForTextWithMediaSource(B)}))):ge(e,n)}}function s(){B.addEventListener("sourceopen",a,!1),B.addEventListener("webkitsourceopen",a,!1),r=g.attachMediaSource(j),t.debug("MediaSource attached to element.  Waiting on open...")}B?n?ge(e,n):(g.detachMediaSource(j),s()):(B=g.createMediaSource(),s())}function ge(e,t){N.activate(B,t?W:void 0,e).then((function(t){if(t){var n=Object.keys(t);n.length>0&&t[n[0]].getBuffer().changeType&&($=!0),W=t}isNaN(e)||(se.trigger(u.Z.SEEK_TARGET,{time:e},{streamId:N.getId()}),q.seek(e,!1,!0),N.startScheduleControllers()),k=!1,se.trigger(u.Z.PERIOD_SWITCH_COMPLETED,{toStreamInfo:Ze()})}))}function me(e){var t=be(e.seekTime);t&&t!==N?t&&t!==N&&(ye(),function(e,t){var n=e&&!isNaN(e.seekTime)?e.seekTime:NaN,r=N.getProcessors().map((function(t){return t.prepareOuterPeriodPlaybackSeeking(e)}));Promise.all(r).then((function(){he(t,N,n)})).catch((function(e){C.error(e)}))}(e,t)):(ye(),function(e){N.getProcessors().forEach((function(t){return t.prepareInnerPeriodPlaybackSeeking(e)})),Ge(J.USER_REQUEST_STOP_REASON)}(e)),Ve(Q.SEEK_START_REASON)}function ye(){ve()}function ve(){X&&X.length>0&&(X.forEach((function(e){e.deactivate(!0)})),X=[])}function _e(e){if(e.newMediaInfo.streamInfo.id===N.getId()){if(ve(),ee.get().streaming.buffer.resetSourceBuffersForTrackSwitch&&e.oldMediaInfo&&e.oldMediaInfo.codec!==e.newMediaInfo.codec){var t=q.getTime();return N.deactivate(!1),void pe(t,!1,!1)}N.prepareTrackChange(e)}}function Te(e,t){try{return ee.get().streaming.buffer.reuseExistingSourceBuffers&&(t.isProtectionCompatible(e)||te)&&($&&ee.get().streaming.buffer.useChangeTypeForTrackSwitch||t.isMediaCodecCompatible(e,t))}catch(e){return!1}}function Ee(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;B&&!e.getPreloaded()&&Te(e,t)&&e.startPreloading(B,W).then((function(){X.push(e)}))}function be(e){if(isNaN(e))return null;for(var t=D.length,n=0;n<t;n++){var r=D[n];if(e<parseFloat((r.getStartTime()+r.getDuration()).toFixed(5)))return r}return null}function Se(){try{var e=h.getIsDynamic(),t=h.getStreamsInfo()[0].manifestInfo,n=q.getTime(),r=R.calcTimeShiftBufferWindow(D,e),i=Me();if(void 0===r.start||void 0===r.end)return;i&&0!==i.length?i.forEach((function(e){p.addDVRInfo(e.getType(),n,t,r)})):p.addDVRInfo(a.Z.VIDEO,n,t,r)}catch(e){}}function Ae(e){if(Z&&L){var t=G.getInitialBufferLevel(),n=[a.Z.TEXT];(isNaN(t)||t<=q.getBufferLevel(n)||h.getIsDynamic()&&t>q.getLiveDelay())&&(Z=!1,Ve(Q.INITIAL_PLAYOUT_START_REASON),q.play())}e&&e.mediaType&&p.addBufferLevel(e.mediaType,new Date,1e3*e.bufferLevel)}function we(e){e.streamInfo.id===N.getId()&&e.reason&&e.reason.forceReplace&&ve(),Ke(e.streamInfo.id).prepareQualityChange(e)}function Ie(){if(h.getIsDynamic()&&0!==q.getOriginalLiveDelay()&&N){var e=h.getStreamsInfo();if(e.length>0){var t=e[0].manifestInfo,n=Be(e,t);q.computeAndSetLiveDelay(n,t)}}}function Ce(){if(qe()){var e=j.getPlaybackQuality();e&&p.addDroppedFrames(e)}}function Re(){t.debug("[onPlaybackStarted]"),!Z&&Y&&Ve(Q.RESUME_FROM_PAUSE_START_REASON),Z&&(Z=!1),K&&(K=!1,ee.get().streaming.applyContentSteering&&!y.shouldQueryBeforeStart()&&y.loadSteeringData()),Y=!1}function De(e){t.debug("[onPlaybackPaused]"),e.ended||(Y=!0,Ge(J.USER_REQUEST_STOP_REASON))}function Ne(e){t.debug("Stream with id ".concat(e.streamInfo.id," finished buffering"));var n=e.streamInfo.isLast;B&&n?(t.info("[onStreamBufferingCompleted] calls signalEndOfStream of mediaSourceController."),g.signalEndOfStream(B)):Oe()}function Oe(){if(N&&N.getHasFinishedBuffering())for(var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;try{var t=e||N||null;if(t){var n=t.getStreamInfo();return D.filter((function(e){var t=e.getStreamInfo();return t.start>n.start&&n.id!==t.id}))}}catch(e){return[]}}(N),t=0;t<e.length;){var n=e[t],r=0===t?N:e[t-1];!n.getPreloaded()&&r.getHasFinishedBuffering()&&B&&Ee(n,r),t+=1}}function Pe(){z&&(clearInterval(z),z=null)}function Me(){return N?N.getProcessors():[]}function xe(e){if(N&&!N.getIsEndedEventSignaled()){N.setIsEndedEventSignaled(!0);var n=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)||N||null;if(!e)return null;for(var t=e.getStreamInfo(),n=t.start,r=0,i=-1,a=NaN;r<D.length;){var s=D[r].getStreamInfo(),o=s.start-n;o>0&&(isNaN(a)||o<a)&&t.id!==s.id&&(a=o,i=r),r+=1}return i>=0?D[i]:null}();n?(t.debug("StreamController onEnded, found next stream with id ".concat(n.getStreamInfo().id,". Switching from ").concat(N.getStreamInfo().id," to ").concat(n.getStreamInfo().id)),he(n,N,NaN)):(t.debug("StreamController no next stream found"),N.setIsEndedEventSignaled(!1)),Ge(n?J.END_OF_PERIOD_STOP_REASON:J.END_OF_CONTENT_STOP_REASON)}e&&e.isLast&&(Pe(),y.stopSteeringRequestTimer())}function Le(e){var t=e||Ze().manifestInfo.duration;g.setDuration(t)}function ke(e){var t=T.getURIFragmentData();if(!t||!t.t)return NaN;var n=Qe()[0].getStreamInfo().start;return t.t=t.t.split(",")[0],Ue(e,t.t,n)}function Fe(e,t){var n=0;return e||(n=Qe()[0].getStreamInfo().start),Ue(e,t,n)}function Ue(e,t,n){var r=h.getRegularPeriods()[0],i=t.toString(),a=-1!==i.indexOf("posix:")?"now"===i.substring(6)?Date.now()/1e3:parseFloat(i.substring(6)):NaN;return e&&!isNaN(a)?R.calcPresentationTimeFromWallTime(new Date(1e3*a),r):parseFloat(i)+n}function Be(e,t){try{var n=NaN;if(t&&!isNaN(t.maxFragmentDuration)&&isFinite(t.maxFragmentDuration))return t.maxFragmentDuration;if(e&&1===e.length){var r=e[0],i=[a.Z.VIDEO,a.Z.AUDIO,a.Z.TEXT].reduce((function(e,t){var n=h.getMediaInfoForType(r,t);return n&&!1!==n.isFragmented&&e.push(n),e}),[]).reduce((function(e,t){var n=h.getVoRepresentations(t);return n&&n.length>0&&n.forEach((function(t){t&&e.push(t)})),e}),[]).reduce((function(e,t){var n=h.convertRepresentationToRepresentationInfo(t);return n&&n.fragmentDuration&&!isNaN(n.fragmentDuration)&&e.push(n.fragmentDuration),e}),[]);n=Math.max.apply(Math,function(e){if(Array.isArray(e))return en(e)}(s=i)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(s)||function(e,t){if(e){if("string"==typeof e)return en(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?en(e,t):void 0}}(s)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}return isFinite(n)?n:NaN}catch(e){return NaN}var s}function je(e){if(e.error)U=!0,Xe();else{t.info("Manifest updated... updating data system wide.");var n=e.manifest;h.updatePeriods(n);var i=h.getUTCTimingSources();!h.getIsDynamic()||i&&0!==i.length||se.trigger(f.Z.CONFORMANCE_VIOLATION,{level:Jt.LEVELS.WARNING,event:Jt.EVENTS.NO_UTC_TIMING_ELEMENT});var a=h.getIsDynamic()?i.concat(V.getUTCTimingSources()):i;r.filterUnsupportedFeatures(n).then((function(){v.initialize(n),m.attemptSync(a,h.getIsDynamic())}))}}function qe(){return!!N&&N.getHasVideoTrack()}function He(){return!!N&&N.getHasAudioTrack()}function Ge(e,t){t=t||new Date,Me().forEach((function(n){n.finalisePlayList(t,e)})),p.addPlayList()}function Ve(e){p.createPlaylistMetrics(1e3*q.getTime(),e)}function Ye(e){if(e.error){var n="";switch(e.error.code){case 1:n="MEDIA_ERR_ABORTED";break;case 2:n="MEDIA_ERR_NETWORK";break;case 3:n="MEDIA_ERR_DECODE",ie.counts.mediaErrorDecode+=1;break;case 4:n="MEDIA_ERR_SRC_NOT_SUPPORTED";break;case 5:n="MEDIA_ERR_ENCRYPTED";break;default:n="UNKNOWN"}"MEDIA_ERR_DECODE"===n&&ee.get().errors.recoverAttempts.mediaErrorDecode>=ie.counts.mediaErrorDecode?function(){t.warn("A MEDIA_ERR_DECODE occured: Resetting the MediaSource");var e=q.getTime();N.deactivate(!1),t.warn("MediaSource has been resetted. Resuming playback from time ".concat(e)),pe(e,!1,!1)}():(F=!0,e.error.message&&(n+=" ("+e.error.message+")"),e.error.msExtendedCode&&(n+=" (0x"+(e.error.msExtendedCode>>>0).toString(16).toUpperCase()+")"),t.fatal("Video Element Error: "+n),e.error&&t.fatal(e.error),C.error(new b.Z(e.error.code,n)),Xe())}}function Ze(){return N?N.getStreamInfo():null}function Ke(e){for(var t=0,n=D.length;t<n;t++)if(D[t].getId()===e)return D[t];return null}function ze(e){isNaN(e.newDuration)||Le(e.newDuration)}function We(){D=[],re=NaN,O=null,k=!1,N=null,F=!1,U=!1,Z=!0,K=!0,Y=!1,L=!0,z=null,te=!1,$=!1,X=[],ne=null,ie={counts:{mediaErrorDecode:0}}}function Xe(){oe(),m.reset(),Ge(F||U?J.FAILURE_STOP_REASON:J.USER_REQUEST_STOP_REASON);for(var t=0,n=D?D.length:0;t<n;t++)D[t].reset(F);se.off(f.Z.PLAYBACK_TIME_UPDATED,Ce,e),se.off(f.Z.PLAYBACK_SEEKING,me,e),se.off(f.Z.PLAYBACK_ERROR,Ye,e),se.off(f.Z.PLAYBACK_STARTED,Re,e),se.off(f.Z.PLAYBACK_PAUSED,De,e),se.off(f.Z.PLAYBACK_ENDED,xe,e),se.off(f.Z.METRIC_ADDED,$e,e),se.off(f.Z.MANIFEST_VALIDITY_CHANGED,ze,e),se.off(f.Z.BUFFER_LEVEL_UPDATED,Ae,e),se.off(f.Z.QUALITY_CHANGE_REQUESTED,we,e),u.Z.KEY_SESSION_UPDATED&&se.off(u.Z.KEY_SESSION_UPDATED,ue,e),se.off(u.Z.MANIFEST_UPDATED,je,e),se.off(u.Z.STREAM_BUFFERING_COMPLETED,Ne,e),se.off(u.Z.TIME_SYNCHRONIZATION_COMPLETED,le,e),se.off(u.Z.CURRENT_TRACK_CHANGED,_e,e),se.off(u.Z.SETTING_UPDATED_LIVE_DELAY,Ie,e),se.off(u.Z.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT,Ie,e),v.reset(),i.reset(),A.reset(),p.clearAllCurrentMetrics(),c.setValue(null),s.reset(),R.reset(),w.reset(),B&&(g.detachMediaSource(j),B=null),j=null,O&&(O=null,M=null,c.getValue()&&se.trigger(u.Z.PROTECTION_DESTROYED,{data:c.getValue().url})),Pe(),se.trigger(u.Z.STREAM_TEARDOWN_COMPLETE),We()}function $e(e){if(e.metric===o.Z.DVR_INFO){var t=He()?a.Z.AUDIO:a.Z.VIDEO;e.mediaType===t&&g.setSeekable(e.value.range.start,e.value.range.end)}}function Qe(){return D}return e={initialize:function(t,n){oe(),L=t,M=n,R.initialize(),(i=Yt(ae).create()).setConfig({manifestModel:c,adapter:h,manifestLoader:s,errHandler:C,settings:ee,contentSteeringController:y}),i.initialize(),(A=Qt(ae).getInstance()).setConfig({manifestUpdater:i,playbackController:q,settings:ee}),A.start(),m.setConfig({dashMetrics:p,baseURLController:v,errHandler:C,settings:ee}),m.initialize(),g.setConfig({settings:ee}),O&&(se.trigger(u.Z.PROTECTION_CREATED,{controller:O}),O.setMediaElement(j.getElement()),M&&O.setProtectionData(M)),se.on(f.Z.PLAYBACK_TIME_UPDATED,Ce,e),se.on(f.Z.PLAYBACK_SEEKING,me,e),se.on(f.Z.PLAYBACK_ERROR,Ye,e),se.on(f.Z.PLAYBACK_STARTED,Re,e),se.on(f.Z.PLAYBACK_PAUSED,De,e),se.on(f.Z.PLAYBACK_ENDED,xe,e),se.on(f.Z.METRIC_ADDED,$e,e),se.on(f.Z.MANIFEST_VALIDITY_CHANGED,ze,e),se.on(f.Z.BUFFER_LEVEL_UPDATED,Ae,e),se.on(f.Z.QUALITY_CHANGE_REQUESTED,we,e),u.Z.KEY_SESSION_UPDATED&&se.on(u.Z.KEY_SESSION_UPDATED,ue,e),se.on(u.Z.MANIFEST_UPDATED,je,e),se.on(u.Z.STREAM_BUFFERING_COMPLETED,Ne,e),se.on(u.Z.TIME_SYNCHRONIZATION_COMPLETED,le,e),se.on(u.Z.CURRENT_TRACK_CHANGED,_e,e),se.on(u.Z.SETTING_UPDATED_LIVE_DELAY,Ie,e),se.on(u.Z.SETTING_UPDATED_LIVE_DELAY_FRAGMENT_COUNT,Ie,e)},getActiveStreamInfo:Ze,addDVRMetric:Se,hasVideoTrack:qe,hasAudioTrack:He,getStreamById:Ke,getStreamForTime:be,getTimeRelativeToStreamId:function(e,t){for(var n=null,r=0,i=0,a=null,s=0;s<D.length;s++){if(i=(n=D[s]).getStartTime(),a=n.getDuration(),Number.isFinite(i)&&(r=i),n.getId()===t)return e-r;Number.isFinite(a)&&(r+=a)}return null},load:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:NaN;oe(),re=t,s.load(e)},loadWithManifest:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:NaN;(function(){if(!i||!i.hasOwnProperty("setManifest"))throw new Error("initialize function has to be called previously")})(),re=t,i.setManifest(e)},getActiveStreamProcessors:Me,setConfig:function(e){e&&(e.capabilities&&(n=e.capabilities),e.capabilitiesFilter&&(r=e.capabilitiesFilter),e.manifestLoader&&(s=e.manifestLoader),e.manifestModel&&(c=e.manifestModel),e.mediaPlayerModel&&(G=e.mediaPlayerModel),e.customParametersModel&&(V=e.customParametersModel),e.protectionController&&(O=e.protectionController),e.adapter&&(h=e.adapter),e.dashMetrics&&(p=e.dashMetrics),e.errHandler&&(C=e.errHandler),e.timelineConverter&&(R=e.timelineConverter),e.videoModel&&(j=e.videoModel),e.playbackController&&(q=e.playbackController),e.serviceDescriptionController&&(H=e.serviceDescriptionController),e.contentSteeringController&&(y=e.contentSteeringController),e.textController&&(P=e.textController),e.abrController&&(E=e.abrController),e.mediaController&&(S=e.mediaController),e.settings&&(ee=e.settings),e.baseURLController&&(v=e.baseURLController),e.uriFragmentModel&&(T=e.uriFragmentModel),e.segmentBaseController&&(_=e.segmentBaseController),e.manifestUpdater&&(i=e.manifestUpdater))},setProtectionData:function(e){M=e,O&&O.setProtectionData(M)},getIsStreamSwitchInProgress:function(){return k},switchToVideoElement:function(e){N&&(q.initialize(Ze()),pe(e,!1,!0))},getHasMediaOrInitialisationError:function(){return F||U},getStreams:Qe,getActiveStream:function(){return N},getInitialPlayback:function(){return Z},getAutoPlay:function(){return L},refreshManifest:function(){i.getIsUpdating()||i.refreshManifest()},reset:Xe},t=(0,d.Z)(ae).getInstance().getLogger(e),m=zt(ae).getInstance(),g=Xt(ae).getInstance(),w=x(ae).getInstance(),We(),e}tn.__dashjs_factory_name="StreamController";var nn=c.Z.getSingletonFactory(tn);function rn(){var e,t,n,r,i,s,o,c,f,h,p,g,m=this.context,y=(0,l.Z)(m).getInstance();function v(){g.debug("Stopping the gap controller"),i&&(clearInterval(i),i=null),function(){y.off(u.Z.WALLCLOCK_TIME_UPDATED,S,this),y.off(u.Z.INITIAL_STREAM_SWITCH,b,this),y.off(u.Z.PLAYBACK_SEEKING,_,this),y.off(u.Z.BUFFER_REPLACEMENT_STARTED,T,e),y.off(u.Z.TRACK_CHANGE_RENDERED,E,e)}(),i=null,s=NaN,r=0,h=null,p={}}function _(){h&&(clearTimeout(h),h=null)}function T(e){try{if(e.streamId!==c.getActiveStreamInfo().id||e.mediaType!==a.Z.VIDEO&&e.mediaType!==a.Z.AUDIO)return;e.streamId===c.getActiveStreamInfo().id&&(p[e.mediaType]=!0)}catch(e){g.error(e)}}function E(e){e&&e.mediaType&&(p[e.mediaType]=!1)}function b(){i||function(){try{i||(g.debug("Starting the gap controller"),i=setInterval((function(){A()&&w(o.getTime())}),100))}catch(e){}}()}function S(){if(A(n.get().streaming.gaps.enableSeekFix)&&++r>=10){var e=o.getTime();t===e?w(e,!0):(t=e,s=NaN),r=0}}function A(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!c.getActiveStream())return!1;var t=Object.keys(p).some((function(e){return p[e]})),r=!!e&&function(){var e=c.getActiveStream(),t=parseFloat((e.getStartTime()+e.getDuration()).toFixed(5));return o.getTime()+n.get().streaming.gaps.threshold>=t}();return!t&&n.get().streaming.gaps.jumpGaps&&c.getActiveStreamProcessors().length>0&&(!o.isSeeking()||r)&&!o.isPaused()&&!c.getIsStreamSwitchInProgress()&&!c.getHasMediaOrInitialisationError()}function w(e){var t,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=n.get().streaming.gaps.enableStallFix,a=n.get().streaming.gaps.stallSeek,l=n.get().streaming.gaps.smallGapLimit,u=n.get().streaming.gaps.jumpLargeGaps,d=f.getBufferRange(),p=NaN,m=!1;if(t=function(e,t){try{if(!e||e.length<=1&&t>0)return NaN;for(var r=NaN,i=0;isNaN(r)&&i<e.length;){var a=i>0?e.end(i-1):0;t<e.start(i)&&a-t<n.get().streaming.gaps.threshold&&(r=i),i+=1}return r}catch(e){return null}}(d,e),!isNaN(t)){var y=d.start(t),v=y-e;v>0&&(v<=l||u)&&(p=y)}var _=o.getTimeToStreamEnd();if(isNaN(p)&&r&&isFinite(_)&&!isNaN(_)&&_<l&&(p=parseFloat(o.getStreamEndTime().toFixed(5)),m=!0),i&&isNaN(p)&&r&&isNaN(t)&&function(e,t){for(var n=0,r=e.length;n<r;n++)if(t>=e.start(n)&&t<=e.end(n))return!0;return!1}(d,e)&&(0===a?(g.warn("Toggle play pause to break stall"),f.pause(),f.play()):(g.warn("Jumping ".concat(a,"s to break stall")),p=e+a)),p>0&&s!==p&&p>e&&!h){var T=p-e;if(m){var E=c.getStreamForTime(p),b=E&&!!E.getPreloaded();g.warn("Jumping to end of stream because of gap from ".concat(e," to ").concat(p,". Gap duration: ").concat(T)),o.seek(p,!0,b)}else{var S=o.getIsDynamic(),A=t>0?d.end(t-1):e,w=S?1e3*Math.max(0,T-.1):0;h=window.setTimeout((function(){o.seek(p,!0,!0),g.warn("Jumping gap occuring in period ".concat(c.getActiveStream().getStreamId()," starting at ").concat(A," and ending at ").concat(p,". Jumping by: ").concat(p-A)),h=null}),w)}s=p}}return e={reset:v,setConfig:function(e){e&&(e.settings&&(n=e.settings),e.playbackController&&(o=e.playbackController),e.streamController&&(c=e.streamController),e.videoModel&&(f=e.videoModel))},initialize:function(){!function(){y.on(u.Z.WALLCLOCK_TIME_UPDATED,S,this),y.on(u.Z.INITIAL_STREAM_SWITCH,b,this),y.on(u.Z.PLAYBACK_SEEKING,_,this),y.on(u.Z.BUFFER_REPLACEMENT_STARTED,T,e),y.on(u.Z.TRACK_CHANGE_RENDERED,E,e)}()}},g=(0,d.Z)(m).getInstance().getLogger(e),v(),e}rn.__dashjs_factory_name="GapController";var an=c.Z.getSingletonFactory(rn);function sn(){var e,t,n,r,i,s,c,h,p,g,m=this.context,y=(0,l.Z)(m).getInstance();function v(){t=!1;var e=je.Z.parseUserAgent();n=e&&e.browser&&e.browser.name&&"safari"===e.browser.name.toLowerCase()}function _(){t=!1}function T(e){if(e.streamId===s.getActiveStreamInfo().id&&p){var t=c.getLiveDelay();c.getBufferLevel()>t/2&&(p=!1)}}function E(e){e.streamId===s.getActiveStreamInfo().id&&(p=e.state===o.Z.BUFFER_EMPTY)}function b(){h.getCatchupModeEnabled()||r.setPlaybackRate(1)}function S(){c.getIsDynamic()&&h.getCatchupModeEnabled()&&(h.getCatchupPlaybackRates().max>0||h.getCatchupPlaybackRates().min<0)&&!c.isPaused()&&!c.isSeeking()&&function(){try{return!(!c.getTime()>0||t)&&(w()===a.Z.LIVE_CATCHUP_MODE_LOLP?function(e,t){try{return Math.abs(A())>0||e<t}catch(e){return!1}}(c.getBufferLevel(),i.get().streaming.liveCatchup.playbackBufferMin):function(){try{return Math.abs(A())>0}catch(e){return!1}}())}catch(e){return!1}}()&&function(){if(!t&&r){var e,s=r.getPlaybackRate(),o=h.getCatchupPlaybackRates(),l=c.getBufferLevel(),u=A(),d=h.getCatchupMaxDrift();if(!isNaN(d)&&d>0&&u>d)g.info("[CatchupController]: Low Latency catchup mechanism. Latency too high, doing a seek to live point"),t=!0,c.seekToCurrentLive(!0,!1);else{var f=c.getCurrentLiveLatency(),m=c.getLiveDelay();e=w()===a.Z.LIVE_CATCHUP_MODE_LOLP?function(e,t,n,r,i){var a;if(i<r){var s=Math.abs(e.min),o=5*(i-r);a=1-s+2*s/(1+Math.pow(Math.E,-o)),g.debug("[LoL+ playback control_buffer-based] bufferLevel: "+i+", newRate: "+a)}else{if(Math.abs(t-n)<=.02*n)a=1;else{var l=t-n,u=l<0?Math.abs(e.min):e.max,c=5*l;a=1-u+2*u/(1+Math.pow(Math.E,-c))}g.debug("[LoL+ playback control_latency-based] latency: "+t+", newRate: "+a)}return a}(o,f,m,i.get().streaming.liveCatchup.playbackBufferMin,l):function(e,t,n,r){if(p)return 1;var i=t-n,a=i<0?Math.abs(e.min):e.max,s=5*i,o=1-a+2*a/(1+Math.pow(Math.E,-s));return c.getPlaybackStalled()&&r<=n/2&&i>0&&(o=1),o}(o,f,m,l);var y=n?.25:.02/(.5/o.max);e&&Math.abs(s-e)>=y&&(g.debug("[CatchupController]: Setting playback rate to ".concat(e)),r.setPlaybackRate(e))}}}()}function A(){return c.getCurrentLiveLatency()-c.getLiveDelay()}function w(){var e=i.get().streaming.liveCatchup.playbackBufferMin;return i.get().streaming.liveCatchup.mode!==a.Z.LIVE_CATCHUP_MODE_LOLP||null===e||isNaN(e)?a.Z.LIVE_CATCHUP_MODE_DEFAULT:a.Z.LIVE_CATCHUP_MODE_LOLP}function I(){h.getCatchupPlaybackRates(!0)}return e={reset:function(){y.off(f.Z.BUFFER_LEVEL_UPDATED,T,e),y.off(f.Z.BUFFER_LEVEL_STATE_CHANGED,E,e),y.off(f.Z.PLAYBACK_PROGRESS,S,e),y.off(f.Z.PLAYBACK_TIME_UPDATED,S,e),y.off(f.Z.PLAYBACK_SEEKED,_,e),y.off(u.Z.SETTING_UPDATED_CATCHUP_ENABLED,b,e),y.off(u.Z.SETTING_UPDATED_PLAYBACK_RATE_MIN,I,e),y.off(u.Z.SETTING_UPDATED_PLAYBACK_RATE_MAX,I,e),y.off(f.Z.STREAM_INITIALIZED,I,e),v(),r.setPlaybackRate(1,!0)},setConfig:function(e){e&&(e.settings&&(i=e.settings),e.videoModel&&(r=e.videoModel),e.streamController&&(s=e.streamController),e.playbackController&&(c=e.playbackController),e.mediaPlayerModel&&(h=e.mediaPlayerModel))},initialize:function(){y.on(f.Z.BUFFER_LEVEL_UPDATED,T,e),y.on(f.Z.BUFFER_LEVEL_STATE_CHANGED,E,e),y.on(f.Z.PLAYBACK_PROGRESS,S,e),y.on(f.Z.PLAYBACK_TIME_UPDATED,S,e),y.on(f.Z.PLAYBACK_SEEKED,_,e),y.on(u.Z.SETTING_UPDATED_CATCHUP_ENABLED,b,e),y.on(u.Z.SETTING_UPDATED_PLAYBACK_RATE_MIN,I,e),y.on(u.Z.SETTING_UPDATED_PLAYBACK_RATE_MAX,I,e),y.on(f.Z.STREAM_INITIALIZED,I,e),I()}},g=(0,d.Z)(m).getInstance().getLogger(e),v(),e}sn.__dashjs_factory_name="CatchupController";var on=c.Z.getSingletonFactory(sn),ln=[a.Z.SERVICE_DESCRIPTION_DVB_LL_SCHEME],un="video",cn="audio";function dn(){var e,t,n,r,i,o=this.context;function l(){t={liveDelay:NaN,liveCatchup:{maxDrift:NaN,playbackRate:{min:NaN,max:NaN}},minBitrate:{},maxBitrate:{},initialBitrate:{},contentSteering:null},n=[]}function u(e,n,i){try{t[e][n]=i/1e3}catch(e){r.error(e)}}return e={getServiceDescriptionSettings:function(){return t},getProducerReferenceTimeOffsets:function(){return n},calculateProducerReferenceTimeOffsets:function(e){try{var t=[];if(e&&e.length>0){var o=[a.Z.VIDEO,a.Z.AUDIO,a.Z.TEXT],l=i.getAvailabilityStartTime()/1e3;e.forEach((function(e){var n=o.reduce((function(t,n){return t.concat(i.getAllMediaInfoForType(e,n))}),[]).reduce((function(t,n){return i.getProducerReferenceTimes(e,n).forEach((function(r){var a=i.getVoRepresentations(n);if(a&&a.length>0&&a[0].adaptation&&a[0].segmentInfoType===s.Z.SEGMENT_TEMPLATE){var o=a[0],u=new Date(r[s.Z.WALL_CLOCK_TIME]).getTime()/1e3-(r[s.Z.PRESENTATION_TIME]/o[s.Z.TIMESCALE]-o[s.Z.PRESENTATION_TIME_OFFSET]+e.start),c=l-u;t.push({id:r[s.Z.ID],to:c})}})),t}),[]);t=t.concat(n)}))}n=t}catch(e){r.error(e),n=[]}},applyServiceDescription:function(e){if(e&&e.serviceDescriptions){var i=e.serviceDescriptions.filter((function(e){return ln.includes(e.schemeIdUri)})),s=e.serviceDescriptions.filter((function(e){return null==e.schemeIdUri})),o=i.length>0?i[i.length-1]:s[s.length-1];o&&(o.latency&&o.latency.target>0&&function(e){var i;if(e.schemeIdUri,a.Z.SERVICE_DESCRIPTION_DVB_LL_SCHEME,i=function(e){return{liveDelay:e.latency.target/1e3,maxDrift:!isNaN(e.latency.max)&&e.latency.max>e.latency.target?(e.latency.max-e.latency.target+500)/1e3:NaN,referenceId:e.latency.referenceId||NaN}}(e),n.length>0){var s=function(e){var t,r=0,i=n.filter((function(t){return t.id===e.referenceId}));return 0===i.length?(r=n.length>0?n[0].to:0,t=n[0].id||NaN):(r=i[0].to||0,t=i[0].id||NaN),{to:r,id:t}}(i),o=s.to,l=s.id;t.liveDelay=i.liveDelay-o,t.liveCatchup.maxDrift=i.maxDrift,r.debug("\n                Found latency properties coming from service description. Applied time offset of ".concat(o," from ProducerReferenceTime element with id ").concat(l,".\n                Live Delay: ").concat(i.liveDelay-o,", Live catchup max drift: ").concat(i.maxDrift,"\n            "))}else t.liveDelay=i.liveDelay,t.liveCatchup.maxDrift=i.maxDrift,r.debug("Found latency properties coming from service description: Live Delay: ".concat(i.liveDelay,", Live catchup max drift: ").concat(i.maxDrift))}(o),o.playbackRate&&function(e){var n=e.playbackRate.min?Math.round(1e3*(e.playbackRate.min-1))/1e3:NaN,i=e.playbackRate.max?Math.round(1e3*(e.playbackRate.max-1))/1e3:NaN;t.liveCatchup.playbackRate.min=n,t.liveCatchup.playbackRate.max=i,r.debug("Found latency properties coming from service description: Live catchup min playback rate: ".concat(n)),r.debug("Found latency properties coming from service description: Live catchup max playback rate: ".concat(i))}(o),o.operatingQuality,o.operatingBandwidth&&function(e){if(e&&e.operatingBandwidth&&e.operatingBandwidth.mediaType&&"all"!==e.operatingBandwidth.mediaType){var t={};t.minBandwidth=e.operatingBandwidth.min,t.maxBandwidth=e.operatingBandwidth.max,t.targetBandwidth=e.operatingBandwidth.target;var n=[];e.operatingBandwidth.mediaType===un||e.operatingBandwidth.mediaType===cn?n.push(e.operatingBandwidth.mediaType):"any"===e.operatingBandwidth.mediaType&&(n.push(cn),n.push(un)),n.forEach((function(e){isNaN(t.minBandwidth)||u("minBitrate",e,t.minBandwidth),isNaN(t.maxBandwidth)||u("maxBitrate",e,t.maxBandwidth),isNaN(t.targetBandwidth)||u("initialBitrate",e,t.targetBandwidth)}))}}(o),o.contentSteering&&function(e){t.contentSteering=e.contentSteering}(o))}},reset:function(){l()},setConfig:function(e){e&&e.adapter&&(i=e.adapter)}},r=(0,d.Z)(o).getInstance().getLogger(e),l(),e}dn.__dashjs_factory_name="ServiceDescriptionController";var fn=c.Z.getSingletonFactory(dn),hn=n(3973),pn=n.n(hn),gn=n(3039);function mn(){var e,t,n,r,i,s,o,c,f=this.context,h=(0,l.Z)(f).getInstance();function p(e,t){return e&&n[t]&&n[t][e]?n[t][e].list:[]}function g(e,t){return e&&n[t]&&n[t][e]?n[t][e].current:null}function m(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e&&e.streamInfo){var i=e.type,o=e.streamInfo.id,l=g(i,o);if(n[o]&&n[o][i]&&(n[o][i].current=e,n[o][i].current&&(i!==a.Z.TEXT&&!_(e,l)||i===a.Z.TEXT&&e.isFragmented)&&h.trigger(u.Z.CURRENT_TRACK_CHANGED,{oldMediaInfo:l,newMediaInfo:e,switchMode:r.get().streaming.trackSwitchMode[i]},{streamId:o}),!t)){var d=function(e){var t={lang:e.lang,viewpoint:e.viewpoint,roles:e.roles,accessibility:e.accessibility,audioChannelConfiguration:e.audioChannelConfiguration,codec:e.codec};return t.lang||t.viewpoint||t.role&&t.role.length>0||t.accessibility&&t.accessibility.length>0||t.audioChannelConfiguration&&t.audioChannelConfiguration.length>0?t:null}(e);if(!d||!n[o][i].storeLastSettings)return;d.roles&&(d.role=d.roles[0],delete d.roles),d.accessibility&&(d.accessibility=d.accessibility[0]),d.audioChannelConfiguration&&(d.audioChannelConfiguration=d.audioChannelConfiguration[0]),s[i]=d,c.setSavedMediaSettings(i,d)}}}function y(e,t){e&&t&&(i[e]=t)}function v(e){return e?i[e]:null}function _(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;var n=e.id===t.id,r=e.viewpoint===t.viewpoint,i=JSON.stringify(e.viewpointsWithSchemeIdUri)===JSON.stringify(t.viewpointsWithSchemeIdUri),a=e.lang===t.lang,s=e.codec===t.codec,o=e.roles.toString()===t.roles.toString(),l=JSON.stringify(e.rolesWithSchemeIdUri)===JSON.stringify(t.rolesWithSchemeIdUri),u=e.accessibility.toString()===t.accessibility.toString(),c=JSON.stringify(e.accessibilitiesWithSchemeIdUri)===JSON.stringify(t.accessibilitiesWithSchemeIdUri),d=e.audioChannelConfiguration.toString()===t.audioChannelConfiguration.toString(),f=JSON.stringify(e.audioChannelConfigurationsWithSchemeIdUri)===JSON.stringify(t.audioChannelConfigurationsWithSchemeIdUri);return n&&s&&r&&i&&a&&o&&l&&u&&c&&d&&f}function T(){n={},s={},i={audio:null,video:null,text:null}}function E(e,t,n){var r=[];return e.forEach((function(e){t(n,e)&&r.push(e)})),0!==r.length?r:e}function b(e,t){try{return!e.lang||e.lang instanceof RegExp?t.lang.match(e.lang):""!==t.lang&&(0,gn.extendedFilter)(t.lang,pn()(e.lang)).length>0}catch(e){return!1}}function S(e,t){return void 0===e.index||null===e.index||t.index===e.index}function A(e,t){return!e.viewpoint||e.viewpoint===t.viewpoint}function w(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return!e.role||!!t.roles.filter((function(t){return t===e.role}))[0]||t.type===a.Z.AUDIO&&n}function I(e,t){return e.accessibility?!!t.accessibility.filter((function(t){return t===e.accessibility}))[0]:!t.accessibility.length}function C(e,t){return!e.audioChannelConfiguration||!!t.audioChannelConfiguration.filter((function(t){return t===e.audioChannelConfiguration}))[0]}function R(e,t){return!e.codec||e.codec===t.codec}function D(e){var t,n=0,r=[];return e.forEach((function(e){(t=Math.max.apply(Math,e.bitrateList.map((function(e){return e.bandwidth}))))>n?(n=t,r=[e]):t===n&&r.push(e)})),r}function N(e){var t,n=1/0,r=[];return e.forEach((function(e){var i=e.bitrateList.reduce((function(e,t){var n=Math.max(1,t.width*t.height);return e+t.bandwidth/n}),0);(t=i/e.bitrateList.length)<n?(n=t,r=[e]):t===n&&r.push(e)})),r}function O(e){var t,n=0,r=[];return e.forEach((function(e){(t=e.representationCount)>n?(n=t,r=[e]):t===n&&r.push(e)})),r}function P(e,n){if(e===a.Z.TEXT)return n[0];var i,s=r.get().streaming.selectionModeForInitialTrack,l=o.getCustomInitialTrackSelectionFunction();if(l&&"function"==typeof l)i=l(n);else switch(s){case a.Z.TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY:i=function(e){var t,n,r=(t=0,n=[],e.forEach((function(e){isNaN(e.selectionPriority)||(e.selectionPriority>t?(t=e.selectionPriority,n=[e]):e.selectionPriority===t&&n.push(e))})),n);return r.length>1&&(r=D(r)),r.length>1&&(r=O(r)),r}(n);break;case a.Z.TRACK_SELECTION_MODE_HIGHEST_BITRATE:i=function(e){var t=D(e);return t.length>1&&(t=O(t)),t}(n);break;case a.Z.TRACK_SELECTION_MODE_FIRST_TRACK:i=M(n);break;case a.Z.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY:i=function(e){var t=N(e);return t.length>1&&(t=D(t)),t}(n);break;case a.Z.TRACK_SELECTION_MODE_WIDEST_RANGE:i=function(e){var t=O(e);return t.length>1&&(t=D(e)),t}(n);break;default:t.warn("Track selection mode ".concat(s," is not supported. Falling back to TRACK_SELECTION_MODE_FIRST_TRACK")),i=M(n)}return i.length>0?i[0]:n[0]}function M(e){return e[0]}return e={setInitialMediaSettingsForType:function(e,t){var n=s[e]||v(e),r=p(e,t.id),i=[];n||((n=c.getSavedMediaSettings(e))&&delete n.codec,y(e,n)),r&&0!==r.length&&(n&&(i=E(i=Array.from(r),b,n),i=E(i,S,n),i=E(i,A,n),e===a.Z.AUDIO&&s[e]||(i=E(i,w,n)),i=E(i,I,n),i=E(i,C,n),i=E(i,R,n)),0===i.length?m(P(e,r),!0):i.length>1?m(P(e,i)):m(i[0]))},addTrack:function(e){if(e){var t=e.type;if((i=t)===a.Z.AUDIO||i===a.Z.VIDEO||i===a.Z.TEXT||i===a.Z.IMAGE){var i,s,o=e.streamInfo.id;n[o]||(n[o]={audio:{list:[],storeLastSettings:s=r.get().streaming.saveLastMediaSettingsForCurrentStreamingSession,current:null},video:{list:[],storeLastSettings:s,current:null},text:{list:[],storeLastSettings:s,current:null},image:{list:[],storeLastSettings:s,current:null}});for(var l=n[o][t].list,u=0,c=l.length;u<c;++u)if(_(l[u],e))return;l.push(e)}}},getTracksFor:p,getCurrentTrackFor:g,isCurrentTrack:function(e){if(!e)return!1;var t=e.type,r=e.streamInfo.id;return n[r]&&n[r][t]&&_(n[r][t].current,e)},setTrack:m,selectInitialTrack:P,setInitialSettings:y,getInitialSettings:v,getTracksWithHighestBitrate:D,getTracksWithHighestEfficiency:N,getTracksWithWidestRange:O,isTracksEqual:_,matchSettings:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{var r=!1;if(e.lang){if(e.lang instanceof RegExp)r=t.lang.match(e.lang);else if(""!==t.lang){var i=pn()(e.lang);i&&(r=(0,gn.extendedFilter)(t.lang,i).length>0)}}else r=!0;var s=void 0===e.index||null===e.index||t.index===e.index,o=!e.viewpoint||e.viewpoint===t.viewpoint,l=!e.role||!!t.roles.filter((function(t){return t===e.role}))[0],u=!e.accessibility||!!t.accessibility.filter((function(t){return t===e.accessibility}))[0],c=!e.audioChannelConfiguration||!!t.audioChannelConfiguration.filter((function(t){return t===e.audioChannelConfiguration}))[0];return r&&s&&o&&(l||t.type===a.Z.AUDIO&&n)&&u&&c}catch(e){return!1}},matchSettingsLang:b,matchSettingsIndex:S,matchSettingsViewPoint:A,matchSettingsRole:w,matchSettingsAccessibility:I,matchSettingsAudioChannelConfig:C,saveTextSettingsDisabled:function(){c.setSavedMediaSettings(a.Z.TEXT,null)},setConfig:function(e){e&&(e.domStorage&&(c=e.domStorage),e.settings&&(r=e.settings),e.customParametersModel&&(o=e.customParametersModel))},reset:T},t=(0,d.Z)(f).getInstance().getLogger(e),T(),e}mn.__dashjs_factory_name="MediaController";var yn=c.Z.getSingletonFactory(mn);c.Z.updateSingletonFactory(mn.__dashjs_factory_name,yn);var vn=yn,_n=NaN,Tn=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.data={baseUrls:t||null,selectedIdx:n||_n},this.children=[]};function En(){var e,t,n,r,i=this.context,a=Re(i).getInstance();function s(e,t,n){var r=o(n);e[t]?a.areEqual(r,e[t].data.baseUrls)||(e[t].data.baseUrls=r,e[t].data.selectedIdx=_n):e[t]=new Tn(r)}function o(e){var t=n.getBaseURLsFromElement(e),i=r.getSynthesizedBaseUrlElements(t);return i&&i.length>0&&(t=t.concat(i)),t}function l(e,n){var r=n||t;e(r.data),r.children&&r.children.forEach((function(t){return l(e,t)}))}function u(){t=new Tn}return e={reset:u,update:function(e){!function(e){!function(){if(!n||!n.hasOwnProperty("getBaseURLsFromElement")||!n.hasOwnProperty("getRepresentationSortFunction"))throw new Error("setConfig function has to be called previously")}();var r=o(e);a.areEqual(r,t.data.baseUrls)||(t.data.baseUrls=r,t.data.selectedIdx=_n),e&&e.Period_asArray&&e.Period_asArray.forEach((function(e,r){s(t.children,r,e),e.AdaptationSet_asArray&&e.AdaptationSet_asArray.forEach((function(e,i){s(t.children[r].children,i,e),e.Representation_asArray&&e.Representation_asArray.sort(n.getRepresentationSortFunction()).forEach((function(e,n){s(t.children[r].children[i].children,n,e)}))}))}))}(e)},getForPath:function(e){var n=t,r=[n.data];return e&&e.forEach((function(e){(n=n.children[e])&&r.push(n.data)})),r.filter((function(e){return e.baseUrls.length}))},invalidateSelectedIndexes:function(e){l((function(t){isNaN(t.selectedIdx)||e===t.baseUrls[t.selectedIdx].serviceLocation&&(t.selectedIdx=_n)}))},setConfig:function(e){e.adapter&&(n=e.adapter),e.contentSteeringController&&(r=e.contentSteeringController)},getBaseUrls:function(e){return o(e)}},u(),e}En.__dashjs_factory_name="BaseURLTreeModel";var bn=c.Z.getClassFactory(En);function Sn(e){var t=(e=e||{}).blacklistController;return{select:function(e){return e&&function(e){var t,n,r=0,i=[],a=0;if((n=e.sort((function(e,t){var n=e.dvbPriority-t.dvbPriority;return isNaN(n)?0:n})).filter((function(e,t,n){return!t||n[0].dvbPriority&&e.dvbPriority&&n[0].dvbPriority===e.dvbPriority}))).length)return n.length>1&&(n.forEach((function(e){r+=e.dvbWeight,i.push(r)})),t=Math.floor(Math.random()*(r-1)),i.every((function(e,n){return a=n,!(t<e)}))),n[a]}((n=[],e.filter((function(e){return!t.contains(e.serviceLocation)||(e.dvbPriority&&n.push(e.dvbPriority),!1)})).filter((function(e){return!n.length||!e.dvbPriority||-1===n.indexOf(e.dvbPriority)}))));var n}}}Sn.__dashjs_factory_name="DVBSelector";var An=c.Z.getClassFactory(Sn);function wn(e){var t=(e=e||{}).blacklistController;return{select:function(e){var n,r=0;return e&&e.some((function(e,n){return r=n,!t.contains(e.serviceLocation)}))&&(n=e[r]),n}}}wn.__dashjs_factory_name="BasicSelector";var In=c.Z.getClassFactory(wn);function Cn(){var e,t,n,r=this.context;function i(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=0,i=NaN,a=function(){var a=e[r],s=t.findIndex((function(e){return e.serviceLocation&&e.serviceLocation===a}));if(-1!==s&&!n.contains(t[s].serviceLocation))return i=s,"break";r+=1};r<e.length&&"break"!==a(););return i}return e={selectBaseUrlIndex:function(e){var n=NaN;if(isNaN(e.selectedIdx)){var r=t.getSteeringDataFromManifest();r&&r.defaultServiceLocationArray.length>0&&(n=i(r.defaultServiceLocationArray,e.baseUrls))}var a=t.getCurrentSteeringResponseData();return e.baseUrls&&e.baseUrls.length&&a&&a.pathwayPriority&&a.pathwayPriority.length&&(n=i(a.pathwayPriority,e.baseUrls)),n},setConfig:function(e){e.blacklistController&&(n=e.blacklistController),e.contentSteeringController&&(t=e.contentSteeringController)}},t=qt(r).getInstance(),e}Cn.__dashjs_factory_name="ContentSteeringSelector";var Rn=c.Z.getClassFactory(Cn);function Dn(){var e,t,n,r,i,a,s=this.context,o=(0,l.Z)(s).getInstance(),c=(0,C.Z)(s).getInstance();function d(){t.reset()}return e={chooseSelector:function(e){(0,K.PS)(e,"boolean"),a=e?r:n},select:function(e){if(e){if(c.get().streaming.applyContentSteering){var t=i.selectBaseUrlIndex(e);isNaN(t)||-1===t||(e.selectedIdx=t)}if(!isNaN(e.selectedIdx))return e.baseUrls[e.selectedIdx];var r=a.select(e.baseUrls);return r?(e.selectedIdx=e.baseUrls.indexOf(r),r):(o.trigger(u.Z.URL_RESOLUTION_FAILED,{error:new b.Z(I.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE,I.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE)}),void(a===n&&d()))}},reset:d,setConfig:function(e){e.selector&&(a=e.selector),e.contentSteeringSelector&&(i=e.contentSteeringSelector)}},t=xt(s).create({updateEventName:u.Z.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,addBlacklistEventName:u.Z.SERVICE_LOCATION_BASE_URL_BLACKLIST_ADD}),n=In(s).create({blacklistController:t}),r=An(s).create({blacklistController:t}),(i=Rn(s).create()).setConfig({blacklistController:t}),a=n,e}Dn.__dashjs_factory_name="BaseURLSelector";var Nn=c.Z.getClassFactory(Dn);function On(){var e,t,n,r,i,a=this.context,s=(0,l.Z)(a).getInstance(),o=(0,X.Z)(a).getInstance();function c(e){n.update(e),r.chooseSelector(t.getIsDVB(e)),s.trigger(f.Z.BASE_URLS_UPDATED,{baseUrls:d(e)})}function d(e){return n.getBaseUrls(e)}return e={reset:function(){n.reset(),r.reset()},initialize:function(e){n.setConfig({adapter:t,contentSteeringController:i}),c(e)},resolve:function(e){var t=n.getForPath(e).reduce((function(e,t){var n=r.select(t);return n?(o.isRelative(n.url)?e.url=o.resolve(n.url,e.url):(e.url=n.url,e.serviceLocation=n.serviceLocation),e.availabilityTimeOffset=n.availabilityTimeOffset,e.availabilityTimeComplete=n.availabilityTimeComplete,e.queryParams=n.queryParams,e):new Te}),new Te);if(!o.isRelative(t.url))return t},setConfig:function(e){e.baseURLTreeModel&&(n=e.baseURLTreeModel),e.baseURLSelector&&(r=e.baseURLSelector),e.adapter&&(t=e.adapter),e.contentSteeringController&&(i=e.contentSteeringController)},getBaseUrls:d,update:c},n=bn(a).create(),r=Nn(a).create(),s.on(u.Z.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,(function(e){n.invalidateSelectedIndexes(e.entry)}),e),e}On.__dashjs_factory_name="BaseURLController";var Pn=c.Z.getClassFactory(On);function Mn(e){return Mn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mn(e)}function xn(e,t){return xn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},xn(e,t)}function Ln(e){return Ln=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ln(e)}var kn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&xn(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Ln(t);if(n){var i=Ln(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(e,t){return!t||"object"!==Mn(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function i(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(n=r.call(this)).url=e||null,n.type=t||null,n.mediaType=a.Z.STREAM,n.responseType="",n}return i}(g.Z);function Fn(e){e=e||{};var t=this.context,n=(0,l.Z)(t).getInstance(),r=yt(t).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,errors:I});return{load:function(e,t,i){var a=function(r,a){t.resolved=!0,t.resolvedContent=r||null,n.trigger(u.Z.XLINK_ELEMENT_LOADED,{element:t,resolveObject:i,error:r||a?null:new b.Z(I.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE,I.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE+e)})};if("urn:mpeg:dash:resolve-to-zero:2013"===e)a(null,!0);else{var s=new kn(e,R.w.XLINK_EXPANSION_TYPE);r.load({request:s,success:function(e){a(e)},error:function(){a(null)}})}},reset:function(){r&&(r.abort(),r=null)}}}Fn.__dashjs_factory_name="XlinkLoader";var Un=c.Z.getClassFactory(Fn),Bn=function(e){function t(e){var t=e.localName;return null==t&&(t=e.baseName),null!=t&&""!=t||(t=e.nodeName),t}function n(e){return"string"==typeof e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;"):e}function r(e,t,n,r){for(var i=0;i<e.length;i++){var a=e[i];if("string"==typeof a){if(a==r)break}else if(a instanceof RegExp){if(a.test(r))break}else if("function"==typeof a&&a(t,n,r))break}return i!=e.length}function i(t,n,i){"property"===e.arrayAccessForm&&(t[n]instanceof Array?t[n+"_asArray"]=t[n]:t[n+"_asArray"]=[t[n]]),!(t[n]instanceof Array)&&e.arrayAccessFormPaths.length>0&&r(e.arrayAccessFormPaths,t,n,i)&&(t[n]=[t[n]])}function a(e){var t=e.split(/[-T:+Z]/g),n=new Date(t[0],t[1]-1,t[2]),r=t[5].split(".");if(n.setHours(t[3],t[4],r[0]),r.length>1&&n.setMilliseconds(r[1]),t[6]&&t[7]){var i=60*t[6]+Number(t[7]);i=0+("-"==(/\d\d-\d\d:\d\d$/.test(e)?"-":"+")?-1*i:i),n.setMinutes(n.getMinutes()-i-n.getTimezoneOffset())}else-1!==e.indexOf("Z",e.length-1)&&(n=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())));return n}function s(t,n,i,a){return!(1==n&&e.xmlElementsFilter.length>0)||r(e.xmlElementsFilter,t,i,a)}function o(n,l){if(9==n.nodeType){for(var u=new Object,c=n.childNodes,d=0;d<c.length;d++)1==(h=c[d]).nodeType&&(e.ignoreRoot?u=o(h):(u={})[p=t(h)]=o(h));return u}if(1==n.nodeType){(u=new Object).__cnt=0;var f=[];for(c=n.childNodes,d=0;d<c.length;d++){var h,p=t(h=c[d]);if(8!=h.nodeType){var g=l+"."+p;if(s(u,h.nodeType,p,g))if(u.__cnt++,null==u[p]){var m=o(h,g);("#text"!=p||/[^\s]/.test(m))&&((y={})[p]=m,f.push(y)),u[p]=m,i(u,p,g)}else{var y;null!=u[p]&&(u[p]instanceof Array||(u[p]=[u[p]],i(u,p,g))),m=o(h,g),("#text"!=p||/[^\s]/.test(m))&&((y={})[p]=m,f.push(y)),u[p][u[p].length]=m}}}u.__children=f;for(var v=t(n),_=0;_<n.attributes.length;_++){var T=n.attributes[_];u.__cnt++;for(var E=T.value,b=0,S=e.matchers.length;b<S;b++){var A=e.matchers[b];A.test(T,v)&&(E=A.converter(T.value))}u[e.attributePrefix+T.name]=E}var w=function(e){return e.prefix}(n);return null!=w&&""!=w&&(u.__cnt++,u.__prefix=w),null!=u["#text"]&&(u.__text=u["#text"],u.__text instanceof Array&&(u.__text=u.__text.join("\n")),e.stripWhitespaces&&(u.__text=u.__text.trim()),delete u["#text"],"property"==e.arrayAccessForm&&delete u["#text_asArray"],u.__text=function(t,n,i){if(e.datetimeAccessFormPaths.length>0){var s=i.split(".#")[0];return r(e.datetimeAccessFormPaths,t,n,s)?a(t):t}return t}(u.__text,p,l+"."+p)),null!=u["#cdata-section"]&&(u.__cdata=u["#cdata-section"],delete u["#cdata-section"],"property"==e.arrayAccessForm&&delete u["#cdata-section_asArray"]),0==u.__cnt&&"text"==e.emptyNodeForm?u="":1==u.__cnt&&null!=u.__text?u=u.__text:1!=u.__cnt||null==u.__cdata||e.keepCData?u.__cnt>1&&null!=u.__text&&e.skipEmptyTextNodesForObj&&(e.stripWhitespaces&&""==u.__text||""==u.__text.trim())&&delete u.__text:u=u.__cdata,delete u.__cnt,!e.enableToStringFunc||null==u.__text&&null==u.__cdata||(u.toString=function(){return(null!=this.__text?this.__text:"")+(null!=this.__cdata?this.__cdata:"")}),u}if(3==n.nodeType||4==n.nodeType)return n.nodeValue}function l(t,r,i,a){var s="<"+(null!=t&&null!=t.__prefix?t.__prefix+":":"")+r;if(null!=i)for(var o=0;o<i.length;o++){var l=i[o],u=t[l];e.escapeMode&&(u=n(u)),s+=" "+l.substr(e.attributePrefix.length)+"=",e.useDoubleQuotes?s+='"'+u+'"':s+="'"+u+"'"}return s+(a?"/>":">")}function u(e,t){return"</"+(null!=e.__prefix?e.__prefix+":":"")+t+">"}function c(t,n){return"property"==e.arrayAccessForm&&(i="_asArray",-1!==(r=n.toString()).indexOf(i,r.length-8))||0==n.toString().indexOf(e.attributePrefix)||0==n.toString().indexOf("__")||t[n]instanceof Function;var r,i}function d(e){var t=0;if(e instanceof Object)for(var n in e)c(e,n)||t++;return t}function f(t,n,i){return 0==e.jsonPropertiesFilter.length||""==i||r(e.jsonPropertiesFilter,t,n,i)}function h(t){var n=[];if(t instanceof Object)for(var r in t)-1==r.toString().indexOf("__")&&0==r.toString().indexOf(e.attributePrefix)&&n.push(r);return n}function p(t){var r="";return t instanceof Object?r+=function(t){var r="";return null!=t.__cdata&&(r+="<![CDATA["+t.__cdata+"]]>"),null!=t.__text&&(e.escapeMode?r+=n(t.__text):r+=t.__text),r}(t):null!=t&&(e.escapeMode?r+=n(t):r+=t),r}function g(e,t){return""===e?t:e+"."+t}function m(e,t,n,r){var i="";if(0==e.length)i+=l(e,t,n,!0);else for(var a=0;a<e.length;a++)i+=l(e[a],t,h(e[a]),!1),i+=y(e[a],g(r,t)),i+=u(e[a],t);return i}function y(e,t){var n="";if(d(e)>0)for(var r in e)if(!c(e,r)&&(""==t||f(e,r,g(t,r)))){var i=e[r],a=h(i);null==i||null==i?n+=l(i,r,a,!0):i instanceof Object?i instanceof Array?n+=m(i,r,a,t):i instanceof Date?(n+=l(i,r,a,!1),n+=i.toISOString(),n+=u(i,r)):d(i)>0||null!=i.__text||null!=i.__cdata?(n+=l(i,r,a,!1),n+=y(i,g(t,r)),n+=u(i,r)):n+=l(i,r,a,!0):(n+=l(i,r,a,!1),n+=p(i),n+=u(i,r))}return n+p(e)}void 0===(e=e||{}).escapeMode&&(e.escapeMode=!0),void 0===e.attributePrefix&&(e.attributePrefix="_"),e.arrayAccessForm=e.arrayAccessForm||"none",e.emptyNodeForm=e.emptyNodeForm||"text",void 0===e.enableToStringFunc&&(e.enableToStringFunc=!0),e.arrayAccessFormPaths=e.arrayAccessFormPaths||[],void 0===e.skipEmptyTextNodesForObj&&(e.skipEmptyTextNodesForObj=!0),void 0===e.stripWhitespaces&&(e.stripWhitespaces=!0),e.datetimeAccessFormPaths=e.datetimeAccessFormPaths||[],void 0===e.useDoubleQuotes&&(e.useDoubleQuotes=!1),e.xmlElementsFilter=e.xmlElementsFilter||[],e.jsonPropertiesFilter=e.jsonPropertiesFilter||[],void 0===e.keepCData&&(e.keepCData=!1),void 0===e.ignoreRoot&&(e.ignoreRoot=!1),this.parseXmlString=function(e){var t;if(window.ActiveXObject||window,void 0===e)return null;if(window.DOMParser){var n=new window.DOMParser;try{(t=n.parseFromString(e,"text/xml")).getElementsByTagNameNS("*","parsererror").length>0&&(t=null)}catch(e){t=null}}else 0==e.indexOf("<?")&&(e=e.substr(e.indexOf("?>")+2)),(t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e);return t},this.asArray=function(e){return void 0===e||null==e?[]:e instanceof Array?e:[e]},this.toXmlDateTime=function(e){return e instanceof Date?e.toISOString():"number"==typeof e?new Date(e).toISOString():null},this.asDateTime=function(e){return"string"==typeof e?a(e):e},this.xml2json=function(e){return o(e)},this.xml_str2json=function(e){var t=this.parseXmlString(e);return null!=t?this.xml2json(t):null},this.json2xml_str=function(e){return y(e,"")},this.json2xml=function(e){var t=this.json2xml_str(e);return this.parseXmlString(t)},this.getVersion=function(){return"1.2.0"}},jn="onLoad";function qn(e){e=e||{};var t,n,r,i,a,o,c=this.context,d=(0,l.Z)(c).getInstance(),f=(0,X.Z)(c).getInstance();function h(e,t,n){var r,i,a={};a.elements=e,a.type=t,a.resolveType=n,0===a.elements.length&&g(a);for(var s=0;s<a.elements.length;s++)r=a.elements[s],i=f.isHTTPURL(r.url)?r.url:r.originalContent.BaseURL+r.url,o.load(i,r,a)}function p(e){var t,n,r="";if(t=e.element,n=e.resolveObject,t.resolvedContent){var i=0;0===t.resolvedContent.indexOf("<?xml")&&(i=t.resolvedContent.indexOf("?>")+2),r=t.resolvedContent.substr(0,i)+"<response>"+t.resolvedContent.substr(i)+"</response>",t.resolvedContent=a.xml_str2json(r)}(function(e){var t;for(t=0;t<e.elements.length;t++)if(!1===e.elements[t].resolved)return!1;return!0})(n)&&g(n)}function g(e){var t,n,a=[];if(function(e){var t,n,a,s,o,l,u=[];for(s=e.elements.length-1;s>=0;s--){if(n=(t=e.elements[s]).type+"_asArray",t.resolvedContent){if(t.resolvedContent)for(o=0;o<t.resolvedContent[n].length;o++)a=t.resolvedContent[n][o],u.push(a)}else delete t.originalContent["xlink:actuate"],delete t.originalContent["xlink:href"],u.push(t.originalContent);for(t.parentElement[n].splice(t.index,1),l=0;l<u.length;l++)t.parentElement[n].splice(t.index+l,0,u[l]);u=[]}e.elements.length>0&&r.run(i)}(e),"onActuate"===e.resolveType&&d.trigger(u.Z.XLINK_READY,{manifest:i}),e.resolveType===jn)switch(e.type){case s.Z.PERIOD:for(t=0;t<i[s.Z.PERIOD+"_asArray"].length;t++)(n=i[s.Z.PERIOD+"_asArray"][t]).hasOwnProperty(s.Z.ADAPTATION_SET+"_asArray")&&(a=a.concat(m(n[s.Z.ADAPTATION_SET+"_asArray"],n,s.Z.ADAPTATION_SET,jn))),n.hasOwnProperty(s.Z.EVENT_STREAM+"_asArray")&&(a=a.concat(m(n[s.Z.EVENT_STREAM+"_asArray"],n,s.Z.EVENT_STREAM,jn)));h(a,s.Z.ADAPTATION_SET,jn);break;case s.Z.ADAPTATION_SET:d.trigger(u.Z.XLINK_READY,{manifest:i})}}function m(e,t,n,r){var i,a,s,o=[];for(a=e.length-1;a>=0;a--)(i=e[a]).hasOwnProperty("xlink:href")&&"urn:mpeg:dash:resolve-to-zero:2013"===i["xlink:href"]&&e.splice(a,1);for(a=0;a<e.length;a++)(i=e[a]).hasOwnProperty("xlink:href")&&i.hasOwnProperty("xlink:actuate")&&i["xlink:actuate"]===r&&(s=y(i["xlink:href"],t,n,a,r,i),o.push(s));return o}function y(e,t,n,r,i,a){return{url:e,parentElement:t,type:n,index:r,resolveType:i,originalContent:a,resolvedContent:null,resolved:!1}}return t={resolveManifestOnLoad:function(e){a=new Bn({escapeMode:!1,attributePrefix:"",arrayAccessForm:"property",emptyNodeForm:"object",stripWhitespaces:!1,enableToStringFunc:!1,ignoreRoot:!0,matchers:n}),(i=e).Period_asArray?h(m(i.Period_asArray,i,s.Z.PERIOD,jn),s.Z.PERIOD,jn):d.trigger(u.Z.XLINK_READY,{manifest:i})},setMatchers:function(e){e&&(n=e)},setIron:function(e){e&&(r=e)},reset:function(){d.off(u.Z.XLINK_ELEMENT_LOADED,p,t),o&&(o.reset(),o=null)}},d.on(u.Z.XLINK_ELEMENT_LOADED,p,t),o=Un(c).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,settings:e.settings}),t}qn.__dashjs_factory_name="XlinkController";var Hn=c.Z.getClassFactory(qn);function Gn(e){return Gn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gn(e)}function Vn(e){function t(e,t){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}function n(e,n,r){for(var i=0,a=e.length;i<a;++i){var s=e[i];if(n[s.name])if(r[s.name]){if(s.merge){var o=n[s.name],l=r[s.name];"object"===Gn(o)&&"object"===Gn(l)?t(o,l):r[s.name]=o+l}}else r[s.name]=n[s.name]}}function r(e,t){for(var i=0,a=e.children.length;i<a;++i){var s=e.children[i],o=t[s.name+"_asArray"];if(o)for(var l=0,u=o.length;l<u;++l){var c=o[l];n(e.properties,t,c),r(s,c)}}}return{run:function(t){if(null===t||"object"!==Gn(t))return t;if(t.Period_asArray&&"period"in e)for(var n=e.period,i=t.Period_asArray,a=0,s=i.length;a<s;++a){var o=i[a];if(r(n,o),"adaptationset"in e){var l=o.AdaptationSet_asArray;if(l)for(var u=e.adaptationset,c=0,d=l.length;c<d;++c)r(u,l[c])}}return t}}}Vn.__dashjs_factory_name="ObjectIron";var Yn=c.Z.getClassFactory(Vn);var Zn=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._test=t,this._converter=n}var t;return(t=[{key:"test",get:function(){return this._test}},{key:"converter",get:function(){return this._converter}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();function Kn(e){return Kn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kn(e)}function zn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wn(e,t){return Wn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Wn(e,t)}function Xn(e){return Xn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Xn(e)}var $n=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Wn(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Xn(t);if(n){var i=Xn(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(e,t){return!t||"object"!==Kn(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function i(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),r.call(this,(function(e,t){var n,r=(zn(n={},s.Z.MPD,[s.Z.ID,s.Z.PROFILES]),zn(n,s.Z.PERIOD,[s.Z.ID]),zn(n,s.Z.BASE_URL,[s.Z.SERVICE_LOCATION,s.Z.BYTE_RANGE]),zn(n,s.Z.SEGMENT_BASE,[s.Z.INDEX_RANGE]),zn(n,s.Z.INITIALIZATION,[s.Z.RANGE]),zn(n,s.Z.REPRESENTATION_INDEX,[s.Z.RANGE]),zn(n,s.Z.SEGMENT_LIST,[s.Z.INDEX_RANGE]),zn(n,s.Z.BITSTREAM_SWITCHING,[s.Z.RANGE]),zn(n,s.Z.SEGMENT_URL,[s.Z.MEDIA_RANGE,s.Z.INDEX_RANGE]),zn(n,s.Z.SEGMENT_TEMPLATE,[s.Z.INDEX_RANGE,s.Z.MEDIA,s.Z.INDEX,s.Z.INITIALIZATION_MINUS,s.Z.BITSTREAM_SWITCHING_MINUS]),zn(n,s.Z.ASSET_IDENTIFIER,[s.Z.VALUE,s.Z.ID]),zn(n,s.Z.EVENT_STREAM,[s.Z.VALUE]),zn(n,s.Z.ADAPTATION_SET,[s.Z.PROFILES,s.Z.MIME_TYPE,s.Z.SEGMENT_PROFILES,s.Z.CODECS,s.Z.CONTENT_TYPE]),zn(n,s.Z.FRAME_PACKING,[s.Z.VALUE,s.Z.ID]),zn(n,s.Z.AUDIO_CHANNEL_CONFIGURATION,[s.Z.VALUE,s.Z.ID]),zn(n,s.Z.CONTENT_PROTECTION,[s.Z.VALUE,s.Z.ID]),zn(n,s.Z.ESSENTIAL_PROPERTY,[s.Z.VALUE,s.Z.ID]),zn(n,s.Z.SUPPLEMENTAL_PROPERTY,[s.Z.VALUE,s.Z.ID]),zn(n,s.Z.INBAND_EVENT_STREAM,[s.Z.VALUE,s.Z.ID]),zn(n,s.Z.ACCESSIBILITY,[s.Z.VALUE,s.Z.ID]),zn(n,s.Z.ROLE,[s.Z.VALUE,s.Z.ID]),zn(n,s.Z.RATING,[s.Z.VALUE,s.Z.ID]),zn(n,s.Z.VIEWPOINT,[s.Z.VALUE,s.Z.ID]),zn(n,s.Z.CONTENT_COMPONENT,[s.Z.CONTENT_TYPE]),zn(n,s.Z.REPRESENTATION,[s.Z.ID,s.Z.DEPENDENCY_ID,s.Z.MEDIA_STREAM_STRUCTURE_ID]),zn(n,s.Z.SUBSET,[s.Z.ID]),zn(n,s.Z.METRICS,[s.Z.METRICS_MINUS]),zn(n,s.Z.REPORTING,[s.Z.VALUE,s.Z.ID]),n);if(r.hasOwnProperty(t)){var i=r[t];return void 0!==i&&i.indexOf(e.name)>=0}return!1}),(function(e){return String(e)}))}return i}(Zn);function Qn(e){return Qn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qn(e)}function Jn(e,t){return Jn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Jn(e,t)}function er(e){return er=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},er(e)}var tr=/^([-])?P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,nr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Jn(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=er(t);if(n){var i=er(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(e,t){return!t||"object"!==Qn(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function i(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),r.call(this,(function(e){for(var t=[s.Z.MIN_BUFFER_TIME,s.Z.MEDIA_PRESENTATION_DURATION,s.Z.MINIMUM_UPDATE_PERIOD,s.Z.TIMESHIFT_BUFFER_DEPTH,s.Z.MAX_SEGMENT_DURATION,s.Z.MAX_SUBSEGMENT_DURATION,s.Z.SUGGESTED_PRESENTATION_DELAY,s.Z.START,a.Z.START_TIME,s.Z.DURATION],n=t.length,r=0;r<n;r++)if(e.nodeName===t[r])return tr.test(e.value);return!1}),(function(e){var t=tr.exec(e),n=31536e3*parseFloat(t[3]||0)+2592e3*parseFloat(t[5]||0)+86400*parseFloat(t[7]||0)+3600*parseFloat(t[9]||0)+60*parseFloat(t[11]||0)+parseFloat(t[13]||0);return void 0!==t[1]&&(n=-n),n}))}return i}(Zn);function rr(e){return rr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rr(e)}function ir(e,t){return ir=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ir(e,t)}function ar(e){return ar=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ar(e)}var sr=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+-])([0-9]{2})(?::?)([0-9]{2}))?/,or=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ir(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=ar(t);if(n){var i=ar(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(e,t){return!t||"object"!==rr(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function i(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),r.call(this,(function(e){return sr.test(e.value)}),(function(e){var t,n=sr.exec(e);if(t=Date.UTC(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10),parseInt(n[4],10),parseInt(n[5],10),n[6]&&parseInt(n[6],10)||0,n[7]&&1e3*parseFloat(n[7])||0),n[9]&&n[10]){var r=60*parseInt(n[9],10)+parseInt(n[10],10);t+=("+"===n[8]?-1:1)*r*60*1e3}return new Date(t)}))}return i}(Zn);function lr(e){return lr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lr(e)}function ur(e,t){return ur=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ur(e,t)}function cr(e){return cr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},cr(e)}var dr=/^[-+]?[0-9]+[.]?[0-9]*([eE][-+]?[0-9]+)?$/,fr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ur(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=cr(t);if(n){var i=cr(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(e,t){return!t||"object"!==lr(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function i(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),r.call(this,(function(e){return dr.test(e.value)}),(function(e){return parseFloat(e)}))}return i}(Zn);function hr(e){return hr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hr(e)}function pr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gr(e,t){return gr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},gr(e,t)}function mr(e){return mr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},mr(e)}var yr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&gr(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=mr(t);if(n){var i=mr(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(e,t){return!t||"object"!==hr(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function i(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),r.call(this,(function(e,t){var n,r=(pr(n={},s.Z.ADAPTATION_SET,[s.Z.LANG]),pr(n,s.Z.REPRESENTATION,[s.Z.LANG]),pr(n,s.Z.CONTENT_COMPONENT,[s.Z.LANG]),pr(n,s.Z.LABEL,[s.Z.LANG]),pr(n,s.Z.GROUP_LABEL,[s.Z.LANG]),n);if(r.hasOwnProperty(t)){var i=r[t];return void 0!==i&&i.indexOf(e.name)>=0}return!1}),(function(e){return pn()(e)||String(e)}))}return i}(Zn);var vr=function(){function e(t){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._name=t,this._merge=(n=t)&&n.length&&n.charAt(0)===n.charAt(0).toUpperCase()}var t;return(t=[{key:"name",get:function(){return this._name}},{key:"merge",get:function(){return this._merge}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();var _r=function(){function e(t,n,r){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._name=t||"",this._properties=[],this._children=r||[],Array.isArray(n)&&n.forEach((function(e){i._properties.push(new vr(e))}))}var t;return(t=[{key:"name",get:function(){return this._name}},{key:"children",get:function(){return this._children}},{key:"properties",get:function(){return this._properties}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();function Tr(e){return Tr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tr(e)}function Er(e,t){return Er=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Er(e,t)}function br(e){return br=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},br(e)}var Sr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Er(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=br(t);if(n){var i=br(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(e,t){return!t||"object"!==Tr(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function i(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);var e=[s.Z.PROFILES,s.Z.WIDTH,s.Z.HEIGHT,s.Z.SAR,s.Z.FRAMERATE,s.Z.AUDIO_SAMPLING_RATE,s.Z.MIME_TYPE,s.Z.SEGMENT_PROFILES,s.Z.CODECS,s.Z.MAXIMUM_SAP_PERIOD,s.Z.START_WITH_SAP,s.Z.MAX_PLAYOUT_RATE,s.Z.CODING_DEPENDENCY,s.Z.SCAN_TYPE,s.Z.FRAME_PACKING,s.Z.AUDIO_CHANNEL_CONFIGURATION,s.Z.CONTENT_PROTECTION,s.Z.ESSENTIAL_PROPERTY,s.Z.ESSENTIAL_PROPERTY+"_asArray",s.Z.SUPPLEMENTAL_PROPERTY,s.Z.INBAND_EVENT_STREAM];return r.call(this,s.Z.ADAPTATION_SET,e,[new _r(s.Z.REPRESENTATION,e,[new _r(s.Z.SUB_REPRESENTATION,e)])])}return i}(_r);function Ar(e){return Ar="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ar(e)}function wr(e,t){return wr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},wr(e,t)}function Ir(e){return Ir=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ir(e)}var Cr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&wr(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Ir(t);if(n){var i=Ir(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(e,t){return!t||"object"!==Ar(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function i(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);var e=[s.Z.SEGMENT_BASE,s.Z.SEGMENT_TEMPLATE,s.Z.SEGMENT_LIST];return r.call(this,s.Z.PERIOD,e,[new _r(s.Z.ADAPTATION_SET,e,[new _r(s.Z.REPRESENTATION,e)])])}return i}(_r);function Rr(e){e=e||{};var t,n,r,i,a,s=this.context,o=e.debug;return t={parse:function(e){var t,r=window.performance.now();if(!(t=i.xml_str2json(e)))throw new Error("parsing the manifest failed");var s=window.performance.now();t.Patch?((t=t.Patch).add_asArray&&t.add_asArray.forEach((function(e){return a.run(e)})),t.replace_asArray&&t.replace_asArray.forEach((function(e){return a.run(e)}))):(t=t.MPD,a.run(t));var o=window.performance.now();return n.info("Parsing complete: ( xml2json: "+(s-r).toPrecision(3)+"ms, objectiron: "+(o-s).toPrecision(3)+"ms, total: "+((o-r)/1e3).toPrecision(3)+"s)"),t.protocol="DASH",t},getMatchers:function(){return r},getIron:function(){return a}},n=o.getLogger(t),r=[new nr,new or,new fr,new yr,new $n],i=new Bn({escapeMode:!1,attributePrefix:"",arrayAccessForm:"property",emptyNodeForm:"object",stripWhitespaces:!1,enableToStringFunc:!0,ignoreRoot:!1,matchers:r}),a=Yn(s).create({adaptationset:new Sr,period:new Cr}),t}Rr.__dashjs_factory_name="DashParser";var Dr=c.Z.getClassFactory(Rr);function Nr(e){e=e||{};var t,n,r,i,o,c=this.context,d=e.debug,f=e.settings,h=(0,l.Z)(c).getInstance(),p=(0,X.Z)(c).getInstance(),g=e.mssHandler,m=e.errHandler;function y(e){h.trigger(u.Z.INTERNAL_MANIFEST_LOADED,{manifest:e.manifest})}function v(e){var t=null;return e.indexOf("SmoothStreamingMedia")>-1?(g&&(t=g.createMssParser(),g.createMssFragmentProcessor(),g.registerEvents()),t):e.indexOf("MPD")>-1||e.indexOf("Patch")>-1?Dr(c).create({debug:d}):t}return t={load:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=new Date,l=new kn(e,R.w.MPD_TYPE);t&&(l.serviceLocation=t),a&&(l.queryParams=a),l.requestStartDate||(l.requestStartDate=s),h.trigger(u.Z.MANIFEST_LOADING_STARTED,{request:l}),r.load({request:l,success:function(t,r,a){var s,l,c;if(i)if(a&&a!==e?(l=p.parseBaseUrl(a),s=a):(p.isRelative(e)&&(e=p.resolve(e,window.location.href)),l=p.parseBaseUrl(e)),"No Content"!=r)if(null===o&&(o=v(t)),null!==o){i.setMatchers(o.getMatchers()),i.setIron(o.getIron());try{c=o.parse(t)}catch(t){return void h.trigger(u.Z.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new b.Z(I.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,I.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+"".concat(e))})}if(c){if(c.url=s||e,c.originalUrl||(c.originalUrl=c.url),f&&f.get().streaming.enableManifestDurationMismatchFix&&c.mediaPresentationDuration&&c.Period_asArray.length>1){var d=c.Period_asArray.reduce((function(e,t){return e+t.duration}),0);!isNaN(d)&&c.mediaPresentationDuration>d&&(n.warn("Media presentation duration greater than duration of all periods. Setting duration to total period duration"),c.mediaPresentationDuration=d)}c.baseUri=l,c.loadedTime=new Date,i.resolveManifestOnLoad(c),h.trigger(u.Z.ORIGINAL_MANIFEST_LOADED,{originalManifest:t})}else h.trigger(u.Z.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new b.Z(I.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,I.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+"".concat(e))})}else h.trigger(u.Z.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new b.Z(I.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,I.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+"".concat(e))});else h.trigger(u.Z.INTERNAL_MANIFEST_LOADED,{manifest:null})},error:function(t,n,r){h.trigger(u.Z.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new b.Z(I.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE,I.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE+"".concat(e,", ").concat(r))})}})},reset:function(){h.off(u.Z.XLINK_READY,y,t),g&&g.reset(),i&&(i.reset(),i=null),r&&(r.abort(),r=null)}},n=d.getLogger(t),h.on(u.Z.XLINK_READY,y,t),r=yt(c).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,urlUtils:p,constants:a.Z,dashConstants:s.Z,errors:I,requestTimeout:e.settings.get().streaming.manifestRequestTimeout}),i=Hn(c).create({errHandler:m,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,settings:e.settings}),o=null,t}Nr.__dashjs_factory_name="ManifestLoader";var Or=c.Z.getClassFactory(Nr);function Pr(){var e=this.context,t=(0,l.Z)(e).getInstance();return{error:function(e){t.trigger(u.Z.ERROR,{error:e})}}}Pr.__dashjs_factory_name="ErrorHandler";var Mr=c.Z.getSingletonFactory(Pr),xr=n(1715);function Lr(){var e,t,n,r,i,s,o=this.context,c=(0,l.Z)(o).getInstance();function f(e,r){if(!r||!r.Period_asArray||0===r.Period_asArray.length)return Promise.resolve();var i=[];return r.Period_asArray.forEach((function(r){i.push(function(e,r){return new Promise((function(i){if(e&&e.AdaptationSet_asArray&&0!==e.AdaptationSet_asArray.length){var o=[];e.AdaptationSet_asArray.forEach((function(e){t.getIsTypeOf(e,r)&&o.push(function(e,r){return new Promise((function(i){if(e.Representation_asArray&&0!==e.Representation_asArray.length){var o=[],l=[];e.Representation_asArray.forEach((function(i,s){var u=t.getCodec(e,s,!1),c=function(e,t,n){switch(e){case a.Z.VIDEO:return function(e,t){return{codec:t,width:e.width||null,height:e.height||null,framerate:e.frameRate||null,bitrate:e.bandwidth||null}}(t,n);case a.Z.AUDIO:return function(e,t){var n=e.audioSamplingRate||null;return{codec:t,bitrate:e.bandwidth||null,samplerate:n}}(t,n);default:return null}}(r,i,u);l.push(c),o.push(n.supportsCodec(c,r))})),Promise.all(o).then((function(t){e.Representation_asArray=e.Representation_asArray.filter((function(e,n){return t[n]||s.debug("[Stream] Codec ".concat(l[n].codec," not supported ")),t[n]})),i()})).catch((function(){i()}))}else i()}))}(e,r))})),Promise.all(o).then((function(){e.AdaptationSet_asArray=e.AdaptationSet_asArray.filter((function(e){var t=e.Representation_asArray&&e.Representation_asArray.length>0;return t||(c.trigger(u.Z.ADAPTATION_SET_REMOVED_NO_CAPABILITIES,{adaptationSet:e}),s.warn("AdaptationSet has been removed because of no supported Representation")),t})),i()})).catch((function(){i()}))}else i()}))}(r,e))})),Promise.all(i)}return e={setConfig:function(e){e&&(e.adapter&&(t=e.adapter),e.capabilities&&(n=e.capabilities),e.settings&&(r=e.settings),e.customParametersModel&&(i=e.customParametersModel))},filterUnsupportedFeatures:function(e){return new Promise((function(o){var l=[];l.push(f(a.Z.VIDEO,e)),l.push(f(a.Z.AUDIO,e)),Promise.all(l).then((function(){r.get().streaming.capabilities.filterUnsupportedEssentialProperties&&function(e){e&&e.Period_asArray&&0!==e.Period_asArray.length&&e.Period_asArray.forEach((function(e){e.AdaptationSet_asArray=e.AdaptationSet_asArray.filter((function(e){return!e.Representation_asArray||0===e.Representation_asArray.length||(e.Representation_asArray=e.Representation_asArray.filter((function(e){var r=t.getEssentialPropertiesForRepresentation(e);if(r&&r.length>0)for(var i=0;i<r.length;){if(!n.supportsEssentialProperty(r[i]))return s.debug("[Stream] EssentialProperty not supported: "+r[i].schemeIdUri),!1;i+=1}return!0})),e.Representation_asArray&&e.Representation_asArray.length>0)}))}))}(e),function(e){var t=i.getCustomCapabilitiesFilters();t&&0!==t.length&&e&&e.Period_asArray&&0!==e.Period_asArray.length&&e.Period_asArray.forEach((function(e){e.AdaptationSet_asArray=e.AdaptationSet_asArray.filter((function(e){return!e.Representation_asArray||0===e.Representation_asArray.length||(e.Representation_asArray=e.Representation_asArray.filter((function(e){return!t.some((function(t){return!t(e)}))})),e.Representation_asArray&&e.Representation_asArray.length>0)}))}))}(e),o()})).catch((function(){o()}))}))}},s=(0,d.Z)(o).getInstance().getLogger(e),e}Lr.__dashjs_factory_name="CapabilitiesFilter";var kr=c.Z.getSingletonFactory(Lr),Fr=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.xywh=null,this.track=null,this.id=null,this.s=null,this.r=null};function Ur(){var e;return{initialize:function(t){if(e=new Fr,!t)return null;var n=t.indexOf("#");if(-1!==n)for(var r=t.substr(n+1).split("&"),i=0,a=r.length;i<a;++i){var s=r[i],o=s.indexOf("=");if(-1!==o){var l=s.substring(0,o);e.hasOwnProperty(l)&&(e[l]=s.substr(o+1))}}},getURIFragmentData:function(){return e}}}Ur.__dashjs_factory_name="URIFragmentModel";var Br=c.Z.getSingletonFactory(Ur);function jr(){var e,t=this.context,n=(0,l.Z)(t).getInstance();return{getValue:function(){return e},setValue:function(t){e=t,t&&n.trigger(u.Z.MANIFEST_LOADED,{data:t})}}}jr.__dashjs_factory_name="ManifestModel";var qr=c.Z.getSingletonFactory(jr),Hr=-.5;function Gr(){var e,t,n,r,i=this.context,a=(0,C.Z)(i).getInstance();function s(e,n){return isNaN(e)?0:e>0?(n&&t.warn("Supplied minimum playback rate is a positive value when it should be negative or 0. The supplied rate will not be applied and set to 0: 100% playback speed."),0):e<Hr?(n&&t.warn("Supplied minimum playback rate is out of range and will be limited to ".concat(Hr,": ").concat(-50,"% playback speed.")),Hr):e}function o(e,n){return isNaN(e)?0:e<0?(n&&t.warn("Supplied maximum playback rate is a negative value when it should be negative or 0. The supplied rate will not be applied and set to 0: 100% playback speed."),0):e>1?(n&&t.warn("Supplied maximum playback rate is out of range and will be limited to ".concat(1,": ").concat(200,"% playback speed.")),1):e}function l(){var e=a.get().streaming.buffer.stableBufferTime>0?a.get().streaming.buffer.stableBufferTime:a.get().streaming.buffer.fastSwitchEnabled?20:12,t=n.getLiveDelay();return!isNaN(t)&&t>0?Math.min(e,t):e}return e={getCatchupMaxDrift:function(){if(!isNaN(a.get().streaming.liveCatchup.maxDrift)&&a.get().streaming.liveCatchup.maxDrift>0)return a.get().streaming.liveCatchup.maxDrift;var e=r.getServiceDescriptionSettings();return e&&e.liveCatchup&&!isNaN(e.liveCatchup.maxDrift)&&e.liveCatchup.maxDrift>0?e.liveCatchup.maxDrift:12},getCatchupModeEnabled:function(){return null!==a.get().streaming.liveCatchup.enabled?a.get().streaming.liveCatchup.enabled:n.getInitialCatchupModeActivated()},getStableBufferTime:l,getInitialBufferLevel:function(){var e=a.get().streaming.buffer.initialBufferLevel;return isNaN(e)||e<0?0:Math.min(l(),e)},getRetryAttemptsForType:function(e){var t=isNaN(a.get().streaming.retryAttempts.lowLatencyMultiplyFactor)?5:a.get().streaming.retryAttempts.lowLatencyMultiplyFactor;return n.getLowLatencyModeEnabled()?a.get().streaming.retryAttempts[e]*t:a.get().streaming.retryAttempts[e]},getRetryIntervalsForType:function(e){var t=isNaN(a.get().streaming.retryIntervals.lowLatencyReductionFactor)?10:a.get().streaming.retryIntervals.lowLatencyReductionFactor;return n.getLowLatencyModeEnabled()?a.get().streaming.retryIntervals[e]/t:a.get().streaming.retryIntervals[e]},getCatchupPlaybackRates:function(e){var t=a.get().streaming.liveCatchup.playbackRate;if(!isNaN(t.min)||!isNaN(t.max))return{min:s(t.min,e),max:o(t.max,e)};var n=r.getServiceDescriptionSettings();if(n&&n.liveCatchup&&(!isNaN(n.liveCatchup.playbackRate.min)||!isNaN(n.liveCatchup.playbackRate.max))){var i=n.liveCatchup.playbackRate;return{min:s(i.min,e),max:o(i.max,e)}}return{min:-.5,max:.5}},getAbrBitrateParameter:function(e,t){try{var n=a.get().streaming.abr[e][t];if(!isNaN(n)&&-1!==n)return n;var i=r.getServiceDescriptionSettings();return i&&i[e]&&!isNaN(i[e][t])?i[e][t]:-1}catch(e){return-1}},setConfig:function(e){e.playbackController&&(n=e.playbackController),e.serviceDescriptionController&&(r=e.serviceDescriptionController)},reset:function(){}},t=(0,d.Z)(i).getInstance().getLogger(e),e}Gr.__dashjs_factory_name="MediaPlayerModel";var Vr=c.Z.getSingletonFactory(Gr),Yr=n(1767);function Zr(e){var t=(e=e||{}).abrController,n=e.switchHistory,r=e.droppedFramesHistory,i=e.currentRequest,a=e.useBufferOccupancyABR,s=e.useL2AABR,o=e.useLoLPABR,l=e.streamProcessor?e.streamProcessor.getScheduleController():null,u=e.streamProcessor?e.streamProcessor.getRepresentationInfo():null,c=e.videoModel?e.videoModel:null;function d(){return u?u.mediaInfo:null}return{getMediaType:function(){var e=d();return e?e.type:null},getMediaInfo:d,getDroppedFramesHistory:function(){return r},getCurrentRequest:function(){return i},getSwitchHistory:function(){return n},getStreamInfo:function(){var e=d();return e?e.streamInfo:null},getScheduleController:function(){return l},getAbrController:function(){return t},getRepresentationInfo:function(){return u},useBufferOccupancyABR:function(){return a},useL2AABR:function(){return s},useLoLPABR:function(){return o},getVideoModel:function(){return c}}}Zr.__dashjs_factory_name="RulesContext";var Kr=c.Z.getClassFactory(Zr),zr=n(2068);function Wr(){var e=[],t=[];return{push:function(n){n.newValue===zr.Z.NO_CHANGE&&(n.newValue=n.oldValue),e[n.oldValue]||(e[n.oldValue]={noDrops:0,drops:0,dropSize:0});var r=n.newValue-n.oldValue,i=r<0?1:0,a=i?-r:0,s=i?0:1;if(e[n.oldValue].drops+=i,e[n.oldValue].dropSize+=a,e[n.oldValue].noDrops+=s,t.push({idx:n.oldValue,noDrop:s,drop:i,dropSize:a}),t.length>8){var o=t.shift();e[o.idx].drops-=o.drop,e[o.idx].dropSize-=o.dropSize,e[o.idx].noDrops-=o.noDrop}},getSwitchRequests:function(){return e},reset:function(){e=[],t=[]}}}Wr.__dashjs_factory_name="SwitchRequestHistory";var Xr=c.Z.getClassFactory(Wr);function $r(){var e={},t={},n={};return{push:function(r,i,a){if(i){e[r]||(e[r]=[],t[r]=0,n[r]=0);var s=a&&a.droppedVideoFrames?a.droppedVideoFrames:0,o=a&&a.totalVideoFrames?a.totalVideoFrames:0,l=s-t[r];t[r]=s;var u=o-n[r];n[r]=o;var c=e[r];isNaN(i)||(c[i]?(c[i].droppedVideoFrames+=l,c[i].totalVideoFrames+=u):c[i]={droppedVideoFrames:l,totalVideoFrames:u})}},getFrameHistory:function(t){return e[t]},clearForStream:function(r){try{delete e[r],delete t[r],delete n[r]}catch(e){}},reset:function(){e={},t={},n={}}}}$r.__dashjs_factory_name="DroppedFramesHistory";var Qr=c.Z.getClassFactory($r);function Jr(e){var t,n,r,i,s,o=this.context,u=(e=e||{}).settings,c=(0,l.Z)(o).getInstance();function d(e,t,n,r){var i=Math.pow(.5,n/r.fast);e.fastEstimate=(1-i)*t+i*e.fastEstimate;var a=Math.pow(.5,n/r.slow);e.slowEstimate=(1-a)*t+a*e.slowEstimate,e.totalWeight+=n}function h(e,o,l){return u.get().streaming.abr.movingAverageMethod!==a.Z.MOVING_AVERAGE_SLIDING_WINDOW?function(e,t){var n=e?s.throughputHalfLife:s.latencyHalfLife,a=e?r[t]:i[t];if(!a||a.totalWeight<=0)return NaN;var o=a.fastEstimate/(1-Math.pow(.5,a.totalWeight/n.fast)),l=a.slowEstimate/(1-Math.pow(.5,a.totalWeight/n.slow));return e?Math.min(o,l):Math.max(o,l)}(e,o):function(e,r,i){var a=function(e,r,i){var a,s;if(e?(a=t[r],s=i?3:4):(a=n[r],s=4),a){if(s>=a.length)s=a.length;else if(e)for(var o=1;o<s;++o){var l=a[a.length-o]/a[a.length-o-1];if((l>=1.3||l<=1/1.3)&&(s+=1)===a.length)break}}else s=0;return s}(e,r,i),s=(e?t:n)[r];return 0!==a&&s&&0!==s.length?(s=s.slice(-a)).reduce((function(e,t){return e+t}))/s.length:NaN}(e,o,l)}function p(e,t){return h(!0,e,t)}function g(e){t[e]=t[e]||[],n[e]=n[e]||[],r[e]=r[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0},i[e]=i[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0}}function m(){t={},n={},r={},i={}}var y={push:function(e,o,l){if(o.trace&&o.trace.length){var h,p=o.tresponse.getTime()-o.trequest.getTime()||1,m=o._tfinish.getTime()-o.tresponse.getTime()||1,y=o.trace.reduce((function(e,t){return e+t.b[0]}),0),v=0;if(0!==(h=o._fileLoaderType&&o._fileLoaderType===a.Z.FILE_LOADER_TYPES.FETCH?o.trace.reduce((function(e,t){return e+t.d}),0):l?m:p+m)&&(v=Math.round(8*y/h)),o.cmsd){var _=o.cmsd.dynamic&&o.cmsd.dynamic.etp?o.cmsd.dynamic.etp:null;if(_){var T=u.get().streaming.cmsd.abr.etpWeightRatio;T>0&&T<=1&&(v=v*(1-T)+_*T)}}if(g(e),function(e,t,n){return e===a.Z.VIDEO?n<u.get().streaming.cacheLoadThresholds[a.Z.VIDEO]:e===a.Z.AUDIO?n<u.get().streaming.cacheLoadThresholds[a.Z.AUDIO]:void 0}(e,0,m)){if(t[e].length>0&&!t[e].hasCachedEntries)return;t[e].hasCachedEntries=!0}else t[e]&&t[e].hasCachedEntries&&function(e){delete t[e],delete n[e],delete r[e],delete i[e],g(e)}(e);t[e].push(v),c.trigger(f.Z.THROUGHPUT_MEASUREMENT_STORED,{throughput:v,mediaType:e,httpRequest:o}),t[e].length>20&&t[e].shift(),n[e].push(p),n[e].length>20&&n[e].shift(),d(r[e],v,.001*m,s.throughputHalfLife),d(i[e],p,1,s.latencyHalfLife)}},getAverageThroughput:p,getSafeAverageThroughput:function(e,t){var n=p(e,t);return isNaN(n)||(n*=u.get().streaming.abr.bandwidthSafetyFactor),n},getAverageLatency:function(e){return h(!1,e)},reset:m};return s={throughputHalfLife:{fast:3,slow:8},latencyHalfLife:{fast:1,slow:2}},m(),y}Jr.__dashjs_factory_name="ThroughputHistory";var ei=c.Z.getClassFactory(Jr);function ti(){var e,t,n,r,i,s,c,h,p,g,m,y,v,_,T,b,S,A,w,I,C,D,N,O,P,M,x,L=this.context,k=(0,d.Z)(L).getInstance(),F=(0,l.Z)(L).getInstance();function U(){i={},s={},h={},c={},I={},N={},O={},P={},void 0===g&&(g=!1),C&&C.reset(),w=void 0,C=void 0,D=void 0,clearTimeout(p),p=null}function B(t){var i=t.request.mediaType,a=t.streamId;if(i&&a&&c[a]&&x.get().streaming.abr.autoSwitchBitrate[i]){var s=c[a][i];if(s){var l=Kr(L).create({abrController:e,streamProcessor:s,currentRequest:t.request,useBufferOccupancyABR:N[i],useL2AABR:O[i],useLoLPABR:P[i],videoModel:_}),u=n.shouldAbandonFragment(l,a);u.quality>zr.Z.NO_CHANGE&&s.getFragmentModel().getRequests({state:E.FRAGMENT_MODEL_LOADING,index:t.request.index})[0]&&(h[a][i].state=o.Z.ABANDON_LOAD,I[a][i].reset(),I[a][i].push({oldValue:V(i,a),newValue:u.quality,confidence:1,reason:u.reason}),Y(i,r.getActiveStreamInfo(),u.quality,u.reason),clearTimeout(p),p=setTimeout((function(){h[a][i].state=o.Z.ALLOW_LOAD,p=null}),x.get().streaming.abandonLoadTimeout))}}}function j(e){e.mediaType===a.Z.VIDEO&&(void 0!==w&&C.push(e.streamId,w,_.getPlaybackQuality()),w=e.newQuality)}function q(e){var n,r;e.metric!==o.Z.HTTP_REQUEST||!e.value||e.value.type!==R.w.MEDIA_SEGMENT_TYPE||e.mediaType!==a.Z.AUDIO&&e.mediaType!==a.Z.VIDEO||D.push(e.mediaType,e.value,x.get().streaming.abr.useDeadTimeLatency),e.metric!==o.Z.BUFFER_LEVEL||e.mediaType!==a.Z.AUDIO&&e.mediaType!==a.Z.VIDEO||(n=e.mediaType,r=.001*e.value.level,x.get().streaming.abr.ABRStrategy===a.Z.ABR_STRATEGY_DYNAMIC&&function(e,n){try{var r=T.getStableBufferTime(),i=r,a=.5*r,s=N[e],o=n>(s?a:i);N[e]=o,o!==s&&(o?t.info("["+e+"] switching from throughput to buffer occupancy ABR rule (buffer: "+n.toFixed(3)+")."):t.info("["+e+"] switching from buffer occupancy to throughput ABR rule (buffer: "+n.toFixed(3)+")."))}catch(e){t.error(e)}}(n,r))}function H(e,n){try{var r;return i[n]=i[n]||{},i[n].hasOwnProperty(e)||(i[n][e]=0),r=function(e,t){var n=i[t][e],r=n;if(!c[t]||!c[t][e])return r;var a=G(e,t);void 0!==a&&(r=Math.max(n,a));var s=function(e,t){try{var n=T.getAbrBitrateParameter("maxBitrate",e);return n>-1?W(c[t][e].getMediaInfo(),n,t):void 0}catch(e){return}}(e,t);return void 0!==s&&(r=Math.min(r,s)),r}(e,n),r=function(e,t,n){var r=i[n][t],a=x.get().streaming.abr.maxRepresentationRatio[t];return isNaN(a)||a>=1||a<0?e:Math.min(e,Math.round(r*a))}(r,e,n),r=function(e,t,n){if(t!==a.Z.VIDEO||!x.get().streaming.abr.limitBitrateByPortal||!c[n]||!c[n][t])return e;g||$();var r=c[n][t].getStreamInfo(),i=v.getAdaptationForType(r.index,t,r).Representation_asArray,s=e;if(m>0&&y>0){for(;s>0&&i[s]&&m<i[s].width&&m-i[s-1].width<i[s].width-m;)s-=1;for(;s<i.length-1&&i[s].width===i[s+1].width;)s+=1}return s}(r,e,n),x.get().streaming.cmsd.enabled&&x.get().streaming.cmsd.abr.applyMb&&(r=function(e,n,r){if("video"!==n)return e;var i=S.getMaxBitrate(n);if(i<0)return e;var a=z(r,"audio",V("audio",r));i-=a?a.bitrate/1e3:0;var s=W(c[r][n].getMediaInfo(),i,r);return t.debug("Stream ID: "+r+" ["+n+"] Apply max bit rate from CMSD: "+i),Math.min(e,s)}(r,e,n)),r}catch(e){return}}function G(e,t){try{return function(e,t){try{var n=T.getAbrBitrateParameter("minBitrate",e);if(n>-1){var r=c[t][e].getMediaInfo(),i=X(r),a=W(r,n,t);return i[a]&&a<i.length-1&&i[a].bitrate<1e3*n&&a++,a}return}catch(e){return}}(e,t)}catch(e){return}}function V(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;try{return t||(t=r.getActiveStreamInfo().id),e&&c[t]&&c[t][e]&&t?(s[t]=s[t]||{},s[t].hasOwnProperty(e)||(s[t][e]=0),s[t][e]):0}catch(e){return 0}}function Y(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(t&&t.id&&e){var i=t.id,a=V(e,i);(0,K.SE)(n);var s=H(e,i);n!==a&&n>=0&&n<=s&&Z(e,a,n,s,r,i)}}function Z(e,n,r,i,a,o){if(e&&c[o]&&c[o][e]){var l=c[o][e].getStreamInfo(),d=l&&l.manifestInfo&&l.manifestInfo.isDynamic,f=M.getCurrentBufferLevel(e);t.info("Stream ID: "+o+" ["+e+"] switch from "+n+" to "+r+"/"+i+" (buffer: "+f+") "+(a?JSON.stringify(a):".")),s[o]=s[o]||{},s[o][e]=r;var h=z(o,e,r);F.trigger(u.Z.QUALITY_CHANGE_REQUESTED,{oldQuality:n,newQuality:r,reason:a,streamInfo:l,bitrateInfo:h,maxIdx:i,mediaType:e},{streamId:l.id,mediaType:e});var p=D.getAverageThroughput(e,d);isNaN(p)||A.setSavedBitrateSettings(e,p)}}function z(e,t,n){if(t&&c&&c[e]&&c[e][t]){var r=X(c[e][t].getMediaInfo());return r[n]?r[n]:null}return null}function W(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=e&&e.type?c[n][e.type].getRepresentationInfo():null;if(x.get().streaming.abr.useDeadTimeLatency&&r&&i&&i.fragmentDuration){r/=1e3;var a=i.fragmentDuration;if(r>a)return 0;t*=1-r/a}for(var s=X(e),o=s.length-1;o>=0;o--)if(1e3*t>=s[o].bitrate)return o;return 0}function X(e){var t=[];if(!e||!e.bitrateList)return t;for(var n,r=e.bitrateList,i=e.type,a=0,s=r.length;a<s;a++)(n=new Dt).mediaType=i,n.qualityIndex=a,n.bitrate=r[a].bandwidth,n.width=r[a].width,n.height=r[a].height,n.scanType=r[a].scanType,t.push(n);return t}function $(){if(_){var e=x.get().streaming.abr.usePixelRatioInLimitBitrateByPortal&&window.hasOwnProperty("devicePixelRatio")?window.devicePixelRatio:1;m=_.getClientWidth()*e,y=_.getClientHeight()*e}}return e={initialize:function(){C=Qr(L).create(),D=ei(L).create({settings:x}),(n=(0,Yr.Z)(L).create({dashMetrics:M,customParametersModel:b,mediaPlayerModel:T,settings:x})).initialize(),F.on(f.Z.QUALITY_CHANGE_RENDERED,j,e),F.on(f.Z.METRIC_ADDED,q,e),F.on(u.Z.LOADING_PROGRESS,B,e)},isPlayingAtTopQuality:function(e){var t=e?e.id:null,n=V(a.Z.AUDIO,t),r=V(a.Z.VIDEO,t);return n===H(a.Z.AUDIO,t)&&r===H(a.Z.VIDEO,t)},updateTopQualityIndex:function(e){var t=e.type,n=e.streamInfo.id,r=e.representationCount-1;return i[n]=i[n]||{},i[n][t]=r,r},clearDataForStream:function(e){C&&C.clearForStream(e),c[e]&&delete c[e],I[e]&&delete I[e],h[e]&&delete h[e]},getThroughputHistory:function(){return D},getBitrateList:X,getQualityForBitrate:W,getTopBitrateInfoFor:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t||(t=r.getActiveStreamInfo().id),e&&c&&c[t]&&c[t][e]){var n=H(e,t),i=X(c[t][e].getMediaInfo());return i[n]?i[n]:null}return null},getMinAllowedIndexFor:G,getMaxAllowedIndexFor:H,getInitialBitrateFor:function(e,t){if(function(){if(!A||!A.hasOwnProperty("getSavedBitrateSettings"))throw new Error(a.Z.MISSING_CONFIG_ERROR)}(),e===a.Z.TEXT)return NaN;var n=A.getSavedBitrateSettings(e),r=T.getAbrBitrateParameter("initialBitrate",e),i=x.get().streaming.abr.initialRepresentationRatio[e];if(-1===r)if(i>-1){var s=c[t][e].getStreamInfo(),o=v.getAdaptationForType(s.index,e,s).Representation_asArray;r=Array.isArray(o)?o[Math.max(Math.round(o.length*i)-1,0)].bandwidth/1e3:0}else r=isNaN(n)?e===a.Z.VIDEO?1e3:100:n;return r},getQualityFor:V,getAbandonmentStateFor:function(e,t){return h[e]&&h[e][t]?h[e][t].state:null},setPlaybackQuality:Y,checkPlaybackQuality:function(t,r){try{if(!(t&&c&&c[r]&&c[r][t]))return!1;if(C){var i=_.getPlaybackQuality();i&&C.push(r,w,i)}if(!x.get().streaming.abr.autoSwitchBitrate[t])return!1;var a=V(t,r),s=Kr(L).create({abrController:e,switchHistory:I[r][t],droppedFramesHistory:C,streamProcessor:c[r][t],currentValue:a,useBufferOccupancyABR:N[t],useL2AABR:O[t],useLoLPABR:P[t],videoModel:_}),l=G(t,r),u=H(t,r),d=n.getMaxQuality(s),f=d.quality;return void 0!==l&&(f>zr.Z.NO_CHANGE?f:a)<l&&(f=l),f>u&&(f=u),I[r][t].push({oldValue:a,newValue:f}),f>zr.Z.NO_CHANGE&&f!==a&&(h[r][t].state===o.Z.ALLOW_LOAD||f<a)&&(Z(t,a,f,u,d.reason,r),!0)}catch(e){return!1}},setElementSize:$,setWindowResizeEventCalled:function(e){g=e},registerStreamType:function(e,t){var n=t.getStreamInfo().id;c[n]||(c[n]={}),I[n]||(I[n]={}),h[n]||(h[n]={}),I[n][e]=Xr(L).create(),c[n][e]=t,h[n][e]={},h[n][e].state=o.Z.ALLOW_LOAD,function(e){var t=x.get().streaming.abr.ABRStrategy;t===a.Z.ABR_STRATEGY_L2A?(N[e]=!1,P[e]=!1,O[e]=!0):t===a.Z.ABR_STRATEGY_LoLP?(N[e]=!1,P[e]=!0,O[e]=!1):t===a.Z.ABR_STRATEGY_BOLA?(N[e]=!0,P[e]=!1,O[e]=!1):t===a.Z.ABR_STRATEGY_THROUGHPUT?(N[e]=!1,P[e]=!1,O[e]=!1):t===a.Z.ABR_STRATEGY_DYNAMIC&&(N[e]=!(!N||!N[e])&&N[e],P[e]=!1,O[e]=!1)}(e),e===a.Z.VIDEO&&$()},unRegisterStreamType:function(e,t){try{c[e]&&c[e][t]&&delete c[e][t],I[e]&&I[e][t]&&delete I[e][t],h[e]&&h[e][t]&&delete h[e][t]}catch(e){}},setConfig:function(e){e&&(e.streamController&&(r=e.streamController),e.domStorage&&(A=e.domStorage),e.mediaPlayerModel&&(T=e.mediaPlayerModel),e.customParametersModel&&(b=e.customParametersModel),e.cmsdModel&&(S=e.cmsdModel),e.dashMetrics&&(M=e.dashMetrics),e.adapter&&(v=e.adapter),e.videoModel&&(_=e.videoModel),e.settings&&(x=e.settings))},reset:function(){U(),F.off(u.Z.LOADING_PROGRESS,B,e),F.off(f.Z.QUALITY_CHANGE_RENDERED,j,e),F.off(f.Z.METRIC_ADDED,q,e),n&&n.reset()}},t=k.getLogger(e),U(),e}ti.__dashjs_factory_name="AbrController";var ni=c.Z.getSingletonFactory(ti);ni.QUALITY_DEFAULT=0,c.Z.updateSingletonFactory(ti.__dashjs_factory_name,ni);var ri=ni,ii=new Map([[a.Z.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,"loadedmetadata"],[a.Z.VIDEO_ELEMENT_READY_STATES.HAVE_CURRENT_DATA,"loadeddata"],[a.Z.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,"canplay"],[a.Z.VIDEO_ELEMENT_READY_STATES.HAVE_ENOUGH_DATA,"canplaythrough"]]);function ai(){var e,t,n,r,i,s,o,c,f=this.context,h=(0,l.Z)(f).getInstance(),p=[];function g(){n&&(n.playbackRate=1,n.removeEventListener("canplay",g))}function m(){return p.length>0}function y(){if(n&&m()&&0===n.playbackRate){var e=document.createEvent("Event");e.initEvent("waiting",!0,!1),n.dispatchEvent(e)}}function v(e,t){n&&n.addEventListener(e,t)}function _(e,t){n&&n.removeEventListener(e,t)}function T(){return n?n.readyState:NaN}function E(){return n?n.buffered:null}function b(e,t,r,i,a){if(n)for(var s=0;s<n.textTracks.length;s++)if(n.textTracks[s].kind===e&&(!t||n.textTracks[s].label==t)&&n.textTracks[s].language===r&&n.textTracks[s].isTTML===i&&n.textTracks[s].isEmbedded===a)return n.textTracks[s];return null}function S(e,t){return e===a.Z.VIDEO_ELEMENT_READY_STATES.HAVE_NOTHING||T()>=e?(t(),null):function(e,t){var n=function n(){_(e,n),t(e)};return v(e,n),{func:n,event:e}}(ii.get(e),t)}return e={addEventListener:v,addTextTrack:function(e,t,r,i,a){if(!n)return null;var s=b(e,t,r,i,a);return s||((s=n.addTextTrack(e,t,r)).isEmbedded=a,s.isTTML=i),s},appendChild:function(e){n&&(n.appendChild(e),void 0!==e.isTTML&&(n.textTracks[n.textTracks.length-1].isTTML=e.isTTML,n.textTracks[n.textTracks.length-1].isEmbedded=e.isEmbedded))},getBufferRange:E,getClientHeight:function(){return n?n.clientHeight:NaN},getClientWidth:function(){return n?n.clientWidth:NaN},getElement:function(){return n},getEnded:function(){return n?n.ended:null},getPlaybackQuality:function(){if(!n)return null;var e="webkitDroppedFrameCount"in n&&"webkitDecodedFrameCount"in n,t=null;return"getVideoPlaybackQuality"in n?t=n.getVideoPlaybackQuality():e&&(t={droppedVideoFrames:n.webkitDroppedFrameCount,totalVideoFrames:n.webkitDroppedFrameCount+n.webkitDecodedFrameCount,creationTime:new Date}),t},getPlaybackRate:function(){return n?n.playbackRate:null},getPlayedRanges:function(){return n?n.played:null},getReadyState:T,getSource:function(){return n?n.src:null},getTTMLRenderingDiv:function(){return s},getTextTrack:b,getTextTracks:function(){return n?n.textTracks:[]},getTime:function(){return n?isNaN(r)?n.currentTime:r:null},getVideoHeight:function(){return n?n.videoHeight:NaN},getVideoRelativeOffsetLeft:function(){if(n){var e=n.parentNode.host||n.parentNode;return e?n.getBoundingClientRect().left-e.getBoundingClientRect().left:NaN}return NaN},getVideoRelativeOffsetTop:function(){if(n){var e=n.parentNode.host||n.parentNode;return e?n.getBoundingClientRect().top-e.getBoundingClientRect().top:NaN}return NaN},getVideoWidth:function(){return n?n.videoWidth:NaN},getVttRenderingDiv:function(){return o},initialize:function(){h.on(u.Z.PLAYBACK_PLAYING,y,this)},isPaused:function(){return n?n.paused:null},isSeeking:function(){return n?n.seeking||!isNaN(r):null},isStalled:m,pause:function(){n&&(n.pause(),n.autoplay=!1)},play:function(){if(n){n.autoplay=!0;var e=n.play();e&&e.catch&&"undefined"!=typeof Promise&&e.catch((function(e){"NotAllowedError"===e.name&&h.trigger(u.Z.PLAYBACK_NOT_ALLOWED),t.warn("Caught pending play exception - continuing (".concat(e,")"))}))}},removeChild:function(e){n&&n.removeChild(e)},removeEventListener:_,reset:function(){clearTimeout(c),h.off(u.Z.PLAYBACK_PLAYING,y,this)},setCurrentTime:function(e,t){n&&(i&&i.func&&i.event&&_(i.event,i.func),r=e,i=S(a.Z.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,(function(){if(n)if(n.currentTime!==r)try{r=t?function(e){var t=E(),n=e,r=9999999999;if(t)for(var i=0;i<t.length;i++){var a=t.start(i),s=t.end(i),o=Math.abs(a-e),l=Math.abs(s-e);if(e>=a&&e<=s)return e;o<r&&(r=o,n=a),l<r&&(r=l,n=s)}return n}(r):r,isNaN(r)||(n.currentTime=r),r=NaN}catch(e){0===n.readyState&&e.code===e.INVALID_STATE_ERR&&(c=setTimeout((function(){n.currentTime=r,r=NaN}),400))}else r=NaN})))},setElement:function(e){if(!(null==e||e&&/^(VIDEO|AUDIO)$/i.test(e.nodeName)))throw"element is not video or audio DOM type!";(n=e)&&(n.preload="auto")},setPlaybackRate:function(e){n&&(!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])&&n.readyState<=2&&e>0?n.addEventListener("canplay",g):n.playbackRate=e)},setSource:function(e){n&&(e?n.src=e:(n.removeAttribute("src"),n.load()))},setStallState:function(e,t){!function(e,t){t?function(e){null!==e&&n&&!n.seeking&&-1===p.indexOf(e)&&p.push(e)}(e):function(e){var t=p.indexOf(e);null!==e&&-1!==t&&p.splice(t,1)}(e)}(e,t)},setTTMLRenderingDiv:function(e){(s=e).style.position="absolute",s.style.display="flex",s.style.overflow="hidden",s.style.pointerEvents="none",s.style.top=0,s.style.left=0},setVttRenderingDiv:function(e){o=e},waitForReadyState:S,setDisableRemotePlayback:function(e){n&&(n.disableRemotePlayback=e)}},t=(0,d.Z)(f).getInstance().getLogger(e),r=NaN,e}ai.__dashjs_factory_name="VideoModel";var si=c.Z.getSingletonFactory(ai),oi=[{oldKey:"dashjs_vbitrate",newKey:"dashjs_video_bitrate"},{oldKey:"dashjs_abitrate",newKey:"dashjs_audio_bitrate"},{oldKey:"dashjs_vsettings",newKey:"dashjs_video_settings"},{oldKey:"dashjs_asettings",newKey:"dashjs_audio_settings"}],li="dashjs_?_bitrate",ui="dashjs_?_settings",ci="localStorage",di="lastBitrate",fi="lastMediaSettings";function hi(e){e=e||{};var t,n,r,i=this.context,s=e.settings;function o(e){if(void 0!==r)return r;var t;r=!1;try{"undefined"!=typeof window&&(t=window[e])}catch(e){return n.warn("DOMStorage access denied: "+e.message),r}if(!t||e!==ci&&"sessionStorage"!==e)return r;try{t.setItem("1","1"),t.removeItem("1"),r=!0}catch(e){n.warn("DOMStorage is supported, but cannot be used: "+e.message)}return r}function l(){var e=6e5;return Math.round((new Date).getTime()/e)*e}function u(e,t){return o(e)&&s.get().streaming[t+"CachingInfo"].enabled}function c(){if(!s)throw new Error(a.Z.MISSING_CONFIG_ERROR)}return t={getSavedBitrateSettings:function(e){if(c(),!s.get().streaming.lastBitrateCachingInfo.enabled)return NaN;var t=NaN;if(u(ci,di)){var r=li.replace(/\?/,e);try{var i=JSON.parse(localStorage.getItem(r))||{},a=(new Date).getTime()-parseInt(i.timestamp,10)>=s.get().streaming.lastBitrateCachingInfo.ttl||!1,o=parseFloat(i.bitrate);isNaN(o)||a?a&&localStorage.removeItem(r):(t=o,n.debug("Last saved bitrate for "+e+" was "+o))}catch(e){return null}}return t},setSavedBitrateSettings:function(e,t){if(u(ci,di)&&t){var r=li.replace(/\?/,e);try{localStorage.setItem(r,JSON.stringify({bitrate:t.toFixed(3),timestamp:l()}))}catch(e){n.error(e.message)}}},getSavedMediaSettings:function(e){if(c(),!s.get().streaming.lastMediaSettingsCachingInfo.enabled)return null;var t=null;if(u(ci,fi)){var n=ui.replace(/\?/,e);try{var r=JSON.parse(localStorage.getItem(n))||{},i=(new Date).getTime()-parseInt(r.timestamp,10)>=s.get().streaming.lastMediaSettingsCachingInfo.ttl||!1;t=r.settings,i&&(localStorage.removeItem(n),t=null)}catch(e){return null}}return t},setSavedMediaSettings:function(e,t){if(u(ci,fi)){var r=ui.replace(/\?/,e);try{localStorage.setItem(r,JSON.stringify({settings:t,timestamp:l()}))}catch(e){n.error(e.message)}}}},n=(0,d.Z)(i).getInstance().getLogger(t),o(ci)&&oi.forEach((function(e){var t=localStorage.getItem(e.oldKey);if(t){localStorage.removeItem(e.oldKey);try{localStorage.setItem(e.newKey,t)}catch(e){n.error(e.message)}}})),t}hi.__dashjs_factory_name="DOMStorage";var pi=c.Z.getSingletonFactory(hi),gi=n(2032),mi=n(2011);function yi(){var e,t,n,r,i,a,s,o,l,u,c,d,f,h=this.context;function p(e,n,i,a){var s=null,l=e?f.resolve(e.path):null,u=a||{init:!0,url:l?l.url:void 0,range:{start:0,end:1500},searching:!1,bytesLoaded:0,bytesToLoad:1500,mediaType:n};t.debug("Start searching for initialization.");var c=v(u);o.load({request:c,success:function(t){if(u.bytesLoaded=u.range.end,!(s=r.findInitRange(t)))return u.range.end=u.bytesLoaded+u.bytesToLoad,p(e,n,i,u);e.range=s,i(e)},error:function(){i(e)}}),t.debug("Perform init search: "+u.url)}function m(e,n,i,a,s,l){if(i&&(void 0===i.start||void 0===i.end)){var u=i?i.toString().split("-"):null;i=u?{start:parseFloat(u[0]),end:parseFloat(u[1])}:null}s=s||y;var c=null,d=null,h=!!i,p=e?f.resolve(e.path):null,g={init:!1,url:p?p.url:void 0,range:h?i:{start:0,end:1500},searching:!h,bytesLoaded:l?l.bytesLoaded:0,bytesToLoad:1500,mediaType:n},_=v(g);o.load({request:_,success:function(i){var o=g.bytesToLoad,l=i.byteLength;if(g.bytesLoaded=g.range.end-g.range.start,c=r.parse(i),(d=c.getBox("sidx"))&&d.isComplete){var u,f,h=d.references;if(null!=h&&h.length>0&&(u=1===h[0].reference_type),u){var p,y,v,_;t.debug("Initiate multiple SIDX load."),g.range.end=g.range.start+d.size;var T=[],E=0,b=(d.offset||g.range.start)+d.size,S=function(t){t?(T=T.concat(t),++E>=y&&(T.sort((function(e,t){return e.startTime-t.startTime<0?-1:0})),s(T,e,a))):s(null,e,a)};for(p=0,y=h.length;p<y;p++)v=b,_=b+h[p].referenced_size-1,b+=h[p].referenced_size,m(e,n,{start:v,end:_},a,S,g)}else t.debug("Parsing segments from SIDX. representation "+n+" - id: "+e.id+" for range : "+g.range.start+" - "+g.range.end),f=function(e,t){for(var n,r,i,a,s=e.references,o=s.length,l=e.timescale,u=e.earliest_presentation_time,c=t.range.start+e.offset+e.first_offset+e.size,d=[],f=0;f<o;f++)i=s[f].subsegment_duration,a=s[f].referenced_size,(n=new mi.Z).duration=i,n.startTime=u,n.timescale=l,r=c+a-1,n.mediaRange=c+"-"+r,d.push(n),u+=i,c+=a;return d}(d,g),s(f,e,a)}else{if(d)g.range.start=d.offset||g.range.start,g.range.end=g.range.start+(d.size||o);else{if(l<g.bytesLoaded)return void s(null,e,a);var A=c.getLastBox();A&&A.size?(g.range.start=A.offset+A.size,g.range.end=g.range.start+o):g.range.end+=o}m(e,n,g.range,a,null,g)}},error:function(){s(null,e,a)}}),t.debug("Perform SIDX load for type ".concat(n," : ").concat(g.url," with range ").concat(g.range.start," - ").concat(g.range.end))}function y(e,t,n){n({segments:e,representation:t,error:e?void 0:new b.Z(l.SEGMENT_BASE_LOADER_ERROR_CODE,l.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}function v(e){if(e.url){var t=new g.Z;return t.setInfo(e),t}}return e={setConfig:function(o){o.baseURLController&&(f=o.baseURLController),o.dashMetrics&&(a=o.dashMetrics),o.mediaPlayerModel&&(s=o.mediaPlayerModel),o.errHandler&&(n=o.errHandler),o.boxParser&&(r=o.boxParser),o.debug&&(t=o.debug.getLogger(e)),o.requestModifier&&(i=o.requestModifier),o.errors&&(l=o.errors),o.urlUtils&&(d=o.urlUtils),o.constants&&(u=o.constants),o.dashConstants&&(c=o.dashConstants)},initialize:function(){o=yt(h).create({errHandler:n,dashMetrics:a,mediaPlayerModel:s,requestModifier:i,boxParser:r,errors:l,urlUtils:d,constants:u,dashConstants:c})},loadInitialization:function(e,t){return new Promise((function(n){p(e,t,n)}))},loadSegments:function(e,t,n){return new Promise((function(r){m(e,t,n,r)}))},reset:function(){o&&(o.abort(),o=null)}}}yi.__dashjs_factory_name="SegmentBaseLoader";var vi=c.Z.getSingletonFactory(yi);function _i(e){var t;e=e||{};var n=new DataView(e.data),r=0;function i(e,t){var i=!0,a=0;if(void 0===t&&(t=!1),e.tag>16777215?(n.getUint32(r)!==e.tag&&(i=!1),a=4):e.tag>65535?(256*n.getUint16(r)+n.getUint8(r+2)!==e.tag&&(i=!1),a=3):e.tag>255?(n.getUint16(r)!==e.tag&&(i=!1),a=2):(n.getUint8(r)!==e.tag&&(i=!1),a=1),!i&&e.required&&!t)throw new Error("required tag not found");return i&&(r+=a),i}function a(e){var t=1,i=128,a=-1,s=0,o=n.getUint8(r),l=0;for(l=0;l<8;l+=1){if((o&i)===i){s=void 0===e?o&~i:o,a=l;break}i>>=1}for(l=0;l<a;l+=1,t+=1)s=s<<8|255&n.getUint8(r+t);return r+=t,s}return t={getPos:function(){return r},setPos:function(e){r=e},consumeTag:i,consumeTagAndSize:function(e,t){var n=i(e,t);return n&&a(),n},parseTag:function(e){var n;return i(e),n=a(),t[e.parse](n)},skipOverElement:function(e,t){var n,s=i(e,t);return s&&(n=a(),r+=n),s},getMatroskaCodedNum:a,getMatroskaFloat:function(e){var t;switch(e){case 4:t=n.getFloat32(r),r+=4;break;case 8:t=n.getFloat64(r),r+=8}return t},getMatroskaUint:function(e){if(e>4)return function(e){for(var t=Math.floor(Number.MAX_SAFE_INTEGER/256),i=0,a=0;a<e;a+=1){if(i>t)throw new Error("Value exceeds safe integer limit");i*=256;var s=n.getUint8(r+a);if(i>Number.MAX_SAFE_INTEGER-s)throw new Error("Value exceeds safe integer limit");i+=s}return r+=e,i}(e);for(var t=0,i=0;i<e;i+=1)t<<=8,t|=255&n.getUint8(r+i);return r+=e,t>>>0},moreData:function(){return r<n.byteLength}}}_i.__dashjs_factory_name="EBMLParser";var Ti=c.Z.getClassFactory(_i);function Ei(){var e,t,n,r,i,s,o,l,u,c,d=this.context;function f(e){var t=new g.Z;return t.setInfo(e),t}return e={setConfig:function(n){if(!(n.baseURLController&&n.dashMetrics&&n.mediaPlayerModel&&n.errHandler))throw new Error(a.Z.MISSING_CONFIG_ERROR);c=n.baseURLController,s=n.dashMetrics,o=n.mediaPlayerModel,r=n.errHandler,u=n.errors,t=n.debug.getLogger(e),i=n.requestModifier},initialize:function(){l=yt(d).create({errHandler:r,dashMetrics:s,mediaPlayerModel:o,requestModifier:i,errors:u})},loadInitialization:function(e,n){return new Promise((function(r){var i=null,a=e?c.resolve(e.path):null,s=e?e.range.split("-"):null,o={range:{start:s?parseFloat(s[0]):null,end:s?parseFloat(s[1]):null},request:i,url:a?a.url:void 0,init:!0,mediaType:n};t.info("Start loading initialization."),i=f(o),l.load({request:i,success:function(){r(e)},error:function(){r(e)}}),t.debug("Perform init load: "+o.url)}))},loadSegments:function(e,r,i){return new Promise((function(a){var s=null,o=e?c.resolve(e.path):null,h=o?o.url:void 0;s=f({bytesLoaded:0,bytesToLoad:8192,range:{start:0,end:8192},request:s,url:h,init:!1,mediaType:r}),t.debug("Parsing ebml header"),l.load({request:s,success:function(r){!function(e,r,i,a){if(e&&0!==e.byteLength){var s,o,u,c,h=Ti(d).create({data:e}),p=i?i.split("-"):null,g=null,m={url:r,range:{start:p?parseFloat(p[0]):null,end:p?parseFloat(p[1]):null},request:g};for(t.debug("Parse EBML header: "+m.url),h.skipOverElement(n.EBML),h.consumeTag(n.Segment),u=h.getMatroskaCodedNum(),u+=h.getPos(),c=h.getPos();h.moreData()&&!h.consumeTagAndSize(n.Segment.Info,!0);)if(!(h.skipOverElement(n.Segment.SeekHead,!0)||h.skipOverElement(n.Segment.Tracks,!0)||h.skipOverElement(n.Segment.Cues,!0)||h.skipOverElement(n.Void,!0)))throw new Error("no valid top level element found");for(;void 0===s;){var y=h.getMatroskaCodedNum(!0),v=h.getMatroskaCodedNum();y===n.Segment.Info.Duration.tag?s=h[n.Segment.Info.Duration.parse](v):h.setPos(h.getPos()+v)}g=f(m),l.load({request:g,success:function(e){o=function(e,r,i,a){var s,o,l,u,c,f,h,p;for(l=[],c=0,f=(o=function(e){var t,r,i=[],a=Ti(d).create({data:e});for(a.consumeTagAndSize(n.Segment.Cues);a.moreData()&&a.consumeTagAndSize(n.Segment.Cues.CuePoint,!0);){for((t={}).CueTime=a.parseTag(n.Segment.Cues.CuePoint.CueTime),t.CueTracks=[];a.moreData()&&a.consumeTag(n.Segment.Cues.CuePoint.CueTrackPositions,!0);){var s=a.getMatroskaCodedNum(),o=a.getPos();if((r={}).Track=a.parseTag(n.Segment.Cues.CuePoint.CueTrackPositions.CueTrack),0===r.Track)throw new Error("Cue track cannot be 0");r.ClusterPosition=a.parseTag(n.Segment.Cues.CuePoint.CueTrackPositions.CueClusterPosition),t.CueTracks.push(r),a.setPos(o+s)}if(0===t.CueTracks.length)throw new Error("Mandatory cuetrack not found");i.push(t)}if(0===i.length)throw new Error("mandatory cuepoint not found");return i}(e)).length;c<f;c+=1)u=new mi.Z,s=c<o.length-1?o[c+1].CueTime-o[c].CueTime:a-o[c].CueTime,u.duration=s,u.startTime=o[c].CueTime,u.timescale=1e3,h=o[c].CueTracks[0].ClusterPosition+r,p=c<o.length-1?o[c+1].CueTracks[0].ClusterPosition+r-1:i-1,u.mediaRange=h+"-"+p,l.push(u);return t.debug("Parsed cues: "+l.length+" cues."),l}(e,c,u,s),a(o)},error:function(){t.error("Download Error: Cues "+m.url),a(null)}}),t.debug("Perform cues load: "+m.url+" bytes="+m.range.start+"-"+m.range.end)}else a(null)}(r,h,i,(function(t){a({segments:t,representation:e,error:t?void 0:new b.Z(u.SEGMENT_BASE_LOADER_ERROR_CODE,u.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}))},error:function(){a({representation:e,error:new b.Z(u.SEGMENT_BASE_LOADER_ERROR_CODE,u.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}})}))},reset:function(){l&&(l.abort(),l=null)}},n={EBML:{tag:440786851,required:!0},Segment:{tag:408125543,required:!0,SeekHead:{tag:290298740,required:!0},Info:{tag:357149030,required:!0,TimecodeScale:{tag:2807729,required:!0,parse:"getMatroskaUint"},Duration:{tag:17545,required:!0,parse:"getMatroskaFloat"}},Tracks:{tag:374648427,required:!0},Cues:{tag:475249515,required:!0,CuePoint:{tag:187,required:!0,CueTime:{tag:179,required:!0,parse:"getMatroskaUint"},CueTrackPositions:{tag:183,required:!0,CueTrack:{tag:247,required:!0,parse:"getMatroskaUint"},CueClusterPosition:{tag:241,required:!0,parse:"getMatroskaUint"}}}}},Void:{tag:236,required:!0}},e}Ei.__dashjs_factory_name="WebmSegmentBaseLoader";var bi=c.Z.getSingletonFactory(Ei);function Si(e){e=e||{};var t,n,r,i=this.context,a=e.eventBus,s=e.events,o=e.dashMetrics,l=e.mediaPlayerModel,u=e.errHandler,c=e.baseURLController,d=e.debug,f=e.boxParser,h=e.requestModifier,p=e.errors;function g(e){return"webm"===(e?e.split("/")[1]:"").toLowerCase()}return t={initialize:function(){n.initialize(),r.initialize()},getSegmentBaseInitSegment:function(e){return g(e.representation.mimeType)?r.loadInitialization(e.representation,e.mediaType):n.loadInitialization(e.representation,e.mediaType)},getSegmentList:function(e){return g(e.mimeType)?r.loadSegments(e.representation,e.mediaType,e.representation?e.representation.indexRange:null):n.loadSegments(e.representation,e.mediaType,e.representation?e.representation.indexRange:null)},reset:function(){n.reset(),r.reset()}},n=vi(i).getInstance(),r=bi(i).getInstance(),n.setConfig({baseURLController:c,dashMetrics:o,mediaPlayerModel:l,errHandler:u,eventBus:a,events:s,errors:p,debug:d,boxParser:f,requestModifier:h}),r.setConfig({baseURLController:c,dashMetrics:o,mediaPlayerModel:l,errHandler:u,eventBus:a,events:s,errors:p,debug:d,requestModifier:h}),t}Si.__dashjs_factory_name="SegmentBaseController";var Ai=c.Z.getSingletonFactory(Si),wi=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.quality=null,this.fragmentDuration=null,this.mediaInfo=null,this.MSETimeOffset=null},Ii=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=null,this.type=null,this.streamInfo=null,this.representationCount=0,this.labels=null,this.lang=null,this.viewpoint=null,this.viewpointsWithSchemeIdUri=null,this.accessibility=null,this.accessibilitiesWithSchemeIdUri=null,this.audioChannelConfiguration=null,this.audioChannelConfigurationsWithSchemeIdUri=null,this.roles=null,this.rolesWithSchemeIdUri=null,this.codec=null,this.mimeType=null,this.contentProtection=null,this.isText=!1,this.KID=null,this.bitrateList=null,this.isFragmented=null,this.isEmbedded=null,this.selectionPriority=1,this.supplementalProperties={},this.supplementalPropertiesAsArray=[],this.essentialProperties={},this.essentialPropertiesAsArray=[],this.segmentAlignment=!1,this.subSegmentAlignment=!1},Ci=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=null,this.start=NaN,this.duration=NaN,this.manifestInfo=null,this.isLast=!0},Ri=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.dvrWindowSize=NaN,this.loadedTime=null,this.availableFrom=null,this.minBufferTime=NaN,this.duration=NaN,this.isDynamic=!1,this.maxFragmentDuration=null,this.serviceDescriptions=[],this.protocol=null};var Di=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.valid="/"==t[0],this.path=t.split("/").filter((function(e){return 0!==e.length})).map((function(e){var t={name:e},r=e.indexOf("[");if(-1!=r){t.name=e.substring(0,r);var i=e.substring(r+1,e.length-1);n.valid=n.valid&&-1==i.indexOf("[");var a=i.indexOf("=");-1!=a?(t.attribute={name:i.substring(1,a),value:i.substring(a+1)},-1!=["'",'"'].indexOf(t.attribute.value[0])&&(t.attribute.value=t.attribute.value.substring(1,t.attribute.value.length-1))):t.position=parseInt(i,10)-1}return t}))}var t;return(t=[{key:"isValid",value:function(){return this.valid}},{key:"findsElement",value:function(){return!this.findsAttribute()}},{key:"findsAttribute",value:function(){return this.path[this.path.length-1].name.startsWith("@")}},{key:"findsTextReplace",value:function(){return"text()"===this.path[this.path.length-1].name}},{key:"getMpdTarget",value:function(e,t){for(var n=null,r=e,i=1,a="MPD";i<this.path.length&&null!==r;){n=r;var s=this.path[i];if(a=s.name,i!==this.path.length-1||!a.startsWith("@")&&"text()"!==a){var o=n[a+"_asArray"]||[];0===o.length&&n[a]&&o.push(n[a]),s.position?r=o[s.position]||null:s.attribute?function(){var e=s.attribute;r=o.filter((function(t){return t[e.name]==e.value}))[0]||null}():r=o[0]||null}i++}return null===r?null:a.startsWith("@")?{name:a.substring(1),leaf:r,target:r}:"text()"===a?{name:"__text",leaf:r,target:r}:{name:a,leaf:r,target:t?n:r}}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();var Ni=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.action=t,this.xpath=n,this.value=r,this.position=null}var t;return(t=[{key:"getMpdTarget",value:function(e){var t="remove"===this.action||"replace"===this.action||"before"===this.position||"after"===this.position;return this.xpath.getMpdTarget(e,t)}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();function Oi(){var e,t,n=this.context;return e={getIsPatch:function(e){return e&&e.hasOwnProperty(s.Z.ORIGINAL_MPD_ID)||!1},getPublishTime:function(e){return e&&e.hasOwnProperty(s.Z.PUBLISH_TIME)?new Date(e[s.Z.PUBLISH_TIME]):null},getOriginalPublishTime:function(e){return e&&e.hasOwnProperty(s.Z.ORIGINAL_PUBLISH_TIME)?new Date(e[s.Z.ORIGINAL_PUBLISH_TIME]):null},getMpdId:function(e){return e&&e[s.Z.ORIGINAL_MPD_ID]||null},getPatchOperations:function(e){return e?(e.__children||[]).map((function(e){var n=Object.keys(e)[0];if("add"!==n&&"remove"!==n&&"replace"!==n)return t.warn("Ignoring node of invalid action: ".concat(n)),null;var r=e[n],i=r.sel;if("add"===n&&r.type){if(!r.type.startsWith("@"))return t.warn("Ignoring add action for prefixed namespace declaration: ".concat(r.type,"=").concat(r.__text)),null;i="".concat(i,"/").concat(r.type)}var a=new Di(i);if(!a.isValid())return t.warn("Ignoring action with invalid selector: ".concat(n," - ").concat(i)),null;var s=null;a.findsAttribute()||a.findsTextReplace()?s=r.__text||"":"remove"!==n&&(s=r.__children.reduce((function(e,t){var n=Object.keys(t)[0];return"#text"!==n&&(e[n]=e[n]||[],e[n].push(t[n])),e}),{}));var o=new Ni(n,a,s);return"add"===n&&(o.position=r.pos),o})).filter((function(e){return!!e})):[]}},t=(0,d.Z)(n).getInstance().getLogger(e),e}Oi.__dashjs_factory_name="PatchManifestModel";var Pi=c.Z.getSingletonFactory(Oi);function Mi(){var e,t,n,r,i,a,o,l=this.context;function u(e,n,a){var o,l=t.getAdaptationsForType(r[0].mpd.manifest,e,n);if(!l||0===l.length)return null;if(l.length>1&&a){var u=f(a,n);if(i[a.id]&&i[a.id][n])for(var d=0,h=l.length;d<h;d++)if(c(i[a.id][n],u[d]))return l[d];for(var p=0,g=l.length;p<g;p++)if(o=l[p],t.getRolesForAdaptation(o).filter((function(e){return e.value===s.Z.MAIN}))[0])return l[p]}return l[0]}function c(e,t){if(!e||!t)return!1;var n=e.id===t.id,r=e.codec===t.codec,i=e.viewpoint===t.viewpoint,a=JSON.stringify(e.viewpointsWithSchemeIdUri)===JSON.stringify(t.viewpointsWithSchemeIdUri),s=e.lang===t.lang,o=e.roles.toString()===t.roles.toString(),l=JSON.stringify(e.rolesWithSchemeIdUri)===JSON.stringify(t.rolesWithSchemeIdUri),u=e.accessibility.toString()===t.accessibility.toString(),c=JSON.stringify(e.accessibilitiesWithSchemeIdUri)===JSON.stringify(t.accessibilitiesWithSchemeIdUri),d=e.audioChannelConfiguration.toString()===t.audioChannelConfiguration.toString(),f=JSON.stringify(e.audioChannelConfigurationsWithSchemeIdUri)===JSON.stringify(t.audioChannelConfigurationsWithSchemeIdUri);return n&&r&&i&&a&&s&&o&&l&&u&&c&&d&&f}function d(e,n,r,i,s,o){var l,u,c,d,f,h,p=[];if(!i||0===i.length)return[];var g=t.getAdaptationsForPeriod(n);for(d=0,h=i.length;d<h;d++)if(l=i[d],u=_(g[c=t.getIndexForAdaptation(l,e,r.index)]),o){var m=u.accessibility.length;for(f=0;f<m;f++)if(u){var y=u.accessibility[f];if(0===y.indexOf("cea-608:")){var v=y.substring(8).split(";");if("CC"===v[0].substring(0,2))for(f=0;f<v.length;f++)u||(u=_.call(this,g[c])),T(u,v[f].substring(0,3),v[f].substring(4)),p.push(u),u=null;else for(f=0;f<v.length;f++)u||(u=_.call(this,g[c])),T(u,"CC"+(f+1),v[f]),p.push(u),u=null}else 0===y.indexOf("cea-608")&&(T(u,a.CC1,"eng"),p.push(u),u=null)}}else s===a.IMAGE?(u.type=a.IMAGE,p.push(u),u=null):u&&p.push(u);return p}function f(e,n,i){var s=r,o=i,l=[];if(o)b(),s=h(o);else{if(!(r.length>0))return l;o=r[0].mpd.manifest}var u=v(e,s),c=t.getAdaptationsForType(o,e?e.index:null,n);return l=d(o,u,e,c,n),n===a.TEXT&&(c=t.getAdaptationsForType(o,e?e.index:null,a.VIDEO),l=l.concat(d(o,u,e,c,n,!0))),l}function h(e){var n=p(e);return t.getRegularPeriods(n)}function p(e){var n=m(e);return t.getMpd(n)}function g(){r=[],i={}}function m(e){return e||(r.length>0?r[0].mpd.manifest:null)}function y(e){try{var n=v(e.streamInfo,r),i=t.getAdaptationsForPeriod(n);return e&&e.streamInfo&&void 0!==e.streamInfo.id&&i?i[e.index]:null}catch(e){return null}}function v(e,t){for(var n=t.length,r=0;r<n;r++){var i=t[r];if(e&&e.id===i.id)return i}return null}function _(e){if(!e)return null;var n,r,i,a,s,l=new Ii,u=e.period.mpd.manifest.Period_asArray[e.period.index].AdaptationSet_asArray[e.index];if(l.id=e.id,l.index=e.index,l.type=e.type,l.streamInfo=E(e.period),l.representationCount=t.getRepresentationCount(u),l.labels=t.getLabelsForAdaptation(u),l.lang=t.getLanguageForAdaptation(u),l.segmentAlignment=t.getSegmentAlignment(u),l.subSegmentAlignment=t.getSubSegmentAlignment(u),n=t.getViewpointForAdaptation(u),l.viewpoint=n.length?n[0].value:void 0,l.viewpointsWithSchemeIdUri=n,s=t.getAccessibilityForAdaptation(u),l.accessibility=s.map((function(e){var t=e.value,n=t;return e.schemeIdUri&&e.schemeIdUri.search("cea-608")>=0&&void 0!==o&&(n=t?"cea-608:"+t:"cea-608",l.embeddedCaptions=!0),n})),l.accessibilitiesWithSchemeIdUri=s,r=t.getAudioChannelConfigurationForAdaptation(u),l.audioChannelConfiguration=r.map((function(e){return e.value})),l.audioChannelConfigurationsWithSchemeIdUri=r,0===l.audioChannelConfiguration.length&&Array.isArray(u.Representation_asArray)&&u.Representation_asArray.length>0&&(i=t.getAudioChannelConfigurationForRepresentation(u.Representation_asArray[0]),l.audioChannelConfiguration=i.map((function(e){return e.value})),l.audioChannelConfigurationsWithSchemeIdUri=i),a=t.getRolesForAdaptation(u),l.roles=a.map((function(e){return e.value})),l.rolesWithSchemeIdUri=a,l.codec=t.getCodec(u),l.mimeType=t.getMimeType(u),l.contentProtection=t.getContentProtectionData(u),l.bitrateList=t.getBitrateListForAdaptation(u),l.selectionPriority=t.getSelectionPriority(u),l.contentProtection){var c=l.contentProtection.map((function(e){return t.getKID(e)})).filter((function(e){return null!==e}));if(c.length){var d=c[0];l.contentProtection.forEach((function(e){e.keyId=d}))}}if(l.isText=t.getIsText(u),l.supplementalProperties=t.getSupplementalPropertiesForAdaptation(u),(!l.supplementalProperties||0===Object.keys(l.supplementalProperties).length)&&Array.isArray(u.Representation_asArray)&&u.Representation_asArray.length>0){var f=u.Representation_asArray.map((function(e){return t.getSupplementalPropertiesForRepresentation(e)}));f.every((function(e){return JSON.stringify(e)===JSON.stringify(f[0])}))&&(l.supplementalProperties=f[0])}if(l.supplementalPropertiesAsArray=t.getSupplementalPropertiesAsArrayForAdaptation(u),(!l.supplementalPropertiesAsArray||0===l.supplementalPropertiesAsArray.length)&&Array.isArray(u.Representation_asArray)&&u.Representation_asArray.length>0){var h=u.Representation_asArray.map((function(e){return t.getSupplementalPropertiesAsArrayForRepresentation(e)}));h.every((function(e){return JSON.stringify(e)===JSON.stringify(h[0])}))&&(l.supplementalPropertiesAsArray=h[0])}return l.essentialProperties=t.getEssentialPropertiesForAdaptation(u),l.essentialPropertiesAsArray=t.getEssentialPropertiesAsArrayForAdaptation(u),l.isFragmented=t.getIsFragmented(u),l.isEmbedded=!1,l}function T(e,t,n){e.id=t,e.index=100+parseInt(t.substring(2,3)),e.type=a.TEXT,e.codec="cea-608-in-SEI",e.isEmbedded=!0,e.isFragmented=!1;var r=pn()(n);e.lang=r||n,e.roles=["caption"],e.rolesWithSchemeIdUri=[{schemeIdUri:"urn:mpeg:dash:role:2011",value:"caption"}]}function E(e){var n,r,i=new Ci;return i.id=e.id,i.index=e.index,i.start=e.start,i.duration=e.duration,i.manifestInfo=(n=e.mpd,(r=new Ri).dvrWindowSize=n.timeShiftBufferDepth,r.loadedTime=n.manifest.loadedTime,r.availableFrom=n.availabilityStartTime,r.minBufferTime=n.manifest.minBufferTime,r.maxFragmentDuration=n.maxSegmentDuration,r.duration=t.getDuration(n.manifest),r.isDynamic=t.getIsDynamic(n.manifest),r.serviceDescriptions=t.getServiceDescriptions(n.manifest),r.protocol=n.manifest.protocol,r),i.isLast=1===e.mpd.manifest.Period_asArray.length||Math.abs(i.start+i.duration-i.manifestInfo.duration)<1,i}function b(){if(!a)throw new Error("setConfig function has to be called previously")}function S(e){return r.length>0?r[0].mpd.manifest.Period_asArray[e]:null}function A(e,t,n){var r,i,a,s,o;if(e)for(r=e.AdaptationSet_asArray,s=0;s<r.length;s+=1)for(a=r[s].Representation_asArray,o=0;o<a.length;o+=1)if(t===(i=a[o]).id)return n?o:i;return null}return e={getBandwidthForRepresentation:function(e,t){var n;return(n=A(S(t),e))?n.bandwidth:null},getIndexForRepresentation:function(e,t){return function(e,t){var n=A(e,t,!0);return null!==n?n:-1}(S(t),e)},getMaxIndexForBufferType:function(e,n){return function(e,n){var r,i,a,s;if(!e||!n)return-1;for(i=e.AdaptationSet_asArray,s=0;s<i.length;s+=1)if(a=(r=i[s]).Representation_asArray,t.getIsTypeOf(r,n))return a.length;return-1}(S(n),e)},convertRepresentationToRepresentationInfo:function(e){if(e){var n=new wi,r=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index],i=t.getRepresentationFor(e.index,r);return n.id=e.id,n.quality=e.index,n.bandwidth=t.getBandwidth(i),n.fragmentDuration=e.segmentDuration||(e.segments&&e.segments.length>0?e.segments[0].duration:NaN),n.MSETimeOffset=e.MSETimeOffset,n.mediaInfo=_(e.adaptation),n}return null},getStreamsInfo:function(e,t){var n=[],i=r;if(e&&(b(),i=h(e)),i.length>0){(!t||t>i.length)&&(t=i.length);for(var a=0;a<t;a++)n.push(E(i[a]))}return n},getMediaInfoForType:function(e,n){if(0===r.length||!e)return null;var i=v(e,r);if(!i)return null;var a=t.getAdaptationsForPeriod(i),s=u(e.index,n,e);return s?_(a[t.getIndexForAdaptation(s,r[0].mpd.manifest,e.index)]):null},getAllMediaInfoForType:f,getAdaptationForType:u,getRealAdaptation:function(e,n){var i,a,s=v(e,r);return i=n?n.id:null,r.length>0&&s&&(a=i?t.getAdaptationForId(i,r[0].mpd.manifest,s.index):t.getAdaptationForIndex(n?n.index:null,r[0].mpd.manifest,s.index)),a},getProducerReferenceTimes:function(e,n){var i,a,s=v(e,r);return i=n?n.id:null,r.length>0&&s&&(a=i?t.getAdaptationForId(i,r[0].mpd.manifest,s.index):t.getAdaptationForIndex(n?n.index:null,r[0].mpd.manifest,s.index)),a?t.getProducerReferenceTimesForAdaptation(a):[]},getRealPeriodByIndex:function(e){return t.getRealPeriodForIndex(e,r[0].mpd.manifest)},getEssentialPropertiesForRepresentation:function(e){try{return t.getEssentialPropertiesForRepresentation(e)}catch(e){return[]}},getVoRepresentations:function(e){var n=y(e);return t.getRepresentationsForAdaptation(n)},getEventsFor:function(e,n,i){var a=[];if(r.length>0){var s=r[0].mpd.manifest;if(e instanceof Ci){var o=v(e,r);a=t.getEventsForPeriod(o)}else if(e instanceof Ii){var l=v(i,r);a=t.getEventStreamForAdaptationSet(s,y(e),l)}else if(e instanceof wi){var u=v(i,r);a=t.getEventStreamForRepresentation(s,n,u)}}return a},getEvent:function(e,t,n,r){try{if(!e||!t||isNaN(n)||!r)return null;var i=e.scheme_id_uri,a=e.value;if(!t[i+"/"+a])return null;var s,o=new ve,l=e.timescale||1,u=r.adaptation.period.start,c=t[i+"/"+a],d=isNaN(r.presentationTimeOffset)?isNaN(c.presentationTimeOffset)?0:c.presentationTimeOffset:r.presentationTimeOffset,f=e.presentation_time_delta/l;s=0===e.version?u+n-d+f:u-d+f;var h=e.event_duration/l,p=e.id,g=e.message_data;return o.eventStream=c,o.eventStream.value=a,o.eventStream.timescale=l,o.duration=h,o.id=p,o.calculatedPresentationTime=s,o.messageData=g,o.presentationTimeDelta=f,o}catch(e){return null}},getMpd:p,setConfig:function(e){e&&(e.constants&&(a=e.constants),e.cea608parser&&(o=e.cea608parser),e.errHandler&&t.setConfig({errHandler:e.errHandler}),e.BASE64&&t.setConfig({BASE64:e.BASE64}))},updatePeriods:function(e){if(!e)return null;b(),r=h(e)},getIsTextTrack:function(e){return t.getIsText(e)},getUTCTimingSources:function(){var e=m();return t.getUTCTimingSources(e)},getSuggestedPresentationDelay:function(){var e=r.length>0?r[0].mpd:null;return t.getSuggestedPresentationDelay(e)},getAvailabilityStartTime:function(e){var n=p(e);return t.getAvailabilityStartTime(n)},getIsTypeOf:function(e,n){return t.getIsTypeOf(e,n)},getIsDynamic:function(e){var n=m(e);return t.getIsDynamic(n)},getDuration:function(e){var n=m(e);return t.getDuration(n)},getRegularPeriods:h,getContentSteering:function(e){return t.getContentSteering(e)},getLocation:function(e){return t.getLocation(e)},getPatchLocation:function(e){var n=t.getPatchLocation(e),r=t.getPublishTime(e);return n&&0!==n.length&&r?n.filter((function(e){return isNaN(e.ttl)||r.getTime()+e.ttl>(new Date).getTime()})):[]},getManifestUpdatePeriod:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.getManifestUpdatePeriod(e,n)},getPublishTime:function(e){return t.getPublishTime(e)},getIsDVB:function(e){return t.hasProfile(e,"urn:dvb:dash:profile:dvb-dash:2014")},getIsPatch:function(e){return n.getIsPatch(e)},getBaseURLsFromElement:function(e){return t.getBaseURLsFromElement(e)},getRepresentationSortFunction:function(){return t.getRepresentationSortFunction()},getCodec:function(e,n,r){return t.getCodec(e,n,r)},getPeriodById:function(e){if(!e||0===r.length)return null;var t=r.filter((function(t){return t.id===e}));return t&&t.length>0?t[0]:null},setCurrentMediaInfo:function(e,t,n){i[e]=i[e]||{},i[e][t]=i[e][t]||{},i[e][t]=n},isPatchValid:function(e,r){var i=t.getId(e),a=n.getMpdId(r),s=t.getPublishTime(e),o=n.getPublishTime(r),l=n.getOriginalPublishTime(r);return!!(i&&a&&i==a&&s&&l&&s.getTime()==l.getTime()&&o&&s.getTime()<o.getTime())},applyPatchToManifest:function(e,t){n.getPatchOperations(t).forEach((function(t){var n=t.getMpdTarget(e);if(null!==n){var r=n.name,i=n.target,a=n.leaf;if(t.xpath.findsAttribute()||"__text"===r)switch(t.action){case"add":case"replace":i[r]=t.value;break;case"remove":delete i[r]}else{var s=(i[r+"_asArray"]||[]).indexOf(a),o="prepend"===t.position||"before"===t.position;if(("remove"===t.action||"replace"===t.action)&&(delete i[r],-1!=s)){var l=i[r+"_asArray"];l.splice(s,1),l.length>1?i[r]=l:1==l.length?i[r]=l[0]:delete i[r+"_asArray"]}"add"!==t.action&&"replace"!==t.action||Object.keys(t.value).forEach((function(e){var n=t.value[e],a=i[e+"_asArray"]||[];if(0===a.length&&i[e]&&a.push(i[e]),0===a.length)a=n;else{var l=a.length;l=e==r&&-1!=s?s+(o?0:1)+("replace"==t.action?-1:0):o?0:a.length,a.splice.apply(a,[l,0].concat(n))}i[e+"_asArray"]=a,i[e]=1==a.length?a[0]:a}))}}}))},areMediaInfosEqual:c,reset:g},t=Be(l).getInstance(),n=Pi(l).getInstance(),g(),e}Mi.__dashjs_factory_name="DashAdapter";var xi=c.Z.getSingletonFactory(Mi);var Li=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t;return t=[{key:"round10",value:function(e,t){return function(e,t,n){return void 0===n||0==+n?Math[e](t):(n=+n,null===(t=+t)||isNaN(t)||"number"!=typeof n||n%1!=0?NaN:(t=t.toString().split("e"),+((t=(t=Math[e](+(t[0]+"e"+(t[1]?+t[1]-n:-n)))).toString().split("e"))[0]+"e"+(t[1]?+t[1]+n:n))))}("round",e,t)}}],t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e,t),e}(),ki=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.TcpList=[],this.HttpList=[],this.RepSwitchList=[],this.BufferLevel=[],this.BufferState=[],this.PlayList=[],this.DroppedFrames=[],this.SchedulingInfo=[],this.DVRInfo=[],this.ManifestUpdate=[],this.RequestsQueue=null,this.DVBErrors=[]},Fi=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.mt=null,this.to=null,this.lto=null},Ui=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.level=null},Bi=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.target=null,this.state=o.Z.BUFFER_EMPTY},ji=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.time=null,this.range=null,this.manifestInfo=null},qi=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.time=null,this.droppedFrames=null};function Hi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Gi=function e(){Hi(this,e),this.mediaType=null,this.type=null,this.requestTime=null,this.fetchTime=null,this.availabilityStartTime=null,this.presentationStartTime=0,this.clientTimeOffset=0,this.currentTime=null,this.buffered=null,this.latency=0,this.streamInfo=[],this.representationInfo=[]},Vi=function e(){Hi(this,e),this.id=null,this.index=null,this.start=null,this.duration=null},Yi=function e(){Hi(this,e),this.id=null,this.index=null,this.mediaType=null,this.streamIndex=null,this.presentationTimeOffset=null,this.startNumber=null,this.fragmentInfoType=null},Zi=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mediaType=null,this.t=null,this.type=null,this.startTime=null,this.availabilityStartTime=null,this.duration=null,this.quality=null,this.range=null,this.state=null},Ki=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.loadingRequests=[],this.executedRequests=[]};function zi(e){var t,n,r=(e=e||{}).settings,i=this.context,s=(0,l.Z)(i).getInstance();function c(){s.trigger(u.Z.METRICS_CHANGED)}function d(e){s.trigger(u.Z.METRIC_CHANGED,{mediaType:e}),c()}function f(e,t,n){s.trigger(u.Z.METRIC_UPDATED,{mediaType:e,metric:t,value:n}),d(e)}function h(e,t,n){s.trigger(u.Z.METRIC_ADDED,{mediaType:e,metric:t,value:n}),d(e)}function p(e,t){var r=null;return e?(n.hasOwnProperty(e)?r=n[e]:t||(r=new ki,n[e]=r),r):r}function g(e,t,n){var i=p(e);null!==i&&(i[t].push(n),i[t].length>r.get().streaming.metrics.maxListDepth&&i[t].shift())}function m(e,t,n){g(e,t,n),h(e,t,n)}return t={clearCurrentMetricsForType:function(e){delete n[e],d(e)},clearAllCurrentMetrics:function(){n={},c()},getMetricsFor:p,addHttpRequest:function e(t,n,r,i,a,s,l,u,c,d,f,h,p,g,y,v,_){var T=new R.w;null!=s&&s!==i&&(e(t,null,r,i,a,null,null,u,c,null,null,null,p,null,null,v,_),T.actualurl=s),T.tcpid=n,T.type=r,T.url=i,T.range=u,T.trequest=c,T.tresponse=d,T.responsecode=h,T.cmsd=_,T._tfinish=f,T._stream=t,T._mediaduration=p,T._quality=a,T._responseHeaders=g,T._serviceLocation=l,T._fileLoaderType=v,y?y.forEach((function(e){!function(e,t,n,r){var i=new R.O;i.s=t,i.d=n,i.b=r,e.trace.push(i),e.interval||(e.interval=0),e.interval+=n}(T,e.s,e.d,e.b)})):(delete T.interval,delete T.trace),m(t,o.Z.HTTP_REQUEST,T)},addRepresentationSwitch:function(e,t,n,r,i){var a=new Fi;a.t=t,a.mt=n,a.to=r,i?a.lto=i:delete a.lto,m(e,o.Z.TRACK_SWITCH,a)},addBufferLevel:function(e,t,n){var r=new Ui;r.t=t,r.level=n,m(e,o.Z.BUFFER_LEVEL,r)},addBufferState:function(e,t,n){var r=new Bi;r.target=n,r.state=t,m(e,o.Z.BUFFER_STATE,r)},addDVRInfo:function(e,t,n,r){var i=new ji;i.time=t,i.range=r,i.manifestInfo=n,m(e,o.Z.DVR_INFO,i)},addDroppedFrames:function(e,t){var n=new qi,r=p(e).DroppedFrames;t&&(n.time=t.creationTime,n.droppedFrames=t.droppedVideoFrames,r.length>0&&r[r.length-1]==n||m(e,o.Z.DROPPED_FRAMES,n))},addSchedulingInfo:function(e,t,n,r,i,a,s,l,u){var c=new Zi;c.mediaType=e,c.t=t,c.type=n,c.startTime=r,c.availabilityStartTime=i,c.duration=a,c.quality=s,c.range=l,c.state=u,m(e,o.Z.SCHEDULING_INFO,c)},addRequestsQueue:function(e,t,n){var r=new Ki;r.loadingRequests=t,r.executedRequests=n,p(e).RequestsQueue=r,h(e,o.Z.REQUESTS_QUEUE,r)},addManifestUpdate:function(e,t,n,r,i,s,l,u,c,d){var f=new Gi;f.mediaType=e,f.type=t,f.requestTime=n,f.fetchTime=r,f.availabilityStartTime=i,f.presentationStartTime=s,f.clientTimeOffset=l,f.currentTime=u,f.buffered=c,f.latency=d,g(a.Z.STREAM,o.Z.MANIFEST_UPDATE,f),h(e,o.Z.MANIFEST_UPDATE,f)},updateManifestUpdateInfo:function(e,t){if(e){for(var n in t)e[n]=t[n];f(e.mediaType,o.Z.MANIFEST_UPDATE,e)}},addManifestUpdateStreamInfo:function(e,t,n,r,i){if(e){var a=new Vi;a.id=t,a.index=n,a.start=r,a.duration=i,e.streamInfo.push(a),f(e.mediaType,o.Z.MANIFEST_UPDATE_STREAM_INFO,e)}},addManifestUpdateRepresentationInfo:function(e,t,n,r,i,a,s,l){if(e&&e.representationInfo){var u=new Yi;u.id=t,u.index=n,u.streamIndex=r,u.mediaType=i,u.startNumber=s,u.fragmentInfoType=l,u.presentationTimeOffset=a,e.representationInfo.push(u),f(e.mediaType,o.Z.MANIFEST_UPDATE_TRACK_INFO,e)}},addPlayList:function(e){e.trace&&Array.isArray(e.trace)?e.trace.forEach((function(e){e.hasOwnProperty("subreplevel")&&!e.subreplevel&&delete e.subreplevel})):delete e.trace,m(a.Z.STREAM,o.Z.PLAY_LIST,e)},addDVBErrors:function(e){m(a.Z.STREAM,o.Z.DVB_ERRORS,e)}},n={},t}zi.__dashjs_factory_name="MetricsModel";var Wi=c.Z.getSingletonFactory(zi);function Xi(e){e=e||{};var t,n,r,i,s=this.context,l=e.metricsModel;function u(e){var t=l.getMetricsFor(e,!0);if(!t)return null;var n,r=t.HttpList,i=null;if(!r||r.length<=0)return null;for(n=r.length-1;n>=0;){if(r[n].responsecode){i=r[n];break}n--}return i}function c(e){var t=l.getMetricsFor(e,!0);return t&&t.HttpList?t.HttpList:[]}function d(e,t){if(!e)return null;var n=e[t];return n&&0!==n.length?n[n.length-1]:null}return t={getCurrentRepresentationSwitch:function(e){return d(l.getMetricsFor(e,!0),o.Z.TRACK_SWITCH)},getCurrentBufferState:function(e){return d(l.getMetricsFor(e,!0),o.Z.BUFFER_STATE)},getCurrentBufferLevel:function(e){var t=d(l.getMetricsFor(e,!0),o.Z.BUFFER_LEVEL);return t?Li.round10(t.level/1e3,-3):0},getCurrentHttpRequest:u,getHttpRequests:c,getCurrentDroppedFrames:function(){return d(l.getMetricsFor(a.Z.VIDEO,!0),o.Z.DROPPED_FRAMES)},getCurrentSchedulingInfo:function(e){return d(l.getMetricsFor(e,!0),o.Z.SCHEDULING_INFO)},getCurrentDVRInfo:function(e){return d(e?l.getMetricsFor(e,!0):l.getMetricsFor(a.Z.VIDEO,!0)||l.getMetricsFor(a.Z.AUDIO,!0),o.Z.DVR_INFO)},getCurrentManifestUpdate:function(){return d(l.getMetricsFor(a.Z.STREAM),o.Z.MANIFEST_UPDATE)},getLatestFragmentRequestHeaderValueByID:function(e,t){if(!t)return null;var n={},r=u(e);r&&(n=je.Z.parseHttpHeaders(r._responseHeaders));var i=n[t.toLowerCase()];return void 0===i?null:i},getLatestMPDRequestHeaderValueByID:function(e){if(!e)return null;var t,n,r,i={};for(r=(t=c(a.Z.STREAM)).length-1;r>=0;r--)if((n=t[r]).type===R.w.MPD_TYPE){i=je.Z.parseHttpHeaders(n._responseHeaders);break}var s=i[e.toLowerCase()];return void 0===s?null:s},addRepresentationSwitch:function(e,t,n,r,i){l.addRepresentationSwitch(e,t,n,r,i)},addDVRInfo:function(e,t,n,r){l.addDVRInfo(e,t,n,r)},updateManifestUpdateInfo:function(e){var t=this.getCurrentManifestUpdate();l.updateManifestUpdateInfo(t,e)},addManifestUpdateStreamInfo:function(e){if(e){var t=this.getCurrentManifestUpdate();l.addManifestUpdateStreamInfo(t,e.id,e.index,e.start,e.duration)}},addManifestUpdateRepresentationInfo:function(e,t){if(e){var n=this.getCurrentManifestUpdate();l.addManifestUpdateRepresentationInfo(n,e.id,e.index,e.streamIndex,t,e.presentationTimeOffset,e.startNumber,e.fragmentInfoType)}},addManifestUpdate:function(e){l.addManifestUpdate(a.Z.STREAM,e.type,e.requestStartDate,e.requestEndDate)},addHttpRequest:function(e,t,n,r,i,a){l.addHttpRequest(e.mediaType,null,e.type,e.url,e.quality,t,e.serviceLocation||null,e.range||null,e.requestStartDate,e.firstByteDate,e.requestEndDate,n,e.duration,r,i,e.fileLoaderType,a)},addSchedulingInfo:function(e,t){l.addSchedulingInfo(e.mediaType,new Date,e.type,e.startTime,e.availabilityStartTime,e.duration,e.quality,e.range,t)},addRequestsQueue:function(e,t,n){l.addRequestsQueue(e,t,n)},addBufferLevel:function(e,t,n){l.addBufferLevel(e,t,n)},addBufferState:function(e,t,n){l.addBufferState(e,t,n)},addDroppedFrames:function(e){l.addDroppedFrames(a.Z.VIDEO,e)},addPlayList:function(){i&&(l.addPlayList(i),i=null)},addDVBErrors:function(e){l.addDVBErrors(e)},createPlaylistMetrics:function(e,t){(i=new Q).start=new Date,i.mstart=e,i.starttype=t},createPlaylistTraceMetrics:function(e,t,i){!0===n&&(n=!1,(r=new J).representationid=e,r.start=new Date,r.mstart=t,r.playbackspeed=null!==i?i.toString():null)},updatePlayListTraceMetrics:function(e){if(r)for(var t in r)r[t]=e[t]},pushPlayListTraceMetrics:function(e,t){if(!1===n&&i&&r&&r.start){var a=r.start,s=e.getTime()-a.getTime();r.duration=s,r.stopreason=t,i.trace.push(r),n=!0}},clearAllCurrentMetrics:function(){l.clearAllCurrentMetrics()}},l=l||Wi(s).getInstance({settings:e.settings}),n=!0,r=null,i=null,t}Xi.__dashjs_factory_name="DashMetrics";var $i=c.Z.getSingletonFactory(Xi);function Qi(){var e,t,n,r,i=this.context,o=(0,l.Z)(i).getInstance(),c=(0,C.Z)(i).getInstance();function d(e){r=e}function h(e,t,n,r){var i,a=t.adaptation.period.mpd,s=a.availabilityStartTime;if(r)i=n&&a.timeShiftBufferDepth!==Number.POSITIVE_INFINITY?new Date(s.getTime()+1e3*(e+a.timeShiftBufferDepth)):a.availabilityEndTime;else if(n){var o=t.availabilityTimeOffset;i=new Date(s.getTime()+1e3*(e-o))}else i=s;return i}function p(e,t){return(e.getTime()-t.mpd.availabilityStartTime.getTime()+1e3*r)/1e3}function g(e,t){return e+(t.adaptation.period.start-t.presentationTimeOffset)}function m(e){var n={start:NaN,end:NaN},r=e[0].getAdapter().getRegularPeriods()[0],i=p(new Date,r);if(!e||0===e.length)return{range:n,now:i};e.forEach((function(e){var r=e.getAdapter(),o=r.getMediaInfoForType(e.getStreamInfo(),a.Z.VIDEO)||r.getMediaInfoForType(e.getStreamInfo(),a.Z.AUDIO),l=r.getVoRepresentations(o)[0],u={start:NaN,end:NaN};if(l)if(l.segmentInfoType===s.Z.SEGMENT_TIMELINE)u=function(e){var n,r,i,a,s=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index],o=t.getRepresentationFor(e.index,s),l=o.SegmentTemplate||o.SegmentList,u=l.SegmentTimeline,c=l.timescale,d=u.S_asArray,f={start:0,end:0},h=d[0].t,p=!isNaN(h),m=p?h:0,y=0;for(p&&(f.start=g(m/c,e)),i=0,a=d.length;i<a;i++)r=0,(n=d[i]).hasOwnProperty("r")&&(r=n.r),y+=n.d*(1+r);return f.end=g((m+y)/c,e),f}(l);else{var c=l.adaptation.period;u.start=c.start,u.end=Math.max(i,c.start+c.duration)}!isNaN(u.start)&&(isNaN(n.start)||n.start>u.start)&&(n.start=u.start),!isNaN(u.end)&&(isNaN(n.end)||n.end<u.end)&&(n.end=u.end)})),n.end=Math.min(i,n.end);var o=v(e,n.end,!0);return n.end=isNaN(o)?n.end:o,n.start=r&&r.mpd&&r.mpd.timeShiftBufferDepth&&!isNaN(r.mpd.timeShiftBufferDepth)&&!isNaN(n.end)?Math.max(n.end-r.mpd.timeShiftBufferDepth,n.start):n.start,n.start=v(e,n.start),{range:n,now:i}}function y(e,t){n=e-t.end}function v(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{for(var r=0,i=!1,a=NaN;!i&&r<e.length;){var s=e[r].getStreamInfo();s.start<=t&&(!isFinite(s.duration)||s.start+s.duration>=t)?(a=t,i=!0):!n&&s.start>t&&(isNaN(a)||s.start<a)?a=s.start:n&&s.start+s.duration<t&&(isNaN(a)||s.start+s.duration>a)&&(a=s.start+s.duration),r+=1}return a}catch(e){return t}}function _(e){void 0===e.offset||isNaN(e.offset)||d(e.offset/1e3)}function T(){r=0,n=0}function E(){o.off(u.Z.UPDATE_TIME_SYNC_OFFSET,_,this),T()}return e={initialize:function(){T(),o.on(u.Z.UPDATE_TIME_SYNC_OFFSET,_,this)},getClientTimeOffset:function(){return r},setClientTimeOffset:d,getClientReferenceTime:function(){return Date.now()-1e3*n+1e3*r},calcAvailabilityStartTimeFromPresentationTime:function(e,t,n){return h(e,t,n)},calcAvailabilityEndTimeFromPresentationTime:function(e,t,n){return h(e,t,n,!0)},calcPresentationTimeFromWallTime:p,calcPresentationTimeFromMediaTime:g,calcPeriodRelativeTimeFromMpdRelativeTime:function(e,t){return t-e.adaptation.period.start},calcMediaTimeFromPresentationTime:function(e,t){return e-t.adaptation.period.start+t.presentationTimeOffset},calcWallTimeForSegment:function(e,t){var n,r,i;return t&&(n=e.representation.adaptation.period.mpd.suggestedPresentationDelay,r=e.presentationStartTime+n,i=new Date(e.availabilityStartTime.getTime()+1e3*r)),i},calcTimeShiftBufferWindow:function(e,t){if(!t)return function(e){var t={start:NaN,end:NaN},n=0,r=NaN;return e.forEach((function(e){var t=e.getStreamInfo();n+=t.duration,(isNaN(r)||t.start<r)&&(r=t.start)})),t.start=r,t.end=r+n,t}(e);if(c.get().streaming.timeShiftBuffer.calcFromSegmentTimeline){var n=m(e);return y(n.now,n.range),n.range}return function(e){var t={start:NaN,end:NaN};if(!e||0===e.length)return t;var n=e[0].getAdapter().getRegularPeriods()[0],r=p(new Date,n),i=n.mpd.timeShiftBufferDepth,a=isNaN(i)?0:r-i;if(t.start=v(e,a),t.end=!isNaN(t.start)&&r<t.start?r:v(e,r,!0),!isNaN(i)&&t.end<r-i&&(t.end=NaN),c.get().streaming.timeShiftBuffer.fallbackToSegmentTimeline){var s=m(e);if(s.range.end<t.start)return o.trigger(f.Z.CONFORMANCE_VIOLATION,{level:Jt.LEVELS.WARNING,event:Jt.EVENTS.INVALID_DVR_WINDOW}),y(s.now,s.range),s.range}return t}(e)},reset:E},t=Be(i).getInstance(),E(),e}Qi.__dashjs_factory_name="TimelineConverter";var Ji=c.Z.getSingletonFactory(Qi),ea=n(4593),ta=n(6934);function na(e){return na="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},na(e)}function ra(e,t){return ra=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ra(e,t)}function ia(e){return ia=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ia(e)}var aa=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ra(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=ia(t);if(n){var i=ia(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(e,t){return!t||"object"!==na(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function i(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(e=r.call(this)).captionData=null,e.label=null,e.defaultTrack=!1,e.kind=null,e.isFragmented=!1,e.isEmbedded=!1,e.isTTML=null,e}return i}(Ii),sa=n(2295);function oa(){var e=0;function t(e){for(var t="",n=0;n<e.length;++n)t+=e[n].uchar;return t.length-t.replace(/^\s+/,"").length}function n(e){return"left: "+3.125*e.x+"%; top: "+6.66*e.y1+"%; width: "+(100-3.125*e.x)+"%; height: "+6.66*Math.max(e.y2-1-e.y1,1)+"%; align-items: flex-start; overflow: visible; -webkit-writing-mode: horizontal-tb;"}function r(e){return"red"===e?"rgb(255, 0, 0)":"green"===e?"rgb(0, 255, 0)":"blue"===e?"rgb(0, 0, 255)":"cyan"===e?"rgb(0, 255, 255)":"magenta"===e?"rgb(255, 0, 255)":"yellow"===e?"rgb(255, 255, 0)":"white"===e?"rgb(255, 255, 255)":"black"===e?"rgb(0, 0, 0)":e}function i(e,t){var n=e.videoHeight/15;return t?"font-size: "+n+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; color: "+(t.foreground?r(t.foreground):"rgb(255, 255, 255)")+"; font-style: "+(t.italics?"italic":"normal")+"; text-decoration: "+(t.underline?"underline":"none")+"; white-space: pre; background-color: "+(t.background?r(t.background):"transparent")+";":"font-size: "+n+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; justify-content: flex-start; text-align: left; color: rgb(255, 255, 255); font-style: normal; white-space: pre; line-height: normal; font-weight: normal; text-decoration: none; width: 100%; display: flex;"}function a(e){return e.replace(/^\s+/g,"")}function s(e){return e.replace(/\s+$/g,"")}return{createHTMLCaptionsFromScreen:function(r,o,l,u){var c,d,f=null,h=!1,p=-1,g={start:o,end:l,spans:[]},m="style_cea608_white_black",y={},v={},_=[];for(c=0;c<15;++c){var T=u.rows[c],E="",b=null;if(!1===T.isEmpty()){var S=t(T.chars);null===f&&(f={x:S,y1:c,y2:c+1,p:[]}),S!==p&&h&&(f.p.push(g),g={start:o,end:l,spans:[]},f.y2=c,f.name="region_"+f.x+"_"+f.y1+"_"+f.y2,!1===y.hasOwnProperty(f.name)?(_.push(f),y[f.name]=f):y[f.name].p.contat(f.p),f={x:S,y1:c,y2:c+1,p:[]});for(var A=0;A<T.chars.length;++A){var w=T.chars[A],I=w.penState;if(null===b||!I.equals(b)){E.trim().length>0&&(g.spans.push({name:m,line:E,row:c}),E="");var C="style_cea608_"+I.foreground+"_"+I.background;I.underline&&(C+="_underline"),I.italics&&(C+="_italics"),v.hasOwnProperty(C)||(v[C]=JSON.parse(JSON.stringify(I))),b=I,m=C}E+=w.uchar}E.trim().length>0&&g.spans.push({name:m,line:E,row:c}),h=!0,p=S}else h=!1,p=-1,f&&(f.p.push(g),g={start:o,end:l,spans:[]},f.y2=c,f.name="region_"+f.x+"_"+f.y1+"_"+f.y2,!1===y.hasOwnProperty(f.name)?(_.push(f),y[f.name]=f):y[f.name].p.contat(f.p),f=null)}f&&(f.p.push(g),f.y2=c+1,f.name="region_"+f.x+"_"+f.y1+"_"+f.y2,!1===y.hasOwnProperty(f.name)?(_.push(f),y[f.name]=f):y[f.name].p.contat(f.p),f=null);var R=[];for(c=0;c<_.length;++c){var D=_[c],N="sub_cea608_"+e++,O=document.createElement("div");O.id=N;var P=n(D);O.style.cssText="position: absolute; margin: 0; display: flex; box-sizing: border-box; pointer-events: none;"+P;var M=document.createElement("div");M.className="paragraph bodyStyle",M.style.cssText=i(r);var x=document.createElement("div");x.className="cueUniWrapper",x.style.cssText="unicode-bidi: normal; direction: ltr;";for(var L=0;L<D.p.length;++L){var k=D.p[L],F=0;for(d=0;d<k.spans.length;++d){var U=k.spans[d];if(U.line.length>0){if(0!==d&&F!=U.row){var B=document.createElement("br");B.className="lineBreak",x.appendChild(B)}var j=!1;F===U.row&&(j=!0),F=U.row;var q=v[U.name],H=document.createElement("span");H.className="spanPadding "+U.name+" customSpanColor",H.style.cssText=i(r,q),0!==d&&j?d===k.spans.length-1?H.textContent=s(U.line):H.textContent=U.line:k.spans.length>1&&d<k.spans.length-1&&U.row===k.spans[d+1].row?H.textContent=a(U.line):H.textContent=U.line.trim(),x.appendChild(H)}}}M.appendChild(x),O.appendChild(M);var G={bodyStyle:["%",90]};for(var V in v)v.hasOwnProperty(V)&&(G[V]=["%",90]);R.push({type:"html",start:o,end:l,cueHTMLElement:O,cueID:N,cellResolution:[32,15],isFromCEA608:!0,fontSize:G,lineHeight:{},linePadding:{}})}return R}}}oa.__dashjs_factory_name="EmbeddedTextHtmlRender";var la=c.Z.getSingletonFactory(oa);function ua(e){var t,n,r,s,o,c,f,h,p,g,m,y,v,_,T,E,S,A=e.errHandler,w=e.manifestModel,C=e.mediaController,D=e.videoModel,N=e.textTracks,O=e.vttParser,P=e.vttCustomRenderingParser,M=e.ttmlParser,x=e.streamInfo,L=e.settings,k=this.context,F=(0,l.Z)(k).getInstance(),U=!1;function B(){c=null,h=NaN,p=[],g=null,f=!1,o=[],s=null}function j(e){var t=new aa;for(var n in e)t[n]=e[n];t.labels=e.labels,t.defaultTrack=function(e){var t=!1;return y.length>1&&e.isEmbedded?t=e.id&&e.id===a.Z.CC1:1===y.length?e.id&&"string"==typeof e.id&&"CC"===e.id.substring(0,2)&&(t=!0):0===y.length&&(t=e.index===o[0].index),t}(e),t.isFragmented=e.isFragmented,t.isEmbedded=!!e.isEmbedded,t.isTTML=function(e){return e.codec&&e.codec.search(a.Z.STPP)>=0||e.mimeType&&e.mimeType.search(a.Z.TTML)>=0}(e),t.kind=function(e,t){var n=e.roles&&e.roles.length>0?t[e.roles[0]]:t.caption;return n===t.caption||n===t.subtitle?n:t.caption}(e,{subtitle:"subtitles",caption:"captions"}),N.addTextTrack(t)}function q(e){var t=e.chunk;t.mediaInfo.embeddedCaptions&&G(t.bytes,t)}function H(e){m=e}function G(e,o){var l=o.mediaInfo,u=l.type,d=l.mimeType,p=l.codec||d;p?-1!==l.codec.indexOf("application/mp4")?function(e,i,o){var l;if("InitializationSegment"===i.segmentType)f=!0,h=r.getMediaTimescaleFromMoov(e);else{if(!f)return;(l=r.getSamplesInfo(e).sampleList).length>0&&(g=l[0].cts-i.start*h),o.search(a.Z.STPP)>=0?function(e,r,i){var o,l;for(s=null!==s?s:Z(i),o=0;o<r.length;o++){var u=r[o],d=u.cts,f=Y(),p=f+d/h,g=p+u.duration/h;t.buffered.add(p,g);var y=new DataView(e,u.offset,u.subSizes[0]),v=ta.Utils.dataViewToString(y,a.Z.UTF8),_=[],T=u.offset+u.subSizes[0];for(l=1;l<u.subSizes.length;l++){var E=new Uint8Array(e,T,u.subSizes[l]),b=String.fromCharCode.apply(null,E);_.push(b),T+=u.subSizes[l]}try{var S=w.getValue().ttmlTimeIsRelative?d/h:0,A=s.parse(v,S,d/h,(d+u.duration)/h,_);N.addCaptions(m,f,A)}catch(e){c.removeExecutedRequestsBeforeTime(),this.remove(),n.error("TTML parser error: "+e.message)}}}(e,l,o):function(e,r){var i,a,s,o=[];for(i=0;i<r.length;i++){var l=r[i];l.cts-=g;var u=Y()+l.cts/h,c=u+l.duration/h;t.buffered.add(u,c);var d=e.slice(l.offset,l.offset+l.size),f=ta.parseBuffer(d);for(a=0;a<f.boxes.length;a++){var p=f.boxes[a];if(n.debug("VTT box1: "+p.type),"vtte"!==p.type&&"vttc"===p.type){n.debug("VTT vttc boxes.length = "+p.boxes.length);var y={styles:{}};for(s=0;s<p.boxes.length;s++){var v=p.boxes[s];if(n.debug("VTT box2: "+v.type),"payl"===v.type)y.start=l.cts/h,y.end=(l.cts+l.duration)/h,y.data=v.cue_text;else if("sttg"===v.type&&v.settings&&""!==v.settings)try{var _=v.settings.split(" ");y.styles=O.getCaptionStyles(_)}catch(e){}}y&&y.data&&(o.push(y),n.debug("VTT  ".concat(y.start," - ").concat(y.end," :  ").concat(y.data)))}}}o.length>0&&N.addCaptions(m,0,o)}(e,l)}}(e,o,p):u===a.Z.VIDEO?function(e,t){var a,s;if(t.segmentType===R.w.INIT_SEGMENT_TYPE)0===v&&(v=r.getMediaTimescaleFromMoov(e));else if(t.segmentType===R.w.MEDIA_SEGMENT_TYPE){if(0===v)return void n.warn("CEA-608: No timescale for embeddedTextTrack yet");var o=(s=r.getSamplesInfo(e)).lastSequenceNumber,l=Math.trunc(t.start),u=Math.trunc(t.end);if(E[0]||E[1]||function(){for(var e,t=0;t<y.length;t++){if(-1===(e=N.getTrackIdxForId(y[t].id)))return void n.warn("CEA-608: data before track is ready.");var r=V(e);E[t]=new(i().Cea608Parser)(t+1,{newCue:r},null)}}(),v){if(function(e,t,n,r,i){return null!==e&&null!==t&&null!==r&&null!==i&&(t===e?r!==i:t!==e+n)}(_,o,s.numSequences,T,l))for(a=0;a<E.length;a++)E[a]&&E[a].reset();for(var c=function(e,t){if(0===t.length)return null;for(var n={splits:[],fields:[[],[]]},r=new DataView(e),a=0;a<t.length;a++)for(var s=t[a],o=i().findCea608Nalus(r,s.offset,s.size),l=null,u=0,c=0;c<o.length;c++)for(var d=i().extractCea608DataFromRange(r,o[c]),f=0;f<2;f++)if(d[f].length>0){s.cts!==l?u=0:u+=1;var h=Y();n.fields[f].push([s.cts+h*v,d[f],u]),l=s.cts}return n.fields.forEach((function(e){e.sort((function(e,t){return e[0]===t[0]?e[2]-t[2]:e[0]-t[0]}))})),n}(e,s.sampleList),d=0;d<E.length;d++){var f=c.fields[d],h=E[d];if(h)for(a=0;a<f.length;a++)h.addData(f[a][0]/v,f[a][1])}_=o,T=u}}}(e,o):function(e,n,r){var i,s,o=new DataView(e,0,e.byteLength);s=ta.Utils.dataViewToString(o,a.Z.UTF8);try{i=Z(r).parse(s,0),N.addCaptions(N.getCurrentTrackIdx(),0,i),t.buffered&&t.buffered.add(n.start,n.end)}catch(e){A.error(new b.Z(I.TIMED_TEXT_ERROR_ID_PARSE_CODE,I.TIMED_TEXT_ERROR_MESSAGE_PARSE+e.message,s))}}(e,o,p):n.error("No text type defined")}function V(e){return function(t,n,r){var i;(i=D.getTTMLRenderingDiv()?S.createHTMLCaptionsFromScreen(D.getElement(),t,n,r):[{start:t,end:n,data:r.getDisplayText(),styles:{}}])&&N.addCaptions(e,0,i)}}function Y(){return isNaN(t.timestampOffset)?0:t.timestampOffset}function Z(e){var t;return e.search(a.Z.VTT)>=0?t=L.get().streaming.text.webvtt.customRenderingEnabled&&P?P:O:(e.search(a.Z.TTML)>=0||e.search(a.Z.STPP)>=0)&&(t=M),t}function K(e){y.forEach((function(t){var n=N.getTrackIdxForId(t.id);n>=0&&N.deleteCuesFromTrackIdx(n,e.from,e.to)}))}return t={initialize:function(){U||(y=[],m=null,v=0,E=[],_=null,T=null,U=!0,S=la(k).getInstance(),F.on(u.Z.VIDEO_CHUNK_RECEIVED,q,t),F.on(u.Z.BUFFER_CLEARED,K,t))},addMediaInfos:function(e,n,r){if(o=o.concat(n),e===a.Z.TEXT&&n[0].isFragmented&&!n[0].isEmbedded){c=r,t.buffered=(0,sa.Z)(k).create(),p=C.getTracksFor(a.Z.TEXT,x.id).filter((function(e){return e.isFragmented}));for(var i=C.getCurrentTrackFor(a.Z.TEXT,x.id),s=0;s<p.length;s++)if(p[s]===i){H(s);break}}for(var l=0;l<n.length;l++)j(n[l])},resetMediaInfos:function(){o=[]},getStreamId:function(){return x.id},append:G,abort:function(){},addEmbeddedTrack:function(e){if(U&&e)if(e.id===a.Z.CC1||e.id===a.Z.CC3){for(var t=0;t<y.length;t++)if(y[t].id===e.id)return;y.push(e)}else n.warn("Embedded track "+e.id+" not supported!")},resetEmbedded:function(){F.off(u.Z.VIDEO_CHUNK_RECEIVED,q,t),F.off(u.Z.BUFFER_CLEARED,K,t),N&&N.deleteAllTextTracks(),U=!1,y=[],E=[null,null],_=null,T=null},getConfig:function(){return{fragmentModel:c,fragmentedTracks:p,videoModel:D}},setCurrentFragmentedTrackIdx:H,remove:function(e,n){void 0===e&&e===n&&(e=t.buffered.start(0),n=t.buffered.end(t.buffered.length-1)),t.buffered.remove(e,n),N.deleteCuesFromTrackIdx(m,e,n)},reset:function(){B(),o=[],r=null}},n=(0,d.Z)(k).getInstance().getLogger(t),r=(0,Pt.Z)(k).getInstance(),B(),t}ua.__dashjs_factory_name="TextSourceBuffer";var ca=c.Z.getClassFactory(ua),da=n(4403);function fa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ha=["text","align","fontSize","id","isd","line","lineAlign","lineHeight","linePadding","position","positionAlign","region","size","snapToLines","vertical"];function pa(e){var t,n,r,i,s,o,c,h,p,g,m,y,v,_,T,E,b,S,A,w,I=this.context,C=(0,l.Z)(I).getInstance(),R=e.videoModel,D=e.streamInfo,N=e.settings;function O(e,t,n,r,i,a){var s=0,o=0;e/t>n/r?s=(o=t)/r*n:o=(s=e)/n*r;var l,u,c=0,d=0;return s/o>i?(d=o,c=o*i):(c=s,d=s/i),l=(e-c)/2,u=(t-d)/2,a?{x:l+.1*c,y:u+.1*d,w:.8*c,h:.8*d}:{x:l,y:u,w:c,h:d}}function P(e,t){var n=R.getClientWidth(),r=R.getClientHeight(),i=R.getVideoWidth(),a=R.getVideoHeight(),s=R.getVideoRelativeOffsetTop(),o=R.getVideoRelativeOffsetLeft();if(0!==i&&0!==a){var l=i/a,u=!1;e.isFromCEA608&&(l=3.5/3,u=!0);var d=O.call(this,n,r,i,a,l,u),y=d.w,v=d.h,E=d.x,S=d.y;if(y!=p||v!=g||E!=c||S!=h||t){if(c=E+o,h=S+s,p=y,g=v,m){var A=m.style;A&&(A.left=c+"px",A.top=h+"px",A.width=p+"px",A.height=g+"px",A.zIndex=_&&document[_]||T?b:null,C.trigger(f.Z.CAPTION_CONTAINER_RESIZE))}var w=e.activeCues;if(w)for(var I=w.length,D=0;D<I;++D){var N=w[D];N.scaleCue(N)}}}}function M(e){var t,n,r,i,a,s=p,o=g;if(e.cellResolution){var l=[s/e.cellResolution[0],o/e.cellResolution[1]];if(e.linePadding)for(t in e.linePadding)if(e.linePadding.hasOwnProperty(t)){n=(e.linePadding[t]*l[0]).toString();for(var u=document.getElementsByClassName("spanPadding"),c=0;c<u.length;c++)u[c].style.cssText=u[c].style.cssText.replace(/(padding-left\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+n),u[c].style.cssText=u[c].style.cssText.replace(/(padding-right\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+n)}if(e.fontSize){for(t in e.fontSize)if(e.fontSize.hasOwnProperty(t)){"%"===e.fontSize[t][0]?r=e.fontSize[t][1]/100:"c"===e.fontSize[t][0]&&(r=e.fontSize[t][1]),n=(r*l[1]).toString(),a="defaultFontSize"!==t?document.getElementsByClassName(t):document.getElementsByClassName("paragraph");for(var d=0;d<a.length;d++)a[d].style.cssText=a[d].style.cssText.replace(/(font-size\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+n)}if(e.lineHeight)for(t in e.lineHeight)if(e.lineHeight.hasOwnProperty(t)){"%"===e.lineHeight[t][0]?i=e.lineHeight[t][1]/100:"c"===e.fontSize[t][0]&&(i=e.lineHeight[t][1]),n=(i*l[1]).toString(),a=document.getElementsByClassName(t);for(var f=0;f<a.length;f++)a[f].style.cssText=a[f].style.cssText.replace(/(line-height\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+n)}}}if(e.isd){var h=document.getElementById(e.cueID);h&&m.removeChild(h),L(e)}}function x(e,t){var n=/^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/,r=/^#(.*)$/;if(n.test(t)){var i=n.exec(t),a=parseInt(i[4],10)-1;return"data:image/png;base64,"+btoa(e.images[a])}if(r.test(t)){var s=r.exec(t)[1];return"data:image/png;base64,"+e.embeddedImages[s]}return t}function L(e){if(m){ie.call(this);var t=document.createElement("div");m.appendChild(t),E=(0,da.renderHTML)(e.isd,t,(function(t){return x(e,t)}),m.clientHeight,m.clientWidth,N.get().streaming.text.imsc.displayForcedOnlyMode,(function(e){n.info("renderCaption :",e)}),E,N.get().streaming.text.imsc.enableRollUp),t.id=e.cueID,C.trigger(f.Z.CAPTION_RENDERED,{captionDiv:t,currentTrackIdx:o})}}function k(e,t){return!!t&&t.endTime>=e.startTime}function F(e,t){return!!N.get().streaming.text.extendSegmentedCues&&!!function(e,t,n){for(var r=0;r<n.length;r++){var i=n[r];if(JSON.stringify(e[i])!==JSON.stringify(t[i]))return!1}return!0}(t,e,ha)&&(t.endTime=Math.max(t.endTime,e.endTime),!0)}function U(e,t){t&&t.forEach((function(t){t.kind&&"image"===t.kind&&(t.src=x(e,t.src)),U(e,t.contents)}))}function B(e,t,r){var i=W(e),s=N.get().streaming.text.dispatchForManualRendering;if(i&&Array.isArray(r)&&0!==r.length)for(var o=0;o<r.length;o++){var l=null,u=r[o];i.cellResolution=u.cellResolution,i.isFromCEA608=u.isFromCEA608,isNaN(u.start)||isNaN(u.end)||(s?l=j(u,t):Y(u)&&m?l=G(u,t,i):u.data&&(l=V(u,t,i)));try{if(l){if(!Q(i,l))if(N.get().streaming.text.webvtt.customRenderingEnabled)i.manualCueList||(i.manualCueList=[]),i.manualCueList.push(l);else{var c=void 0;i.cues&&0!==i.cues.length&&(c=i.cues[i.cues.length-1]),k(l,c)?F(l,c)||(c.isd&&(c.onexit=function(){}),i.mode!==a.Z.TEXT_DISABLED&&i.addCue(l)):i.mode!==a.Z.TEXT_DISABLED&&i.addCue(l)}var d=N.get().streaming.buffer.bufferToKeep;ee(i,0,R.getTime()-d)}else n.error("Impossible to display subtitles. You might have missed setting a TTML rendering div via player.attachTTMLRenderingDiv(TTMLRenderingDiv)")}catch(e){throw te(i),i.addCue(l),e}}}function j(e,t){var n=Z(e,t);return n.onenter=function(){Y(e)&&w&&w.cueID!==n.cueID&&H(w),delete n.type,w=n,q(n)},n.onexit=function(){H(n),w=null},n}function q(e){C.trigger(f.Z.CUE_ENTER,e)}function H(e){C.trigger(f.Z.CUE_EXIT,{cueID:e.cueID})}function G(e,t,r){var i=this,s=Z(e,t);return m.style.left=c+"px",m.style.top=h+"px",m.style.width=p+"px",m.style.height=g+"px",s.onenter=function(){var e=this;r.mode===a.Z.TEXT_SHOWING&&(this.isd?(A?requestAnimationFrame((function(){return L(e)})):L(this),n.debug("Cue enter id:"+this.cueID)):(m.appendChild(this.cueHTMLElement),M.call(i,this),C.trigger(f.Z.CAPTION_RENDERED,{captionDiv:this.cueHTMLElement,currentTrackIdx:o})))},s.onexit=function(){if(m)for(var e=m.childNodes,t=0;t<e.length;++t)e[t].id===this.cueID&&(n.debug("Cue exit id:"+e[t].id),m.removeChild(e[t]),--t)},s}function V(e,t,r){var i=Z(e,t);if(i.isActive=!1,e.styles)try{void 0!==e.styles.align&&"align"in i&&(i.align=e.styles.align),void 0!==e.styles.line&&"line"in i&&(i.line=e.styles.line),void 0!==e.styles.snapToLines&&"snapToLines"in i&&(i.snapToLines=e.styles.snapToLines),void 0!==e.styles.position&&"position"in i&&(i.position=e.styles.position),void 0!==e.styles.size&&"size"in i&&(i.size=e.styles.size)}catch(e){n.error(e)}return i.onenter=function(){r.mode===a.Z.TEXT_SHOWING&&C.trigger(f.Z.CAPTION_RENDERED,{currentTrackIdx:o})},i}function Y(e){return"html"===e.type}function Z(e,t){return Y(e)?function(e,t){var n=new r(e.start+t,e.end+t,"");return n.cueHTMLElement=e.cueHTMLElement,n.isd=e.isd,n.images=e.images,n.embeddedImages=e.embeddedImages,n.cueID=e.cueID,n.scaleCue=M.bind(self),n.cellResolution=e.cellResolution,n.lineHeight=e.lineHeight,n.linePadding=e.linePadding,n.fontSize=e.fontSize,n.isd&&U(n,n.isd.contents),n}(e,t):function(e,t){var n=new r(e.start-t,e.end-t,e.data);return n.cueID="".concat(n.startTime,"_").concat(n.endTime),n}(e,t)}function K(e){if(y)for(var t=y.childNodes,n=0;n<t.length;++n)t[n].id===e.cueID&&(y.removeChild(t[n]),--n)}function z(){var e,t=[],n=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return fa(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fa(e,t):void 0}}(e))){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}(R.getTextTracks());try{for(n.s();!(e=n.n()).done;){var r=e.value;r.manualMode===a.Z.TEXT_SHOWING&&t.push(r)}}catch(e){n.e(e)}finally{n.f()}return t}function W(e){return e>=0&&i[e]?R.getTextTrack(i[e].kind,i[e].id,i[e].lang,i[e].isTTML,i[e].isEmbedded):null}function X(e){var t=this;if(e!==o){var n=W(o=e);$.call(this,n),v&&(clearInterval(v),v=null),n&&"html"===n.renderingType&&(P.call(this,n,!0),window.ResizeObserver?(S=new window.ResizeObserver((function(){P.call(t,n,!0)}))).observe(R.getElement()):v=setInterval(P.bind(this,n),500))}}function $(e){ie.call(this),e&&"html"===e.renderingType?ne.call(this):re.call(this)}function Q(e,t){if(!e.cues)return!1;for(var n=0;n<e.cues.length;n++)if(e.cues[n].startTime===t.startTime&&e.cues[n].endTime===t.endTime)return!0;return!1}function J(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return!!e&&(isNaN(t)||(r?e.startTime:e.endTime)>=t)&&(isNaN(n)||(r?e.endTime:e.startTime)<=n)}function ee(e,t,n){var r,i;if(!(n<t)&&e&&(e.cues||e.manualCueList)){var a=e.cues&&e.cues.length>0?"native":"custom",s="native"===a?e.cues:e.manualCueList;if(!s||0===s.length)return;for(var o=s.length-1;o>=0;o--)!J(s[o],t,n,!0)||(r=s[o],i=R.getTime(),r.startTime>=i&&r.endTime<=i)||("native"===a?e.removeCue(s[o]):(K(s[o]),delete e.manualCueList[o]))}}function te(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(e&&(e.cues||e.manualCueList)){var i=e.cues&&e.cues.length>0?"native":"custom",a="native"===i?e.cues:e.manualCueList;if(!a||0===a.length)return;for(var s=a.length-1;s>=0;s--)J(a[s],t,n,r)&&("native"===i?(a[s].onexit&&a[s].onexit(),e.removeCue(a[s])):(K(a[s]),delete e.manualCueList[s]))}}function ne(){var e=document.getElementById("native-cue-style");if(!e){(e=document.createElement("style")).id="native-cue-style",document.head.appendChild(e);var t=e.sheet,r=R.getElement();try{r&&(r.id?t.insertRule("#"+r.id+"::cue {background: transparent}",0):0!==r.classList.length?t.insertRule("."+r.className+"::cue {background: transparent}",0):t.insertRule("video::cue {background: transparent}",0))}catch(e){n.info(""+e.message)}}}function re(){var e=document.getElementById("native-cue-style");e&&document.head.removeChild(e)}function ie(){if(m)for(;m.firstChild;)m.removeChild(m.firstChild)}return t={initialize:function(){"undefined"!=typeof window&&"undefined"!=typeof navigator&&(r=window.VTTCue||window.TextTrackCue,i=[],s=[],o=-1,c=0,h=0,p=0,g=0,m=null,y=null,v=null,T=!1,b=2147483647,E=null,A="requestAnimationFrame"in window,void 0!==document.fullscreenElement?_="fullscreenElement":void 0!==document.webkitIsFullScreen?_="webkitIsFullScreen":document.msFullscreenElement?_="msFullscreenElement":document.mozFullScreen&&(_="mozFullScreen"))},getStreamId:function(){return D.id},addTextTrack:function(e){i.push(e)},addCaptions:B,createTracks:function(){var e=N.get().streaming.text.dispatchForManualRendering;i.sort((function(e,t){return e.index-t.index})),m=R.getTTMLRenderingDiv(),y=R.getVttRenderingDiv();for(var t,n,r,l,c,d,h=-1,p=0;p<i.length;p++){var g=(n=(t=i[p]).kind,r=void 0!==t.id?t.id:t.lang,l=t.lang,c=t.isTTML,d=t.isEmbedded,R.addTextTrack(n,r,l,c,d));s.push(g),i[p].defaultTrack&&(g.default=!0,h=p);var v=W(p);v&&(v.mode=a.Z.TEXT_SHOWING,m&&(i[p].isTTML||i[p].isEmbedded)?v.renderingType="html":v.renderingType="default"),B(p,0,i[p].captionData),C.trigger(f.Z.TEXT_TRACK_ADDED)}if(X.call(this,h),h>=0){C.on(f.Z.PLAYBACK_METADATA_LOADED,(function e(){var t=W(h);t&&"html"===t.renderingType&&P.call(this,t,!0),C.off(f.Z.PLAYBACK_METADATA_LOADED,e,this)}),this);for(var _=0;_<i.length;_++){var T=W(_);T&&(T.mode=_!==h||e?a.Z.TEXT_HIDDEN:a.Z.TEXT_SHOWING,T.manualMode=_===h?a.Z.TEXT_SHOWING:a.Z.TEXT_HIDDEN)}}C.trigger(u.Z.TEXT_TRACKS_QUEUE_INITIALIZED,{index:o,tracks:i,streamId:D.id})},getCurrentTrackIdx:function(){return o},setCurrentTrackIdx:X,getTrackIdxForId:function(e){for(var t=-1,n=0;n<i.length;n++)if(i[n].id===e){t=n;break}return t},getCurrentTrackInfo:function(){return i[o]},setModeForTrackIdx:function(e,t){var n=W(e);n&&n.mode!==t&&(n.mode=t),n&&n.manualMode!==t&&(n.manualMode=t)},deleteCuesFromTrackIdx:function(e,t,n){var r=W(e);r&&te(r,t,n)},deleteAllTextTracks:function(){for(var e=s?s.length:0,t=0;t<e;t++){var n=W(t);n&&te.call(this,n,D.start,D.start+D.duration,!1)}s=[],i=[],v&&(clearInterval(v),v=null),S&&R&&(S.unobserve(R.getElement()),S=null),o=-1,ie.call(this)},manualCueProcessing:function(e){var t=z();if(t&&t.length>0){var n=t[0].manualCueList;n&&n.length>0&&n.forEach((function(t){t.startTime<=e&&t.endTime>=e&&!t.isActive?(t.isActive=!0,N.get().streaming.text.dispatchForManualRendering?q(t):WebVTT.processCues(window,[t],y,t.cueID)):t.isActive&&(t.startTime>e||t.endTime<e)&&(t.isActive=!1,N.get().streaming.text.dispatchForManualRendering?H(t):K(t))}))}},disableManualTracks:function(){var e=z();if(e&&e.length>0){var t=e[0].manualCueList;t&&t.length>0&&t.forEach((function(e){if(e.isActive)if(e.isActive=!1,N.get().streaming.text.dispatchForManualRendering)H(e);else if(y)for(var t=y.childNodes,n=0;n<t.length;++n)t[n].id===e.cueID&&(y.removeChild(t[n]),--n)}))}}},n=(0,d.Z)(I).getInstance().getLogger(t),t}pa.__dashjs_factory_name="TextTracks";var ga=c.Z.getClassFactory(pa);function ma(){var e,t,n,r,i,a,s=this.context;function o(e){var t=e.split(":"),n=t.length-1;return e=60*parseInt(t[n-1],10)+parseFloat(t[n]),2===n&&(e+=3600*parseInt(t[0],10)),e}function l(e){var t=e.split(r),n=t[1].split(a);return n.shift(),t[1]=n[0],n.shift(),{cuePoints:t,styles:u(n)}}function u(e){var t={};return e.forEach((function(e){if(e.split(/:/).length>1){var n=e.split(/:/)[1],r=!1;n&&-1!=n.search(/%/)&&(r=!0,n=parseInt(n.replace(/%/,""),10)),(e.match(/align/)||e.match(/A/))&&(t.align=n),(e.match(/line/)||e.match(/L/))&&(t.line="auto"===n?n:parseInt(n,10),r&&(t.snapToLines=!1)),(e.match(/position/)||e.match(/P/))&&(t.position=n),(e.match(/size/)||e.match(/S/))&&(t.size=n)}})),t}function c(e,t){for(var n,i=t,a="",s="";""!==e[i]&&i<e.length;)i++;if((n=i-t)>1)for(var o=0;o<n;o++){if((s=e[t+o]).match(r)){a="";break}a+=s,o!==n-1&&(a+="\n")}else(s=e[t]).match(r)||(a=s);return a}return e={parse:function(e){var a,s,u=[];if(!e)return u;a=(e=e.split(n)).length,s=-1;for(var d=0;d<a;d++){var f=e[d];if(f.length>0&&"WEBVTT"!==f&&f.match(r)){var h=l(f),p=h.cuePoints,g=h.styles,m=c(e,d+1),y=o(p[0].replace(i,"")),v=o(p[1].replace(i,""));!isNaN(y)&&!isNaN(v)&&y>=s&&v>y?""!==m?(s=y,u.push({start:y,end:v,data:m,styles:g})):t.error("Skipping cue due to empty/malformed cue text"):t.error("Skipping cue due to incorrect cue timing")}}return u},getCaptionStyles:u},t=(0,d.Z)(s).getInstance().getLogger(e),n=/(?:\r\n|\r|\n)/gm,r=/-->/,i=/(^[\s]+|[\s]+$)/g,a=/\s\b/g,e}ma.__dashjs_factory_name="VTTParser";var ya=c.Z.getSingletonFactory(ma);function va(){var e,t;return e={parse:function(e){var n=[];return t.oncue=function(e){e.start=e.startTime,e.end=e.endTime,e.data=e.text,e.styles={align:e.align,line:e.line,position:e.position,size:e.size},n.push(e)},t.parse(e),n}},function(){try{window&&window.WebVTT&&window.WebVTT.Parser&&(t=new window.WebVTT.Parser(window,window.vttjs,window.WebVTT.StringDecoder()))}catch(e){}}(),e}va.__dashjs_factory_name="VttCustomRenderingParser";var _a=c.Z.getSingletonFactory(va);function Ta(){var e,t,n=this.context,r=(0,l.Z)(n).getInstance(),i=0;return e={parse:function(e,n,a,s,o){var l,c,d,h="",p=[],g={},m={},y="",v="",_={onOpenTag:function(e,n,i){if(i[" imagetype"]&&!i[" imageType"]&&(r.trigger(f.Z.CONFORMANCE_VIOLATION,{level:Jt.LEVELS.ERROR,event:Jt.EVENTS.NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE}),i[" imageType"]=i[" imagetype"]),"image"===n&&("http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt"===e||"http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"===e)){if(!i[" imageType"]||"PNG"!==i[" imageType"].value)return void t.warn("smpte-tt imageType != PNG. Discarded");y=i["http://www.w3.org/XML/1998/namespace id"].value}},onCloseTag:function(){y&&(m[y]=v.trim()),v="",y=""},onText:function(e){y&&(v+=e)}};if(!e)throw h="no ttml data to parse",new Error(h);g.data=e,r.trigger(u.Z.TTML_TO_PARSE,g);var T=(0,da.fromXML)(g.data,(function(e){h=e}),_);r.trigger(u.Z.TTML_PARSED,{ttmlString:g.data,ttmlDoc:T});var E,b=T.getMediaTimeEvents();for(d=0;d<b.length;d++){var S=(0,da.generateISD)(T,b[d],(function(e){h=e}));S.contents.some((function(e){return e.contents.length}))&&(l=b[d]+n)<(c=b[d+1]+n)&&p.push({start:l,end:c,type:"html",cueID:(E="cue_TTML_"+i,i++,E),isd:S,images:o,embeddedImages:m})}if(""!==h)throw t.error(h),new Error(h);return p}},t=(0,d.Z)(n).getInstance().getLogger(e),e}Ta.__dashjs_factory_name="TTMLParser";var Ea=c.Z.getSingletonFactory(Ta);function ba(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Sa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ba(Object(n),!0).forEach((function(t){Aa(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ba(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Aa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ia(e){var t,n,r,i=this.context,s=(0,l.Z)(i).getInstance(),o=(0,X.Z)(i).getInstance(),u=e.adapter,c=e.baseURLController;function h(e,t){var n,i,s=!1;if(c.resolve()){var l=u.getVoRepresentations(e);l&&l.length>0&&(n=c.resolve(l[0].path).url)}var d=e.essentialPropertiesAsArray.filter((function(e){return e.schemeIdUri&&e.schemeIdUri===a.Z.FONT_DOWNLOAD_DVB_SCHEME})),f=e.supplementalPropertiesAsArray.filter((function(e){return e.schemeIdUri&&e.schemeIdUri===a.Z.FONT_DOWNLOAD_DVB_SCHEME}));d.length>0?(s=!0,i=d):i=f,i.forEach((function(i){if(function(e){return!(!(e.value&&"1"===e.value&&e.dvbUrl&&e.dvbUrl.length>0&&e.dvbFontFamily&&e.dvbFontFamily.length>0&&e.dvbMimeType)||e.dvbMimeType!==a.Z.OFF_MIMETYPE&&e.dvbMimeType!==a.Z.WOFF_MIMETYPE)}(i)){var l=(u=i.dvbUrl,c=n,o.isPathAbsolute(u)?u:o.isRelative(u)?c?o.resolve(u,c):o.resolve(u):u);r.push({fontFamily:i.dvbFontFamily,url:l,mimeType:i.dvbMimeType,trackId:e.id,streamId:t,isEssential:s,status:"unloaded",fontFace:new FontFace(i.dvbFontFamily,"url(".concat(l,")"),{display:"swap"})})}var u,c}))}function p(e,t){var n=r[e];r[e]=Sa(Sa({},n),{},{status:t})}function g(){r=[]}return t={addFontsFromTracks:function(e,t){if(e&&Array.isArray(e)&&t)for(var n=0;n<e.length;n++)h(e[n],t)},downloadFonts:function(){for(var e=function(e){var t=r[e];document.fonts.add(t.fontFace),s.trigger(f.Z.DVB_FONT_DOWNLOAD_ADDED,t),t.fontFace.load().then((function(){p(e,"loaded"),s.trigger(f.Z.DVB_FONT_DOWNLOAD_COMPLETE,t)}),(function(r){p(e,"error"),n.debug("Font download error: ",r),s.trigger(f.Z.DVB_FONT_DOWNLOAD_FAILED,t)}))},t=0;t<r.length;t++)e(t)},getFonts:function(){return r},getFontsForTrackId:function(e){return r.filter((function(t){return t.trackId&&t.trackId===e}))},reset:function(){!function(){var e,t=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return wa(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wa(e,t):void 0}}(e))){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}(r);try{for(t.s();!(e=t.n()).done;){var i=e.value,a=document.fonts.delete(i.fontFace);n.debug("Removal of fontFamily: ".concat(i.fontFamily," was ").concat(a?"successful":"unsuccessful"))}}catch(e){t.e(e)}finally{t.f()}}(),g()}},n=(0,d.Z)(i).getInstance().getLogger(t),g(),t}Ia.__dashjs_factory_name="DVBFonts";var Ca=c.Z.getClassFactory(Ia);function Ra(e){var t,n,r,i,s,o,c,h,p,g,m,y,v,_,T=this.context,E=e.adapter,b=e.errHandler,S=e.manifestModel,A=e.mediaController,w=e.baseURLController,I=e.videoModel,C=e.settings;function R(e){if(_.error("Could not download ".concat(e.isEssential?"an essential":"a"," font - fontFamily: ").concat(e.fontFamily,", url: ").concat(e.url)),e.isEssential){var t=i[e.streamId].getTrackIdxForId(e.trackId);i[e.streamId].setModeForTrackIdx(t,a.Z.TEXT_DISABLED)}}function D(e){if(_.debug("Successfully downloaded ".concat(e.isEssential?"an essential":"a"," font - fontFamily: ").concat(e.fontFamily,", url: ").concat(e.url)),e.isEssential){var t=i[e.streamId].getTrackIdxForId(e.trackId);t===i[e.streamId].getCurrentTrackIdx()?i[e.streamId].setModeForTrackIdx(t,a.Z.TEXT_SHOWING):i[e.streamId].setModeForTrackIdx(t,a.Z.TEXT_HIDDEN)}}function N(e){var t=e.tracks,r=e.index,s=e.streamId;if(!1===C.get().streaming.text.defaultEnabled&&!M()||y)x(s,-1);else{var o=A.getCurrentTrackFor(a.Z.TEXT,s);if(o){var l={lang:o.lang,role:o.roles[0],index:o.index,codec:o.codec,accessibility:o.accessibility[0]};t.some((function(e,t){if(A.matchSettings(l,e))return x(s,t),r=t,!0}))}p=!1}n[s].lastEnabledIndex=r,h.trigger(f.Z.TEXT_TRACKS_ADDED,{enabled:M(),index:r,tracks:t,streamId:s}),m=!0,v.addFontsFromTracks(t,s),v.getFonts().forEach((function(e){if(e.isEssential){var t=i[e.streamId].getTrackIdxForId(e.trackId);i[e.streamId].setModeForTrackIdx(t,a.Z.TEXT_DISABLED)}})),v.downloadFonts()}function O(e){try{var t=e.streamId;if(!i[t]||isNaN(e.time))return;i[t].manualCueProcessing(e.time)}catch(e){}}function P(e){try{var t=e.streamId;if(!i[t])return;i[t].disableManualTracks()}catch(e){}}function M(){var e=!0;return p&&!g&&(e=!1),e}function x(e,t){(p=-1===t)&&A&&A.saveTextSettingsDisabled();var n=L(e);if(n!==t&&i[e]){i[e].disableManualTracks();var s=i[e].getCurrentTrackInfo(),o=s?I.getTextTrack(s.kind,s.id,s.lang,s.isTTML,s.isEmbedded):null;o&&o.mode!==a.Z.TEXT_DISABLED&&i[e].setModeForTrackIdx(n,a.Z.TEXT_HIDDEN),i[e].setCurrentTrackIdx(t),s=i[e].getCurrentTrackInfo();var l=C.get().streaming.text.dispatchForManualRendering;s&&!l&&s.mode!==a.Z.TEXT_DISABLED&&i[e].setModeForTrackIdx(t,a.Z.TEXT_SHOWING),s&&s.isFragmented&&!s.isEmbedded?function(e,t,n){if(r[e])for(var s=r[e].getConfig().fragmentedTracks,o=0;o<s.length;o++){var l=s[o];if(t.lang===l.lang&&(l.id?t.id===l.id:t.index===l.index)){var c=A.getCurrentTrackFor(a.Z.TEXT,e);(l.id?c.id!==l.id:c.index!==l.index)?(i[e].deleteCuesFromTrackIdx(n),r[e].setCurrentFragmentedTrackIdx(o)):-1===n&&h.trigger(u.Z.SET_FRAGMENTED_TEXT_AFTER_DISABLED,{},{streamId:e,mediaType:a.Z.TEXT})}}}(e,s,n):s&&!s.isFragmented&&function(e,t){h.trigger(u.Z.SET_NON_FRAGMENTED_TEXT,{currentTrackInfo:t},{streamId:e,mediaType:a.Z.TEXT})}(e,s),A.setTrack(s)}}function L(e){return i[e].getCurrentTrackIdx()}function k(){r={},i={},n={},p=!0,m=!1,y=!1}return t={deactivateStream:function(e){if(e){var t=e.id;r[t]&&r[t].resetMediaInfos(),i[t]&&i[t].deleteAllTextTracks()}},initialize:function(){v=Ca(T).create({adapter:E,baseURLController:w}),h.on(u.Z.TEXT_TRACKS_QUEUE_INITIALIZED,N,t),h.on(u.Z.DVB_FONT_DOWNLOAD_FAILED,R,t),h.on(u.Z.DVB_FONT_DOWNLOAD_COMPLETE,D,t),C.get().streaming.text.webvtt.customRenderingEnabled&&(h.on(u.Z.PLAYBACK_TIME_UPDATED,O,t),h.on(u.Z.PLAYBACK_SEEKING,P,t))},initializeForStream:function(e){var t=e.id,a=ga(T).create({videoModel:I,settings:C,streamInfo:e});a.initialize(),i[t]=a;var l=ca(T).create({errHandler:b,adapter:E,dvbFonts:v,manifestModel:S,mediaController:A,videoModel:I,textTracks:a,vttParser:s,vttCustomRenderingParser:o,ttmlParser:c,streamInfo:e,settings:C});l.initialize(),r[t]=l,n[t]={},n[t].lastEnabledIndex=-1},createTracks:function(e){var t=e.id;i[t]&&i[t].createTracks()},getTextSourceBuffer:function(e){var t=e.id;if(r&&r[t])return r[t]},getAllTracksAreDisabled:function(){return p},addEmbeddedTrack:function(e,t){var n=e.id;r[n]&&r[n].addEmbeddedTrack(t)},enableText:function(e,t){return(0,K.PS)(t,"boolean"),M()!==t&&(t&&x(e,n[e].lastEnabledIndex),t||(n[e].lastEnabledIndex=L(e),m?x(e,-1):y=!0)),!0},isTextEnabled:M,setTextTrack:x,getCurrentTrackIdx:L,enableForcedTextStreaming:function(e){return(0,K.PS)(e,"boolean"),g=e,!0},addMediaInfosToBuffer:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=e.id;r[a]&&r[a].addMediaInfos(t,n,i)},reset:function(){v.reset(),k(),h.off(u.Z.TEXT_TRACKS_QUEUE_INITIALIZED,N,t),h.off(u.Z.DVB_FONT_DOWNLOAD_FAILED,R,t),h.off(u.Z.DVB_FONT_DOWNLOAD_COMPLETE,D,t),C.get().streaming.text.webvtt.customRenderingEnabled&&(h.off(u.Z.PLAYBACK_TIME_UPDATED,O,t),h.off(u.Z.PLAYBACK_SEEKING,P,t)),Object.keys(r).forEach((function(e){r[e].resetEmbedded(),r[e].reset()}))}},g=!1,m=!1,y=!1,s=ya(T).getInstance(),o=_a(T).getInstance(),c=Ea(T).getInstance(),h=(0,l.Z)(T).getInstance(),_=(0,d.Z)(T).getInstance().getLogger(t),k(),t}Ra.__dashjs_factory_name="TextController";var Da=c.Z.getClassFactory(Ra);function Na(){var e,t,n,r,h,g,m,y,v,_,T,E,S,A,w,D,N,O,P,M,x,L,k,F,U,B,j,q,H,G,V,Y,Z,z,$,Q,J,ee,te,ne="You must first call initialize() and set a source before calling this method",re="You must first call initialize() and set a valid source and view before calling this method",ie="You must first call attachView() to set the video element before calling this method",ae="You must first call attachSource() with a valid source before calling this method",se="MediaPlayer not initialized!",oe=this.context,le=(0,l.Z)(oe).getInstance(),ue=(0,C.Z)(oe).getInstance(),ce=(0,d.Z)(oe).getInstance({settings:ue});function de(){we(null),Se(null),r=null,A&&(A.reset(),A=null),w&&(w.reset(),w=null),M&&M.reset(),ue.reset(),N&&(N.reset(),N=null)}function fe(){return!!n&&!!Q.getElement()}function he(){return(0,gi.e)()}function pe(){if(!m)throw re;return q.isPaused()}function ge(){if(!m)throw re;return q.getIsDynamic()}function me(e){var t=U&&U.hasVideoTrack()?a.Z.VIDEO:a.Z.AUDIO,n=Y.getCurrentDVRInfo(t);if(!n)return 0;var r=q.getOriginalLiveDelay(),i=n.range.start+e;return i>n.range.end-r&&(i=n.range.end-r),i}function ye(e){if(!m)throw re;var t=be().currentTime;if(void 0!==e)t=U.getTimeRelativeToStreamId(t,e);else if(q.getIsDynamic()){var n=U&&U.hasVideoTrack()?a.Z.VIDEO:a.Z.AUDIO,r=Y.getCurrentDVRInfo(n);t=null===r||0===t?0:Math.max(0,t-r.range.start)}return t}function ve(){if(!m)throw re;var e=be().duration;if(q.getIsDynamic()){var t=U&&U.hasVideoTrack()?a.Z.VIDEO:a.Z.AUDIO,n=Y.getCurrentDVRInfo(t);e=n?n.range.end-n.range.start:0}return e}function _e(e){(0,K.PS)(e,"boolean"),y=e}function Te(){M.restoreDefaultUTCTimingSources()}function Ee(){return Y}function be(){if(!Q.getElement())throw ie;return Q.getElement()}function Se(e){if(!h)throw se;Q.setElement(e),e&&(De(),function(){if(!w){var e=dashjs.MetricsReporting;if("function"==typeof e){var t=e(oe).create();w=t.createMetricsReporting({debug:ce,eventBus:le,mediaElement:be(),adapter:O,dashMetrics:Y,mediaPlayerModel:P,events:u.Z,constants:a.Z,metricsConstants:o.Z})}}}(),function(){if(!D){var e=dashjs.MssHandler;"function"==typeof e&&(I.extend(e.errors),D=e(oe).create({eventBus:le,mediaPlayerModel:P,dashMetrics:Y,manifestModel:Z,playbackController:q,streamController:U,protectionController:A,baseURLController:L,errHandler:x,events:u.Z,constants:a.Z,debug:ce,initSegmentType:R.w.INIT_SEGMENT_TYPE,BASE64:ea,ISOBoxer:ta,settings:ue}))}}(),U&&U.switchToVideoElement(v)),m&&Ce(),Pe(v)}function Ae(e){if(!g)throw ne;var t=U.getActiveStreamInfo();return t?S.getTracksFor(e,t.id):[]}function we(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:NaN;if(!h)throw se;"string"==typeof e&&J.initialize(e),null==t&&(t=NaN),isNaN(t)||(t=Math.max(0,t)),v=t,n=e,(g||m)&&Ce(),fe()&&Pe(v)}function Ie(){if(!g)throw ne;var e=U.getActiveStreamInfo();return e?U.getStreamById(e.id):null}function Ce(){m=!1,g=!1,O.reset(),U.reset(),j.reset(),V.reset(),q.reset(),H.reset(),G.reset(),_.reset(),S.reset(),te.reset(),A&&(ue.get().streaming.protection.keepProtectionMediaKeys?A.stop():(A.reset(),A=null,De())),B.reset(),z.reset(),$.reset()}function Re(){return Or(oe).create({debug:ce,errHandler:x,dashMetrics:Y,mediaPlayerModel:P,requestModifier:(0,W.Z)(oe).getInstance(),mssHandler:D,settings:ue})}function De(){if(A)return A;var e=dashjs.Protection;if("function"==typeof e){var t=e(oe).create();return u.Z.extend(e.events),f.Z.extend(e.events,{publicOnly:!0}),I.extend(e.errors),k||(k=(0,xr.Z)(oe).getInstance()),A=t.createProtectionSystem({debug:ce,errHandler:x,videoModel:Q,customParametersModel:M,capabilities:k,eventBus:le,events:u.Z,BASE64:ea,constants:a.Z,cmcdModel:z,settings:ue})}return null}function Ne(){if(!h)throw se;if(N)return N;var e=dashjs.OfflineController;if("function"==typeof e){u.Z.extend(e.events),f.Z.extend(e.events,{publicOnly:!0}),I.extend(e.errors);var t=Re(),n=Yt(oe).create();return n.setConfig({manifestModel:Z,adapter:O,manifestLoader:t,errHandler:x,contentSteeringController:G}),N=e(oe).create({debug:ce,manifestUpdater:n,baseURLController:L,manifestLoader:t,manifestModel:Z,mediaPlayerModel:P,abrController:_,playbackController:q,adapter:O,errHandler:x,dashMetrics:Y,timelineConverter:E,segmentBaseController:te,schemeLoaderFactory:T,eventBus:le,events:u.Z,errors:I,constants:a.Z,settings:ue,dashConstants:s.Z,urlUtils:(0,X.Z)(oe).getInstance()})}return null}function Oe(e){var t=U&&U.hasVideoTrack()?a.Z.VIDEO:a.Z.AUDIO,n=Y.getCurrentDVRInfo(t);return n?e+(n.manifestInfo.availableFrom.getTime()/1e3+n.range.start):0}function Pe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:NaN;N&&N.resetRecords(),!g&&n&&(g=!0,t.info("Streaming Initialized"),function(){var e=Re();U||(U=nn(oe).getInstance()),B||(B=Da(oe).create({errHandler:x,manifestModel:Z,adapter:O,mediaController:S,baseURLController:L,videoModel:Q,settings:ue})),F.setConfig({capabilities:k,customParametersModel:M,adapter:O,settings:ue,manifestModel:Z,errHandler:x}),U.setConfig({capabilities:k,capabilitiesFilter:F,manifestLoader:e,manifestModel:Z,mediaPlayerModel:P,customParametersModel:M,protectionController:A,textController:B,adapter:O,dashMetrics:Y,errHandler:x,timelineConverter:E,videoModel:Q,playbackController:q,serviceDescriptionController:H,contentSteeringController:G,abrController:_,mediaController:S,settings:ue,baseURLController:L,uriFragmentModel:J,segmentBaseController:te}),j.setConfig({settings:ue,playbackController:q,streamController:U,videoModel:Q,timelineConverter:E,adapter:O}),q.setConfig({streamController:U,serviceDescriptionController:H,dashMetrics:Y,adapter:O,videoModel:Q,timelineConverter:E,settings:ue}),V.setConfig({streamController:U,playbackController:q,mediaPlayerModel:P,videoModel:Q,settings:ue}),_.setConfig({streamController:U,domStorage:ee,mediaPlayerModel:P,customParametersModel:M,cmsdModel:$,dashMetrics:Y,adapter:O,videoModel:Q,settings:ue}),z.setConfig({abrController:_,dashMetrics:Y,playbackController:q}),$.setConfig({}),_.initialize(),U.initialize(y,r),B.initialize(),j.initialize(),V.initialize(),z.initialize(),$.initialize(),G.initialize(),te.initialize()}(),"string"==typeof n?U.load(n,e):U.loadWithManifest(n,e)),!m&&fe()&&(m=!0,t.info("Playback Initialized"))}return e={initialize:function(e,n,r){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:NaN;k||(k=(0,xr.Z)(oe).getInstance()).setConfig({settings:ue}),x||(x=Mr(oe).getInstance()),k.supportsMediaSource()?(h||(h=!0,E=Ji(oe).getInstance(),_||(_=ri(oe).getInstance()).setConfig({settings:ue}),T||(T=gt(oe).getInstance()),q||(q=p(oe).getInstance()),S||(S=vn(oe).getInstance()),U||(U=nn(oe).getInstance()),j||(j=an(oe).getInstance()),V||(V=on(oe).getInstance()),H||(H=fn(oe).getInstance()),G||(G=qt(oe).getInstance()),F||(F=kr(oe).getInstance()),O=xi(oe).getInstance(),Z=qr(oe).getInstance(),z=Ve(oe).getInstance(),$=ot(oe).getInstance(),Y=$i(oe).getInstance({settings:ue}),ee=pi(oe).getInstance({settings:ue}),O.setConfig({constants:a.Z,cea608parser:i(),errHandler:x,BASE64:ea}),L||(L=Pn(oe).create()),L.setConfig({adapter:O,contentSteeringController:G}),H.setConfig({adapter:O}),te||(te=Ai(oe).getInstance({dashMetrics:Y,mediaPlayerModel:P,errHandler:x,baseURLController:L,events:u.Z,eventBus:le,debug:ce,boxParser:(0,Pt.Z)(oe).getInstance(),requestModifier:(0,W.Z)(oe).getInstance(),errors:I})),S.setConfig({domStorage:ee,settings:ue,customParametersModel:M}),P.setConfig({playbackController:q,serviceDescriptionController:H}),G.setConfig({adapter:O,errHandler:x,dashMetrics:Y,mediaPlayerModel:P,manifestModel:Z,serviceDescriptionController:H,eventBus:le,requestModifier:(0,W.Z)(oe).getInstance()}),Te(),_e(void 0===r||r),Ne()),e&&Se(e),n&&we(n,s),t.info("[dash.js "+he()+"] MediaPlayer has been initialized")):x.error(new b.Z(I.CAPABILITY_MEDIASOURCE_ERROR_CODE,I.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE))},setConfig:function(e){e&&(e.capabilities&&(k=e.capabilities),e.capabilitiesFilter&&(F=e.capabilitiesFilter),e.streamController&&(U=e.streamController),e.textController&&(B=e.textController),e.gapController&&(j=e.gapController),e.playbackController&&(q=e.playbackController),e.serviceDescriptionController&&(H=e.serviceDescriptionController),e.contentSteeringController&&(G=e.contentSteeringController),e.catchupController&&(V=e.catchupController),e.mediaPlayerModel&&(P=e.mediaPlayerModel),e.customParametersModel&&(M=e.customParametersModel),e.abrController&&(_=e.abrController),e.schemeLoaderFactory&&(T=e.schemeLoaderFactory),e.mediaController&&(S=e.mediaController),e.settings&&(ue=e.settings))},on:function(e,t,n,r){le.on(e,t,n,r)},off:function(e,t,n){le.off(e,t,n)},extend:function(e,t,n){c.Z.extend(e,t,n,oe)},attachView:Se,attachSource:we,refreshManifest:function(e){if(!h)throw se;if(!fe())return e(null,ae);var t=this;"function"==typeof e&&le.on(u.Z.INTERNAL_MANIFEST_LOADED,(function n(r){le.off(u.Z.INTERNAL_MANIFEST_LOADED,n,t),r.error?e(null,r.error):e(r.manifest)}),t),U.refreshManifest()},isReady:fe,preload:function(){if(!Q.getElement()&&!g){if(!n)throw ae;Pe(v)}},play:function(){if(!m)throw re;(!y||pe()&&m)&&q.play(!0)},isPaused:pe,pause:function(){if(!m)throw re;q.pause()},isSeeking:function(){if(!m)throw re;return q.isSeeking()},isDynamic:ge,getLowLatencyModeEnabled:function(){if(!m)throw re;return q.getLowLatencyModeEnabled()},seek:function(e){if(!m)throw re;if((0,K.PS)(e,"number"),isNaN(e))throw a.Z.BAD_ARGUMENT_ERROR;e<0&&(e=0);var t=q.getIsDynamic()?me(e):e,n=be();!q.getIsDynamic()&&n.duration&&(t=Math.min(n.duration,t)),q.seek(t,!1,!1,!0)},seekToOriginalLive:function(){m&&ge()&&q.seekToOriginalLive()},setPlaybackRate:function(e){be().playbackRate=e},getPlaybackRate:function(){return be().playbackRate},setMute:function(e){(0,K.PS)(e,"boolean"),be().muted=e},isMuted:function(){return be().muted},setVolume:function(e){if("number"!=typeof e||isNaN(e)||e<0||e>1)throw a.Z.BAD_ARGUMENT_ERROR;be().volume=e},getVolume:function(){return be().volume},time:ye,duration:ve,timeAsUTC:function(){if(!m)throw re;return ye()<0?NaN:Oe(ye())},durationAsUTC:function(){if(!m)throw re;return Oe(ve())},getActiveStream:Ie,getDVRWindowSize:function(){var e=U&&U.hasVideoTrack()?a.Z.VIDEO:a.Z.AUDIO,t=Y.getCurrentDVRInfo(e);return t?t.manifestInfo.dvrWindowSize:0},getDVRSeekOffset:me,getAvailableBaseUrls:function(){var e=Z.getValue();return e?L.getBaseUrls(e):[]},getAvailableLocations:function(){var e=Z.getValue();if(!e)return[];var t=O.getLocation(e),n=G.getSynthesizedLocationElements(t);return t.concat(n)},getTargetLiveDelay:function(){if(!m)throw re;return q.getOriginalLiveDelay()},convertToTimeCode:function(e){e=Math.max(e,0);var t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%3600%60);return(0===t?"":t<10?"0"+t.toString()+":":t.toString()+":")+(n<10?"0"+n.toString():n.toString())+":"+(r<10?"0"+r.toString():r.toString())},formatUTC:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=new Date(1e3*e),a=i.toLocaleDateString(t),s=i.toLocaleTimeString(t,{hour12:n});return r?s+" "+a:s},getVersion:he,getDebug:function(){return ce},getBufferLength:function(e){var n=[a.Z.VIDEO,a.Z.AUDIO,a.Z.TEXT];if(e)return-1!==n.indexOf(e)?Ee().getCurrentBufferLevel(e)||NaN:(t.warn("getBufferLength requested for invalid type"),NaN);var r=n.map((function(e){return Ae(e).length>0?Ee().getCurrentBufferLevel(e):Number.MAX_VALUE})).reduce((function(e,t){return Math.min(e,t)}));return r===Number.MAX_VALUE?NaN:r},getTTMLRenderingDiv:function(){return Q?Q.getTTMLRenderingDiv():null},getVideoElement:be,getSource:function(){if(!n)throw ae;return n},updateSource:function(e){n=e,U.load(n)},getCurrentLiveLatency:function(){if(!h)throw se;return m?q.getCurrentLiveLatency():NaN},getTopBitrateInfoFor:function(e){if(!g)throw ne;return _.getTopBitrateInfoFor(e)},setAutoPlay:_e,getAutoPlay:function(){return y},getDashMetrics:Ee,getQualityFor:function(e){if(!g)throw ne;if(e===a.Z.IMAGE){var t=Ie();if(!t)return-1;var n=t.getThumbnailController();return n?n.getCurrentTrackIndex():-1}return _.getQualityFor(e)},setQualityFor:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!g)throw ne;if(e===a.Z.IMAGE){var r=Ie();if(!r)return;var i=r.getThumbnailController();i&&i.setTrackByIndex(t)}_.setPlaybackQuality(e,U.getActiveStreamInfo(),t,{forceReplace:n})},updatePortalSize:function(){_.setElementSize(),_.setWindowResizeEventCalled(!0)},enableText:function(e){var t=U.getActiveStreamInfo();return!(!t||!B)&&B.enableText(t.id,e)},enableForcedTextStreaming:function(e){return!(!U.getActiveStreamInfo()||!B)&&B.enableForcedTextStreaming(e)},isTextEnabled:function(){var e=U.getActiveStreamInfo();return!(!e||!B)&&B.isTextEnabled(e)},setTextTrack:function(e){if(!m)throw re;var t=U.getActiveStreamInfo();t&&B&&B.setTextTrack(t.id,e)},getBitrateInfoListFor:function(e){if(!g)throw ne;var t=Ie();return t?t.getBitrateListFor(e):[]},getStreamsFromManifest:function(e){if(!g)throw ne;return O.getStreamsInfo(e)},getTracksFor:Ae,getTracksForTypeFromManifest:function(e,t,n){if(!g)throw ne;return(n=n||O.getStreamsInfo(t,1)[0])?O.getAllMediaInfoForType(n,e,t):[]},getCurrentTrackFor:function(e){if(!g)throw ne;var t=U.getActiveStreamInfo();return S.getCurrentTrackFor(e,t.id)},setInitialMediaSettingsFor:function(e,t){if(!h)throw se;S.setInitialSettings(e,t)},getInitialMediaSettingsFor:function(e){if(!h)throw se;return S.getInitialSettings(e)},setCurrentTrack:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!g)throw ne;S.setTrack(e,t)},addABRCustomRule:function(e,t,n){M.addAbrCustomRule(e,t,n)},removeABRCustomRule:function(e){M.removeAbrCustomRule(e)},removeAllABRCustomRule:function(){M.removeAllAbrCustomRule()},getABRCustomRules:function(){return M.getAbrCustomRules()},getAverageThroughput:function(e){var t=_.getThroughputHistory(),n=q.getIsDynamic();return t?t.getAverageThroughput(e,n):0},retrieveManifest:function(e,t){var n=Re(),r=this;le.on(u.Z.INTERNAL_MANIFEST_LOADED,(function e(i){i.error?t(null,i.error):t(i.manifest),le.off(u.Z.INTERNAL_MANIFEST_LOADED,e,r),n.reset()}),r),J.initialize(e),n.load(e)},addUTCTimingSource:function(e,t){M.addUTCTimingSource(e,t)},removeUTCTimingSource:function(e,t){M.removeUTCTimingSource(e,t)},clearDefaultUTCTimingSources:function(){M.clearDefaultUTCTimingSources()},restoreDefaultUTCTimingSources:Te,setXHRWithCredentialsForType:function(e,t){M.setXHRWithCredentialsForType(e,t)},getXHRWithCredentialsForType:function(e){return M.getXHRWithCredentialsForType(e)},getProtectionController:function(){return De()},attachProtectionController:function(e){A=e},setProtectionData:function(e){r=e,U&&U.setProtectionData(r)},registerLicenseRequestFilter:function(e){M.registerLicenseRequestFilter(e)},registerLicenseResponseFilter:function(e){M.registerLicenseResponseFilter(e)},unregisterLicenseRequestFilter:function(e){M.unregisterLicenseRequestFilter(e)},unregisterLicenseResponseFilter:function(e){M.unregisterLicenseResponseFilter(e)},registerCustomCapabilitiesFilter:function(e){M.registerCustomCapabilitiesFilter(e)},unregisterCustomCapabilitiesFilter:function(e){M.unregisterCustomCapabilitiesFilter(e)},setCustomInitialTrackSelectionFunction:function(e){M.setCustomInitialTrackSelectionFunction(e)},resetCustomInitialTrackSelectionFunction:function(){M.resetCustomInitialTrackSelectionFunction(null)},attachTTMLRenderingDiv:function(e){if(!Q.getElement())throw ie;Q.setTTMLRenderingDiv(e)},attachVttRenderingDiv:function(e){if(!Q.getElement())throw ie;Q.setVttRenderingDiv(e)},getCurrentTextTrackIndex:function(){var e=U.getActiveStreamInfo();if(e&&B)return B.getCurrentTrackIdx(e.id)},provideThumbnail:function(e,t){if("function"==typeof t)if(e<0)t(null);else{var n=q.getIsDynamic()?me(e):e,r=U.getStreamForTime(n);if(null!==r){var i=r.getThumbnailController();if(i)return i.provide(n,t);t(null)}else t(null)}},getDashAdapter:function(){return O},getOfflineController:function(){return Ne()},triggerSteeringRequest:function(){if(G)return G.loadSteeringData()},getCurrentSteeringResponseData:function(){if(G)return G.getCurrentSteeringResponseData()},getSettings:function(){return ue.get()},updateSettings:function(e){ue.update(e)},resetSettings:function(){ue.reset()},reset:de,destroy:function(){de(),c.Z.deleteSingletonInstances(oe)}},t=ce.getLogger(e),h=!1,m=!1,g=!1,y=!0,v=NaN,A=null,N=null,r=null,O=null,te=null,u.Z.extend(f.Z),P=Vr(oe).getInstance(),M=(0,ct.Z)(oe).getInstance(),Q=si(oe).getInstance(),J=Br(oe).getInstance(),e}Na.__dashjs_factory_name="MediaPlayer";var Oa=c.Z.getClassFactory(Na);Oa.events=f.Z,Oa.errors=I,c.Z.updateClassFactory(Na.__dashjs_factory_name,Oa);var Pa=Oa},8825:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}var o=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=s(t);if(n){var i=s(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return a(this,e)});function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=r.call(this)).AST_IN_FUTURE="astInFuture",e.BASE_URLS_UPDATED="baseUrlsUpdated",e.BUFFER_EMPTY="bufferStalled",e.BUFFER_LOADED="bufferLoaded",e.BUFFER_LEVEL_STATE_CHANGED="bufferStateChanged",e.BUFFER_LEVEL_UPDATED="bufferLevelUpdated",e.DVB_FONT_DOWNLOAD_ADDED="dvbFontDownloadAdded",e.DVB_FONT_DOWNLOAD_COMPLETE="dvbFontDownloadComplete",e.DVB_FONT_DOWNLOAD_FAILED="dvbFontDownloadFailed",e.DYNAMIC_TO_STATIC="dynamicToStatic",e.ERROR="error",e.FRAGMENT_LOADING_COMPLETED="fragmentLoadingCompleted",e.FRAGMENT_LOADING_PROGRESS="fragmentLoadingProgress",e.FRAGMENT_LOADING_STARTED="fragmentLoadingStarted",e.FRAGMENT_LOADING_ABANDONED="fragmentLoadingAbandoned",e.LOG="log",e.MANIFEST_LOADING_STARTED="manifestLoadingStarted",e.MANIFEST_LOADING_FINISHED="manifestLoadingFinished",e.MANIFEST_LOADED="manifestLoaded",e.METRICS_CHANGED="metricsChanged",e.METRIC_CHANGED="metricChanged",e.METRIC_ADDED="metricAdded",e.METRIC_UPDATED="metricUpdated",e.PERIOD_SWITCH_STARTED="periodSwitchStarted",e.PERIOD_SWITCH_COMPLETED="periodSwitchCompleted",e.QUALITY_CHANGE_REQUESTED="qualityChangeRequested",e.QUALITY_CHANGE_RENDERED="qualityChangeRendered",e.TRACK_CHANGE_RENDERED="trackChangeRendered",e.STREAM_INITIALIZING="streamInitializing",e.STREAM_UPDATED="streamUpdated",e.STREAM_ACTIVATED="streamActivated",e.STREAM_DEACTIVATED="streamDeactivated",e.STREAM_INITIALIZED="streamInitialized",e.STREAM_TEARDOWN_COMPLETE="streamTeardownComplete",e.TEXT_TRACKS_ADDED="allTextTracksAdded",e.TEXT_TRACK_ADDED="textTrackAdded",e.CUE_ENTER="cueEnter",e.CUE_EXIT="cueExit",e.THROUGHPUT_MEASUREMENT_STORED="throughputMeasurementStored",e.TTML_PARSED="ttmlParsed",e.TTML_TO_PARSE="ttmlToParse",e.CAPTION_RENDERED="captionRendered",e.CAPTION_CONTAINER_RESIZE="captionContainerResize",e.CAN_PLAY="canPlay",e.CAN_PLAY_THROUGH="canPlayThrough",e.PLAYBACK_ENDED="playbackEnded",e.PLAYBACK_ERROR="playbackError",e.PLAYBACK_NOT_ALLOWED="playbackNotAllowed",e.PLAYBACK_METADATA_LOADED="playbackMetaDataLoaded",e.PLAYBACK_LOADED_DATA="playbackLoadedData",e.PLAYBACK_PAUSED="playbackPaused",e.PLAYBACK_PLAYING="playbackPlaying",e.PLAYBACK_PROGRESS="playbackProgress",e.PLAYBACK_RATE_CHANGED="playbackRateChanged",e.PLAYBACK_SEEKED="playbackSeeked",e.PLAYBACK_SEEKING="playbackSeeking",e.PLAYBACK_STALLED="playbackStalled",e.PLAYBACK_STARTED="playbackStarted",e.PLAYBACK_TIME_UPDATED="playbackTimeUpdated",e.PLAYBACK_VOLUME_CHANGED="playbackVolumeChanged",e.PLAYBACK_WAITING="playbackWaiting",e.MANIFEST_VALIDITY_CHANGED="manifestValidityChanged",e.EVENT_MODE_ON_START="eventModeOnStart",e.EVENT_MODE_ON_RECEIVE="eventModeOnReceive",e.CONFORMANCE_VIOLATION="conformanceViolation",e.REPRESENTATION_SWITCH="representationSwitch",e.ADAPTATION_SET_REMOVED_NO_CAPABILITIES="adaptationSetRemovedNoCapabilities",e.CONTENT_STEERING_REQUEST_COMPLETED="contentSteeringRequestCompleted",e.INBAND_PRFT="inbandPrft",e.MANAGED_MEDIA_SOURCE_START_STREAMING="managedMediaSourceStartStreaming",e.MANAGED_MEDIA_SOURCE_END_STREAMING="managedMediaSourceEndStreaming",e}return o}(n(8342).Z));t.Z=o},3393:function(e,t){"use strict";var n=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t;return(t=[{key:"init",value:function(){this.STREAM="stream",this.VIDEO="video",this.AUDIO="audio",this.TEXT="text",this.MUXED="muxed",this.IMAGE="image",this.STPP="stpp",this.TTML="ttml",this.VTT="vtt",this.WVTT="wvtt",this.CONTENT_STEERING="contentSteering",this.ABR_STRATEGY_DYNAMIC="abrDynamic",this.ABR_STRATEGY_BOLA="abrBola",this.ABR_STRATEGY_L2A="abrL2A",this.ABR_STRATEGY_LoLP="abrLoLP",this.ABR_STRATEGY_THROUGHPUT="abrThroughput",this.ABR_FETCH_THROUGHPUT_CALCULATION_DOWNLOADED_DATA="abrFetchThroughputCalculationDownloadedData",this.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING="abrFetchThroughputCalculationMoofParsing",this.ABR_FETCH_THROUGHPUT_CALCULATION_AAST="abrFetchThroughputCalculationAAST",this.LIVE_CATCHUP_MODE_DEFAULT="liveCatchupModeDefault",this.LIVE_CATCHUP_MODE_LOLP="liveCatchupModeLoLP",this.MOVING_AVERAGE_SLIDING_WINDOW="slidingWindow",this.MOVING_AVERAGE_EWMA="ewma",this.BAD_ARGUMENT_ERROR="Invalid Arguments",this.MISSING_CONFIG_ERROR="Missing config parameter(s)",this.TRACK_SWITCH_MODE_ALWAYS_REPLACE="alwaysReplace",this.TRACK_SWITCH_MODE_NEVER_REPLACE="neverReplace",this.TRACK_SELECTION_MODE_FIRST_TRACK="firstTrack",this.TRACK_SELECTION_MODE_HIGHEST_BITRATE="highestBitrate",this.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY="highestEfficiency",this.TRACK_SELECTION_MODE_WIDEST_RANGE="widestRange",this.TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY="highestSelectionPriority",this.CMCD_MODE_QUERY="query",this.CMCD_MODE_HEADER="header",this.INITIALIZE="initialize",this.TEXT_SHOWING="showing",this.TEXT_HIDDEN="hidden",this.TEXT_DISABLED="disabled",this.CC1="CC1",this.CC3="CC3",this.UTF8="utf-8",this.SCHEME_ID_URI="schemeIdUri",this.START_TIME="starttime",this.SERVICE_DESCRIPTION_DVB_LL_SCHEME="urn:dvb:dash:lowlatency:scope:2019",this.SUPPLEMENTAL_PROPERTY_DVB_LL_SCHEME="urn:dvb:dash:lowlatency:critical:2019",this.FONT_DOWNLOAD_DVB_SCHEME="urn:dvb:dash:fontdownload:2014",this.XML="XML",this.ARRAY_BUFFER="ArrayBuffer",this.DVB_REPORTING_URL="dvb:reportingUrl",this.DVB_PROBABILITY="dvb:probability",this.OFF_MIMETYPE="application/font-sfnt",this.WOFF_MIMETYPE="application/font-woff",this.VIDEO_ELEMENT_READY_STATES={HAVE_NOTHING:0,HAVE_METADATA:1,HAVE_CURRENT_DATA:2,HAVE_FUTURE_DATA:3,HAVE_ENOUGH_DATA:4},this.FILE_LOADER_TYPES={FETCH:"fetch_loader",XHR:"xhr_loader"}}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}());t.Z=n},3860:function(e,t){"use strict";var n=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t;return(t=[{key:"init",value:function(){this.TCP_CONNECTION="TcpList",this.HTTP_REQUEST="HttpList",this.TRACK_SWITCH="RepSwitchList",this.BUFFER_LEVEL="BufferLevel",this.BUFFER_LOADED="bufferLoaded",this.ABANDON_LOAD="abandonload",this.ALLOW_LOAD="allowload",this.BUFFER_EMPTY="bufferStalled",this.BUFFER_STATE="BufferState",this.DVR_INFO="DVRInfo",this.DROPPED_FRAMES="DroppedFrames",this.SCHEDULING_INFO="SchedulingInfo",this.REQUESTS_QUEUE="RequestsQueue",this.MANIFEST_UPDATE="ManifestUpdate",this.MANIFEST_UPDATE_STREAM_INFO="ManifestUpdatePeriodInfo",this.MANIFEST_UPDATE_TRACK_INFO="ManifestUpdateRepresentationInfo",this.PLAY_LIST="PlayList",this.DVB_ERRORS="DVBErrors",this.HTTP_REQUEST_DVB_REPORTING_TYPE="DVBReporting"}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}());t.Z=n},8080:function(e,t,n){"use strict";n.d(t,{default:function(){return Z}});var r=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mpdurl=null,this.errorcode=null,this.terror=null,this.url=null,this.ipaddress=null,this.servicelocation=null};r.SSL_CONNECTION_FAILED_PREFIX="SSL",r.DNS_RESOLUTION_FAILED="C00",r.HOST_UNREACHABLE="C01",r.CONNECTION_REFUSED="C02",r.CONNECTION_ERROR="C03",r.CORRUPT_MEDIA_ISOBMFF="M00",r.CORRUPT_MEDIA_OTHER="M01",r.BASE_URL_CHANGED="F00",r.BECAME_REPORTER="S00";var i=r,a=n(1180);function s(e){var t,n,r=(e=e||{}).eventBus,s=e.dashMetrics,o=e.metricsConstants,l=e.events;function u(e){var t=new i;if(n){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.mpdurl||(t.mpdurl=n.originalUrl||n.url),t.terror||(t.terror=new Date),s.addDVBErrors(t)}}function c(e){e.error||(n=e.manifest)}function d(e){u({errorcode:i.BASE_URL_CHANGED,servicelocation:e.entry})}function f(){u({errorcode:i.BECAME_REPORTER})}function h(e){var t;e.metric===o.HTTP_REQUEST&&(0===(t=e.value).responsecode||null==t.responsecode||t.responsecode>=400||t.responsecode<100||t.responsecode>=600)&&u({errorcode:t.responsecode||i.CONNECTION_ERROR,url:t.url,terror:t.tresponse,servicelocation:t._serviceLocation})}function p(e){var t;switch(e.error?e.error.code:0){case MediaError.MEDIA_ERR_NETWORK:t=i.CONNECTION_ERROR;break;case MediaError.MEDIA_ERR_DECODE:t=i.CORRUPT_MEDIA_OTHER;break;default:return}u({errorcode:t})}return t={initialize:function(){r.on(l.MANIFEST_UPDATED,c,t),r.on(l.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,d,t),r.on(l.METRIC_ADDED,h,t),r.on(l.METRIC_UPDATED,h,t),r.on(l.PLAYBACK_ERROR,p,t),r.on(a.Z.BECAME_REPORTING_PLAYER,f,t)},reset:function(){r.off(l.MANIFEST_UPDATED,c,t),r.off(l.SERVICE_LOCATION_BASE_URL_BLACKLIST_CHANGED,d,t),r.off(l.METRIC_ADDED,h,t),r.off(l.METRIC_UPDATED,h,t),r.off(l.PLAYBACK_ERROR,p,t),r.off(a.Z.BECAME_REPORTING_PLAYER,f,t)}}}s.__dashjs_factory_name="DVBErrorsTranslator";var o=dashjs.FactoryMaker.getSingletonFactory(s),l=n(2295);function u(e){e=e||{};var t,n,r=!1,i=this.context,a=e.mediaElement;return t={initialize:function(e){e&&e.length&&(e.forEach((function(e){var t=e.starttime,r=t+e.duration;n.add(t,r)})),r=!!e[0]._useWallClockTime)},reset:function(){n.clear()},isEnabled:function(){var e,t=n.length;if(!t)return!0;e=r?(new Date).getTime()/1e3:a.currentTime;for(var i=0;i<t;i+=1){var s=n.start(i),o=n.end(i);if(s<=e&&e<o)return!0}return!1}},n=(0,l.Z)(i).create(),t}u.__dashjs_factory_name="RangeController";var c=dashjs.FactoryMaker.getClassFactory(u);function d(){return{serialise:function e(t){var n,r,i=[],a=[];for(n in t)if(t.hasOwnProperty(n)&&0!==n.indexOf("_")){if(null==(r=t[n])&&(r=""),Array.isArray(r)){if(!r.length)continue;a=[],r.forEach((function(t){var n="Object"!==Object.prototype.toString.call(t).slice(8,-1);a.push(n?t:e(t))})),r=a.map(encodeURIComponent).join(",")}else"string"==typeof r?r=encodeURIComponent(r):r instanceof Date?r=r.toISOString():"number"==typeof r&&(r=Math.round(r));i.push(n+"="+r)}return i.join("&")}}}d.__dashjs_factory_name="MetricSerialiser";var f=dashjs.FactoryMaker.getSingletonFactory(d);function h(){var e,t,n,r=window.crypto||window.msCrypto,i=Uint32Array,a=Math.pow(2,8*i.BYTES_PER_ELEMENT)-1;function s(){r&&(e||(e=new i(10)),r.getRandomValues(e),t=0)}return n={random:function(n,i){var o;return n||(n=0),i||(i=1),r?(t===e.length&&s(),o=e[t]/a,t+=1):o=Math.random(),o*(i-n)+n}},s(),n}h.__dashjs_factory_name="RNG";var p=dashjs.FactoryMaker.getSingletonFactory(h),g=n(5717);function m(e){var t;e=e||{};var n,r,i,a,s,o,l,u=this.context,c=[],d=e.metricsConstants;function h(){a=!1,s=!1,o=null,l=null}return t={report:function(e,t){Array.isArray(t)||(t=[t]),s&&l.isEnabled()&&t.forEach((function(t){var i=n.serialise(t);e!==d.DVB_ERRORS&&(i="metricname=".concat(e,"&").concat(i)),function(e,t,n){var i=new XMLHttpRequest;i.withCredentials=r.getXHRWithCredentialsForType(d.HTTP_REQUEST_DVB_REPORTING_TYPE);var a=function(){var e=c.indexOf(i);-1!==e&&(c.splice(e,1),!(i.status>=200&&i.status<300)&&n&&n())};c.push(i);try{i.open("GET",e),i.onloadend=a,i.onerror=a,i.send()}catch(e){i.onerror()}}(i="".concat(o,"?").concat(i),0,(function(){s=!1}))}))},initialize:function(e,t){var n;if(l=t,!(o=e.dvbReportingUrl))throw new Error("required parameter missing (dvb:reportingUrl)");a||((n=e.dvbProbability)&&(1e3===n||n/1e3>=i.random())&&(s=!0),a=!0)},reset:function(){h()}},n=f(u).getInstance(),i=p(u).getInstance(),r=(0,g.Z)(u).getInstance(),h(),t}m.__dashjs_factory_name="DVBReporting";var y=dashjs.FactoryMaker.getClassFactory(m);function v(e){e=e||{};var t={"urn:dvb:dash:reporting:2014":y},n=this.context,r=e.debug?e.debug.getLogger(undefined):{},i=e.metricsConstants,a=e.mediaPlayerModel||{};return{create:function(e,s){var o;try{(o=t[e.schemeIdUri](n).create({metricsConstants:i,mediaPlayerModel:a})).initialize(e,s)}catch(s){o=null,r.error("ReportingFactory: could not create Reporting with schemeIdUri ".concat(e.schemeIdUri," (").concat(s.message,")"))}return o},register:function(e,n){t[e]=n},unregister:function(e){delete t[e]}}}v.__dashjs_factory_name="ReportingFactory";var _=dashjs.FactoryMaker.getSingletonFactory(v);function T(e){var t=[],n=_(this.context).getInstance(e);return{initialize:function(e,r){e.some((function(e){var i=n.create(e,r);if(i)return t.push(i),!0}))},reset:function(){t.forEach((function(e){return e.reset()})),t=[]},report:function(e,n){t.forEach((function(t){return t.report(e,n)}))}}}T.__dashjs_factory_name="ReportingController";var E=dashjs.FactoryMaker.getClassFactory(T);function b(){return{reconstructFullMetricName:function(e,t,n){var r=e;return t&&(r+="("+t,n&&n.length&&(r+=","+n),r+=")"),r},validateN:function(e){if(!e)throw new Error("missing n");if(isNaN(e))throw new Error("n is NaN");if(e<0)throw new Error("n must be positive");return e}}}b.__dashjs_factory_name="HandlerHelpers";var S=dashjs.FactoryMaker.getSingletonFactory(b);function A(e){var t,n,r,i,a;e=e||{};var s=this.context,o=S(s).getInstance(),l=[],u=e.metricsConstants;function c(){var e=function(){try{return Object.keys(l).map((function(e){return l[e]})).reduce((function(e,t){return e.level<t.level?e:t}))}catch(e){return}}();e&&a!==e.t&&(a=e.t,t.report(r,e))}return{initialize:function(e,a,s){a&&(n=o.validateN(s),t=a,r=o.reconstructFullMetricName(e,s),i=setInterval(c,n))},reset:function(){clearInterval(i),i=null,n=0,t=null,a=null},handleNewMetric:function(e,t,n){e===u.BUFFER_LEVEL&&(l[n]=t)}}}A.__dashjs_factory_name="BufferLevelHandler";var w=dashjs.FactoryMaker.getClassFactory(A),I=dashjs.FactoryMaker.getClassFactory((function(e){var t,n=(e=e||{}).eventBus,r=e.metricsConstants;function i(){n.off(a.Z.METRICS_INITIALISATION_COMPLETE,i,this),n.trigger(a.Z.BECAME_REPORTING_PLAYER)}return{initialize:function(e,r){r&&(t=r,n.on(a.Z.METRICS_INITIALISATION_COMPLETE,i,this))},reset:function(){t=null},handleNewMetric:function(e,n){e===r.DVB_ERRORS&&t&&t.report(e,n)}}}));function C(e){var t,n,r,i,a;e=e||{};var s=[],o=S(this.context).getInstance(),l=e.metricsConstants;function u(){var e=s;e.length&&t&&t.report(i,e),s=[]}return{initialize:function(e,s,l,c){s&&(n=o.validateN(l),t=s,c&&c.length&&(r=c),i=o.reconstructFullMetricName(e,l,c),a=setInterval(u,n))},reset:function(){clearInterval(a),a=null,n=null,r=null,s=[],t=null},handleNewMetric:function(e,t){e===l.HTTP_REQUEST&&(r&&r!==t.type||s.push(t))}}}C.__dashjs_factory_name="HttpListHandler";var R=dashjs.FactoryMaker.getClassFactory(C);function D(){var e,t;return{initialize:function(n,r){e=n,t=r},reset:function(){t=null,e=void 0},handleNewMetric:function(n,r){n===e&&t&&t.report(e,r)}}}D.__dashjs_factory_name="GenericMetricHandler";var N=dashjs.FactoryMaker.getClassFactory(D);function O(e){var t=(e=e||{}).debug?e.debug.getLogger(undefined):{},n=/([a-zA-Z]*)(\(([0-9]*)(\,\s*([a-zA-Z]*))?\))?/,r=this.context,i={BufferLevel:w,DVBErrors:I,HttpList:R,PlayList:N,RepSwitchList:N,TcpList:N};return{create:function(a,s){var o,l=a.match(n);if(l){try{(o=i[l[1]](r).create({eventBus:e.eventBus,metricsConstants:e.metricsConstants})).initialize(l[1],s,l[3],l[5])}catch(e){o=null,t.error("MetricsHandlerFactory: Could not create handler for type ".concat(l[1]," with args ").concat(l[3],", ").concat(l[5]," (").concat(e.message,")"))}return o}},register:function(e,t){i[e]=t},unregister:function(e){delete i[e]}}}O.__dashjs_factory_name="MetricsHandlerFactory";var P=dashjs.FactoryMaker.getSingletonFactory(O);function M(e){e=e||{};var t,n=[],r=this.context,i=e.eventBus,a=e.events,s=P(r).getInstance({debug:e.debug,eventBus:e.eventBus,metricsConstants:e.metricsConstants});function o(e){n.forEach((function(t){t.handleNewMetric(e.metric,e.value,e.mediaType)}))}return t={initialize:function(e,r){e.split(",").forEach((function(e,t,i){var a;if(-1!==e.indexOf("(")&&-1===e.indexOf(")")){var o=i[t+1];o&&-1===o.indexOf("(")&&-1!==o.indexOf(")")&&(e+=","+o,delete i[t+1])}(a=s.create(e,r))&&n.push(a)})),i.on(a.METRIC_ADDED,o,t),i.on(a.METRIC_UPDATED,o,t)},reset:function(){i.off(a.METRIC_ADDED,o,t),i.off(a.METRIC_UPDATED,o,t),n.forEach((function(e){return e.reset()})),n=[]}}}M.__dashjs_factory_name="MetricsHandlersController";var x=dashjs.FactoryMaker.getClassFactory(M);function L(e){var t,n,r;e=e||{};var i=this.context;function a(){t&&t.reset(),n&&n.reset(),r&&r.reset()}return{initialize:function(s){try{(r=c(i).create({mediaElement:e.mediaElement})).initialize(s.Range),(n=E(i).create({debug:e.debug,metricsConstants:e.metricsConstants,mediaPlayerModel:e.mediaPlayerModel})).initialize(s.Reporting,r),(t=x(i).create({debug:e.debug,eventBus:e.eventBus,metricsConstants:e.metricsConstants,events:e.events})).initialize(s.metrics,n)}catch(e){throw a(),e}},reset:a}}L.__dashjs_factory_name="MetricsController";var k=dashjs.FactoryMaker.getClassFactory(L),F=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.metrics="",this.Range=[],this.Reporting=[]},U=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.starttime=0,this.duration=1/0,this._useWallClockTime=!1},B=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.schemeIdUri="",this.value="",this.dvbReportingUrl="",this.dvbProbability=1e3};function j(e){var t=(e=e||{}).adapter,n=e.constants;return{getMetrics:function(e){var r=[];return e&&e.Metrics_asArray&&e.Metrics_asArray.forEach((function(i){var a=new F,s=t.getIsDynamic(e);i.hasOwnProperty("metrics")&&(a.metrics=i.metrics,i.Range_asArray&&i.Range_asArray.forEach((function(r){var i=new U;i.starttime=function(e,r,i){var a,s,o=0;return r?o=t.getAvailabilityStartTime(e)/1e3:(a=t.getRegularPeriods(e)).length&&(o=a[0].start),s=o,i&&i.hasOwnProperty(n.START_TIME)&&(s+=i.starttime),s}(e,s,r),r.hasOwnProperty("duration")?i.duration=r.duration:i.duration=t.getDuration(e),i._useWallClockTime=s,a.Range.push(i)})),i.Reporting_asArray&&(i.Reporting_asArray.forEach((function(e){var t=new B;e.hasOwnProperty(n.SCHEME_ID_URI)&&(t.schemeIdUri=e.schemeIdUri,e.hasOwnProperty("value")&&(t.value=e.value),e.hasOwnProperty(n.DVB_REPORTING_URL)&&(t.dvbReportingUrl=e[n.DVB_REPORTING_URL]),e.hasOwnProperty(n.DVB_PROBABILITY)&&(t.dvbProbability=e[n.DVB_PROBABILITY]),a.Reporting.push(t))})),r.push(a)))})),r}}}j.__dashjs_factory_name="ManifestParsing";var q=dashjs.FactoryMaker.getSingletonFactory(j);function H(e){var t;e=e||{};var n={},r=this.context,i=e.eventBus,s=e.events;function o(t){if(!t.error){var s=Object.keys(n);q(r).getInstance({adapter:e.adapter,constants:e.constants}).getMetrics(t.manifest).forEach((function(t){var i=JSON.stringify(t);if(n.hasOwnProperty(i))s.splice(i,1);else try{var a=k(r).create(e);a.initialize(t),n[i]=a}catch(e){}})),s.forEach((function(e){n[e].reset(),delete n[e]})),i.trigger(a.Z.METRICS_INITIALISATION_COMPLETE)}}function l(){Object.keys(n).forEach((function(e){n[e].reset()})),n={}}return t={reset:function(){i.off(s.MANIFEST_UPDATED,o,t),i.off(s.STREAM_TEARDOWN_COMPLETE,l,t)}},i.on(s.MANIFEST_UPDATED,o,t),i.on(s.STREAM_TEARDOWN_COMPLETE,l,t),t}H.__dashjs_factory_name="MetricsCollectionController";var G=dashjs.FactoryMaker.getClassFactory(H);function V(){var e=this.context;return{createMetricsReporting:function(t){return o(e).getInstance({eventBus:t.eventBus,dashMetrics:t.dashMetrics,metricsConstants:t.metricsConstants,events:t.events}).initialize(),G(e).create(t)},getReportingFactory:function(){return _(e).getInstance()},getMetricsHandlerFactory:function(){return P(e).getInstance()}}}V.__dashjs_factory_name="MetricsReporting";var Y=dashjs.FactoryMaker.getClassFactory(V);Y.events=a.Z,dashjs.FactoryMaker.updateClassFactory(V.__dashjs_factory_name,Y);var Z=Y},1180:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}var o=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=s(t);if(n){var i=s(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return a(this,e)});function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=r.call(this)).METRICS_INITIALISATION_COMPLETE="internal_metricsReportingInitialized",e.BECAME_REPORTING_PLAYER="internal_becameReportingPlayer",e.CMCD_DATA_GENERATED="cmcdDataGenerated",e}return o}(n(8342).Z));t.Z=o},5717:function(e,t,n){"use strict";var r=n(2610),i=n(5448),a=n(1264),s=n(3106),o=n(1767),l=n(3393);function u(){var e,t,n,i,u,c,d,f,h=this.context,p=(0,a.Z)(h).getInstance();function g(){i=[],u=[],c=[],f=[],d=null,t=[]}function m(e,t){var n=-1;e.some((function(e,r){if(e===t)return n=r,!0})),n<0||e.splice(n,1)}function y(e){var t;for(t=0;t<f.length;t++)if(f[t].rulename===e)return t;return-1}function v(e,n){_(e,n);var i=new r.Z;i.schemeIdUri=e,i.value=n,t.push(i)}function _(e,n){(0,s.PS)(e,"string"),(0,s.PS)(n,"string"),t.forEach((function(r,i){r.schemeIdUri===e&&r.value===n&&t.splice(i,1)}))}return e={getCustomInitialTrackSelectionFunction:function(){return d},setCustomInitialTrackSelectionFunction:function(e){d=e},resetCustomInitialTrackSelectionFunction:function(){d=null},getLicenseResponseFilters:function(){return u},getLicenseRequestFilters:function(){return i},getCustomCapabilitiesFilters:function(){return c},registerCustomCapabilitiesFilter:function(e){c.push(e)},registerLicenseResponseFilter:function(e){u.push(e)},registerLicenseRequestFilter:function(e){i.push(e)},unregisterCustomCapabilitiesFilter:function(e){m(c,e)},unregisterLicenseResponseFilter:function(e){m(u,e)},unregisterLicenseRequestFilter:function(e){m(i,e)},addAbrCustomRule:function(e,t,n){if("string"!=typeof e||e!==o.Z.ABANDON_FRAGMENT_RULES&&e!==o.Z.QUALITY_SWITCH_RULES||"string"!=typeof t)throw l.Z.BAD_ARGUMENT_ERROR;var r=y(t);-1===r?f.push({type:e,rulename:t,rule:n}):(f[r].type=e,f[r].rule=n)},removeAllAbrCustomRule:function(){f=[]},removeAbrCustomRule:function(e){if(e){var t=y(e);-1!==t&&f.splice(t,1)}else f=[]},getAbrCustomRules:function(){return f},addUTCTimingSource:v,removeUTCTimingSource:_,getUTCTimingSources:function(){return t},clearDefaultUTCTimingSources:function(){t=[]},restoreDefaultUTCTimingSources:function(){var e=p.get().streaming.utcSynchronization.defaultTimingSource;v(e.scheme,e.value)},setXHRWithCredentialsForType:function e(t,r){t?n[t]=!!r:Object.keys(n).forEach((function(t){e(t,r)}))},getXHRWithCredentialsForType:function(e){var t=n[e];return void 0===t?n.default:t},setConfig:function(){},reset:function(){g()}},n={default:!1},g(),e}u.__dashjs_factory_name="CustomParametersModel",t.Z=i.Z.getSingletonFactory(u)},9032:function(e,t,n){"use strict";var r=n(5448),i=n(7473);function a(e){var t=(e=e||{}).requestModifier;function n(e){var n=new Date,r=e.request,i=new XMLHttpRequest;if(i.open(e.method,e.url,!0),r.responseType&&(i.responseType=r.responseType),r.range&&i.setRequestHeader("Range","bytes="+r.range),r.requestStartDate||(r.requestStartDate=n),t&&t.modifyRequestHeader&&(i=t.modifyRequestHeader(i,{url:e.url})),e.headers)for(var a in e.headers){var s=e.headers[a];s&&i.setRequestHeader(a,s)}i.withCredentials=e.withCredentials,i.onload=e.onload,i.onloadend=e.onend,i.onerror=e.onerror,i.onprogress=e.progress,i.onabort=e.onabort,i.ontimeout=e.ontimeout,i.timeout=e.timeout,i.send(),e.response=i}return{load:function(e){t&&t.modifyRequest?(0,i.k)(e,t).then((function(){return n(e)})):n(e)},abort:function(e){var t=e.response;t.onloadend=t.onerror=t.onprogress=void 0,t.abort()}}}a.__dashjs_factory_name="XHRLoader";var s=r.Z.getClassFactory(a);t.Z=s},1737:function(e,t,n){"use strict";n.d(t,{default:function(){return ve}});var r={attributes:["Laurl","laurl"],prefixes:["clearkey","dashif"]},i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t;return t=[{key:"findCencContentProtection",value:function(e){for(var t=null,n=0;n<e.length;++n){var r=e[n];"urn:mpeg:dash:mp4protection:2011"!==r.schemeIdUri.toLowerCase()||"cenc"!==r.value.toLowerCase()&&"cbcs"!==r.value.toLowerCase()||(t=r)}return t}},{key:"getPSSHData",value:function(e){var t=8,n=new DataView(e),r=n.getUint8(t);return t+=20,r>0&&(t+=4+16*n.getUint32(t)),t+=4,e.slice(t)}},{key:"getPSSHForKeySystem",value:function(t,n){var r=e.parsePSSHList(n);return t&&r.hasOwnProperty(t.uuid.toLowerCase())?r[t.uuid.toLowerCase()]:null}},{key:"parseInitDataFromContentProtection",value:function(e,t){return"pssh"in e?(e.pssh.__text=e.pssh.__text.replace(/\r?\n|\r/g,"").replace(/\s+/g,""),t.decodeArray(e.pssh.__text).buffer):null}},{key:"parsePSSHList",value:function(e){if(null==e)return[];for(var t=new DataView(e.buffer||e),n={},r=0;;){var i,a,s=void 0,o=r;if(r>=t.buffer.byteLength)break;if(i=r+t.getUint32(r),r+=4,1886614376===t.getUint32(r))if(r+=4,0===(a=t.getUint8(r))||1===a){r++,r+=3,s="";var l=void 0,u=void 0;for(l=0;l<4;l++)s+=1===(u=t.getUint8(r+l).toString(16)).length?"0"+u:u;for(r+=4,s+="-",l=0;l<2;l++)s+=1===(u=t.getUint8(r+l).toString(16)).length?"0"+u:u;for(r+=2,s+="-",l=0;l<2;l++)s+=1===(u=t.getUint8(r+l).toString(16)).length?"0"+u:u;for(r+=2,s+="-",l=0;l<2;l++)s+=1===(u=t.getUint8(r+l).toString(16)).length?"0"+u:u;for(r+=2,s+="-",l=0;l<6;l++)s+=1===(u=t.getUint8(r+l).toString(16)).length?"0"+u:u;r+=6,r+=4,n[s=s.toLowerCase()]=t.buffer.slice(o,i),r=i}else r=i;else r=i}return n}},{key:"getLicenseServerUrlFromMediaInfo",value:function(e,t){try{if(!e||0===e.length)return null;for(var n=0,i=null;n<e.length&&!i;){var a=e[n];if(a&&a.contentProtection&&a.contentProtection.length>0){var s=a.contentProtection.filter((function(e){return e.schemeIdUri&&e.schemeIdUri===t}));if(s&&s.length>0)for(var o=0;o<s.length&&!i;){for(var l=s[o],u=0;u<r.attributes.length&&!i;){for(var c=0,d=r.attributes[u];c<r.prefixes.length&&!i;){var f=r.prefixes[c];l[d]&&l[d].__prefix&&l[d].__prefix===f&&l[d].__text&&(i=l[d].__text),c+=1}u+=1}o+=1}}n+=1}return i}catch(e){return null}}}],t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e,t),e}(),a=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.contentType=t,this.robustness=n},s=function e(t,n,r,i,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.initDataTypes=["cenc"],t&&t.length&&(this.audioCapabilities=t),n&&n.length&&(this.videoCapabilities=n),this.distinctiveIdentifier=r,this.persistentState=i,this.sessionTypes=a};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function l(e,t){return l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},l(e,t)}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}var c=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=u(t);if(n){var i=u(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function i(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(e=r.call(this)).MEDIA_KEYERR_CODE=100,e.MEDIA_KEYERR_UNKNOWN_CODE=101,e.MEDIA_KEYERR_CLIENT_CODE=102,e.MEDIA_KEYERR_SERVICE_CODE=103,e.MEDIA_KEYERR_OUTPUT_CODE=104,e.MEDIA_KEYERR_HARDWARECHANGE_CODE=105,e.MEDIA_KEYERR_DOMAIN_CODE=106,e.MEDIA_KEY_MESSAGE_ERROR_CODE=107,e.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE=108,e.SERVER_CERTIFICATE_UPDATED_ERROR_CODE=109,e.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE=110,e.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE=111,e.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE=112,e.KEY_SESSION_CREATED_ERROR_CODE=113,e.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE=114,e.MEDIA_KEYERR_UNKNOWN_MESSAGE="An unspecified error occurred. This value is used for errors that don't match any of the other codes.",e.MEDIA_KEYERR_CLIENT_MESSAGE="The Key System could not be installed or updated.",e.MEDIA_KEYERR_SERVICE_MESSAGE="The message passed into update indicated an error from the license service.",e.MEDIA_KEYERR_OUTPUT_MESSAGE="There is no available output device with the required characteristics for the content protection system.",e.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE="A hardware configuration change caused a content protection error.",e.MEDIA_KEYERR_DOMAIN_MESSAGE="An error occurred in a multi-device domain licensing configuration. The most common error is a failure to join the domain.",e.MEDIA_KEY_MESSAGE_ERROR_MESSAGE="Multiple key sessions were creates with a user-agent that does not support sessionIDs!! Unpredictable behavior ahead!",e.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE="DRM: Empty key message from CDM",e.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE="Error updating server certificate -- ",e.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE="DRM: KeyStatusChange error! -- License has expired",e.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE="DRM: No license server URL specified!",e.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE="DRM: KeySystem Access Denied! -- ",e.KEY_SESSION_CREATED_ERROR_MESSAGE="DRM: unable to create session! --",e.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE="DRM: licenser error! --",e}return i}(n(2230).Z)),d=n(5459),f=function e(t,n,r,i,a,s,o,l){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t,this.method=n,this.responseType=r,this.headers=i,this.withCredentials=a,this.messageType=s,this.sessionId=o,this.data=l},h=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t,this.headers=n,this.data=r},p=n(7855),g=n(703),m=n(3393),y=n(5448);function v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}function _(e){var t,n,r,o,l,u,y,_,T,E,b,S=(e=e||{}).protectionKeyController,A=e.protectionModel,w=e.eventBus,I=e.events,C=e.debug,R=e.BASE64,D=e.constants,N=[],O=e.cmcdModel,P=e.settings,M=e.customParametersModel;function x(){if(!(w&&w.hasOwnProperty("on")&&S&&S.hasOwnProperty("getSupportedKeySystemsFromContentProtection")))throw new Error("Missing config parameter(s)")}function L(e,t){_||T?_&&k():function(e,t){if(!T){T=!0;var r,i=[];e=e.sort((function(t,n){return(l&&l[t.ks.systemString]&&l[t.ks.systemString].priority>=0?l[t.ks.systemString].priority:e.length)-(l&&l[n.ks.systemString]&&l[n.ks.systemString].priority>=0?l[n.ks.systemString].priority:e.length)}));for(var a=0;a<e.length;a++){var s=G(e[a]);i.push({ks:e[a].ks,configs:[s],protData:e[a].protData})}A.requestKeySystemAccess(i).then((function(e){var t=(r=e.data).mksa&&r.mksa.selectedSystemString?r.mksa.selectedSystemString:r.keySystem.systemString;return n.info("DRM: KeySystem Access Granted for system string ("+t+")!  Selecting key system..."),A.selectKeySystem(r)})).then((function(e){if(_=e,T=!1,A){w.trigger(I.KEY_SYSTEM_SELECTED,{data:r});var t=j(_);t&&t.serverCertificate&&t.serverCertificate.length>0&&A.setServerCertificate(R.decodeArray(t.serverCertificate).buffer),k()}})).catch((function(e){_=null,T=!1,t||w.trigger(I.KEY_SYSTEM_SELECTED,{data:null,error:new d.Z(c.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,c.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+"Error selecting key system! -- "+e.error)})}))}}(e,t)}function k(){for(var e,t=0;t<r.length;t++)for(e=0;e<r[t].length;e++)if(_===r[t][e].ks){F(r[t][e]);break}r=[]}function F(e){if(S.isClearKey(_)&&e.protData&&e.protData.hasOwnProperty("clearkeys")&&0!==Object.keys(e.protData.clearkeys).length){var t={kids:Object.keys(e.protData.clearkeys)};e.initData=(new TextEncoder).encode(JSON.stringify(t))}e.sessionId?U(e):null!==e.initData&&B(e)}function U(e){x(),A.loadKeySession(e)}function B(e){var t=i.getPSSHForKeySystem(_,e?e.initData:null);if(t){if(function(e){if(!e)return!1;try{for(var t=A.getSessions(),n=0;n<t.length;n++)if(t[n].getKeyId()===e)return!0;return!1}catch(e){return!1}}(e.keyId))return;if(q(t))return;try{e.initData=t,A.createKeySession(e)}catch(e){w.trigger(I.KEY_SESSION_CREATED,{data:null,error:new d.Z(c.KEY_SESSION_CREATED_ERROR_CODE,c.KEY_SESSION_CREATED_ERROR_MESSAGE+e.message)})}}else e&&e.initData?A.createKeySession(e):w.trigger(I.KEY_SESSION_CREATED,{data:null,error:new d.Z(c.KEY_SESSION_CREATED_ERROR_CODE,c.KEY_SESSION_CREATED_ERROR_MESSAGE+"Selected key system is "+(_?_.systemString:null)+".  needkey/encrypted event contains no initData corresponding to that key system!")})}function j(e){if(e){var t=e.systemString;if(l)return t in l?l[t]:null}return null}function q(e){if(!e)return!1;try{for(var t=A.getAllInitData(),r=0;r<t.length;r++)if(S.initDataEquals(e,t[r]))return n.debug("DRM: Ignoring initData because we have already seen it!"),!0;return!1}catch(e){return!1}}function H(e){x(),e?(A.setMediaElement(e),w.on(I.NEED_KEY,Q,t)):null===e&&(A.setMediaElement(e),w.off(I.NEED_KEY,Q,t))}function G(e){var t=e.protData,n=[],r=[],i=t&&t.audioRobustness&&t.audioRobustness.length>0?t.audioRobustness:y,l=t&&t.videoRobustness&&t.videoRobustness.length>0?t.videoRobustness:y,u=e.sessionType,c=t&&t.distinctiveIdentifier?t.distinctiveIdentifier:"optional",d=t&&t.persistentState?t.persistentState:"temporary"===u?"optional":"required";return o.forEach((function(e){e.type===D.AUDIO?n.push(new a(e.codec,i)):e.type===D.VIDEO&&r.push(new a(e.codec,l))})),new s(n,r,c,d,[u])}function V(e){e.error?w.trigger(I.KEY_STATUSES_CHANGED,{data:null,error:e.error}):n.debug("DRM: key status = "+e.status)}function Y(e){n.debug("DRM: onKeyMessage");var t=e.data;w.trigger(I.KEY_MESSAGE,{data:t});var r=t.messageType?t.messageType:"license-request",a=t.message,s=t.sessionToken,l=j(_),u=S.getLicenseServerModelInstance(_,l,r),m={sessionToken:s,messageType:r};if(a&&0!==a.byteLength){if(!u)return n.debug("DRM: License server request not required for this message (type = "+e.data.messageType+").  Session ID = "+s.getSessionId()),void Z(m);if(S.isClearKey(_)){var y=S.processClearKeyLicenseRequest(_,l,a);if(y&&y.keyPairs&&y.keyPairs.length>0)return n.debug("DRM: ClearKey license request handled by application!"),Z(m),void A.updateKeySession(s,y)}!function(e,t,n){var r=e.sessionToken,a=e.messageType?e.messageType:"license-request",s={sessionToken:r,messageType:a},l=_?_.systemString:null,u=function(e,t,n,r,a){var s=null,l=r.message;if(e&&e.serverURL){var u=e.serverURL;"string"==typeof u&&""!==u?s=u:"object"===v(u)&&u.hasOwnProperty(t)&&(s=u[t])}else if(e&&e.laURL&&""!==e.laURL)s=e.laURL;else if(!(s=i.getLicenseServerUrlFromMediaInfo(o,_.schemeIdURI))&&!S.isClearKey(_)){var c=i.getPSSHData(n.initData);(s=_.getLicenseServerURLFromInitData(c))||(s=r.laURL)}return a.getServerURLFromMessage(s,l,t)}(n,a,r,e,t);if(u){var m={},y=!1;n&&W(m,n.httpRequestHeaders);var T=e.message;W(m,_.getRequestHeadersFromMessage(T)),Object.keys(m).forEach((function(e){"authorization"===e.toLowerCase()&&(y=!0)})),n&&"boolean"==typeof n.withCredentials&&(y=n.withCredentials);var E=function(e){if(A)if(e.status>=200&&e.status<=299){var n=g.Z.parseHttpHeaders(e.getAllResponseHeaders?e.getAllResponseHeaders():null),i=new h(e.responseURL,n,e.response);$(M.getLicenseResponseFilters(),i).then((function(){var n=t.getLicenseMessage(i.data,l,a);null!==n?(Z(s),A.updateKeySession(r,n)):X(e,s,l,a,t)}))}else X(e,s,l,a,t)},b=function(e){Z(s,new d.Z(c.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,c.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+l+' update, XHR aborted. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))},w=function(e){Z(s,new d.Z(c.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,c.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+l+' update, XHR error. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))},I=_.getLicenseRequestFromMessage(T),C=t.getHTTPMethod(a),R=t.getResponseType(l,a),D=n&&!isNaN(n.httpTimeout)?n.httpTimeout:8e3,N=r.getSessionId()||null,O=new f(u,C,R,m,y,a,N,I),x=isNaN(P.get().streaming.retryAttempts[p.w.LICENSE])?3:P.get().streaming.retryAttempts[p.w.LICENSE];$(M.getLicenseRequestFilters(),O).then((function(){K(O,x,D,E,b,w)}))}else Z(s,new d.Z(c.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE,c.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE))}(t,u,l)}else Z(m,new d.Z(c.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE,c.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE))}function Z(e,t){w.trigger(I.LICENSE_REQUEST_COMPLETE,{data:e,error:t})}function K(e,t,r,i,a,s){var o=new XMLHttpRequest;if(P.get().streaming.cmcd&&P.get().streaming.cmcd.enabled&&P.get().streaming.cmcd.mode===m.Z.CMCD_MODE_QUERY){var l=O.getQueryParameter({url:e.url,type:p.w.LICENSE});l&&(e.url=g.Z.addAditionalQueryParameterToUrl(e.url,[l]))}for(var u in o.open(e.method,e.url,!0),o.responseType=e.responseType,o.withCredentials=e.withCredentials,r>0&&(o.timeout=r),e.headers)o.setRequestHeader(u,e.headers[u]);if(P.get().streaming.cmcd&&P.get().streaming.cmcd.enabled&&P.get().streaming.cmcd.mode===m.Z.CMCD_MODE_HEADER){var c=O.getHeaderParameters({url:e.url,type:p.w.LICENSE});if(c)for(var d in c){var f=c[d];f&&o.setRequestHeader(d,f)}}var h=function(){t--;var n=isNaN(P.get().streaming.retryIntervals[p.w.LICENSE])?1e3:P.get().streaming.retryIntervals[p.w.LICENSE];b=setTimeout((function(){K(e,t,r,i,a,s)}),n)};o.onload=function(){E=null,this.status>=200&&this.status<=299||t<=0?i(this):(n.warn("License request failed ("+this.status+"). Retrying it... Pending retries: "+t),h())},o.ontimeout=o.onerror=function(){E=null,t<=0?s(this):(n.warn("License request network request failed . Retrying it... Pending retries: "+t),h())},o.onabort=function(){a(this)},w.trigger(I.LICENSE_REQUEST_SENDING,{url:e.url,headers:e.headers,payload:e.data,sessionId:e.sessionId}),E=o,o.send(e.data)}function z(){E&&(E.onloadend=E.onerror=E.onprogress=void 0,E.abort(),E=null),b&&(clearTimeout(b),b=null)}function W(e,t){if(t)for(var n in t)e[n]=t[n]}function X(e,t,n,r,i){var a="NONE",s=null;e.response&&(a=i.getErrorResponse(e.response,n,r),s={serverResponse:e.response||null,responseCode:e.status||null,responseText:e.statusText||null}),Z(t,new d.Z(c.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,c.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+n+' update, XHR complete. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState+".  Response is "+a,s))}function $(e,t){return e?e.reduce((function(e,n){return e.then((function(){return n(t)}))}),Promise.resolve()):Promise.resolve()}function Q(e,t){if(!P.get().streaming.protection.ignoreEmeEncryptedEvent){if(n.debug("DRM: onNeedKey"),"cenc"!==e.key.initDataType)return void n.warn("DRM:  Only 'cenc' initData is supported!  Ignoring initData of type: "+e.key.initDataType);if(0===o.length&&(n.warn("DRM: onNeedKey called before initializeForMedia, wait until initialized"),(t=void 0===t?1:t+1)<5))return void N.push(setTimeout((function(){Q(e,t)}),500));var a=e.key.initData;if(ArrayBuffer.isView(a)&&(a=a.buffer),_){var s=i.getPSSHForKeySystem(_,a);if(s&&q(s))return}n.debug("DRM: initData:",String.fromCharCode.apply(null,new Uint8Array(a)));var c=S.getSupportedKeySystemsFromSegmentPssh(a,l,u);if(0===c.length)return void n.debug("DRM: Received needkey event with initData, but we don't support any of the key systems!");!function(e){r.push(e),L(e,!1)}(c)}}return t={initializeForMedia:function(e){if(!e)throw new Error("mediaInfo can not be null or undefined");x(),o.push(e)},clearMediaInfoArray:function(){o=[]},handleKeySystemFromManifest:function(){if(o&&0!==o.length){var e=[];o.forEach((function(t){var n=S.getSupportedKeySystemsFromContentProtection(t.contentProtection,l,u);n.length>0&&(0===e.length&&(e=n),r.push(n))})),e&&e.length>0&&L(e,!0)}},createKeySession:B,loadKeySession:U,removeKeySession:function(e){x(),A.removeKeySession(e)},closeKeySession:function(e){x(),A.closeKeySession(e)},setServerCertificate:function(e){x(),A.setServerCertificate(e)},setMediaElement:H,setSessionType:function(e){u=e},setRobustnessLevel:function(e){y=e},setProtectionData:function(e){l=e,S.setProtectionData(e)},getSupportedKeySystemsFromContentProtection:function(e){return x(),S.getSupportedKeySystemsFromContentProtection(e,l,u)},getKeySystems:function(){return S?S.getKeySystems():[]},setKeySystems:function(e){S&&S.setKeySystems(e)},stop:function(){z(),A&&A.stop()},reset:function(){w.off(I.INTERNAL_KEY_MESSAGE,Y,t),w.off(I.INTERNAL_KEY_STATUS_CHANGED,V,t),x(),z(),H(null),_=null,T=!1,A&&(A.reset(),A=null),N.forEach((function(e){return clearTimeout(e)})),N=[],o=[],r=[]}},n=C.getLogger(t),r=[],o=[],u="temporary",y="",E=null,b=null,w.on(I.INTERNAL_KEY_MESSAGE,Y,t),w.on(I.INTERNAL_KEY_STATUS_CHANGED,V,t),t}_.__dashjs_factory_name="ProtectionController";var T=y.Z.getClassFactory(_),E=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.keyID=t,this.key=n};var b=function(){function e(t,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n&&"persistent"!==n&&"temporary"!==n)throw new Error("Invalid ClearKey key set type!  Must be one of 'persistent' or 'temporary'");this.keyPairs=t,this.type=n}var t;return(t=[{key:"toJWK",value:function(){var e,t=this.keyPairs.length,n={keys:[]};for(e=0;e<t;e++){var r={kty:"oct",alg:"A128KW",kid:this.keyPairs[e].keyID,k:this.keyPairs[e].key};n.keys.push(r)}this.type&&(n.type=this.type);var i=JSON.stringify(n),a=i.length,s=new ArrayBuffer(a),o=new Uint8Array(s);for(e=0;e<a;e++)o[e]=i.charCodeAt(e);return s}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();var S=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t;return(t=[{key:"init",value:function(){this.CLEARKEY_KEYSTEM_STRING="org.w3.clearkey",this.WIDEVINE_KEYSTEM_STRING="com.widevine.alpha",this.PLAYREADY_KEYSTEM_STRING="com.microsoft.playready",this.PLAYREADY_RECOMMENDATION_KEYSTEM_STRING="com.microsoft.playready.recommendation",this.INITIALIZATION_DATA_TYPE_CENC="cenc",this.INITIALIZATION_DATA_TYPE_KEYIDS="keyids",this.INITIALIZATION_DATA_TYPE_WEBM="webm"}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}()),A="e2719d58-a985-b3c9-781a-b030af78d30e",w=S.CLEARKEY_KEYSTEM_STRING,I="urn:uuid:"+A;function C(e){var t=(e=e||{}).BASE64;return{uuid:A,schemeIdURI:I,systemString:w,getInitData:function(e,n){try{var r=i.parseInitDataFromContentProtection(e,t);if(!r&&n){var a={kids:[function(e){try{var t=e.replace(/-/g,"");return(t=btoa(t.match(/\w{2}/g).map((function(e){return String.fromCharCode(parseInt(e,16))})).join(""))).replace(/=/g,"").replace(/\//g,"_").replace(/\+/g,"-")}catch(e){return null}}(n["cenc:default_KID"])]};r=(new TextEncoder).encode(JSON.stringify(a))}return r}catch(e){return null}},getRequestHeadersFromMessage:function(){return{"Content-Type":"application/json"}},getLicenseRequestFromMessage:function(e){return JSON.stringify(JSON.parse(String.fromCharCode.apply(null,new Uint8Array(e))))},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getClearKeysFromProtectionData:function(e,t){var n=null;if(e){for(var r=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))),i=[],a=0;a<r.kids.length;a++){var s=r.kids[a],o=e.clearkeys&&e.clearkeys.hasOwnProperty(s)?e.clearkeys[s]:null;if(!o)throw new Error("DRM: ClearKey keyID ("+s+") is not known!");i.push(new E(s,o))}n=new b(i)}return n}}}C.__dashjs_factory_name="KeySystemClearKey";var R=dashjs.FactoryMaker.getSingletonFactory(C),D="1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",N=S.CLEARKEY_KEYSTEM_STRING,O="urn:uuid:"+D;function P(e){var t=e.BASE64,n=e.debug.getLogger(undefined);return{uuid:D,schemeIdURI:O,systemString:N,getInitData:function(e){return i.parseInitDataFromContentProtection(e,t)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(e){return new Uint8Array(e)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getClearKeysFromProtectionData:function(e,t){var r=null;if(e){for(var i=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))),a=[],s=0;s<i.kids.length;s++){var o=i.kids[s],l=e.clearkeys&&e.clearkeys.hasOwnProperty(o)?e.clearkeys[o]:null;if(!l)throw new Error("DRM: ClearKey keyID ("+o+") is not known!");a.push(new E(o,l))}r=new b(a),n.warn("ClearKey schemeIdURI is using W3C Common PSSH systemID (1077efec-c0b2-4d02-ace3-3c1e52e2fb4b) in Content Protection. See DASH-IF IOP v4.1 section 7.6.2.4")}return r}}}P.__dashjs_factory_name="KeySystemW3CClearKey";var M=dashjs.FactoryMaker.getSingletonFactory(P),x="edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",L=S.WIDEVINE_KEYSTEM_STRING,k="urn:uuid:"+x;function F(e){var t=(e=e||{}).BASE64;return{uuid:x,schemeIdURI:k,systemString:L,getInitData:function(e){return i.parseInitDataFromContentProtection(e,t)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(e){return new Uint8Array(e)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null}}}F.__dashjs_factory_name="KeySystemWidevine";var U=dashjs.FactoryMaker.getSingletonFactory(F),B="9a04f079-9840-4286-ab92-e65be0885f95",j=S.PLAYREADY_KEYSTEM_STRING,q="urn:uuid:"+B;function H(e){var t="utf-16",n=(e=e||{}).BASE64,r=e.settings;function a(){if(!n||!n.hasOwnProperty("decodeArray")||!n.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")}return{uuid:B,schemeIdURI:q,systemString:j,getInitData:function(e){var t,r,s,o,l,u=new Uint8Array([112,115,115,104,0,0,0,0]),c=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]),d=0,f=null;if(a(),!e)return null;if("pssh"in e)return i.parseInitDataFromContentProtection(e,n);if("pro"in e)f=n.decodeArray(e.pro.__text);else{if(!("prheader"in e))return null;f=n.decodeArray(e.prheader.__text)}return t=f.length,r=4+u.length+c.length+4+t,s=new ArrayBuffer(r),o=new Uint8Array(s),(l=new DataView(s)).setUint32(d,r),d+=4,o.set(u,d),d+=u.length,o.set(c,d),d+=c.length,l.setUint32(d,t),d+=4,o.set(f,d),d+=t,o.buffer},getRequestHeadersFromMessage:function(e){var n,i,a={},s=new DOMParser;if(r&&r.get().streaming.protection.detectPlayreadyMessageFormat&&"utf-16"===t&&e&&e.byteLength%2==1)return a["Content-Type"]="text/xml; charset=utf-8",a;var o="utf-16"===t?new Uint16Array(e):new Uint8Array(e);n=String.fromCharCode.apply(null,o);for(var l=(i=s.parseFromString(n,"application/xml")).getElementsByTagName("name"),u=i.getElementsByTagName("value"),c=0;c<l.length;c++)a[l[c].childNodes[0].nodeValue]=u[c].childNodes[0].nodeValue;return a.hasOwnProperty("Content")&&(a["Content-Type"]=a.Content,delete a.Content),a.hasOwnProperty("Content-Type")||(a["Content-Type"]="text/xml; charset=utf-8"),a},getLicenseRequestFromMessage:function(e){var i=null,s=new DOMParser;if(r&&r.get().streaming.protection.detectPlayreadyMessageFormat&&"utf-16"===t&&e&&e.byteLength%2==1)return e;var o="utf-16"===t?new Uint16Array(e):new Uint8Array(e);a();var l=String.fromCharCode.apply(null,o),u=s.parseFromString(l,"application/xml");if(!u.getElementsByTagName("PlayReadyKeyMessage")[0])return e;var c=u.getElementsByTagName("Challenge")[0].childNodes[0].nodeValue;return c&&(i=n.decode(c)),i},getLicenseServerURLFromInitData:function(e){if(e)for(var t=new DataView(e),n=t.getUint16(4,!0),r=6,i=new DOMParser,a=0;a<n;a++){var s=t.getUint16(r,!0);r+=2;var o=t.getUint16(r,!0);if(r+=2,1===s){var l=e.slice(r,r+o),u=String.fromCharCode.apply(null,new Uint16Array(l)),c=i.parseFromString(u,"application/xml");if(c.getElementsByTagName("LA_URL")[0]){var d=c.getElementsByTagName("LA_URL")[0].childNodes[0].nodeValue;if(d)return d}if(c.getElementsByTagName("LUI_URL")[0]){var f=c.getElementsByTagName("LUI_URL")[0].childNodes[0].nodeValue;if(f)return f}}else r+=o}return null},getCDMData:function(e){var t,r,i,s;if(a(),!e)return null;for(t=[],s=0;s<e.length;++s)t.push(e.charCodeAt(s)),t.push(0);for(t=String.fromCharCode.apply(null,t),t=n.encode(t),r='<PlayReadyCDMData type="LicenseAcquisition"><LicenseAcquisition version="1.0" Proactive="false"><CustomData encoding="base64encoded">%CUSTOMDATA%</CustomData></LicenseAcquisition></PlayReadyCDMData>'.replace("%CUSTOMDATA%",t),i=[],s=0;s<r.length;++s)i.push(r.charCodeAt(s)),i.push(0);return new Uint8Array(i).buffer},setPlayReadyMessageFormat:function(e){if("utf-8"!==e&&"utf-16"!==e)throw new Error('Specified message format is not one of "utf-8" or "utf-16"');t=e}}}H.__dashjs_factory_name="KeySystemPlayReady";var G=dashjs.FactoryMaker.getSingletonFactory(H);function V(e){var t=(e=e||{}).BASE64,n={};return n[S.WIDEVINE_KEYSTEM_STRING]={responseType:"json",getLicenseMessage:function(e){return t.decodeArray(e.license)},getErrorResponse:function(e){return e}},n[S.PLAYREADY_KEYSTEM_STRING]={responseType:"arraybuffer",getLicenseMessage:function(e){return e},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}},{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(e){return n[e].responseType},getLicenseMessage:function(e,r){return function(){if(!t||!t.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")}(),n[r].getLicenseMessage(e)},getErrorResponse:function(e,t){return n[t].getErrorResponse(e)}}}V.__dashjs_factory_name="DRMToday";var Y=dashjs.FactoryMaker.getSingletonFactory(V);function Z(){var e="http://schemas.xmlsoap.org/soap/envelope/";function t(e){var t=String.fromCharCode.apply(null,new Uint8Array(e));return decodeURIComponent(escape(t))}function n(n){if(window.DOMParser){var r=t(n),i=(new window.DOMParser).parseFromString(r,"text/xml"),a=i?i.getElementsByTagNameNS(e,"Envelope")[0]:null,s=a?a.getElementsByTagNameNS(e,"Body")[0]:null;if(s&&s.getElementsByTagNameNS(e,"Fault")[0])return null}return n}function r(n){var r="",i="",a="",s=-1,o=-1;if(window.DOMParser){var l=t(n),u=(new window.DOMParser).parseFromString(l,"text/xml"),c=u?u.getElementsByTagNameNS(e,"Envelope")[0]:null,d=c?c.getElementsByTagNameNS(e,"Body")[0]:null,f=d?d.getElementsByTagNameNS(e,"Fault")[0]:null,h=f?f.getElementsByTagName("detail")[0]:null,p=h?h.getElementsByTagName("Exception")[0]:null,g=null;if(null===f)return l;r=(g=f.getElementsByTagName("faultstring")[0].firstChild)?g.nodeValue:null,null!==p&&(i=(g=p.getElementsByTagName("StatusCode")[0])?g.firstChild.nodeValue:null,s=(a=(g=p.getElementsByTagName("Message")[0])?g.firstChild.nodeValue:null)?a.lastIndexOf("[")+1:-1,o=a?a.indexOf("]"):-1,a=a?a.substring(s,o):"")}var m="code: ".concat(i,", name: ").concat(r);return a&&(m+=", message: ".concat(a)),m}return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(e){return n.call(this,e)},getErrorResponse:function(e){return r.call(this,e)}}}Z.__dashjs_factory_name="PlayReady";var K=y.Z.getSingletonFactory(Z);function z(){return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(e){return e},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}}}z.__dashjs_factory_name="Widevine";var W=dashjs.FactoryMaker.getSingletonFactory(z);function X(){return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"json"},getLicenseMessage:function(e){if(!e.hasOwnProperty("keys"))return null;for(var t=[],n=0;n<e.keys.length;n++){var r=e.keys[n],i=r.kid.replace(/=/g,""),a=r.k.replace(/=/g,"");t.push(new E(i,a))}return new b(t)},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}}}X.__dashjs_factory_name="ClearKey";var $=dashjs.FactoryMaker.getSingletonFactory(X);function Q(){var e,t,n,r,a,s,o,l,u=this.context;function c(e,t){return t&&e in t?t[e]:null}function d(e,t){return e&&e.sessionId?e.sessionId:t&&t.sessionId?t.sessionId:null}function f(e,t){return e&&e.sessionType?e.sessionType:t}return e={initialize:function(){var e;r=[],e=G(u).getInstance({BASE64:a,settings:s}),r.push(e),e=U(u).getInstance({BASE64:a}),r.push(e),e=R(u).getInstance({BASE64:a}),r.push(e),o=e,e=M(u).getInstance({BASE64:a,debug:t}),r.push(e),l=e},setProtectionData:function(e){for(var t,n,i=0;i<r.length;i++){var a=r[i];a.hasOwnProperty("init")&&a.init((t=a.systemString,n=void 0,n=null,e&&(n=t in e?e[t]:null),n))}},isClearKey:function(e){return e===o||e===l},initDataEquals:function(e,t){if(e.byteLength===t.byteLength){for(var n=new Uint8Array(e),r=new Uint8Array(t),i=0;i<n.length;i++)if(n[i]!==r[i])return!1;return!0}return!1},getKeySystems:function(){return r},setKeySystems:function(e){r=e},getKeySystemBySystemString:function(e){for(var t=0;t<r.length;t++)if(r[t].systemString===e)return r[t];return null},getSupportedKeySystemsFromContentProtection:function(e,t,n){var a,s,o,l,u=[];if(e){var h=i.findCencContentProtection(e);for(o=0;o<r.length;++o){var p=c((s=r[o]).systemString,t);for(l=0;l<e.length;++l)if((a=e[l]).schemeIdUri.toLowerCase()===s.schemeIdURI){var g=s.getInitData(a,h);u.push({ks:r[o],keyId:a.keyId,initData:g,protData:p,cdmData:s.getCDMData(p?p.cdmData:null),sessionId:d(p,a),sessionType:f(p,n)})}}}return u},getSupportedKeySystemsFromSegmentPssh:function(e,t,n){for(var a,s=[],o=i.parsePSSHList(e),l=0;l<r.length;++l){var u=c((a=r[l]).systemString,t);a.uuid in o&&s.push({ks:a,initData:o[a.uuid],protData:u,cdmData:a.getCDMData(u?u.cdmData:null),sessionId:d(u),sessionType:f(u,n)})}return s},getLicenseServerModelInstance:function(e,t,n){if("license-release"===n||"individualization-request"===n)return null;var r=null;return t&&t.hasOwnProperty("drmtoday")?r=Y(u).getInstance({BASE64:a}):e.systemString===S.WIDEVINE_KEYSTEM_STRING?r=W(u).getInstance():e.systemString===S.PLAYREADY_KEYSTEM_STRING?r=K(u).getInstance():e.systemString===S.CLEARKEY_KEYSTEM_STRING&&(r=$(u).getInstance()),r},processClearKeyLicenseRequest:function(e,t,r){try{return e.getClearKeysFromProtectionData(t,r)}catch(e){return n.error("Failed to retrieve clearkeys from ProtectionData"),null}},setConfig:function(r){r&&(r.debug&&(t=r.debug,n=t.getLogger(e)),r.BASE64&&(a=r.BASE64),r.settings&&(s=r.settings))}},e}Q.__dashjs_factory_name="ProtectionKeyController";var J=dashjs.FactoryMaker.getSingletonFactory(Q);function ee(e){return ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ee(e)}function te(e,t){return te=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},te(e,t)}function ne(e){return ne=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ne(e)}var re=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&te(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=ne(t);if(n){var i=ne(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(e,t){return!t||"object"!==ee(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function i(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(e=r.call(this)).INTERNAL_KEY_MESSAGE="internalKeyMessage",e.INTERNAL_KEY_STATUS_CHANGED="internalkeyStatusChanged",e.KEY_ADDED="public_keyAdded",e.KEY_ERROR="public_keyError",e.KEY_MESSAGE="public_keyMessage",e.KEY_SESSION_CLOSED="public_keySessionClosed",e.KEY_SESSION_CREATED="public_keySessionCreated",e.KEY_SESSION_REMOVED="public_keySessionRemoved",e.KEY_STATUSES_CHANGED="public_keyStatusesChanged",e.KEY_SYSTEM_ACCESS_COMPLETE="public_keySystemAccessComplete",e.KEY_SYSTEM_SELECTED="public_keySystemSelected",e.LICENSE_REQUEST_COMPLETE="public_licenseRequestComplete",e.LICENSE_REQUEST_SENDING="public_licenseRequestSending",e.NEED_KEY="needkey",e.PROTECTION_CREATED="public_protectioncreated",e.PROTECTION_DESTROYED="public_protectiondestroyed",e.SERVER_CERTIFICATE_UPDATED="serverCertificateUpdated",e.TEARDOWN_COMPLETE="protectionTeardownComplete",e.VIDEO_ELEMENT_SELECTED="videoElementSelected",e.KEY_SESSION_UPDATED="public_keySessionUpdated",e}return i}(n(8342).Z)),ie=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.initData=t,this.initDataType=n},ae=function e(t,n,r,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sessionToken=t,this.message=n,this.defaultURL=r,this.messageType=i||"license-request"},se=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.keySystem=t,this.ksConfiguration=n},oe={};function le(e){e=e||{};var t,n,r,i,a,s,o,l,u=this.context,f=e.eventBus,h=e.events,p=e.debug;function g(e,t,n,r){if(void 0===navigator.requestMediaKeySystemAccess||"function"!=typeof navigator.requestMediaKeySystemAccess){var i="Insecure origins are not allowed";return f.trigger(h.KEY_SYSTEM_ACCESS_COMPLETE,{error:i}),void r({error:i})}var a=e[t].protData&&e[t].protData.systemStringPriority?e[t].protData.systemStringPriority:null,s=e[t].configs,o=e[t].ks,l=o.systemString;(function(e,t){return new Promise((function(n,r){m(e,t,0,n,r)}))})(a||(oe[l]?oe[l]:[l]),s).then((function(e){var t="function"==typeof e.getConfiguration?e.getConfiguration():null,r=new se(o,t);r.mksa=e,f.trigger(h.KEY_SYSTEM_ACCESS_COMPLETE,{data:r}),n({data:r})})).catch((function(i){if(t+1<e.length)g(e,t+1,n,r);else{var a="Key system access denied! ";f.trigger(h.KEY_SYSTEM_ACCESS_COMPLETE,{error:a+i.message}),r({error:a+i.message})}}))}function m(e,t,r,i,a){var s=e[r];n.debug("Requesting key system access for system string ".concat(s)),navigator.requestMediaKeySystemAccess(s,t).then((function(e){e.selectedSystemString=s,i(e)})).catch((function(n){r+1<e.length?m(e,t,r+1,i,a):a(n)}))}function y(e){if(!e||!e.session)return Promise.resolve;var t=e.session;return t.removeEventListener("keystatuseschange",e),t.removeEventListener("message",e),t.close()}function v(e){for(var t=0;t<s.length;t++)if(s[t]===e){s.splice(t,1);break}}function _(e){var t,n;return e&&e.length>0&&(e[0]&&("string"==typeof e[0]?t=e[0]:n=e[0]),e[1]&&("string"==typeof e[1]?t=e[1]:n=e[1])),{status:t,keyId:n}}function T(e,t){var r={session:e,keyId:t.keyId,initData:t.initData,sessionId:t.sessionId,sessionType:t.sessionType,handleEvent:function(e){switch(e.type){case"keystatuseschange":f.trigger(h.KEY_STATUSES_CHANGED,{data:this}),e.target.keyStatuses.forEach((function(){var e=_(arguments);"expired"===e.status?f.trigger(h.INTERNAL_KEY_STATUS_CHANGED,{error:new d.Z(c.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE,c.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE)}):f.trigger(h.INTERNAL_KEY_STATUS_CHANGED,e)}));break;case"message":var t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;f.trigger(h.INTERNAL_KEY_MESSAGE,{data:new ae(this,t,void 0,e.messageType)})}},getKeyId:function(){return this.keyId},getSessionId:function(){return e.sessionId},getSessionType:function(){return this.sessionType},getExpirationTime:function(){return e.expiration},getKeyStatuses:function(){return e.keyStatuses},getUsable:function(){var t=!1;return e.keyStatuses.forEach((function(){"usable"===_(arguments).status&&(t=!0)})),t}};return e.addEventListener("keystatuseschange",r),e.addEventListener("message",r),e.closed.then((function(){v(r),n.debug("DRM: Session closed.  SessionID = "+r.getSessionId()),f.trigger(h.KEY_SESSION_CLOSED,{data:r.getSessionId()})})),s.push(r),r}return t={getAllInitData:function(){for(var e=[],t=0;t<s.length;t++)s[t].initData&&e.push(s[t].initData);return e},getSessions:function(){return s},requestKeySystemAccess:function(e){return new Promise((function(t,n){g(e,0,t,n)}))},selectKeySystem:function(e){return new Promise((function(t,n){e.mksa.createMediaKeys().then((function(t){return r=e.keySystem,a=t,i?i.setMediaKeys(a):Promise.resolve()})).then((function(){t(r)})).catch((function(){n({error:"Error selecting keys system ("+e.keySystem.systemString+")! Could not create MediaKeys -- TODO"})}))}))},setMediaElement:function(e){i!==e&&(i&&(i.removeEventListener("encrypted",o),i.setMediaKeys&&i.setMediaKeys(null)),(i=e)&&(i.addEventListener("encrypted",o),i.setMediaKeys&&a&&i.setMediaKeys(a)))},setServerCertificate:function(e){if(!r||!a)throw new Error("Can not set server certificate until you have selected a key system");a.setServerCertificate(e).then((function(){n.info("DRM: License server certificate successfully updated."),f.trigger(h.SERVER_CERTIFICATE_UPDATED)})).catch((function(e){f.trigger(h.SERVER_CERTIFICATE_UPDATED,{error:new d.Z(c.SERVER_CERTIFICATE_UPDATED_ERROR_CODE,c.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE+e.name)})}))},createKeySession:function(e){if(!r||!a)throw new Error("Can not create sessions until you have selected a key system");var t=a.createSession(e.sessionType),i=T(t,e),s=r.systemString===S.CLEARKEY_KEYSTEM_STRING&&(e.initData||e.protData&&e.protData.clearkeys)?S.INITIALIZATION_DATA_TYPE_KEYIDS:S.INITIALIZATION_DATA_TYPE_CENC;t.generateRequest(s,e.initData).then((function(){n.debug("DRM: Session created.  SessionID = "+i.getSessionId()),f.trigger(h.KEY_SESSION_CREATED,{data:i})})).catch((function(e){v(i),f.trigger(h.KEY_SESSION_CREATED,{data:null,error:new d.Z(c.KEY_SESSION_CREATED_ERROR_CODE,c.KEY_SESSION_CREATED_ERROR_MESSAGE+"Error generating key request -- "+e.name)})}))},updateKeySession:function(e,t){var n=e.session;l.isClearKey(r)&&(t=t.toJWK()),n.update(t).then((function(){f.trigger(h.KEY_SESSION_UPDATED)})).catch((function(t){f.trigger(h.KEY_ERROR,{error:new d.Z(c.MEDIA_KEYERR_CODE,"Error sending update() message! "+t.name,e)})}))},loadKeySession:function(e){if(!r||!a)throw new Error("Can not load sessions until you have selected a key system");for(var t=e.sessionId,i=0;i<s.length;i++)if(t===s[i].sessionId)return void n.warn("DRM: Ignoring session ID because we have already seen it!");var o=a.createSession(e.sessionType),l=T(o,e);o.load(t).then((function(e){e?(n.debug("DRM: Session loaded.  SessionID = "+l.getSessionId()),f.trigger(h.KEY_SESSION_CREATED,{data:l})):(v(l),f.trigger(h.KEY_SESSION_CREATED,{data:null,error:new d.Z(c.KEY_SESSION_CREATED_ERROR_CODE,c.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session! Invalid Session ID ("+t+")")}))})).catch((function(e){v(l),f.trigger(h.KEY_SESSION_CREATED,{data:null,error:new d.Z(c.KEY_SESSION_CREATED_ERROR_CODE,c.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session ("+t+")! "+e.name)})}))},removeKeySession:function(e){e.session.remove().then((function(){n.debug("DRM: Session removed.  SessionID = "+e.getSessionId()),f.trigger(h.KEY_SESSION_REMOVED,{data:e.getSessionId()})}),(function(t){f.trigger(h.KEY_SESSION_REMOVED,{data:null,error:"Error removing session ("+e.getSessionId()+"). "+t.name})}))},closeKeySession:function(e){y(e).catch((function(t){v(e),f.trigger(h.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+e.getSessionId()+") "+t.name})}))},stop:function(){for(var e,t=0;t<s.length;t++)(e=s[t]).getUsable()||(y(e),v(e))},reset:function(){var e,t=s.length;0!==t?function(){for(var n=function(e){v(e),0===s.length&&(i?(i.removeEventListener("encrypted",o),i.setMediaKeys(null).then((function(){f.trigger(h.TEARDOWN_COMPLETE)}))):f.trigger(h.TEARDOWN_COMPLETE))},r=0;r<t;r++)!function(t){y(e),n(t)}(e=s[r])}():f.trigger(h.TEARDOWN_COMPLETE)}},n=p.getLogger(t),r=null,i=null,a=null,s=[],l=J(u).getInstance(),o={handleEvent:function(e){if("encrypted"===e.type&&e.initData){var t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;f.trigger(h.NEED_KEY,{key:new ie(t,e.initDataType)})}}},t}oe[S.PLAYREADY_KEYSTEM_STRING]=[S.PLAYREADY_KEYSTEM_STRING,S.PLAYREADY_RECOMMENDATION_KEYSTEM_STRING],oe[S.WIDEVINE_KEYSTEM_STRING]=[S.WIDEVINE_KEYSTEM_STRING],oe[S.CLEARKEY_KEYSTEM_STRING]=[S.CLEARKEY_KEYSTEM_STRING],le.__dashjs_factory_name="ProtectionModel_21Jan2015";var ue=dashjs.FactoryMaker.getClassFactory(le);function ce(e){e=e||{};var t,n,r,i,a,o,l,u,f,h=this.context,p=e.eventBus,g=e.events,m=e.debug,y=e.api;function v(){try{for(var e=0;e<l.length;e++)_(l[e]);r&&r.removeEventListener(y.needkey,u),p.trigger(g.TEARDOWN_COMPLETE)}catch(e){p.trigger(g.TEARDOWN_COMPLETE,{error:"Error tearing down key sessions and MediaKeys! -- "+e.message})}}function _(e){var t=e.session;t.removeEventListener(y.error,e),t.removeEventListener(y.message,e),t.removeEventListener(y.ready,e),t.removeEventListener(y.close,e);for(var n=0;n<l.length;n++)if(l[n]===e){l.splice(n,1);break}t[y.release]()}function T(){var e=null,t=function(){r.removeEventListener("loadedmetadata",e),r[y.setMediaKeys](a),p.trigger(g.VIDEO_ELEMENT_SELECTED)};r.readyState>=1?t():(e=t.bind(this),r.addEventListener("loadedmetadata",e))}return t={getAllInitData:function(){for(var e=[],t=0;t<l.length;t++)e.push(l[t].initData);return e},getSessions:function(){return l},requestKeySystemAccess:function(e){return new Promise((function(t,n){for(var r=!1,i=0;i<e.length;i++)for(var a=e[i].ks.systemString,o=e[i].configs,l=null,u=null,c=0;c<o.length;c++){var d=o[c].audioCapabilities,h=o[c].videoCapabilities;if(d&&0!==d.length){l=[];for(var m=0;m<d.length;m++)window[y.MediaKeys].isTypeSupported(a,d[m].contentType)&&l.push(d[m])}if(h&&0!==h.length){u=[];for(var v=0;v<h.length;v++)window[y.MediaKeys].isTypeSupported(a,h[v].contentType)&&u.push(h[v])}if(!(!l&&!u||l&&0===l.length||u&&0===u.length)){r=!0;var _=new s(l,u),T=f.getKeySystemBySystemString(a),E=new se(T,_);p.trigger(g.KEY_SYSTEM_ACCESS_COMPLETE,{data:E}),t({data:E});break}}if(!r){var b="Key system access denied! -- No valid audio/video content configurations detected!";p.trigger(g.KEY_SYSTEM_ACCESS_COMPLETE,{error:b}),n({error:b})}}))},selectKeySystem:function(e){return new Promise((function(t,n){try{a=e.mediaKeys=new window[y.MediaKeys](e.keySystem.systemString),i=e.keySystem,o=e,r&&T(),t(i)}catch(e){n({error:"Error selecting keys system ("+i.systemString+")! Could not create MediaKeys -- TODO"})}}))},setMediaElement:function(e){r!==e&&(r&&r.removeEventListener(y.needkey,u),(r=e)&&(r.addEventListener(y.needkey,u),a&&T()))},createKeySession:function(e){if(!i||!a||!o)throw new Error("Can not create sessions until you have selected a key system");var t=null;if(o.ksConfiguration.videoCapabilities&&o.ksConfiguration.videoCapabilities.length>0&&(t=o.ksConfiguration.videoCapabilities[0]),null===t&&o.ksConfiguration.audioCapabilities&&o.ksConfiguration.audioCapabilities.length>0&&(t=o.ksConfiguration.audioCapabilities[0]),null===t)throw new Error("Can not create sessions for unknown content types.");var r=t.contentType,s=a.createSession(r,new Uint8Array(e.initData),e.cdmData?new Uint8Array(e.cdmData):null),u=function(e,t){return{session:e,keyId:t.keyId,initData:t.initData,getKeyId:function(){return this.keyId},getSessionId:function(){return this.session.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"},handleEvent:function(e){switch(e.type){case y.error:p.trigger(g.KEY_ERROR,{error:new d.Z(c.MEDIA_KEYERR_CODE,"KeyError",this)});break;case y.message:var t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;p.trigger(g.INTERNAL_KEY_MESSAGE,{data:new ae(this,t,e.destinationURL)});break;case y.ready:n.debug("DRM: Key added."),p.trigger(g.KEY_ADDED);break;case y.close:n.debug("DRM: Session closed.  SessionID = "+this.getSessionId()),p.trigger(g.KEY_SESSION_CLOSED,{data:this.getSessionId()})}}}}(s,e);s.addEventListener(y.error,u),s.addEventListener(y.message,u),s.addEventListener(y.ready,u),s.addEventListener(y.close,u),l.push(u),n.debug("DRM: Session created.  SessionID = "+u.getSessionId()),p.trigger(g.KEY_SESSION_CREATED,{data:u})},updateKeySession:function(e,t){var n=e.session;f.isClearKey(i)?n.update(new Uint8Array(t.toJWK())):n.update(new Uint8Array(t)),p.trigger(g.KEY_SESSION_UPDATED)},closeKeySession:_,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},stop:v,reset:v},n=m.getLogger(t),r=null,i=null,a=null,o=null,l=[],f=J(h).getInstance(),u={handleEvent:function(e){if(e.type===y.needkey&&e.initData){var t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;p.trigger(g.NEED_KEY,{key:new ie(t,"cenc")})}}},t}ce.__dashjs_factory_name="ProtectionModel_3Feb2014";var de=dashjs.FactoryMaker.getClassFactory(ce);function fe(e){e=e||{};var t,n,r,i,a,o,l,u,f,h=this.context,p=e.eventBus,g=e.events,m=e.debug,y=e.api,v=e.errHandler;function _(){r&&b();for(var e=0;e<l.length;e++)T(l[e]);p.trigger(g.TEARDOWN_COMPLETE)}function T(e){try{r[y.cancelKeyRequest](i.systemString,e.sessionId)}catch(t){p.trigger(g.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+e.sessionId+") "+t.message})}}function E(e,t){if(t&&e){for(var n=e.length,r=0;r<n;r++)if(e[r].sessionId==t)return e[r];return null}return null}function b(){r.removeEventListener(y.keyerror,f),r.removeEventListener(y.needkey,f),r.removeEventListener(y.keymessage,f),r.removeEventListener(y.keyadded,f)}return t={getAllInitData:function(){for(var e=[],t=0;t<o.length;t++)e.push(o[t].initData);for(var n=0;n<l.length;n++)e.push(l[n].initData);return e},getSessions:function(){return l.concat(o)},requestKeySystemAccess:function(e){return new Promise((function(t,n){var i=r;i||(i=document.createElement("video"));for(var o=!1,l=0;l<e.length;l++)for(var u=e[l].ks.systemString,c=e[l].configs,d=null,f=0;f<c.length;f++){var h=c[f].videoCapabilities;if(h&&0!==h.length){d=[];for(var m=0;m<h.length;m++)""!==i.canPlayType(h[m].contentType,u)&&d.push(h[m])}if(d&&(!d||0!==d.length)){o=!0;var y=new s(null,d),v=a.getKeySystemBySystemString(u),_=new se(v,y);p.trigger(g.KEY_SYSTEM_ACCESS_COMPLETE,{data:_}),t({data:_});break}}if(!o){var T="Key system access denied! -- No valid audio/video content configurations detected!";p.trigger(g.KEY_SYSTEM_ACCESS_COMPLETE,{error:T}),n({error:T})}}))},selectKeySystem:function(e){return i=e.keySystem,Promise.resolve(i)},setMediaElement:function(e){if(r!==e){if(r){b();for(var t=0;t<l.length;t++)T(l[t]);l=[]}(r=e)&&(r.addEventListener(y.keyerror,f),r.addEventListener(y.needkey,f),r.addEventListener(y.keymessage,f),r.addEventListener(y.keyadded,f),p.trigger(g.VIDEO_ELEMENT_SELECTED))}},createKeySession:function(e){if(!i)throw new Error("Can not create sessions until you have selected a key system");if(u||0===l.length){var t={sessionId:null,keyId:e.keyId,initData:e.initData,getKeyId:function(){return this.keyId},getSessionId:function(){return this.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"}};return o.push(t),r[y.generateKeyRequest](i.systemString,new Uint8Array(e.initData)),t}throw new Error("Multiple sessions not allowed!")},updateKeySession:function(e,t){var n=e.sessionId;if(a.isClearKey(i))for(var s=0;s<t.keyPairs.length;s++)r[y.addKey](i.systemString,t.keyPairs[s].key,t.keyPairs[s].keyID,n);else r[y.addKey](i.systemString,new Uint8Array(t),new Uint8Array(e.initData),n);p.trigger(g.KEY_SESSION_UPDATED)},closeKeySession:T,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},stop:_,reset:_},n=m.getLogger(t),r=null,i=null,o=[],l=[],a=J(h).getInstance(),f={handleEvent:function(e){var t=null;switch(e.type){case y.needkey:var r=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;p.trigger(g.NEED_KEY,{key:new ie(r,"cenc")});break;case y.keyerror:if((t=E(l,e.sessionId))||(t=E(o,e.sessionId)),t){var i=c.MEDIA_KEYERR_CODE,a="";switch(e.errorCode.code){case 1:i=c.MEDIA_KEYERR_UNKNOWN_CODE,a+="MEDIA_KEYERR_UNKNOWN - "+c.MEDIA_KEYERR_UNKNOWN_MESSAGE;break;case 2:i=c.MEDIA_KEYERR_CLIENT_CODE,a+="MEDIA_KEYERR_CLIENT - "+c.MEDIA_KEYERR_CLIENT_MESSAGE;break;case 3:i=c.MEDIA_KEYERR_SERVICE_CODE,a+="MEDIA_KEYERR_SERVICE - "+c.MEDIA_KEYERR_SERVICE_MESSAGE;break;case 4:i=c.MEDIA_KEYERR_OUTPUT_CODE,a+="MEDIA_KEYERR_OUTPUT - "+c.MEDIA_KEYERR_OUTPUT_MESSAGE;break;case 5:i=c.MEDIA_KEYERR_HARDWARECHANGE_CODE,a+="MEDIA_KEYERR_HARDWARECHANGE - "+c.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE;break;case 6:i=c.MEDIA_KEYERR_DOMAIN_CODE,a+="MEDIA_KEYERR_DOMAIN - "+c.MEDIA_KEYERR_DOMAIN_MESSAGE}a+="  System Code = "+e.systemCode,p.trigger(g.KEY_ERROR,{error:new d.Z(i,a,t)})}else n.error("No session token found for key error");break;case y.keyadded:(t=E(l,e.sessionId))||(t=E(o,e.sessionId)),t?(n.debug("DRM: Key added."),p.trigger(g.KEY_ADDED,{data:t})):n.debug("No session token found for key added");break;case y.keymessage:if((u=null!==e.sessionId&&void 0!==e.sessionId)?!(t=E(l,e.sessionId))&&o.length>0&&(t=o.shift(),l.push(t),t.sessionId=e.sessionId,p.trigger(g.KEY_SESSION_CREATED,{data:t})):o.length>0&&(t=o.shift(),l.push(t),0!==o.length&&v.error(new d.Z(c.MEDIA_KEY_MESSAGE_ERROR_CODE,c.MEDIA_KEY_MESSAGE_ERROR_MESSAGE))),t){var s=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;t.keyMessage=s,p.trigger(g.INTERNAL_KEY_MESSAGE,{data:new ae(t,s,e.defaultURL)})}else n.warn("No session token found for key message")}}},t}fe.__dashjs_factory_name="ProtectionModel_01b";var he=dashjs.FactoryMaker.getClassFactory(fe),pe=[{generateKeyRequest:"generateKeyRequest",addKey:"addKey",cancelKeyRequest:"cancelKeyRequest",needkey:"needkey",keyerror:"keyerror",keyadded:"keyadded",keymessage:"keymessage"},{generateKeyRequest:"webkitGenerateKeyRequest",addKey:"webkitAddKey",cancelKeyRequest:"webkitCancelKeyRequest",needkey:"webkitneedkey",keyerror:"webkitkeyerror",keyadded:"webkitkeyadded",keymessage:"webkitkeymessage"}],ge=[{setMediaKeys:"setMediaKeys",MediaKeys:"MediaKeys",release:"close",needkey:"needkey",error:"keyerror",message:"keymessage",ready:"keyadded",close:"keyclose"},{setMediaKeys:"msSetMediaKeys",MediaKeys:"MSMediaKeys",release:"close",needkey:"msneedkey",error:"mskeyerror",message:"mskeymessage",ready:"mskeyadded",close:"mskeyclose"}];function me(){var e,t=this.context;function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];if("function"==typeof e[r[Object.keys(r)[0]]])return r}return null}return e={createProtectionSystem:function(r){var i=null,a=J(t).getInstance();a.setConfig({debug:r.debug,BASE64:r.BASE64,settings:r.settings}),a.initialize();var s=function(r){var i=r.debug,a=i.getLogger(e),s=r.eventBus,o=r.errHandler,l=r.videoModel?r.videoModel.getElement():null;return l&&void 0===l.onencrypted||l&&void 0===l.mediaKeys?n(l,ge)?(a.info("EME detected on this user agent! (ProtectionModel_3Feb2014)"),de(t).create({debug:i,eventBus:s,events:r.events,api:n(l,ge)})):n(l,pe)?(a.info("EME detected on this user agent! (ProtectionModel_01b)"),he(t).create({debug:i,eventBus:s,errHandler:o,events:r.events,api:n(l,pe)})):(a.warn("No supported version of EME detected on this user agent! - Attempts to play encrypted content will fail!"),null):(a.info("EME detected on this user agent! (ProtectionModel_21Jan2015)"),ue(t).create({debug:i,eventBus:s,events:r.events}))}(r);return!i&&s&&(i=T(t).create({protectionModel:s,protectionKeyController:a,eventBus:r.eventBus,debug:r.debug,events:r.events,BASE64:r.BASE64,constants:r.constants,cmcdModel:r.cmcdModel,customParametersModel:r.customParametersModel,settings:r.settings}),r.capabilities.setEncryptedMediaSupported(!0)),i}}}me.__dashjs_factory_name="Protection";var ye=dashjs.FactoryMaker.getClassFactory(me);ye.events=re,ye.errors=c,dashjs.FactoryMaker.updateClassFactory(me.__dashjs_factory_name,ye);var ve=ye},2068:function(e,t,n){"use strict";var r=n(5448),i={DEFAULT:.5,STRONG:1,WEAK:0};function a(e,t,n){var r,a;return r=void 0===e?-1:e,a=function(e){var t=i.DEFAULT;return e!==i.DEFAULT&&e!==i.STRONG&&e!==i.WEAK||(t=e),t}(n),{quality:r,reason:void 0===t?null:t,priority:a}}a.__dashjs_factory_name="SwitchRequest";var s=r.Z.getClassFactory(a);s.NO_CHANGE=-1,s.PRIORITY=i,r.Z.updateClassFactory(a.__dashjs_factory_name,s),t.Z=s},1767:function(e,t,n){"use strict";var r=n(5628),i=n(6535),a=n(7423),s=n(895),o=n(6070),l=n(3112),u=n(1914),c=n(5435),d=n(5448),f=n(2068),h=n(3393),p="qualitySwitchRules",g="abandonFragmentRules";function m(e){e=e||{};var t,n,d=this.context,m=e.mediaPlayerModel,y=e.customParametersModel,v=e.dashMetrics,_=e.settings;function T(e){return e.filter((function(e){return e.quality>f.Z.NO_CHANGE}))}function E(e){var t,n,r,i,a,s={},o=null;if(0!==e.length){for(s[f.Z.PRIORITY.STRONG]={quality:f.Z.NO_CHANGE,reason:null},s[f.Z.PRIORITY.WEAK]={quality:f.Z.NO_CHANGE,reason:null},s[f.Z.PRIORITY.DEFAULT]={quality:f.Z.NO_CHANGE,reason:null},t=0,n=e.length;t<n;t+=1)(r=e[t]).quality!==f.Z.NO_CHANGE&&(s[r.priority].quality===f.Z.NO_CHANGE||s[r.priority].quality>r.quality)&&(s[r.priority].quality=r.quality,s[r.priority].reason=r.reason||null);return s[f.Z.PRIORITY.WEAK].quality!==f.Z.NO_CHANGE&&(o=s[f.Z.PRIORITY.WEAK]),s[f.Z.PRIORITY.DEFAULT].quality!==f.Z.NO_CHANGE&&(o=s[f.Z.PRIORITY.DEFAULT]),s[f.Z.PRIORITY.STRONG].quality!==f.Z.NO_CHANGE&&(o=s[f.Z.PRIORITY.STRONG]),o&&(i=o.quality,a=o.reason),(0,f.Z)(d).create(i,a)}}return{initialize:function(){t=[],n=[],_.get().streaming.abr.useDefaultABRRules&&(_.get().streaming.abr.ABRStrategy===h.Z.ABR_STRATEGY_L2A?t.push((0,u.Z)(d).create({dashMetrics:v,settings:_})):_.get().streaming.abr.ABRStrategy===h.Z.ABR_STRATEGY_LoLP?t.push((0,c.Z)(d).create({dashMetrics:v})):(t.push((0,l.Z)(d).create({dashMetrics:v,mediaPlayerModel:m,settings:_})),t.push((0,r.Z)(d).create({dashMetrics:v})),_.get().streaming.abr.additionalAbrRules.insufficientBufferRule&&t.push((0,i.Z)(d).create({dashMetrics:v,settings:_})),_.get().streaming.abr.additionalAbrRules.switchHistoryRule&&t.push((0,o.Z)(d).create()),_.get().streaming.abr.additionalAbrRules.droppedFramesRule&&t.push((0,s.Z)(d).create()),_.get().streaming.abr.additionalAbrRules.abandonRequestsRule&&n.push((0,a.Z)(d).create({dashMetrics:v,mediaPlayerModel:m,settings:_})))),y.getAbrCustomRules().forEach((function(e){e.type===p&&t.push(e.rule(d).create()),e.type===g&&n.push(e.rule(d).create())}))},reset:function(){[t,n].forEach((function(e){e&&e.length&&e.forEach((function(e){return e.reset&&e.reset()}))})),t=[],n=[]},getMaxQuality:function(e){return E(T(t.map((function(t){return t.getMaxIndex(e)}))))||(0,f.Z)(d).create()},getMinSwitchRequest:E,shouldAbandonFragment:function(e,t){var r=E(T(n.map((function(n){return n.shouldAbandon(e,t)}))));return r&&(r.reason.forceAbandon=!0),r||(0,f.Z)(d).create()},getQualitySwitchRules:function(){return t}}}m.__dashjs_factory_name="ABRRulesCollection";var y=d.Z.getClassFactory(m);y.QUALITY_SWITCH_RULES=p,y.ABANDON_FRAGMENT_RULES=g,d.Z.updateSingletonFactory(m.__dashjs_factory_name,y),t.Z=y},7423:function(e,t,n){"use strict";var r=n(2068),i=n(5448),a=n(6398);function s(e){e=e||{};var t,n,i,o,l,u=this.context,c=e.mediaPlayerModel,d=e.dashMetrics,f=e.settings;function h(){i={},o={},l=[]}return t={shouldAbandon:function(e){var t=(0,r.Z)(u).create(r.Z.NO_CHANGE,{name:s.__dashjs_factory_name});if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getCurrentRequest")&&e.hasOwnProperty("getRepresentationInfo")&&e.hasOwnProperty("getAbrController")))return t;var a,h,p=e.getMediaInfo(),g=e.getMediaType(),m=e.getStreamInfo(),y=m?m.id:null,v=e.getCurrentRequest();if(!isNaN(v.index)){a=g,h=v.index,i[a]=i[a]||{},i[a][h]=i[a][h]||{};var _=c.getStableBufferTime();if(d.getCurrentBufferLevel(g)>_)return t;var T=i[g][v.index];if(null===T||null===v.firstByteDate||o.hasOwnProperty(T.id))return t;if(void 0===T.firstByteTime&&(l[g]=[],T.firstByteTime=v.firstByteDate.getTime(),T.segmentDuration=v.duration,T.bytesTotal=v.bytesTotal,T.id=v.index),T.bytesLoaded=v.bytesLoaded,T.elapsedTime=(new Date).getTime()-T.firstByteTime,T.bytesLoaded>0&&T.elapsedTime>0&&function(e,t){l[e]=l[e]||[],l[e].push(t)}(g,Math.round(8*T.bytesLoaded/T.elapsedTime)),l[g].length>=f.get().streaming.abr.abrRulesParameters.abandonRequestsRule.minLengthToAverage&&T.elapsedTime>f.get().streaming.abr.abrRulesParameters.abandonRequestsRule.graceTimeThreshold&&T.bytesLoaded<T.bytesTotal){var E=l[g].reduce((function(e,t){return e+t}),0);if(T.measuredBandwidthInKbps=Math.round(E/l[g].length),T.estimatedTimeOfDownload=+(8*T.bytesTotal/T.measuredBandwidthInKbps/1e3).toFixed(2),T.estimatedTimeOfDownload<T.segmentDuration*f.get().streaming.abr.abrRulesParameters.abandonRequestsRule.abandonMultiplier||0===e.getRepresentationInfo().quality)return t;if(!o.hasOwnProperty(T.id)){var b=e.getAbrController(),S=T.bytesTotal-T.bytesLoaded,A=b.getBitrateList(p),w=b.getQualityForBitrate(p,T.measuredBandwidthInKbps*f.get().streaming.abr.bandwidthSafetyFactor,y),I=b.getMinAllowedIndexFor(g,y),C=void 0!==I?Math.max(I,w):w;S>T.bytesTotal*A[C].bitrate/A[b.getQualityFor(g,y)].bitrate&&(t.quality=C,t.reason.throughput=T.measuredBandwidthInKbps,t.reason.fragmentID=T.id,t.reason.rule=this.getClassName(),o[T.id]=T,n.debug("["+g+"] frag id",T.id," is asking to abandon and switch to quality to ",C," measured bandwidth was",T.measuredBandwidthInKbps),delete i[g][T.id])}}else T.bytesLoaded===T.bytesTotal&&delete i[g][T.id]}return t},reset:h},n=(0,a.Z)(u).getInstance().getLogger(t),h(),t}s.__dashjs_factory_name="AbandonRequestsRule",t.Z=i.Z.getClassFactory(s)},3112:function(e,t,n){"use strict";var r=n(3860),i=n(2068),a=n(5448),s=n(7855),o=n(5595),l=n(8512),u=n(6398),c=n(8825),d=n(3393),f=10;function h(e){e=e||{};var t,n,a,h=this.context,p=e.dashMetrics,g=e.mediaPlayerModel,m=(0,o.Z)(h).getInstance();function y(e,t,n){var r=n.reduce((function(e,t,r){return t>n[e]?r:e}),0);if(0===r)return null;var i=Math.max(e,f+2*t.length),a=(n[r]-1)/(i/f-1);return{gp:a,Vp:f/a}}function v(e){e.placeholderBuffer=0,e.mostAdvancedSegmentStart=NaN,e.lastSegmentWasReplacement=!1,e.lastSegmentStart=NaN,e.lastSegmentDurationS=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN}function _(e,t){var n=g.getStableBufferTime();if(e.stableBufferTime!==n){var r=y(n,e.bitrates,e.utilities);if(r.Vp!==e.Vp||r.gp!==e.gp){var i=p.getCurrentBufferLevel(t),a=i+e.placeholderBuffer;a-=f,a*=r.Vp/e.Vp,a+=f,e.stableBufferTime=n,e.Vp=r.Vp,e.gp=r.gp,e.placeholderBuffer=Math.max(0,a-i)}}}function T(e,t){return e.Vp*(e.utilities[t]+e.gp)}function E(e,t){for(var n=e.bitrates[t],r=e.utilities[t],i=0,a=t-1;a>=0;--a)if(e.utilities[a]<e.utilities[t]){var s=e.bitrates[a],o=e.utilities[a],l=e.Vp*(e.gp+(n*o-s*r)/(n-s));i=Math.max(i,l)}return i}function b(e){var t=e.mediaType===d.Z.AUDIO?[d.Z.AUDIO]:a;for(var n in t)a.hasOwnProperty(n)&&2===a[n].state&&(a[n].placeholderBuffer=0)}function S(){for(var e in a)if(a.hasOwnProperty(e)){var t=a[e];0!==t.state&&(t.state=1,v(t))}}function A(e){if(e&&e.chunk&&e.chunk.mediaInfo){var t=a[e.chunk.mediaInfo.type];if(t&&0!==t.state){var n=e.chunk.start;isNaN(t.mostAdvancedSegmentStart)||n>t.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=n,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=n,t.lastSegmentDurationS=e.chunk.duration,t.lastQuality=e.chunk.quality,I(t,e.chunk.mediaInfo.type)}}}function w(e){if(e&&e.metric===r.Z.HTTP_REQUEST&&e.value&&e.value.type===s.w.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){var t=a[e.mediaType];t&&0!==t.state&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),I(t,e.mediaType))}}function I(e,t){if(!isNaN(e.lastSegmentStart)&&!isNaN(e.lastSegmentRequestTimeMs)&&!isNaN(e.placeholderBuffer)){if(e.placeholderBuffer*=.99,!isNaN(e.lastSegmentFinishTimeMs)){var n=p.getCurrentBufferLevel(t)+.001*(e.lastSegmentFinishTimeMs-e.lastSegmentRequestTimeMs),r=T(e,e.lastQuality),i=Math.max(0,r-n);e.placeholderBuffer=Math.min(i,e.placeholderBuffer)}e.lastSegmentWasReplacement&&!isNaN(e.lastSegmentDurationS)&&(e.placeholderBuffer+=e.lastSegmentDurationS),e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN}}function C(e){if(e){var t=a[e.mediaType];t&&0!==t.state&&(t.abrQuality=e.newQuality)}}function R(e){if(e){var t=a[e.mediaType];if(t&&0!==t.state){var n,r=p.getCurrentBufferLevel(e.mediaType);n=t.abrQuality>0?E(t,t.abrQuality):f;var i=Math.max(0,n-r);t.placeholderBuffer=Math.min(t.placeholderBuffer,i)}}}function D(){a={}}return t={getMaxIndex:function(e){var t=(0,i.Z)(h).create();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getScheduleController")&&e.hasOwnProperty("getStreamInfo")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("useBufferOccupancyABR")))return t;var r=e.getMediaInfo(),s=e.getMediaType(),o=e.getScheduleController(),l=e.getStreamInfo(),u=e.getAbrController(),c=u.getThroughputHistory(),d=l?l.id:null,f=l&&l.manifestInfo&&l.manifestInfo.isDynamic,m=e.useBufferOccupancyABR();if(t.reason=t.reason||{},!m)return t;o.setTimeToLoadDelay(0);var b=function(e){var t=e.getMediaType(),n=a[t];return n?0!==n.state&&_(n,t):(n=function(e){var t={},n=e.getMediaInfo().bitrateList.map((function(e){return e.bandwidth})),r=function(e){return e.map((function(e){return Math.log(e)}))}(n);r=r.map((function(e){return e-r[0]+1}));var i=g.getStableBufferTime(),a=y(i,n,r);return a?(t.state=1,t.bitrates=n,t.utilities=r,t.stableBufferTime=i,t.Vp=a.Vp,t.gp=a.gp,t.lastQuality=0,v(t)):t.state=0,t}(e),a[t]=n),n}(e);if(0===b.state)return t;var S,A=p.getCurrentBufferLevel(s),w=c.getAverageThroughput(s,f),I=c.getSafeAverageThroughput(s,f),C=c.getAverageLatency(s);if(t.reason.state=b.state,t.reason.throughput=w,t.reason.latency=C,isNaN(w))return t;switch(b.state){case 1:S=u.getQualityForBitrate(r,I,d,C),t.quality=S,t.reason.throughput=I,b.placeholderBuffer=Math.max(0,E(b,S)-A),b.lastQuality=S,!isNaN(b.lastSegmentDurationS)&&A>=b.lastSegmentDurationS&&(b.state=2);break;case 2:!function(e,t){var n=Date.now();if(isNaN(e.lastSegmentFinishTimeMs)){if(!isNaN(e.lastCallTimeMs)){var r=.001*(n-e.lastCallTimeMs);e.placeholderBuffer+=Math.max(0,r)}}else{var i=.001*(n-e.lastSegmentFinishTimeMs);e.placeholderBuffer+=Math.max(0,i)}e.lastCallTimeMs=n,e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN,_(e,t)}(b,s),S=function(e,t){for(var n=e.bitrates.length,r=NaN,i=NaN,a=0;a<n;++a){var s=(e.Vp*(e.utilities[a]+e.gp)-t)/e.bitrates[a];(isNaN(i)||s>=i)&&(i=s,r=a)}return r}(b,A+b.placeholderBuffer);var R=u.getQualityForBitrate(r,I,d,C);S>b.lastQuality&&S>R&&(S=Math.max(R,b.lastQuality));var D=Math.max(0,A+b.placeholderBuffer-T(b,S));D<=b.placeholderBuffer?(b.placeholderBuffer-=D,D=0):(D-=b.placeholderBuffer,b.placeholderBuffer=0,S<u.getMaxAllowedIndexFor(s,d)?o.setTimeToLoadDelay(1e3*D):D=0),t.quality=S,t.reason.throughput=w,t.reason.latency=C,t.reason.bufferLevel=A,t.reason.placeholderBuffer=b.placeholderBuffer,t.reason.delay=D,b.lastQuality=S;break;default:n.debug("BOLA ABR rule invoked in bad state."),t.quality=u.getQualityForBitrate(r,I,d,C),t.reason.state=b.state,t.reason.throughput=I,t.reason.latency=C,b.state=1,v(b)}return t},reset:function(){D(),m.off(c.Z.BUFFER_EMPTY,b,t),m.off(c.Z.PLAYBACK_SEEKING,S,t),m.off(c.Z.METRIC_ADDED,w,t),m.off(c.Z.QUALITY_CHANGE_REQUESTED,C,t),m.off(c.Z.FRAGMENT_LOADING_ABANDONED,R,t),m.off(l.Z.MEDIA_FRAGMENT_LOADED,A,t)}},n=(0,u.Z)(h).getInstance().getLogger(t),D(),m.on(c.Z.BUFFER_EMPTY,b,t),m.on(c.Z.PLAYBACK_SEEKING,S,t),m.on(c.Z.METRIC_ADDED,w,t),m.on(c.Z.QUALITY_CHANGE_REQUESTED,C,t),m.on(c.Z.FRAGMENT_LOADING_ABANDONED,R,t),m.on(l.Z.MEDIA_FRAGMENT_LOADED,A,t),t}h.__dashjs_factory_name="BolaRule",t.Z=a.Z.getClassFactory(h)},895:function(e,t,n){"use strict";var r=n(5448),i=n(2068),a=n(6398);function s(){var e,t,n=this.context;return e={getMaxIndex:function(e){var r=(0,i.Z)(n).create();if(!e||!e.hasOwnProperty("getDroppedFramesHistory"))return r;var a=e.getDroppedFramesHistory(),s=e.getStreamInfo().id;if(a){var o=a.getFrameHistory(s);if(!o||0===o.length)return r;for(var l=0,u=0,c=i.Z.NO_CHANGE,d=1;d<o.length;d++)if(o[d]&&(l=o[d].droppedVideoFrames,(u=o[d].totalVideoFrames)>375&&l/u>.15)){c=d-1,t.debug("index: "+c+" Dropped Frames: "+l+" Total Frames: "+u);break}return(0,i.Z)(n).create(c,{droppedFrames:l})}return r}},t=(0,a.Z)(n).getInstance().getLogger(e),e}s.__dashjs_factory_name="DroppedFramesRule",t.Z=r.Z.getClassFactory(s)},6535:function(e,t,n){"use strict";var r=n(5595),i=n(8512),a=n(5448),s=n(6398),o=n(2068),l=n(3393),u=n(3860),c=n(8825);function d(e){e=e||{};var t,n,a,d=this.context,f=(0,r.Z)(d).getInstance(),h=e.dashMetrics;function p(){(a={})[l.Z.VIDEO]={ignoreCount:2},a[l.Z.AUDIO]={ignoreCount:2}}function g(){p()}function m(e){isNaN(e.startTime)||e.mediaType!==l.Z.AUDIO&&e.mediaType!==l.Z.VIDEO||a[e.mediaType].ignoreCount>0&&a[e.mediaType].ignoreCount--}return t={getMaxIndex:function(e){var t=(0,o.Z)(d).create();if(!e||!e.hasOwnProperty("getMediaType"))return t;!function(){if(!h||!h.hasOwnProperty("getCurrentBufferLevel")||!h.hasOwnProperty("getCurrentBufferState"))throw new Error(l.Z.MISSING_CONFIG_ERROR)}();var r=e.getMediaType(),i=h.getCurrentBufferState(r),s=e.getRepresentationInfo().fragmentDuration,c=e.getStreamInfo(),f=c?c.id:null,p=e.getScheduleController(),g=c&&c.manifestInfo&&c.manifestInfo.isDynamic;if(function(e,t){return!e&&a[t].ignoreCount>0}(p.getPlaybackController().getLowLatencyModeEnabled(),r)||!s)return t;if(i&&i.state===u.Z.BUFFER_EMPTY)n.debug("["+r+"] Switch to index 0; buffer is empty."),t.quality=0,t.reason="InsufficientBufferRule: Buffer is empty";else{var m=e.getMediaInfo(),y=e.getAbrController(),v=y.getThroughputHistory(),_=h.getCurrentBufferLevel(r),T=v.getAverageThroughput(r,g),E=v.getAverageLatency(r),b=T*(_/s)*.5;t.quality=y.getQualityForBitrate(m,b,f,E),t.reason="InsufficientBufferRule: being conservative to avoid immediate rebuffering"}return t},reset:function(){p(),f.off(c.Z.PLAYBACK_SEEKING,g,t),f.off(i.Z.BYTES_APPENDED_END_FRAGMENT,m,t)}},n=(0,s.Z)(d).getInstance().getLogger(t),p(),f.on(c.Z.PLAYBACK_SEEKING,g,t),f.on(i.Z.BYTES_APPENDED_END_FRAGMENT,m,t),t}d.__dashjs_factory_name="InsufficientBufferRule",t.Z=a.Z.getClassFactory(d)},1914:function(e,t,n){"use strict";var r=n(3860),i=n(2068),a=n(5448),s=n(7855),o=n(5595),l=n(8512),u=n(6398),c=n(3393);function d(e){e=e||{};var t,n,a,d,f=this.context,h=e.dashMetrics,p=(0,o.Z)(f).getInstance();function g(e){e.placeholderBuffer=0,e.mostAdvancedSegmentStart=NaN,e.lastSegmentWasReplacement=!1,e.lastSegmentStart=NaN,e.lastSegmentDurationS=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN,e.lastSegmentUrl=""}function m(){for(var e in n)if(n.hasOwnProperty(e)){var t=n[e];0!==t.state&&(t.state=1,g(t))}}function y(e){if(e&&e.chunk&&e.chunk.mediaInfo){var t=n[e.chunk.mediaInfo.type],r=a[e.chunk.mediaInfo.type];if(t&&0!==t.state){var i=e.chunk.start;isNaN(t.mostAdvancedSegmentStart)||i>t.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=i,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=i,t.lastSegmentDurationS=e.chunk.duration,t.lastQuality=e.chunk.quality,_(t,r)}}}function v(e){if(e&&e.metric===r.Z.HTTP_REQUEST&&e.value&&e.value.type===s.w.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){var t=n[e.mediaType],i=a[e.mediaType];t&&0!==t.state&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),_(t,i))}}function _(e,t){isNaN(e.lastSegmentStart)||isNaN(e.lastSegmentRequestTimeMs)||(t.segment_request_start_s=.001*e.lastSegmentRequestTimeMs,t.segment_download_finish_s=.001*e.lastSegmentFinishTimeMs,e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN)}function T(e){if(e&&e.mediaType){var t=n[e.mediaType];t&&0!==t.state&&(t.abrQuality=e.newQuality)}}function E(e,t){if(e.length!==t.length)return-1;for(var n=0,r=0;r<e.length;r++)n+=e[r]*t[r];return n}function b(){n={},a={}}return t={getMaxIndex:function(e){var t,r=(0,i.Z)(f).create(),o=Math.pow(4,.99),l=Math.max(Math.pow(4,1),o*Math.sqrt(4)),u=e.getMediaInfo(),p=e.getMediaType(),m=u.bitrateList.map((function(e){return e.bandwidth})),y=m.length,v=e.getScheduleController(),_=e.getStreamInfo(),T=e.getAbrController(),b=T.getThroughputHistory(),S=_&&_.manifestInfo&&_.manifestInfo.isDynamic,A=e.useL2AABR(),w=h.getCurrentBufferLevel(p,!0),I=b.getSafeAverageThroughput(p,S),C=b.getAverageThroughput(p,S),R=b.getAverageLatency(p),D=e.getVideoModel().getPlaybackRate();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getScheduleController")&&e.hasOwnProperty("getStreamInfo")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("useL2AABR")))return r;if(r.reason=r.reason||{},!A||p===c.Z.AUDIO)return r;v.setTimeToLoadDelay(0);var N=function(e){var t=e.getMediaType(),r=n[t];return r||(r=function(e){var t={},n=e.getMediaInfo(),r=n.bitrateList.map((function(e){return e.bandwidth/1e3}));return t.state=1,t.bitrates=r,t.lastQuality=0,function(e){e&&e.type&&(a[e.type]={},a[e.type].w=[],a[e.type].prev_w=[],a[e.type].Q=0,a[e.type].segment_request_start_s=0,a[e.type].segment_download_finish_s=0,a[e.type].B_target=1.5)}(n),g(t),t}(e),n[t]=r),r}(e);if(0===N.state)return r;var O=a[p];if(!O)return r;if(r.reason.state=N.state,r.reason.throughput=C,r.reason.latency=R,isNaN(C))return r;switch(N.state){case 1:if(t=T.getQualityForBitrate(u,I,_.id,R),r.quality=t,r.reason.throughput=I,N.lastQuality=t,!isNaN(N.lastSegmentDurationS)&&w>=O.B_target){N.state=2,O.Q=o;for(var P=0;P<y;++P)P===N.lastQuality?O.prev_w[P]=1:O.prev_w[P]=0}break;case 2:var M=[],x=h.getCurrentHttpRequest(p).trace.reduce((function(e,t){return e+t.d}),0),L=h.getCurrentHttpRequest(p).trace.reduce((function(e,t){return e+t.b[0]}),0),k=Math.round(8*L/x),F=h.getCurrentHttpRequest(p);if(k<1&&(k=1),F.url===N.lastSegmentUrl||F.type===s.w.INIT_SEGMENT_TYPE)t=N.lastQuality;else{for(var U=N.lastSegmentDurationS,B=1,j=0;j<y;++j)m[j]=m[j]/1e3,D*m[j]>k&&(B=-1),O.w[j]=O.prev_w[j]+B*(U/(2*l))*((O.Q+o)*(D*m[j]/k));O.w=function(e){for(var t=e.length,n=!1,r=[],i=0;i<t;++i)r[i]=e[i];for(var a=e.sort((function(e,t){return t-e})),s=0,o=0,l=[],u=0;u<t-1;++u)if((o=((s+=a[u])-1)/(u+1))>=a[u+1]){n=!0;break}n||(o=(s+a[t-1]-1)/t);for(var c=0;c<t;++c)l[c]=Math.max(r[c]-o,0);return l}(O.w);for(var q=0;q<y;++q)M[q]=O.w[q]-O.prev_w[q],O.prev_w[q]=O.w[q];O.Q=Math.max(0,O.Q-U+U*D*((E(m,O.prev_w)+E(m,M))/k));for(var H=[],G=0;G<y;++G)H[G]=Math.abs(m[G]-E(O.w,m));(t=H.indexOf(Math.min.apply(Math,H)))>N.lastQuality&&m[N.lastQuality+1]<=k&&(t=N.lastQuality+1),m[t]>=k&&(O.Q=2*Math.max(o,O.Q)),N.lastSegmentUrl=F.url}r.quality=t,r.reason.throughput=C,r.reason.latency=R,r.reason.bufferLevel=w,N.lastQuality=r.quality;break;default:d.debug("L2A ABR rule invoked in bad state."),r.quality=T.getQualityForBitrate(u,I,_.id,R),r.reason.state=N.state,r.reason.throughput=I,r.reason.latency=R,N.state=1,g(N)}return r},reset:function(){b(),p.off(l.Z.PLAYBACK_SEEKING,m,t),p.off(l.Z.MEDIA_FRAGMENT_LOADED,y,t),p.off(l.Z.METRIC_ADDED,v,t),p.off(l.Z.QUALITY_CHANGE_REQUESTED,T,t)}},d=(0,u.Z)(f).getInstance().getLogger(t),b(),p.on(l.Z.PLAYBACK_SEEKING,m,t),p.on(l.Z.MEDIA_FRAGMENT_LOADED,y,t),p.on(l.Z.METRIC_ADDED,v,t),p.on(l.Z.QUALITY_CHANGE_REQUESTED,T,t),t}d.__dashjs_factory_name="L2ARule",t.Z=a.Z.getClassFactory(d)},6070:function(e,t,n){"use strict";var r=n(5448),i=n(6398),a=n(2068);function s(){var e,t,n=this.context;return e={getMaxIndex:function(e){for(var r=e?e.getSwitchHistory():null,i=r?r.getSwitchRequests():[],s=0,o=0,l=0,u=(0,a.Z)(n).create(),c=0;c<i.length;c++)if(void 0!==i[c]&&(s+=i[c].drops,o+=i[c].noDrops,l+=i[c].dropSize,s+o>=6&&s/o>.075)){u.quality=c>0&&i[c].drops>0?c-1:c,u.reason={index:u.quality,drops:s,noDrops:o,dropSize:l},t.debug("Switch history rule index: "+u.quality+" samples: "+(s+o)+" drops: "+s);break}return u}},t=(0,i.Z)(n).getInstance().getLogger(e),e}s.__dashjs_factory_name="SwitchHistoryRule",t.Z=r.Z.getClassFactory(s)},5628:function(e,t,n){"use strict";var r=n(5448),i=n(2068),a=n(3393),s=n(3860);function o(e){e=e||{};var t=this.context,n=e.dashMetrics;return{getMaxIndex:function(e){var r=(0,i.Z)(t).create();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("useBufferOccupancyABR")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("getScheduleController")))return r;!function(){if(!n||!n.hasOwnProperty("getCurrentBufferState"))throw new Error(a.Z.MISSING_CONFIG_ERROR)}();var o=e.getMediaInfo(),l=e.getMediaType(),u=n.getCurrentBufferState(l),c=e.getScheduleController(),d=e.getAbrController(),f=e.getStreamInfo(),h=f?f.id:null,p=f&&f.manifestInfo?f.manifestInfo.isDynamic:null,g=d.getThroughputHistory(),m=g.getSafeAverageThroughput(l,p),y=g.getAverageLatency(l),v=e.useBufferOccupancyABR();return isNaN(m)||!u||v||d.getAbandonmentStateFor(h,l)!==s.Z.ABANDON_LOAD&&(u.state===s.Z.BUFFER_LOADED||p)&&(r.quality=d.getQualityForBitrate(o,m,h,y),c.setTimeToLoadDelay(0),r.reason={throughput:m,latency:y}),r},reset:function(){}}}o.__dashjs_factory_name="ThroughputRule",t.Z=r.Z.getClassFactory(o)},4722:function(e,t,n){"use strict";var r=n(5448),i=n(6398);function a(){var e,t,n,r,a,s,o,l,u,c=this.context;function d(){n=null,r=1,a=100,s=0,o=null,l=null,u="dynamic_weight_selection"}function f(){var e=0;if(n)for(var t=0;t<n.length;t++){var r=n[t];r.state.throughput>e&&(e=r.state.throughput)}return e}function h(e,t,n){var r=e.map((function(e,r){return n[r]*Math.pow(e-t[r],2)})).reduce((function(e,t){return e+t}));return(r<0?-1:1)*Math.sqrt(Math.abs(r))}function p(e,t){return h([e.state.throughput,e.state.latency,e.state.rebuffer,e.state.switch],[t.state.throughput,t.state.latency,t.state.rebuffer,t.state.switch],[1,1,1,1])}function g(e,t,n){for(var r=0;r<t.length;r++){var i=t[r],a=p(i,e);m(i,n,Math.exp(-1*Math.pow(a,2)/(2*Math.pow(.1,2))))}}function m(e,t,n){var r=e.state,i=[.01,.01,.01,.01];r.throughput=r.throughput+(t[0]-r.throughput)*i[0]*n,r.latency=r.latency+(t[1]-r.latency)*i[1]*n,r.rebuffer=r.rebuffer+(t[2]-r.rebuffer)*i[2]*n,r.switch=r.switch+(t[3]-r.switch)*i[3]*n}return e={getNextQuality:function(e,i,c,d,p,m,y){var v=c,_=d,T=i,E=function(e){if(!n){n=[];var t=e.bitrateList,i=[];s=t[0].bandwidth,t.forEach((function(e){i.push(e.bandwidth),e.bandwidth<s&&(s=e.bandwidth)})),u=i.map((function(e){return Math.pow(e,2)})).reduce((function(e,t){return e+t})),r=Math.sqrt(u);for(var a=0;a<t.length;a++){var o={qualityIndex:a,bitrate:t[a].bandwidth,state:{throughput:t[a].bandwidth/r,latency:0,rebuffer:0,switch:0}};n.push(o)}l=function(e){var t=[],n=function(e){for(var t=[],n=0;n<e;n++){var r=[Math.random()*f(),Math.random(),Math.random(),Math.random()];t.push(r)}return t}(Math.pow(e.length,2));t.push(n[0]);for(var r=[1,1,1,1],i=1;i<e.length;i++){for(var a=null,s=null,o=0;o<n.length;o++){for(var l=n[o],u=null,c=0;c<t.length;c++){var d=h(l,t[c],r);(null===u||d<u)&&(u=d)}(null===s||u>s)&&(a=l,s=u)}t.push(a)}for(var p=null,g=null,m=0;m<t.length;m++){for(var y=0,v=0;v<t.length;v++)m!==v&&(y+=h(t[m],t[v],r));(null===p||y>p)&&(p=y,g=m)}var _=[];for(_.push(t[g]),t.splice(g,1);t.length>0;){for(var T=null,E=null,b=0;b<t.length;b++){var S=h(_[0],t[b],r);(null===T||S<T)&&(T=S,E=b)}_.push(t[E]),t.splice(E,1)}return _}(n)}var u;return n}(e),b=i/r;b>1&&(b=f()),c/=a,t.debug("getNextQuality called throughput:".concat(b," latency:").concat(c," bufferSize:").concat(d," currentQualityIndex:").concat(m," playbackRate:").concat(p));var S=E[m],A=S.bitrate*y.getSegmentDuration()/T,w=Math.max(0,A-_);if(_-A<y.getMinBuffer())return t.debug("Buffer is low for bitrate= ".concat(S.bitrate," downloadTime=").concat(A," currentBuffer=").concat(_," rebuffer=").concat(w)),function(e,t){var r=0,i=e;if(n)for(var a=0;a<n.length;a++){var s=n[a];s.bitrate<e.bitrate&&s.bitrate>r&&t>s.bitrate&&(r=s.bitrate,i=s)}return i}(S,T).qualityIndex;switch(u){case"manual_weight_selection":o=[.4,.4,.4,.4];break;case"random_weight_selection":!function(e){o=function(e,t){for(var n=[],r=Math.sqrt(2/e),i=0;i<4;i++)n.push(Math.random()*r);return o=n}(e.length)}(E);break;default:!function(e,t,n,r,i,a,s){o||(o=l[l.length-1]);var u=e.findWeightVector(t,n,r,i,a,s);null!==u&&-1!==u&&(o=u)}(y,E,v,_,w,T,p)}for(var I=null,C=null,R=null,D=0;D<E.length;D++){var N=E[D],O=N.state,P=[O.throughput,O.latency,O.rebuffer,O.switch],M=o.slice(),x=y.getNextBufferWithBitrate(N.bitrate,_,T),L=x<y.getMinBuffer();L&&t.debug("Buffer is low for bitrate=".concat(N.bitrate," downloadTime=").concat(A," currentBuffer=").concat(_," nextBuffer=").concat(x)),(N.bitrate>i-1e4||L)&&N.bitrate!==s&&(M[0]=100);var k=h(P,[b,0,0,0],M);(null===I||k<I)&&(I=k,C=N.qualityIndex,R=N)}var F=Math.abs(S.bitrate-R.bitrate)/r;return g(S,E,[b,c,w,F]),g(R,E,[b,0,0,F]),C},reset:function(){d()}},t=(0,i.Z)(c).getInstance().getLogger(e),d(),e}a.__dashjs_factory_name="LearningAbrController",t.Z=r.Z.getClassFactory(a)},5317:function(e,t,n){"use strict";var r=n(5448),i=n(2298);function a(){var e,t,n,r,a;function s(){t=null,n=null,r=null,a=null}function o(e,t,n,r){var a=new i.Z;return a.type=e,a.weights.bitrateReward=t||1,a.weights.bitrateSwitchPenalty=1,a.weights.rebufferPenalty=n||1e3,a.weights.latencyPenalty=[],a.weights.latencyPenalty.push({threshold:1.1,penalty:.05*r}),a.weights.latencyPenalty.push({threshold:1e8,penalty:.1*n}),a.weights.playbackSpeedPenalty=r||200,a}function l(e,t,n,r,i){i.bitrateWSum+=i.weights.bitrateReward*e,i.lastBitrate&&(i.bitrateSwitchWSum+=i.weights.bitrateSwitchPenalty*Math.abs(e-i.lastBitrate)),i.lastBitrate=e,i.rebufferWSum+=i.weights.rebufferPenalty*t;for(var a=0;a<i.weights.latencyPenalty.length;a++){var s=i.weights.latencyPenalty[a];if(n<=s.threshold){i.latencyWSum+=s.penalty*n;break}}i.playbackSpeedWSum+=i.weights.playbackSpeedPenalty*Math.abs(1-r),i.totalQoe=i.bitrateWSum-i.bitrateSwitchWSum-i.rebufferWSum-i.latencyWSum-i.playbackSpeedWSum}return e={setupPerSegmentQoe:function(e,i,s){t=o("segment",e,i,s),n=e,r=i,a=s},logSegmentMetrics:function(e,n,r,i){t&&l(e,n,r,i,t)},getPerSegmentQoe:function(){return t},calculateSingleUseQoe:function(e,t,i,s){var u=null;return n&&r&&a&&(u=o("segment",n,r,a)),u?(l(e,t,i,s,u),u.totalQoe):0},reset:function(){s()}},s(),e}a.__dashjs_factory_name="LoLpQoeEvaluator",t.Z=r.Z.getClassFactory(a)},5435:function(e,t,n){"use strict";var r=n(6398),i=n(5448),a=n(4722),s=n(5317),o=n(2068),l=n(3860),u=n(6523),c=n(3393);function d(e){var t,n,i,d,f=(e=e||{}).dashMetrics,h=this.context;return n={getMaxIndex:function(e){try{var n=(0,o.Z)(h).create(),r=e.getMediaInfo().type,a=e.getAbrController(),s=e.getStreamInfo(),p=a.getQualityFor(r,s.id),g=e.getMediaInfo(),m=f.getCurrentBufferState(r),y=e.getScheduleController(),v=f.getCurrentBufferLevel(r,!0),_=s&&s.manifestInfo?s.manifestInfo.isDynamic:null,T=y.getPlaybackController(),E=T.getCurrentLiveLatency();if(!e.useLoLPABR()||r===c.Z.AUDIO)return n;E||(E=0);var b=T.getPlaybackRate(),S=a.getThroughputHistory().getSafeAverageThroughput(r,_);if(t.debug("Throughput ".concat(Math.round(S)," kbps")),isNaN(S)||!m)return n;if(a.getAbandonmentStateFor(s.id,r)===l.Z.ABANDON_LOAD)return n;for(var A=g.bitrateList,w=e.getRepresentationInfo().fragmentDuration,I=A[0].bandwidth/1e3,C=A[A.length-1].bandwidth/1e3,R=0;R<A.length;R++){var D=A[R].bandwidth/1e3;D>C?C=D:D<I&&(I=D)}var N=A[p].bandwidth/1e3,O=f.getCurrentHttpRequest(r,!0),P=(O.tresponse.getTime()-O.trequest.getTime())/1e3,M=P>w?P-w:0;d.setupPerSegmentQoe(w,C,I),d.logSegmentMetrics(N,M,E,b);var x=(0,u.Z)(h).create({targetLatency:1.5,bufferMin:.3,segmentDuration:w,qoeEvaluator:d});return n.quality=i.getNextQuality(g,1e3*S,E,v,b,p,x),n.reason={throughput:S,latency:E},n.priority=o.Z.PRIORITY.STRONG,y.setTimeToLoadDelay(0),n.quality!==p&&t.debug("[TgcLearningRule]["+r+"] requesting switch to index: ",n.quality,"Average throughput",Math.round(S),"kbps"),n}catch(e){throw e}},reset:function(){i.reset(),d.reset()}},t=(0,r.Z)(h).getInstance().getLogger(n),i=(0,a.Z)(h).create(),d=(0,s.Z)(h).create(),n}d.__dashjs_factory_name="LoLPRule",t.Z=i.Z.getClassFactory(d)},6523:function(e,t,n){"use strict";var r=n(5448);function i(e){var t,n,r,i,a=e.targetLatency,s=e.bufferMin,o=e.segmentDuration,l=e.qoeEvaluator;function u(){return o}function c(e,t){var n=u();return t>n?e-n:e+n-t}return t={getMinBuffer:function(){return s},getSegmentDuration:u,getNextBufferWithBitrate:function(e,t,n){return c(t,e*o/n)},getNextBuffer:c,findWeightVector:function(e,t,i,u,d,f){var h=null,p=null,g=null,m=Math.abs(t-r);return e.forEach((function(e){n.forEach((function(n){n[0];var r=n[1],u=n[2],y=(n[3],e.bitrate*o/d),v=c(i,y),_=(0===u?10:1/u)*Math.max(1e-5,y-v),T=(0===r?10:1/r)*e.state.latency,E=l.calculateSingleUseQoe(e.bitrate,_,T,f);(null===h||E>h)&&function(e,t,n){return!(e>a+n)&&t>=s}(t,v,m)&&(h=E,p=n,g=e.bitrate)}))})),null===p&&null===g&&(p=-1),r=t,p}},n=function e(t,n,r){if(r===n)return t;for(var a=t.length,s=0;s<a;s++)for(var o=t.shift(),l=0;l<i.length;l++)t.push(o.concat(i[l]));return e(t,n,r+1)}((i=[.2,.4,.6,.8,1]).map((function(e){return[e]})),4,1),r=0,t}i.__dashjs_factory_name="LoLpWeightSelector",t.Z=r.Z.getClassFactory(i)},2298:function(e,t){"use strict";t.Z=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type=null,this.lastBitrate=null,this.weights={},this.weights.bitrateReward=null,this.weights.bitrateSwitchPenalty=null,this.weights.rebufferPenalty=null,this.weights.latencyPenalty=null,this.weights.playbackSpeedPenalty=null,this.bitrateWSum=0,this.bitrateSwitchWSum=0,this.rebufferWSum=0,this.latencyWSum=0,this.playbackSpeedWSum=0,this.totalQoe=0}},7803:function(e,t,n){"use strict";n.d(t,{Y:function(){return h}});var r=n(3393),i=n(1553),a=n(5448),s=n(2128),o=n(2594),l=n(7387),u=n(7417),c=n(9032),d=n(9326),f=n(7802),h=["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"];function p(e){var t,n,a,p,g,m,y,v,_=this.context,T=e.adapter,E=e.baseURLController,b=e.streamInfo,S=e.timelineConverter,A=e.debug,w=e.eventBus,I=e.events,C=e.dashConstants,R=(0,o.Z)(_).getInstance();function D(e,t){var r=new s.Z;r.id=e.id,r.bitrate=e.bandwidth,r.width=e.width,r.height=e.height,r.tilesHor=1,r.tilesVert=1,e.essentialProperties&&e.essentialProperties.forEach((function(e){if(h.indexOf(e.schemeIdUri)>=0&&e.value){var t=e.value.split("x");2!==t.length||isNaN(t[0])||isNaN(t[1])||(r.tilesHor=parseInt(t[0],10),r.tilesVert=parseInt(t[1],10))}})),t?m.updateSegmentData(e).then((function(t){!function(e,t,n){var r=[],i=function(e,t){var n,r,i,a,s=[],o=0;for(n=0,r=e.segments.length;n<r;n++)i=e.segments[n],(a=(0,l.TJ)(S,T.getIsDynamic(),t,i.startTime,i.duration,i.timescale,i.media,i.mediaRange,o))&&(s.push(a),a=null,o++);return s}(n,t);t.segments=i,e.segmentDuration=t.segments[0].duration,e.readThumbnail=function(e,n){var i=null;r.some((function(t){if(t.start<=e&&t.end>e)return i=t.url,!0})),i?n(i):t.segments.some((function(i){if(i.mediaStartTime<=e&&i.mediaStartTime+i.duration>e){var a=E.resolve(t.path);return y.load({method:"get",url:a.url,request:{range:i.mediaRange,responseType:"arraybuffer"},onload:function(e){var t=v.getSamplesInfo(e.target.response),a=new Blob([e.target.response.slice(t.sampleList[0].offset,t.sampleList[0].offset+t.sampleList[0].size)],{type:"image/jpeg"}),s=window.URL.createObjectURL(a);r.push({start:i.mediaStartTime,end:i.mediaStartTime+i.duration,url:s}),n&&n(s)}}),!0}}))}}(r,e,t)})):(r.startNumber=e.startNumber,r.segmentDuration=e.segmentDuration,r.timescale=e.timescale,r.templateUrl=function(e){var t=R.isRelative(e.media)?R.resolve(e.media,E.resolve(e.path).url):e.media;return t?(0,l.Aj)(t,e.id):""}(e)),r.tilesHor>0&&r.tilesVert>0&&(r.widthPerTile=r.width/r.tilesHor,r.heightPerTile=r.height/r.tilesVert,n.push(r))}function N(){n=[],p=-1,g=null}return t={getTracks:function(){return n},addTracks:function(){if(b&&T&&(g=T.getMediaInfoForType(b,r.Z.IMAGE))){var e=T.getVoRepresentations(g);e&&e.length>0&&e.forEach((function(e){(e.segmentInfoType===i.Z.SEGMENT_TEMPLATE&&e.segmentDuration>0&&e.media||e.segmentInfoType===i.Z.SEGMENT_TIMELINE)&&D(e),e.segmentInfoType===i.Z.SEGMENT_BASE&&D(e,!0)})),n.length>0&&n.sort((function(e,t){return e.bitrate-t.bitrate}))}},reset:N,setTrackByIndex:function(e){n&&0!==n.length&&(e>=n.length&&(e=n.length-1),p=e)},getCurrentTrack:function(){return p<0?null:n[p]},getCurrentTrackIndex:function(){return p},getThumbnailRequestForTime:function(e){for(var t,r=T.getVoRepresentations(g),i=0;i<r.length;i++)if(n[p].id===r[i].id){t=r[i];break}return a.getSegmentRequestForTime(g,t,e)}},N(),y=(0,c.Z)(_).create({}),v=(0,u.Z)(_).getInstance(),m=(0,f.Z)(_).create({events:I,eventBus:w,streamInfo:b,timelineConverter:S,dashConstants:C,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController,type:r.Z.IMAGE}),(a=(0,d.Z)(_).create({streamInfo:b,type:r.Z.IMAGE,timelineConverter:S,segmentsController:m,baseURLController:E,debug:A,eventBus:w,events:I,dashConstants:C,urlUtils:R})).initialize(!!T&&T.getIsDynamic()),t}p.__dashjs_factory_name="ThumbnailTracks",t.Z=a.Z.getClassFactory(p)},7417:function(e,t,n){"use strict";var r=n(6398),i=n(8260),a=n(5448),s=n(6934),o=n(9597);function l(){var e,t,n=this.context;function a(e){if(!e)return null;void 0===e.fileStart&&(e.fileStart=0);var t=s.parseBuffer(e),r=(0,i.Z)(n).create();return r.setData(t),r}function l(e,t){return e[t+3]>>>0|e[t+2]<<8>>>0|e[t+1]<<16>>>0|e[t]<<24>>>0}function u(e,t){return String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t])}return t={parse:a,findLastTopIsoBoxCompleted:function(e,t,n){if(void 0===n&&(n=0),!t||n+8>=t.byteLength)return new o.Z(0,!1);for(var r,i=t instanceof ArrayBuffer?new Uint8Array(t):t,a=0;n<i.byteLength;){var s=l(i,n),c=u(i,n+4);if(0===s)break;n+s<=i.byteLength&&(e.indexOf(c)>=0?r=new o.Z(n,!0,s):a=n+s),n+=s}return r||new o.Z(a,!1)},getMediaTimescaleFromMoov:function(e){var t=a(e),n=t?t.getBox("mdhd"):void 0;return n?n.timescale:NaN},getSamplesInfo:function(e){if(!e||0===e.byteLength)return{sampleList:[],lastSequenceNumber:NaN,totalDuration:NaN,numSequences:NaN};var t,n,r,i,s,o,l,u,c,d,f,h,p,g,m,y,v=a(e),_=v.getBoxes("moof"),T=v.getBoxes("mfhd");m=v.getBoxes("moof").length,g=T[T.length-1].sequence_number,n=0,s=[];var E=-1,b=-1;for(d=0;d<_.length;d++){var S=_[d],A=S.getChildBoxes("traf");for(u=0;u<A.length;u++){var w=A[u],I=w.getChildBox("tfhd"),C=w.getChildBox("tfdt");i=C.baseMediaDecodeTime;var R=w.getChildBoxes("trun"),D=w.getChildBoxes("subs");for(c=0;c<R.length;c++){var N=R[c];for(n=N.sample_count,p=(I.base_data_offset||0)+(N.data_offset||0),l=0;l<n;l++){t=void 0!==(o=N.samples[l]).sample_duration?o.sample_duration:I.default_sample_duration,r=void 0!==o.sample_size?o.sample_size:I.default_sample_size;var O={dts:i,cts:i+(void 0!==o.sample_composition_time_offset?o.sample_composition_time_offset:0),duration:t,offset:S.offset+p,size:r,subSizes:[r]};if(D)for(f=0;f<D.length;f++){var P=D[f];if(E<P.entry_count-1&&l>b&&(E++,b+=P.entries[E].sample_delta),l==b){O.subSizes=[];var M=P.entries[E];for(h=0;h<M.subsample_count;h++)O.subSizes.push(M.subsamples[h].subsample_size)}}s.push(O),p+=r,i+=t}}y=i-C.baseMediaDecodeTime}}return{sampleList:s,lastSequenceNumber:g,totalDuration:y,numSequences:m}},findInitRange:function(t){var n=null,r=a(t);if(!r)return n;var i=r.getBox("ftyp"),s=r.getBox("moov");return e.debug("Searching for initialization."),s&&s.isComplete&&(n=(i?i.offset:s.offset)+"-"+(s.offset+s.size-1),e.debug("Found the initialization.  Range: "+n)),n},parsePayload:function(e,t,n){if(void 0===n&&(n=0),!t||n+8>=t.byteLength)return new o.Z(0,!1);for(var r,i=t instanceof ArrayBuffer?new Uint8Array(t):t,a=0;n<i.byteLength;){var s=l(i,n),c=u(i,n+4);if(0===s)break;n+s<=i.byteLength&&(e.indexOf(c)>=0?r=new o.Z(n,!0,s,c):a=n+s),n+=s}return r||new o.Z(a,!1)}},e=(0,r.Z)(n).getInstance().getLogger(t),t}l.__dashjs_factory_name="BoxParser",t.Z=a.Z.getSingletonFactory(l)},1715:function(e,t,n){"use strict";n.d(t,{B:function(){return o}});var r=n(5448),i=n(7803),a=n(3393),s=[{codec:"avc1",compatibleCodecs:["avc3"]},{codec:"avc3",compatibleCodecs:["avc1"]}];function o(){var e="ManagedMediaSource"in window,t="WebKitMediaSource"in window,n="MediaSource"in window;return e||t||n}function l(){var e,t,n;return e={setConfig:function(e){e&&e.settings&&(t=e.settings)},supportsMediaSource:o,supportsEncryptedMedia:function(){return n},supportsCodec:function(e,n){return n!==a.Z.AUDIO&&n!==a.Z.VIDEO?Promise.resolve(!0):function(e,n){return t.get().streaming.capabilities.useMediaCapabilitiesApi&&navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo&&(e.codec&&n===a.Z.AUDIO||n===a.Z.VIDEO&&e.codec&&e.width&&e.height&&e.bitrate&&e.framerate)}(e,n)?function(e,t){return new Promise((function(n){if(e&&e.codec){var r={type:"media-source"};r[t]={},r[t].contentType=e.codec,r[t].width=e.width,r[t].height=e.height,r[t].bitrate=parseInt(e.bitrate),r[t].framerate=parseFloat(e.framerate),navigator.mediaCapabilities.decodingInfo(r).then((function(e){n(e.supported)})).catch((function(){n(!1)}))}else n(!1)}))}(e,n):function(e){return new Promise((function(t){if(e&&e.codec){var n=e.codec;e.width&&e.height&&(n+=';width="'+e.width+'";height="'+e.height+'"'),"ManagedMediaSource"in window&&ManagedMediaSource.isTypeSupported(n)||"MediaSource"in window&&MediaSource.isTypeSupported(n)||"WebKitMediaSource"in window&&WebKitMediaSource.isTypeSupported(n)?t(!0):t(!1)}else t(!1)}))}(e)},setEncryptedMediaSupported:function(e){n=e},supportsEssentialProperty:function(e){try{return-1!==i.Y.indexOf(e.schemeIdUri)||a.Z.FONT_DOWNLOAD_DVB_SCHEME===e.schemeIdUri}catch(e){return!0}},codecRootCompatibleWithCodec:function(e,t){for(var n,r=e.split(".")[0],i=0===t.indexOf(r),a=0;a<s.length;a++)if(s[a].codec===r){n=s[a];break}return n?i||n.compatibleCodecs.some((function(e){return 0===t.indexOf(e)})):i}},n=!1,e}l.__dashjs_factory_name="Capabilities",t.Z=r.Z.getSingletonFactory(l)},2295:function(e,t,n){"use strict";var r=n(5448),i=n(3106);function a(){return{customTimeRangeArray:[],length:0,add:function(e,t){var n;for(n=0;n<this.customTimeRangeArray.length&&e>this.customTimeRangeArray[n].start;n++);for(this.customTimeRangeArray.splice(n,0,{start:e,end:t}),n=0;n<this.customTimeRangeArray.length-1;n++)this.mergeRanges(n,n+1)&&n--;this.length=this.customTimeRangeArray.length},clear:function(){this.customTimeRangeArray=[],this.length=0},remove:function(e,t){for(var n=0;n<this.customTimeRangeArray.length;n++)if(e<=this.customTimeRangeArray[n].start&&t>=this.customTimeRangeArray[n].end)this.customTimeRangeArray.splice(n,1),n--;else{if(e>this.customTimeRangeArray[n].start&&t<this.customTimeRangeArray[n].end){this.customTimeRangeArray.splice(n+1,0,{start:t,end:this.customTimeRangeArray[n].end}),this.customTimeRangeArray[n].end=e;break}e>this.customTimeRangeArray[n].start&&e<this.customTimeRangeArray[n].end?this.customTimeRangeArray[n].end=e:t>this.customTimeRangeArray[n].start&&t<this.customTimeRangeArray[n].end&&(this.customTimeRangeArray[n].start=t)}this.length=this.customTimeRangeArray.length},mergeRanges:function(e,t){var n=this.customTimeRangeArray[e],r=this.customTimeRangeArray[t];return n.start<=r.start&&r.start<=n.end&&n.end<=r.end?(n.end=r.end,this.customTimeRangeArray.splice(t,1),!0):r.start<=n.start&&n.start<=r.end&&r.end<=n.end?(n.start=r.start,this.customTimeRangeArray.splice(t,1),!0):r.start<=n.start&&n.start<=r.end&&n.end<=r.end?(this.customTimeRangeArray.splice(e,1),!0):n.start<=r.start&&r.start<=n.end&&r.end<=n.end&&(this.customTimeRangeArray.splice(t,1),!0)},start:function(e){return(0,i.SE)(e),e>=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].start},end:function(e){return(0,i.SE)(e),e>=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].end}}}a.__dashjs_factory_name="CustomTimeRanges",t.Z=r.Z.getClassFactory(a)},5:function(e,t,n){"use strict";var r=n(5448);function i(){var e,t=/^[a-z][a-z0-9+\-_.]*:/i,n=/^https?:\/\//i,r=/^https:\/\//i,i=/^([a-z][a-z0-9+\-_.]*:\/\/[^\/]+)\/?/i,a=function(e,t){try{return new window.URL(e,t).toString()}catch(t){return e}},s=function(e,t){var n=o;if(!t)return e;if(!c(e))return e;d(e)&&(n=l),f(e)&&(n=u);var r=n(t),i="/"!==r.charAt(r.length-1)&&"/"!==e.charAt(0)?"/":"";return[r,e].join(i)};function o(e){var t=e.indexOf("/"),n=e.lastIndexOf("/");return-1!==t?n===t+1?e:(-1!==e.indexOf("?")&&(e=e.substring(0,e.indexOf("?"))),e.substring(0,n+1)):""}function l(e){var t=e.match(i);return t?t[1]:""}function u(e){var n=e.match(t);return n?n[0]:""}function c(e){return!t.test(e)}function d(e){return c(e)&&"/"===e.charAt(0)}function f(e){return 0===e.indexOf("//")}return function(){try{new window.URL("x","http://y"),e=a}catch(e){}finally{e=e||s}}(),{parseBaseUrl:o,parseOrigin:l,parseScheme:u,isRelative:c,isPathAbsolute:d,isSchemeRelative:f,isHTTPURL:function(e){return n.test(e)},isHTTPS:function(e){return r.test(e)},removeHostname:function(e){return/^(?:\w+\:\/\/)?([^\/]+)(.*)$/.exec(e)[2].substring(1)},resolve:function(t,n){return e(t,n)}}}i.__dashjs_factory_name="DefaultURLUtils",t.Z=r.Z.getSingletonFactory(i)},8260:function(e,t,n){"use strict";var r=n(2839),i=n(5448);function a(){var e;function t(t){var r=[];if(!t||!e||"function"!=typeof e.fetchAll)return r;for(var i,a=e.fetchAll(t),s=0,o=a.length;s<o;s++)(i=n(a[s]))&&r.push(i);return r}function n(e){if(!e)return null;var t=new r.Z(e);return e.hasOwnProperty("_incomplete")&&(t.isComplete=!e._incomplete),t}return{getBox:function(t){return t&&e&&e.boxes&&0!==e.boxes.length&&"function"==typeof e.fetch?n(e.fetch(t)):null},getBoxes:t,setData:function(t){e=t},getLastBox:function(){if(!e||!e.boxes||!e.boxes.length)return null;var n=t(e.boxes[e.boxes.length-1].type);return n.length>0?n[n.length-1]:null}}}a.__dashjs_factory_name="IsoFile",t.Z=i.Z.getClassFactory(a)},7473:function(e,t,n){"use strict";n.d(t,{k:function(){return i}});var r=n(5448);function i(e,t){var n={url:e.url,method:e.method,headers:Object.assign({},e.headers),credentials:e.withCredentials?"include":void 0,range:e.request.range};return Promise.resolve(t.modifyRequest(n)).then((function(){return Object.assign(e,n,{withCredentials:"include"===n.credentials})}))}function a(){return{modifyRequest:null,modifyRequestURL:function(e){return e},modifyRequestHeader:function(e,t){return t.url,e}}}a.__dashjs_factory_name="RequestModifier",t.Z=r.Z.getSingletonFactory(a)},3106:function(e,t,n){"use strict";n.d(t,{PS:function(){return a},SE:function(){return s}});var r=n(3393);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){if(i(e)!==t)throw r.Z.BAD_ARGUMENT_ERROR}function s(e){if(null===e||isNaN(e)||e%1!=0)throw r.Z.BAD_ARGUMENT_ERROR+" : argument is not an integer"}},2594:function(e,t,n){"use strict";var r=n(5448),i=n(5);function a(){var e,t=[],n=this.context;function r(n,r,i){var a=function(n){var r;for(r=0;r<t.length;r++)if(t[r].regex.test(n))return t[r].utils;return e}(i||r);return a&&"function"==typeof a[n]?a[n](r,i):e[n](r,i)}return e=(0,i.Z)(n).getInstance(),{registerUrlRegex:function(e,n){t.push({regex:e,utils:n})},parseBaseUrl:function(e){return r("parseBaseUrl",e)},parseOrigin:function(e){return r("parseOrigin",e)},parseScheme:function(e){return r("parseScheme",e)},isRelative:function(e){return r("isRelative",e)},isPathAbsolute:function(e){return r("isPathAbsolute",e)},isSchemeRelative:function(e){return r("isSchemeRelative",e)},isHTTPURL:function(e){return r("isHTTPURL",e)},isHTTPS:function(e){return r("isHTTPS",e)},removeHostname:function(e){return r("removeHostname",e)},resolve:function(e,t){return r("resolve",e,t)}}}a.__dashjs_factory_name="URLUtils";var s=r.Z.getSingletonFactory(a);t.Z=s},5459:function(e,t){"use strict";t.Z=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.code=t||null,this.message=n||null,this.data=r||null}},3186:function(e,t,n){"use strict";var r=n(7855);var i=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.action=e.ACTION_DOWNLOAD,this.startTime=NaN,this.mediaStartTime=NaN,this.mediaType=null,this.mediaInfo=null,this.type=null,this.duration=NaN,this.timescale=NaN,this.range=null,this.url=t||null,this.serviceLocation=null,this.requestStartDate=null,this.firstByteDate=null,this.requestEndDate=null,this.quality=NaN,this.index=NaN,this.availabilityStartTime=null,this.availabilityEndTime=null,this.wallStartTime=null,this.bytesLoaded=NaN,this.bytesTotal=NaN,this.delayLoadingTime=NaN,this.responseType="arraybuffer",this.representationId=null}var t;return(t=[{key:"isInitializationRequest",value:function(){return this.type&&this.type===r.w.INIT_SEGMENT_TYPE}},{key:"setInfo",value:function(e){this.type=e&&e.init?r.w.INIT_SEGMENT_TYPE:r.w.MEDIA_SEGMENT_TYPE,this.url=e&&e.url?e.url:null,this.range=e&&e.range?e.range.start+"-"+e.range.end:null,this.mediaType=e&&e.mediaType?e.mediaType:null}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();i.ACTION_DOWNLOAD="download",i.ACTION_COMPLETE="complete",t.Z=i},2839:function(e,t){"use strict";var n=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.offset=t._offset,this.type=t.type,this.size=t.size,this.boxes=[],t.boxes)for(var n=0;n<t.boxes.length;n++)this.boxes.push(new e(t.boxes[n]));switch(this.isComplete=!0,t.type){case"sidx":if(this.timescale=t.timescale,this.earliest_presentation_time=t.earliest_presentation_time,this.first_offset=t.first_offset,this.references=t.references,t.references){this.references=[];for(var r=0;r<t.references.length;r++){var i={reference_type:t.references[r].reference_type,referenced_size:t.references[r].referenced_size,subsegment_duration:t.references[r].subsegment_duration};this.references.push(i)}}break;case"emsg":this.id=t.id,this.version=1===t.version?1:0,this.value=t.value,this.timescale=t.timescale,this.scheme_id_uri=t.scheme_id_uri,this.presentation_time_delta=1===t.version?t.presentation_time:t.presentation_time_delta,this.event_duration=t.event_duration,this.message_data=t.message_data;break;case"mdhd":this.timescale=t.timescale;break;case"mfhd":this.sequence_number=t.sequence_number;break;case"subs":this.entry_count=t.entry_count,this.entries=t.entries;break;case"tfhd":this.base_data_offset=t.base_data_offset,this.sample_description_index=t.sample_description_index,this.default_sample_duration=t.default_sample_duration,this.default_sample_size=t.default_sample_size,this.default_sample_flags=t.default_sample_flags,this.flags=t.flags;break;case"tfdt":this.version=t.version,this.baseMediaDecodeTime=t.baseMediaDecodeTime,this.flags=t.flags;break;case"trun":if(this.sample_count=t.sample_count,this.first_sample_flags=t.first_sample_flags,this.data_offset=t.data_offset,this.flags=t.flags,this.samples=t.samples,t.samples){this.samples=[];for(var a=0,s=t.samples.length;a<s;a++){var o={sample_size:t.samples[a].sample_size,sample_duration:t.samples[a].sample_duration,sample_composition_time_offset:t.samples[a].sample_composition_time_offset};this.samples.push(o)}}break;case"prft":this.version=t.version,this.reference_track_ID=t.reference_track_ID,this.ntp_timestamp_sec=t.ntp_timestamp_sec,this.ntp_timestamp_frac=t.ntp_timestamp_frac,this.media_time=t.media_time,this.flags=t.flags}}var t;return(t=[{key:"getChildBox",value:function(e){for(var t=0;t<this.boxes.length;t++)if(this.boxes[t].type===e)return this.boxes[t]}},{key:"getChildBoxes",value:function(e){for(var t=[],n=0;n<this.boxes.length;n++)this.boxes[n].type===e&&t.push(this.boxes[n]);return t}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();t.Z=n},9597:function(e,t){"use strict";t.Z=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.lastCompletedOffset=t,this.found=n,this.size=r}},2128:function(e,t){"use strict";t.Z=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.bitrate=0,this.width=0,this.height=0,this.tilesHor=0,this.tilesVert=0,this.widthPerTile=0,this.heightPerTile=0,this.startNumber=0,this.segmentDuration=0,this.timescale=0,this.templateUrl="",this.id=""}},7855:function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,{O:function(){return a},w:function(){return i}});var i=function e(){r(this,e),this.tcpid=null,this.type=null,this.url=null,this.actualurl=null,this.range=null,this.trequest=null,this.tresponse=null,this.responsecode=null,this.interval=null,this.trace=[],this.cmsd=null,this._stream=null,this._tfinish=null,this._mediaduration=null,this._quality=null,this._responseHeaders=null,this._serviceLocation=null,this._fileLoaderType=null},a=function e(){r(this,e),this.s=null,this.d=null,this.b=[]};i.GET="GET",i.HEAD="HEAD",i.MPD_TYPE="MPD",i.XLINK_EXPANSION_TYPE="XLinkExpansion",i.INIT_SEGMENT_TYPE="InitializationSegment",i.INDEX_SEGMENT_TYPE="IndexSegment",i.MEDIA_SEGMENT_TYPE="MediaSegment",i.BITSTREAM_SWITCHING_SEGMENT_TYPE="BitstreamSwitchingSegment",i.MSS_FRAGMENT_INFO_SEGMENT_TYPE="FragmentInfoSegment",i.DVB_REPORTING_TYPE="DVBReporting",i.LICENSE="license",i.CONTENT_STEERING_TYPE="ContentSteering",i.OTHER_TYPE="other"},3039:function(e,t){"use strict";function n(e,t){return function(n,i){for(var a,s,o,l=r(n,"tag"),u=r(null==i?"*":i,"range"),c=[],d=-1;++d<u.length;)if(a=u[d].toLowerCase(),t||"*"!==a){for(s=-1,o=[];++s<l.length;)if(e(l[s].toLowerCase(),a)){if(!t)return l[s];c.push(l[s])}else o.push(l[s]);l=o}return t?c:void 0}}function r(e,t){var n=e&&"string"==typeof e?[e]:e;if(!n||"object"!=typeof n||!("length"in n))throw new Error("Invalid "+t+" `"+n+"`, expected non-empty string");return n}t.basicFilter=n((function(e,t){return"*"===t||e===t||e.indexOf(t+"-")>-1}),!0),t.extendedFilter=n((function(e,t){var n=e.split("-"),r=t.split("-"),i=0,a=0;if("*"!==r[a]&&n[i]!==r[a])return!1;for(i++,a++;a<r.length;)if("*"!==r[a]){if(!n[i])return!1;if(n[i]!==r[a]){if(1===n[i].length)return!1;i++}else i++,a++}else a++;return!0}),!0),t.lookup=n((function(e,t){for(var n,r=t;;){if("*"===r||e===r)return!0;if((n=r.lastIndexOf("-"))<0)return!1;"-"===r.charAt(n-2)&&(n-=2),r=r.slice(0,n)}}))},3973:function(e,t,n){"use strict";e.exports=n(3854)},3854:function(e,t,n){"use strict";var r=n(2415),i=n(3039),a=n(7778),s=n(5813),o=n(3165),l=n(9460);e.exports=function(e,t){var n,c=t||{},m=r.parse(String(e||"").toLowerCase(),c),y=r.stringify(m),v=-1;if(!y)return y;for(;++v<a.length;)i.extendedFilter(y,a[v].from).length&&(f(m,a[v].from,a[v].to),y=r.stringify(m));for(v=-1;++v<s.length;)h(m,s[v].from.field,s[v].from.value)&&p(m,s[v].to.field,s[v].to.value);for(y=r.stringify(Object.assign({},m,d)),v=-1;++v<o.length;)y===o[v]&&(f(m,o[v],o[v].split("-").slice(0,-1).join("-")),y=r.stringify(Object.assign({},m,d)));if(m.extensions.sort(g),c.warning)for(n in l)u.call(l[n],m[n])&&c.warning("Deprecated "+n+" `"+m[n]+"`, expected one of `"+l[n][m[n]].join("`, `")+"`",null,7);return m.script&&(m.script=m.script.charAt(0).toUpperCase()+m.script.slice(1)),m.region&&(m.region=m.region.toUpperCase()),r.stringify(m)};var u={}.hasOwnProperty,c=new Intl.Collator,d={variants:[],extensions:[],privateuse:[],irregular:null,regular:null};function f(e,t,n){var i,a=r.parse(t),s=r.parse(n),o=[];for(i in a)a[i]&&a[i].length&&h(e,i,a[i])&&o.push(i);for(i in s)s[i]&&s[i].length&&(o.indexOf(i)>-1||!e[i]||!e[i].length)&&p(e,i,s[i])}function h(e,t,n){var r,i,a,s,o=!1;if(n){if(i=r=e[t],r&&"object"==typeof r)for(i=[],a=-1;++a<r.length;)s=r[a],n.indexOf(s)<0?i.push(s):o=!0;else r===n&&(i=null,o=!0);e[t]=i}return o}function p(e,t,n){var r,i,a,s=e[t];if(s&&"object"==typeof s)for(r=[].concat(n),i=-1;++i<r.length;)a=r[i],s.indexOf(a)<0&&s.push(a);else e[t]=n}function g(e,t){return c.compare(e.singleton,t.singleton)}},2415:function(e,t,n){"use strict";t.parse=n(6903),t.stringify=n(6713)},6903:function(e,t,n){"use strict";var r=n(2219),i=n(3516),a=n(395),s=n(858),o=n(8589);e.exports=function e(t,n){var u,c,d,f=n||{},h={language:null,extendedLanguageSubtags:[],script:null,region:null,variants:[],extensions:[],privateuse:[],irregular:null,regular:null},p=String(t),g=p.toLowerCase(),m=0;if(null==t)throw new Error("Expected string, got `"+t+"`");if(l.call(o,g))return(null==f.normalize||f.normalize)&&o[g]?e(o[g]):(h[-1===s.indexOf(g)?"irregular":"regular"]=p,h);for(;i(g.charCodeAt(m))&&m<9;)m++;if(m>1&&m<9){if(h.language=p.slice(0,m),m<4)for(c=0;45===g.charCodeAt(m)&&i(g.charCodeAt(m+1))&&i(g.charCodeAt(m+2))&&i(g.charCodeAt(m+3))&&!i(g.charCodeAt(m+4));){if(c>2)return y(m,3,"Too many extended language subtags, expected at most 3 subtags");h.extendedLanguageSubtags.push(p.slice(m+1,m+4)),m+=4,c++}for(45===g.charCodeAt(m)&&i(g.charCodeAt(m+1))&&i(g.charCodeAt(m+2))&&i(g.charCodeAt(m+3))&&i(g.charCodeAt(m+4))&&!i(g.charCodeAt(m+5))&&(h.script=p.slice(m+1,m+5),m+=5),45===g.charCodeAt(m)&&(i(g.charCodeAt(m+1))&&i(g.charCodeAt(m+2))&&!i(g.charCodeAt(m+3))?(h.region=p.slice(m+1,m+3),m+=3):a(g.charCodeAt(m+1))&&a(g.charCodeAt(m+2))&&a(g.charCodeAt(m+3))&&!a(g.charCodeAt(m+4))&&(h.region=p.slice(m+1,m+4),m+=4));45===g.charCodeAt(m);){for(d=u=m+1;r(g.charCodeAt(d));){if(d-u>7)return y(d,1,"Too long variant, expected at most 8 characters");d++}if(!(d-u>4||d-u>3&&a(g.charCodeAt(u))))break;h.variants.push(p.slice(u,d)),m=d}for(;45===g.charCodeAt(m)&&120!==g.charCodeAt(m+1)&&r(g.charCodeAt(m+1))&&45===g.charCodeAt(m+2)&&r(g.charCodeAt(m+3));){for(d=m+2,c=0;45===g.charCodeAt(d)&&r(g.charCodeAt(d+1))&&r(g.charCodeAt(d+2));)for(d=(u=d+1)+2,c++;r(g.charCodeAt(d));){if(d-u>7)return y(d,2,"Too long extension, expected at most 8 characters");d++}if(!c)return y(d,4,"Empty extension, extensions must have at least 2 characters of content");h.extensions.push({singleton:p.charAt(m+1),extensions:p.slice(m+3,d).split("-")}),m=d}}else m=0;if(0===m&&120===g.charCodeAt(m)||45===g.charCodeAt(m)&&120===g.charCodeAt(m+1))for(d=m=m?m+2:1;45===g.charCodeAt(d)&&r(g.charCodeAt(d+1));){for(d=u=m+1;r(g.charCodeAt(d));){if(d-u>7)return y(d,5,"Too long private-use area, expected at most 8 characters");d++}h.privateuse.push(p.slice(m+1,d)),m=d}return m!==p.length?y(m,6,"Found superfluous content after tag"):h;function y(e,t,n){return f.warning&&f.warning(n,t,e),f.forgiving?h:{language:null,extendedLanguageSubtags:[],script:null,region:null,variants:[],extensions:[],privateuse:[],irregular:null,regular:null}}};var l={}.hasOwnProperty},6713:function(e){"use strict";e.exports=function(e){var t,n,r,i=e||{},a=[];if(i.irregular||i.regular)return i.irregular||i.regular;if(i.language)for(a=a.concat(i.language,i.extendedLanguageSubtags||[],i.script||[],i.region||[],i.variants||[]),t=i.extensions||[],n=-1;++n<t.length;)(r=t[n]).singleton&&r.extensions&&r.extensions.length&&(a=a.concat(r.singleton,r.extensions));return i.privateuse&&i.privateuse.length&&(a=a.concat("x",i.privateuse)),a.join("-")}},1549:function(e,t,n){"use strict";var r=n(6693),i=n(2165),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=l,t.SlowBuffer=function(e){return+e!=e&&(e=0),l.alloc(+e)},t.INSPECT_MAX_BYTES=50;var s=2147483647;function o(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return u(e,t,n)}function u(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|g(e,t),r=o(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(q(e,Uint8Array)){var t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(q(e,ArrayBuffer)||e&&q(e.buffer,ArrayBuffer))return h(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(q(e,SharedArrayBuffer)||e&&q(e.buffer,SharedArrayBuffer)))return h(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return l.from(r,t,n);var i=function(e){if(l.isBuffer(e)){var t=0|p(e.length),n=o(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||H(e.length)?o(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return c(e),o(e<0?0:0|p(e))}function f(e){for(var t=e.length<0?0:0|p(e.length),n=o(t),r=0;r<t;r+=1)n[r]=255&e[r];return n}function h(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');var r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,l.prototype),r}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function g(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||q(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return B(e).length;default:if(i)return r?-1:U(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return N(this,t,n);case"utf8":case"utf-8":return I(this,t,n);case"ascii":return R(this,t,n);case"latin1":case"binary":return D(this,t,n);case"base64":return w(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function y(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function v(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),H(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:_(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):_(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function _(e,t,n,r,i){var a,s=1,o=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,o/=2,l/=2,n/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var c=-1;for(a=n;a<o;a++)if(u(e,a)===u(t,-1===c?0:a-c)){if(-1===c&&(c=a),a-c+1===l)return c*s}else-1!==c&&(a-=a-c),c=-1}else for(n+l>o&&(n=o-l),a=n;a>=0;a--){for(var d=!0,f=0;f<l;f++)if(u(e,a+f)!==u(t,f)){d=!1;break}if(d)return a}return-1}function T(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var a=t.length;r>a/2&&(r=a/2);for(var s=0;s<r;++s){var o=parseInt(t.substr(2*s,2),16);if(H(o))return s;e[n+s]=o}return s}function E(e,t,n,r){return j(U(t,e.length-n),e,n,r)}function b(e,t,n,r){return j(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function S(e,t,n,r){return j(B(t),e,n,r)}function A(e,t,n,r){return j(function(e,t){for(var n,r,i,a=[],s=0;s<e.length&&!((t-=2)<0);++s)r=(n=e.charCodeAt(s))>>8,i=n%256,a.push(i),a.push(r);return a}(t,e.length-n),e,n,r)}function w(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function I(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var a,s,o,l,u=e[i],c=null,d=u>239?4:u>223?3:u>191?2:1;if(i+d<=n)switch(d){case 1:u<128&&(c=u);break;case 2:128==(192&(a=e[i+1]))&&(l=(31&u)<<6|63&a)>127&&(c=l);break;case 3:a=e[i+1],s=e[i+2],128==(192&a)&&128==(192&s)&&(l=(15&u)<<12|(63&a)<<6|63&s)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:a=e[i+1],s=e[i+2],o=e[i+3],128==(192&a)&&128==(192&s)&&128==(192&o)&&(l=(15&u)<<18|(63&a)<<12|(63&s)<<6|63&o)>65535&&l<1114112&&(c=l)}null===c?(c=65533,d=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=d}return function(e){var t=e.length;if(t<=C)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=C));return n}(r)}t.kMaxLength=s,l.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,n){return u(e,t,n)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,n){return function(e,t,n){return c(e),e<=0?o(e):void 0!==t?"string"==typeof n?o(e).fill(t,n):o(e).fill(t):o(e)}(e,t,n)},l.allocUnsafe=function(e){return d(e)},l.allocUnsafeSlow=function(e){return d(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(q(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),q(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=l.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var a=e[n];if(q(a,Uint8Array))i+a.length>r.length?l.from(a).copy(r,i):Uint8Array.prototype.set.call(r,a,i);else{if(!l.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i)}i+=a.length}return r},l.byteLength=g,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)y(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},l.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?I(this,0,e):m.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},a&&(l.prototype[a]=l.prototype.inspect),l.prototype.compare=function(e,t,n,r,i){if(q(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),o=Math.min(a,s),u=this.slice(r,i),c=e.slice(t,n),d=0;d<o;++d)if(u[d]!==c[d]){a=u[d],s=c[d];break}return a<s?-1:s<a?1:0},l.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},l.prototype.indexOf=function(e,t,n){return v(this,e,t,n,!0)},l.prototype.lastIndexOf=function(e,t,n){return v(this,e,t,n,!1)},l.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return T(this,e,t,n);case"utf8":case"utf-8":return E(this,e,t,n);case"ascii":case"latin1":case"binary":return b(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function R(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function D(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function N(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",a=t;a<n;++a)i+=G[e[a]];return i}function O(e,t,n){for(var r=e.slice(t,n),i="",a=0;a<r.length-1;a+=2)i+=String.fromCharCode(r[a]+256*r[a+1]);return i}function P(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,n,r,i,a){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function x(e,t,n,r,i,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(e,t,n,r,a){return t=+t,n>>>=0,a||x(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function k(e,t,n,r,a){return t=+t,n>>>=0,a||x(e,0,n,8),i.write(e,t,n,r,52,8),n+8}l.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);var r=this.subarray(e,t);return Object.setPrototypeOf(r,l.prototype),r},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},l.prototype.readInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||P(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){e>>>=0,t||P(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return e>>>=0,t||P(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||P(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||P(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||P(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||M(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,a=0;for(this[t]=255&e;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||M(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var a=0,s=1,o=0;for(this[t]=255&e;++a<n&&(s*=256);)e<0&&0===o&&0!==this[t+a-1]&&(o=1),this[t+a]=(e/s>>0)-o&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var a=n-1,s=1,o=0;for(this[t+a]=255&e;--a>=0&&(s*=256);)e<0&&0===o&&0!==this[t+a+1]&&(o=1),this[t+a]=(e/s>>0)-o&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeFloatLE=function(e,t,n){return L(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return L(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return k(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return k(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i=r-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},l.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!l.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){var i=e.charCodeAt(0);("utf8"===r&&i<128||"latin1"===r)&&(e=i)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var a;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a<n;++a)this[a]=e;else{var s=l.isBuffer(e)?e:l.from(e,r),o=s.length;if(0===o)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(a=0;a<n-t;++a)this[a+t]=s[a%o]}return this};var F=/[^+/0-9A-Za-z-_]/g;function U(e,t){var n;t=t||1/0;for(var r=e.length,i=null,a=[],s=0;s<r;++s){if((n=e.charCodeAt(s))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function B(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(F,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function j(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function H(e){return e!=e}var G=function(){for(var e="0123456789abcdef",t=new Array(256),n=0;n<16;++n)for(var r=16*n,i=0;i<16;++i)t[r+i]=e[n]+e[i];return t}()},6693:function(e,t){"use strict";t.byteLength=function(e){var t=o(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,a=o(e),s=a[0],l=a[1],u=new i(function(e,t,n){return 3*(t+n)/4-n}(0,s,l)),c=0,d=l>0?s-4:s;for(n=0;n<d;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===l&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,u[c++]=255&t),1===l&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,a=[],s=16383,o=0,u=r-i;o<u;o+=s)a.push(l(e,o,o+s>u?u:o+s));return 1===i?(t=e[r-1],a.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],a.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),a.join("")};for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)n[s]=a[s],r[a.charCodeAt(s)]=s;function o(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,r){for(var i,a,s=[],o=t;o<r;o+=3)i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),s.push(n[(a=i)>>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return s.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},2165:function(e,t){t.read=function(e,t,n,r,i){var a,s,o=8*i-r-1,l=(1<<o)-1,u=l>>1,c=-7,d=n?i-1:0,f=n?-1:1,h=e[t+d];for(d+=f,a=h&(1<<-c)-1,h>>=-c,c+=o;c>0;a=256*a+e[t+d],d+=f,c-=8);for(s=a&(1<<-c)-1,a>>=-c,c+=r;c>0;s=256*s+e[t+d],d+=f,c-=8);if(0===a)a=1-u;else{if(a===l)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,r),a-=u}return(h?-1:1)*s*Math.pow(2,a-r)},t.write=function(e,t,n,r,i,a){var s,o,l,u=8*a-i-1,c=(1<<u)-1,d=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:a-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+d>=1?f/l:f*Math.pow(2,1-d))*l>=2&&(s++,l/=2),s+d>=c?(o=0,s=c):s+d>=1?(o=(t*l-1)*Math.pow(2,i),s+=d):(o=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[n+h]=255&o,h+=p,o/=256,i-=8);for(s=s<<i|o,u+=i;u>0;e[n+h]=255&s,h+=p,s/=256,u-=8);e[n+h-p]|=128*g}},6934:function(e,t){var n={parseBuffer:function(e){return new r(e).parse()},addBoxProcessor:function(e,t){"string"==typeof e&&"function"==typeof t&&(i.prototype._boxProcessors[e]=t)},createFile:function(){return new r},createBox:function(e,t,n){var r=i.create(e);return t&&t.append(r,n),r},createFullBox:function(e,t,r){var i=n.createBox(e,t,r);return i.version=0,i.flags=0,i},Utils:{}};n.Utils.dataViewToString=function(e,t){var n=t||"utf-8";if("undefined"!=typeof TextDecoder)return new TextDecoder(n).decode(e);var r=[],i=0;if("utf-8"===n)for(;i<e.byteLength;){var a=e.getUint8(i++);a<128||(a<224?(a=(31&a)<<6,a|=63&e.getUint8(i++)):a<240?(a=(15&a)<<12,a|=(63&e.getUint8(i++))<<6,a|=63&e.getUint8(i++)):(a=(7&a)<<18,a|=(63&e.getUint8(i++))<<12,a|=(63&e.getUint8(i++))<<6,a|=63&e.getUint8(i++))),r.push(String.fromCharCode(a))}else for(;i<e.byteLength;)r.push(String.fromCharCode(e.getUint8(i++)));return r.join("")},n.Utils.utf8ToByteArray=function(e){var t,n;if("undefined"!=typeof TextEncoder)t=(new TextEncoder).encode(e);else for(t=[],n=0;n<e.length;++n){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?(t.push(192|r>>6),t.push(128|63&r)):r<65536?(t.push(224|r>>12),t.push(128|63&r>>6),t.push(128|63&r)):(t.push(240|r>>18),t.push(128|63&r>>12),t.push(128|63&r>>6),t.push(128|63&r))}return t},n.Utils.appendBox=function(e,t,n){if(t._offset=e._cursor.offset,t._root=e._root?e._root:e,t._raw=e._raw,t._parent=e,-1!==n)if(null!=n){var r,i=-1;if("number"==typeof n)i=n;else{if("string"==typeof n)r=n;else{if("object"!=typeof n||!n.type)return void e.boxes.push(t);r=n.type}for(var a=0;a<e.boxes.length;a++)if(r===e.boxes[a].type){i=a+1;break}}e.boxes.splice(i,0,t)}else e.boxes.push(t)},t.parseBuffer=n.parseBuffer,t.addBoxProcessor=n.addBoxProcessor,t.createFile=n.createFile,t.createBox=n.createBox,t.createFullBox=n.createFullBox,t.Utils=n.Utils,n.Cursor=function(e){this.offset=void 0===e?0:e};var r=function(e){this._cursor=new n.Cursor,this.boxes=[],e&&(this._raw=new DataView(e))};r.prototype.fetch=function(e){var t=this.fetchAll(e,!0);return t.length?t[0]:null},r.prototype.fetchAll=function(e,t){var n=[];return r._sweep.call(this,e,n,t),n},r.prototype.parse=function(){for(this._cursor.offset=0,this.boxes=[];this._cursor.offset<this._raw.byteLength;){var e=i.parse(this);if(void 0===e.type)break;this.boxes.push(e)}return this},r._sweep=function(e,t,n){for(var i in this.type&&this.type==e&&t.push(this),this.boxes){if(t.length&&n)return;r._sweep.call(this.boxes[i],e,t,n)}},r.prototype.write=function(){var e,t=0;for(e=0;e<this.boxes.length;e++)t+=this.boxes[e].getLength(!1);var n=new Uint8Array(t);for(this._rawo=new DataView(n.buffer),this.bytes=n,this._cursor.offset=0,e=0;e<this.boxes.length;e++)this.boxes[e].write();return n.buffer},r.prototype.append=function(e,t){n.Utils.appendBox(this,e,t)};var i=function(){this._cursor=new n.Cursor};i.parse=function(e){var t=new i;return t._offset=e._cursor.offset,t._root=e._root?e._root:e,t._raw=e._raw,t._parent=e,t._parseBox(),e._cursor.offset=t._raw.byteOffset+t._raw.byteLength,t},i.create=function(e){var t=new i;return t.type=e,t.boxes=[],t},i.prototype._boxContainers=["dinf","edts","mdia","meco","mfra","minf","moof","moov","mvex","stbl","strk","traf","trak","tref","udta","vttc","sinf","schi","encv","enca"],i.prototype._boxProcessors={},i.prototype._procField=function(e,t,n){this._parsing?this[e]=this._readField(t,n):this._writeField(t,n,this[e])},i.prototype._procFieldArray=function(e,t,n,r){var i;if(this._parsing)for(this[e]=[],i=0;i<t;i++)this[e][i]=this._readField(n,r);else for(i=0;i<this[e].length;i++)this._writeField(n,r,this[e][i])},i.prototype._procFullBox=function(){this._procField("version","uint",8),this._procField("flags","uint",24)},i.prototype._procEntries=function(e,t,n){var r;if(this._parsing)for(this[e]=[],r=0;r<t;r++)this[e].push({}),n.call(this,this[e][r]);else for(r=0;r<t;r++)n.call(this,this[e][r])},i.prototype._procSubEntries=function(e,t,n,r){var i;if(this._parsing)for(e[t]=[],i=0;i<n;i++)e[t].push({}),r.call(this,e[t][i]);else for(i=0;i<n;i++)r.call(this,e[t][i])},i.prototype._procEntryField=function(e,t,n,r){this._parsing?e[t]=this._readField(n,r):this._writeField(n,r,e[t])},i.prototype._procSubBoxes=function(e,t){var n;if(this._parsing)for(this[e]=[],n=0;n<t;n++)this[e].push(i.parse(this));else for(n=0;n<t;n++)this._rawo?this[e][n].write():this.size+=this[e][n].getLength()},i.prototype._readField=function(e,t){switch(e){case"uint":return this._readUint(t);case"int":return this._readInt(t);case"template":return this._readTemplate(t);case"string":return-1===t?this._readTerminatedString():this._readString(t);case"data":return this._readData(t);case"utf8":return this._readUTF8String();default:return-1}},i.prototype._readInt=function(e){var t=null,n=this._cursor.offset-this._raw.byteOffset;switch(e){case 8:t=this._raw.getInt8(n);break;case 16:t=this._raw.getInt16(n);break;case 32:t=this._raw.getInt32(n);break;case 64:var r=this._raw.getInt32(n),i=this._raw.getInt32(n+4);t=r*Math.pow(2,32)+i}return this._cursor.offset+=e>>3,t},i.prototype._readUint=function(e){var t,n,r=null,i=this._cursor.offset-this._raw.byteOffset;switch(e){case 8:r=this._raw.getUint8(i);break;case 16:r=this._raw.getUint16(i);break;case 24:r=((t=this._raw.getUint16(i))<<8)+(n=this._raw.getUint8(i+2));break;case 32:r=this._raw.getUint32(i);break;case 64:t=this._raw.getUint32(i),n=this._raw.getUint32(i+4),r=t*Math.pow(2,32)+n}return this._cursor.offset+=e>>3,r},i.prototype._readString=function(e){for(var t="",n=0;n<e;n++){var r=this._readUint(8);t+=String.fromCharCode(r)}return t},i.prototype._readTemplate=function(e){return this._readUint(e/2)+this._readUint(e/2)/Math.pow(2,e/2)},i.prototype._readTerminatedString=function(){for(var e="";this._cursor.offset-this._offset<this._raw.byteLength;){var t=this._readUint(8);if(0===t)break;e+=String.fromCharCode(t)}return e},i.prototype._readData=function(e){var t=e>0?e:this._raw.byteLength-(this._cursor.offset-this._offset);if(t>0){var n=new Uint8Array(this._raw.buffer,this._cursor.offset,t);return this._cursor.offset+=t,n}return null},i.prototype._readUTF8String=function(){var e=this._raw.byteLength-(this._cursor.offset-this._offset),t=null;return e>0&&(t=new DataView(this._raw.buffer,this._cursor.offset,e),this._cursor.offset+=e),t?n.Utils.dataViewToString(t):t},i.prototype._parseBox=function(){if(this._parsing=!0,this._cursor.offset=this._offset,this._offset+8>this._raw.buffer.byteLength)this._root._incomplete=!0;else{switch(this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this.size){case 0:this._raw=new DataView(this._raw.buffer,this._offset);break;case 1:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.largesize);break;default:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.size)}this._incomplete||(this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type)?this._parseContainerBox():this._data=this._readData())}},i.prototype._parseFullBox=function(){this.version=this._readUint(8),this.flags=this._readUint(24)},i.prototype._parseContainerBox=function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.boxes.push(i.parse(this))},i.prototype.append=function(e,t){n.Utils.appendBox(this,e,t)},i.prototype.getLength=function(){if(this._parsing=!1,this._rawo=null,this.size=0,this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type))for(var e=0;e<this.boxes.length;e++)this.size+=this.boxes[e].getLength();return this._data&&this._writeData(this._data),this.size},i.prototype.write=function(){switch(this._parsing=!1,this._cursor.offset=this._parent._cursor.offset,this.size){case 0:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.parent._rawo.byteLength-this._cursor.offset);break;case 1:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.largesize);break;default:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.size)}if(this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type))for(var e=0;e<this.boxes.length;e++)this.boxes[e].write();return this._data&&this._writeData(this._data),this._parent._cursor.offset+=this.size,this.size},i.prototype._writeInt=function(e,t){if(this._rawo){var n=this._cursor.offset-this._rawo.byteOffset;switch(e){case 8:this._rawo.setInt8(n,t);break;case 16:this._rawo.setInt16(n,t);break;case 32:this._rawo.setInt32(n,t);break;case 64:var r=Math.floor(t/Math.pow(2,32)),i=t-r*Math.pow(2,32);this._rawo.setUint32(n,r),this._rawo.setUint32(n+4,i)}this._cursor.offset+=e>>3}else this.size+=e>>3},i.prototype._writeUint=function(e,t){if(this._rawo){var n,r,i=this._cursor.offset-this._rawo.byteOffset;switch(e){case 8:this._rawo.setUint8(i,t);break;case 16:this._rawo.setUint16(i,t);break;case 24:n=(16776960&t)>>8,r=255&t,this._rawo.setUint16(i,n),this._rawo.setUint8(i+2,r);break;case 32:this._rawo.setUint32(i,t);break;case 64:r=t-(n=Math.floor(t/Math.pow(2,32)))*Math.pow(2,32),this._rawo.setUint32(i,n),this._rawo.setUint32(i+4,r)}this._cursor.offset+=e>>3}else this.size+=e>>3},i.prototype._writeString=function(e,t){for(var n=0;n<e;n++)this._writeUint(8,t.charCodeAt(n))},i.prototype._writeTerminatedString=function(e){if(0!==e.length){for(var t=0;t<e.length;t++)this._writeUint(8,e.charCodeAt(t));this._writeUint(8,0)}},i.prototype._writeTemplate=function(e,t){var n=Math.floor(t),r=(t-n)*Math.pow(2,e/2);this._writeUint(e/2,n),this._writeUint(e/2,r)},i.prototype._writeData=function(e){if(e)if(this._rawo){if(e instanceof Array){for(var t=this._cursor.offset-this._rawo.byteOffset,n=0;n<e.length;n++)this._rawo.setInt8(t+n,e[n]);this._cursor.offset+=e.length}e instanceof Uint8Array&&(this._root.bytes.set(e,this._cursor.offset),this._cursor.offset+=e.length)}else this.size+=e.length},i.prototype._writeUTF8String=function(e){var t=n.Utils.utf8ToByteArray(e);if(this._rawo)for(var r=new DataView(this._rawo.buffer,this._cursor.offset,t.length),i=0;i<t.length;i++)r.setUint8(i,t[i]);else this.size+=t.length},i.prototype._writeField=function(e,t,n){switch(e){case"uint":this._writeUint(t,n);break;case"int":this._writeInt(t,n);break;case"template":this._writeTemplate(t,n);break;case"string":-1==t?this._writeTerminatedString(n):this._writeString(t,n);break;case"data":this._writeData(n);break;case"utf8":this._writeUTF8String(n)}},i.prototype._boxProcessors.avc1=i.prototype._boxProcessors.avc2=i.prototype._boxProcessors.avc3=i.prototype._boxProcessors.avc4=i.prototype._boxProcessors.hvc1=i.prototype._boxProcessors.hev1=i.prototype._boxProcessors.encv=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procField("pre_defined1","uint",16),this._procField("reserved2","uint",16),this._procFieldArray("pre_defined2",3,"uint",32),this._procField("width","uint",16),this._procField("height","uint",16),this._procField("horizresolution","template",32),this._procField("vertresolution","template",32),this._procField("reserved3","uint",32),this._procField("frame_count","uint",16),this._procFieldArray("compressorname",32,"uint",8),this._procField("depth","uint",16),this._procField("pre_defined3","int",16),this._procField("config","data",-1)},i.prototype._boxProcessors.ctts=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(e){this._procEntryField(e,"sample_count","uint",32),this._procEntryField(e,"sample_offset",1===this.version?"int":"uint",32)}))},i.prototype._boxProcessors.dref=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},i.prototype._boxProcessors.elst=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(e){this._procEntryField(e,"segment_duration","uint",1===this.version?64:32),this._procEntryField(e,"media_time","int",1===this.version?64:32),this._procEntryField(e,"media_rate_integer","int",16),this._procEntryField(e,"media_rate_fraction","int",16)}))},i.prototype._boxProcessors.emsg=function(){this._procFullBox(),1==this.version?(this._procField("timescale","uint",32),this._procField("presentation_time","uint",64),this._procField("event_duration","uint",32),this._procField("id","uint",32),this._procField("scheme_id_uri","string",-1),this._procField("value","string",-1)):(this._procField("scheme_id_uri","string",-1),this._procField("value","string",-1),this._procField("timescale","uint",32),this._procField("presentation_time_delta","uint",32),this._procField("event_duration","uint",32),this._procField("id","uint",32)),this._procField("message_data","data",-1)},i.prototype._boxProcessors.free=i.prototype._boxProcessors.skip=function(){this._procField("data","data",-1)},i.prototype._boxProcessors.frma=function(){this._procField("data_format","uint",32)},i.prototype._boxProcessors.ftyp=i.prototype._boxProcessors.styp=function(){this._procField("major_brand","string",4),this._procField("minor_version","uint",32);var e=-1;this._parsing&&(e=(this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset))/4),this._procFieldArray("compatible_brands",e,"string",4)},i.prototype._boxProcessors.hdlr=function(){this._procFullBox(),this._procField("pre_defined","uint",32),this._procField("handler_type","string",4),this._procFieldArray("reserved",3,"uint",32),this._procField("name","string",-1)},i.prototype._boxProcessors.mdat=function(){this._procField("data","data",-1)},i.prototype._boxProcessors.mdhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",1==this.version?64:32),this._parsing||"string"!=typeof this.language||(this.language=this.language.charCodeAt(0)-96<<10|this.language.charCodeAt(1)-96<<5|this.language.charCodeAt(2)-96),this._procField("language","uint",16),this._parsing&&(this.language=String.fromCharCode(96+(this.language>>10&31),96+(this.language>>5&31),96+(31&this.language))),this._procField("pre_defined","uint",16)},i.prototype._boxProcessors.mehd=function(){this._procFullBox(),this._procField("fragment_duration","uint",1==this.version?64:32)},i.prototype._boxProcessors.mfhd=function(){this._procFullBox(),this._procField("sequence_number","uint",32)},i.prototype._boxProcessors.mfro=function(){this._procFullBox(),this._procField("mfra_size","uint",32)},i.prototype._boxProcessors.mp4a=i.prototype._boxProcessors.enca=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procField("channelcount","uint",16),this._procField("samplesize","uint",16),this._procField("pre_defined","uint",16),this._procField("reserved3","uint",16),this._procField("samplerate","template",32),this._procField("esds","data",-1)},i.prototype._boxProcessors.mvhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procField("rate","template",32),this._procField("volume","template",16),this._procField("reserved1","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procFieldArray("matrix",9,"template",32),this._procFieldArray("pre_defined",6,"uint",32),this._procField("next_track_ID","uint",32)},i.prototype._boxProcessors.payl=function(){this._procField("cue_text","utf8")},i.prototype._boxProcessors.prft=function(){this._procFullBox(),this._procField("reference_track_ID","uint",32),this._procField("ntp_timestamp_sec","uint",32),this._procField("ntp_timestamp_frac","uint",32),this._procField("media_time","uint",1==this.version?64:32)},i.prototype._boxProcessors.pssh=function(){this._procFullBox(),this._procFieldArray("SystemID",16,"uint",8),this._procField("DataSize","uint",32),this._procFieldArray("Data",this.DataSize,"uint",8)},i.prototype._boxProcessors.schm=function(){this._procFullBox(),this._procField("scheme_type","uint",32),this._procField("scheme_version","uint",32),1&this.flags&&this._procField("scheme_uri","string",-1)},i.prototype._boxProcessors.sdtp=function(){this._procFullBox();var e=-1;this._parsing&&(e=this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset)),this._procFieldArray("sample_dependency_table",e,"uint",8)},i.prototype._boxProcessors.sidx=function(){this._procFullBox(),this._procField("reference_ID","uint",32),this._procField("timescale","uint",32),this._procField("earliest_presentation_time","uint",1==this.version?64:32),this._procField("first_offset","uint",1==this.version?64:32),this._procField("reserved","uint",16),this._procField("reference_count","uint",16),this._procEntries("references",this.reference_count,(function(e){this._parsing||(e.reference=(1&e.reference_type)<<31,e.reference|=2147483647&e.referenced_size,e.sap=(1&e.starts_with_SAP)<<31,e.sap|=(3&e.SAP_type)<<28,e.sap|=268435455&e.SAP_delta_time),this._procEntryField(e,"reference","uint",32),this._procEntryField(e,"subsegment_duration","uint",32),this._procEntryField(e,"sap","uint",32),this._parsing&&(e.reference_type=e.reference>>31&1,e.referenced_size=2147483647&e.reference,e.starts_with_SAP=e.sap>>31&1,e.SAP_type=e.sap>>28&7,e.SAP_delta_time=268435455&e.sap)}))},i.prototype._boxProcessors.smhd=function(){this._procFullBox(),this._procField("balance","uint",16),this._procField("reserved","uint",16)},i.prototype._boxProcessors.ssix=function(){this._procFullBox(),this._procField("subsegment_count","uint",32),this._procEntries("subsegments",this.subsegment_count,(function(e){this._procEntryField(e,"ranges_count","uint",32),this._procSubEntries(e,"ranges",e.ranges_count,(function(e){this._procEntryField(e,"level","uint",8),this._procEntryField(e,"range_size","uint",24)}))}))},i.prototype._boxProcessors.stsd=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},i.prototype._boxProcessors.sttg=function(){this._procField("settings","utf8")},i.prototype._boxProcessors.stts=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(e){this._procEntryField(e,"sample_count","uint",32),this._procEntryField(e,"sample_delta","uint",32)}))},i.prototype._boxProcessors.subs=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(e){this._procEntryField(e,"sample_delta","uint",32),this._procEntryField(e,"subsample_count","uint",16),this._procSubEntries(e,"subsamples",e.subsample_count,(function(e){this._procEntryField(e,"subsample_size","uint",1===this.version?32:16),this._procEntryField(e,"subsample_priority","uint",8),this._procEntryField(e,"discardable","uint",8),this._procEntryField(e,"codec_specific_parameters","uint",32)}))}))},i.prototype._boxProcessors.tenc=function(){this._procFullBox(),this._procField("default_IsEncrypted","uint",24),this._procField("default_IV_size","uint",8),this._procFieldArray("default_KID",16,"uint",8)},i.prototype._boxProcessors.tfdt=function(){this._procFullBox(),this._procField("baseMediaDecodeTime","uint",1==this.version?64:32)},i.prototype._boxProcessors.tfhd=function(){this._procFullBox(),this._procField("track_ID","uint",32),1&this.flags&&this._procField("base_data_offset","uint",64),2&this.flags&&this._procField("sample_description_offset","uint",32),8&this.flags&&this._procField("default_sample_duration","uint",32),16&this.flags&&this._procField("default_sample_size","uint",32),32&this.flags&&this._procField("default_sample_flags","uint",32)},i.prototype._boxProcessors.tfra=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._parsing||(this.reserved=0,this.reserved|=(48&this.length_size_of_traf_num)<<4,this.reserved|=(12&this.length_size_of_trun_num)<<2,this.reserved|=3&this.length_size_of_sample_num),this._procField("reserved","uint",32),this._parsing&&(this.length_size_of_traf_num=(48&this.reserved)>>4,this.length_size_of_trun_num=(12&this.reserved)>>2,this.length_size_of_sample_num=3&this.reserved),this._procField("number_of_entry","uint",32),this._procEntries("entries",this.number_of_entry,(function(e){this._procEntryField(e,"time","uint",1===this.version?64:32),this._procEntryField(e,"moof_offset","uint",1===this.version?64:32),this._procEntryField(e,"traf_number","uint",8*(this.length_size_of_traf_num+1)),this._procEntryField(e,"trun_number","uint",8*(this.length_size_of_trun_num+1)),this._procEntryField(e,"sample_number","uint",8*(this.length_size_of_sample_num+1))}))},i.prototype._boxProcessors.tkhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("track_ID","uint",32),this._procField("reserved1","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procFieldArray("reserved2",2,"uint",32),this._procField("layer","uint",16),this._procField("alternate_group","uint",16),this._procField("volume","template",16),this._procField("reserved3","uint",16),this._procFieldArray("matrix",9,"template",32),this._procField("width","template",32),this._procField("height","template",32)},i.prototype._boxProcessors.trex=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._procField("default_sample_description_index","uint",32),this._procField("default_sample_duration","uint",32),this._procField("default_sample_size","uint",32),this._procField("default_sample_flags","uint",32)},i.prototype._boxProcessors.trun=function(){this._procFullBox(),this._procField("sample_count","uint",32),1&this.flags&&this._procField("data_offset","int",32),4&this.flags&&this._procField("first_sample_flags","uint",32),this._procEntries("samples",this.sample_count,(function(e){256&this.flags&&this._procEntryField(e,"sample_duration","uint",32),512&this.flags&&this._procEntryField(e,"sample_size","uint",32),1024&this.flags&&this._procEntryField(e,"sample_flags","uint",32),2048&this.flags&&this._procEntryField(e,"sample_composition_time_offset",1===this.version?"int":"uint",32)}))},i.prototype._boxProcessors["url "]=i.prototype._boxProcessors["urn "]=function(){this._procFullBox(),"urn "===this.type&&this._procField("name","string",-1),this._procField("location","string",-1)},i.prototype._boxProcessors.vlab=function(){this._procField("source_label","utf8")},i.prototype._boxProcessors.vmhd=function(){this._procFullBox(),this._procField("graphicsmode","uint",16),this._procFieldArray("opcolor",3,"uint",16)},i.prototype._boxProcessors.vttC=function(){this._procField("config","utf8")},i.prototype._boxProcessors.vtte=function(){}},5530:function(e,t,n){"use strict";e.exports=n(6146).polyfill()},6146:function(e,t,n){e.exports=function(){"use strict";function e(e){return"function"==typeof e}var t=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},r=0,i=void 0,a=void 0,s=function(e,t){h[r]=e,h[r+1]=t,2===(r+=2)&&(a?a(p):_())},o="undefined"!=typeof window?window:void 0,l=o||{},u=l.MutationObserver||l.WebKitMutationObserver,c="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),d="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function f(){var e=setTimeout;return function(){return e(p,1)}}var h=new Array(1e3);function p(){for(var e=0;e<r;e+=2)(0,h[e])(h[e+1]),h[e]=void 0,h[e+1]=void 0;r=0}var g,m,y,v,_=void 0;function T(e,t){var n=this,r=new this.constructor(S);void 0===r[b]&&x(r);var i=n._state;if(i){var a=arguments[i-1];s((function(){return P(i,r,a,n._result)}))}else N(n,r,e,t);return r}function E(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(S);return I(t,e),t}_=c?function(){return process.nextTick(p)}:u?(m=0,y=new u(p),v=document.createTextNode(""),y.observe(v,{characterData:!0}),function(){v.data=m=++m%2}):d?((g=new MessageChannel).port1.onmessage=p,function(){return g.port2.postMessage(0)}):void 0===o?function(){try{var e=Function("return this")().require("vertx");return void 0!==(i=e.runOnLoop||e.runOnContext)?function(){i(p)}:f()}catch(e){return f()}}():f();var b=Math.random().toString(36).substring(2);function S(){}var A=void 0;function w(t,n,r){n.constructor===t.constructor&&r===T&&n.constructor.resolve===E?function(e,t){1===t._state?R(e,t._result):2===t._state?D(e,t._result):N(t,void 0,(function(t){return I(e,t)}),(function(t){return D(e,t)}))}(t,n):void 0===r?R(t,n):e(r)?function(e,t,n){s((function(e){var r=!1,i=function(e,t,n,r){try{e.call(t,n,r)}catch(e){return e}}(n,t,(function(n){r||(r=!0,t!==n?I(e,n):R(e,n))}),(function(t){r||(r=!0,D(e,t))}),e._label);!r&&i&&(r=!0,D(e,i))}),e)}(t,n,r):R(t,n)}function I(e,t){if(e===t)D(e,new TypeError("You cannot resolve a promise with itself"));else if(i=typeof(r=t),null===r||"object"!==i&&"function"!==i)R(e,t);else{var n=void 0;try{n=t.then}catch(t){return void D(e,t)}w(e,t,n)}var r,i}function C(e){e._onerror&&e._onerror(e._result),O(e)}function R(e,t){e._state===A&&(e._result=t,e._state=1,0!==e._subscribers.length&&s(O,e))}function D(e,t){e._state===A&&(e._state=2,e._result=t,s(C,e))}function N(e,t,n,r){var i=e._subscribers,a=i.length;e._onerror=null,i[a]=t,i[a+1]=n,i[a+2]=r,0===a&&e._state&&s(O,e)}function O(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r=void 0,i=void 0,a=e._result,s=0;s<t.length;s+=3)r=t[s],i=t[s+n],r?P(n,r,i,a):i(a);e._subscribers.length=0}}function P(t,n,r,i){var a=e(r),s=void 0,o=void 0,l=!0;if(a){try{s=r(i)}catch(e){l=!1,o=e}if(n===s)return void D(n,new TypeError("A promises callback cannot return that same promise."))}else s=i;n._state!==A||(a&&l?I(n,s):!1===l?D(n,o):1===t?R(n,s):2===t&&D(n,s))}var M=0;function x(e){e[b]=M++,e._state=void 0,e._result=void 0,e._subscribers=[]}var L=function(){function e(e,n){this._instanceConstructor=e,this.promise=new e(S),this.promise[b]||x(this.promise),t(n)?(this.length=n.length,this._remaining=n.length,this._result=new Array(this.length),0===this.length?R(this.promise,this._result):(this.length=this.length||0,this._enumerate(n),0===this._remaining&&R(this.promise,this._result))):D(this.promise,new Error("Array Methods must be provided an Array"))}return e.prototype._enumerate=function(e){for(var t=0;this._state===A&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var n=this._instanceConstructor,r=n.resolve;if(r===E){var i=void 0,a=void 0,s=!1;try{i=e.then}catch(e){s=!0,a=e}if(i===T&&e._state!==A)this._settledAt(e._state,t,e._result);else if("function"!=typeof i)this._remaining--,this._result[t]=e;else if(n===k){var o=new n(S);s?D(o,a):w(o,e,i),this._willSettleAt(o,t)}else this._willSettleAt(new n((function(t){return t(e)})),t)}else this._willSettleAt(r(e),t)},e.prototype._settledAt=function(e,t,n){var r=this.promise;r._state===A&&(this._remaining--,2===e?D(r,n):this._result[t]=n),0===this._remaining&&R(r,this._result)},e.prototype._willSettleAt=function(e,t){var n=this;N(e,void 0,(function(e){return n._settledAt(1,t,e)}),(function(e){return n._settledAt(2,t,e)}))},e}(),k=function(){function t(e){this[b]=M++,this._result=this._state=void 0,this._subscribers=[],S!==e&&("function"!=typeof e&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof t?function(e,t){try{t((function(t){I(e,t)}),(function(t){D(e,t)}))}catch(t){D(e,t)}}(this,e):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return t.prototype.catch=function(e){return this.then(null,e)},t.prototype.finally=function(t){var n=this,r=n.constructor;return e(t)?n.then((function(e){return r.resolve(t()).then((function(){return e}))}),(function(e){return r.resolve(t()).then((function(){throw e}))})):n.then(t,t)},t}();return k.prototype.then=T,k.all=function(e){return new L(this,e).promise},k.race=function(e){var n=this;return t(e)?new n((function(t,r){for(var i=e.length,a=0;a<i;a++)n.resolve(e[a]).then(t,r)})):new n((function(e,t){return t(new TypeError("You must pass an array to race."))}))},k.resolve=E,k.reject=function(e){var t=new this(S);return D(t,e),t},k._setScheduler=function(e){a=e},k._setAsap=function(e){s=e},k._asap=s,k.polyfill=function(){var e=void 0;if(void 0!==n.g)e=n.g;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var r=null;try{r=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===r&&!t.cast)return}e.Promise=k},k.Promise=k,k}()},1159:function(e){"use strict";var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}g(e,t,a,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&g(e,"error",t,{once:!0})}(e,i)}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var s=10;function o(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function u(e,t,n,r){var i,a,s,u;if(o(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),s=a[t]),void 0===s)s=a[t]=n,++e._eventsCount;else if("function"==typeof s?s=a[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(i=l(e))>0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,u=c,console&&console.warn&&console.warn(u)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=c.bind(r);return i.listener=n,r.wrapFn=i,i}function f(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):p(i,i.length)}function h(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function p(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function g(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(a){r.once&&e.removeEventListener(t,i),n(a)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return l(this)},a.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i="error"===e,a=this._events;if(void 0!==a)i=i&&void 0===a.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var l=a[e];if(void 0===l)return!1;if("function"==typeof l)r(l,this,t);else{var u=l.length,c=p(l,u);for(n=0;n<u;++n)r(c[n],this,t)}return!0},a.prototype.addListener=function(e,t){return u(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return u(this,e,t,!0)},a.prototype.once=function(e,t){return o(t),this.on(e,d(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return o(t),this.prependListener(e,d(this,e,t)),this},a.prototype.removeListener=function(e,t){var n,r,i,a,s;if(o(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){s=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,a=Object.keys(n);for(r=0;r<a.length;++r)"removeListener"!==(i=a[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},a.prototype.listeners=function(e){return f(this,e,!0)},a.prototype.rawListeners=function(e){return f(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},a.prototype.listenerCount=h,a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},3101:function(e){"use strict";var t=Array.isArray,n=Object.keys,r=Object.prototype.hasOwnProperty;e.exports=function e(i,a){if(i===a)return!0;if(i&&a&&"object"==typeof i&&"object"==typeof a){var s,o,l,u=t(i),c=t(a);if(u&&c){if((o=i.length)!=a.length)return!1;for(s=o;0!=s--;)if(!e(i[s],a[s]))return!1;return!0}if(u!=c)return!1;var d=i instanceof Date,f=a instanceof Date;if(d!=f)return!1;if(d&&f)return i.getTime()==a.getTime();var h=i instanceof RegExp,p=a instanceof RegExp;if(h!=p)return!1;if(h&&p)return i.toString()==a.toString();var g=n(i);if((o=g.length)!==n(a).length)return!1;for(s=o;0!=s--;)if(!r.call(a,g[s]))return!1;for(s=o;0!=s--;)if(!e(i[l=g[s]],a[l]))return!1;return!0}return i!=i&&a!=a}},3362:function(e,t,n){!function(e,t,n,r,i){function a(e){if("contents"in e)for(var t=("styleAttrs"in e?e.styleAttrs[r.byName.ruby.qname]:null),n="span"===e.kind&&("container"===t||"textContainer"===t||"baseContainer"===t),i=e.contents.length-1;i>=0;i--)!n||"styleAttrs"in e.contents[i]&&r.byName.ruby.qname in e.contents[i].styleAttrs?a(e.contents[i]):delete e.contents[i]}function s(e,t,n,r){var i=r&&"seq"===r.timeContainer,a=0;r&&(a=i&&n?n.end:r.begin),t.begin=t.explicit_begin?t.explicit_begin+a:a;var o=t.begin,l=null;if("sets"in t)for(var u=0;u<t.sets.length;u++)s(e,t.sets[u],l,t),o="seq"===t.timeContainer?t.sets[u].end:Math.max(o,t.sets[u].end),l=t.sets[u];if("contents"in t){if("contents"in t)for(var c=0;c<t.contents.length;c++)s(e,t.contents[c],l,t),o="seq"===t.timeContainer?t.contents[c].end:Math.max(o,t.contents[c].end),l=t.contents[c]}else o=i?t.begin:Number.POSITIVE_INFINITY;null!==t.explicit_end&&null!==t.explicit_dur?t.end=Math.min(t.begin+t.explicit_dur,a+t.explicit_end):null===t.explicit_end&&null!==t.explicit_dur?t.end=t.begin+t.explicit_dur:null!==t.explicit_end&&null===t.explicit_dur?t.end=a+t.explicit_end:t.end=o,delete t.explicit_begin,delete t.explicit_dur,delete t.explicit_end,e._registerEvent(t)}function o(e){this.node=e}function l(){this.events=[],this.head=new u,this.body=null}function u(){this.styling=new c,this.layout=new h}function c(){this.styles={},this.initials={}}function d(){this.id=null,this.styleAttrs=null,this.styleRefs=null}function f(){this.styleAttrs=null}function h(){this.regions={}}function p(e,t){g.call(this,"image"),this.src=e,this.type=t}function g(e){this.kind=e}function m(e){this.id=e}function y(e){this.regionID=e}function v(e){this.styleAttrs=e}function _(e){this.sets=e}function T(e){this.contents=e}function E(e,t,n){this.explicit_begin=e,this.explicit_end=t,this.explicit_dur=n}function b(){g.call(this,"body")}function S(){g.call(this,"div")}function A(){g.call(this,"p")}function w(){g.call(this,"span")}function I(){g.call(this,"span")}function C(){g.call(this,"br")}function R(){}function D(){}function N(e){return e&&"xml:id"in e.attributes&&e.attributes["xml:id"].value||null}function O(e){return e&&"style"in e.attributes?e.attributes.style.value.split(" "):[]}function P(e,t){var n={};if(null!==e)for(var i in e.attributes){var a=e.attributes[i].uri+" "+e.attributes[i].local,s=r.byQName[a];if(void 0!==s){var o=s.parse(e.attributes[i].value);null!==o?(n[a]=o,s===r.byName.zIndex&&U(t,"zIndex attribute present but not used by IMSC1 since regions do not overlap")):B(t,"Cannot parse styling attribute "+a+" --\x3e "+e.attributes[i].value)}}return n}function M(e,t,n){for(var r in e.attributes)if(e.attributes[r].uri===t&&e.attributes[r].local===n)return e.attributes[r].value;return null}function x(e,t,n){var r,i=null;return null!==(r=/^(\d+(?:\.\d+)?)f$/.exec(n))?null!==t&&(i=parseFloat(r[1])/t):null!==(r=/^(\d+(?:\.\d+)?)t$/.exec(n))?null!==e&&(i=parseFloat(r[1])/e):null!==(r=/^(\d+(?:\.\d+)?)ms$/.exec(n))?i=parseFloat(r[1])/1e3:null!==(r=/^(\d+(?:\.\d+)?)s$/.exec(n))?i=parseFloat(r[1]):null!==(r=/^(\d+(?:\.\d+)?)h$/.exec(n))?i=3600*parseFloat(r[1]):null!==(r=/^(\d+(?:\.\d+)?)m$/.exec(n))?i=60*parseFloat(r[1]):null!==(r=/^(\d{2,}):(\d\d):(\d\d(?:\.\d+)?)$/.exec(n))?i=3600*parseInt(r[1])+60*parseInt(r[2])+parseFloat(r[3]):null!==(r=/^(\d{2,}):(\d\d):(\d\d)\:(\d{2,})$/.exec(n))&&null!==t&&(i=3600*parseInt(r[1])+60*parseInt(r[2])+parseInt(r[3])+(null===r[4]?0:parseInt(r[4])/t)),i}function L(e,t,n){for(;t.styleRefs.length>0;){var r=t.styleRefs.pop();r in e.styles?(L(e,e.styles[r],n),F(e.styles[r].styleAttrs,t.styleAttrs)):B(n,"Non-existant style id referenced")}}function k(e,t,n,r){for(var i=t.length-1;i>=0;i--){var a=t[i];a in e.styles?F(e.styles[a].styleAttrs,n):B(r,"Non-existant style id referenced")}}function F(e,t){for(var n in e)e.hasOwnProperty(n)&&(n in t||(t[n]=e[n]))}function U(e,t){if(e&&e.warn&&e.warn(t))throw t}function B(e,t){if(e&&e.error&&e.error(t))throw t}function j(e,t){throw e&&e.fatal&&e.fatal(t),t}function q(e,t){for(var n,r=0,i=e.length-1;r<=i;){var a=e[n=Math.floor((r+i)/2)];if(a<t)r=n+1;else{if(!(a>t))return{found:!0,index:n};i=n-1}}return{found:!1,index:r}}e.fromXML=function(e,i,g){var m=t.parser(!0,{xmlns:!0}),y=[],v=[],_=[],T=0,E=null;m.onclosetag=function(e){if(y[0]instanceof R)null!==E.head&&null!==E.head.styling&&k(E.head.styling,y[0].styleRefs,y[0].styleAttrs,i),delete y[0].styleRefs;else if(y[0]instanceof c)for(var t in y[0].styles)y[0].styles.hasOwnProperty(t)&&L(y[0],y[0].styles[t],i);else if(y[0]instanceof A||y[0]instanceof w){if(y[0].contents.length>1){var r,a=[y[0].contents[0]];for(r=1;r<y[0].contents.length;r++)y[0].contents[r]instanceof I&&a[a.length-1]instanceof I?a[a.length-1].text+=y[0].contents[r].text:a.push(y[0].contents[r]);y[0].contents=a}y[0]instanceof w&&1===y[0].contents.length&&y[0].contents[0]instanceof I&&(y[0].text=y[0].contents[0].text,delete y[0].contents)}else y[0]instanceof o&&(y[0].node.uri===n.ns_tt&&"metadata"===y[0].node.local?T--:T>0&&g&&"onCloseTag"in g&&g.onCloseTag());_.shift(),v.shift(),y.shift()},m.ontext=function(e){if(void 0===y[0]);else if(y[0]instanceof w||y[0]instanceof A){if(y[0]instanceof w){var t=y[0].styleAttrs[r.byName.ruby.qname];if("container"===t||"textContainer"===t||"baseContainer"===t)return}var n=new I;n.initFromText(E,y[0],e,v[0],_[0],i),y[0].contents.push(n)}else y[0]instanceof o&&T>0&&g&&"onText"in g&&g.onText(e)},m.onopentag=function(e){var t=e.attributes["xml:space"];t?_.unshift(t.value):0===_.length?_.unshift("default"):_.unshift(_[0]);var a=e.attributes["xml:lang"];if(a?v.unshift(a.value):0===v.length?v.unshift(""):v.unshift(v[0]),e.uri===n.ns_tt)if("tt"===e.local)null!==E&&j(i,"Two <tt> elements at ("+this.line+","+this.column+")"),(E=new l).initFromNode(e,v[0],i),y.unshift(E);else if("head"===e.local)y[0]instanceof l||j(i,"Parent of <head> element is not <tt> at ("+this.line+","+this.column+")"),y.unshift(E.head);else if("styling"===e.local)y[0]instanceof u||j(i,"Parent of <styling> element is not <head> at ("+this.line+","+this.column+")"),y.unshift(E.head.styling);else if("style"===e.local){var s;y[0]instanceof c?((s=new d).initFromNode(e,i),s.id?E.head.styling.styles[s.id]=s:B(i,"<style> element missing @id attribute"),y.unshift(s)):y[0]instanceof R?((s=new d).initFromNode(e,i),F(s.styleAttrs,y[0].styleAttrs),y.unshift(s)):j(i,"Parent of <style> element is not <styling> or <region> at ("+this.line+","+this.column+")")}else if("initial"===e.local){var m;if(y[0]instanceof c){for(var I in(m=new f).initFromNode(e,i),m.styleAttrs)m.styleAttrs.hasOwnProperty(I)&&(E.head.styling.initials[I]=m.styleAttrs[I]);y.unshift(m)}else j(i,"Parent of <initial> element is not <styling> at ("+this.line+","+this.column+")")}else if("layout"===e.local)y[0]instanceof u||j(i,"Parent of <layout> element is not <head> at "+this.line+","+this.column+")"),y.unshift(E.head.layout);else if("region"===e.local){y[0]instanceof h||j(i,"Parent of <region> element is not <layout> at "+this.line+","+this.column+")");var N=new R;N.initFromNode(E,e,v[0],i),!N.id||N.id in E.head.layout.regions?B(i,"Ignoring <region> with duplicate or missing @id at "+this.line+","+this.column+")"):E.head.layout.regions[N.id]=N,y.unshift(N)}else if("body"===e.local){y[0]instanceof l||j(i,"Parent of <body> element is not <tt> at "+this.line+","+this.column+")"),null!==E.body&&j(i,"Second <body> element at "+this.line+","+this.column+")");var O=new b;O.initFromNode(E,e,v[0],i),E.body=O,y.unshift(O)}else if("div"===e.local){y[0]instanceof S||y[0]instanceof b||j(i,"Parent of <div> element is not <body> or <div> at "+this.line+","+this.column+")");var P=new S;P.initFromNode(E,y[0],e,v[0],i);var M=P.styleAttrs[r.byName.backgroundImage.qname];M&&(P.contents.push(new p(M)),delete P.styleAttrs[r.byName.backgroundImage.qname]),y[0].contents.push(P),y.unshift(P)}else if("image"===e.local){y[0]instanceof S||j(i,"Parent of <image> element is not <div> at "+this.line+","+this.column+")");var x=new p;x.initFromNode(E,y[0],e,v[0],i),y[0].contents.push(x),y.unshift(x)}else if("p"===e.local){y[0]instanceof S||j(i,"Parent of <p> element is not <div> at "+this.line+","+this.column+")");var L=new A;L.initFromNode(E,y[0],e,v[0],i),y[0].contents.push(L),y.unshift(L)}else if("span"===e.local){y[0]instanceof w||y[0]instanceof A||j(i,"Parent of <span> element is not <span> or <p> at "+this.line+","+this.column+")");var k=new w;k.initFromNode(E,y[0],e,v[0],_[0],i),y[0].contents.push(k),y.unshift(k)}else if("br"===e.local){y[0]instanceof w||y[0]instanceof A||j(i,"Parent of <br> element is not <span> or <p> at "+this.line+","+this.column+")");var U=new C;U.initFromNode(E,y[0],e,v[0],i),y[0].contents.push(U),y.unshift(U)}else if("set"===e.local){y[0]instanceof w||y[0]instanceof A||y[0]instanceof S||y[0]instanceof b||y[0]instanceof R||y[0]instanceof C||j(i,"Parent of <set> element is not a content element or a region at "+this.line+","+this.column+")");var q=new D;q.initFromNode(E,y[0],e,i),y[0].sets.push(q),y.unshift(q)}else y.unshift(new o(e));else y.unshift(new o(e));if(y[0]instanceof o)if(e.uri===n.ns_tt&&"metadata"===e.local)T++;else if(T>0&&g&&"onOpenTag"in g){var H=[];for(var G in e.attributes)H[e.attributes[G].uri+" "+e.attributes[G].local]={uri:e.attributes[G].uri,local:e.attributes[G].local,value:e.attributes[G].value};g.onOpenTag(e.uri,e.local,H)}},m.write(e).close(),delete E.head.styling.styles;var N=!1;for(var O in E.head.layout.regions)if(E.head.layout.regions.hasOwnProperty(O)){N=!0;break}if(!N){var P=R.prototype.createDefaultRegion(E.lang);E.head.layout.regions[P.id]=P}for(var M in E.head.layout.regions)E.head.layout.regions.hasOwnProperty(M)&&s(E,E.head.layout.regions[M],null,null);return E.body&&s(E,E.body,null,null),E.body&&a(E.body),E},l.prototype.initFromNode=function(e,t,r){var a=function(e,t){var r=M(e,n.ns_ttp,"cellResolution"),i=15,a=32;if(null!==r){var s=/(\d+) (\d+)/.exec(r);null!==s?(a=parseInt(s[1]),i=parseInt(s[2])):U(t,"Malformed cellResolution value (using initial value instead)")}return{w:a,h:i}}(e,r);this.cellLength={h:new i.ComputedLength(0,1/a.h),w:new i.ComputedLength(1/a.w,0)};var s=function(e,t){var r,i=M(e,n.ns_ttp,"frameRate"),a=30;null!==i&&(null!==(r=/(\d+)/.exec(i))?a=parseInt(r[1]):U(t,"Malformed frame rate attribute (using initial value instead)"));var s=M(e,n.ns_ttp,"frameRateMultiplier"),o=1;null!==s&&(null!==(r=/(\d+) (\d+)/.exec(s))?o=parseInt(r[1])/parseInt(r[2]):U(t,"Malformed frame rate multiplier attribute (using initial value instead)"));var l=o*a,u=1,c=M(e,n.ns_ttp,"tickRate");return null===c?null!==i&&(u=l):null!==(r=/(\d+)/.exec(c))?u=parseInt(r[1]):U(t,"Malformed tick rate attribute (using initial value instead)"),{effectiveFrameRate:l,tickRate:u}}(e,r);this.effectiveFrameRate=s.effectiveFrameRate,this.tickRate=s.tickRate,this.aspectRatio=function(e,t){var r=M(e,n.ns_ittp,"aspectRatio");null===r&&(r=M(e,n.ns_ttp,"displayAspectRatio"));var i=null;if(null!==r){var a=/(\d+)\s+(\d+)/.exec(r);if(null!==a){var s=parseInt(a[1]),o=parseInt(a[2]);0!==s&&0!==o?i=s/o:B(t,"Illegal aspectRatio values (ignoring)")}else B(t,"Malformed aspectRatio attribute (ignoring)")}return i}(e,r);var o=M(e,n.ns_ttp,"timeBase");null!==o&&"media"!==o&&j(r,"Unsupported time base");var l=function(e,t){var r=M(e,n.ns_tts,"extent");if(null===r)return null;var a=r.split(" ");if(2!==a.length)return U(t,"Malformed extent (ignoring)"),null;var s=i.parseLength(a[0]),o=i.parseLength(a[1]);return o&&s?{h:o,w:s}:(U(t,"Malformed extent values (ignoring)"),null)}(e,r);null===l?this.pxLength={h:null,w:null}:("px"===l.h.unit&&"px"===l.w.unit||j(r,"Extent on TT must be in px or absent"),this.pxLength={h:new i.ComputedLength(0,1/l.h.value),w:new i.ComputedLength(1/l.w.value,0)}),this.dimensions={h:new i.ComputedLength(0,1),w:new i.ComputedLength(1,0)},this.lang=t},l.prototype._registerEvent=function(e){if(!(e.end<=e.begin)){var t=q(this.events,e.begin);if(t.found||this.events.splice(t.index,0,e.begin),e.end!==Number.POSITIVE_INFINITY){var n=q(this.events,e.end);n.found||this.events.splice(n.index,0,e.end)}}},l.prototype.getMediaTimeRange=function(){return[this.events[0],this.events[this.events.length-1]]},l.prototype.getMediaTimeEvents=function(){return this.events},d.prototype.initFromNode=function(e,t){this.id=N(e),this.styleAttrs=P(e,t),this.styleRefs=O(e)},f.prototype.initFromNode=function(e,t){for(var r in this.styleAttrs={},e.attributes)if(e.attributes[r].uri===n.ns_itts||e.attributes[r].uri===n.ns_ebutts||e.attributes[r].uri===n.ns_tts){var i=e.attributes[r].uri+" "+e.attributes[r].local;this.styleAttrs[i]=e.attributes[r].value}},p.prototype.initFromNode=function(e,t,n,r,i){this.src="src"in n.attributes?n.attributes.src.value:null,this.src||B(i,"Invalid image@src attribute"),this.type="type"in n.attributes?n.attributes.type.value:null,this.type||B(i,"Invalid image@type attribute"),v.prototype.initFromNode.call(this,e,t,n,i),E.prototype.initFromNode.call(this,e,t,n,i),_.prototype.initFromNode.call(this,e,t,n,i),y.prototype.initFromNode.call(this,e,t,n,i),this.lang=r},m.prototype.initFromNode=function(e,t,n,r){this.id=N(n)},y.prototype.initFromNode=function(e,t,n,r){this.regionID=function(e){return e&&"region"in e.attributes?e.attributes.region.value:""}(n)},v.prototype.initFromNode=function(e,t,n,r){this.styleAttrs=P(n,r),null!==e.head&&null!==e.head.styling&&k(e.head.styling,O(n),this.styleAttrs,r)},_.prototype.initFromNode=function(e,t,n,r){this.sets=[]},T.prototype.initFromNode=function(e,t,n,r){this.contents=[]},E.prototype.initFromNode=function(e,t,n,r){var i=function(e,t,n,r){var i=null;n&&"begin"in n.attributes&&null===(i=x(e.tickRate,e.effectiveFrameRate,n.attributes.begin.value))&&U(r,"Malformed begin value "+n.attributes.begin.value+" (using 0)");var a=null;n&&"dur"in n.attributes&&null===(a=x(e.tickRate,e.effectiveFrameRate,n.attributes.dur.value))&&U(r,"Malformed dur value "+n.attributes.dur.value+" (ignoring)");var s=null;return n&&"end"in n.attributes&&null===(s=x(e.tickRate,e.effectiveFrameRate,n.attributes.end.value))&&U(r,"Malformed end value (ignoring)"),{explicit_begin:i,explicit_end:s,explicit_dur:a}}(e,0,n,r);this.explicit_begin=i.explicit_begin,this.explicit_end=i.explicit_end,this.explicit_dur=i.explicit_dur,this.timeContainer=function(e,t){var n=e&&"timeContainer"in e.attributes?e.attributes.timeContainer.value:null;return n&&"par"!==n?"seq"===n?"seq":(B(t,"Illegal value of timeContainer (assuming 'par')"),"par"):"par"}(n,r)},b.prototype.initFromNode=function(e,t,n,r){v.prototype.initFromNode.call(this,e,null,t,r),E.prototype.initFromNode.call(this,e,null,t,r),_.prototype.initFromNode.call(this,e,null,t,r),y.prototype.initFromNode.call(this,e,null,t,r),T.prototype.initFromNode.call(this,e,null,t,r),this.lang=n},S.prototype.initFromNode=function(e,t,n,r,i){v.prototype.initFromNode.call(this,e,t,n,i),E.prototype.initFromNode.call(this,e,t,n,i),_.prototype.initFromNode.call(this,e,t,n,i),y.prototype.initFromNode.call(this,e,t,n,i),T.prototype.initFromNode.call(this,e,t,n,i),this.lang=r},A.prototype.initFromNode=function(e,t,n,r,i){v.prototype.initFromNode.call(this,e,t,n,i),E.prototype.initFromNode.call(this,e,t,n,i),_.prototype.initFromNode.call(this,e,t,n,i),y.prototype.initFromNode.call(this,e,t,n,i),T.prototype.initFromNode.call(this,e,t,n,i),this.lang=r},w.prototype.initFromNode=function(e,t,n,r,i,a){v.prototype.initFromNode.call(this,e,t,n,a),E.prototype.initFromNode.call(this,e,t,n,a),_.prototype.initFromNode.call(this,e,t,n,a),y.prototype.initFromNode.call(this,e,t,n,a),T.prototype.initFromNode.call(this,e,t,n,a),this.space=i,this.lang=r},I.prototype.initFromText=function(e,t,n,r,i,a){E.prototype.initFromNode.call(this,e,t,null,a),this.text=n,this.space=i,this.lang=r},C.prototype.initFromNode=function(e,t,n,r,i){y.prototype.initFromNode.call(this,e,t,n,i),E.prototype.initFromNode.call(this,e,t,n,i),this.lang=r},R.prototype.createDefaultRegion=function(e){var t=new R;return m.call(t,""),v.call(t,{}),_.call(t,[]),E.call(t,0,Number.POSITIVE_INFINITY,null),this.lang=e,t},R.prototype.initFromNode=function(e,t,n,r){m.prototype.initFromNode.call(this,e,null,t,r),E.prototype.initFromNode.call(this,e,null,t,r),_.prototype.initFromNode.call(this,e,null,t,r),this.styleAttrs=P(t,r),this.styleRefs=O(t),this.lang=n},D.prototype.initFromNode=function(e,t,n,r){E.prototype.initFromNode.call(this,e,t,n,r);var i=P(n,r);for(var a in this.qname=null,this.value=null,i)if(i.hasOwnProperty(a)){if(this.qname){B(r,"More than one style specified on set");break}this.qname=a,this.value=i[a]}}}(t,"undefined"==typeof sax?n(5378):sax,"undefined"==typeof imscNames?n(210):imscNames,"undefined"==typeof imscStyles?n(6811):imscStyles,"undefined"==typeof imscUtils?n(5926):imscUtils)},506:function(e,t,n){var r=/firefox/i.test(navigator.userAgent);!function(e,t,n){function i(e,t,d,h){var p;if("region"===d.kind)(p=document.createElement("div")).style.position="absolute";else if("body"===d.kind)p=document.createElement("div");else if("div"===d.kind)p=document.createElement("div");else if("image"===d.kind){if(p=document.createElement("img"),null!==e.imgResolver&&null!==d.src){var y=e.imgResolver(d.src,p);y&&(p.src=y),p.height=e.regionH,p.width=e.regionW}}else if("p"===d.kind)p=document.createElement("p");else if("span"===d.kind)if("container"===d.styleAttrs[n.byName.ruby.qname])p=document.createElement("ruby"),e.ruby=!0;else if("base"===d.styleAttrs[n.byName.ruby.qname])p=document.createElement("span");else if("text"===d.styleAttrs[n.byName.ruby.qname])p=document.createElement("rt");else if("baseContainer"===d.styleAttrs[n.byName.ruby.qname])p=document.createElement("rbc");else if("textContainer"===d.styleAttrs[n.byName.ruby.qname])p=document.createElement("rtc");else{if("delimiter"===d.styleAttrs[n.byName.ruby.qname])return;p=document.createElement("span")}else"br"===d.kind&&(p=document.createElement("br"));if(p){if(d.lang&&("region"!==d.kind&&d.lang===h.lang||(p.lang=d.lang)),t.appendChild(p),p.style.margin="0","region"===d.kind){var T=d.styleAttrs[n.byName.writingMode.qname];"lrtb"===T||"lr"===T?(e.ipd="lr",e.bpd="tb"):"rltb"===T||"rl"===T?(e.ipd="rl",e.bpd="tb"):"tblr"===T?(e.ipd="tb",e.bpd="lr"):"tbrl"!==T&&"tb"!==T||(e.ipd="tb",e.bpd="rl")}else if("p"===d.kind&&"tb"===e.bpd){var E=d.styleAttrs[n.byName.direction.qname];e.ipd="ltr"===E?"lr":"rl"}for(var b=0;b<f.length;b++){var S=f[b],A=d.styleAttrs[S.qname];void 0!==A&&null!==S.map&&S.map(e,p,d,A)}var w=p,I=d.styleAttrs[n.byName.linePadding.qname];if(I&&!I.isZero()){var C=I.toUsedLength(e.w,e.h);if(C>0){var R=Math.ceil(C)+"px";"tb"===e.bpd?(w.style.paddingLeft=R,w.style.paddingRight=R):(w.style.paddingTop=R,w.style.paddingBottom=R),e.lp=I}}var D=d.styleAttrs[n.byName.multiRowAlign.qname];if(D&&"auto"!==D){var N=document.createElement("span");N.style.display="inline-block",N.style.textAlign=D,p.appendChild(N),w=N,e.mra=D}var O=d.styleAttrs[n.byName.rubyReserve.qname];if(O&&"none"!==O[0]&&(e.rubyReserve=O),d.styleAttrs[n.byName.fillLineGap.qname]&&(e.flg=!0),"span"===d.kind&&d.text){var P=d.styleAttrs[n.byName.textEmphasis.qname];if(P&&"none"!==P.style&&(e.textEmphasis=!0),n.byName.textCombine.qname in d.styleAttrs&&"all"===d.styleAttrs[n.byName.textCombine.qname])p.textContent=d.text,p._isd_element=d,P&&c(e,p,0,P);else for(var M="",x=0;x<d.text.length;x++){M+=d.text.charAt(x);var L=d.text.charCodeAt(x);if(L<55296||L>56319||x===d.text.length-1){var k=document.createElement("span");k.textContent=M,P&&c(e,k,0,P),p.appendChild(k),M="",k._isd_element=d}}}if("contents"in d)for(var F=0;F<d.contents.length;F++)i(e,w,d.contents[F],d);var U=[];if("p"===d.kind&&(u(e,w,U,null),e.rubyReserve&&(function(e,t){for(var n=0;n<e.length;n++){var r,i,a=document.createElement("ruby"),s=document.createElement("span");s.textContent="​",a.appendChild(s);var o,l=t.rubyReserve[1].toUsedLength(t.w,t.h)+"px";"both"===t.rubyReserve[0]||"outside"===t.rubyReserve[0]&&1==e.length?((r=document.createElement("rtc")).style[m]=g?"after":"under",r.textContent="​",r.style.fontSize=l,(i=document.createElement("rtc")).style[m]=g?"before":"over",i.textContent="​",i.style.fontSize=l,a.appendChild(r),a.appendChild(i)):((r=document.createElement("rtc")).textContent="​",r.style.fontSize=l,o="after"===t.rubyReserve[0]||"outside"===t.rubyReserve[0]&&n>0?g?"after":"tb"===t.bpd||"rl"===t.bpd?"under":"over":g?"before":"tb"===t.bpd||"rl"===t.bpd?"over":"under",r.style[m]=o,a.appendChild(r));for(var u=null,c=0;c<e[n].rbc.length;c++)if("ruby"===e[n].rbc[c].localName){u=e[n].rbc[c];for(var d=0;d<u.style.length;d++)a.style.setProperty(u.style.item(d),u.style.getPropertyValue(u.style.item(d)));break}(u=u||e[n].elements[0].node).parentElement.insertBefore(a,u)}}(U,e),e.rubyReserve=null),(e.ruby||e.rubyReserve)&&(function(e,t){for(var n=0;n<e.length;n++)for(var r=0;r<e[n].rbc.length;r++){var i;e[n].rbc[r].style[m]||(i=g?0===n?"before":"after":"tb"===t.bpd||"rl"===t.bpd?0===n?"over":"under":0===n?"under":"over",e[n].rbc[r].style[m]=i)}}(U,e),e.ruby=null),e.textEmphasis&&(function(e,t){for(var n=0;n<e.length;n++)for(var r=0;r<e[n].te.length;r++){var i;e[n].te[r].style[v]&&"none"!==e[n].te[r].style[v]||(i="tb"===t.bpd?0===n?"left over":"left under":"rl"===t.bpd?0===n?"right under":"left under":0===n?"left under":"right under",e[n].te[r].style[v]=i)}}(U,e),e.textEmphasis=null),e.mra&&(function(e){for(var t=0;t<e.length-1;t++){var n=e[t].elements.length;if(0!==n&&!1===e[t].br){var r=document.createElement("br"),i=e[t].elements[n-1].node;i.parentElement.insertBefore(r,i.nextSibling)}}}(U),e.mra=null),e.lp&&(function(e,t,n){if(null!==e)for(var i=0;i<e.length;i++){var a=e[i].elements.length,s=Math.ceil(t)+"px",o="-"+Math.ceil(t)+"px";if(0!==a){var l=e[i].elements[e[i].start_elem],u=e[i].elements[e[i].end_elem];if(l===u){var c=l.node.getBoundingClientRect();if(0==c.width||0==c.height)continue}"lr"===n.ipd?(l.node.style.marginLeft=o,l.node.style.paddingLeft=s):"rl"===n.ipd?(l.node.style.paddingRight=s,l.node.style.marginRight=o):"tb"===n.ipd&&(l.node.style.paddingTop=s,l.node.style.marginTop=o),"lr"===n.ipd?(r||(u.node.style.marginRight=o),u.node.style.paddingRight=s):"rl"===n.ipd?(u.node.style.paddingLeft=s,r||(u.node.style.marginLeft=o)):"tb"===n.ipd&&(u.node.style.paddingBottom=s,u.node.style.marginBottom=o)}}}(U,e.lp.toUsedLength(e.w,e.h),e),e.lp=null),function(e,t){for(var n=0;n<e.length;n++)for(var r=e[n],i=1;i<r.elements.length;){var o=r.elements[i-1],l=r.elements[i];s(o.node,l.node,t)?r.elements.splice(i,1):i++}for(var u,c,d=[],f=0;f<e.length;f++)for(var h=0;h<e[f].elements.length;h++)(c=a(u=e[f].elements[h].node,d,!1))&&(u.style.backgroundColor=c);for(var p=0;p<d.length;p++)d[p].style.backgroundColor=""}(U,e),e.flg)){var B=l(w.getBoundingClientRect(),e);!function(e,t,n,r,i){for(var a=Math.sign(n-t),s=0;s<=e.length;s++){var o,l,u,c;if(o=0===s?Math.round(t):s===e.length?Math.round(n):Math.round((e[s-1].after+e[s].before)/2),s>0&&e[s-1])for(u=0;u<e[s-1].elements.length;u++)l=a*(o-(c=e[s-1].elements[u]).after)+"px","lr"===r.bpd?c.node.style.paddingRight=l:"rl"===r.bpd?c.node.style.paddingLeft=l:"tb"===r.bpd&&(c.node.style.paddingBottom=l);if(s<e.length)for(u=0;u<e[s].elements.length;u++)l=a*((c=e[s].elements[u]).before-o)+"px","lr"===r.bpd?c.node.style.paddingLeft=l:"rl"===r.bpd?c.node.style.paddingRight=l:"tb"===r.bpd&&(c.node.style.paddingTop=l)}}(U,B.before,B.after,e),e.flg=null}if("region"===d.kind&&"tb"===e.bpd&&e.enableRollUp&&d.contents.length>0&&"after"===d.styleAttrs[n.byName.displayAlign.qname]){u(e,w,U,null);var j=new o(""===d.id?"_":d.id,U);if(e.currentISDState[j.id]=j,e.previousISDState&&j.id in e.previousISDState&&e.previousISDState[j.id].plist.length>0&&j.plist.length>1&&j.plist[j.plist.length-2].text===e.previousISDState[j.id].plist[e.previousISDState[j.id].plist.length-1].text){var q=p.firstElementChild,H=j.plist[j.plist.length-1].after-j.plist[j.plist.length-1].before;q.style.bottom="-"+H+"px",q.style.transition="transform 0.4s",q.style.position="relative",q.style.transform="translateY(-"+H+"px)"}}}else _(e.errorHandler,"Error processing ISD element kind: "+d.kind)}function a(e,t,n){return e.style.backgroundColor?(n&&!t.includes(e)&&t.push(e),e.style.backgroundColor):"SPAN"===e.parentElement.nodeName||"RUBY"===e.parentElement.nodeName||"RBC"===e.parentElement.nodeName||"RTC"===e.parentElement.nodeName||"RT"===e.parentElement.nodeName?a(e.parentElement,t,!0):void 0}function s(e,t,n){if("SPAN"===e.tagName&&"SPAN"===t.tagName&&e._isd_element===t._isd_element){if(!e._isd_element)return _(n.errorHandler,"Internal error: HTML span is not linked to a source element; cannot merge spans."),!1;e.textContent+=t.textContent;for(var r=0;r<t.style.length;r++){var i=t.style[r];(i.indexOf("border")>=0||i.indexOf("padding")>=0||i.indexOf("margin")>=0)&&(e.style[i]=t.style[i])}return t.parentElement.removeChild(t),!0}return!1}function o(e,t){this.id=e,this.plist=t}function l(e,t){var n={before:null,after:null,start:null,end:null};return"tb"===t.bpd?(n.before=e.top,n.after=e.bottom,"lr"===t.ipd?(n.start=e.left,n.end=e.right):(n.start=e.right,n.end=e.left)):"lr"===t.bpd?(n.before=e.left,n.after=e.right,n.start=e.top,n.end=e.bottom):"rl"===t.bpd&&(n.before=e.right,n.after=e.left,n.start=e.top,n.end=e.bottom),n}function u(e,t,n,r){if("rt"!==t.localName&&"rtc"!==t.localName){var i,a,s,o,c=t.style.backgroundColor||r;if(0===t.childElementCount)if("span"===t.localName||"rb"===t.localName){var d=l(t.getBoundingClientRect(),e);if(0!==n.length&&(i=d.before,a=d.after,s=n[n.length-1].before,a<(o=n[n.length-1].after)&&i>s||o<=a&&s>=i)){var f=Math.sign(d.after-d.before),h=Math.sign(d.end-d.start);f*(d.before-n[n.length-1].before)<0&&(n[n.length-1].before=d.before),f*(d.after-n[n.length-1].after)>0&&(n[n.length-1].after=d.after),h*(d.start-n[n.length-1].start)<0&&(n[n.length-1].start=d.start,n[n.length-1].start_elem=n[n.length-1].elements.length),h*(d.end-n[n.length-1].end)>0&&(n[n.length-1].end=d.end,n[n.length-1].end_elem=n[n.length-1].elements.length)}else n.push({before:d.before,after:d.after,start:d.start,end:d.end,start_elem:0,end_elem:0,elements:[],rbc:[],te:[],text:"",br:!1});n[n.length-1].text+=t.textContent,n[n.length-1].elements.push({node:t,bgcolor:c,before:d.before,after:d.after})}else"br"===t.localName&&0!==n.length&&(n[n.length-1].br=!0);else for(var p=t.firstChild;p;)p.nodeType===Node.ELEMENT_NODE&&(u(e,p,n,c),"ruby"===p.localName||"rtc"===p.localName?n.length>0&&n[n.length-1].rbc.push(p):"span"===p.localName&&p.style[y]&&"none"!==p.style[y]&&n.length>0&&n[n.length-1].te.push(p)),p=p.nextSibling}}function c(e,t,n,r){var i;"none"!==r.style&&("auto"===r.style?t.style[y]="filled":t.style[y]=r.style+" "+r.symbol,("before"===r.position||"after"===r.position)&&(i="tb"===e.bpd?"before"===r.position?"left over":"left under":"rl"===e.bpd?"before"===r.position?"right under":"left under":"before"===r.position?"left under":"right under",t.style[v]=i))}function d(e,t){this.qname=e,this.map=t}e.render=function(e,t,n,r,a,s,o,l,u){var c=r||t.clientHeight,d=a||t.clientWidth;if(null!==e.aspectRatio){var f=c*e.aspectRatio;f>d?c=Math.round(d/e.aspectRatio):d=f}var h=document.createElement("div");h.style.position="relative",h.style.width=d+"px",h.style.height=c+"px",h.style.margin="auto",h.style.top=0,h.style.bottom=0,h.style.left=0,h.style.right=0,h.style.zIndex=0;var p={h:c,w:d,regionH:null,regionW:null,imgResolver:n,displayForcedOnlyMode:s||!1,isd:e,errorHandler:o,previousISDState:l,enableRollUp:u||!1,currentISDState:{},flg:null,lp:null,mra:null,ipd:null,bpd:null,ruby:null,textEmphasis:null,rubyReserve:null};if(t.appendChild(h),"contents"in e)for(var g=0;g<e.contents.length;g++)i(p,h,e.contents[g],e);return p.currentISDState};for(var f=[new d("http://www.w3.org/ns/ttml#styling backgroundColor",(function(e,t,n,r){0!==r[3]&&(t.style.backgroundColor="rgba("+r[0].toString()+","+r[1].toString()+","+r[2].toString()+","+(r[3]/255).toString()+")")})),new d("http://www.w3.org/ns/ttml#styling color",(function(e,t,n,r){t.style.color="rgba("+r[0].toString()+","+r[1].toString()+","+r[2].toString()+","+(r[3]/255).toString()+")"})),new d("http://www.w3.org/ns/ttml#styling direction",(function(e,t,n,r){t.style.direction=r})),new d("http://www.w3.org/ns/ttml#styling display",(function(e,t,n,r){})),new d("http://www.w3.org/ns/ttml#styling displayAlign",(function(e,t,n,r){t.style.display="flex",t.style.flexDirection="column","before"===r?t.style.justifyContent="flex-start":"center"===r?t.style.justifyContent="center":"after"===r&&(t.style.justifyContent="flex-end")})),new d("http://www.w3.org/ns/ttml#styling extent",(function(e,t,n,r){e.regionH=r.h.toUsedLength(e.w,e.h),e.regionW=r.w.toUsedLength(e.w,e.h);var i=0,a=0,s=n.styleAttrs["http://www.w3.org/ns/ttml#styling padding"];s&&(i=s[0].toUsedLength(e.w,e.h)+s[2].toUsedLength(e.w,e.h),a=s[1].toUsedLength(e.w,e.h)+s[3].toUsedLength(e.w,e.h)),t.style.height=e.regionH-i+"px",t.style.width=e.regionW-a+"px"})),new d("http://www.w3.org/ns/ttml#styling fontFamily",(function(e,t,n,r){for(var i=[],a=0;a<r.length;a++)r[a]=r[a].trim(),"monospaceSerif"===r[a]?(i.push("Courier New"),i.push('"Liberation Mono"'),i.push("Courier"),i.push("monospace")):"proportionalSansSerif"===r[a]?(i.push("Arial"),i.push("Helvetica"),i.push('"Liberation Sans"'),i.push("sans-serif")):"monospace"===r[a]?i.push("monospace"):"sansSerif"===r[a]?i.push("sans-serif"):"serif"===r[a]?i.push("serif"):"monospaceSansSerif"===r[a]?(i.push("Consolas"),i.push("monospace")):"proportionalSerif"===r[a]?i.push("serif"):i.push(r[a]);if(i.length>0){for(var s=[i[0]],o=1;o<i.length;o++)-1==s.indexOf(i[o])&&s.push(i[o]);i=s}t.style.fontFamily=i.join(",")})),new d("http://www.w3.org/ns/ttml#styling shear",(function(e,t,n,r){if(0!==r){var i=-.9*r;"tb"===e.bpd?t.style.transform="skewX("+i+"deg)":t.style.transform="skewY("+i+"deg)"}})),new d("http://www.w3.org/ns/ttml#styling fontSize",(function(e,t,n,r){t.style.fontSize=r.toUsedLength(e.w,e.h)+"px"})),new d("http://www.w3.org/ns/ttml#styling fontStyle",(function(e,t,n,r){t.style.fontStyle=r})),new d("http://www.w3.org/ns/ttml#styling fontWeight",(function(e,t,n,r){t.style.fontWeight=r})),new d("http://www.w3.org/ns/ttml#styling lineHeight",(function(e,t,n,r){t.style.lineHeight="normal"===r?"normal":r.toUsedLength(e.w,e.h)+"px"})),new d("http://www.w3.org/ns/ttml#styling opacity",(function(e,t,n,r){t.style.opacity=r})),new d("http://www.w3.org/ns/ttml#styling origin",(function(e,t,n,r){t.style.top=r.h.toUsedLength(e.w,e.h)+"px",t.style.left=r.w.toUsedLength(e.w,e.h)+"px"})),new d("http://www.w3.org/ns/ttml#styling overflow",(function(e,t,n,r){t.style.overflow=r})),new d("http://www.w3.org/ns/ttml#styling padding",(function(e,t,n,r){var i=[];i[0]=r[0].toUsedLength(e.w,e.h)+"px",i[1]=r[3].toUsedLength(e.w,e.h)+"px",i[2]=r[2].toUsedLength(e.w,e.h)+"px",i[3]=r[1].toUsedLength(e.w,e.h)+"px",t.style.padding=i.join(" ")})),new d("http://www.w3.org/ns/ttml#styling position",(function(e,t,n,r){t.style.top=r.h.toUsedLength(e.w,e.h)+"px",t.style.left=r.w.toUsedLength(e.w,e.h)+"px"})),new d("http://www.w3.org/ns/ttml#styling rubyAlign",(function(e,t,n,r){t.style.rubyAlign="spaceAround"===r?"space-around":"center"})),new d("http://www.w3.org/ns/ttml#styling rubyPosition",(function(e,t,n,r){var i;"before"!==r&&"after"!==r||(i=g?r:"tb"===e.bpd||"rl"===e.bpd?"before"===r?"over":"under":"before"===r?"under":"over",t.parentElement.style[m]=i)})),new d("http://www.w3.org/ns/ttml#styling showBackground",null),new d("http://www.w3.org/ns/ttml#styling textAlign",(function(e,t,n,r){var i;i="start"===r?"rl"===e.ipd?"right":"left":"end"===r?"rl"===e.ipd?"left":"right":r,t.style.textAlign=i})),new d("http://www.w3.org/ns/ttml#styling textDecoration",(function(e,t,n,r){t.style.textDecoration=r.join(" ").replace("lineThrough","line-through")})),new d("http://www.w3.org/ns/ttml#styling textOutline",(function(e,t,n,r){})),new d("http://www.w3.org/ns/ttml#styling textShadow",(function(e,t,r,i){var a=r.styleAttrs[n.byName.textOutline.qname];if("none"===i&&"none"===a)t.style.textShadow="";else{var s=[];if("none"!==a){var o="rgba("+a.color[0].toString()+","+a.color[1].toString()+","+a.color[2].toString()+","+(a.color[3]/255).toString()+")";s.push("1px 1px 1px "+o),s.push("-1px 1px 1px "+o),s.push("1px -1px 1px "+o),s.push("-1px -1px 1px "+o)}if("none"!==i)for(var l=0;l<i.length;l++)s.push(i[l].x_off.toUsedLength(e.w,e.h)+"px "+i[l].y_off.toUsedLength(e.w,e.h)+"px "+i[l].b_radius.toUsedLength(e.w,e.h)+"px rgba("+i[l].color[0].toString()+","+i[l].color[1].toString()+","+i[l].color[2].toString()+","+(i[l].color[3]/255).toString()+")");t.style.textShadow=s.join(",")}})),new d("http://www.w3.org/ns/ttml#styling textCombine",(function(e,t,n,r){t.style.textCombineUpright=r})),new d("http://www.w3.org/ns/ttml#styling textEmphasis",(function(e,t,n,r){})),new d("http://www.w3.org/ns/ttml#styling unicodeBidi",(function(e,t,n,r){var i;i="bidiOverride"===r?"bidi-override":r,t.style.unicodeBidi=i})),new d("http://www.w3.org/ns/ttml#styling visibility",(function(e,t,n,r){t.style.visibility=r})),new d("http://www.w3.org/ns/ttml#styling wrapOption",(function(e,t,n,r){"wrap"===r?"preserve"===n.space?t.style.whiteSpace="pre-wrap":t.style.whiteSpace="normal":"preserve"===n.space?t.style.whiteSpace="pre":t.style.whiteSpace="noWrap"})),new d("http://www.w3.org/ns/ttml#styling writingMode",(function(e,t,n,r){"lrtb"===r||"lr"===r||"rltb"===r||"rl"===r?t.style.writingMode="horizontal-tb":"tblr"===r?t.style.writingMode="vertical-lr":"tbrl"!==r&&"tb"!==r||(t.style.writingMode="vertical-rl")})),new d("http://www.w3.org/ns/ttml#styling zIndex",(function(e,t,n,r){t.style.zIndex=r})),new d("http://www.w3.org/ns/ttml/profile/imsc1#styling forcedDisplay",(function(e,t,n,r){e.displayForcedOnlyMode&&!1===r&&(t.style.visibility="hidden")}))],h={},p=0;p<f.length;p++)h[f[p].qname]=f[p];var g="webkitRubyPosition"in window.getComputedStyle(document.documentElement),m=g?"webkitRubyPosition":"rubyPosition",y="webkitTextEmphasisStyle"in window.getComputedStyle(document.documentElement)?"webkitTextEmphasisStyle":"textEmphasisStyle",v="webkitTextEmphasisPosition"in window.getComputedStyle(document.documentElement)?"webkitTextEmphasisPosition":"textEmphasisPosition";function _(e,t){if(e&&e.error&&e.error(t))throw t}}(t,"undefined"==typeof imscNames?n(210):imscNames,"undefined"==typeof imscStyles?n(6811):imscStyles,"undefined"==typeof imscUtils?n(5926):imscUtils)},4080:function(e,t,n){!function(e,t,n,r){e.generateISD=function(e,t,r){var i,s=new l(e),o={},u={},c=e.head.styling.initials[n.byName.showBackground.qname],d=e.head.styling.initials[n.byName.backgroundColor.qname];for(var f in e.head.layout.regions)if(e.head.layout.regions.hasOwnProperty(f)){var h=e.head.layout.regions[f],p=h.styleAttrs[n.byName.showBackground.qname]||c,g=h.styleAttrs[n.byName.backgroundColor.qname]||d;u[h.id]=("always"===p||void 0===p)&&void 0!==g&&!(t<h.begin||t>=h.end)}for(var m in e.body&&e.body.regionID&&(u[e.body.regionID]=!0),i=null!==e.body?function e(t,n){if(n.contents){var r={};for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i]);return r.contents=[],n.contents.filter((function(e){return!(t<e.begin||t>=e.end)})).forEach((function(n){var i=e(t,n);i.regionID&&(u[i.regionID]=!0),null!==i&&r.contents.push(i)})),r}return n}(t,e.body):null,void 0!==u[""]&&(u[""]=!0),u)if(u[m]){var y=a(e,t,e.head.layout.regions[m],i,null,"",e.head.layout.regions[m],r,o);null!==y&&s.contents.push(y.element)}return s};var i=[n.byName.color.qname,n.byName.textCombine.qname,n.byName.textDecoration.qname,n.byName.textEmphasis.qname,n.byName.textOutline.qname,n.byName.textShadow.qname];function a(e,t,l,d,f,h,p,g,m){if(t<p.begin||t>=p.end)return null;var y="regionID"in p&&""!==p.regionID?p.regionID:h;if(null!==f&&y!==l.id&&(!("contents"in p)||"contents"in p&&0===p.contents.length||""!==y))return null;var v=new u(p);if("sets"in p)for(var _=0;_<p.sets.length;_++)t<p.sets[_].begin||t>=p.sets[_].end||(v.styleAttrs[p.sets[_].qname]=p.sets[_].value);var T={};for(var E in v.styleAttrs)if(v.styleAttrs.hasOwnProperty(E)&&(T[E]=!0,"region"===v.kind&&E===n.byName.writingMode.qname&&!(n.byName.direction.qname in v.styleAttrs))){var b=v.styleAttrs[E];"lrtb"===b||"lr"===b?v.styleAttrs[n.byName.direction.qname]="ltr":"rltb"!==b&&"rl"!==b||(v.styleAttrs[n.byName.direction.qname]="rtl")}if(null!==f)for(var S=0;S<n.all.length;S++){var A=n.all[S];if(A.qname===n.byName.textDecoration.qname){var w=f.styleAttrs[A.qname],I=v.styleAttrs[A.qname],C=[];void 0===I?C=w:-1===I.indexOf("none")?((-1===I.indexOf("noUnderline")&&-1!==w.indexOf("underline")||-1!==I.indexOf("underline"))&&C.push("underline"),(-1===I.indexOf("noLineThrough")&&-1!==w.indexOf("lineThrough")||-1!==I.indexOf("lineThrough"))&&C.push("lineThrough"),(-1===I.indexOf("noOverline")&&-1!==w.indexOf("overline")||-1!==I.indexOf("overline"))&&C.push("overline")):C.push("none"),v.styleAttrs[A.qname]=C}else if(A.qname!==n.byName.fontSize.qname||A.qname in v.styleAttrs||"span"!==v.kind||"textContainer"!==v.styleAttrs[n.byName.ruby.qname])if(A.qname!==n.byName.fontSize.qname||A.qname in v.styleAttrs||"span"!==v.kind||"text"!==v.styleAttrs[n.byName.ruby.qname])A.inherit&&A.qname in f.styleAttrs&&!(A.qname in v.styleAttrs)&&(v.styleAttrs[A.qname]=f.styleAttrs[A.qname]);else{var R=f.styleAttrs[n.byName.fontSize.qname];"textContainer"===f.styleAttrs[n.byName.ruby.qname]?v.styleAttrs[A.qname]=R:v.styleAttrs[A.qname]=new r.ComputedLength(.5*R.rw,.5*R.rh)}else{var D=f.styleAttrs[n.byName.fontSize.qname];v.styleAttrs[A.qname]=new r.ComputedLength(.5*D.rw,.5*D.rh)}}for(var N=0;N<n.all.length;N++){var O=n.all[N];if(!(O.qname in v.styleAttrs)&&!(O.qname===n.byName.position.qname&&n.byName.origin.qname in v.styleAttrs||O.qname===n.byName.origin.qname&&n.byName.position.qname in v.styleAttrs)){var P=e.head.styling.initials[O.qname]||O.initial;if(null!==P&&("region"===v.kind||!1===O.inherit&&null!==P)){var M=O.parse(P);null!==M?(v.styleAttrs[O.qname]=M,T[O.qname]=!0):c(g,"Invalid initial value for '"+O.qname+"' on element '"+v.kind)}}}for(var x=0;x<n.all.length;x++){var L=n.all[x];if(L.qname in T&&null!==L.compute){var k=L.compute(e,f,v,v.styleAttrs[L.qname],m);null!==k?v.styleAttrs[L.qname]=k:(v.styleAttrs[L.qname]=L.compute(e,f,v,L.parse(L.initial),m),c(g,"Style '"+L.qname+"' on element '"+v.kind+"' cannot be computed"))}}if("none"===v.styleAttrs[n.byName.display.qname])return null;var F=null;null===f?F=null===d?[]:[d]:"contents"in p&&(F=p.contents);for(var U=0;null!==F&&U<F.length;U++){var B=a(e,t,l,d,v,y,F[U],g,m);null!==B&&v.contents.push(B.element)}for(var j in v.styleAttrs)if(v.styleAttrs.hasOwnProperty(j)){var q=!1;if("span"===v.kind){var H=v.styleAttrs[n.byName.ruby.qname];(q=("container"===H||"textContainer"===H||"baseContainer"===H)&&-1!==i.indexOf(j))||(q="container"!==H&&j===n.byName.rubyAlign.qname),q||(q=!("textContainer"===H||"text"===H)&&j===n.byName.rubyPosition.qname)}if(!q){var G=n.byQName[j];"applies"in G&&(q=-1===G.applies.indexOf(v.kind))}q&&delete v.styleAttrs[j]}var V=v.styleAttrs[n.byName.ruby.qname];if("p"===v.kind||"span"===v.kind&&("textContainer"===V||"text"===V)){var Y=[];s(v,Y),function(e){for(var t,n=0;n<e.length;)if("br"!==(t=e[n]).kind&&"preserve"!==t.space){var r=t.text.replace(/[\t\r\n ]+/g," ");/^[ ]/.test(r)&&(0===n||"br"===(i=e[n-1]).kind||/[\r\n\t ]$/.test(i.text))&&(r=r.substring(1)),t.text=r,0===r.length?e.splice(n,1):n++}else n++;var i,a;for(n=0;n<e.length;n++)"br"!==(t=e[n]).kind&&"preserve"!==t.space?/[ ]$/.test(t.text)&&(n===e.length-1||"br"===(a=e[n+1]).kind||"preserve"===a.space&&/^[\r\n]/.test(a.text))&&(t.text=t.text.slice(0,-1)):n++}(Y),o(v)}return"div"===v.kind&&n.byName.backgroundImage.qname in v.styleAttrs||"br"===v.kind||"image"===v.kind||"contents"in v&&v.contents.length>0||"span"===v.kind&&null!==v.text||"region"===v.kind&&"always"===v.styleAttrs[n.byName.showBackground.qname]?{region_id:y,element:v}:null}function s(e,t){if("contents"in e)for(var r=0;r<e.contents.length;r++){var i=e.contents[r],a=i.styleAttrs[n.byName.ruby.qname];("span"!==i.kind||"textContainer"!==a&&"text"!==a)&&("contents"in i?s(i,t):("span"===i.kind&&0!==i.text.length||"br"===i.kind)&&t.push(i))}}function o(e){if("br"===e.kind)return!1;if("text"in e)return 0===e.text.length;if("contents"in e){for(var t=e.contents.length;t--;)o(e.contents[t])&&e.contents.splice(t,1);return 0===e.contents.length}}function l(e){this.contents=[],this.aspectRatio=e.aspectRatio,this.lang=e.lang}function u(e){for(var t in this.kind=e.kind||"region",this.lang=e.lang,e.id&&(this.id=e.id),this.styleAttrs={},e.styleAttrs)e.styleAttrs.hasOwnProperty(t)&&(this.styleAttrs[t]=e.styleAttrs[t]);"src"in e&&(this.src=e.src),"type"in e&&(this.type=e.type),"text"in e?this.text=e.text:("region"===this.kind||"contents"in e)&&(this.contents=[]),"space"in e&&(this.space=e.space)}function c(e,t){if(e&&e.error&&e.error(t))throw t}}(t,"undefined"==typeof imscNames?n(210):imscNames,"undefined"==typeof imscStyles?n(6811):imscStyles,"undefined"==typeof imscUtils?n(5926):imscUtils)},4403:function(e,t,n){t.generateISD=n(4080).generateISD,t.fromXML=n(3362).fromXML,t.renderHTML=n(506).render},210:function(e,t){!function(e){e.ns_tt="http://www.w3.org/ns/ttml",e.ns_tts="http://www.w3.org/ns/ttml#styling",e.ns_ttp="http://www.w3.org/ns/ttml#parameter",e.ns_xml="http://www.w3.org/XML/1998/namespace",e.ns_itts="http://www.w3.org/ns/ttml/profile/imsc1#styling",e.ns_ittp="http://www.w3.org/ns/ttml/profile/imsc1#parameter",e.ns_smpte="http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt",e.ns_ebutts="urn:ebu:tt:style"}(t)},6811:function(e,t,n){!function(e,t,n){function r(e,t,n,r,i,a,s,o){this.name=t,this.ns=e,this.qname=e+" "+t,this.inherit=i,this.animatable=a,this.initial=n,this.applies=r,this.parse=s,this.compute=o}for(var i in e.all=[new r(t.ns_tts,"backgroundColor","transparent",["body","div","p","region","span"],!1,!0,n.parseColor,null),new r(t.ns_tts,"color","white",["span"],!0,!0,n.parseColor,null),new r(t.ns_tts,"direction","ltr",["p","span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"display","auto",["body","div","p","region","span"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"displayAlign","before",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"extent","auto",["tt","region"],!1,!0,(function(e){if("auto"===e)return e;var t=e.split(" ");if(2!==t.length)return null;var r=n.parseLength(t[0]),i=n.parseLength(t[1]);return i&&r?{h:i,w:r}:null}),(function(e,t,r,i,a){var s,o;if("auto"===i)s=new n.ComputedLength(0,1);else if(null===(s=n.toComputedLength(i.h.value,i.h.unit,null,e.dimensions.h,null,e.pxLength.h)))return null;if("auto"===i)o=new n.ComputedLength(1,0);else if(null===(o=n.toComputedLength(i.w.value,i.w.unit,null,e.dimensions.w,null,e.pxLength.w)))return null;return{h:s,w:o}})),new r(t.ns_tts,"fontFamily","default",["span","p"],!0,!0,(function(e){for(var t=e.split(","),n=[],r=0;r<t.length;r++)t[r]=t[r].trim(),"'"!==t[r].charAt(0)&&'"'!==t[r].charAt(0)&&"default"===t[r]?n.push("monospaceSerif"):n.push(t[r]);return n}),null),new r(t.ns_tts,"shear","0%",["p"],!0,!0,n.parseLength,(function(e,t,n,r){return"%"!==r.unit?null:Math.abs(r.value)>100?100*Math.sign(r.value):r.value})),new r(t.ns_tts,"fontSize","1c",["span","p"],!0,!0,n.parseLength,(function(t,r,i,a,s){return n.toComputedLength(a.value,a.unit,null!==r?r.styleAttrs[e.byName.fontSize.qname]:t.cellLength.h,null!==r?r.styleAttrs[e.byName.fontSize.qname]:t.cellLength.h,t.cellLength.h,t.pxLength.h)})),new r(t.ns_tts,"fontStyle","normal",["span","p"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"fontWeight","normal",["span","p"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"lineHeight","normal",["p"],!0,!0,(function(e){return"normal"===e?e:n.parseLength(e)}),(function(t,r,i,a,s){var o;if("normal"===a)o=a;else if(null===(o=n.toComputedLength(a.value,a.unit,i.styleAttrs[e.byName.fontSize.qname],i.styleAttrs[e.byName.fontSize.qname],t.cellLength.h,t.pxLength.h)))return null;return o})),new r(t.ns_tts,"opacity",1,["region"],!1,!0,parseFloat,null),new r(t.ns_tts,"origin","auto",["region"],!1,!0,(function(e){if("auto"===e)return e;var t=e.split(" ");if(2!==t.length)return null;var r=n.parseLength(t[0]),i=n.parseLength(t[1]);return i&&r?{h:i,w:r}:null}),(function(e,t,r,i,a){var s,o;if("auto"===i)s=new n.ComputedLength(0,0);else if(null===(s=n.toComputedLength(i.h.value,i.h.unit,null,e.dimensions.h,null,e.pxLength.h)))return null;if("auto"===i)o=new n.ComputedLength(0,0);else if(null===(o=n.toComputedLength(i.w.value,i.w.unit,null,e.dimensions.w,null,e.pxLength.w)))return null;return{h:s,w:o}})),new r(t.ns_tts,"overflow","hidden",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"padding","0px",["region"],!1,!0,(function(e){var t=e.split(" ");if(t.length>4)return null;for(var r=[],i=0;i<t.length;i++){var a=n.parseLength(t[i]);if(!a)return null;r.push(a)}return r}),(function(t,r,i,a,s){var o;if(1===a.length)o=[a[0],a[0],a[0],a[0]];else if(2===a.length)o=[a[0],a[1],a[0],a[1]];else if(3===a.length)o=[a[0],a[1],a[2],a[1]];else{if(4!==a.length)return null;o=[a[0],a[1],a[2],a[3]]}var l=i.styleAttrs[e.byName.writingMode.qname];if("lrtb"===l||"lr"===l)o=[o[0],o[3],o[2],o[1]];else if("rltb"===l||"rl"===l)o=[o[0],o[1],o[2],o[3]];else if("tblr"===l)o=[o[3],o[0],o[1],o[2]];else{if("tbrl"!==l&&"tb"!==l)return null;o=[o[3],o[2],o[1],o[0]]}for(var u=[],c=0;c<o.length;c++)if(0===o[c].value)u[c]=new n.ComputedLength(0,0);else if(u[c]=n.toComputedLength(o[c].value,o[c].unit,i.styleAttrs[e.byName.fontSize.qname],0===c||2===c?i.styleAttrs[e.byName.extent.qname].h:i.styleAttrs[e.byName.extent.qname].w,0===c||2===c?t.cellLength.h:t.cellLength.w,0===c||2===c?t.pxLength.h:t.pxLength.w),null===u[c])return null;return u})),new r(t.ns_tts,"position","top left",["region"],!1,!0,(function(e){return n.parsePosition(e)}),(function(t,r,i,a){var s,o;return null===(s=n.toComputedLength(a.v.offset.value,a.v.offset.unit,null,new n.ComputedLength(-i.styleAttrs[e.byName.extent.qname].h.rw,t.dimensions.h.rh-i.styleAttrs[e.byName.extent.qname].h.rh),null,t.pxLength.h))?null:("bottom"===a.v.edge&&(s=new n.ComputedLength(-s.rw-i.styleAttrs[e.byName.extent.qname].h.rw,t.dimensions.h.rh-s.rh-i.styleAttrs[e.byName.extent.qname].h.rh)),o=n.toComputedLength(a.h.offset.value,a.h.offset.unit,null,new n.ComputedLength(t.dimensions.w.rw-i.styleAttrs[e.byName.extent.qname].w.rw,-i.styleAttrs[e.byName.extent.qname].w.rh),null,t.pxLength.w),null===s?null:("right"===a.h.edge&&(o=new n.ComputedLength(t.dimensions.w.rw-o.rw-i.styleAttrs[e.byName.extent.qname].w.rw,-o.rh-i.styleAttrs[e.byName.extent.qname].w.rh)),{h:s,w:o}))})),new r(t.ns_tts,"ruby","none",["span"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"rubyAlign","center",["span"],!0,!0,(function(e){return"center"!==e&&"spaceAround"!==e?null:e}),null),new r(t.ns_tts,"rubyPosition","outside",["span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"rubyReserve","none",["p"],!0,!0,(function(e){var t=e.split(" "),r=[null,null];if(0===t.length||t.length>2)return null;if("none"!==t[0]&&"both"!==t[0]&&"after"!==t[0]&&"before"!==t[0]&&"outside"!==t[0])return null;if(r[0]=t[0],2===t.length&&"none"!==t[0]){var i=n.parseLength(t[1]);if(!i)return null;r[1]=i}return r}),(function(t,r,i,a,s){return"none"===a[0]?a:null===(o=null===a[1]?new n.ComputedLength(.5*i.styleAttrs[e.byName.fontSize.qname].rw,.5*i.styleAttrs[e.byName.fontSize.qname].rh):n.toComputedLength(a[1].value,a[1].unit,i.styleAttrs[e.byName.fontSize.qname],i.styleAttrs[e.byName.fontSize.qname],t.cellLength.h,t.pxLength.h))?null:[a[0],o];var o})),new r(t.ns_tts,"showBackground","always",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"textAlign","start",["p"],!0,!0,(function(e){return e}),(function(e,t,n,r,i){return"left"===r?"start":"right"===r?"end":r})),new r(t.ns_tts,"textCombine","none",["span"],!0,!0,(function(e){return"none"===e||"all"===e?e:null}),null),new r(t.ns_tts,"textDecoration","none",["span"],!0,!0,(function(e){return e.split(" ")}),null),new r(t.ns_tts,"textEmphasis","none",["span"],!0,!0,(function(e){for(var t=e.split(" "),r={style:null,symbol:null,color:null,position:null},i=0;i<t.length;i++)if("none"===t[i]||"auto"===t[i])r.style=t[i];else if("filled"===t[i]||"open"===t[i])r.style=t[i];else if("circle"===t[i]||"dot"===t[i]||"sesame"===t[i])r.symbol=t[i];else if("current"===t[i])r.color=t[i];else if("outside"===t[i]||"before"===t[i]||"after"===t[i])r.position=t[i];else if(r.color=n.parseColor(t[i]),null===r.color)return null;return null==r.style&&null==r.symbol?r.style="auto":(r.symbol=r.symbol||"circle",r.style=r.style||"filled"),r.position=r.position||"outside",r.color=r.color||"current",r}),null),new r(t.ns_tts,"textOutline","none",["span"],!0,!0,(function(e){if("none"===e)return e;var t={},r=e.split(" ");if(0===r.length||r.length>2)return null;var i=n.parseColor(r[0]);if(t.color=i,null!==i&&r.shift(),1!==r.length)return null;var a=n.parseLength(r[0]);return a?(t.thickness=a,t):null}),(function(t,r,i,a,s){if("none"===a)return a;var o={};return null===a.color?o.color=i.styleAttrs[e.byName.color.qname]:o.color=a.color,o.thickness=n.toComputedLength(a.thickness.value,a.thickness.unit,i.styleAttrs[e.byName.fontSize.qname],i.styleAttrs[e.byName.fontSize.qname],t.cellLength.h,t.pxLength.h),null===o.thickness?null:o})),new r(t.ns_tts,"textShadow","none",["span"],!0,!0,n.parseTextShadow,(function(t,r,i,a){if("none"===a)return a;for(var s=[],o=0;o<a.length;o++){var l={};if(l.x_off=n.toComputedLength(a[o][0].value,a[o][0].unit,null,i.styleAttrs[e.byName.fontSize.qname],null,t.pxLength.w),null===l.x_off)return null;if(l.y_off=n.toComputedLength(a[o][1].value,a[o][1].unit,null,i.styleAttrs[e.byName.fontSize.qname],null,t.pxLength.h),null===l.y_off)return null;if(null===a[o][2])l.b_radius=0;else if(l.b_radius=n.toComputedLength(a[o][2].value,a[o][2].unit,null,i.styleAttrs[e.byName.fontSize.qname],null,t.pxLength.h),null===l.b_radius)return null;null===a[o][3]?l.color=i.styleAttrs[e.byName.color.qname]:l.color=a[o][3],s.push(l)}return s})),new r(t.ns_tts,"unicodeBidi","normal",["span","p"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"visibility","visible",["body","div","p","region","span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"wrapOption","wrap",["span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"writingMode","lrtb",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"zIndex","auto",["region"],!1,!0,(function(e){var t;return"auto"===e?t=e:(t=parseInt(e),isNaN(t)&&(t=null)),t}),null),new r(t.ns_ebutts,"linePadding","0c",["p"],!0,!1,n.parseLength,(function(e,t,r,i,a){return n.toComputedLength(i.value,i.unit,null,null,e.cellLength.w,null)})),new r(t.ns_ebutts,"multiRowAlign","auto",["p"],!0,!1,(function(e){return e}),null),new r(t.ns_smpte,"backgroundImage",null,["div"],!1,!1,(function(e){return e}),null),new r(t.ns_itts,"forcedDisplay","false",["body","div","p","region","span"],!0,!0,(function(e){return"true"===e}),null),new r(t.ns_itts,"fillLineGap","false",["p"],!0,!0,(function(e){return"true"===e}),null)],e.byQName={},e.all)e.byQName[e.all[i].qname]=e.all[i];for(var a in e.byName={},e.all)e.byName[e.all[a].name]=e.all[a]}(t,"undefined"==typeof imscNames?n(210):imscNames,"undefined"==typeof imscUtils?n(5926):imscUtils)},5926:function(e,t){!function(e){var t=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?/,n=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,r=/rgba\(\s*(\d+),\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,i={transparent:[0,0,0,0],black:[0,0,0,255],silver:[192,192,192,255],gray:[128,128,128,255],white:[255,255,255,255],maroon:[128,0,0,255],red:[255,0,0,255],purple:[128,0,128,255],fuchsia:[255,0,255,255],magenta:[255,0,255,255],green:[0,128,0,255],lime:[0,255,0,255],olive:[128,128,0,255],yellow:[255,255,0,255],navy:[0,0,128,255],blue:[0,0,255,255],teal:[0,128,128,255],aqua:[0,255,255,255],cyan:[0,255,255,255]};e.parseColor=function(e){var a,s=null,o=i[e.toLowerCase()];return void 0!==o?s=o:null!==(a=t.exec(e))?s=[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16),void 0!==a[4]?parseInt(a[4],16):255]:null!==(a=n.exec(e))?s=[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),255]:null!==(a=r.exec(e))&&(s=[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),parseInt(a[4])]),s};var a=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%|rh|rw)$/;e.parseLength=function(e){var t,n=null;return null!==(t=a.exec(e))&&(n={value:parseFloat(t[1]),unit:t[2]}),n},e.parseTextShadow=function(t){for(var n=t.match(/([^\(,\)]|\([^\)]+\))+/g),r=[],i=0;i<n.length;i++){var a=n[i].split(" ");if(1===a.length&&"none"===a[0])return"none";if(a.length>1&&a.length<5){var s=[null,null,null,null],o=e.parseLength(a.shift());if(null===o)return null;if(s[0]=o,null===(o=e.parseLength(a.shift())))return null;if(s[1]=o,0===a.length){r.push(s);continue}if(null!==(o=e.parseLength(a[0]))&&(s[2]=o,a.shift()),0===a.length){r.push(s);continue}var l=e.parseColor(a[0]);if(null===l)return null;s[3]=l,r.push(s)}}return r},e.parsePosition=function(t){var n=t.split(" "),r=function(e){return"center"===e||"left"===e||"top"===e||"bottom"===e||"right"===e};if(n.length>4)return null;for(var i=0;i<n.length;i++)if(!r(n[i])){var a=e.parseLength(n[i]);if(null===a)return null;n[i]=a}for(var s={h:{edge:"left",offset:{value:50,unit:"%"}},v:{edge:"top",offset:{value:50,unit:"%"}}},o=0;o<n.length;){var l=n[o++];if(r(l)){var u={value:0,unit:"%"};2!==n.length&&o<n.length&&!r(n[o])&&(u=n[o++]),"right"===l?(s.h.edge=l,s.h.offset=u):"bottom"===l?(s.v.edge=l,s.v.offset=u):"left"===l?s.h.offset=u:"top"===l&&(s.v.offset=u)}else{if(1!==n.length&&2!==n.length)return null;1===o?s.h.offset=l:s.v.offset=l}}return s},e.ComputedLength=function(e,t){this.rw=e,this.rh=t},e.ComputedLength.prototype.toUsedLength=function(e,t){return e*this.rw+t*this.rh},e.ComputedLength.prototype.isZero=function(){return 0===this.rw&&0===this.rh},e.toComputedLength=function(t,n,r,i,a,s){return"%"===n&&i?new e.ComputedLength(i.rw*t/100,i.rh*t/100):"em"===n&&r?new e.ComputedLength(r.rw*t,r.rh*t):"c"===n&&a?new e.ComputedLength(t*a.rw,t*a.rh):"px"===n&&s?new e.ComputedLength(t*s.rw,t*s.rh):"rh"===n?new e.ComputedLength(0,t/100):"rw"===n?new e.ComputedLength(t/100,0):null}}(t)},3516:function(e){"use strict";e.exports=function(e){var t="string"==typeof e?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}},2219:function(e,t,n){"use strict";var r=n(3516),i=n(395);e.exports=function(e){return r(e)||i(e)}},395:function(e){"use strict";e.exports=function(e){var t="string"==typeof e?e.charCodeAt(0):e;return t>=48&&t<=57}},3875:function(e){"use strict";function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,r="",i=0,a=-1,s=0,o=0;o<=e.length;++o){if(o<e.length)n=e.charCodeAt(o);else{if(47===n)break;n=47}if(47===n){if(a===o-1||1===s);else if(a!==o-1&&2===s){if(r.length<2||2!==i||46!==r.charCodeAt(r.length-1)||46!==r.charCodeAt(r.length-2))if(r.length>2){var l=r.lastIndexOf("/");if(l!==r.length-1){-1===l?(r="",i=0):i=(r=r.slice(0,l)).length-1-r.lastIndexOf("/"),a=o,s=0;continue}}else if(2===r.length||1===r.length){r="",i=0,a=o,s=0;continue}t&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+e.slice(a+1,o):r=e.slice(a+1,o),i=o-a-1;a=o,s=0}else 46===n&&-1!==s?++s:s=-1}return r}var r={resolve:function(){for(var e,r="",i=!1,a=arguments.length-1;a>=-1&&!i;a--){var s;a>=0?s=arguments[a]:(void 0===e&&(e=process.cwd()),s=e),t(s),0!==s.length&&(r=s+"/"+r,i=47===s.charCodeAt(0))}return r=n(r,!i),i?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(e){if(t(e),0===e.length)return".";var r=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!r)).length||r||(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n<arguments.length;++n){var i=arguments[n];t(i),i.length>0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=r.resolve(e))===(n=r.resolve(n)))return"";for(var i=1;i<e.length&&47===e.charCodeAt(i);++i);for(var a=e.length,s=a-i,o=1;o<n.length&&47===n.charCodeAt(o);++o);for(var l=n.length-o,u=s<l?s:l,c=-1,d=0;d<=u;++d){if(d===u){if(l>u){if(47===n.charCodeAt(o+d))return n.slice(o+d+1);if(0===d)return n.slice(o+d)}else s>u&&(47===e.charCodeAt(i+d)?c=d:0===d&&(c=0));break}var f=e.charCodeAt(i+d);if(f!==n.charCodeAt(o+d))break;47===f&&(c=d)}var h="";for(d=i+c+1;d<=a;++d)d!==a&&47!==e.charCodeAt(d)||(0===h.length?h+="..":h+="/..");return h.length>0?h+n.slice(o+c):(o+=c,47===n.charCodeAt(o)&&++o,n.slice(o))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),r=47===n,i=-1,a=!0,s=e.length-1;s>=1;--s)if(47===(n=e.charCodeAt(s))){if(!a){i=s;break}}else a=!1;return-1===i?r?"/":".":r&&1===i?"//":e.slice(0,i)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var r,i=0,a=-1,s=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var o=n.length-1,l=-1;for(r=e.length-1;r>=0;--r){var u=e.charCodeAt(r);if(47===u){if(!s){i=r+1;break}}else-1===l&&(s=!1,l=r+1),o>=0&&(u===n.charCodeAt(o)?-1==--o&&(a=r):(o=-1,a=l))}return i===a?a=l:-1===a&&(a=e.length),e.slice(i,a)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!s){i=r+1;break}}else-1===a&&(s=!1,a=r+1);return-1===a?"":e.slice(i,a)},extname:function(e){t(e);for(var n=-1,r=0,i=-1,a=!0,s=0,o=e.length-1;o>=0;--o){var l=e.charCodeAt(o);if(47!==l)-1===i&&(a=!1,i=o+1),46===l?-1===n?n=o:1!==s&&(s=1):-1!==n&&(s=-1);else if(!a){r=o+1;break}}return-1===n||-1===i||0===s||1===s&&n===i-1&&n===r+1?"":e.slice(n,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+"/"+r:r}(0,e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var r,i=e.charCodeAt(0),a=47===i;a?(n.root="/",r=1):r=0;for(var s=-1,o=0,l=-1,u=!0,c=e.length-1,d=0;c>=r;--c)if(47!==(i=e.charCodeAt(c)))-1===l&&(u=!1,l=c+1),46===i?-1===s?s=c:1!==d&&(d=1):-1!==s&&(d=-1);else if(!u){o=c+1;break}return-1===s||-1===l||0===d||1===d&&s===l-1&&s===o+1?-1!==l&&(n.base=n.name=0===o&&a?e.slice(1,l):e.slice(o,l)):(0===o&&a?(n.name=e.slice(1,s),n.base=e.slice(1,l)):(n.name=e.slice(o,s),n.base=e.slice(o,l)),n.ext=e.slice(s,l)),o>0?n.dir=e.slice(0,o-1):a&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,e.exports=r},8387:function(e,t,n){var r=n(1549),i=r.Buffer;function a(e,t){for(var n in e)t[n]=e[n]}function s(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(a(r,t),t.Buffer=s),a(i,s),s.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},s.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},5378:function(e,t,n){!function(e){e.parser=function(e,t){return new i(e,t)},e.SAXParser=i,e.SAXStream=s,e.createStream=function(e,t){return new s(e,t)},e.MAX_BUFFER_LENGTH=65536;var t,r=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function i(t,n){if(!(this instanceof i))return new i(t,n);var a=this;!function(e){for(var t=0,n=r.length;t<n;t++)e[r[t]]=""}(a),a.q=a.c="",a.bufferCheckPosition=e.MAX_BUFFER_LENGTH,a.opt=n||{},a.opt.lowercase=a.opt.lowercase||a.opt.lowercasetags,a.looseCase=a.opt.lowercase?"toLowerCase":"toUpperCase",a.tags=[],a.closed=a.closedRoot=a.sawRoot=!1,a.tag=a.error=null,a.strict=!!t,a.noscript=!(!t&&!a.opt.noscript),a.state=w.BEGIN,a.strictEntities=a.opt.strictEntities,a.ENTITIES=a.strictEntities?Object.create(e.XML_ENTITIES):Object.create(e.ENTITIES),a.attribList=[],a.opt.xmlns&&(a.ns=Object.create(p)),a.trackPosition=!1!==a.opt.position,a.trackPosition&&(a.position=a.line=a.column=0),C(a,"onready")}e.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Object.create||(Object.create=function(e){function t(){}return t.prototype=e,new t}),Object.keys||(Object.keys=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}),i.prototype={end:function(){P(this)},write:function(t){var n=this;if(this.error)throw this.error;if(n.closed)return O(n,"Cannot write after close. Assign an onready handler.");if(null===t)return P(n);"object"==typeof t&&(t=t.toString());for(var i=0,a="";a=q(t,i++),n.c=a,a;)switch(n.trackPosition&&(n.position++,"\n"===a?(n.line++,n.column=0):n.column++),n.state){case w.BEGIN:if(n.state=w.BEGIN_WHITESPACE,"\ufeff"===a)continue;j(n,a);continue;case w.BEGIN_WHITESPACE:j(n,a);continue;case w.TEXT:if(n.sawRoot&&!n.closedRoot){for(var s=i-1;a&&"<"!==a&&"&"!==a;)(a=q(t,i++))&&n.trackPosition&&(n.position++,"\n"===a?(n.line++,n.column=0):n.column++);n.textNode+=t.substring(s,i-1)}"<"!==a||n.sawRoot&&n.closedRoot&&!n.strict?(!E(o,a)||n.sawRoot&&!n.closedRoot||M(n,"Text data outside of root node."),"&"===a?n.state=w.TEXT_ENTITY:n.textNode+=a):(n.state=w.OPEN_WAKA,n.startTagPosition=n.position);continue;case w.SCRIPT:"<"===a?n.state=w.SCRIPT_ENDING:n.script+=a;continue;case w.SCRIPT_ENDING:"/"===a?n.state=w.CLOSE_TAG:(n.script+="<"+a,n.state=w.SCRIPT);continue;case w.OPEN_WAKA:if("!"===a)n.state=w.SGML_DECL,n.sgmlDecl="";else if(T(o,a));else if(T(g,a))n.state=w.OPEN_TAG,n.tagName=a;else if("/"===a)n.state=w.CLOSE_TAG,n.tagName="";else if("?"===a)n.state=w.PROC_INST,n.procInstName=n.procInstBody="";else{if(M(n,"Unencoded <"),n.startTagPosition+1<n.position){var l=n.position-n.startTagPosition;a=new Array(l).join(" ")+a}n.textNode+="<"+a,n.state=w.TEXT}continue;case w.SGML_DECL:"[CDATA["===(n.sgmlDecl+a).toUpperCase()?(R(n,"onopencdata"),n.state=w.CDATA,n.sgmlDecl="",n.cdata=""):n.sgmlDecl+a==="--"?(n.state=w.COMMENT,n.comment="",n.sgmlDecl=""):"DOCTYPE"===(n.sgmlDecl+a).toUpperCase()?(n.state=w.DOCTYPE,(n.doctype||n.sawRoot)&&M(n,"Inappropriately located doctype declaration"),n.doctype="",n.sgmlDecl=""):">"===a?(R(n,"onsgmldeclaration",n.sgmlDecl),n.sgmlDecl="",n.state=w.TEXT):T(c,a)?(n.state=w.SGML_DECL_QUOTED,n.sgmlDecl+=a):n.sgmlDecl+=a;continue;case w.SGML_DECL_QUOTED:a===n.q&&(n.state=w.SGML_DECL,n.q=""),n.sgmlDecl+=a;continue;case w.DOCTYPE:">"===a?(n.state=w.TEXT,R(n,"ondoctype",n.doctype),n.doctype=!0):(n.doctype+=a,"["===a?n.state=w.DOCTYPE_DTD:T(c,a)&&(n.state=w.DOCTYPE_QUOTED,n.q=a));continue;case w.DOCTYPE_QUOTED:n.doctype+=a,a===n.q&&(n.q="",n.state=w.DOCTYPE);continue;case w.DOCTYPE_DTD:n.doctype+=a,"]"===a?n.state=w.DOCTYPE:T(c,a)&&(n.state=w.DOCTYPE_DTD_QUOTED,n.q=a);continue;case w.DOCTYPE_DTD_QUOTED:n.doctype+=a,a===n.q&&(n.state=w.DOCTYPE_DTD,n.q="");continue;case w.COMMENT:"-"===a?n.state=w.COMMENT_ENDING:n.comment+=a;continue;case w.COMMENT_ENDING:"-"===a?(n.state=w.COMMENT_ENDED,n.comment=N(n.opt,n.comment),n.comment&&R(n,"oncomment",n.comment),n.comment=""):(n.comment+="-"+a,n.state=w.COMMENT);continue;case w.COMMENT_ENDED:">"!==a?(M(n,"Malformed comment"),n.comment+="--"+a,n.state=w.COMMENT):n.state=w.TEXT;continue;case w.CDATA:"]"===a?n.state=w.CDATA_ENDING:n.cdata+=a;continue;case w.CDATA_ENDING:"]"===a?n.state=w.CDATA_ENDING_2:(n.cdata+="]"+a,n.state=w.CDATA);continue;case w.CDATA_ENDING_2:">"===a?(n.cdata&&R(n,"oncdata",n.cdata),R(n,"onclosecdata"),n.cdata="",n.state=w.TEXT):"]"===a?n.cdata+="]":(n.cdata+="]]"+a,n.state=w.CDATA);continue;case w.PROC_INST:"?"===a?n.state=w.PROC_INST_ENDING:T(o,a)?n.state=w.PROC_INST_BODY:n.procInstName+=a;continue;case w.PROC_INST_BODY:if(!n.procInstBody&&T(o,a))continue;"?"===a?n.state=w.PROC_INST_ENDING:n.procInstBody+=a;continue;case w.PROC_INST_ENDING:">"===a?(R(n,"onprocessinginstruction",{name:n.procInstName,body:n.procInstBody}),n.procInstName=n.procInstBody="",n.state=w.TEXT):(n.procInstBody+="?"+a,n.state=w.PROC_INST_BODY);continue;case w.OPEN_TAG:T(m,a)?n.tagName+=a:(x(n),">"===a?F(n):"/"===a?n.state=w.OPEN_TAG_SLASH:(E(o,a)&&M(n,"Invalid character in tag name"),n.state=w.ATTRIB));continue;case w.OPEN_TAG_SLASH:">"===a?(F(n,!0),U(n)):(M(n,"Forward-slash in opening tag not followed by >"),n.state=w.ATTRIB);continue;case w.ATTRIB:if(T(o,a))continue;">"===a?F(n):"/"===a?n.state=w.OPEN_TAG_SLASH:T(g,a)?(n.attribName=a,n.attribValue="",n.state=w.ATTRIB_NAME):M(n,"Invalid attribute name");continue;case w.ATTRIB_NAME:"="===a?n.state=w.ATTRIB_VALUE:">"===a?(M(n,"Attribute without value"),n.attribValue=n.attribName,k(n),F(n)):T(o,a)?n.state=w.ATTRIB_NAME_SAW_WHITE:T(m,a)?n.attribName+=a:M(n,"Invalid attribute name");continue;case w.ATTRIB_NAME_SAW_WHITE:if("="===a)n.state=w.ATTRIB_VALUE;else{if(T(o,a))continue;M(n,"Attribute without value"),n.tag.attributes[n.attribName]="",n.attribValue="",R(n,"onattribute",{name:n.attribName,value:""}),n.attribName="",">"===a?F(n):T(g,a)?(n.attribName=a,n.state=w.ATTRIB_NAME):(M(n,"Invalid attribute name"),n.state=w.ATTRIB)}continue;case w.ATTRIB_VALUE:if(T(o,a))continue;T(c,a)?(n.q=a,n.state=w.ATTRIB_VALUE_QUOTED):(M(n,"Unquoted attribute value"),n.state=w.ATTRIB_VALUE_UNQUOTED,n.attribValue=a);continue;case w.ATTRIB_VALUE_QUOTED:if(a!==n.q){"&"===a?n.state=w.ATTRIB_VALUE_ENTITY_Q:n.attribValue+=a;continue}k(n),n.q="",n.state=w.ATTRIB_VALUE_CLOSED;continue;case w.ATTRIB_VALUE_CLOSED:T(o,a)?n.state=w.ATTRIB:">"===a?F(n):"/"===a?n.state=w.OPEN_TAG_SLASH:T(g,a)?(M(n,"No whitespace between attributes"),n.attribName=a,n.attribValue="",n.state=w.ATTRIB_NAME):M(n,"Invalid attribute name");continue;case w.ATTRIB_VALUE_UNQUOTED:if(E(d,a)){"&"===a?n.state=w.ATTRIB_VALUE_ENTITY_U:n.attribValue+=a;continue}k(n),">"===a?F(n):n.state=w.ATTRIB;continue;case w.CLOSE_TAG:if(n.tagName)">"===a?U(n):T(m,a)?n.tagName+=a:n.script?(n.script+="</"+n.tagName,n.tagName="",n.state=w.SCRIPT):(E(o,a)&&M(n,"Invalid tagname in closing tag"),n.state=w.CLOSE_TAG_SAW_WHITE);else{if(T(o,a))continue;E(g,a)?n.script?(n.script+="</"+a,n.state=w.SCRIPT):M(n,"Invalid tagname in closing tag."):n.tagName=a}continue;case w.CLOSE_TAG_SAW_WHITE:if(T(o,a))continue;">"===a?U(n):M(n,"Invalid characters in closing tag");continue;case w.TEXT_ENTITY:case w.ATTRIB_VALUE_ENTITY_Q:case w.ATTRIB_VALUE_ENTITY_U:var u,f;switch(n.state){case w.TEXT_ENTITY:u=w.TEXT,f="textNode";break;case w.ATTRIB_VALUE_ENTITY_Q:u=w.ATTRIB_VALUE_QUOTED,f="attribValue";break;case w.ATTRIB_VALUE_ENTITY_U:u=w.ATTRIB_VALUE_UNQUOTED,f="attribValue"}";"===a?(n[f]+=B(n),n.entity="",n.state=u):T(n.entity.length?v:y,a)?n.entity+=a:(M(n,"Invalid character in entity name"),n[f]+="&"+n.entity+a,n.entity="",n.state=u);continue;default:throw new Error(n,"Unknown state: "+n.state)}return n.position>=n.bufferCheckPosition&&function(t){for(var n=Math.max(e.MAX_BUFFER_LENGTH,10),i=0,a=0,s=r.length;a<s;a++){var o=t[r[a]].length;if(o>n)switch(r[a]){case"textNode":D(t);break;case"cdata":R(t,"oncdata",t.cdata),t.cdata="";break;case"script":R(t,"onscript",t.script),t.script="";break;default:O(t,"Max buffer length exceeded: "+r[a])}i=Math.max(i,o)}var l=e.MAX_BUFFER_LENGTH-i;t.bufferCheckPosition=l+t.position}(n),n},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var e;D(e=this),""!==e.cdata&&(R(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(R(e,"onscript",e.script),e.script="")}};try{t=n(182).Stream}catch(e){t=function(){}}var a=e.EVENTS.filter((function(e){return"error"!==e&&"end"!==e}));function s(e,n){if(!(this instanceof s))return new s(e,n);t.apply(this),this._parser=new i(e,n),this.writable=!0,this.readable=!0;var r=this;this._parser.onend=function(){r.emit("end")},this._parser.onerror=function(e){r.emit("error",e),r._parser.error=null},this._decoder=null,a.forEach((function(e){Object.defineProperty(r,"on"+e,{get:function(){return r._parser["on"+e]},set:function(t){if(!t)return r.removeAllListeners(e),r._parser["on"+e]=t,t;r.on(e,t)},enumerable:!0,configurable:!1})}))}s.prototype=Object.create(t.prototype,{constructor:{value:s}}),s.prototype.write=function(e){if("function"==typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(e)){if(!this._decoder){var t=n(7503).s;this._decoder=new t("utf8")}e=this._decoder.write(e)}return this._parser.write(e.toString()),this.emit("data",e),!0},s.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},s.prototype.on=function(e,n){var r=this;return r._parser["on"+e]||-1===a.indexOf(e)||(r._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),r.emit.apply(r,t)}),t.prototype.on.call(r,e,n)};var o="\r\n\t ",l="0124356789",u="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",c="'\"",d=o+">",f="http://www.w3.org/XML/1998/namespace",h="http://www.w3.org/2000/xmlns/",p={xml:f,xmlns:h};o=_(o),l=_(l),u=_(u);var g=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,m=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/,y=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,v=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;function _(e){return e.split("").reduce((function(e,t){return e[t]=!0,e}),{})}function T(e,t){return function(e){return"[object RegExp]"===Object.prototype.toString.call(e)}(e)?!!t.match(e):e[t]}function E(e,t){return!T(e,t)}c=_(c),d=_(d);var b,S,A,w=0;for(var I in e.STATE={BEGIN:w++,BEGIN_WHITESPACE:w++,TEXT:w++,TEXT_ENTITY:w++,OPEN_WAKA:w++,SGML_DECL:w++,SGML_DECL_QUOTED:w++,DOCTYPE:w++,DOCTYPE_QUOTED:w++,DOCTYPE_DTD:w++,DOCTYPE_DTD_QUOTED:w++,COMMENT_STARTING:w++,COMMENT:w++,COMMENT_ENDING:w++,COMMENT_ENDED:w++,CDATA:w++,CDATA_ENDING:w++,CDATA_ENDING_2:w++,PROC_INST:w++,PROC_INST_BODY:w++,PROC_INST_ENDING:w++,OPEN_TAG:w++,OPEN_TAG_SLASH:w++,ATTRIB:w++,ATTRIB_NAME:w++,ATTRIB_NAME_SAW_WHITE:w++,ATTRIB_VALUE:w++,ATTRIB_VALUE_QUOTED:w++,ATTRIB_VALUE_CLOSED:w++,ATTRIB_VALUE_UNQUOTED:w++,ATTRIB_VALUE_ENTITY_Q:w++,ATTRIB_VALUE_ENTITY_U:w++,CLOSE_TAG:w++,CLOSE_TAG_SAW_WHITE:w++,SCRIPT:w++,SCRIPT_ENDING:w++},e.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},e.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(e.ENTITIES).forEach((function(t){var n=e.ENTITIES[t],r="number"==typeof n?String.fromCharCode(n):n;e.ENTITIES[t]=r})),e.STATE)e.STATE[e.STATE[I]]=I;function C(e,t,n){e[t]&&e[t](n)}function R(e,t,n){e.textNode&&D(e),C(e,t,n)}function D(e){e.textNode=N(e.opt,e.textNode),e.textNode&&C(e,"ontext",e.textNode),e.textNode=""}function N(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function O(e,t){return D(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,C(e,"onerror",t),e}function P(e){return e.sawRoot&&!e.closedRoot&&M(e,"Unclosed root tag"),e.state!==w.BEGIN&&e.state!==w.BEGIN_WHITESPACE&&e.state!==w.TEXT&&O(e,"Unexpected end"),D(e),e.c="",e.closed=!0,C(e,"onend"),i.call(e,e.strict,e.opt),e}function M(e,t){if("object"!=typeof e||!(e instanceof i))throw new Error("bad call to strictFail");e.strict&&O(e,t)}function x(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,n=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(n.ns=t.ns),e.attribList.length=0,R(e,"onopentagstart",n)}function L(e,t){var n=e.indexOf(":")<0?["",e]:e.split(":"),r=n[0],i=n[1];return t&&"xmlns"===e&&(r="xmlns",i=""),{prefix:r,local:i}}function k(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue="";else{if(e.opt.xmlns){var t=L(e.attribName,!0),n=t.prefix,r=t.local;if("xmlns"===n)if("xml"===r&&e.attribValue!==f)M(e,"xml: prefix must be bound to "+f+"\nActual: "+e.attribValue);else if("xmlns"===r&&e.attribValue!==h)M(e,"xmlns: prefix must be bound to "+h+"\nActual: "+e.attribValue);else{var i=e.tag,a=e.tags[e.tags.length-1]||e;i.ns===a.ns&&(i.ns=Object.create(a.ns)),i.ns[r]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,R(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}}function F(e,t){if(e.opt.xmlns){var n=e.tag,r=L(e.tagName);n.prefix=r.prefix,n.local=r.local,n.uri=n.ns[r.prefix]||"",n.prefix&&!n.uri&&(M(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),n.uri=r.prefix);var i=e.tags[e.tags.length-1]||e;n.ns&&i.ns!==n.ns&&Object.keys(n.ns).forEach((function(t){R(e,"onopennamespace",{prefix:t,uri:n.ns[t]})}));for(var a=0,s=e.attribList.length;a<s;a++){var o=e.attribList[a],l=o[0],u=o[1],c=L(l,!0),d=c.prefix,f=c.local,h=""===d?"":n.ns[d]||"",p={name:l,value:u,prefix:d,local:f,uri:h};d&&"xmlns"!==d&&!h&&(M(e,"Unbound namespace prefix: "+JSON.stringify(d)),p.uri=d),e.tag.attributes[l]=p,R(e,"onattribute",p)}e.attribList.length=0}e.tag.isSelfClosing=!!t,e.sawRoot=!0,e.tags.push(e.tag),R(e,"onopentag",e.tag),t||(e.noscript||"script"!==e.tagName.toLowerCase()?e.state=w.TEXT:e.state=w.SCRIPT,e.tag=null,e.tagName=""),e.attribName=e.attribValue="",e.attribList.length=0}function U(e){if(!e.tagName)return M(e,"Weird empty close tag."),e.textNode+="</>",void(e.state=w.TEXT);if(e.script){if("script"!==e.tagName)return e.script+="</"+e.tagName+">",e.tagName="",void(e.state=w.SCRIPT);R(e,"onscript",e.script),e.script=""}var t=e.tags.length,n=e.tagName;e.strict||(n=n[e.looseCase]());for(var r=n;t--&&e.tags[t].name!==r;)M(e,"Unexpected close tag");if(t<0)return M(e,"Unmatched closing tag: "+e.tagName),e.textNode+="</"+e.tagName+">",void(e.state=w.TEXT);e.tagName=n;for(var i=e.tags.length;i-- >t;){var a=e.tag=e.tags.pop();e.tagName=e.tag.name,R(e,"onclosetag",e.tagName);var s={};for(var o in a.ns)s[o]=a.ns[o];var l=e.tags[e.tags.length-1]||e;e.opt.xmlns&&a.ns!==l.ns&&Object.keys(a.ns).forEach((function(t){var n=a.ns[t];R(e,"onclosenamespace",{prefix:t,uri:n})}))}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=w.TEXT}function B(e){var t,n=e.entity,r=n.toLowerCase(),i="";return e.ENTITIES[n]?e.ENTITIES[n]:e.ENTITIES[r]?e.ENTITIES[r]:("#"===(n=r).charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),i=(t=parseInt(n,16)).toString(16)):(n=n.slice(1),i=(t=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,""),i.toLowerCase()!==n?(M(e,"Invalid character entity"),"&"+e.entity+";"):String.fromCodePoint(t))}function j(e,t){"<"===t?(e.state=w.OPEN_WAKA,e.startTagPosition=e.position):E(o,t)&&(M(e,"Non-whitespace before first tag."),e.textNode=t,e.state=w.TEXT)}function q(e,t){var n="";return t<e.length&&(n=e.charAt(t)),n}w=e.STATE,String.fromCodePoint||(b=String.fromCharCode,S=Math.floor,A=function(){var e,t,n=[],r=-1,i=arguments.length;if(!i)return"";for(var a="";++r<i;){var s=Number(arguments[r]);if(!isFinite(s)||s<0||s>1114111||S(s)!==s)throw RangeError("Invalid code point: "+s);s<=65535?n.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,n.push(e,t)),(r+1===i||n.length>16384)&&(a+=b.apply(null,n),n.length=0)}return a},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:A,configurable:!0,writable:!0}):String.fromCodePoint=A)}(t)},182:function(e,t,n){e.exports=i;var r=n(1159).EventEmitter;function i(){r.call(this)}n(1765)(i,r),i.Readable=n(2846),i.Writable=n(8318),i.Duplex=n(6138),i.Transform=n(9798),i.PassThrough=n(5472),i.finished=n(8800),i.pipeline=n(7295),i.Stream=i,i.prototype.pipe=function(e,t){var n=this;function i(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function a(){n.readable&&n.resume&&n.resume()}n.on("data",i),e.on("drain",a),e._isStdio||t&&!1===t.end||(n.on("end",o),n.on("close",l));var s=!1;function o(){s||(s=!0,e.end())}function l(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(c(),0===r.listenerCount(this,"error"))throw e}function c(){n.removeListener("data",i),e.removeListener("drain",a),n.removeListener("end",o),n.removeListener("close",l),n.removeListener("error",u),e.removeListener("error",u),n.removeListener("end",c),n.removeListener("close",c),e.removeListener("close",c)}return n.on("error",u),e.on("error",u),n.on("end",c),n.on("close",c),e.on("close",c),e.emit("pipe",n),e}},1765:function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},3690:function(e){"use strict";var t={};function n(e,n,r){r||(r=Error);var i=function(e){var t,r;function i(t,r,i){return e.call(this,function(e,t,r){return"string"==typeof n?n:n(e,t,r)}(t,r,i))||this}return r=e,(t=i).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,i}(r);i.prototype.name=r.name,i.prototype.code=e,t[e]=i}function r(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map((function(e){return String(e)})),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}n("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(e,t,n){var i,a,s,o,l;if("string"==typeof t&&(a="not ",t.substr(0,4)===a)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-9,n)===t}(e," argument"))s="The ".concat(e," ").concat(i," ").concat(r(t,"type"));else{var u=("number"!=typeof l&&(l=0),l+1>(o=e).length||-1===o.indexOf(".",l)?"argument":"property");s='The "'.concat(e,'" ').concat(u," ").concat(i," ").concat(r(t,"type"))}return s+". Received type ".concat(typeof n)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},6138:function(e,t,n){"use strict";var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=u;var i=n(2846),a=n(8318);n(1765)(u,i);for(var s=r(a.prototype),o=0;o<s.length;o++){var l=s[o];u.prototype[l]||(u.prototype[l]=a.prototype[l])}function u(e){if(!(this instanceof u))return new u(e);i.call(this,e),a.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",c)))}function c(){this._writableState.ended||process.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},5472:function(e,t,n){"use strict";e.exports=i;var r=n(9798);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}n(1765)(i,r),i.prototype._transform=function(e,t,n){n(null,e)}},2846:function(e,t,n){"use strict";var r;e.exports=A,A.ReadableState=S,n(1159).EventEmitter;var i,a=function(e,t){return e.listeners(t).length},s=n(9299),o=n(1549).Buffer,l=n.g.Uint8Array||function(){},u=n(964);i=u&&u.debuglog?u.debuglog("stream"):function(){};var c,d,f,h=n(8393),p=n(6163),g=n(7269).getHighWaterMark,m=n(3690).q,y=m.ERR_INVALID_ARG_TYPE,v=m.ERR_STREAM_PUSH_AFTER_EOF,_=m.ERR_METHOD_NOT_IMPLEMENTED,T=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(1765)(A,s);var E=p.errorOrDestroy,b=["error","close","destroy","pause","resume"];function S(e,t,i){r=r||n(6138),e=e||{},"boolean"!=typeof i&&(i=t instanceof r),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,"readableHighWaterMark",i),this.buffer=new h,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(c||(c=n(7503).s),this.decoder=new c(e.encoding),this.encoding=e.encoding)}function A(e){if(r=r||n(6138),!(this instanceof A))return new A(e);var t=this instanceof r;this._readableState=new S(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),s.call(this)}function w(e,t,n,r,a){i("readableAddChunk",t);var s,u=e._readableState;if(null===t)u.reading=!1,function(e,t){if(i("onEofChunk"),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?D(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,N(e)))}}(e,u);else if(a||(s=function(e,t){var n,r;return r=t,o.isBuffer(r)||r instanceof l||"string"==typeof t||void 0===t||e.objectMode||(n=new y("chunk",["string","Buffer","Uint8Array"],t)),n}(u,t)),s)E(e,s);else if(u.objectMode||t&&t.length>0)if("string"==typeof t||u.objectMode||Object.getPrototypeOf(t)===o.prototype||(t=function(e){return o.from(e)}(t)),r)u.endEmitted?E(e,new T):I(e,u,t,!0);else if(u.ended)E(e,new v);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!n?(t=u.decoder.write(t),u.objectMode||0!==t.length?I(e,u,t,!1):O(e,u)):I(e,u,t,!1)}else r||(u.reading=!1,O(e,u));return!u.ended&&(u.length<u.highWaterMark||0===u.length)}function I(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&D(e)),O(e,t)}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),A.prototype.destroy=p.destroy,A.prototype._undestroy=p.undestroy,A.prototype._destroy=function(e,t){t(e)},A.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=o.from(e,t),t=""),n=!0),w(this,e,t,!1,n)},A.prototype.unshift=function(e){return w(this,e,null,!0,!1)},A.prototype.isPaused=function(){return!1===this._readableState.flowing},A.prototype.setEncoding=function(e){c||(c=n(7503).s);var t=new c(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";null!==r;)i+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var C=1073741824;function R(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=C?e=C:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function D(e){var t=e._readableState;i("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(i("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(N,e))}function N(e){var t=e._readableState;i("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,k(e)}function O(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(P,e,t))}function P(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var n=t.length;if(i("maybeReadMore read 0"),e.read(0),n===t.length)break}t.readingMore=!1}function M(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function x(e){i("readable nexttick read 0"),e.read(0)}function L(e,t){i("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),k(e),t.flowing&&!t.reading&&e.read(0)}function k(e){var t=e._readableState;for(i("flow",t.flowing);t.flowing&&null!==e.read(););}function F(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function U(e){var t=e._readableState;i("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(B,t,e))}function B(e,t){if(i("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function j(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}A.prototype.read=function(e){i("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return i("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?U(this):D(this),null;if(0===(e=R(e,t))&&t.ended)return 0===t.length&&U(this),null;var r,a=t.needReadable;return i("need readable",a),(0===t.length||t.length-e<t.highWaterMark)&&i("length less than watermark",a=!0),t.ended||t.reading?i("reading or ended",a=!1):a&&(i("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=R(n,t))),null===(r=e>0?F(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&U(this)),null!==r&&this.emit("data",r),r},A.prototype._read=function(e){E(this,new _("_read()"))},A.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,i("pipe count=%d opts=%j",r.pipesCount,t);var s=t&&!1===t.end||e===process.stdout||e===process.stderr?p:o;function o(){i("onend"),e.end()}r.endEmitted?process.nextTick(s):n.once("end",s),e.on("unpipe",(function t(a,s){i("onunpipe"),a===n&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,i("cleanup"),e.removeListener("close",f),e.removeListener("finish",h),e.removeListener("drain",l),e.removeListener("error",d),e.removeListener("unpipe",t),n.removeListener("end",o),n.removeListener("end",p),n.removeListener("data",c),u=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}));var l=function(e){return function(){var t=e._readableState;i("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&a(e,"data")&&(t.flowing=!0,k(e))}}(n);e.on("drain",l);var u=!1;function c(t){i("ondata");var a=e.write(t);i("dest.write",a),!1===a&&((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==j(r.pipes,e))&&!u&&(i("false write response, pause",r.awaitDrain),r.awaitDrain++),n.pause())}function d(t){i("onerror",t),p(),e.removeListener("error",d),0===a(e,"error")&&E(e,t)}function f(){e.removeListener("finish",h),p()}function h(){i("onfinish"),e.removeListener("close",f),p()}function p(){i("unpipe"),n.unpipe(e)}return n.on("data",c),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",d),e.once("close",f),e.once("finish",h),e.emit("pipe",n),r.flowing||(i("pipe resume"),n.resume()),e},A.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)r[a].emit("unpipe",this,{hasUnpiped:!1});return this}var s=j(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},A.prototype.on=function(e,t){var n=s.prototype.on.call(this,e,t),r=this._readableState;return"data"===e?(r.readableListening=this.listenerCount("readable")>0,!1!==r.flowing&&this.resume()):"readable"===e&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,i("on readable",r.length,r.reading),r.length?D(this):r.reading||process.nextTick(x,this))),n},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(e,t){var n=s.prototype.removeListener.call(this,e,t);return"readable"===e&&process.nextTick(M,this),n},A.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(M,this),t},A.prototype.resume=function(){var e=this._readableState;return e.flowing||(i("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(L,e,t))}(this,e)),e.paused=!1,this},A.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var a in e.on("end",(function(){if(i("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(a){i("wrapped data"),n.decoder&&(a=n.decoder.write(a)),n.objectMode&&null==a||(n.objectMode||a&&a.length)&&(t.push(a)||(r=!0,e.pause()))})),e)void 0===this[a]&&"function"==typeof e[a]&&(this[a]=function(t){return function(){return e[t].apply(e,arguments)}}(a));for(var s=0;s<b.length;s++)e.on(b[s],this.emit.bind(this,b[s]));return this._read=function(t){i("wrapped _read",t),r&&(r=!1,e.resume())},this},"function"==typeof Symbol&&(A.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=n(7299)),d(this)}),Object.defineProperty(A.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(A.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(A.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),A._fromList=F,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(A.from=function(e,t){return void 0===f&&(f=n(6233)),f(A,e,t)})},9798:function(e,t,n){"use strict";e.exports=c;var r=n(3690).q,i=r.ERR_METHOD_NOT_IMPLEMENTED,a=r.ERR_MULTIPLE_CALLBACK,s=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=r.ERR_TRANSFORM_WITH_LENGTH_0,l=n(6138);function u(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new a);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function c(e){if(!(this instanceof c))return new c(e);l.call(this,e),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",d)}function d(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?f(this,null,null):this._flush((function(t,n){f(e,t,n)}))}function f(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new o;if(e._transformState.transforming)throw new s;return e.push(null)}n(1765)(c,l),c.prototype.push=function(e,t){return this._transformState.needTransform=!1,l.prototype.push.call(this,e,t)},c.prototype._transform=function(e,t,n){n(new i("_transform()"))},c.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},c.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},c.prototype._destroy=function(e,t){l.prototype._destroy.call(this,e,(function(e){t(e)}))}},8318:function(e,t,n){"use strict";function r(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;for(e.entry=null;r;){var i=r.callback;t.pendingcb--,i(void 0),r=r.next}t.corkedRequestsFree.next=e}(t,e)}}var i;e.exports=A,A.WritableState=S;var a,s={deprecate:n(7839)},o=n(9299),l=n(1549).Buffer,u=n.g.Uint8Array||function(){},c=n(6163),d=n(7269).getHighWaterMark,f=n(3690).q,h=f.ERR_INVALID_ARG_TYPE,p=f.ERR_METHOD_NOT_IMPLEMENTED,g=f.ERR_MULTIPLE_CALLBACK,m=f.ERR_STREAM_CANNOT_PIPE,y=f.ERR_STREAM_DESTROYED,v=f.ERR_STREAM_NULL_VALUES,_=f.ERR_STREAM_WRITE_AFTER_END,T=f.ERR_UNKNOWN_ENCODING,E=c.errorOrDestroy;function b(){}function S(e,t,a){i=i||n(6138),e=e||{},"boolean"!=typeof a&&(a=t instanceof i),this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=d(this,e,"writableHighWaterMark",a),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if("function"!=typeof i)throw new g;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(process.nextTick(i,r),process.nextTick(N,e,t),e._writableState.errorEmitted=!0,E(e,r)):(i(r),e._writableState.errorEmitted=!0,E(e,r),N(e,t))}(e,n,r,t,i);else{var a=R(n)||e.destroyed;a||n.corked||n.bufferProcessing||!n.bufferedRequest||C(e,n),r?process.nextTick(I,e,n,a,i):I(e,n,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}function A(e){var t=this instanceof(i=i||n(6138));if(!t&&!a.call(A,this))return new A(e);this._writableState=new S(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),o.call(this)}function w(e,t,n,r,i,a,s){t.writelen=r,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new y("write")):n?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function I(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),N(e,t)}function C(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var i=t.bufferedRequestCount,a=new Array(i),s=t.corkedRequestsFree;s.entry=n;for(var o=0,l=!0;n;)a[o]=n,n.isBuf||(l=!1),n=n.next,o+=1;a.allBuffers=l,w(e,t,!0,t.length,a,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new r(t),t.bufferedRequestCount=0}else{for(;n;){var u=n.chunk,c=n.encoding,d=n.callback;if(w(e,t,!1,t.objectMode?1:u.length,u,c,d),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function R(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function D(e,t){e._final((function(n){t.pendingcb--,n&&E(e,n),t.prefinished=!0,e.emit("prefinish"),N(e,t)}))}function N(e,t){var n=R(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,process.nextTick(D,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}n(1765)(A,o),S.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(S.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(a=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(e){return!!a.call(this,e)||this===A&&e&&e._writableState instanceof S}})):a=function(e){return e instanceof this},A.prototype.pipe=function(){E(this,new m)},A.prototype.write=function(e,t,n){var r,i=this._writableState,a=!1,s=!i.objectMode&&(r=e,l.isBuffer(r)||r instanceof u);return s&&!l.isBuffer(e)&&(e=function(e){return l.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=b),i.ending?function(e,t){var n=new _;E(e,n),process.nextTick(t,n)}(this,n):(s||function(e,t,n,r){var i;return null===n?i=new v:"string"==typeof n||t.objectMode||(i=new h("chunk",["string","Buffer"],n)),!i||(E(e,i),process.nextTick(r,i),!1)}(this,i,e,n))&&(i.pendingcb++,a=function(e,t,n,r,i,a){if(!n){var s=function(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=l.from(t,n)),t}(t,r,i);r!==s&&(n=!0,i="buffer",r=s)}var o=t.objectMode?1:r.length;t.length+=o;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:a,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else w(e,t,!1,o,r,i,a);return u}(this,i,s,e,t,n)),a},A.prototype.cork=function(){this._writableState.corked++},A.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||C(this,e))},A.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new T(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(e,t,n){n(new p("_write()"))},A.prototype._writev=null,A.prototype.end=function(e,t,n){var r=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,n){t.ending=!0,N(e,t),n&&(t.finished?process.nextTick(n):e.once("finish",n)),t.ended=!0,e.writable=!1}(this,r,n),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),A.prototype.destroy=c.destroy,A.prototype._undestroy=c.undestroy,A.prototype._destroy=function(e,t){t(e)}},7299:function(e,t,n){"use strict";var r;function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a=n(8800),s=Symbol("lastResolve"),o=Symbol("lastReject"),l=Symbol("error"),u=Symbol("ended"),c=Symbol("lastPromise"),d=Symbol("handlePromise"),f=Symbol("stream");function h(e,t){return{value:e,done:t}}function p(e){var t=e[s];if(null!==t){var n=e[f].read();null!==n&&(e[c]=null,e[s]=null,e[o]=null,t(h(n,!1)))}}function g(e){process.nextTick(p,e)}var m=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((i(r={get stream(){return this[f]},next:function(){var e=this,t=this[l];if(null!==t)return Promise.reject(t);if(this[u])return Promise.resolve(h(void 0,!0));if(this[f].destroyed)return new Promise((function(t,n){process.nextTick((function(){e[l]?n(e[l]):t(h(void 0,!0))}))}));var n,r=this[c];if(r)n=new Promise(function(e,t){return function(n,r){e.then((function(){t[u]?n(h(void 0,!0)):t[d](n,r)}),r)}}(r,this));else{var i=this[f].read();if(null!==i)return Promise.resolve(h(i,!1));n=new Promise(this[d])}return this[c]=n,n}},Symbol.asyncIterator,(function(){return this})),i(r,"return",(function(){var e=this;return new Promise((function(t,n){e[f].destroy(null,(function(e){e?n(e):t(h(void 0,!0))}))}))})),r),m);e.exports=function(e){var t,n=Object.create(y,(i(t={},f,{value:e,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,o,{value:null,writable:!0}),i(t,l,{value:null,writable:!0}),i(t,u,{value:e._readableState.endEmitted,writable:!0}),i(t,d,{value:function(e,t){var r=n[f].read();r?(n[c]=null,n[s]=null,n[o]=null,e(h(r,!1))):(n[s]=e,n[o]=t)},writable:!0}),t));return n[c]=null,a(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[o];return null!==t&&(n[c]=null,n[s]=null,n[o]=null,t(e)),void(n[l]=e)}var r=n[s];null!==r&&(n[c]=null,n[s]=null,n[o]=null,r(h(void 0,!0))),n[u]=!0})),e.on("readable",g.bind(null,n)),n}},8393:function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a=n(1549).Buffer,s=n(9862).inspect,o=s&&s.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t;return t=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t,n,r,i=a.allocUnsafe(e>>>0),s=this.head,o=0;s;)t=s.data,n=i,r=o,a.prototype.copy.call(t,n,r),o+=s.data.length,s=s.next;return i}},{key:"consume",value:function(e,t){var n;return e<this.head.data.length?(n=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):n=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,n=1,r=t.data;for(e-=r.length;t=t.next;){var i=t.data,a=e>i.length?i.length:e;if(a===i.length?r+=i:r+=i.slice(0,e),0==(e-=a)){a===i.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(a));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var i=n.data,s=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,s),0==(e-=s)){s===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(s));break}++r}return this.length-=r,t}},{key:o,value:function(e,t){return s(this,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}],t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}()},6163:function(e){"use strict";function t(e,t){r(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function r(e,t){e.emit("error",t)}e.exports={destroy:function(e,i){var a=this,s=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return s||o?(i?i(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(r,this,e)):process.nextTick(r,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!i&&e?a._writableState?a._writableState.errorEmitted?process.nextTick(n,a):(a._writableState.errorEmitted=!0,process.nextTick(t,a,e)):process.nextTick(t,a,e):i?(process.nextTick(n,a),i(e)):process.nextTick(n,a)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit("error",t)}}},8800:function(e,t,n){"use strict";var r=n(3690).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,n,a){if("function"==typeof n)return e(t,null,n);n||(n={}),a=function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];e.apply(this,r)}}}(a||i);var s=n.readable||!1!==n.readable&&t.readable,o=n.writable||!1!==n.writable&&t.writable,l=function(){t.writable||c()},u=t._writableState&&t._writableState.finished,c=function(){o=!1,u=!0,s||a.call(t)},d=t._readableState&&t._readableState.endEmitted,f=function(){s=!1,d=!0,o||a.call(t)},h=function(e){a.call(t,e)},p=function(){var e;return s&&!d?(t._readableState&&t._readableState.ended||(e=new r),a.call(t,e)):o&&!u?(t._writableState&&t._writableState.ended||(e=new r),a.call(t,e)):void 0},g=function(){t.req.on("finish",c)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",c),t.on("abort",p),t.req?g():t.on("request",g)):o&&!t._writableState&&(t.on("end",l),t.on("close",l)),t.on("end",f),t.on("finish",c),!1!==n.error&&t.on("error",h),t.on("close",p),function(){t.removeListener("complete",c),t.removeListener("abort",p),t.removeListener("request",g),t.req&&t.req.removeListener("finish",c),t.removeListener("end",l),t.removeListener("close",l),t.removeListener("finish",c),t.removeListener("end",f),t.removeListener("error",h),t.removeListener("close",p)}}},6233:function(e){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},7295:function(e,t,n){"use strict";var r,i=n(3690).q,a=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function o(e){if(e)throw e}function l(e,t,i,a){a=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(a);var o=!1;e.on("close",(function(){o=!0})),void 0===r&&(r=n(8800)),r(e,{readable:t,writable:i},(function(e){if(e)return a(e);o=!0,a()}));var l=!1;return function(t){if(!o&&!l)return l=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void a(t||new s("pipe"))}}function u(e){e()}function c(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=function(e){return e.length?"function"!=typeof e[e.length-1]?o:e.pop():o}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new a("streams");var s=t.map((function(e,n){var a=n<t.length-1;return l(e,a,n>0,(function(e){r||(r=e),e&&s.forEach(u),a||(s.forEach(u),i(r))}))}));return t.reduce(c)}},7269:function(e,t,n){"use strict";var r=n(3690).q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,n,i){var a=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,i,n);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new r(i?n:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}}},9299:function(e,t,n){e.exports=n(1159).EventEmitter},7503:function(e,t,n){"use strict";var r=n(8387).Buffer,i=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=u,t=4;break;case"utf8":this.fillLast=o,t=4;break;case"base64":this.text=c,this.end=d,t=3;break;default:return this.write=f,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function o(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function c(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.s=a,a.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},a.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},a.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=s(t[r]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--r<n||-2===i?0:(i=s(t[r]))>=0?(i>0&&(e.lastNeed=i-2),i):--r<n||-2===i?0:(i=s(t[r]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},1067:function(e,t,n){var r;!function(i,a){"use strict";var s="function",o="undefined",l="object",u="string",c="major",d="model",f="name",h="type",p="vendor",g="version",m="architecture",y="console",v="mobile",_="tablet",T="smarttv",E="wearable",b="embedded",S="Amazon",A="Apple",w="ASUS",I="BlackBerry",C="Browser",R="Chrome",D="Firefox",N="Google",O="Huawei",P="LG",M="Microsoft",x="Motorola",L="Opera",k="Samsung",F="Sharp",U="Sony",B="Xiaomi",j="Zebra",q="Facebook",H="Chromium OS",G="Mac OS",V=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},Y=function(e,t){return typeof e===u&&-1!==Z(t).indexOf(Z(e))},Z=function(e){return e.toLowerCase()},K=function(e,t){if(typeof e===u)return e=e.replace(/^\s\s*/,""),typeof t===o?e:e.substring(0,500)},z=function(e,t){for(var n,r,i,o,u,c,d=0;d<t.length&&!u;){var f=t[d],h=t[d+1];for(n=r=0;n<f.length&&!u&&f[n];)if(u=f[n++].exec(e))for(i=0;i<h.length;i++)c=u[++r],typeof(o=h[i])===l&&o.length>0?2===o.length?typeof o[1]==s?this[o[0]]=o[1].call(this,c):this[o[0]]=o[1]:3===o.length?typeof o[1]!==s||o[1].exec&&o[1].test?this[o[0]]=c?c.replace(o[1],o[2]):a:this[o[0]]=c?o[1].call(this,c,o[2]):a:4===o.length&&(this[o[0]]=c?o[3].call(this,c.replace(o[1],o[2])):a):this[o]=c||a;d+=2}},W=function(e,t){for(var n in t)if(typeof t[n]===l&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(Y(t[n][r],e))return"?"===n?a:n}else if(Y(t[n],e))return"?"===n?a:n;return e},X={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},$={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[g,[f,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[g,[f,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[f,g],[/opios[\/ ]+([\w\.]+)/i],[g,[f,L+" Mini"]],[/\bopr\/([\w\.]+)/i],[g,[f,L]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[g,[f,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[f,g],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[g,[f,"UC"+C]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[g,[f,"WeChat"]],[/konqueror\/([\w\.]+)/i],[g,[f,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[g,[f,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[g,[f,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[g,[f,"Smart Lenovo "+C]],[/(avast|avg)\/([\w\.]+)/i],[[f,/(.+)/,"$1 Secure "+C],g],[/\bfocus\/([\w\.]+)/i],[g,[f,D+" Focus"]],[/\bopt\/([\w\.]+)/i],[g,[f,L+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[g,[f,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[g,[f,"Dolphin"]],[/coast\/([\w\.]+)/i],[g,[f,L+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[g,[f,"MIUI "+C]],[/fxios\/([-\w\.]+)/i],[g,[f,D]],[/\bqihu|(qi?ho?o?|360)browser/i],[[f,"360 "+C]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[f,/(.+)/,"$1 "+C],g],[/samsungbrowser\/([\w\.]+)/i],[g,[f,k+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[f,/_/g," "],g],[/metasr[\/ ]?([\d\.]+)/i],[g,[f,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[f,"Sogou Mobile"],g],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[f,g],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[f],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[f,q],g],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[f,g],[/\bgsa\/([\w\.]+) .*safari\//i],[g,[f,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[g,[f,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[g,[f,R+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[f,R+" WebView"],g],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[g,[f,"Android "+C]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[f,g],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[g,[f,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[g,f],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[f,[g,W,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[f,g],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[f,"Netscape"],g],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[g,[f,D+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[f,g],[/(cobalt)\/([\w\.]+)/i],[f,[g,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[m,"amd64"]],[/(ia32(?=;))/i],[[m,Z]],[/((?:i[346]|x)86)[;\)]/i],[[m,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[m,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[m,"armhf"]],[/windows (ce|mobile); ppc;/i],[[m,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[m,/ower/,"",Z]],[/(sun4\w)[;\)]/i],[[m,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[m,Z]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[d,[p,k],[h,_]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[d,[p,k],[h,v]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[d,[p,A],[h,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[d,[p,A],[h,_]],[/(macintosh);/i],[d,[p,A]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[d,[p,F],[h,v]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[d,[p,O],[h,_]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[d,[p,O],[h,v]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[d,/_/g," "],[p,B],[h,v]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[d,/_/g," "],[p,B],[h,_]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[d,[p,"OPPO"],[h,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[d,[p,"Vivo"],[h,v]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[d,[p,"Realme"],[h,v]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[d,[p,x],[h,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[d,[p,x],[h,_]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[d,[p,P],[h,_]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[d,[p,P],[h,v]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[d,[p,"Lenovo"],[h,_]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[d,/_/g," "],[p,"Nokia"],[h,v]],[/(pixel c)\b/i],[d,[p,N],[h,_]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[d,[p,N],[h,v]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[d,[p,U],[h,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[d,"Xperia Tablet"],[p,U],[h,_]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[d,[p,"OnePlus"],[h,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[d,[p,S],[h,_]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[d,/(.+)/g,"Fire Phone $1"],[p,S],[h,v]],[/(playbook);[-\w\),; ]+(rim)/i],[d,p,[h,_]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[d,[p,I],[h,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[d,[p,w],[h,_]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[d,[p,w],[h,v]],[/(nexus 9)/i],[d,[p,"HTC"],[h,_]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[p,[d,/_/g," "],[h,v]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[d,[p,"Acer"],[h,_]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[d,[p,"Meizu"],[h,v]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[d,[p,"Ulefone"],[h,v]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[p,d,[h,v]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[p,d,[h,_]],[/(surface duo)/i],[d,[p,M],[h,_]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[d,[p,"Fairphone"],[h,v]],[/(u304aa)/i],[d,[p,"AT&T"],[h,v]],[/\bsie-(\w*)/i],[d,[p,"Siemens"],[h,v]],[/\b(rct\w+) b/i],[d,[p,"RCA"],[h,_]],[/\b(venue[\d ]{2,7}) b/i],[d,[p,"Dell"],[h,_]],[/\b(q(?:mv|ta)\w+) b/i],[d,[p,"Verizon"],[h,_]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[d,[p,"Barnes & Noble"],[h,_]],[/\b(tm\d{3}\w+) b/i],[d,[p,"NuVision"],[h,_]],[/\b(k88) b/i],[d,[p,"ZTE"],[h,_]],[/\b(nx\d{3}j) b/i],[d,[p,"ZTE"],[h,v]],[/\b(gen\d{3}) b.+49h/i],[d,[p,"Swiss"],[h,v]],[/\b(zur\d{3}) b/i],[d,[p,"Swiss"],[h,_]],[/\b((zeki)?tb.*\b) b/i],[d,[p,"Zeki"],[h,_]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[p,"Dragon Touch"],d,[h,_]],[/\b(ns-?\w{0,9}) b/i],[d,[p,"Insignia"],[h,_]],[/\b((nxa|next)-?\w{0,9}) b/i],[d,[p,"NextBook"],[h,_]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[p,"Voice"],d,[h,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[p,"LvTel"],d,[h,v]],[/\b(ph-1) /i],[d,[p,"Essential"],[h,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[d,[p,"Envizen"],[h,_]],[/\b(trio[-\w\. ]+) b/i],[d,[p,"MachSpeed"],[h,_]],[/\btu_(1491) b/i],[d,[p,"Rotor"],[h,_]],[/(shield[\w ]+) b/i],[d,[p,"Nvidia"],[h,_]],[/(sprint) (\w+)/i],[p,d,[h,v]],[/(kin\.[onetw]{3})/i],[[d,/\./g," "],[p,M],[h,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[d,[p,j],[h,_]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[d,[p,j],[h,v]],[/smart-tv.+(samsung)/i],[p,[h,T]],[/hbbtv.+maple;(\d+)/i],[[d,/^/,"SmartTV"],[p,k],[h,T]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[p,P],[h,T]],[/(apple) ?tv/i],[p,[d,A+" TV"],[h,T]],[/crkey/i],[[d,R+"cast"],[p,N],[h,T]],[/droid.+aft(\w+)( bui|\))/i],[d,[p,S],[h,T]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[d,[p,F],[h,T]],[/(bravia[\w ]+)( bui|\))/i],[d,[p,U],[h,T]],[/(mitv-\w{5}) bui/i],[d,[p,B],[h,T]],[/Hbbtv.*(technisat) (.*);/i],[p,d,[h,T]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[p,K],[d,K],[h,T]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[h,T]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[p,d,[h,y]],[/droid.+; (shield) bui/i],[d,[p,"Nvidia"],[h,y]],[/(playstation [345portablevi]+)/i],[d,[p,U],[h,y]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[d,[p,M],[h,y]],[/((pebble))app/i],[p,d,[h,E]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[d,[p,A],[h,E]],[/droid.+; (glass) \d/i],[d,[p,N],[h,E]],[/droid.+; (wt63?0{2,3})\)/i],[d,[p,j],[h,E]],[/(quest( 2| pro)?)/i],[d,[p,q],[h,E]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[p,[h,b]],[/(aeobc)\b/i],[d,[p,S],[h,b]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[d,[h,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[d,[h,_]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[h,_]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[h,v]],[/(android[-\w\. ]{0,9});.+buil/i],[d,[p,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[g,[f,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[g,[f,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[f,g],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[g,f]],os:[[/microsoft (windows) (vista|xp)/i],[f,g],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[f,[g,W,X]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[g,W,X],[f,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[g,/_/g,"."],[f,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[f,G],[g,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[g,f],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[f,g],[/\(bb(10);/i],[g,[f,I]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[g,[f,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[g,[f,D+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[g,[f,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[g,[f,"watchOS"]],[/crkey\/([\d\.]+)/i],[g,[f,R+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[f,H],g],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[f,g],[/(sunos) ?([\w\.\d]*)/i],[[f,"Solaris"],g],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[f,g]]},Q=function(e,t){if(typeof e===l&&(t=e,e=a),!(this instanceof Q))return new Q(e,t).getResult();var n=typeof i!==o&&i.navigator?i.navigator:a,r=e||(n&&n.userAgent?n.userAgent:""),y=n&&n.userAgentData?n.userAgentData:a,T=t?function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n}($,t):$,E=n&&n.userAgent==r;return this.getBrowser=function(){var e,t={};return t[f]=a,t[g]=a,z.call(t,r,T.browser),t[c]=typeof(e=t[g])===u?e.replace(/[^\d\.]/g,"").split(".")[0]:a,E&&n&&n.brave&&typeof n.brave.isBrave==s&&(t[f]="Brave"),t},this.getCPU=function(){var e={};return e[m]=a,z.call(e,r,T.cpu),e},this.getDevice=function(){var e={};return e[p]=a,e[d]=a,e[h]=a,z.call(e,r,T.device),E&&!e[h]&&y&&y.mobile&&(e[h]=v),E&&"Macintosh"==e[d]&&n&&typeof n.standalone!==o&&n.maxTouchPoints&&n.maxTouchPoints>2&&(e[d]="iPad",e[h]=_),e},this.getEngine=function(){var e={};return e[f]=a,e[g]=a,z.call(e,r,T.engine),e},this.getOS=function(){var e={};return e[f]=a,e[g]=a,z.call(e,r,T.os),E&&!e[f]&&y&&"Unknown"!=y.platform&&(e[f]=y.platform.replace(/chrome os/i,H).replace(/macos/i,G)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return r},this.setUA=function(e){return r=typeof e===u&&e.length>500?K(e,500):e,this},this.setUA(r),this};Q.VERSION="1.0.37",Q.BROWSER=V([f,g,c]),Q.CPU=V([m]),Q.DEVICE=V([d,p,h,y,v,T,_,E,b]),Q.ENGINE=Q.OS=V([f,g]),typeof t!==o?(e.exports&&(t=e.exports=Q),t.UAParser=Q):n.amdO?(r=function(){return Q}.call(t,n,t,e))===a||(e.exports=r):typeof i!==o&&(i.UAParser=Q);var J=typeof i!==o&&(i.jQuery||i.Zepto);if(J&&!J.ua){var ee=new Q;J.ua=ee.getResult(),J.ua.get=function(){return ee.getUA()},J.ua.set=function(e){ee.setUA(e);var t=ee.getResult();for(var n in t)J.ua[n]=t[n]}}}("object"==typeof window?window:this)},7839:function(e,t,n){function r(e){try{if(!n.g.localStorage)return!1}catch(e){return!1}var t=n.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}},9862:function(){},964:function(){},3165:function(e){"use strict";e.exports=JSON.parse('["mni-beng-in","mni-mtei-in","sat-deva-in","sat-olck-in","shi-latn-ma","shi-tfng-ma","vai-latn-lr","vai-vaii-lr","yue-hans-cn","yue-hant-hk","az-arab-ir","az-cyrl-az","az-latn-az","bm-nkoo-ml","bs-cyrl-ba","bs-latn-ba","en-dsrt-us","ff-adlm-gn","ff-latn-sn","ha-arab-ng","hi-latn-in","iu-latn-ca","ks-arab-in","ks-deva-in","mn-mong-cn","ms-arab-my","pa-arab-pk","pa-guru-in","sd-arab-pk","sd-deva-in","sr-cyrl-rs","sr-latn-rs","su-latn-id","uz-arab-af","uz-cyrl-uz","uz-latn-uz","zh-hans-cn","zh-hant-tw","mni-beng","sat-olck","shi-tfng","vai-vaii","yue-hant","az-latn","bs-latn","ff-latn","jbo-001","ks-arab","pa-guru","prg-001","sd-arab","sr-cyrl","su-latn","uz-latn","zh-hans","agq-cm","ar-001","arn-cl","asa-tz","ast-es","bas-cm","bem-zm","bez-tz","bgn-pk","blt-vn","brx-in","bss-cm","byn-er","cad-us","cch-ng","ccp-bd","ceb-ph","cgg-ug","chr-us","cic-us","ckb-iq","dav-ke","dje-ne","doi-in","dsb-de","dua-cm","dyo-sn","ebu-ke","eo-001","ewo-cm","fil-ph","fur-it","gaa-gh","gez-et","gsw-ch","guz-ke","haw-us","hsb-de","ia-001","ife-tg","io-001","jgo-cm","jmc-tz","kab-dz","kaj-ng","kam-ke","kcg-ng","kde-tz","kea-cv","ken-cm","khq-ml","kkj-cm","kln-ke","kok-in","kpe-lr","ksb-tz","ksf-cm","ksh-de","lag-tz","lkt-us","lrc-ir","luo-ke","luy-ke","mai-in","mas-ke","mer-ke","mfe-mu","mgh-mz","mgo-cm","moh-ca","mua-cm","mus-us","myv-ru","mzn-ir","naq-na","nds-de","nmg-cm","nnh-cm","nqo-gn","nso-za","nus-ss","nyn-ug","osa-us","pcm-ng","quc-gt","rof-tz","rwk-tz","sah-ru","saq-ke","sbp-tz","scn-it","sdh-ir","seh-mz","ses-ml","sid-et","sma-se","smj-se","smn-fi","sms-fi","ssy-er","syr-iq","szl-pl","teo-ug","tig-er","trv-tw","trw-pk","twq-ne","tzm-ma","vo-001","vun-tz","wae-ch","wal-et","wbp-au","xog-ug","yav-cm","yi-001","zgh-ma","aa-et","af-za","ak-gh","am-et","an-es","as-in","ba-ru","be-by","bg-bg","bm-ml","bn-bd","bo-cn","br-fr","ca-es","ce-ru","co-fr","cs-cz","cu-ru","cv-ru","cy-gb","da-dk","de-de","dv-mv","dz-bt","ee-gh","el-gr","en-us","es-es","et-ee","eu-es","fa-ir","fi-fi","fo-fo","fr-fr","fy-nl","ga-ie","gd-gb","gl-es","gn-py","gu-in","gv-im","ha-ng","he-il","hi-in","hr-hr","hu-hu","hy-am","id-id","ig-ng","ii-cn","is-is","it-it","iu-ca","ja-jp","jv-id","ka-ge","ki-ke","kk-kz","kl-gl","km-kh","kn-in","ko-kr","ku-tr","kw-gb","ky-kg","lb-lu","lg-ug","ln-cd","lo-la","lt-lt","lu-cd","lv-lv","mg-mg","mi-nz","mk-mk","ml-in","mn-mn","mr-in","ms-my","mt-mt","my-mm","nb-no","nd-zw","ne-np","nl-nl","nn-no","nr-za","nv-us","ny-mw","oc-fr","om-et","or-in","os-ge","pl-pl","ps-af","pt-br","qu-pe","rm-ch","rn-bi","ro-ro","ru-ru","rw-rw","sa-in","sc-it","se-no","sg-cf","si-lk","sk-sk","sl-si","sn-zw","so-so","sq-al","ss-za","st-za","sv-se","sw-tz","ta-in","te-in","tg-tj","th-th","ti-et","tk-tm","tn-za","to-to","tr-tr","ts-za","tt-ru","ug-cn","uk-ua","ur-pk","ve-za","vi-vn","wa-be","wo-sn","xh-za","yo-ng","zu-za"]')},5813:function(e){"use strict";e.exports=JSON.parse('[{"from":{"field":"script","value":"qaai"},"to":{"field":"script","value":"zinh"}},{"from":{"field":"region","value":"bu"},"to":{"field":"region","value":"mm"}},{"from":{"field":"region","value":"ct"},"to":{"field":"region","value":"ki"}},{"from":{"field":"region","value":"dd"},"to":{"field":"region","value":"de"}},{"from":{"field":"region","value":"dy"},"to":{"field":"region","value":"bj"}},{"from":{"field":"region","value":"fx"},"to":{"field":"region","value":"fr"}},{"from":{"field":"region","value":"hv"},"to":{"field":"region","value":"bf"}},{"from":{"field":"region","value":"jt"},"to":{"field":"region","value":"um"}},{"from":{"field":"region","value":"mi"},"to":{"field":"region","value":"um"}},{"from":{"field":"region","value":"nh"},"to":{"field":"region","value":"vu"}},{"from":{"field":"region","value":"nq"},"to":{"field":"region","value":"aq"}},{"from":{"field":"region","value":"pu"},"to":{"field":"region","value":"um"}},{"from":{"field":"region","value":"pz"},"to":{"field":"region","value":"pa"}},{"from":{"field":"region","value":"qu"},"to":{"field":"region","value":"eu"}},{"from":{"field":"region","value":"rh"},"to":{"field":"region","value":"zw"}},{"from":{"field":"region","value":"tp"},"to":{"field":"region","value":"tl"}},{"from":{"field":"region","value":"uk"},"to":{"field":"region","value":"gb"}},{"from":{"field":"region","value":"vd"},"to":{"field":"region","value":"vn"}},{"from":{"field":"region","value":"wk"},"to":{"field":"region","value":"um"}},{"from":{"field":"region","value":"yd"},"to":{"field":"region","value":"ye"}},{"from":{"field":"region","value":"zr"},"to":{"field":"region","value":"cd"}},{"from":{"field":"region","value":"230"},"to":{"field":"region","value":"et"}},{"from":{"field":"region","value":"280"},"to":{"field":"region","value":"de"}},{"from":{"field":"region","value":"736"},"to":{"field":"region","value":"sd"}},{"from":{"field":"region","value":"886"},"to":{"field":"region","value":"ye"}},{"from":{"field":"region","value":"958"},"to":{"field":"region","value":"aa"}},{"from":{"field":"region","value":"020"},"to":{"field":"region","value":"ad"}},{"from":{"field":"region","value":"784"},"to":{"field":"region","value":"ae"}},{"from":{"field":"region","value":"004"},"to":{"field":"region","value":"af"}},{"from":{"field":"region","value":"028"},"to":{"field":"region","value":"ag"}},{"from":{"field":"region","value":"660"},"to":{"field":"region","value":"ai"}},{"from":{"field":"region","value":"008"},"to":{"field":"region","value":"al"}},{"from":{"field":"region","value":"051"},"to":{"field":"region","value":"am"}},{"from":{"field":"region","value":"024"},"to":{"field":"region","value":"ao"}},{"from":{"field":"region","value":"010"},"to":{"field":"region","value":"aq"}},{"from":{"field":"region","value":"032"},"to":{"field":"region","value":"ar"}},{"from":{"field":"region","value":"016"},"to":{"field":"region","value":"as"}},{"from":{"field":"region","value":"040"},"to":{"field":"region","value":"at"}},{"from":{"field":"region","value":"036"},"to":{"field":"region","value":"au"}},{"from":{"field":"region","value":"533"},"to":{"field":"region","value":"aw"}},{"from":{"field":"region","value":"248"},"to":{"field":"region","value":"ax"}},{"from":{"field":"region","value":"031"},"to":{"field":"region","value":"az"}},{"from":{"field":"region","value":"070"},"to":{"field":"region","value":"ba"}},{"from":{"field":"region","value":"052"},"to":{"field":"region","value":"bb"}},{"from":{"field":"region","value":"050"},"to":{"field":"region","value":"bd"}},{"from":{"field":"region","value":"056"},"to":{"field":"region","value":"be"}},{"from":{"field":"region","value":"854"},"to":{"field":"region","value":"bf"}},{"from":{"field":"region","value":"100"},"to":{"field":"region","value":"bg"}},{"from":{"field":"region","value":"048"},"to":{"field":"region","value":"bh"}},{"from":{"field":"region","value":"108"},"to":{"field":"region","value":"bi"}},{"from":{"field":"region","value":"204"},"to":{"field":"region","value":"bj"}},{"from":{"field":"region","value":"652"},"to":{"field":"region","value":"bl"}},{"from":{"field":"region","value":"060"},"to":{"field":"region","value":"bm"}},{"from":{"field":"region","value":"096"},"to":{"field":"region","value":"bn"}},{"from":{"field":"region","value":"068"},"to":{"field":"region","value":"bo"}},{"from":{"field":"region","value":"535"},"to":{"field":"region","value":"bq"}},{"from":{"field":"region","value":"076"},"to":{"field":"region","value":"br"}},{"from":{"field":"region","value":"044"},"to":{"field":"region","value":"bs"}},{"from":{"field":"region","value":"064"},"to":{"field":"region","value":"bt"}},{"from":{"field":"region","value":"104"},"to":{"field":"region","value":"mm"}},{"from":{"field":"region","value":"074"},"to":{"field":"region","value":"bv"}},{"from":{"field":"region","value":"072"},"to":{"field":"region","value":"bw"}},{"from":{"field":"region","value":"112"},"to":{"field":"region","value":"by"}},{"from":{"field":"region","value":"084"},"to":{"field":"region","value":"bz"}},{"from":{"field":"region","value":"124"},"to":{"field":"region","value":"ca"}},{"from":{"field":"region","value":"166"},"to":{"field":"region","value":"cc"}},{"from":{"field":"region","value":"180"},"to":{"field":"region","value":"cd"}},{"from":{"field":"region","value":"140"},"to":{"field":"region","value":"cf"}},{"from":{"field":"region","value":"178"},"to":{"field":"region","value":"cg"}},{"from":{"field":"region","value":"756"},"to":{"field":"region","value":"ch"}},{"from":{"field":"region","value":"384"},"to":{"field":"region","value":"ci"}},{"from":{"field":"region","value":"184"},"to":{"field":"region","value":"ck"}},{"from":{"field":"region","value":"152"},"to":{"field":"region","value":"cl"}},{"from":{"field":"region","value":"120"},"to":{"field":"region","value":"cm"}},{"from":{"field":"region","value":"156"},"to":{"field":"region","value":"cn"}},{"from":{"field":"region","value":"170"},"to":{"field":"region","value":"co"}},{"from":{"field":"region","value":"188"},"to":{"field":"region","value":"cr"}},{"from":{"field":"region","value":"192"},"to":{"field":"region","value":"cu"}},{"from":{"field":"region","value":"132"},"to":{"field":"region","value":"cv"}},{"from":{"field":"region","value":"531"},"to":{"field":"region","value":"cw"}},{"from":{"field":"region","value":"162"},"to":{"field":"region","value":"cx"}},{"from":{"field":"region","value":"196"},"to":{"field":"region","value":"cy"}},{"from":{"field":"region","value":"203"},"to":{"field":"region","value":"cz"}},{"from":{"field":"region","value":"278"},"to":{"field":"region","value":"de"}},{"from":{"field":"region","value":"276"},"to":{"field":"region","value":"de"}},{"from":{"field":"region","value":"262"},"to":{"field":"region","value":"dj"}},{"from":{"field":"region","value":"208"},"to":{"field":"region","value":"dk"}},{"from":{"field":"region","value":"212"},"to":{"field":"region","value":"dm"}},{"from":{"field":"region","value":"214"},"to":{"field":"region","value":"do"}},{"from":{"field":"region","value":"012"},"to":{"field":"region","value":"dz"}},{"from":{"field":"region","value":"218"},"to":{"field":"region","value":"ec"}},{"from":{"field":"region","value":"233"},"to":{"field":"region","value":"ee"}},{"from":{"field":"region","value":"818"},"to":{"field":"region","value":"eg"}},{"from":{"field":"region","value":"732"},"to":{"field":"region","value":"eh"}},{"from":{"field":"region","value":"232"},"to":{"field":"region","value":"er"}},{"from":{"field":"region","value":"724"},"to":{"field":"region","value":"es"}},{"from":{"field":"region","value":"231"},"to":{"field":"region","value":"et"}},{"from":{"field":"region","value":"246"},"to":{"field":"region","value":"fi"}},{"from":{"field":"region","value":"242"},"to":{"field":"region","value":"fj"}},{"from":{"field":"region","value":"238"},"to":{"field":"region","value":"fk"}},{"from":{"field":"region","value":"583"},"to":{"field":"region","value":"fm"}},{"from":{"field":"region","value":"234"},"to":{"field":"region","value":"fo"}},{"from":{"field":"region","value":"250"},"to":{"field":"region","value":"fr"}},{"from":{"field":"region","value":"249"},"to":{"field":"region","value":"fr"}},{"from":{"field":"region","value":"266"},"to":{"field":"region","value":"ga"}},{"from":{"field":"region","value":"826"},"to":{"field":"region","value":"gb"}},{"from":{"field":"region","value":"308"},"to":{"field":"region","value":"gd"}},{"from":{"field":"region","value":"268"},"to":{"field":"region","value":"ge"}},{"from":{"field":"region","value":"254"},"to":{"field":"region","value":"gf"}},{"from":{"field":"region","value":"831"},"to":{"field":"region","value":"gg"}},{"from":{"field":"region","value":"288"},"to":{"field":"region","value":"gh"}},{"from":{"field":"region","value":"292"},"to":{"field":"region","value":"gi"}},{"from":{"field":"region","value":"304"},"to":{"field":"region","value":"gl"}},{"from":{"field":"region","value":"270"},"to":{"field":"region","value":"gm"}},{"from":{"field":"region","value":"324"},"to":{"field":"region","value":"gn"}},{"from":{"field":"region","value":"312"},"to":{"field":"region","value":"gp"}},{"from":{"field":"region","value":"226"},"to":{"field":"region","value":"gq"}},{"from":{"field":"region","value":"300"},"to":{"field":"region","value":"gr"}},{"from":{"field":"region","value":"239"},"to":{"field":"region","value":"gs"}},{"from":{"field":"region","value":"320"},"to":{"field":"region","value":"gt"}},{"from":{"field":"region","value":"316"},"to":{"field":"region","value":"gu"}},{"from":{"field":"region","value":"624"},"to":{"field":"region","value":"gw"}},{"from":{"field":"region","value":"328"},"to":{"field":"region","value":"gy"}},{"from":{"field":"region","value":"344"},"to":{"field":"region","value":"hk"}},{"from":{"field":"region","value":"334"},"to":{"field":"region","value":"hm"}},{"from":{"field":"region","value":"340"},"to":{"field":"region","value":"hn"}},{"from":{"field":"region","value":"191"},"to":{"field":"region","value":"hr"}},{"from":{"field":"region","value":"332"},"to":{"field":"region","value":"ht"}},{"from":{"field":"region","value":"348"},"to":{"field":"region","value":"hu"}},{"from":{"field":"region","value":"360"},"to":{"field":"region","value":"id"}},{"from":{"field":"region","value":"372"},"to":{"field":"region","value":"ie"}},{"from":{"field":"region","value":"376"},"to":{"field":"region","value":"il"}},{"from":{"field":"region","value":"833"},"to":{"field":"region","value":"im"}},{"from":{"field":"region","value":"356"},"to":{"field":"region","value":"in"}},{"from":{"field":"region","value":"086"},"to":{"field":"region","value":"io"}},{"from":{"field":"region","value":"368"},"to":{"field":"region","value":"iq"}},{"from":{"field":"region","value":"364"},"to":{"field":"region","value":"ir"}},{"from":{"field":"region","value":"352"},"to":{"field":"region","value":"is"}},{"from":{"field":"region","value":"380"},"to":{"field":"region","value":"it"}},{"from":{"field":"region","value":"832"},"to":{"field":"region","value":"je"}},{"from":{"field":"region","value":"388"},"to":{"field":"region","value":"jm"}},{"from":{"field":"region","value":"400"},"to":{"field":"region","value":"jo"}},{"from":{"field":"region","value":"392"},"to":{"field":"region","value":"jp"}},{"from":{"field":"region","value":"404"},"to":{"field":"region","value":"ke"}},{"from":{"field":"region","value":"417"},"to":{"field":"region","value":"kg"}},{"from":{"field":"region","value":"116"},"to":{"field":"region","value":"kh"}},{"from":{"field":"region","value":"296"},"to":{"field":"region","value":"ki"}},{"from":{"field":"region","value":"174"},"to":{"field":"region","value":"km"}},{"from":{"field":"region","value":"659"},"to":{"field":"region","value":"kn"}},{"from":{"field":"region","value":"408"},"to":{"field":"region","value":"kp"}},{"from":{"field":"region","value":"410"},"to":{"field":"region","value":"kr"}},{"from":{"field":"region","value":"414"},"to":{"field":"region","value":"kw"}},{"from":{"field":"region","value":"136"},"to":{"field":"region","value":"ky"}},{"from":{"field":"region","value":"398"},"to":{"field":"region","value":"kz"}},{"from":{"field":"region","value":"418"},"to":{"field":"region","value":"la"}},{"from":{"field":"region","value":"422"},"to":{"field":"region","value":"lb"}},{"from":{"field":"region","value":"662"},"to":{"field":"region","value":"lc"}},{"from":{"field":"region","value":"438"},"to":{"field":"region","value":"li"}},{"from":{"field":"region","value":"144"},"to":{"field":"region","value":"lk"}},{"from":{"field":"region","value":"430"},"to":{"field":"region","value":"lr"}},{"from":{"field":"region","value":"426"},"to":{"field":"region","value":"ls"}},{"from":{"field":"region","value":"440"},"to":{"field":"region","value":"lt"}},{"from":{"field":"region","value":"442"},"to":{"field":"region","value":"lu"}},{"from":{"field":"region","value":"428"},"to":{"field":"region","value":"lv"}},{"from":{"field":"region","value":"434"},"to":{"field":"region","value":"ly"}},{"from":{"field":"region","value":"504"},"to":{"field":"region","value":"ma"}},{"from":{"field":"region","value":"492"},"to":{"field":"region","value":"mc"}},{"from":{"field":"region","value":"498"},"to":{"field":"region","value":"md"}},{"from":{"field":"region","value":"499"},"to":{"field":"region","value":"me"}},{"from":{"field":"region","value":"663"},"to":{"field":"region","value":"mf"}},{"from":{"field":"region","value":"450"},"to":{"field":"region","value":"mg"}},{"from":{"field":"region","value":"584"},"to":{"field":"region","value":"mh"}},{"from":{"field":"region","value":"807"},"to":{"field":"region","value":"mk"}},{"from":{"field":"region","value":"466"},"to":{"field":"region","value":"ml"}},{"from":{"field":"region","value":"496"},"to":{"field":"region","value":"mn"}},{"from":{"field":"region","value":"446"},"to":{"field":"region","value":"mo"}},{"from":{"field":"region","value":"580"},"to":{"field":"region","value":"mp"}},{"from":{"field":"region","value":"474"},"to":{"field":"region","value":"mq"}},{"from":{"field":"region","value":"478"},"to":{"field":"region","value":"mr"}},{"from":{"field":"region","value":"500"},"to":{"field":"region","value":"ms"}},{"from":{"field":"region","value":"470"},"to":{"field":"region","value":"mt"}},{"from":{"field":"region","value":"480"},"to":{"field":"region","value":"mu"}},{"from":{"field":"region","value":"462"},"to":{"field":"region","value":"mv"}},{"from":{"field":"region","value":"454"},"to":{"field":"region","value":"mw"}},{"from":{"field":"region","value":"484"},"to":{"field":"region","value":"mx"}},{"from":{"field":"region","value":"458"},"to":{"field":"region","value":"my"}},{"from":{"field":"region","value":"508"},"to":{"field":"region","value":"mz"}},{"from":{"field":"region","value":"516"},"to":{"field":"region","value":"na"}},{"from":{"field":"region","value":"540"},"to":{"field":"region","value":"nc"}},{"from":{"field":"region","value":"562"},"to":{"field":"region","value":"ne"}},{"from":{"field":"region","value":"574"},"to":{"field":"region","value":"nf"}},{"from":{"field":"region","value":"566"},"to":{"field":"region","value":"ng"}},{"from":{"field":"region","value":"558"},"to":{"field":"region","value":"ni"}},{"from":{"field":"region","value":"528"},"to":{"field":"region","value":"nl"}},{"from":{"field":"region","value":"578"},"to":{"field":"region","value":"no"}},{"from":{"field":"region","value":"524"},"to":{"field":"region","value":"np"}},{"from":{"field":"region","value":"520"},"to":{"field":"region","value":"nr"}},{"from":{"field":"region","value":"570"},"to":{"field":"region","value":"nu"}},{"from":{"field":"region","value":"554"},"to":{"field":"region","value":"nz"}},{"from":{"field":"region","value":"512"},"to":{"field":"region","value":"om"}},{"from":{"field":"region","value":"591"},"to":{"field":"region","value":"pa"}},{"from":{"field":"region","value":"604"},"to":{"field":"region","value":"pe"}},{"from":{"field":"region","value":"258"},"to":{"field":"region","value":"pf"}},{"from":{"field":"region","value":"598"},"to":{"field":"region","value":"pg"}},{"from":{"field":"region","value":"608"},"to":{"field":"region","value":"ph"}},{"from":{"field":"region","value":"586"},"to":{"field":"region","value":"pk"}},{"from":{"field":"region","value":"616"},"to":{"field":"region","value":"pl"}},{"from":{"field":"region","value":"666"},"to":{"field":"region","value":"pm"}},{"from":{"field":"region","value":"612"},"to":{"field":"region","value":"pn"}},{"from":{"field":"region","value":"630"},"to":{"field":"region","value":"pr"}},{"from":{"field":"region","value":"275"},"to":{"field":"region","value":"ps"}},{"from":{"field":"region","value":"620"},"to":{"field":"region","value":"pt"}},{"from":{"field":"region","value":"585"},"to":{"field":"region","value":"pw"}},{"from":{"field":"region","value":"600"},"to":{"field":"region","value":"py"}},{"from":{"field":"region","value":"634"},"to":{"field":"region","value":"qa"}},{"from":{"field":"region","value":"959"},"to":{"field":"region","value":"qm"}},{"from":{"field":"region","value":"960"},"to":{"field":"region","value":"qn"}},{"from":{"field":"region","value":"962"},"to":{"field":"region","value":"qp"}},{"from":{"field":"region","value":"963"},"to":{"field":"region","value":"qq"}},{"from":{"field":"region","value":"964"},"to":{"field":"region","value":"qr"}},{"from":{"field":"region","value":"965"},"to":{"field":"region","value":"qs"}},{"from":{"field":"region","value":"966"},"to":{"field":"region","value":"qt"}},{"from":{"field":"region","value":"967"},"to":{"field":"region","value":"eu"}},{"from":{"field":"region","value":"968"},"to":{"field":"region","value":"qv"}},{"from":{"field":"region","value":"969"},"to":{"field":"region","value":"qw"}},{"from":{"field":"region","value":"970"},"to":{"field":"region","value":"qx"}},{"from":{"field":"region","value":"971"},"to":{"field":"region","value":"qy"}},{"from":{"field":"region","value":"972"},"to":{"field":"region","value":"qz"}},{"from":{"field":"region","value":"638"},"to":{"field":"region","value":"re"}},{"from":{"field":"region","value":"642"},"to":{"field":"region","value":"ro"}},{"from":{"field":"region","value":"688"},"to":{"field":"region","value":"rs"}},{"from":{"field":"region","value":"643"},"to":{"field":"region","value":"ru"}},{"from":{"field":"region","value":"646"},"to":{"field":"region","value":"rw"}},{"from":{"field":"region","value":"682"},"to":{"field":"region","value":"sa"}},{"from":{"field":"region","value":"090"},"to":{"field":"region","value":"sb"}},{"from":{"field":"region","value":"690"},"to":{"field":"region","value":"sc"}},{"from":{"field":"region","value":"729"},"to":{"field":"region","value":"sd"}},{"from":{"field":"region","value":"752"},"to":{"field":"region","value":"se"}},{"from":{"field":"region","value":"702"},"to":{"field":"region","value":"sg"}},{"from":{"field":"region","value":"654"},"to":{"field":"region","value":"sh"}},{"from":{"field":"region","value":"705"},"to":{"field":"region","value":"si"}},{"from":{"field":"region","value":"744"},"to":{"field":"region","value":"sj"}},{"from":{"field":"region","value":"703"},"to":{"field":"region","value":"sk"}},{"from":{"field":"region","value":"694"},"to":{"field":"region","value":"sl"}},{"from":{"field":"region","value":"674"},"to":{"field":"region","value":"sm"}},{"from":{"field":"region","value":"686"},"to":{"field":"region","value":"sn"}},{"from":{"field":"region","value":"706"},"to":{"field":"region","value":"so"}},{"from":{"field":"region","value":"740"},"to":{"field":"region","value":"sr"}},{"from":{"field":"region","value":"728"},"to":{"field":"region","value":"ss"}},{"from":{"field":"region","value":"678"},"to":{"field":"region","value":"st"}},{"from":{"field":"region","value":"222"},"to":{"field":"region","value":"sv"}},{"from":{"field":"region","value":"534"},"to":{"field":"region","value":"sx"}},{"from":{"field":"region","value":"760"},"to":{"field":"region","value":"sy"}},{"from":{"field":"region","value":"748"},"to":{"field":"region","value":"sz"}},{"from":{"field":"region","value":"796"},"to":{"field":"region","value":"tc"}},{"from":{"field":"region","value":"148"},"to":{"field":"region","value":"td"}},{"from":{"field":"region","value":"260"},"to":{"field":"region","value":"tf"}},{"from":{"field":"region","value":"768"},"to":{"field":"region","value":"tg"}},{"from":{"field":"region","value":"764"},"to":{"field":"region","value":"th"}},{"from":{"field":"region","value":"762"},"to":{"field":"region","value":"tj"}},{"from":{"field":"region","value":"772"},"to":{"field":"region","value":"tk"}},{"from":{"field":"region","value":"626"},"to":{"field":"region","value":"tl"}},{"from":{"field":"region","value":"795"},"to":{"field":"region","value":"tm"}},{"from":{"field":"region","value":"788"},"to":{"field":"region","value":"tn"}},{"from":{"field":"region","value":"776"},"to":{"field":"region","value":"to"}},{"from":{"field":"region","value":"792"},"to":{"field":"region","value":"tr"}},{"from":{"field":"region","value":"780"},"to":{"field":"region","value":"tt"}},{"from":{"field":"region","value":"798"},"to":{"field":"region","value":"tv"}},{"from":{"field":"region","value":"158"},"to":{"field":"region","value":"tw"}},{"from":{"field":"region","value":"834"},"to":{"field":"region","value":"tz"}},{"from":{"field":"region","value":"804"},"to":{"field":"region","value":"ua"}},{"from":{"field":"region","value":"800"},"to":{"field":"region","value":"ug"}},{"from":{"field":"region","value":"581"},"to":{"field":"region","value":"um"}},{"from":{"field":"region","value":"840"},"to":{"field":"region","value":"us"}},{"from":{"field":"region","value":"858"},"to":{"field":"region","value":"uy"}},{"from":{"field":"region","value":"860"},"to":{"field":"region","value":"uz"}},{"from":{"field":"region","value":"336"},"to":{"field":"region","value":"va"}},{"from":{"field":"region","value":"670"},"to":{"field":"region","value":"vc"}},{"from":{"field":"region","value":"862"},"to":{"field":"region","value":"ve"}},{"from":{"field":"region","value":"092"},"to":{"field":"region","value":"vg"}},{"from":{"field":"region","value":"850"},"to":{"field":"region","value":"vi"}},{"from":{"field":"region","value":"704"},"to":{"field":"region","value":"vn"}},{"from":{"field":"region","value":"548"},"to":{"field":"region","value":"vu"}},{"from":{"field":"region","value":"876"},"to":{"field":"region","value":"wf"}},{"from":{"field":"region","value":"882"},"to":{"field":"region","value":"ws"}},{"from":{"field":"region","value":"973"},"to":{"field":"region","value":"xa"}},{"from":{"field":"region","value":"974"},"to":{"field":"region","value":"xb"}},{"from":{"field":"region","value":"975"},"to":{"field":"region","value":"xc"}},{"from":{"field":"region","value":"976"},"to":{"field":"region","value":"xd"}},{"from":{"field":"region","value":"977"},"to":{"field":"region","value":"xe"}},{"from":{"field":"region","value":"978"},"to":{"field":"region","value":"xf"}},{"from":{"field":"region","value":"979"},"to":{"field":"region","value":"xg"}},{"from":{"field":"region","value":"980"},"to":{"field":"region","value":"xh"}},{"from":{"field":"region","value":"981"},"to":{"field":"region","value":"xi"}},{"from":{"field":"region","value":"982"},"to":{"field":"region","value":"xj"}},{"from":{"field":"region","value":"983"},"to":{"field":"region","value":"xk"}},{"from":{"field":"region","value":"984"},"to":{"field":"region","value":"xl"}},{"from":{"field":"region","value":"985"},"to":{"field":"region","value":"xm"}},{"from":{"field":"region","value":"986"},"to":{"field":"region","value":"xn"}},{"from":{"field":"region","value":"987"},"to":{"field":"region","value":"xo"}},{"from":{"field":"region","value":"988"},"to":{"field":"region","value":"xp"}},{"from":{"field":"region","value":"989"},"to":{"field":"region","value":"xq"}},{"from":{"field":"region","value":"990"},"to":{"field":"region","value":"xr"}},{"from":{"field":"region","value":"991"},"to":{"field":"region","value":"xs"}},{"from":{"field":"region","value":"992"},"to":{"field":"region","value":"xt"}},{"from":{"field":"region","value":"993"},"to":{"field":"region","value":"xu"}},{"from":{"field":"region","value":"994"},"to":{"field":"region","value":"xv"}},{"from":{"field":"region","value":"995"},"to":{"field":"region","value":"xw"}},{"from":{"field":"region","value":"996"},"to":{"field":"region","value":"xx"}},{"from":{"field":"region","value":"997"},"to":{"field":"region","value":"xy"}},{"from":{"field":"region","value":"998"},"to":{"field":"region","value":"xz"}},{"from":{"field":"region","value":"720"},"to":{"field":"region","value":"ye"}},{"from":{"field":"region","value":"887"},"to":{"field":"region","value":"ye"}},{"from":{"field":"region","value":"175"},"to":{"field":"region","value":"yt"}},{"from":{"field":"region","value":"710"},"to":{"field":"region","value":"za"}},{"from":{"field":"region","value":"894"},"to":{"field":"region","value":"zm"}},{"from":{"field":"region","value":"716"},"to":{"field":"region","value":"zw"}},{"from":{"field":"region","value":"999"},"to":{"field":"region","value":"zz"}},{"from":{"field":"variants","value":"aaland"},"to":{"field":"region","value":"ax"}},{"from":{"field":"variants","value":"polytoni"},"to":{"field":"variants","value":"polyton"}},{"from":{"field":"variants","value":"heploc"},"to":{"field":"variants","value":"alalc97"}},{"from":{"field":"variants","value":"arevela"},"to":{"field":"language","value":"hy"}},{"from":{"field":"variants","value":"arevmda"},"to":{"field":"language","value":"hyw"}}]')},9460:function(e){"use strict";e.exports=JSON.parse('{"region":{"172":["ru","am","az","by","ge","kg","kz","md","tj","tm","ua","uz"],"200":["cz","sk"],"530":["cw","sx","bq"],"532":["cw","sx","bq"],"536":["sa","iq"],"582":["fm","mh","mp","pw"],"810":["ru","am","az","by","ee","ge","kz","kg","lv","lt","md","tj","tm","ua","uz"],"830":["je","gg"],"890":["rs","me","si","hr","mk","ba"],"891":["rs","me"],"an":["cw","sx","bq"],"cs":["rs","me"],"fq":["aq","tf"],"nt":["sa","iq"],"pc":["fm","mh","mp","pw"],"su":["ru","am","az","by","ee","ge","kz","kg","lv","lt","md","tj","tm","ua","uz"],"yu":["rs","me"],"062":["034","143"],"ant":["cw","sx","bq"],"scg":["rs","me"],"ntz":["sa","iq"],"sun":["ru","am","az","by","ee","ge","kz","kg","lv","lt","md","tj","tm","ua","uz"],"yug":["rs","me"]}}')},7778:function(e){"use strict";e.exports=JSON.parse('[{"from":"in","to":"id"},{"from":"iw","to":"he"},{"from":"ji","to":"yi"},{"from":"jw","to":"jv"},{"from":"mo","to":"ro"},{"from":"scc","to":"sr"},{"from":"scr","to":"hr"},{"from":"aam","to":"aas"},{"from":"adp","to":"dz"},{"from":"aue","to":"ktz"},{"from":"ayx","to":"nun"},{"from":"bgm","to":"bcg"},{"from":"bjd","to":"drl"},{"from":"ccq","to":"rki"},{"from":"cjr","to":"mom"},{"from":"cka","to":"cmr"},{"from":"cmk","to":"xch"},{"from":"coy","to":"pij"},{"from":"cqu","to":"quh"},{"from":"drh","to":"mn"},{"from":"drw","to":"fa-af"},{"from":"gav","to":"dev"},{"from":"gfx","to":"vaj"},{"from":"ggn","to":"gvr"},{"from":"gti","to":"nyc"},{"from":"guv","to":"duz"},{"from":"hrr","to":"jal"},{"from":"ibi","to":"opa"},{"from":"ilw","to":"gal"},{"from":"jeg","to":"oyb"},{"from":"kgc","to":"tdf"},{"from":"kgh","to":"kml"},{"from":"koj","to":"kwv"},{"from":"krm","to":"bmf"},{"from":"ktr","to":"dtp"},{"from":"kvs","to":"gdj"},{"from":"kwq","to":"yam"},{"from":"kxe","to":"tvd"},{"from":"kzj","to":"dtp"},{"from":"kzt","to":"dtp"},{"from":"lii","to":"raq"},{"from":"lmm","to":"rmx"},{"from":"meg","to":"cir"},{"from":"mst","to":"mry"},{"from":"mwj","to":"vaj"},{"from":"myt","to":"mry"},{"from":"nad","to":"xny"},{"from":"ncp","to":"kdz"},{"from":"nnx","to":"ngv"},{"from":"nts","to":"pij"},{"from":"oun","to":"vaj"},{"from":"pcr","to":"adx"},{"from":"pmc","to":"huw"},{"from":"pmu","to":"phr"},{"from":"ppa","to":"bfy"},{"from":"ppr","to":"lcq"},{"from":"pry","to":"prt"},{"from":"puz","to":"pub"},{"from":"sca","to":"hle"},{"from":"skk","to":"oyb"},{"from":"tdu","to":"dtp"},{"from":"thc","to":"tpo"},{"from":"thx","to":"oyb"},{"from":"tie","to":"ras"},{"from":"tkk","to":"twm"},{"from":"tlw","to":"weo"},{"from":"tmp","to":"tyj"},{"from":"tne","to":"kak"},{"from":"tnf","to":"fa-af"},{"from":"tsf","to":"taj"},{"from":"uok","to":"ema"},{"from":"xba","to":"cax"},{"from":"xia","to":"acn"},{"from":"xkh","to":"waw"},{"from":"xsj","to":"suj"},{"from":"ybd","to":"rki"},{"from":"yma","to":"lrr"},{"from":"ymt","to":"mtm"},{"from":"yos","to":"zom"},{"from":"yuu","to":"yug"},{"from":"asd","to":"snz"},{"from":"dit","to":"dif"},{"from":"llo","to":"ngt"},{"from":"myd","to":"aog"},{"from":"nns","to":"nbr"},{"from":"sgn-br","to":"bzs"},{"from":"sgn-co","to":"csn"},{"from":"sgn-de","to":"gsg"},{"from":"sgn-dk","to":"dsl"},{"from":"sgn-fr","to":"fsl"},{"from":"sgn-gb","to":"bfi"},{"from":"sgn-gr","to":"gss"},{"from":"sgn-ie","to":"isg"},{"from":"sgn-it","to":"ise"},{"from":"sgn-jp","to":"jsl"},{"from":"sgn-mx","to":"mfs"},{"from":"sgn-ni","to":"ncs"},{"from":"sgn-nl","to":"dse"},{"from":"sgn-no","to":"nsi"},{"from":"sgn-pt","to":"psr"},{"from":"sgn-se","to":"swl"},{"from":"sgn-us","to":"ase"},{"from":"sgn-za","to":"sfs"},{"from":"no-bokmal","to":"nb"},{"from":"no-nynorsk","to":"nn"},{"from":"aa-saaho","to":"ssy"},{"from":"sh","to":"sr-latn"},{"from":"cnr","to":"sr-me"},{"from":"no","to":"nb"},{"from":"tl","to":"fil"},{"from":"az-az","to":"az-latn-az"},{"from":"bs-ba","to":"bs-latn-ba"},{"from":"ha-latn-gh","to":"ha-gh"},{"from":"ha-latn-ne","to":"ha-ne"},{"from":"ha-latn-ng","to":"ha-ng"},{"from":"kk-cyrl-kz","to":"kk-kz"},{"from":"ky-cyrl-kg","to":"ky-kg"},{"from":"ks-arab-in","to":"ks-in"},{"from":"mn-cyrl-mn","to":"mn-mn"},{"from":"ms-latn-bn","to":"ms-bn"},{"from":"ms-latn-my","to":"ms-my"},{"from":"ms-latn-sg","to":"ms-sg"},{"from":"pa-in","to":"pa-guru-in"},{"from":"pa-pk","to":"pa-arab-pk"},{"from":"shi-ma","to":"shi-tfng-ma"},{"from":"sr-ba","to":"sr-cyrl-ba"},{"from":"sr-me","to":"sr-latn-me"},{"from":"sr-rs","to":"sr-cyrl-rs"},{"from":"sr-xk","to":"sr-cyrl-xk"},{"from":"tzm-latn-ma","to":"tzm-ma"},{"from":"ug-arab-cn","to":"ug-cn"},{"from":"uz-af","to":"uz-arab-af"},{"from":"uz-uz","to":"uz-latn-uz"},{"from":"vai-lr","to":"vai-vaii-lr"},{"from":"yue-cn","to":"yue-hans-cn"},{"from":"yue-hk","to":"yue-hant-hk"},{"from":"zh-cn","to":"zh-hans-cn"},{"from":"zh-hk","to":"zh-hant-hk"},{"from":"zh-mo","to":"zh-hant-mo"},{"from":"zh-sg","to":"zh-hans-sg"},{"from":"zh-tw","to":"zh-hant-tw"},{"from":"aju","to":"jrb"},{"from":"als","to":"sq"},{"from":"arb","to":"ar"},{"from":"ayr","to":"ay"},{"from":"azj","to":"az"},{"from":"bcc","to":"bal"},{"from":"bcl","to":"bik"},{"from":"bxk","to":"luy"},{"from":"bxr","to":"bua"},{"from":"cld","to":"syr"},{"from":"cmn","to":"zh"},{"from":"cwd","to":"cr"},{"from":"dgo","to":"doi"},{"from":"dhd","to":"mwr"},{"from":"dik","to":"din"},{"from":"diq","to":"zza"},{"from":"lbk","to":"bnc"},{"from":"ekk","to":"et"},{"from":"emk","to":"man"},{"from":"esk","to":"ik"},{"from":"fat","to":"ak"},{"from":"fuc","to":"ff"},{"from":"gaz","to":"om"},{"from":"gbo","to":"grb"},{"from":"gno","to":"gon"},{"from":"gug","to":"gn"},{"from":"gya","to":"gba"},{"from":"hdn","to":"hai"},{"from":"hea","to":"hmn"},{"from":"ike","to":"iu"},{"from":"kmr","to":"ku"},{"from":"knc","to":"kr"},{"from":"kng","to":"kg"},{"from":"knn","to":"kok"},{"from":"kpv","to":"kv"},{"from":"lvs","to":"lv"},{"from":"mhr","to":"chm"},{"from":"mup","to":"raj"},{"from":"khk","to":"mn"},{"from":"npi","to":"ne"},{"from":"ojg","to":"oj"},{"from":"ory","to":"or"},{"from":"pbu","to":"ps"},{"from":"pes","to":"fa"},{"from":"plt","to":"mg"},{"from":"pnb","to":"lah"},{"from":"quz","to":"qu"},{"from":"rmy","to":"rom"},{"from":"spy","to":"kln"},{"from":"src","to":"sc"},{"from":"swh","to":"sw"},{"from":"ttq","to":"tmh"},{"from":"tw","to":"ak"},{"from":"umu","to":"del"},{"from":"uzn","to":"uz"},{"from":"xpe","to":"kpe"},{"from":"xsl","to":"den"},{"from":"ydd","to":"yi"},{"from":"zai","to":"zap"},{"from":"zsm","to":"ms"},{"from":"zyb","to":"za"},{"from":"him","to":"srx"},{"from":"mnk","to":"man"},{"from":"bh","to":"bho"},{"from":"prs","to":"fa-af"},{"from":"swc","to":"sw-cd"},{"from":"aar","to":"aa"},{"from":"abk","to":"ab"},{"from":"ave","to":"ae"},{"from":"afr","to":"af"},{"from":"aka","to":"ak"},{"from":"amh","to":"am"},{"from":"arg","to":"an"},{"from":"ara","to":"ar"},{"from":"asm","to":"as"},{"from":"ava","to":"av"},{"from":"aym","to":"ay"},{"from":"aze","to":"az"},{"from":"bak","to":"ba"},{"from":"bel","to":"be"},{"from":"bul","to":"bg"},{"from":"bih","to":"bho"},{"from":"bis","to":"bi"},{"from":"bam","to":"bm"},{"from":"ben","to":"bn"},{"from":"bod","to":"bo"},{"from":"bre","to":"br"},{"from":"bos","to":"bs"},{"from":"cat","to":"ca"},{"from":"che","to":"ce"},{"from":"cha","to":"ch"},{"from":"cos","to":"co"},{"from":"cre","to":"cr"},{"from":"ces","to":"cs"},{"from":"chu","to":"cu"},{"from":"chv","to":"cv"},{"from":"cym","to":"cy"},{"from":"dan","to":"da"},{"from":"deu","to":"de"},{"from":"div","to":"dv"},{"from":"dzo","to":"dz"},{"from":"ewe","to":"ee"},{"from":"ell","to":"el"},{"from":"eng","to":"en"},{"from":"epo","to":"eo"},{"from":"spa","to":"es"},{"from":"est","to":"et"},{"from":"eus","to":"eu"},{"from":"fas","to":"fa"},{"from":"ful","to":"ff"},{"from":"fin","to":"fi"},{"from":"fij","to":"fj"},{"from":"fao","to":"fo"},{"from":"fra","to":"fr"},{"from":"fry","to":"fy"},{"from":"gle","to":"ga"},{"from":"gla","to":"gd"},{"from":"glg","to":"gl"},{"from":"grn","to":"gn"},{"from":"guj","to":"gu"},{"from":"glv","to":"gv"},{"from":"hau","to":"ha"},{"from":"heb","to":"he"},{"from":"hin","to":"hi"},{"from":"hmo","to":"ho"},{"from":"hrv","to":"hr"},{"from":"hat","to":"ht"},{"from":"hun","to":"hu"},{"from":"hye","to":"hy"},{"from":"her","to":"hz"},{"from":"ina","to":"ia"},{"from":"ind","to":"id"},{"from":"ile","to":"ie"},{"from":"ibo","to":"ig"},{"from":"iii","to":"ii"},{"from":"ipk","to":"ik"},{"from":"ido","to":"io"},{"from":"isl","to":"is"},{"from":"ita","to":"it"},{"from":"iku","to":"iu"},{"from":"jpn","to":"ja"},{"from":"jav","to":"jv"},{"from":"kat","to":"ka"},{"from":"kon","to":"kg"},{"from":"kik","to":"ki"},{"from":"kua","to":"kj"},{"from":"kaz","to":"kk"},{"from":"kal","to":"kl"},{"from":"khm","to":"km"},{"from":"kan","to":"kn"},{"from":"kor","to":"ko"},{"from":"kau","to":"kr"},{"from":"kas","to":"ks"},{"from":"kur","to":"ku"},{"from":"kom","to":"kv"},{"from":"cor","to":"kw"},{"from":"kir","to":"ky"},{"from":"lat","to":"la"},{"from":"ltz","to":"lb"},{"from":"lug","to":"lg"},{"from":"lim","to":"li"},{"from":"lin","to":"ln"},{"from":"lao","to":"lo"},{"from":"lit","to":"lt"},{"from":"lub","to":"lu"},{"from":"lav","to":"lv"},{"from":"mlg","to":"mg"},{"from":"mah","to":"mh"},{"from":"mri","to":"mi"},{"from":"mkd","to":"mk"},{"from":"mal","to":"ml"},{"from":"mon","to":"mn"},{"from":"mol","to":"ro"},{"from":"mar","to":"mr"},{"from":"msa","to":"ms"},{"from":"mlt","to":"mt"},{"from":"mya","to":"my"},{"from":"nau","to":"na"},{"from":"nob","to":"nb"},{"from":"nde","to":"nd"},{"from":"nep","to":"ne"},{"from":"ndo","to":"ng"},{"from":"nld","to":"nl"},{"from":"nno","to":"nn"},{"from":"nor","to":"nb"},{"from":"nbl","to":"nr"},{"from":"nav","to":"nv"},{"from":"nya","to":"ny"},{"from":"oci","to":"oc"},{"from":"oji","to":"oj"},{"from":"orm","to":"om"},{"from":"ori","to":"or"},{"from":"oss","to":"os"},{"from":"pan","to":"pa"},{"from":"pli","to":"pi"},{"from":"pol","to":"pl"},{"from":"pus","to":"ps"},{"from":"por","to":"pt"},{"from":"que","to":"qu"},{"from":"roh","to":"rm"},{"from":"run","to":"rn"},{"from":"ron","to":"ro"},{"from":"rus","to":"ru"},{"from":"kin","to":"rw"},{"from":"san","to":"sa"},{"from":"srd","to":"sc"},{"from":"snd","to":"sd"},{"from":"sme","to":"se"},{"from":"sag","to":"sg"},{"from":"hbs","to":"sr-latn"},{"from":"sin","to":"si"},{"from":"slk","to":"sk"},{"from":"slv","to":"sl"},{"from":"smo","to":"sm"},{"from":"sna","to":"sn"},{"from":"som","to":"so"},{"from":"sqi","to":"sq"},{"from":"srp","to":"sr"},{"from":"ssw","to":"ss"},{"from":"sot","to":"st"},{"from":"sun","to":"su"},{"from":"swe","to":"sv"},{"from":"swa","to":"sw"},{"from":"tam","to":"ta"},{"from":"tel","to":"te"},{"from":"tgk","to":"tg"},{"from":"tha","to":"th"},{"from":"tir","to":"ti"},{"from":"tuk","to":"tk"},{"from":"tgl","to":"fil"},{"from":"tsn","to":"tn"},{"from":"ton","to":"to"},{"from":"tur","to":"tr"},{"from":"tso","to":"ts"},{"from":"tat","to":"tt"},{"from":"twi","to":"ak"},{"from":"tah","to":"ty"},{"from":"uig","to":"ug"},{"from":"ukr","to":"uk"},{"from":"urd","to":"ur"},{"from":"uzb","to":"uz"},{"from":"ven","to":"ve"},{"from":"vie","to":"vi"},{"from":"vol","to":"vo"},{"from":"wln","to":"wa"},{"from":"wol","to":"wo"},{"from":"xho","to":"xh"},{"from":"yid","to":"yi"},{"from":"yor","to":"yo"},{"from":"zha","to":"za"},{"from":"zho","to":"zh"},{"from":"zul","to":"zu"},{"from":"alb","to":"sq"},{"from":"arm","to":"hy"},{"from":"baq","to":"eu"},{"from":"bur","to":"my"},{"from":"chi","to":"zh"},{"from":"cze","to":"cs"},{"from":"dut","to":"nl"},{"from":"fre","to":"fr"},{"from":"geo","to":"ka"},{"from":"ger","to":"de"},{"from":"gre","to":"el"},{"from":"ice","to":"is"},{"from":"mac","to":"mk"},{"from":"mao","to":"mi"},{"from":"may","to":"ms"},{"from":"per","to":"fa"},{"from":"rum","to":"ro"},{"from":"slo","to":"sk"},{"from":"tib","to":"bo"},{"from":"wel","to":"cy"}]')},8589:function(e){"use strict";e.exports=JSON.parse('{"en-gb-oed":"en-GB-oxendict","i-ami":"ami","i-bnn":"bnn","i-default":null,"i-enochian":null,"i-hak":"hak","i-klingon":"tlh","i-lux":"lb","i-mingo":null,"i-navajo":"nv","i-pwn":"pwn","i-tao":"tao","i-tay":"tay","i-tsu":"tsu","sgn-be-fr":"sfb","sgn-be-nl":"vgt","sgn-ch-de":"sgg","art-lojban":"jbo","cel-gaulish":null,"no-bok":"nb","no-nyn":"nn","zh-guoyu":"cmn","zh-hakka":"hak","zh-min":null,"zh-min-nan":"nan","zh-xiang":"hsn"}')},858:function(e){"use strict";e.exports=JSON.parse('["art-lojban","cel-gaulish","no-bok","no-nyn","zh-guoyu","zh-hakka","zh-min","zh-min-nan","zh-xiang"]')}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var a=t[r]={exports:{}};return e[r].call(a.exports,a,a.exports,n),a.exports}n.amdO={},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var r={};return function(){"use strict";n.d(r,{default:function(){return c}}),n(8416);var e,t=n(1715),i=n(8080),a=n(1737),s=n(1139),o=function(){var e,t="application/dash+xml";function n(n,r,i){if(!n||!/^VIDEO$/i.test(n.nodeName))return null;if(n._dashjs_player)return n._dashjs_player;var a,o=n.id||n.name||"video element";if(!(r=r||[].slice.call(n.querySelectorAll("source")).filter((function(e){return e.type==t}))[0])&&n.src)(r=document.createElement("source")).src=n.src;else if(!r&&!n.src)return null;return i=i||{},(a=(0,s.Z)(i).create()).initialize(n,r.src,n.autoplay),e||(e=a.getDebug().getLogger()),e.debug("Converted "+o+" to dash.js player and added content: "+r.src),n._dashjs_player=a,a}function r(e){return/^VIDEO$/i.test(e.nodeName)?e:r(e.parentNode)}return{create:n,createAll:function(e,i){var a=[];e=e||"[data-dashjs-player]";for(var s=(i=i||document).querySelectorAll(e),o=0;o<s.length;o++){var l=n(s[o],null);a.push(l)}for(var u=i.querySelectorAll('source[type="'+t+'"]'),c=0;c<u.length;c++){var d=n(r(u[c]),null);a.push(d)}return a}}}();!("undefined"!=typeof window&&window&&window.dashjs&&window.dashjs.skipAutoCreate)&&"undefined"!=typeof window&&window&&window.addEventListener&&("complete"===window.document.readyState?window.dashjs?o.createAll():e=window.setInterval((function(){window.dashjs&&(window.clearInterval(e),o.createAll())}),500):window.addEventListener("load",(function e(){window.removeEventListener("load",e),o.createAll()})));var l=o,u=n(6398);dashjs.Protection=a.default,dashjs.MetricsReporting=i.default,dashjs.MediaPlayerFactory=l,dashjs.Debug=u.Z,dashjs.supportsMediaSource=t.B;var c=dashjs}(),r.default}()},9144:(e,t,n)=>{var r,i=void 0!==n.g?n.g:"undefined"!=typeof window?window:{},a=n(5893);"undefined"!=typeof document?r=document:(r=i["__GLOBAL_DOCUMENT_CACHE@4"])||(r=i["__GLOBAL_DOCUMENT_CACHE@4"]=a),e.exports=r},8908:(e,t,n)=>{var r;r="undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},e.exports=r},7376:e=>{e.exports=function(e){if(!e)return!1;var n=t.call(e);return"[object Function]"===n||"function"==typeof e&&"[object RegExp]"!==n||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)};var t=Object.prototype.toString},5592:(e,t,n)=>{var r,i,a;!function(s){"use strict";i=[n(9755)],void 0===(a="function"==typeof(r=function(e){return e.ui=e.ui||{},e.ui.version="1.13.2"})?r.apply(t,i):r)||(e.exports=a)}()},6891:(e,t,n)=>{var r,i,a;!function(s){"use strict";i=[n(9755),n(5592)],r=function(e){var t,n=0,r=Array.prototype.hasOwnProperty,i=Array.prototype.slice;return e.cleanData=(t=e.cleanData,function(n){var r,i,a;for(a=0;null!=(i=n[a]);a++)(r=e._data(i,"events"))&&r.remove&&e(i).triggerHandler("remove");t(n)}),e.widget=function(t,n,r){var i,a,s,o={},l=t.split(".")[0],u=l+"-"+(t=t.split(".")[1]);return r||(r=n,n=e.Widget),Array.isArray(r)&&(r=e.extend.apply(null,[{}].concat(r))),e.expr.pseudos[u.toLowerCase()]=function(t){return!!e.data(t,u)},e[l]=e[l]||{},i=e[l][t],a=e[l][t]=function(e,t){if(!this||!this._createWidget)return new a(e,t);arguments.length&&this._createWidget(e,t)},e.extend(a,i,{version:r.version,_proto:e.extend({},r),_childConstructors:[]}),(s=new n).options=e.widget.extend({},s.options),e.each(r,(function(e,t){o[e]="function"==typeof t?function(){function r(){return n.prototype[e].apply(this,arguments)}function i(t){return n.prototype[e].apply(this,t)}return function(){var e,n=this._super,a=this._superApply;return this._super=r,this._superApply=i,e=t.apply(this,arguments),this._super=n,this._superApply=a,e}}():t})),a.prototype=e.widget.extend(s,{widgetEventPrefix:i&&s.widgetEventPrefix||t},o,{constructor:a,namespace:l,widgetName:t,widgetFullName:u}),i?(e.each(i._childConstructors,(function(t,n){var r=n.prototype;e.widget(r.namespace+"."+r.widgetName,a,n._proto)})),delete i._childConstructors):n._childConstructors.push(a),e.widget.bridge(t,a),a},e.widget.extend=function(t){for(var n,a,s=i.call(arguments,1),o=0,l=s.length;o<l;o++)for(n in s[o])a=s[o][n],r.call(s[o],n)&&void 0!==a&&(e.isPlainObject(a)?t[n]=e.isPlainObject(t[n])?e.widget.extend({},t[n],a):e.widget.extend({},a):t[n]=a);return t},e.widget.bridge=function(t,n){var r=n.prototype.widgetFullName||t;e.fn[t]=function(a){var s="string"==typeof a,o=i.call(arguments,1),l=this;return s?this.length||"instance"!==a?this.each((function(){var n,i=e.data(this,r);return"instance"===a?(l=i,!1):i?"function"!=typeof i[a]||"_"===a.charAt(0)?e.error("no such method '"+a+"' for "+t+" widget instance"):(n=i[a].apply(i,o))!==i&&void 0!==n?(l=n&&n.jquery?l.pushStack(n.get()):n,!1):void 0:e.error("cannot call methods on "+t+" prior to initialization; attempted to call method '"+a+"'")})):l=void 0:(o.length&&(a=e.widget.extend.apply(null,[a].concat(o))),this.each((function(){var t=e.data(this,r);t?(t.option(a||{}),t._init&&t._init()):e.data(this,r,new n(a,this))}))),l}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,r){r=e(r||this.defaultElement||this)[0],this.element=e(r),this.uuid=n++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),this.classesElementLookup={},r!==this&&(e.data(r,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===r&&this.destroy()}}),this.document=e(r.style?r.ownerDocument:r.document||r),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){var t=this;this._destroy(),e.each(this.classesElementLookup,(function(e,n){t._removeClass(n,e)})),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:e.noop,widget:function(){return this.element},option:function(t,n){var r,i,a,s=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(s={},r=t.split("."),t=r.shift(),r.length){for(i=s[t]=e.widget.extend({},this.options[t]),a=0;a<r.length-1;a++)i[r[a]]=i[r[a]]||{},i=i[r[a]];if(t=r.pop(),1===arguments.length)return void 0===i[t]?null:i[t];i[t]=n}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];s[t]=n}return this._setOptions(s),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return"classes"===e&&this._setOptionClasses(t),this.options[e]=t,"disabled"===e&&this._setOptionDisabled(t),this},_setOptionClasses:function(t){var n,r,i;for(n in t)i=this.classesElementLookup[n],t[n]!==this.options.classes[n]&&i&&i.length&&(r=e(i.get()),this._removeClass(i,n),r.addClass(this._classes({element:r,keys:n,classes:t,add:!0})))},_setOptionDisabled:function(e){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!e),e&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(t){var n=[],r=this;function i(){var n=[];t.element.each((function(t,i){e.map(r.classesElementLookup,(function(e){return e})).some((function(e){return e.is(i)}))||n.push(i)})),r._on(e(n),{remove:"_untrackClassesElement"})}function a(a,s){var o,l;for(l=0;l<a.length;l++)o=r.classesElementLookup[a[l]]||e(),t.add?(i(),o=e(e.uniqueSort(o.get().concat(t.element.get())))):o=e(o.not(t.element).get()),r.classesElementLookup[a[l]]=o,n.push(a[l]),s&&t.classes[a[l]]&&n.push(t.classes[a[l]])}return(t=e.extend({element:this.element,classes:this.options.classes||{}},t)).keys&&a(t.keys.match(/\S+/g)||[],!0),t.extra&&a(t.extra.match(/\S+/g)||[]),n.join(" ")},_untrackClassesElement:function(t){var n=this;e.each(n.classesElementLookup,(function(r,i){-1!==e.inArray(t.target,i)&&(n.classesElementLookup[r]=e(i.not(t.target).get()))})),this._off(e(t.target))},_removeClass:function(e,t,n){return this._toggleClass(e,t,n,!1)},_addClass:function(e,t,n){return this._toggleClass(e,t,n,!0)},_toggleClass:function(e,t,n,r){r="boolean"==typeof r?r:n;var i="string"==typeof e||null===e,a={extra:i?t:n,keys:i?e:t,element:i?this.element:e,add:r};return a.element.toggleClass(this._classes(a),r),this},_on:function(t,n,r){var i,a=this;"boolean"!=typeof t&&(r=n,n=t,t=!1),r?(n=i=e(n),this.bindings=this.bindings.add(n)):(r=n,n=this.element,i=this.widget()),e.each(r,(function(r,s){function o(){if(t||!0!==a.options.disabled&&!e(this).hasClass("ui-state-disabled"))return("string"==typeof s?a[s]:s).apply(a,arguments)}"string"!=typeof s&&(o.guid=s.guid=s.guid||o.guid||e.guid++);var l=r.match(/^([\w:-]*)\s*(.*)$/),u=l[1]+a.eventNamespace,c=l[2];c?i.on(u,c,o):n.on(u,o)}))},_off:function(t,n){n=(n||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(n),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){var n=this;return setTimeout((function(){return("string"==typeof e?n[e]:e).apply(n,arguments)}),t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(e(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(e(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(e(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(e(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,n,r){var i,a,s=this.options[t];if(r=r||{},(n=e.Event(n)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),n.target=this.element[0],a=n.originalEvent)for(i in a)i in n||(n[i]=a[i]);return this.element.trigger(n,r),!("function"==typeof s&&!1===s.apply(this.element[0],[n].concat(r))||n.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},(function(t,n){e.Widget.prototype["_"+t]=function(r,i,a){var s;"string"==typeof i&&(i={effect:i});var o=i?!0===i||"number"==typeof i?n:i.effect||n:t;"number"==typeof(i=i||{})?i={duration:i}:!0===i&&(i={}),s=!e.isEmptyObject(i),i.complete=a,i.delay&&r.delay(i.delay),s&&e.effects&&e.effects.effect[o]?r[t](i):o!==t&&r[o]?r[o](i.duration,i.easing,a):r.queue((function(n){e(this)[t](),a&&a.call(r[0]),n()}))}})),e.widget},void 0===(a=r.apply(t,i))||(e.exports=a)}()},9459:(e,t,n)=>{var r=n(9755);!function(e,t,n,r){var i=n("html"),a=n(e),s=n(t),o=n.fancybox=function(){o.open.apply(this,arguments)},l=navigator.userAgent.match(/msie/i),u=null,c=t.createTouch!==r,d=function(e){return e&&e.hasOwnProperty&&e instanceof n},f=function(e){return e&&"string"===n.type(e)},h=function(e){return f(e)&&0<e.indexOf("%")},p=function(e,t){var n=parseInt(e,10)||0;return t&&h(e)&&(n*=o.getViewport()[t]/100),Math.ceil(n)},g=function(e,t){return p(e,t)+"px"};n.extend(o,{version:"2.1.5",defaults:{padding:15,margin:20,width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,pixelRatio:1,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!c,fitToView:!0,aspectRatio:!1,topRatio:.5,leftRatio:.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3e3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},keys:{next:{13:"left",34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen'+(l?' allowtransparency="true"':"")+"></iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:n.noop,beforeLoad:n.noop,afterLoad:n.noop,beforeShow:n.noop,afterShow:n.noop,beforeChange:n.noop,beforeClose:n.noop,afterClose:n.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(e,t){if(e&&(n.isPlainObject(t)||(t={}),!1!==o.close(!0)))return n.isArray(e)||(e=d(e)?n(e).get():[e]),n.each(e,(function(i,a){var s,l,u,c,h,p={};"object"===n.type(a)&&(a.nodeType&&(a=n(a)),d(a)?(p={href:a.data("fancybox-href")||a.attr("href"),title:n("<div/>").text(a.data("fancybox-title")||a.attr("title")).html(),isDom:!0,element:a},n.metadata&&n.extend(!0,p,a.metadata())):p=a),s=t.href||p.href||(f(a)?a:null),l=t.title!==r?t.title:p.title||"",!(c=(u=t.content||p.content)?"html":t.type||p.type)&&p.isDom&&((c=a.data("fancybox-type"))||(c=(c=a.prop("class").match(/fancybox\.(\w+)/))?c[1]:null)),f(s)&&(c||(o.isImage(s)?c="image":o.isSWF(s)?c="swf":"#"===s.charAt(0)?c="inline":f(a)&&(c="html",u=a)),"ajax"===c&&(h=s.split(/\s+/,2),s=h.shift(),h=h.shift())),u||("inline"===c?s?u=n(f(s)?s.replace(/.*(?=#[^\s]+$)/,""):s):p.isDom&&(u=a):"html"===c?u=s:c||s||!p.isDom||(c="inline",u=a)),n.extend(p,{href:s,type:c,content:u,title:l,selector:h}),e[i]=p})),o.opts=n.extend(!0,{},o.defaults,t),t.keys!==r&&(o.opts.keys=!!t.keys&&n.extend({},o.defaults.keys,t.keys)),o.group=e,o._start(o.opts.index)},cancel:function(){var e=o.coming;e&&!1===o.trigger("onCancel")||(o.hideLoading(),e&&(o.ajaxLoad&&o.ajaxLoad.abort(),o.ajaxLoad=null,o.imgPreload&&(o.imgPreload.onload=o.imgPreload.onerror=null),e.wrap&&e.wrap.stop(!0,!0).trigger("onReset").remove(),o.coming=null,o.current||o._afterZoomOut(e)))},close:function(e){o.cancel(),!1!==o.trigger("beforeClose")&&(o.unbindEvents(),o.isActive&&(o.isOpen&&!0!==e?(o.isOpen=o.isOpened=!1,o.isClosing=!0,n(".fancybox-item, .fancybox-nav").remove(),o.wrap.stop(!0,!0).removeClass("fancybox-opened"),o.transitions[o.current.closeMethod]()):(n(".fancybox-wrap").stop(!0).trigger("onReset").remove(),o._afterZoomOut())))},play:function(e){var t=function(){clearTimeout(o.player.timer)},n=function(){t(),o.current&&o.player.isActive&&(o.player.timer=setTimeout(o.next,o.current.playSpeed))},r=function(){t(),s.unbind(".player"),o.player.isActive=!1,o.trigger("onPlayEnd")};!0===e||!o.player.isActive&&!1!==e?o.current&&(o.current.loop||o.current.index<o.group.length-1)&&(o.player.isActive=!0,s.bind({"onCancel.player beforeClose.player":r,"onUpdate.player":n,"beforeLoad.player":t}),n(),o.trigger("onPlayStart")):r()},next:function(e){var t=o.current;t&&(f(e)||(e=t.direction.next),o.jumpto(t.index+1,e,"next"))},prev:function(e){var t=o.current;t&&(f(e)||(e=t.direction.prev),o.jumpto(t.index-1,e,"prev"))},jumpto:function(e,t,n){var i=o.current;i&&(e=p(e),o.direction=t||i.direction[e>=i.index?"next":"prev"],o.router=n||"jumpto",i.loop&&(0>e&&(e=i.group.length+e%i.group.length),e%=i.group.length),i.group[e]!==r&&(o.cancel(),o._start(e)))},reposition:function(e,t){var r,i=o.current,a=i?i.wrap:null;a&&(r=o._getPosition(t),e&&"scroll"===e.type?(delete r.position,a.stop(!0,!0).animate(r,200)):(a.css(r),i.pos=n.extend({},i.dim,r)))},update:function(e){var t=e&&e.originalEvent&&e.originalEvent.type,n=!t||"orientationchange"===t;n&&(clearTimeout(u),u=null),o.isOpen&&!u&&(u=setTimeout((function(){var r=o.current;r&&!o.isClosing&&(o.wrap.removeClass("fancybox-tmp"),(n||"load"===t||"resize"===t&&r.autoResize)&&o._setDimension(),"scroll"===t&&r.canShrink||o.reposition(e),o.trigger("onUpdate"),u=null)}),n&&!c?0:300))},toggle:function(e){o.isOpen&&(o.current.fitToView="boolean"===n.type(e)?e:!o.current.fitToView,c&&(o.wrap.removeAttr("style").addClass("fancybox-tmp"),o.trigger("onUpdate")),o.update())},hideLoading:function(){s.unbind(".loading"),n("#fancybox-loading").remove()},showLoading:function(){var e,t;o.hideLoading(),e=n('<div id="fancybox-loading"><div></div></div>').click(o.cancel).appendTo("body"),s.bind("keydown.loading",(function(e){27===(e.which||e.keyCode)&&(e.preventDefault(),o.cancel())})),o.defaults.fixed||(t=o.getViewport(),e.css({position:"absolute",top:.5*t.h+t.y,left:.5*t.w+t.x})),o.trigger("onLoading")},getViewport:function(){var t=o.current&&o.current.locked||!1,n={x:a.scrollLeft(),y:a.scrollTop()};return t&&t.length?(n.w=t[0].clientWidth,n.h=t[0].clientHeight):(n.w=c&&e.innerWidth?e.innerWidth:a.width(),n.h=c&&e.innerHeight?e.innerHeight:a.height()),n},unbindEvents:function(){o.wrap&&d(o.wrap)&&o.wrap.unbind(".fb"),s.unbind(".fb"),a.unbind(".fb")},bindEvents:function(){var e,t=o.current;t&&(a.bind("orientationchange.fb"+(c?"":" resize.fb")+(t.autoCenter&&!t.locked?" scroll.fb":""),o.update),(e=t.keys)&&s.bind("keydown.fb",(function(i){var a=i.which||i.keyCode,s=i.target||i.srcElement;if(27===a&&o.coming)return!1;i.ctrlKey||i.altKey||i.shiftKey||i.metaKey||s&&(s.type||n(s).is("[contenteditable]"))||n.each(e,(function(e,s){return 1<t.group.length&&s[a]!==r?(o[e](s[a]),i.preventDefault(),!1):-1<n.inArray(a,s)?(o[e](),i.preventDefault(),!1):void 0}))})),n.fn.mousewheel&&t.mouseWheel&&o.wrap.bind("mousewheel.fb",(function(e,r,i,a){for(var s=n(e.target||null),l=!1;s.length&&!(l||s.is(".fancybox-skin")||s.is(".fancybox-wrap"));)l=s[0]&&!(s[0].style.overflow&&"hidden"===s[0].style.overflow)&&(s[0].clientWidth&&s[0].scrollWidth>s[0].clientWidth||s[0].clientHeight&&s[0].scrollHeight>s[0].clientHeight),s=n(s).parent();0!==r&&!l&&1<o.group.length&&!t.canShrink&&(0<a||0<i?o.prev(0<a?"down":"left"):(0>a||0>i)&&o.next(0>a?"up":"right"),e.preventDefault())})))},trigger:function(e,t){var r,i=t||o.coming||o.current;if(i){if(n.isFunction(i[e])&&(r=i[e].apply(i,Array.prototype.slice.call(arguments,1))),!1===r)return!1;i.helpers&&n.each(i.helpers,(function(t,r){r&&o.helpers[t]&&n.isFunction(o.helpers[t][e])&&o.helpers[t][e](n.extend(!0,{},o.helpers[t].defaults,r),i)}))}s.trigger(e)},isImage:function(e){return f(e)&&e.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(e){return f(e)&&e.match(/\.(swf)((\?|#).*)?$/i)},_start:function(e){var t,r,i={};if(e=p(e),!(t=o.group[e]||null))return!1;if(t=(i=n.extend(!0,{},o.opts,t)).margin,r=i.padding,"number"===n.type(t)&&(i.margin=[t,t,t,t]),"number"===n.type(r)&&(i.padding=[r,r,r,r]),i.modal&&n.extend(!0,i,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}}),i.autoSize&&(i.autoWidth=i.autoHeight=!0),"auto"===i.width&&(i.autoWidth=!0),"auto"===i.height&&(i.autoHeight=!0),i.group=o.group,i.index=e,o.coming=i,!1===o.trigger("beforeLoad"))o.coming=null;else{if(r=i.type,t=i.href,!r)return o.coming=null,!(!o.current||!o.router||"jumpto"===o.router)&&(o.current.index=e,o[o.router](o.direction));if(o.isActive=!0,"image"!==r&&"swf"!==r||(i.autoHeight=i.autoWidth=!1,i.scrolling="visible"),"image"===r&&(i.aspectRatio=!0),"iframe"===r&&c&&(i.scrolling="scroll"),i.wrap=n(i.tpl.wrap).addClass("fancybox-"+(c?"mobile":"desktop")+" fancybox-type-"+r+" fancybox-tmp "+i.wrapCSS).appendTo(i.parent||"body"),n.extend(i,{skin:n(".fancybox-skin",i.wrap),outer:n(".fancybox-outer",i.wrap),inner:n(".fancybox-inner",i.wrap)}),n.each(["Top","Right","Bottom","Left"],(function(e,t){i.skin.css("padding"+t,g(i.padding[e]))})),o.trigger("onReady"),"inline"===r||"html"===r){if(!i.content||!i.content.length)return o._error("content")}else if(!t)return o._error("href");"image"===r?o._loadImage():"ajax"===r?o._loadAjax():"iframe"===r?o._loadIframe():o._afterLoad()}},_error:function(e){n.extend(o.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:e,content:o.coming.tpl.error}),o._afterLoad()},_loadImage:function(){var e=o.imgPreload=new Image;e.onload=function(){this.onload=this.onerror=null,o.coming.width=this.width/o.opts.pixelRatio,o.coming.height=this.height/o.opts.pixelRatio,o._afterLoad()},e.onerror=function(){this.onload=this.onerror=null,o._error("image")},e.src=o.coming.href,!0!==e.complete&&o.showLoading()},_loadAjax:function(){var e=o.coming;o.showLoading(),o.ajaxLoad=n.ajax(n.extend({},e.ajax,{url:e.href,error:function(e,t){o.coming&&"abort"!==t?o._error("ajax",e):o.hideLoading()},success:function(t,n){"success"===n&&(e.content=t,o._afterLoad())}}))},_loadIframe:function(){var e=o.coming,t=n(e.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",c?"auto":e.iframe.scrolling).attr("src",e.href);n(e.wrap).bind("onReset",(function(){try{n(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(e){}})),e.iframe.preload&&(o.showLoading(),t.one("load",(function(){n(this).data("ready",1),c||n(this).bind("load.fb",o.update),n(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show(),o._afterLoad()}))),e.content=t.appendTo(e.inner),e.iframe.preload||o._afterLoad()},_preloadImages:function(){var e,t,n=o.group,r=o.current,i=n.length,a=r.preload?Math.min(r.preload,i-1):0;for(t=1;t<=a;t+=1)"image"===(e=n[(r.index+t)%i]).type&&e.href&&((new Image).src=e.href)},_afterLoad:function(){var e,t,r,i,a,s=o.coming,l=o.current;if(o.hideLoading(),s&&!1!==o.isActive)if(!1===o.trigger("afterLoad",s,l))s.wrap.stop(!0).trigger("onReset").remove(),o.coming=null;else{switch(l&&(o.trigger("beforeChange",l),l.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove()),o.unbindEvents(),e=s.content,t=s.type,r=s.scrolling,n.extend(o,{wrap:s.wrap,skin:s.skin,outer:s.outer,inner:s.inner,current:s,previous:l}),i=s.href,t){case"inline":case"ajax":case"html":s.selector?e=n("<div>").html(e).find(s.selector):d(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",n('<div class="fancybox-placeholder"></div>').insertAfter(e).hide()),e=e.show().detach(),s.wrap.bind("onReset",(function(){n(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder",!1)})));break;case"image":e=s.tpl.image.replace(/\{href\}/g,i);break;case"swf":e='<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+i+'"></param>',a="",n.each(s.swf,(function(t,n){e+='<param name="'+t+'" value="'+n+'"></param>',a+=" "+t+'="'+n+'"'})),e+='<embed src="'+i+'" type="application/x-shockwave-flash" width="100%" height="100%"'+a+"></embed></object>"}d(e)&&e.parent().is(s.inner)||s.inner.append(e),o.trigger("beforeShow"),s.inner.css("overflow","yes"===r?"scroll":"no"===r?"hidden":r),o._setDimension(),o.reposition(),o.isOpen=!1,o.coming=null,o.bindEvents(),o.isOpened?l.prevMethod&&o.transitions[l.prevMethod]():n(".fancybox-wrap").not(s.wrap).stop(!0).trigger("onReset").remove(),o.transitions[o.isOpened?s.nextMethod:s.openMethod](),o._preloadImages()}},_setDimension:function(){var e,t,r,i,a,s,l,u,c,d=o.getViewport(),f=0,m=!1,y=!1,v=(m=o.wrap,o.skin),_=o.inner,T=o.current,E=(y=T.width,T.height),b=T.minWidth,S=T.minHeight,A=T.maxWidth,w=T.maxHeight,I=T.scrolling,C=T.scrollOutside?T.scrollbarWidth:0,R=T.margin,D=p(R[1]+R[3]),N=p(R[0]+R[2]);if(m.add(v).add(_).width("auto").height("auto").removeClass("fancybox-tmp"),t=D+(R=p(v.outerWidth(!0)-v.width())),r=N+(e=p(v.outerHeight(!0)-v.height())),i=h(y)?(d.w-t)*p(y)/100:y,a=h(E)?(d.h-r)*p(E)/100:E,"iframe"===T.type){if(c=T.content,T.autoHeight&&1===c.data("ready"))try{c[0].contentWindow.document.location&&(_.width(i).height(9999),s=c.contents().find("body"),C&&s.css("overflow-x","hidden"),a=s.outerHeight(!0))}catch(e){}}else(T.autoWidth||T.autoHeight)&&(_.addClass("fancybox-tmp"),T.autoWidth||_.width(i),T.autoHeight||_.height(a),T.autoWidth&&(i=_.width()),T.autoHeight&&(a=_.height()),_.removeClass("fancybox-tmp"));if(y=p(i),E=p(a),u=i/a,b=p(h(b)?p(b,"w")-t:b),A=p(h(A)?p(A,"w")-t:A),S=p(h(S)?p(S,"h")-r:S),s=A,l=w=p(h(w)?p(w,"h")-r:w),T.fitToView&&(A=Math.min(d.w-t,A),w=Math.min(d.h-r,w)),t=d.w-D,N=d.h-N,T.aspectRatio?(y>A&&(E=p((y=A)/u)),E>w&&(y=p((E=w)*u)),y<b&&(E=p((y=b)/u)),E<S&&(y=p((E=S)*u))):(y=Math.max(b,Math.min(y,A)),T.autoHeight&&"iframe"!==T.type&&(_.width(y),E=_.height()),E=Math.max(S,Math.min(E,w))),T.fitToView)if(_.width(y).height(E),m.width(y+R),d=m.width(),D=m.height(),T.aspectRatio)for(;(d>t||D>N)&&y>b&&E>S&&!(19<f++);)E=Math.max(S,Math.min(w,E-10)),(y=p(E*u))<b&&(E=p((y=b)/u)),y>A&&(E=p((y=A)/u)),_.width(y).height(E),m.width(y+R),d=m.width(),D=m.height();else y=Math.max(b,Math.min(y,y-(d-t))),E=Math.max(S,Math.min(E,E-(D-N)));C&&"auto"===I&&E<a&&y+R+C<t&&(y+=C),_.width(y).height(E),m.width(y+R),d=m.width(),D=m.height(),m=(d>t||D>N)&&y>b&&E>S,y=T.aspectRatio?y<s&&E<l&&y<i&&E<a:(y<s||E<l)&&(y<i||E<a),n.extend(T,{dim:{width:g(d),height:g(D)},origWidth:i,origHeight:a,canShrink:m,canExpand:y,wPadding:R,hPadding:e,wrapSpace:D-v.outerHeight(!0),skinSpace:v.height()-E}),!c&&T.autoHeight&&E>S&&E<w&&!y&&_.height("auto")},_getPosition:function(e){var t=o.current,n=o.getViewport(),r=t.margin,i=o.wrap.width()+r[1]+r[3],a=o.wrap.height()+r[0]+r[2];return r={position:"absolute",top:r[0],left:r[3]},t.autoCenter&&t.fixed&&!e&&a<=n.h&&i<=n.w?r.position="fixed":t.locked||(r.top+=n.y,r.left+=n.x),r.top=g(Math.max(r.top,r.top+(n.h-a)*t.topRatio)),r.left=g(Math.max(r.left,r.left+(n.w-i)*t.leftRatio)),r},_afterZoomIn:function(){var e=o.current;e&&(o.isOpen=o.isOpened=!0,o.wrap.css("overflow","visible").addClass("fancybox-opened"),o.update(),(e.closeClick||e.nextClick&&1<o.group.length)&&o.inner.css("cursor","pointer").bind("click.fb",(function(t){n(t.target).is("a")||n(t.target).parent().is("a")||(t.preventDefault(),o[e.closeClick?"close":"next"]())})),e.closeBtn&&n(e.tpl.closeBtn).appendTo(o.skin).bind("click.fb",(function(e){e.preventDefault(),o.close()})),e.arrows&&1<o.group.length&&((e.loop||0<e.index)&&n(e.tpl.prev).appendTo(o.outer).bind("click.fb",o.prev),(e.loop||e.index<o.group.length-1)&&n(e.tpl.next).appendTo(o.outer).bind("click.fb",o.next)),o.trigger("afterShow"),e.loop||e.index!==e.group.length-1?o.opts.autoPlay&&!o.player.isActive&&(o.opts.autoPlay=!1,o.play(!0)):o.play(!1))},_afterZoomOut:function(e){e=e||o.current,n(".fancybox-wrap").trigger("onReset").remove(),n.extend(o,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null}),o.trigger("afterClose",e)}}),o.transitions={getOrigPosition:function(){var e=o.current,t=e.element,n=e.orig,r={},i=50,a=50,s=e.hPadding,l=e.wPadding,u=o.getViewport();return!n&&e.isDom&&t.is(":visible")&&((n=t.find("img:first")).length||(n=t)),d(n)?(r=n.offset(),n.is("img")&&(i=n.outerWidth(),a=n.outerHeight())):(r.top=u.y+(u.h-a)*e.topRatio,r.left=u.x+(u.w-i)*e.leftRatio),("fixed"===o.wrap.css("position")||e.locked)&&(r.top-=u.y,r.left-=u.x),{top:g(r.top-s*e.topRatio),left:g(r.left-l*e.leftRatio),width:g(i+l),height:g(a+s)}},step:function(e,t){var n,r,i=t.prop,a=(r=o.current).wrapSpace,s=r.skinSpace;"width"!==i&&"height"!==i||(n=t.end===t.start?1:(e-t.start)/(t.end-t.start),o.isClosing&&(n=1-n),r=e-(r="width"===i?r.wPadding:r.hPadding),o.skin[i](p("width"===i?r:r-a*n)),o.inner[i](p("width"===i?r:r-a*n-s*n)))},zoomIn:function(){var e=o.current,t=e.pos,r=e.openEffect,i="elastic"===r,a=n.extend({opacity:1},t);delete a.position,i?(t=this.getOrigPosition(),e.openOpacity&&(t.opacity=.1)):"fade"===r&&(t.opacity=.1),o.wrap.css(t).animate(a,{duration:"none"===r?0:e.openSpeed,easing:e.openEasing,step:i?this.step:null,complete:o._afterZoomIn})},zoomOut:function(){var e=o.current,t=e.closeEffect,n="elastic"===t,r={opacity:.1};n&&(r=this.getOrigPosition(),e.closeOpacity&&(r.opacity=.1)),o.wrap.animate(r,{duration:"none"===t?0:e.closeSpeed,easing:e.closeEasing,step:n?this.step:null,complete:o._afterZoomOut})},changeIn:function(){var e,t=o.current,n=t.nextEffect,r=t.pos,i={opacity:1},a=o.direction;r.opacity=.1,"elastic"===n&&(e="down"===a||"up"===a?"top":"left","down"===a||"right"===a?(r[e]=g(p(r[e])-200),i[e]="+=200px"):(r[e]=g(p(r[e])+200),i[e]="-=200px")),"none"===n?o._afterZoomIn():o.wrap.css(r).animate(i,{duration:t.nextSpeed,easing:t.nextEasing,complete:o._afterZoomIn})},changeOut:function(){var e=o.previous,t=e.prevEffect,r={opacity:.1},i=o.direction;"elastic"===t&&(r["down"===i||"up"===i?"top":"left"]=("up"===i||"left"===i?"-":"+")+"=200px"),e.wrap.animate(r,{duration:"none"===t?0:e.prevSpeed,easing:e.prevEasing,complete:function(){n(this).trigger("onReset").remove()}})}},o.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEarly:!0,css:{},locked:!c,fixed:!0},overlay:null,fixed:!1,el:n("html"),create:function(e){var t;e=n.extend({},this.defaults,e),this.overlay&&this.close(),t=o.coming?o.coming.parent:e.parent,this.overlay=n('<div class="fancybox-overlay"></div>').appendTo(t&&t.lenth?t:"body"),this.fixed=!1,e.fixed&&o.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(e){var t=this;e=n.extend({},this.defaults,e),this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(e),this.fixed||(a.bind("resize.overlay",n.proxy(this.update,this)),this.update()),e.closeClick&&this.overlay.bind("click.overlay",(function(e){if(n(e.target).hasClass("fancybox-overlay"))return o.isActive?o.close():t.close(),!1})),this.overlay.css(e.css).show()},close:function(){a.unbind("resize.overlay"),this.el.hasClass("fancybox-lock")&&(n(".fancybox-margin").removeClass("fancybox-margin"),this.el.removeClass("fancybox-lock"),a.scrollTop(this.scrollV).scrollLeft(this.scrollH)),n(".fancybox-overlay").remove().hide(),n.extend(this,{overlay:null,fixed:!1})},update:function(){var e,n="100%";this.overlay.width(n).height("100%"),l?(e=Math.max(t.documentElement.offsetWidth,t.body.offsetWidth),s.width()>e&&(n=s.width())):s.width()>a.width()&&(n=s.width()),this.overlay.width(n).height(s.height())},onReady:function(e,t){var r=this.overlay;n(".fancybox-overlay").stop(!0,!0),r||this.create(e),e.locked&&this.fixed&&t.fixed&&(t.locked=this.overlay.append(t.wrap),t.fixed=!1),!0===e.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(e,t){t.locked&&!this.el.hasClass("fancybox-lock")&&(!1!==this.fixPosition&&n("*").filter((function(){return"fixed"===n(this).css("position")&&!n(this).hasClass("fancybox-overlay")&&!n(this).hasClass("fancybox-wrap")})).addClass("fancybox-margin"),this.el.addClass("fancybox-margin"),this.scrollV=a.scrollTop(),this.scrollH=a.scrollLeft(),this.el.addClass("fancybox-lock"),a.scrollTop(this.scrollV).scrollLeft(this.scrollH)),this.open(e)},onUpdate:function(){this.fixed||this.update()},afterClose:function(e){this.overlay&&!o.coming&&this.overlay.fadeOut(e.speedOut,n.proxy(this.close,this))}},o.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(e){var t=o.current,r=t.title,i=e.type;if(n.isFunction(r)&&(r=r.call(t.element,t)),f(r)&&""!==n.trim(r)){switch(t=n('<div class="fancybox-title fancybox-title-'+i+'-wrap">'+r+"</div>"),i){case"inside":i=o.skin;break;case"outside":i=o.wrap;break;case"over":i=o.inner;break;default:i=o.skin,t.appendTo("body"),l&&t.width(t.width()),t.wrapInner('<span class="child"></span>'),o.current.margin[2]+=Math.abs(p(t.css("margin-bottom")))}t["top"===e.position?"prependTo":"appendTo"](i)}}},n.fn.fancybox=function(e){var t,r=n(this),i=this.selector||"",a=function(a){var s,l,u=n(this).blur(),c=t;a.ctrlKey||a.altKey||a.shiftKey||a.metaKey||u.is(".fancybox-wrap")||(s=e.groupAttr||"data-fancybox-group",(l=u.attr(s))||(s="rel",l=u.get(0)[s]),l&&""!==l&&"nofollow"!==l&&(c=(u=(u=i.length?n(i):r).filter("["+s+'="'+l+'"]')).index(this)),e.index=c,!1!==o.open(u,e)&&a.preventDefault())};return t=(e=e||{}).index||0,i&&!1!==e.live?s.undelegate(i,"click.fb-start").delegate(i+":not('.fancybox-item, .fancybox-nav')","click.fb-start",a):r.unbind("click.fb-start").bind("click.fb-start",a),this.filter("[data-fancybox-start=1]").trigger("click"),this},s.ready((function(){var t,a;n.scrollbarWidth===r&&(n.scrollbarWidth=function(){var e=n('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),t=(t=e.children()).innerWidth()-t.height(99).innerWidth();return e.remove(),t}),n.support.fixedPosition===r&&(n.support.fixedPosition=function(){var e=n('<div style="position:fixed;top:20px;"></div>').appendTo("body"),t=20===e[0].offsetTop||15===e[0].offsetTop;return e.remove(),t}()),n.extend(o.defaults,{scrollbarWidth:n.scrollbarWidth(),fixed:n.support.fixedPosition,parent:n("body")}),t=n(e).width(),i.addClass("fancybox-lock-test"),a=n(e).width(),i.removeClass("fancybox-lock-test"),n("<style type='text/css'>.fancybox-margin{margin-right:"+(a-t)+"px;}</style>").appendTo("head")}))}(window,document,r)},3430:(e,t,n)=>{var r,i,a;i=[n(9755)],void 0===(a="function"==typeof(r=function(e){var t,n,r=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],i="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],a=Array.prototype.slice;if(e.event.fixHooks)for(var s=r.length;s;)e.event.fixHooks[r[--s]]=e.event.mouseHooks;var o=e.event.special.mousewheel={version:"3.1.9",setup:function(){if(this.addEventListener)for(var t=i.length;t;)this.addEventListener(i[--t],l,!1);else this.onmousewheel=l;e.data(this,"mousewheel-line-height",o.getLineHeight(this)),e.data(this,"mousewheel-page-height",o.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var e=i.length;e;)this.removeEventListener(i[--e],l,!1);else this.onmousewheel=null},getLineHeight:function(t){return parseInt(e(t)["offsetParent"in e.fn?"offsetParent":"parent"]().css("fontSize"),10)},getPageHeight:function(t){return e(t).height()},settings:{adjustOldDeltas:!0}};function l(r){var i=r||window.event,s=a.call(arguments,1),o=0,l=0,d=0,f=0;if((r=e.event.fix(i)).type="mousewheel","detail"in i&&(d=-1*i.detail),"wheelDelta"in i&&(d=i.wheelDelta),"wheelDeltaY"in i&&(d=i.wheelDeltaY),"wheelDeltaX"in i&&(l=-1*i.wheelDeltaX),"axis"in i&&i.axis===i.HORIZONTAL_AXIS&&(l=-1*d,d=0),o=0===d?l:d,"deltaY"in i&&(o=d=-1*i.deltaY),"deltaX"in i&&(l=i.deltaX,0===d&&(o=-1*l)),0!==d||0!==l){if(1===i.deltaMode){var h=e.data(this,"mousewheel-line-height");o*=h,d*=h,l*=h}else if(2===i.deltaMode){var p=e.data(this,"mousewheel-page-height");o*=p,d*=p,l*=p}return f=Math.max(Math.abs(d),Math.abs(l)),(!n||f<n)&&(n=f,c(i,f)&&(n/=40)),c(i,f)&&(o/=40,l/=40,d/=40),o=Math[o>=1?"floor":"ceil"](o/n),l=Math[l>=1?"floor":"ceil"](l/n),d=Math[d>=1?"floor":"ceil"](d/n),r.deltaX=l,r.deltaY=d,r.deltaFactor=n,r.deltaMode=0,s.unshift(r,o,l,d),t&&clearTimeout(t),t=setTimeout(u,200),(e.event.dispatch||e.event.handle).apply(this,s)}}function u(){n=null}function c(e,t){return o.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120==0}e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})})?r.apply(t,i):r)||(e.exports=a)},7440:(e,t,n)=>{var r,i,a;!function(s){"use strict";i=[n(9755)],void 0===(a="function"==typeof(r=function(e){var t=e.scrollTo=function(t,n,r){return e(window).scrollTo(t,n,r)};function n(t){return!t.nodeName||-1!==e.inArray(t.nodeName.toLowerCase(),["iframe","#document","html","body"])}function r(e){return"function"==typeof e}function i(t){return r(t)||e.isPlainObject(t)?t:{top:t,left:t}}return t.defaults={axis:"xy",duration:0,limit:!0},e.fn.scrollTo=function(a,s,o){"object"==typeof s&&(o=s,s=0),"function"==typeof o&&(o={onAfter:o}),"max"===a&&(a=9e9),o=e.extend({},t.defaults,o),s=s||o.duration;var l=o.queue&&o.axis.length>1;return l&&(s/=2),o.offset=i(o.offset),o.over=i(o.over),this.each((function(){if(null!==a){var u,c=n(this),d=c?this.contentWindow||window:this,f=e(d),h=a,p={};switch(typeof h){case"number":case"string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(h)){h=i(h);break}h=c?e(h):e(h,d);case"object":if(0===h.length)return;(h.is||h.style)&&(u=(h=e(h)).offset())}var g=r(o.offset)&&o.offset(d,h)||o.offset;e.each(o.axis.split(""),(function(e,n){var r="x"===n?"Left":"Top",i=r.toLowerCase(),a="scroll"+r,s=f[a](),y=t.max(d,n);if(u)p[a]=u[i]+(c?0:s-f.offset()[i]),o.margin&&(p[a]-=parseInt(h.css("margin"+r),10)||0,p[a]-=parseInt(h.css("border"+r+"Width"),10)||0),p[a]+=g[i]||0,o.over[i]&&(p[a]+=h["x"===n?"width":"height"]()*o.over[i]);else{var v=h[i];p[a]=v.slice&&"%"===v.slice(-1)?parseFloat(v)/100*y:v}o.limit&&/^\d+$/.test(p[a])&&(p[a]=p[a]<=0?0:Math.min(p[a],y)),!e&&o.axis.length>1&&(s===p[a]?p={}:l&&(m(o.onAfterFirst),p={}))})),m(o.onAfter)}function m(t){var n=e.extend({},o,{queue:!0,duration:s,complete:t&&function(){t.call(d,h,o)}});f.animate(p,n)}}))},t.max=function(t,r){var i="x"===r?"Width":"Height",a="scroll"+i;if(!n(t))return t[a]-e(t)[i.toLowerCase()]();var s="client"+i,o=t.ownerDocument||t.document,l=o.documentElement,u=o.body;return Math.max(l[a],u[a])-Math.min(l[s],u[s])},e.Tween.propHooks.scrollLeft=e.Tween.propHooks.scrollTop={get:function(t){return e(t.elem)[t.prop]()},set:function(t){var n=this.get(t);if(t.options.interrupt&&t._last&&t._last!==n)return e(t.elem).stop();var r=Math.round(t.now);n!==r&&(e(t.elem)[t.prop](r),t._last=this.get(t))}},t})?r.apply(t,i):r)||(e.exports=a)}()},9755:function(e,t){var n;!function(t,n){"use strict";"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,(function(r,i){"use strict";var a=[],s=Object.getPrototypeOf,o=a.slice,l=a.flat?function(e){return a.flat.call(e)}:function(e){return a.concat.apply([],e)},u=a.push,c=a.indexOf,d={},f=d.toString,h=d.hasOwnProperty,p=h.toString,g=p.call(Object),m={},y=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},v=function(e){return null!=e&&e===e.window},_=r.document,T={type:!0,src:!0,nonce:!0,noModule:!0};function E(e,t,n){var r,i,a=(n=n||_).createElement("script");if(a.text=e,t)for(r in T)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&a.setAttribute(r,i);n.head.appendChild(a).parentNode.removeChild(a)}function b(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?d[f.call(e)]||"object":typeof e}var S="3.7.1",A=/HTML$/i,w=function(e,t){return new w.fn.init(e,t)};function I(e){var t=!!e&&"length"in e&&e.length,n=b(e);return!y(e)&&!v(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function C(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}w.fn=w.prototype={jquery:S,constructor:w,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=w.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return w.each(this,e)},map:function(e){return this.pushStack(w.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(w.grep(this,(function(e,t){return(t+1)%2})))},odd:function(){return this.pushStack(w.grep(this,(function(e,t){return t%2})))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:a.sort,splice:a.splice},w.extend=w.fn.extend=function(){var e,t,n,r,i,a,s=arguments[0]||{},o=1,l=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[o]||{},o++),"object"==typeof s||y(s)||(s={}),o===l&&(s=this,o--);o<l;o++)if(null!=(e=arguments[o]))for(t in e)r=e[t],"__proto__"!==t&&s!==r&&(u&&r&&(w.isPlainObject(r)||(i=Array.isArray(r)))?(n=s[t],a=i&&!Array.isArray(n)?[]:i||w.isPlainObject(n)?n:{},i=!1,s[t]=w.extend(u,a,r)):void 0!==r&&(s[t]=r));return s},w.extend({expando:"jQuery"+(S+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==f.call(e)||(t=s(e))&&("function"!=typeof(n=h.call(t,"constructor")&&t.constructor)||p.call(n)!==g))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){E(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(I(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},text:function(e){var t,n="",r=0,i=e.nodeType;if(!i)for(;t=e[r++];)n+=w.text(t);return 1===i||11===i?e.textContent:9===i?e.documentElement.textContent:3===i||4===i?e.nodeValue:n},makeArray:function(e,t){var n=t||[];return null!=e&&(I(Object(e))?w.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:c.call(t,e,n)},isXMLDoc:function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!A.test(t||n&&n.nodeName||"HTML")},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,a=e.length,s=!n;i<a;i++)!t(e[i],i)!==s&&r.push(e[i]);return r},map:function(e,t,n){var r,i,a=0,s=[];if(I(e))for(r=e.length;a<r;a++)null!=(i=t(e[a],a,n))&&s.push(i);else for(a in e)null!=(i=t(e[a],a,n))&&s.push(i);return l(s)},guid:1,support:m}),"function"==typeof Symbol&&(w.fn[Symbol.iterator]=a[Symbol.iterator]),w.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(e,t){d["[object "+t+"]"]=t.toLowerCase()}));var R=a.pop,D=a.sort,N=a.splice,O="[\\x20\\t\\r\\n\\f]",P=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g");w.contains=function(e,t){var n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(e.contains?e.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))};var M=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function x(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e}w.escapeSelector=function(e){return(e+"").replace(M,x)};var L=_,k=u;!function(){var e,t,n,i,s,l,u,d,f,p,g=k,y=w.expando,v=0,_=0,T=ee(),E=ee(),b=ee(),S=ee(),A=function(e,t){return e===t&&(s=!0),0},I="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="(?:\\\\[\\da-fA-F]{1,6}"+O+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",x="\\["+O+"*("+M+")(?:"+O+"*([*^$|!~]?=)"+O+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+O+"*\\]",F=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+x+")*)|.*)\\)|)",U=new RegExp(O+"+","g"),B=new RegExp("^"+O+"*,"+O+"*"),j=new RegExp("^"+O+"*([>+~]|"+O+")"+O+"*"),q=new RegExp(O+"|>"),H=new RegExp(F),G=new RegExp("^"+M+"$"),V={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+x),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),bool:new RegExp("^(?:"+I+")$","i"),needsContext:new RegExp("^"+O+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,K=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,z=/[+~]/,W=new RegExp("\\\\[\\da-fA-F]{1,6}"+O+"?|\\\\([^\\r\\n\\f])","g"),X=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},$=function(){le()},Q=fe((function(e){return!0===e.disabled&&C(e,"fieldset")}),{dir:"parentNode",next:"legend"});try{g.apply(a=o.call(L.childNodes),L.childNodes),a[L.childNodes.length].nodeType}catch(e){g={apply:function(e,t){k.apply(e,o.call(t))},call:function(e){k.apply(e,o.call(arguments,1))}}}function J(e,t,n,r){var i,a,s,o,u,c,h,p=t&&t.ownerDocument,v=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==v&&9!==v&&11!==v)return n;if(!r&&(le(t),t=t||l,d)){if(11!==v&&(u=K.exec(e)))if(i=u[1]){if(9===v){if(!(s=t.getElementById(i)))return n;if(s.id===i)return g.call(n,s),n}else if(p&&(s=p.getElementById(i))&&J.contains(t,s)&&s.id===i)return g.call(n,s),n}else{if(u[2])return g.apply(n,t.getElementsByTagName(e)),n;if((i=u[3])&&t.getElementsByClassName)return g.apply(n,t.getElementsByClassName(i)),n}if(!(S[e+" "]||f&&f.test(e))){if(h=e,p=t,1===v&&(q.test(e)||j.test(e))){for((p=z.test(e)&&oe(t.parentNode)||t)==t&&m.scope||((o=t.getAttribute("id"))?o=w.escapeSelector(o):t.setAttribute("id",o=y)),a=(c=ce(e)).length;a--;)c[a]=(o?"#"+o:":scope")+" "+de(c[a]);h=c.join(",")}try{return g.apply(n,p.querySelectorAll(h)),n}catch(t){S(e,!0)}finally{o===y&&t.removeAttribute("id")}}}return ve(e.replace(P,"$1"),t,n,r)}function ee(){var e=[];return function n(r,i){return e.push(r+" ")>t.cacheLength&&delete n[e.shift()],n[r+" "]=i}}function te(e){return e[y]=!0,e}function ne(e){var t=l.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function re(e){return function(t){return C(t,"input")&&t.type===e}}function ie(e){return function(t){return(C(t,"input")||C(t,"button"))&&t.type===e}}function ae(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&Q(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function se(e){return te((function(t){return t=+t,te((function(n,r){for(var i,a=e([],n.length,t),s=a.length;s--;)n[i=a[s]]&&(n[i]=!(r[i]=n[i]))}))}))}function oe(e){return e&&void 0!==e.getElementsByTagName&&e}function le(e){var n,r=e?e.ownerDocument||e:L;return r!=l&&9===r.nodeType&&r.documentElement?(u=(l=r).documentElement,d=!w.isXMLDoc(l),p=u.matches||u.webkitMatchesSelector||u.msMatchesSelector,u.msMatchesSelector&&L!=l&&(n=l.defaultView)&&n.top!==n&&n.addEventListener("unload",$),m.getById=ne((function(e){return u.appendChild(e).id=w.expando,!l.getElementsByName||!l.getElementsByName(w.expando).length})),m.disconnectedMatch=ne((function(e){return p.call(e,"*")})),m.scope=ne((function(){return l.querySelectorAll(":scope")})),m.cssHas=ne((function(){try{return l.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}})),m.getById?(t.filter.ID=function(e){var t=e.replace(W,X);return function(e){return e.getAttribute("id")===t}},t.find.ID=function(e,t){if(void 0!==t.getElementById&&d){var n=t.getElementById(e);return n?[n]:[]}}):(t.filter.ID=function(e){var t=e.replace(W,X);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},t.find.ID=function(e,t){if(void 0!==t.getElementById&&d){var n,r,i,a=t.getElementById(e);if(a){if((n=a.getAttributeNode("id"))&&n.value===e)return[a];for(i=t.getElementsByName(e),r=0;a=i[r++];)if((n=a.getAttributeNode("id"))&&n.value===e)return[a]}return[]}}),t.find.TAG=function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},t.find.CLASS=function(e,t){if(void 0!==t.getElementsByClassName&&d)return t.getElementsByClassName(e)},f=[],ne((function(e){var t;u.appendChild(e).innerHTML="<a id='"+y+"' href='' disabled='disabled'></a><select id='"+y+"-\r\\' disabled='disabled'><option selected=''></option></select>",e.querySelectorAll("[selected]").length||f.push("\\["+O+"*(?:value|"+I+")"),e.querySelectorAll("[id~="+y+"-]").length||f.push("~="),e.querySelectorAll("a#"+y+"+*").length||f.push(".#.+[+~]"),e.querySelectorAll(":checked").length||f.push(":checked"),(t=l.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),u.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&f.push(":enabled",":disabled"),(t=l.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||f.push("\\["+O+"*name"+O+"*="+O+"*(?:''|\"\")")})),m.cssHas||f.push(":has"),f=f.length&&new RegExp(f.join("|")),A=function(e,t){if(e===t)return s=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!m.sortDetached&&t.compareDocumentPosition(e)===n?e===l||e.ownerDocument==L&&J.contains(L,e)?-1:t===l||t.ownerDocument==L&&J.contains(L,t)?1:i?c.call(i,e)-c.call(i,t):0:4&n?-1:1)},l):l}for(e in J.matches=function(e,t){return J(e,null,null,t)},J.matchesSelector=function(e,t){if(le(e),d&&!S[t+" "]&&(!f||!f.test(t)))try{var n=p.call(e,t);if(n||m.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){S(t,!0)}return J(t,l,null,[e]).length>0},J.contains=function(e,t){return(e.ownerDocument||e)!=l&&le(e),w.contains(e,t)},J.attr=function(e,n){(e.ownerDocument||e)!=l&&le(e);var r=t.attrHandle[n.toLowerCase()],i=r&&h.call(t.attrHandle,n.toLowerCase())?r(e,n,!d):void 0;return void 0!==i?i:e.getAttribute(n)},J.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},w.uniqueSort=function(e){var t,n=[],r=0,a=0;if(s=!m.sortStable,i=!m.sortStable&&o.call(e,0),D.call(e,A),s){for(;t=e[a++];)t===e[a]&&(r=n.push(a));for(;r--;)N.call(e,n[r],1)}return i=null,e},w.fn.uniqueSort=function(){return this.pushStack(w.uniqueSort(o.apply(this)))},t=w.expr={cacheLength:50,createPseudo:te,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(W,X),e[3]=(e[3]||e[4]||e[5]||"").replace(W,X),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||J.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&J.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return V.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&H.test(n)&&(t=ce(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(W,X).toLowerCase();return"*"===e?function(){return!0}:function(e){return C(e,t)}},CLASS:function(e){var t=T[e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&T(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var i=J.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(U," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var a="nth"!==e.slice(0,3),s="last"!==e.slice(-4),o="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,d,f,h,p=a!==s?"nextSibling":"previousSibling",g=t.parentNode,m=o&&t.nodeName.toLowerCase(),_=!l&&!o,T=!1;if(g){if(a){for(;p;){for(d=t;d=d[p];)if(o?C(d,m):1===d.nodeType)return!1;h=p="only"===e&&!h&&"nextSibling"}return!0}if(h=[s?g.firstChild:g.lastChild],s&&_){for(T=(f=(u=(c=g[y]||(g[y]={}))[e]||[])[0]===v&&u[1])&&u[2],d=f&&g.childNodes[f];d=++f&&d&&d[p]||(T=f=0)||h.pop();)if(1===d.nodeType&&++T&&d===t){c[e]=[v,f,T];break}}else if(_&&(T=f=(u=(c=t[y]||(t[y]={}))[e]||[])[0]===v&&u[1]),!1===T)for(;(d=++f&&d&&d[p]||(T=f=0)||h.pop())&&(!(o?C(d,m):1===d.nodeType)||!++T||(_&&((c=d[y]||(d[y]={}))[e]=[v,T]),d!==t)););return(T-=i)===r||T%r==0&&T/r>=0}}},PSEUDO:function(e,n){var r,i=t.pseudos[e]||t.setFilters[e.toLowerCase()]||J.error("unsupported pseudo: "+e);return i[y]?i(n):i.length>1?(r=[e,e,"",n],t.setFilters.hasOwnProperty(e.toLowerCase())?te((function(e,t){for(var r,a=i(e,n),s=a.length;s--;)e[r=c.call(e,a[s])]=!(t[r]=a[s])})):function(e){return i(e,0,r)}):i}},pseudos:{not:te((function(e){var t=[],n=[],r=ye(e.replace(P,"$1"));return r[y]?te((function(e,t,n,i){for(var a,s=r(e,null,i,[]),o=e.length;o--;)(a=s[o])&&(e[o]=!(t[o]=a))})):function(e,i,a){return t[0]=e,r(t,null,a,n),t[0]=null,!n.pop()}})),has:te((function(e){return function(t){return J(e,t).length>0}})),contains:te((function(e){return e=e.replace(W,X),function(t){return(t.textContent||w.text(t)).indexOf(e)>-1}})),lang:te((function(e){return G.test(e||"")||J.error("unsupported lang: "+e),e=e.replace(W,X).toLowerCase(),function(t){var n;do{if(n=d?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(e){var t=r.location&&r.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===u},focus:function(e){return e===function(){try{return l.activeElement}catch(e){}}()&&l.hasFocus()&&!!(e.type||e.href||~e.tabIndex)},enabled:ae(!1),disabled:ae(!0),checked:function(e){return C(e,"input")&&!!e.checked||C(e,"option")&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!t.pseudos.empty(e)},header:function(e){return Z.test(e.nodeName)},input:function(e){return Y.test(e.nodeName)},button:function(e){return C(e,"input")&&"button"===e.type||C(e,"button")},text:function(e){var t;return C(e,"input")&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:se((function(){return[0]})),last:se((function(e,t){return[t-1]})),eq:se((function(e,t,n){return[n<0?n+t:n]})),even:se((function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e})),odd:se((function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e})),lt:se((function(e,t,n){var r;for(r=n<0?n+t:n>t?t:n;--r>=0;)e.push(r);return e})),gt:se((function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e}))}},t.pseudos.nth=t.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})t.pseudos[e]=re(e);for(e in{submit:!0,reset:!0})t.pseudos[e]=ie(e);function ue(){}function ce(e,n){var r,i,a,s,o,l,u,c=E[e+" "];if(c)return n?0:c.slice(0);for(o=e,l=[],u=t.preFilter;o;){for(s in r&&!(i=B.exec(o))||(i&&(o=o.slice(i[0].length)||o),l.push(a=[])),r=!1,(i=j.exec(o))&&(r=i.shift(),a.push({value:r,type:i[0].replace(P," ")}),o=o.slice(r.length)),t.filter)!(i=V[s].exec(o))||u[s]&&!(i=u[s](i))||(r=i.shift(),a.push({value:r,type:s,matches:i}),o=o.slice(r.length));if(!r)break}return n?o.length:o?J.error(e):E(e,l).slice(0)}function de(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function fe(e,t,n){var r=t.dir,i=t.next,a=i||r,s=n&&"parentNode"===a,o=_++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||s)return e(t,n,i);return!1}:function(t,n,l){var u,c,d=[v,o];if(l){for(;t=t[r];)if((1===t.nodeType||s)&&e(t,n,l))return!0}else for(;t=t[r];)if(1===t.nodeType||s)if(c=t[y]||(t[y]={}),i&&C(t,i))t=t[r]||t;else{if((u=c[a])&&u[0]===v&&u[1]===o)return d[2]=u[2];if(c[a]=d,d[2]=e(t,n,l))return!0}return!1}}function he(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function pe(e,t,n,r,i){for(var a,s=[],o=0,l=e.length,u=null!=t;o<l;o++)(a=e[o])&&(n&&!n(a,r,i)||(s.push(a),u&&t.push(o)));return s}function ge(e,t,n,r,i,a){return r&&!r[y]&&(r=ge(r)),i&&!i[y]&&(i=ge(i,a)),te((function(a,s,o,l){var u,d,f,h,p=[],m=[],y=s.length,v=a||function(e,t,n){for(var r=0,i=t.length;r<i;r++)J(e,t[r],n);return n}(t||"*",o.nodeType?[o]:o,[]),_=!e||!a&&t?v:pe(v,p,e,o,l);if(n?n(_,h=i||(a?e:y||r)?[]:s,o,l):h=_,r)for(u=pe(h,m),r(u,[],o,l),d=u.length;d--;)(f=u[d])&&(h[m[d]]=!(_[m[d]]=f));if(a){if(i||e){if(i){for(u=[],d=h.length;d--;)(f=h[d])&&u.push(_[d]=f);i(null,h=[],u,l)}for(d=h.length;d--;)(f=h[d])&&(u=i?c.call(a,f):p[d])>-1&&(a[u]=!(s[u]=f))}}else h=pe(h===s?h.splice(y,h.length):h),i?i(null,s,h,l):g.apply(s,h)}))}function me(e){for(var r,i,a,s=e.length,o=t.relative[e[0].type],l=o||t.relative[" "],u=o?1:0,d=fe((function(e){return e===r}),l,!0),f=fe((function(e){return c.call(r,e)>-1}),l,!0),h=[function(e,t,i){var a=!o&&(i||t!=n)||((r=t).nodeType?d(e,t,i):f(e,t,i));return r=null,a}];u<s;u++)if(i=t.relative[e[u].type])h=[fe(he(h),i)];else{if((i=t.filter[e[u].type].apply(null,e[u].matches))[y]){for(a=++u;a<s&&!t.relative[e[a].type];a++);return ge(u>1&&he(h),u>1&&de(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(P,"$1"),i,u<a&&me(e.slice(u,a)),a<s&&me(e=e.slice(a)),a<s&&de(e))}h.push(i)}return he(h)}function ye(e,r){var i,a=[],s=[],o=b[e+" "];if(!o){for(r||(r=ce(e)),i=r.length;i--;)(o=me(r[i]))[y]?a.push(o):s.push(o);o=b(e,function(e,r){var i=r.length>0,a=e.length>0,s=function(s,o,u,c,f){var h,p,m,y=0,_="0",T=s&&[],E=[],b=n,S=s||a&&t.find.TAG("*",f),A=v+=null==b?1:Math.random()||.1,I=S.length;for(f&&(n=o==l||o||f);_!==I&&null!=(h=S[_]);_++){if(a&&h){for(p=0,o||h.ownerDocument==l||(le(h),u=!d);m=e[p++];)if(m(h,o||l,u)){g.call(c,h);break}f&&(v=A)}i&&((h=!m&&h)&&y--,s&&T.push(h))}if(y+=_,i&&_!==y){for(p=0;m=r[p++];)m(T,E,o,u);if(s){if(y>0)for(;_--;)T[_]||E[_]||(E[_]=R.call(c));E=pe(E)}g.apply(c,E),f&&!s&&E.length>0&&y+r.length>1&&w.uniqueSort(c)}return f&&(v=A,n=b),T};return i?te(s):s}(s,a)),o.selector=e}return o}function ve(e,n,r,i){var a,s,o,l,u,c="function"==typeof e&&e,f=!i&&ce(e=c.selector||e);if(r=r||[],1===f.length){if((s=f[0]=f[0].slice(0)).length>2&&"ID"===(o=s[0]).type&&9===n.nodeType&&d&&t.relative[s[1].type]){if(!(n=(t.find.ID(o.matches[0].replace(W,X),n)||[])[0]))return r;c&&(n=n.parentNode),e=e.slice(s.shift().value.length)}for(a=V.needsContext.test(e)?0:s.length;a--&&(o=s[a],!t.relative[l=o.type]);)if((u=t.find[l])&&(i=u(o.matches[0].replace(W,X),z.test(s[0].type)&&oe(n.parentNode)||n))){if(s.splice(a,1),!(e=i.length&&de(s)))return g.apply(r,i),r;break}}return(c||ye(e,f))(i,n,!d,r,!n||z.test(e)&&oe(n.parentNode)||n),r}ue.prototype=t.filters=t.pseudos,t.setFilters=new ue,m.sortStable=y.split("").sort(A).join("")===y,le(),m.sortDetached=ne((function(e){return 1&e.compareDocumentPosition(l.createElement("fieldset"))})),w.find=J,w.expr[":"]=w.expr.pseudos,w.unique=w.uniqueSort,J.compile=ye,J.select=ve,J.setDocument=le,J.tokenize=ce,J.escape=w.escapeSelector,J.getText=w.text,J.isXML=w.isXMLDoc,J.selectors=w.expr,J.support=w.support,J.uniqueSort=w.uniqueSort}();var F=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&w(e).is(n))break;r.push(e)}return r},U=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},B=w.expr.match.needsContext,j=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function q(e,t,n){return y(t)?w.grep(e,(function(e,r){return!!t.call(e,r,e)!==n})):t.nodeType?w.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?w.grep(e,(function(e){return c.call(t,e)>-1!==n})):w.filter(t,e,n)}w.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?w.find.matchesSelector(r,e)?[r]:[]:w.find.matches(e,w.grep(t,(function(e){return 1===e.nodeType})))},w.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(w(e).filter((function(){for(t=0;t<r;t++)if(w.contains(i[t],this))return!0})));for(n=this.pushStack([]),t=0;t<r;t++)w.find(e,i[t],n);return r>1?w.uniqueSort(n):n},filter:function(e){return this.pushStack(q(this,e||[],!1))},not:function(e){return this.pushStack(q(this,e||[],!0))},is:function(e){return!!q(this,"string"==typeof e&&B.test(e)?w(e):e||[],!1).length}});var H,G=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(w.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||H,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:G.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof w?t[0]:t,w.merge(this,w.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:_,!0)),j.test(r[1])&&w.isPlainObject(t))for(r in t)y(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=_.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):y(e)?void 0!==n.ready?n.ready(e):e(w):w.makeArray(e,this)}).prototype=w.fn,H=w(_);var V=/^(?:parents|prev(?:Until|All))/,Y={children:!0,contents:!0,next:!0,prev:!0};function Z(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}w.fn.extend({has:function(e){var t=w(e,this),n=t.length;return this.filter((function(){for(var e=0;e<n;e++)if(w.contains(this,t[e]))return!0}))},closest:function(e,t){var n,r=0,i=this.length,a=[],s="string"!=typeof e&&w(e);if(!B.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(s?s.index(n)>-1:1===n.nodeType&&w.find.matchesSelector(n,e))){a.push(n);break}return this.pushStack(a.length>1?w.uniqueSort(a):a)},index:function(e){return e?"string"==typeof e?c.call(w(e),this[0]):c.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(w.uniqueSort(w.merge(this.get(),w(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),w.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return F(e,"parentNode")},parentsUntil:function(e,t,n){return F(e,"parentNode",n)},next:function(e){return Z(e,"nextSibling")},prev:function(e){return Z(e,"previousSibling")},nextAll:function(e){return F(e,"nextSibling")},prevAll:function(e){return F(e,"previousSibling")},nextUntil:function(e,t,n){return F(e,"nextSibling",n)},prevUntil:function(e,t,n){return F(e,"previousSibling",n)},siblings:function(e){return U((e.parentNode||{}).firstChild,e)},children:function(e){return U(e.firstChild)},contents:function(e){return null!=e.contentDocument&&s(e.contentDocument)?e.contentDocument:(C(e,"template")&&(e=e.content||e),w.merge([],e.childNodes))}},(function(e,t){w.fn[e]=function(n,r){var i=w.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=w.filter(r,i)),this.length>1&&(Y[e]||w.uniqueSort(i),V.test(e)&&i.reverse()),this.pushStack(i)}}));var K=/[^\x20\t\r\n\f]+/g;function z(e){return e}function W(e){throw e}function X(e,t,n,r){var i;try{e&&y(i=e.promise)?i.call(e).done(t).fail(n):e&&y(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}w.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return w.each(e.match(K)||[],(function(e,n){t[n]=!0})),t}(e):w.extend({},e);var t,n,r,i,a=[],s=[],o=-1,l=function(){for(i=i||e.once,r=t=!0;s.length;o=-1)for(n=s.shift();++o<a.length;)!1===a[o].apply(n[0],n[1])&&e.stopOnFalse&&(o=a.length,n=!1);e.memory||(n=!1),t=!1,i&&(a=n?[]:"")},u={add:function(){return a&&(n&&!t&&(o=a.length-1,s.push(n)),function t(n){w.each(n,(function(n,r){y(r)?e.unique&&u.has(r)||a.push(r):r&&r.length&&"string"!==b(r)&&t(r)}))}(arguments),n&&!t&&l()),this},remove:function(){return w.each(arguments,(function(e,t){for(var n;(n=w.inArray(t,a,n))>-1;)a.splice(n,1),n<=o&&o--})),this},has:function(e){return e?w.inArray(e,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return i=s=[],a=n="",this},disabled:function(){return!a},lock:function(){return i=s=[],n||t||(a=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],s.push(n),t||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!r}};return u},w.extend({Deferred:function(e){var t=[["notify","progress",w.Callbacks("memory"),w.Callbacks("memory"),2],["resolve","done",w.Callbacks("once memory"),w.Callbacks("once memory"),0,"resolved"],["reject","fail",w.Callbacks("once memory"),w.Callbacks("once memory"),1,"rejected"]],n="pending",i={state:function(){return n},always:function(){return a.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return w.Deferred((function(n){w.each(t,(function(t,r){var i=y(e[r[4]])&&e[r[4]];a[r[1]]((function(){var e=i&&i.apply(this,arguments);e&&y(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[e]:arguments)}))})),e=null})).promise()},then:function(e,n,i){var a=0;function s(e,t,n,i){return function(){var o=this,l=arguments,u=function(){var r,u;if(!(e<a)){if((r=n.apply(o,l))===t.promise())throw new TypeError("Thenable self-resolution");u=r&&("object"==typeof r||"function"==typeof r)&&r.then,y(u)?i?u.call(r,s(a,t,z,i),s(a,t,W,i)):(a++,u.call(r,s(a,t,z,i),s(a,t,W,i),s(a,t,z,t.notifyWith))):(n!==z&&(o=void 0,l=[r]),(i||t.resolveWith)(o,l))}},c=i?u:function(){try{u()}catch(r){w.Deferred.exceptionHook&&w.Deferred.exceptionHook(r,c.error),e+1>=a&&(n!==W&&(o=void 0,l=[r]),t.rejectWith(o,l))}};e?c():(w.Deferred.getErrorHook?c.error=w.Deferred.getErrorHook():w.Deferred.getStackHook&&(c.error=w.Deferred.getStackHook()),r.setTimeout(c))}}return w.Deferred((function(r){t[0][3].add(s(0,r,y(i)?i:z,r.notifyWith)),t[1][3].add(s(0,r,y(e)?e:z)),t[2][3].add(s(0,r,y(n)?n:W))})).promise()},promise:function(e){return null!=e?w.extend(e,i):i}},a={};return w.each(t,(function(e,r){var s=r[2],o=r[5];i[r[1]]=s.add,o&&s.add((function(){n=o}),t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),s.add(r[3].fire),a[r[0]]=function(){return a[r[0]+"With"](this===a?void 0:this,arguments),this},a[r[0]+"With"]=s.fireWith})),i.promise(a),e&&e.call(a,a),a},when:function(e){var t=arguments.length,n=t,r=Array(n),i=o.call(arguments),a=w.Deferred(),s=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?o.call(arguments):n,--t||a.resolveWith(r,i)}};if(t<=1&&(X(e,a.done(s(n)).resolve,a.reject,!t),"pending"===a.state()||y(i[n]&&i[n].then)))return a.then();for(;n--;)X(i[n],s(n),a.reject);return a.promise()}});var $=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;w.Deferred.exceptionHook=function(e,t){r.console&&r.console.warn&&e&&$.test(e.name)&&r.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},w.readyException=function(e){r.setTimeout((function(){throw e}))};var Q=w.Deferred();function J(){_.removeEventListener("DOMContentLoaded",J),r.removeEventListener("load",J),w.ready()}w.fn.ready=function(e){return Q.then(e).catch((function(e){w.readyException(e)})),this},w.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--w.readyWait:w.isReady)||(w.isReady=!0,!0!==e&&--w.readyWait>0||Q.resolveWith(_,[w]))}}),w.ready.then=Q.then,"complete"===_.readyState||"loading"!==_.readyState&&!_.documentElement.doScroll?r.setTimeout(w.ready):(_.addEventListener("DOMContentLoaded",J),r.addEventListener("load",J));var ee=function(e,t,n,r,i,a,s){var o=0,l=e.length,u=null==n;if("object"===b(n))for(o in i=!0,n)ee(e,t,o,n[o],!0,a,s);else if(void 0!==r&&(i=!0,y(r)||(s=!0),u&&(s?(t.call(e,r),t=null):(u=t,t=function(e,t,n){return u.call(w(e),n)})),t))for(;o<l;o++)t(e[o],n,s?r:r.call(e[o],o,t(e[o],n)));return i?e:u?t.call(e):l?t(e[0],n):a},te=/^-ms-/,ne=/-([a-z])/g;function re(e,t){return t.toUpperCase()}function ie(e){return e.replace(te,"ms-").replace(ne,re)}var ae=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function se(){this.expando=w.expando+se.uid++}se.uid=1,se.prototype={cache:function(e){var t=e[this.expando];return t||(t={},ae(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[ie(t)]=n;else for(r in t)i[ie(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][ie(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(ie):(t=ie(t))in r?[t]:t.match(K)||[]).length;for(;n--;)delete r[t[n]]}(void 0===t||w.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!w.isEmptyObject(t)}};var oe=new se,le=new se,ue=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,ce=/[A-Z]/g;function de(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(ce,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:ue.test(e)?JSON.parse(e):e)}(n)}catch(e){}le.set(e,t,n)}else n=void 0;return n}w.extend({hasData:function(e){return le.hasData(e)||oe.hasData(e)},data:function(e,t,n){return le.access(e,t,n)},removeData:function(e,t){le.remove(e,t)},_data:function(e,t,n){return oe.access(e,t,n)},_removeData:function(e,t){oe.remove(e,t)}}),w.fn.extend({data:function(e,t){var n,r,i,a=this[0],s=a&&a.attributes;if(void 0===e){if(this.length&&(i=le.get(a),1===a.nodeType&&!oe.get(a,"hasDataAttrs"))){for(n=s.length;n--;)s[n]&&0===(r=s[n].name).indexOf("data-")&&(r=ie(r.slice(5)),de(a,r,i[r]));oe.set(a,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each((function(){le.set(this,e)})):ee(this,(function(t){var n;if(a&&void 0===t)return void 0!==(n=le.get(a,e))||void 0!==(n=de(a,e))?n:void 0;this.each((function(){le.set(this,e,t)}))}),null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each((function(){le.remove(this,e)}))}}),w.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=oe.get(e,t),n&&(!r||Array.isArray(n)?r=oe.access(e,t,w.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=w.queue(e,t),r=n.length,i=n.shift(),a=w._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete a.stop,i.call(e,(function(){w.dequeue(e,t)}),a)),!r&&a&&a.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return oe.get(e,n)||oe.access(e,n,{empty:w.Callbacks("once memory").add((function(){oe.remove(e,[t+"queue",n])}))})}}),w.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?w.queue(this[0],e):void 0===t?this:this.each((function(){var n=w.queue(this,e,t);w._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&w.dequeue(this,e)}))},dequeue:function(e){return this.each((function(){w.dequeue(this,e)}))},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=w.Deferred(),a=this,s=this.length,o=function(){--r||i.resolveWith(a,[a])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";s--;)(n=oe.get(a[s],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(o));return o(),i.promise(t)}});var fe=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,he=new RegExp("^(?:([+-])=|)("+fe+")([a-z%]*)$","i"),pe=["Top","Right","Bottom","Left"],ge=_.documentElement,me=function(e){return w.contains(e.ownerDocument,e)},ye={composed:!0};ge.getRootNode&&(me=function(e){return w.contains(e.ownerDocument,e)||e.getRootNode(ye)===e.ownerDocument});var ve=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&me(e)&&"none"===w.css(e,"display")};function _e(e,t,n,r){var i,a,s=20,o=r?function(){return r.cur()}:function(){return w.css(e,t,"")},l=o(),u=n&&n[3]||(w.cssNumber[t]?"":"px"),c=e.nodeType&&(w.cssNumber[t]||"px"!==u&&+l)&&he.exec(w.css(e,t));if(c&&c[3]!==u){for(l/=2,u=u||c[3],c=+l||1;s--;)w.style(e,t,c+u),(1-a)*(1-(a=o()/l||.5))<=0&&(s=0),c/=a;c*=2,w.style(e,t,c+u),n=n||[]}return n&&(c=+c||+l||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=u,r.start=c,r.end=i)),i}var Te={};function Ee(e){var t,n=e.ownerDocument,r=e.nodeName,i=Te[r];return i||(t=n.body.appendChild(n.createElement(r)),i=w.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),Te[r]=i,i)}function be(e,t){for(var n,r,i=[],a=0,s=e.length;a<s;a++)(r=e[a]).style&&(n=r.style.display,t?("none"===n&&(i[a]=oe.get(r,"display")||null,i[a]||(r.style.display="")),""===r.style.display&&ve(r)&&(i[a]=Ee(r))):"none"!==n&&(i[a]="none",oe.set(r,"display",n)));for(a=0;a<s;a++)null!=i[a]&&(e[a].style.display=i[a]);return e}w.fn.extend({show:function(){return be(this,!0)},hide:function(){return be(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each((function(){ve(this)?w(this).show():w(this).hide()}))}});var Se,Ae,we=/^(?:checkbox|radio)$/i,Ie=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Ce=/^$|^module$|\/(?:java|ecma)script/i;Se=_.createDocumentFragment().appendChild(_.createElement("div")),(Ae=_.createElement("input")).setAttribute("type","radio"),Ae.setAttribute("checked","checked"),Ae.setAttribute("name","t"),Se.appendChild(Ae),m.checkClone=Se.cloneNode(!0).cloneNode(!0).lastChild.checked,Se.innerHTML="<textarea>x</textarea>",m.noCloneChecked=!!Se.cloneNode(!0).lastChild.defaultValue,Se.innerHTML="<option></option>",m.option=!!Se.lastChild;var Re={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function De(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&C(e,t)?w.merge([e],n):n}function Ne(e,t){for(var n=0,r=e.length;n<r;n++)oe.set(e[n],"globalEval",!t||oe.get(t[n],"globalEval"))}Re.tbody=Re.tfoot=Re.colgroup=Re.caption=Re.thead,Re.th=Re.td,m.option||(Re.optgroup=Re.option=[1,"<select multiple='multiple'>","</select>"]);var Oe=/<|&#?\w+;/;function Pe(e,t,n,r,i){for(var a,s,o,l,u,c,d=t.createDocumentFragment(),f=[],h=0,p=e.length;h<p;h++)if((a=e[h])||0===a)if("object"===b(a))w.merge(f,a.nodeType?[a]:a);else if(Oe.test(a)){for(s=s||d.appendChild(t.createElement("div")),o=(Ie.exec(a)||["",""])[1].toLowerCase(),l=Re[o]||Re._default,s.innerHTML=l[1]+w.htmlPrefilter(a)+l[2],c=l[0];c--;)s=s.lastChild;w.merge(f,s.childNodes),(s=d.firstChild).textContent=""}else f.push(t.createTextNode(a));for(d.textContent="",h=0;a=f[h++];)if(r&&w.inArray(a,r)>-1)i&&i.push(a);else if(u=me(a),s=De(d.appendChild(a),"script"),u&&Ne(s),n)for(c=0;a=s[c++];)Ce.test(a.type||"")&&n.push(a);return d}var Me=/^([^.]*)(?:\.(.+)|)/;function xe(){return!0}function Le(){return!1}function ke(e,t,n,r,i,a){var s,o;if("object"==typeof t){for(o in"string"!=typeof n&&(r=r||n,n=void 0),t)ke(e,o,n,r,t[o],a);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Le;else if(!i)return e;return 1===a&&(s=i,i=function(e){return w().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=w.guid++)),e.each((function(){w.event.add(this,t,i,r,n)}))}function Fe(e,t,n){n?(oe.set(e,t,!1),w.event.add(e,t,{namespace:!1,handler:function(e){var n,r=oe.get(this,t);if(1&e.isTrigger&&this[t]){if(r)(w.event.special[t]||{}).delegateType&&e.stopPropagation();else if(r=o.call(arguments),oe.set(this,t,r),this[t](),n=oe.get(this,t),oe.set(this,t,!1),r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n}else r&&(oe.set(this,t,w.event.trigger(r[0],r.slice(1),this)),e.stopPropagation(),e.isImmediatePropagationStopped=xe)}})):void 0===oe.get(e,t)&&w.event.add(e,t,xe)}w.event={global:{},add:function(e,t,n,r,i){var a,s,o,l,u,c,d,f,h,p,g,m=oe.get(e);if(ae(e))for(n.handler&&(n=(a=n).handler,i=a.selector),i&&w.find.matchesSelector(ge,i),n.guid||(n.guid=w.guid++),(l=m.events)||(l=m.events=Object.create(null)),(s=m.handle)||(s=m.handle=function(t){return void 0!==w&&w.event.triggered!==t.type?w.event.dispatch.apply(e,arguments):void 0}),u=(t=(t||"").match(K)||[""]).length;u--;)h=g=(o=Me.exec(t[u])||[])[1],p=(o[2]||"").split(".").sort(),h&&(d=w.event.special[h]||{},h=(i?d.delegateType:d.bindType)||h,d=w.event.special[h]||{},c=w.extend({type:h,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&w.expr.match.needsContext.test(i),namespace:p.join(".")},a),(f=l[h])||((f=l[h]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,r,p,s)||e.addEventListener&&e.addEventListener(h,s)),d.add&&(d.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?f.splice(f.delegateCount++,0,c):f.push(c),w.event.global[h]=!0)},remove:function(e,t,n,r,i){var a,s,o,l,u,c,d,f,h,p,g,m=oe.hasData(e)&&oe.get(e);if(m&&(l=m.events)){for(u=(t=(t||"").match(K)||[""]).length;u--;)if(h=g=(o=Me.exec(t[u])||[])[1],p=(o[2]||"").split(".").sort(),h){for(d=w.event.special[h]||{},f=l[h=(r?d.delegateType:d.bindType)||h]||[],o=o[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=a=f.length;a--;)c=f[a],!i&&g!==c.origType||n&&n.guid!==c.guid||o&&!o.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(f.splice(a,1),c.selector&&f.delegateCount--,d.remove&&d.remove.call(e,c));s&&!f.length&&(d.teardown&&!1!==d.teardown.call(e,p,m.handle)||w.removeEvent(e,h,m.handle),delete l[h])}else for(h in l)w.event.remove(e,h+t[u],n,r,!0);w.isEmptyObject(l)&&oe.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,a,s,o=new Array(arguments.length),l=w.event.fix(e),u=(oe.get(this,"events")||Object.create(null))[l.type]||[],c=w.event.special[l.type]||{};for(o[0]=l,t=1;t<arguments.length;t++)o[t]=arguments[t];if(l.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,l)){for(s=w.event.handlers.call(this,l,u),t=0;(i=s[t++])&&!l.isPropagationStopped();)for(l.currentTarget=i.elem,n=0;(a=i.handlers[n++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==a.namespace&&!l.rnamespace.test(a.namespace)||(l.handleObj=a,l.data=a.data,void 0!==(r=((w.event.special[a.origType]||{}).handle||a.handler).apply(i.elem,o))&&!1===(l.result=r)&&(l.preventDefault(),l.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,l),l.result}},handlers:function(e,t){var n,r,i,a,s,o=[],l=t.delegateCount,u=e.target;if(l&&u.nodeType&&!("click"===e.type&&e.button>=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==e.type||!0!==u.disabled)){for(a=[],s={},n=0;n<l;n++)void 0===s[i=(r=t[n]).selector+" "]&&(s[i]=r.needsContext?w(i,this).index(u)>-1:w.find(i,this,null,[u]).length),s[i]&&a.push(r);a.length&&o.push({elem:u,handlers:a})}return u=this,l<t.length&&o.push({elem:u,handlers:t.slice(l)}),o},addProp:function(e,t){Object.defineProperty(w.Event.prototype,e,{enumerable:!0,configurable:!0,get:y(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[w.expando]?e:new w.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return we.test(t.type)&&t.click&&C(t,"input")&&Fe(t,"click",!0),!1},trigger:function(e){var t=this||e;return we.test(t.type)&&t.click&&C(t,"input")&&Fe(t,"click"),!0},_default:function(e){var t=e.target;return we.test(t.type)&&t.click&&C(t,"input")&&oe.get(t,"click")||C(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},w.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},w.Event=function(e,t){if(!(this instanceof w.Event))return new w.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?xe:Le,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&w.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[w.expando]=!0},w.Event.prototype={constructor:w.Event,isDefaultPrevented:Le,isPropagationStopped:Le,isImmediatePropagationStopped:Le,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=xe,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=xe,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=xe,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},w.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},w.event.addProp),w.each({focus:"focusin",blur:"focusout"},(function(e,t){function n(e){if(_.documentMode){var n=oe.get(this,"handle"),r=w.event.fix(e);r.type="focusin"===e.type?"focus":"blur",r.isSimulated=!0,n(e),r.target===r.currentTarget&&n(r)}else w.event.simulate(t,e.target,w.event.fix(e))}w.event.special[e]={setup:function(){var r;if(Fe(this,e,!0),!_.documentMode)return!1;(r=oe.get(this,t))||this.addEventListener(t,n),oe.set(this,t,(r||0)+1)},trigger:function(){return Fe(this,e),!0},teardown:function(){var e;if(!_.documentMode)return!1;(e=oe.get(this,t)-1)?oe.set(this,t,e):(this.removeEventListener(t,n),oe.remove(this,t))},_default:function(t){return oe.get(t.target,e)},delegateType:t},w.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,i=_.documentMode?this:r,a=oe.get(i,t);a||(_.documentMode?this.addEventListener(t,n):r.addEventListener(e,n,!0)),oe.set(i,t,(a||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=_.documentMode?this:r,a=oe.get(i,t)-1;a?oe.set(i,t,a):(_.documentMode?this.removeEventListener(t,n):r.removeEventListener(e,n,!0),oe.remove(i,t))}}})),w.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(e,t){w.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=e.relatedTarget,i=e.handleObj;return r&&(r===this||w.contains(this,r))||(e.type=i.origType,n=i.handler.apply(this,arguments),e.type=t),n}}})),w.fn.extend({on:function(e,t,n,r){return ke(this,e,t,n,r)},one:function(e,t,n,r){return ke(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,w(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Le),this.each((function(){w.event.remove(this,e,n,t)}))}});var Ue=/<script|<style|<link/i,Be=/checked\s*(?:[^=]|=\s*.checked.)/i,je=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function qe(e,t){return C(e,"table")&&C(11!==t.nodeType?t:t.firstChild,"tr")&&w(e).children("tbody")[0]||e}function He(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Ge(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Ve(e,t){var n,r,i,a,s,o;if(1===t.nodeType){if(oe.hasData(e)&&(o=oe.get(e).events))for(i in oe.remove(t,"handle events"),o)for(n=0,r=o[i].length;n<r;n++)w.event.add(t,i,o[i][n]);le.hasData(e)&&(a=le.access(e),s=w.extend({},a),le.set(t,s))}}function Ye(e,t){var n=t.nodeName.toLowerCase();"input"===n&&we.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function Ze(e,t,n,r){t=l(t);var i,a,s,o,u,c,d=0,f=e.length,h=f-1,p=t[0],g=y(p);if(g||f>1&&"string"==typeof p&&!m.checkClone&&Be.test(p))return e.each((function(i){var a=e.eq(i);g&&(t[0]=p.call(this,i,a.html())),Ze(a,t,n,r)}));if(f&&(a=(i=Pe(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=a),a||r)){for(o=(s=w.map(De(i,"script"),He)).length;d<f;d++)u=i,d!==h&&(u=w.clone(u,!0,!0),o&&w.merge(s,De(u,"script"))),n.call(e[d],u,d);if(o)for(c=s[s.length-1].ownerDocument,w.map(s,Ge),d=0;d<o;d++)u=s[d],Ce.test(u.type||"")&&!oe.access(u,"globalEval")&&w.contains(c,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?w._evalUrl&&!u.noModule&&w._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},c):E(u.textContent.replace(je,""),u,c))}return e}function Ke(e,t,n){for(var r,i=t?w.filter(t,e):e,a=0;null!=(r=i[a]);a++)n||1!==r.nodeType||w.cleanData(De(r)),r.parentNode&&(n&&me(r)&&Ne(De(r,"script")),r.parentNode.removeChild(r));return e}w.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,a,s,o=e.cloneNode(!0),l=me(e);if(!(m.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||w.isXMLDoc(e)))for(s=De(o),r=0,i=(a=De(e)).length;r<i;r++)Ye(a[r],s[r]);if(t)if(n)for(a=a||De(e),s=s||De(o),r=0,i=a.length;r<i;r++)Ve(a[r],s[r]);else Ve(e,o);return(s=De(o,"script")).length>0&&Ne(s,!l&&De(e,"script")),o},cleanData:function(e){for(var t,n,r,i=w.event.special,a=0;void 0!==(n=e[a]);a++)if(ae(n)){if(t=n[oe.expando]){if(t.events)for(r in t.events)i[r]?w.event.remove(n,r):w.removeEvent(n,r,t.handle);n[oe.expando]=void 0}n[le.expando]&&(n[le.expando]=void 0)}}}),w.fn.extend({detach:function(e){return Ke(this,e,!0)},remove:function(e){return Ke(this,e)},text:function(e){return ee(this,(function(e){return void 0===e?w.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return Ze(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||qe(this,e).appendChild(e)}))},prepend:function(){return Ze(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=qe(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return Ze(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return Ze(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(w.cleanData(De(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return w.clone(this,e,t)}))},html:function(e){return ee(this,(function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ue.test(e)&&!Re[(Ie.exec(e)||["",""])[1].toLowerCase()]){e=w.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(w.cleanData(De(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)}),null,e,arguments.length)},replaceWith:function(){var e=[];return Ze(this,arguments,(function(t){var n=this.parentNode;w.inArray(this,e)<0&&(w.cleanData(De(this)),n&&n.replaceChild(t,this))}),e)}}),w.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(e,t){w.fn[e]=function(e){for(var n,r=[],i=w(e),a=i.length-1,s=0;s<=a;s++)n=s===a?this:this.clone(!0),w(i[s])[t](n),u.apply(r,n.get());return this.pushStack(r)}}));var ze=new RegExp("^("+fe+")(?!px)[a-z%]+$","i"),We=/^--/,Xe=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=r),t.getComputedStyle(e)},$e=function(e,t,n){var r,i,a={};for(i in t)a[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=a[i];return r},Qe=new RegExp(pe.join("|"),"i");function Je(e,t,n){var r,i,a,s,o=We.test(t),l=e.style;return(n=n||Xe(e))&&(s=n.getPropertyValue(t)||n[t],o&&s&&(s=s.replace(P,"$1")||void 0),""!==s||me(e)||(s=w.style(e,t)),!m.pixelBoxStyles()&&ze.test(s)&&Qe.test(t)&&(r=l.width,i=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=s,s=n.width,l.width=r,l.minWidth=i,l.maxWidth=a)),void 0!==s?s+"":s}function et(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(c){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ge.appendChild(u).appendChild(c);var e=r.getComputedStyle(c);n="1%"!==e.top,l=12===t(e.marginLeft),c.style.right="60%",s=36===t(e.right),i=36===t(e.width),c.style.position="absolute",a=12===t(c.offsetWidth/3),ge.removeChild(u),c=null}}function t(e){return Math.round(parseFloat(e))}var n,i,a,s,o,l,u=_.createElement("div"),c=_.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",m.clearCloneStyle="content-box"===c.style.backgroundClip,w.extend(m,{boxSizingReliable:function(){return e(),i},pixelBoxStyles:function(){return e(),s},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),l},scrollboxSize:function(){return e(),a},reliableTrDimensions:function(){var e,t,n,i;return null==o&&(e=_.createElement("table"),t=_.createElement("tr"),n=_.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",t.style.cssText="box-sizing:content-box;border:1px solid",t.style.height="1px",n.style.height="9px",n.style.display="block",ge.appendChild(e).appendChild(t).appendChild(n),i=r.getComputedStyle(t),o=parseInt(i.height,10)+parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10)===t.offsetHeight,ge.removeChild(e)),o}}))}();var tt=["Webkit","Moz","ms"],nt=_.createElement("div").style,rt={};function it(e){return w.cssProps[e]||rt[e]||(e in nt?e:rt[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=tt.length;n--;)if((e=tt[n]+t)in nt)return e}(e)||e)}var at=/^(none|table(?!-c[ea]).+)/,st={position:"absolute",visibility:"hidden",display:"block"},ot={letterSpacing:"0",fontWeight:"400"};function lt(e,t,n){var r=he.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function ut(e,t,n,r,i,a){var s="width"===t?1:0,o=0,l=0,u=0;if(n===(r?"border":"content"))return 0;for(;s<4;s+=2)"margin"===n&&(u+=w.css(e,n+pe[s],!0,i)),r?("content"===n&&(l-=w.css(e,"padding"+pe[s],!0,i)),"margin"!==n&&(l-=w.css(e,"border"+pe[s]+"Width",!0,i))):(l+=w.css(e,"padding"+pe[s],!0,i),"padding"!==n?l+=w.css(e,"border"+pe[s]+"Width",!0,i):o+=w.css(e,"border"+pe[s]+"Width",!0,i));return!r&&a>=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-a-l-o-.5))||0),l+u}function ct(e,t,n){var r=Xe(e),i=(!m.boxSizingReliable()||n)&&"border-box"===w.css(e,"boxSizing",!1,r),a=i,s=Je(e,t,r),o="offset"+t[0].toUpperCase()+t.slice(1);if(ze.test(s)){if(!n)return s;s="auto"}return(!m.boxSizingReliable()&&i||!m.reliableTrDimensions()&&C(e,"tr")||"auto"===s||!parseFloat(s)&&"inline"===w.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===w.css(e,"boxSizing",!1,r),(a=o in e)&&(s=e[o])),(s=parseFloat(s)||0)+ut(e,t,n||(i?"border":"content"),a,r,s)+"px"}function dt(e,t,n,r,i){return new dt.prototype.init(e,t,n,r,i)}w.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Je(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,a,s,o=ie(t),l=We.test(t),u=e.style;if(l||(t=it(o)),s=w.cssHooks[t]||w.cssHooks[o],void 0===n)return s&&"get"in s&&void 0!==(i=s.get(e,!1,r))?i:u[t];"string"==(a=typeof n)&&(i=he.exec(n))&&i[1]&&(n=_e(e,t,i),a="number"),null!=n&&n==n&&("number"!==a||l||(n+=i&&i[3]||(w.cssNumber[o]?"":"px")),m.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),s&&"set"in s&&void 0===(n=s.set(e,n,r))||(l?u.setProperty(t,n):u[t]=n))}},css:function(e,t,n,r){var i,a,s,o=ie(t);return We.test(t)||(t=it(o)),(s=w.cssHooks[t]||w.cssHooks[o])&&"get"in s&&(i=s.get(e,!0,n)),void 0===i&&(i=Je(e,t,r)),"normal"===i&&t in ot&&(i=ot[t]),""===n||n?(a=parseFloat(i),!0===n||isFinite(a)?a||0:i):i}}),w.each(["height","width"],(function(e,t){w.cssHooks[t]={get:function(e,n,r){if(n)return!at.test(w.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?ct(e,t,r):$e(e,st,(function(){return ct(e,t,r)}))},set:function(e,n,r){var i,a=Xe(e),s=!m.scrollboxSize()&&"absolute"===a.position,o=(s||r)&&"border-box"===w.css(e,"boxSizing",!1,a),l=r?ut(e,t,r,o,a):0;return o&&s&&(l-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(a[t])-ut(e,t,"border",!1,a)-.5)),l&&(i=he.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=w.css(e,t)),lt(0,n,l)}}})),w.cssHooks.marginLeft=et(m.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(Je(e,"marginLeft"))||e.getBoundingClientRect().left-$e(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),w.each({margin:"",padding:"",border:"Width"},(function(e,t){w.cssHooks[e+t]={expand:function(n){for(var r=0,i={},a="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+pe[r]+t]=a[r]||a[r-2]||a[0];return i}},"margin"!==e&&(w.cssHooks[e+t].set=lt)})),w.fn.extend({css:function(e,t){return ee(this,(function(e,t,n){var r,i,a={},s=0;if(Array.isArray(t)){for(r=Xe(e),i=t.length;s<i;s++)a[t[s]]=w.css(e,t[s],!1,r);return a}return void 0!==n?w.style(e,t,n):w.css(e,t)}),e,t,arguments.length>1)}}),w.Tween=dt,dt.prototype={constructor:dt,init:function(e,t,n,r,i,a){this.elem=e,this.prop=n,this.easing=i||w.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=a||(w.cssNumber[n]?"":"px")},cur:function(){var e=dt.propHooks[this.prop];return e&&e.get?e.get(this):dt.propHooks._default.get(this)},run:function(e){var t,n=dt.propHooks[this.prop];return this.options.duration?this.pos=t=w.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):dt.propHooks._default.set(this),this}},dt.prototype.init.prototype=dt.prototype,dt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=w.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){w.fx.step[e.prop]?w.fx.step[e.prop](e):1!==e.elem.nodeType||!w.cssHooks[e.prop]&&null==e.elem.style[it(e.prop)]?e.elem[e.prop]=e.now:w.style(e.elem,e.prop,e.now+e.unit)}}},dt.propHooks.scrollTop=dt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},w.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},w.fx=dt.prototype.init,w.fx.step={};var ft,ht,pt=/^(?:toggle|show|hide)$/,gt=/queueHooks$/;function mt(){ht&&(!1===_.hidden&&r.requestAnimationFrame?r.requestAnimationFrame(mt):r.setTimeout(mt,w.fx.interval),w.fx.tick())}function yt(){return r.setTimeout((function(){ft=void 0})),ft=Date.now()}function vt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=pe[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function _t(e,t,n){for(var r,i=(Tt.tweeners[t]||[]).concat(Tt.tweeners["*"]),a=0,s=i.length;a<s;a++)if(r=i[a].call(n,t,e))return r}function Tt(e,t,n){var r,i,a=0,s=Tt.prefilters.length,o=w.Deferred().always((function(){delete l.elem})),l=function(){if(i)return!1;for(var t=ft||yt(),n=Math.max(0,u.startTime+u.duration-t),r=1-(n/u.duration||0),a=0,s=u.tweens.length;a<s;a++)u.tweens[a].run(r);return o.notifyWith(e,[u,r,n]),r<1&&s?n:(s||o.notifyWith(e,[u,1,0]),o.resolveWith(e,[u]),!1)},u=o.promise({elem:e,props:w.extend({},t),opts:w.extend(!0,{specialEasing:{},easing:w.easing._default},n),originalProperties:t,originalOptions:n,startTime:ft||yt(),duration:n.duration,tweens:[],createTween:function(t,n){var r=w.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)u.tweens[n].run(1);return t?(o.notifyWith(e,[u,1,0]),o.resolveWith(e,[u,t])):o.rejectWith(e,[u,t]),this}}),c=u.props;for(function(e,t){var n,r,i,a,s;for(n in e)if(i=t[r=ie(n)],a=e[n],Array.isArray(a)&&(i=a[1],a=e[n]=a[0]),n!==r&&(e[r]=a,delete e[n]),(s=w.cssHooks[r])&&"expand"in s)for(n in a=s.expand(a),delete e[r],a)n in e||(e[n]=a[n],t[n]=i);else t[r]=i}(c,u.opts.specialEasing);a<s;a++)if(r=Tt.prefilters[a].call(u,e,c,u.opts))return y(r.stop)&&(w._queueHooks(u.elem,u.opts.queue).stop=r.stop.bind(r)),r;return w.map(c,_t,u),y(u.opts.start)&&u.opts.start.call(e,u),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always),w.fx.timer(w.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u}w.Animation=w.extend(Tt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return _e(n.elem,e,he.exec(t),n),n}]},tweener:function(e,t){y(e)?(t=e,e=["*"]):e=e.match(K);for(var n,r=0,i=e.length;r<i;r++)n=e[r],Tt.tweeners[n]=Tt.tweeners[n]||[],Tt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,a,s,o,l,u,c,d="width"in t||"height"in t,f=this,h={},p=e.style,g=e.nodeType&&ve(e),m=oe.get(e,"fxshow");for(r in n.queue||(null==(s=w._queueHooks(e,"fx")).unqueued&&(s.unqueued=0,o=s.empty.fire,s.empty.fire=function(){s.unqueued||o()}),s.unqueued++,f.always((function(){f.always((function(){s.unqueued--,w.queue(e,"fx").length||s.empty.fire()}))}))),t)if(i=t[r],pt.test(i)){if(delete t[r],a=a||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!m||void 0===m[r])continue;g=!0}h[r]=m&&m[r]||w.style(e,r)}if((l=!w.isEmptyObject(t))||!w.isEmptyObject(h))for(r in d&&1===e.nodeType&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],null==(u=m&&m.display)&&(u=oe.get(e,"display")),"none"===(c=w.css(e,"display"))&&(u?c=u:(be([e],!0),u=e.style.display||u,c=w.css(e,"display"),be([e]))),("inline"===c||"inline-block"===c&&null!=u)&&"none"===w.css(e,"float")&&(l||(f.done((function(){p.display=u})),null==u&&(c=p.display,u="none"===c?"":c)),p.display="inline-block")),n.overflow&&(p.overflow="hidden",f.always((function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}))),l=!1,h)l||(m?"hidden"in m&&(g=m.hidden):m=oe.access(e,"fxshow",{display:u}),a&&(m.hidden=!g),g&&be([e],!0),f.done((function(){for(r in g||be([e]),oe.remove(e,"fxshow"),h)w.style(e,r,h[r])}))),l=_t(g?m[r]:0,r,f),r in m||(m[r]=l.start,g&&(l.end=l.start,l.start=0))}],prefilter:function(e,t){t?Tt.prefilters.unshift(e):Tt.prefilters.push(e)}}),w.speed=function(e,t,n){var r=e&&"object"==typeof e?w.extend({},e):{complete:n||!n&&t||y(e)&&e,duration:e,easing:n&&t||t&&!y(t)&&t};return w.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in w.fx.speeds?r.duration=w.fx.speeds[r.duration]:r.duration=w.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){y(r.old)&&r.old.call(this),r.queue&&w.dequeue(this,r.queue)},r},w.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ve).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=w.isEmptyObject(e),a=w.speed(t,n,r),s=function(){var t=Tt(this,w.extend({},e),a);(i||oe.get(this,"finish"))&&t.stop(!0)};return s.finish=s,i||!1===a.queue?this.each(s):this.queue(a.queue,s)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&this.queue(e||"fx",[]),this.each((function(){var t=!0,i=null!=e&&e+"queueHooks",a=w.timers,s=oe.get(this);if(i)s[i]&&s[i].stop&&r(s[i]);else for(i in s)s[i]&&s[i].stop&&gt.test(i)&&r(s[i]);for(i=a.length;i--;)a[i].elem!==this||null!=e&&a[i].queue!==e||(a[i].anim.stop(n),t=!1,a.splice(i,1));!t&&n||w.dequeue(this,e)}))},finish:function(e){return!1!==e&&(e=e||"fx"),this.each((function(){var t,n=oe.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],a=w.timers,s=r?r.length:0;for(n.finish=!0,w.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=a.length;t--;)a[t].elem===this&&a[t].queue===e&&(a[t].anim.stop(!0),a.splice(t,1));for(t=0;t<s;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish}))}}),w.each(["toggle","show","hide"],(function(e,t){var n=w.fn[t];w.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(vt(t,!0),e,r,i)}})),w.each({slideDown:vt("show"),slideUp:vt("hide"),slideToggle:vt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(e,t){w.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}})),w.timers=[],w.fx.tick=function(){var e,t=0,n=w.timers;for(ft=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||w.fx.stop(),ft=void 0},w.fx.timer=function(e){w.timers.push(e),w.fx.start()},w.fx.interval=13,w.fx.start=function(){ht||(ht=!0,mt())},w.fx.stop=function(){ht=null},w.fx.speeds={slow:600,fast:200,_default:400},w.fn.delay=function(e,t){return e=w.fx&&w.fx.speeds[e]||e,t=t||"fx",this.queue(t,(function(t,n){var i=r.setTimeout(t,e);n.stop=function(){r.clearTimeout(i)}}))},function(){var e=_.createElement("input"),t=_.createElement("select").appendChild(_.createElement("option"));e.type="checkbox",m.checkOn=""!==e.value,m.optSelected=t.selected,(e=_.createElement("input")).value="t",e.type="radio",m.radioValue="t"===e.value}();var Et,bt=w.expr.attrHandle;w.fn.extend({attr:function(e,t){return ee(this,w.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each((function(){w.removeAttr(this,e)}))}}),w.extend({attr:function(e,t,n){var r,i,a=e.nodeType;if(3!==a&&8!==a&&2!==a)return void 0===e.getAttribute?w.prop(e,t,n):(1===a&&w.isXMLDoc(e)||(i=w.attrHooks[t.toLowerCase()]||(w.expr.match.bool.test(t)?Et:void 0)),void 0!==n?null===n?void w.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=w.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!m.radioValue&&"radio"===t&&C(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(K);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),Et={set:function(e,t,n){return!1===t?w.removeAttr(e,n):e.setAttribute(n,n),n}},w.each(w.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=bt[t]||w.find.attr;bt[t]=function(e,t,r){var i,a,s=t.toLowerCase();return r||(a=bt[s],bt[s]=i,i=null!=n(e,t,r)?s:null,bt[s]=a),i}}));var St=/^(?:input|select|textarea|button)$/i,At=/^(?:a|area)$/i;function wt(e){return(e.match(K)||[]).join(" ")}function It(e){return e.getAttribute&&e.getAttribute("class")||""}function Ct(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(K)||[]}w.fn.extend({prop:function(e,t){return ee(this,w.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[w.propFix[e]||e]}))}}),w.extend({prop:function(e,t,n){var r,i,a=e.nodeType;if(3!==a&&8!==a&&2!==a)return 1===a&&w.isXMLDoc(e)||(t=w.propFix[t]||t,i=w.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=w.find.attr(e,"tabindex");return t?parseInt(t,10):St.test(e.nodeName)||At.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),m.optSelected||(w.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),w.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){w.propFix[this.toLowerCase()]=this})),w.fn.extend({addClass:function(e){var t,n,r,i,a,s;return y(e)?this.each((function(t){w(this).addClass(e.call(this,t,It(this)))})):(t=Ct(e)).length?this.each((function(){if(r=It(this),n=1===this.nodeType&&" "+wt(r)+" "){for(a=0;a<t.length;a++)i=t[a],n.indexOf(" "+i+" ")<0&&(n+=i+" ");s=wt(n),r!==s&&this.setAttribute("class",s)}})):this},removeClass:function(e){var t,n,r,i,a,s;return y(e)?this.each((function(t){w(this).removeClass(e.call(this,t,It(this)))})):arguments.length?(t=Ct(e)).length?this.each((function(){if(r=It(this),n=1===this.nodeType&&" "+wt(r)+" "){for(a=0;a<t.length;a++)for(i=t[a];n.indexOf(" "+i+" ")>-1;)n=n.replace(" "+i+" "," ");s=wt(n),r!==s&&this.setAttribute("class",s)}})):this:this.attr("class","")},toggleClass:function(e,t){var n,r,i,a,s=typeof e,o="string"===s||Array.isArray(e);return y(e)?this.each((function(n){w(this).toggleClass(e.call(this,n,It(this),t),t)})):"boolean"==typeof t&&o?t?this.addClass(e):this.removeClass(e):(n=Ct(e),this.each((function(){if(o)for(a=w(this),i=0;i<n.length;i++)r=n[i],a.hasClass(r)?a.removeClass(r):a.addClass(r);else void 0!==e&&"boolean"!==s||((r=It(this))&&oe.set(this,"__className__",r),this.setAttribute&&this.setAttribute("class",r||!1===e?"":oe.get(this,"__className__")||""))})))},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+wt(It(n))+" ").indexOf(t)>-1)return!0;return!1}});var Rt=/\r/g;w.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=y(e),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,w(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=w.map(i,(function(e){return null==e?"":e+""}))),(t=w.valHooks[this.type]||w.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))}))):i?(t=w.valHooks[i.type]||w.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(Rt,""):null==n?"":n:void 0}}),w.extend({valHooks:{option:{get:function(e){var t=w.find.attr(e,"value");return null!=t?t:wt(w.text(e))}},select:{get:function(e){var t,n,r,i=e.options,a=e.selectedIndex,s="select-one"===e.type,o=s?null:[],l=s?a+1:i.length;for(r=a<0?l:s?a:0;r<l;r++)if(((n=i[r]).selected||r===a)&&!n.disabled&&(!n.parentNode.disabled||!C(n.parentNode,"optgroup"))){if(t=w(n).val(),s)return t;o.push(t)}return o},set:function(e,t){for(var n,r,i=e.options,a=w.makeArray(t),s=i.length;s--;)((r=i[s]).selected=w.inArray(w.valHooks.option.get(r),a)>-1)&&(n=!0);return n||(e.selectedIndex=-1),a}}}}),w.each(["radio","checkbox"],(function(){w.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=w.inArray(w(e).val(),t)>-1}},m.checkOn||(w.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}));var Dt=r.location,Nt={guid:Date.now()},Ot=/\?/;w.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new r.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||w.error("Invalid XML: "+(n?w.map(n.childNodes,(function(e){return e.textContent})).join("\n"):e)),t};var Pt=/^(?:focusinfocus|focusoutblur)$/,Mt=function(e){e.stopPropagation()};w.extend(w.event,{trigger:function(e,t,n,i){var a,s,o,l,u,c,d,f,p=[n||_],g=h.call(e,"type")?e.type:e,m=h.call(e,"namespace")?e.namespace.split("."):[];if(s=f=o=n=n||_,3!==n.nodeType&&8!==n.nodeType&&!Pt.test(g+w.event.triggered)&&(g.indexOf(".")>-1&&(m=g.split("."),g=m.shift(),m.sort()),u=g.indexOf(":")<0&&"on"+g,(e=e[w.expando]?e:new w.Event(g,"object"==typeof e&&e)).isTrigger=i?2:3,e.namespace=m.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:w.makeArray(t,[e]),d=w.event.special[g]||{},i||!d.trigger||!1!==d.trigger.apply(n,t))){if(!i&&!d.noBubble&&!v(n)){for(l=d.delegateType||g,Pt.test(l+g)||(s=s.parentNode);s;s=s.parentNode)p.push(s),o=s;o===(n.ownerDocument||_)&&p.push(o.defaultView||o.parentWindow||r)}for(a=0;(s=p[a++])&&!e.isPropagationStopped();)f=s,e.type=a>1?l:d.bindType||g,(c=(oe.get(s,"events")||Object.create(null))[e.type]&&oe.get(s,"handle"))&&c.apply(s,t),(c=u&&s[u])&&c.apply&&ae(s)&&(e.result=c.apply(s,t),!1===e.result&&e.preventDefault());return e.type=g,i||e.isDefaultPrevented()||d._default&&!1!==d._default.apply(p.pop(),t)||!ae(n)||u&&y(n[g])&&!v(n)&&((o=n[u])&&(n[u]=null),w.event.triggered=g,e.isPropagationStopped()&&f.addEventListener(g,Mt),n[g](),e.isPropagationStopped()&&f.removeEventListener(g,Mt),w.event.triggered=void 0,o&&(n[u]=o)),e.result}},simulate:function(e,t,n){var r=w.extend(new w.Event,n,{type:e,isSimulated:!0});w.event.trigger(r,null,t)}}),w.fn.extend({trigger:function(e,t){return this.each((function(){w.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return w.event.trigger(e,t,n,!0)}});var xt=/\[\]$/,Lt=/\r?\n/g,kt=/^(?:submit|button|image|reset|file)$/i,Ft=/^(?:input|select|textarea|keygen)/i;function Ut(e,t,n,r){var i;if(Array.isArray(t))w.each(t,(function(t,i){n||xt.test(e)?r(e,i):Ut(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)}));else if(n||"object"!==b(t))r(e,t);else for(i in t)Ut(e+"["+i+"]",t[i],n,r)}w.param=function(e,t){var n,r=[],i=function(e,t){var n=y(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!w.isPlainObject(e))w.each(e,(function(){i(this.name,this.value)}));else for(n in e)Ut(n,e[n],t,i);return r.join("&")},w.fn.extend({serialize:function(){return w.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=w.prop(this,"elements");return e?w.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!w(this).is(":disabled")&&Ft.test(this.nodeName)&&!kt.test(e)&&(this.checked||!we.test(e))})).map((function(e,t){var n=w(this).val();return null==n?null:Array.isArray(n)?w.map(n,(function(e){return{name:t.name,value:e.replace(Lt,"\r\n")}})):{name:t.name,value:n.replace(Lt,"\r\n")}})).get()}});var Bt=/%20/g,jt=/#.*$/,qt=/([?&])_=[^&]*/,Ht=/^(.*?):[ \t]*([^\r\n]*)$/gm,Gt=/^(?:GET|HEAD)$/,Vt=/^\/\//,Yt={},Zt={},Kt="*/".concat("*"),zt=_.createElement("a");function Wt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,a=t.toLowerCase().match(K)||[];if(y(n))for(;r=a[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Xt(e,t,n,r){var i={},a=e===Zt;function s(o){var l;return i[o]=!0,w.each(e[o]||[],(function(e,o){var u=o(t,n,r);return"string"!=typeof u||a||i[u]?a?!(l=u):void 0:(t.dataTypes.unshift(u),s(u),!1)})),l}return s(t.dataTypes[0])||!i["*"]&&s("*")}function $t(e,t){var n,r,i=w.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&w.extend(!0,e,r),e}zt.href=Dt.href,w.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Dt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Dt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Kt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":w.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?$t($t(e,w.ajaxSettings),t):$t(w.ajaxSettings,e)},ajaxPrefilter:Wt(Yt),ajaxTransport:Wt(Zt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,i,a,s,o,l,u,c,d,f,h=w.ajaxSetup({},t),p=h.context||h,g=h.context&&(p.nodeType||p.jquery)?w(p):w.event,m=w.Deferred(),y=w.Callbacks("once memory"),v=h.statusCode||{},T={},E={},b="canceled",S={readyState:0,getResponseHeader:function(e){var t;if(u){if(!s)for(s={};t=Ht.exec(a);)s[t[1].toLowerCase()+" "]=(s[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=s[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return u?a:null},setRequestHeader:function(e,t){return null==u&&(e=E[e.toLowerCase()]=E[e.toLowerCase()]||e,T[e]=t),this},overrideMimeType:function(e){return null==u&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(u)S.always(e[S.status]);else for(t in e)v[t]=[v[t],e[t]];return this},abort:function(e){var t=e||b;return n&&n.abort(t),A(0,t),this}};if(m.promise(S),h.url=((e||h.url||Dt.href)+"").replace(Vt,Dt.protocol+"//"),h.type=t.method||t.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(K)||[""],null==h.crossDomain){l=_.createElement("a");try{l.href=h.url,l.href=l.href,h.crossDomain=zt.protocol+"//"+zt.host!=l.protocol+"//"+l.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=w.param(h.data,h.traditional)),Xt(Yt,h,t,S),u)return S;for(d in(c=w.event&&h.global)&&0==w.active++&&w.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Gt.test(h.type),i=h.url.replace(jt,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(Bt,"+")):(f=h.url.slice(i.length),h.data&&(h.processData||"string"==typeof h.data)&&(i+=(Ot.test(i)?"&":"?")+h.data,delete h.data),!1===h.cache&&(i=i.replace(qt,"$1"),f=(Ot.test(i)?"&":"?")+"_="+Nt.guid+++f),h.url=i+f),h.ifModified&&(w.lastModified[i]&&S.setRequestHeader("If-Modified-Since",w.lastModified[i]),w.etag[i]&&S.setRequestHeader("If-None-Match",w.etag[i])),(h.data&&h.hasContent&&!1!==h.contentType||t.contentType)&&S.setRequestHeader("Content-Type",h.contentType),S.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+Kt+"; q=0.01":""):h.accepts["*"]),h.headers)S.setRequestHeader(d,h.headers[d]);if(h.beforeSend&&(!1===h.beforeSend.call(p,S,h)||u))return S.abort();if(b="abort",y.add(h.complete),S.done(h.success),S.fail(h.error),n=Xt(Zt,h,t,S)){if(S.readyState=1,c&&g.trigger("ajaxSend",[S,h]),u)return S;h.async&&h.timeout>0&&(o=r.setTimeout((function(){S.abort("timeout")}),h.timeout));try{u=!1,n.send(T,A)}catch(e){if(u)throw e;A(-1,e)}}else A(-1,"No Transport");function A(e,t,s,l){var d,f,_,T,E,b=t;u||(u=!0,o&&r.clearTimeout(o),n=void 0,a=l||"",S.readyState=e>0?4:0,d=e>=200&&e<300||304===e,s&&(T=function(e,t,n){for(var r,i,a,s,o=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in o)if(o[i]&&o[i].test(r)){l.unshift(i);break}if(l[0]in n)a=l[0];else{for(i in n){if(!l[0]||e.converters[i+" "+l[0]]){a=i;break}s||(s=i)}a=a||s}if(a)return a!==l[0]&&l.unshift(a),n[a]}(h,S,s)),!d&&w.inArray("script",h.dataTypes)>-1&&w.inArray("json",h.dataTypes)<0&&(h.converters["text script"]=function(){}),T=function(e,t,n,r){var i,a,s,o,l,u={},c=e.dataTypes.slice();if(c[1])for(s in e.converters)u[s.toLowerCase()]=e.converters[s];for(a=c.shift();a;)if(e.responseFields[a]&&(n[e.responseFields[a]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=a,a=c.shift())if("*"===a)a=l;else if("*"!==l&&l!==a){if(!(s=u[l+" "+a]||u["* "+a]))for(i in u)if((o=i.split(" "))[1]===a&&(s=u[l+" "+o[0]]||u["* "+o[0]])){!0===s?s=u[i]:!0!==u[i]&&(a=o[0],c.unshift(o[1]));break}if(!0!==s)if(s&&e.throws)t=s(t);else try{t=s(t)}catch(e){return{state:"parsererror",error:s?e:"No conversion from "+l+" to "+a}}}return{state:"success",data:t}}(h,T,S,d),d?(h.ifModified&&((E=S.getResponseHeader("Last-Modified"))&&(w.lastModified[i]=E),(E=S.getResponseHeader("etag"))&&(w.etag[i]=E)),204===e||"HEAD"===h.type?b="nocontent":304===e?b="notmodified":(b=T.state,f=T.data,d=!(_=T.error))):(_=b,!e&&b||(b="error",e<0&&(e=0))),S.status=e,S.statusText=(t||b)+"",d?m.resolveWith(p,[f,b,S]):m.rejectWith(p,[S,b,_]),S.statusCode(v),v=void 0,c&&g.trigger(d?"ajaxSuccess":"ajaxError",[S,h,d?f:_]),y.fireWith(p,[S,b]),c&&(g.trigger("ajaxComplete",[S,h]),--w.active||w.event.trigger("ajaxStop")))}return S},getJSON:function(e,t,n){return w.get(e,t,n,"json")},getScript:function(e,t){return w.get(e,void 0,t,"script")}}),w.each(["get","post"],(function(e,t){w[t]=function(e,n,r,i){return y(n)&&(i=i||r,r=n,n=void 0),w.ajax(w.extend({url:e,type:t,dataType:i,data:n,success:r},w.isPlainObject(e)&&e))}})),w.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),w._evalUrl=function(e,t,n){return w.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){w.globalEval(e,t,n)}})},w.fn.extend({wrapAll:function(e){var t;return this[0]&&(y(e)&&(e=e.call(this[0])),t=w(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return y(e)?this.each((function(t){w(this).wrapInner(e.call(this,t))})):this.each((function(){var t=w(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=y(e);return this.each((function(n){w(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){w(this).replaceWith(this.childNodes)})),this}}),w.expr.pseudos.hidden=function(e){return!w.expr.pseudos.visible(e)},w.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},w.ajaxSettings.xhr=function(){try{return new r.XMLHttpRequest}catch(e){}};var Qt={0:200,1223:204},Jt=w.ajaxSettings.xhr();m.cors=!!Jt&&"withCredentials"in Jt,m.ajax=Jt=!!Jt,w.ajaxTransport((function(e){var t,n;if(m.cors||Jt&&!e.crossDomain)return{send:function(i,a){var s,o=e.xhr();if(o.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(s in e.xhrFields)o[s]=e.xhrFields[s];for(s in e.mimeType&&o.overrideMimeType&&o.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)o.setRequestHeader(s,i[s]);t=function(e){return function(){t&&(t=n=o.onload=o.onerror=o.onabort=o.ontimeout=o.onreadystatechange=null,"abort"===e?o.abort():"error"===e?"number"!=typeof o.status?a(0,"error"):a(o.status,o.statusText):a(Qt[o.status]||o.status,o.statusText,"text"!==(o.responseType||"text")||"string"!=typeof o.responseText?{binary:o.response}:{text:o.responseText},o.getAllResponseHeaders()))}},o.onload=t(),n=o.onerror=o.ontimeout=t("error"),void 0!==o.onabort?o.onabort=n:o.onreadystatechange=function(){4===o.readyState&&r.setTimeout((function(){t&&n()}))},t=t("abort");try{o.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}})),w.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),w.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return w.globalEval(e),e}}}),w.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),w.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,i){t=w("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),_.head.appendChild(t[0])},abort:function(){n&&n()}}}));var en,tn=[],nn=/(=)\?(?=&|$)|\?\?/;w.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=tn.pop()||w.expando+"_"+Nt.guid++;return this[e]=!0,e}}),w.ajaxPrefilter("json jsonp",(function(e,t,n){var i,a,s,o=!1!==e.jsonp&&(nn.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&nn.test(e.data)&&"data");if(o||"jsonp"===e.dataTypes[0])return i=e.jsonpCallback=y(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,o?e[o]=e[o].replace(nn,"$1"+i):!1!==e.jsonp&&(e.url+=(Ot.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return s||w.error(i+" was not called"),s[0]},e.dataTypes[0]="json",a=r[i],r[i]=function(){s=arguments},n.always((function(){void 0===a?w(r).removeProp(i):r[i]=a,e[i]&&(e.jsonpCallback=t.jsonpCallback,tn.push(i)),s&&y(a)&&a(s[0]),s=a=void 0})),"script"})),m.createHTMLDocument=((en=_.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===en.childNodes.length),w.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(m.createHTMLDocument?((r=(t=_.implementation.createHTMLDocument("")).createElement("base")).href=_.location.href,t.head.appendChild(r)):t=_),a=!n&&[],(i=j.exec(e))?[t.createElement(i[1])]:(i=Pe([e],t,a),a&&a.length&&w(a).remove(),w.merge([],i.childNodes)));var r,i,a},w.fn.load=function(e,t,n){var r,i,a,s=this,o=e.indexOf(" ");return o>-1&&(r=wt(e.slice(o)),e=e.slice(0,o)),y(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),s.length>0&&w.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done((function(e){a=arguments,s.html(r?w("<div>").append(w.parseHTML(e)).find(r):e)})).always(n&&function(e,t){s.each((function(){n.apply(this,a||[e.responseText,t,e])}))}),this},w.expr.pseudos.animated=function(e){return w.grep(w.timers,(function(t){return e===t.elem})).length},w.offset={setOffset:function(e,t,n){var r,i,a,s,o,l,u=w.css(e,"position"),c=w(e),d={};"static"===u&&(e.style.position="relative"),o=c.offset(),a=w.css(e,"top"),l=w.css(e,"left"),("absolute"===u||"fixed"===u)&&(a+l).indexOf("auto")>-1?(s=(r=c.position()).top,i=r.left):(s=parseFloat(a)||0,i=parseFloat(l)||0),y(t)&&(t=t.call(e,n,w.extend({},o))),null!=t.top&&(d.top=t.top-o.top+s),null!=t.left&&(d.left=t.left-o.left+i),"using"in t?t.using.call(e,d):c.css(d)}},w.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){w.offset.setOffset(this,e,t)}));var t,n,r=this[0];return r?r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===w.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===w.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=w(e).offset()).top+=w.css(e,"borderTopWidth",!0),i.left+=w.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-w.css(r,"marginTop",!0),left:t.left-i.left-w.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent;e&&"static"===w.css(e,"position");)e=e.offsetParent;return e||ge}))}}),w.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var n="pageYOffset"===t;w.fn[e]=function(r){return ee(this,(function(e,r,i){var a;if(v(e)?a=e:9===e.nodeType&&(a=e.defaultView),void 0===i)return a?a[t]:e[r];a?a.scrollTo(n?a.pageXOffset:i,n?i:a.pageYOffset):e[r]=i}),e,r,arguments.length)}})),w.each(["top","left"],(function(e,t){w.cssHooks[t]=et(m.pixelPosition,(function(e,n){if(n)return n=Je(e,t),ze.test(n)?w(e).position()[t]+"px":n}))})),w.each({Height:"height",Width:"width"},(function(e,t){w.each({padding:"inner"+e,content:t,"":"outer"+e},(function(n,r){w.fn[r]=function(i,a){var s=arguments.length&&(n||"boolean"!=typeof i),o=n||(!0===i||!0===a?"margin":"border");return ee(this,(function(t,n,i){var a;return v(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(a=t.documentElement,Math.max(t.body["scroll"+e],a["scroll"+e],t.body["offset"+e],a["offset"+e],a["client"+e])):void 0===i?w.css(t,n,o):w.style(t,n,i,o)}),t,s?i:void 0,s)}}))})),w.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(e,t){w.fn[t]=function(e){return this.on(t,e)}})),w.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),w.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(e,t){w.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}));var rn=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;w.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),y(e))return r=o.call(arguments,2),i=function(){return e.apply(t||this,r.concat(o.call(arguments)))},i.guid=e.guid=e.guid||w.guid++,i},w.holdReady=function(e){e?w.readyWait++:w.ready(!0)},w.isArray=Array.isArray,w.parseJSON=JSON.parse,w.nodeName=C,w.isFunction=y,w.isWindow=v,w.camelCase=ie,w.type=b,w.now=Date.now,w.isNumeric=function(e){var t=w.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},w.trim=function(e){return null==e?"":(e+"").replace(rn,"$1")},void 0===(n=function(){return w}.apply(t,[]))||(e.exports=n);var an=r.jQuery,sn=r.$;return w.noConflict=function(e){return r.$===w&&(r.$=sn),e&&r.jQuery===w&&(r.jQuery=an),w},void 0===i&&(r.jQuery=r.$=w),w}))},7537:(e,t)=>{function n(e){if(e&&"object"==typeof e){var t=e.which||e.keyCode||e.charCode;t&&(e=t)}if("number"==typeof e)return s[e];var n,a=String(e);return(n=r[a.toLowerCase()])?n:(n=i[a.toLowerCase()])||(1===a.length?a.charCodeAt(0):void 0)}n.isEventKey=function(e,t){if(e&&"object"==typeof e){var n=e.which||e.keyCode||e.charCode;if(null==n)return!1;if("string"==typeof t){var a;if(a=r[t.toLowerCase()])return a===n;if(a=i[t.toLowerCase()])return a===n}else if("number"==typeof t)return t===n;return!1}};var r=(t=e.exports=n).code=t.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},i=t.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(a=97;a<123;a++)r[String.fromCharCode(a)]=a-32;for(var a=48;a<58;a++)r[a-48]=a;for(a=1;a<13;a++)r["f"+a]=a+111;for(a=0;a<10;a++)r["numpad "+a]=a+96;var s=t.names=t.title={};for(a in r)s[r[a]]=a;for(var o in i)r[o]=i[o]},4221:(e,t,n)=>{var r=n(6894).getUint64;e.exports=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8)},i=12;0===n.version?(n.earliestPresentationTime=t.getUint32(i),n.firstOffset=t.getUint32(i+4),i+=8):(n.earliestPresentationTime=r(e.subarray(i)),n.firstOffset=r(e.subarray(i+8)),i+=16),i+=2;var a=t.getUint16(i);for(i+=2;a>0;i+=12,a--)n.references.push({referenceType:(128&e[i])>>>7,referencedSize:2147483647&t.getUint32(i),subsegmentDuration:t.getUint32(i+4),startsWithSap:!!(128&e[i+8]),sapType:(112&e[i+8])>>>4,sapDeltaTime:268435455&t.getUint32(i+8)});return n}},1489:e=>{var t,n,r,i,a,s,o,l=9e4;t=function(e){return e*l},n=function(e,t){return e*t},r=function(e){return e/l},i=function(e,t){return e/t},a=function(e,n){return t(i(e,n))},s=function(e,t){return n(r(e),t)},o=function(e,t,n){return r(n?e:e-t)},e.exports={ONE_SECOND_IN_TS:l,secondsToVideoTs:t,secondsToAudioTs:n,videoTsToSeconds:r,audioTsToSeconds:i,audioTsToVideoTs:a,videoTsToAudioTs:s,metadataTsToSeconds:o}},6894:e=>{var t=Math.pow(2,32);e.exports={getUint64:function(e){var n,r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getBigUint64?(n=r.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(n):n:r.getUint32(0)*t+r.getUint32(4)},MAX_UINT32:t}},5974:e=>{e.exports=function(e,t){var n,r=null;try{n=JSON.parse(e,t)}catch(e){r=e}return[r,n]}},9945:function(e){var t,n,r,i,a;t=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,n=/^(?=([^\/?#]*))\1([^]*)$/,r=/(?:\/|^)\.(?=\/)/g,i=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,a={buildAbsoluteURL:function(e,t,r){if(r=r||{},e=e.trim(),!(t=t.trim())){if(!r.alwaysNormalize)return e;var i=a.parseURL(e);if(!i)throw new Error("Error trying to parse base URL.");return i.path=a.normalizePath(i.path),a.buildURLFromParts(i)}var s=a.parseURL(t);if(!s)throw new Error("Error trying to parse relative URL.");if(s.scheme)return r.alwaysNormalize?(s.path=a.normalizePath(s.path),a.buildURLFromParts(s)):t;var o=a.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var l=n.exec(o.path);o.netLoc=l[1],o.path=l[2]}o.netLoc&&!o.path&&(o.path="/");var u={scheme:o.scheme,netLoc:s.netLoc,path:null,params:s.params,query:s.query,fragment:s.fragment};if(!s.netLoc&&(u.netLoc=o.netLoc,"/"!==s.path[0]))if(s.path){var c=o.path,d=c.substring(0,c.lastIndexOf("/")+1)+s.path;u.path=a.normalizePath(d)}else u.path=o.path,s.params||(u.params=o.params,s.query||(u.query=o.query));return null===u.path&&(u.path=r.alwaysNormalize?a.normalizePath(s.path):s.path),a.buildURLFromParts(u)},parseURL:function(e){var n=t.exec(e);return n?{scheme:n[1]||"",netLoc:n[2]||"",path:n[3]||"",params:n[4]||"",query:n[5]||"",fragment:n[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(r,"");e.length!==(e=e.replace(i,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=a},3033:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>hs});var r=n(8908),i=n.n(r),a=n(9144),s=n.n(a),o=n(7537),l=n.n(o),u=n(5974),c=n.n(u),d=n(9603),f=n.n(d),h=n(3407),p=n.n(h),g=n(7462),m=n(9945),y=n.n(m);const v=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=i().location&&i().location.href||"");var n="function"==typeof i().URL,r=/^\/\//.test(e),a=!i().location&&!/\/\//i.test(e);if(n?e=new(i().URL)(e,i().location||"http://example.com"):/\/\//i.test(e)||(e=y().buildAbsoluteURL(i().location&&i().location.href||"",e)),n){var s=new URL(t,e);return a?s.href.slice(18):r?s.href.slice(s.protocol.length):s.href}return y().buildAbsoluteURL(e,t)};var _=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var n=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(n,1),n>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var n=t.length,r=0;r<n;++r)t[r].call(this,arguments[1]);else for(var i=Array.prototype.slice.call(arguments,1),a=t.length,s=0;s<a;++s)t[s].apply(this,i)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}();function T(e){for(var t=function(e){return i().atob?i().atob(e):Buffer.from(e,"base64").toString("binary")}(e),n=new Uint8Array(t.length),r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}class E extends _{constructor(){super(),this.buffer=""}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf("\n");t>-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const b=String.fromCharCode(9),S=function(e){const t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),n={};return t[1]&&(n.length=parseInt(t[1],10)),t[2]&&(n.offset=parseInt(t[2],10)),n},A=function(e){const t={};if(!e)return t;const n=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))'));let r,i=n.length;for(;i--;)""!==n[i]&&(r=/([^=]*)=(.*)/.exec(n[i]).slice(1),r[0]=r[0].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^['"](.*)['"]$/g,"$1"),t[r[0]]=r[1]);return t};class w extends _{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,n;0!==(e=e.trim()).length&&("#"===e[0]?this.tagMappers.reduce(((t,n)=>{const r=n(e);return r===e?t:t.concat([r])}),[e]).forEach((e=>{for(let t=0;t<this.customParsers.length;t++)if(this.customParsers[t].call(this,e))return;if(0===e.indexOf("#EXT"))if(e=e.replace("\r",""),t=/^#EXTM3U/.exec(e),t)this.trigger("data",{type:"tag",tagType:"m3u"});else{if(t=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(e),t)return n={type:"tag",tagType:"inf"},t[1]&&(n.duration=parseFloat(t[1])),t[2]&&(n.title=t[2]),void this.trigger("data",n);if(t=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(e),t)return n={type:"tag",tagType:"targetduration"},t[1]&&(n.duration=parseInt(t[1],10)),void this.trigger("data",n);if(t=/^#EXT-X-VERSION:([0-9.]*)?/.exec(e),t)return n={type:"tag",tagType:"version"},t[1]&&(n.version=parseInt(t[1],10)),void this.trigger("data",n);if(t=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(e),t)return n={type:"tag",tagType:"media-sequence"},t[1]&&(n.number=parseInt(t[1],10)),void this.trigger("data",n);if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(e),t)return n={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(n.number=parseInt(t[1],10)),void this.trigger("data",n);if(t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(e),t)return n={type:"tag",tagType:"playlist-type"},t[1]&&(n.playlistType=t[1]),void this.trigger("data",n);if(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(e),t)return n=(0,g.Z)(S(t[1]),{type:"tag",tagType:"byterange"}),void this.trigger("data",n);if(t=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(e),t)return n={type:"tag",tagType:"allow-cache"},t[1]&&(n.allowed=!/NO/.test(t[1])),void this.trigger("data",n);if(t=/^#EXT-X-MAP:(.*)$/.exec(e),t){if(n={type:"tag",tagType:"map"},t[1]){const e=A(t[1]);e.URI&&(n.uri=e.URI),e.BYTERANGE&&(n.byterange=S(e.BYTERANGE))}this.trigger("data",n)}else if(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(e),t){if(n={type:"tag",tagType:"stream-inf"},t[1]){if(n.attributes=A(t[1]),n.attributes.RESOLUTION){const e=n.attributes.RESOLUTION.split("x"),t={};e[0]&&(t.width=parseInt(e[0],10)),e[1]&&(t.height=parseInt(e[1],10)),n.attributes.RESOLUTION=t}n.attributes.BANDWIDTH&&(n.attributes.BANDWIDTH=parseInt(n.attributes.BANDWIDTH,10)),n.attributes["FRAME-RATE"]&&(n.attributes["FRAME-RATE"]=parseFloat(n.attributes["FRAME-RATE"])),n.attributes["PROGRAM-ID"]&&(n.attributes["PROGRAM-ID"]=parseInt(n.attributes["PROGRAM-ID"],10))}this.trigger("data",n)}else{if(t=/^#EXT-X-MEDIA:(.*)$/.exec(e),t)return n={type:"tag",tagType:"media"},t[1]&&(n.attributes=A(t[1])),void this.trigger("data",n);if(t=/^#EXT-X-ENDLIST/.exec(e),t)this.trigger("data",{type:"tag",tagType:"endlist"});else if(t=/^#EXT-X-DISCONTINUITY/.exec(e),t)this.trigger("data",{type:"tag",tagType:"discontinuity"});else{if(t=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(e),t)return n={type:"tag",tagType:"program-date-time"},t[1]&&(n.dateTimeString=t[1],n.dateTimeObject=new Date(t[1])),void this.trigger("data",n);if(t=/^#EXT-X-KEY:(.*)$/.exec(e),t)return n={type:"tag",tagType:"key"},t[1]&&(n.attributes=A(t[1]),n.attributes.IV&&("0x"===n.attributes.IV.substring(0,2).toLowerCase()&&(n.attributes.IV=n.attributes.IV.substring(2)),n.attributes.IV=n.attributes.IV.match(/.{8}/g),n.attributes.IV[0]=parseInt(n.attributes.IV[0],16),n.attributes.IV[1]=parseInt(n.attributes.IV[1],16),n.attributes.IV[2]=parseInt(n.attributes.IV[2],16),n.attributes.IV[3]=parseInt(n.attributes.IV[3],16),n.attributes.IV=new Uint32Array(n.attributes.IV))),void this.trigger("data",n);if(t=/^#EXT-X-START:(.*)$/.exec(e),t)return n={type:"tag",tagType:"start"},t[1]&&(n.attributes=A(t[1]),n.attributes["TIME-OFFSET"]=parseFloat(n.attributes["TIME-OFFSET"]),n.attributes.PRECISE=/YES/.test(n.attributes.PRECISE)),void this.trigger("data",n);if(t=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(e),t)return n={type:"tag",tagType:"cue-out-cont"},t[1]?n.data=t[1]:n.data="",void this.trigger("data",n);if(t=/^#EXT-X-CUE-OUT:(.*)?$/.exec(e),t)return n={type:"tag",tagType:"cue-out"},t[1]?n.data=t[1]:n.data="",void this.trigger("data",n);if(t=/^#EXT-X-CUE-IN:(.*)?$/.exec(e),t)return n={type:"tag",tagType:"cue-in"},t[1]?n.data=t[1]:n.data="",void this.trigger("data",n);if(t=/^#EXT-X-SKIP:(.*)$/.exec(e),t&&t[1])return n={type:"tag",tagType:"skip"},n.attributes=A(t[1]),n.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(n.attributes["SKIPPED-SEGMENTS"]=parseInt(n.attributes["SKIPPED-SEGMENTS"],10)),n.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(n.attributes["RECENTLY-REMOVED-DATERANGES"]=n.attributes["RECENTLY-REMOVED-DATERANGES"].split(b)),void this.trigger("data",n);if(t=/^#EXT-X-PART:(.*)$/.exec(e),t&&t[1])return n={type:"tag",tagType:"part"},n.attributes=A(t[1]),["DURATION"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseFloat(n.attributes[e]))})),["INDEPENDENT","GAP"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=/YES/.test(n.attributes[e]))})),n.attributes.hasOwnProperty("BYTERANGE")&&(n.attributes.byterange=S(n.attributes.BYTERANGE)),void this.trigger("data",n);if(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e),t&&t[1])return n={type:"tag",tagType:"server-control"},n.attributes=A(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseFloat(n.attributes[e]))})),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=/YES/.test(n.attributes[e]))})),void this.trigger("data",n);if(t=/^#EXT-X-PART-INF:(.*)$/.exec(e),t&&t[1])return n={type:"tag",tagType:"part-inf"},n.attributes=A(t[1]),["PART-TARGET"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseFloat(n.attributes[e]))})),void this.trigger("data",n);if(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e),t&&t[1])return n={type:"tag",tagType:"preload-hint"},n.attributes=A(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach((function(e){if(n.attributes.hasOwnProperty(e)){n.attributes[e]=parseInt(n.attributes[e],10);const t="BYTERANGE-LENGTH"===e?"length":"offset";n.attributes.byterange=n.attributes.byterange||{},n.attributes.byterange[t]=n.attributes[e],delete n.attributes[e]}})),void this.trigger("data",n);if(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e),t&&t[1])return n={type:"tag",tagType:"rendition-report"},n.attributes=A(t[1]),["LAST-MSN","LAST-PART"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseInt(n.attributes[e],10))})),void this.trigger("data",n);if(t=/^#EXT-X-DATERANGE:(.*)$/.exec(e),t&&t[1]){n={type:"tag",tagType:"daterange"},n.attributes=A(t[1]),["ID","CLASS"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=String(n.attributes[e]))})),["START-DATE","END-DATE"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=new Date(n.attributes[e]))})),["DURATION","PLANNED-DURATION"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseFloat(n.attributes[e]))})),["END-ON-NEXT"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=/YES/i.test(n.attributes[e]))})),["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=n.attributes[e].toString(16))}));const e=/^X-([A-Z]+-)+[A-Z]+$/;for(const t in n.attributes){if(!e.test(t))continue;const r=/[0-9A-Fa-f]{6}/g.test(n.attributes[t]),i=/^\d+(\.\d+)?$/.test(n.attributes[t]);n.attributes[t]=r?n.attributes[t].toString(16):i?parseFloat(n.attributes[t]):String(n.attributes[t])}this.trigger("data",n)}else if(t=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(e),t)this.trigger("data",{type:"tag",tagType:"independent-segments"});else{if(t=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(e),t)return n={type:"tag",tagType:"content-steering"},n.attributes=A(t[1]),void this.trigger("data",n);this.trigger("data",{type:"tag",data:e.slice(4)})}}}}else this.trigger("data",{type:"comment",text:e.slice(1)})})):this.trigger("data",{type:"uri",uri:e}))}addParser({expression:e,customType:t,dataParser:n,segment:r}){"function"!=typeof n&&(n=e=>e),this.customParsers.push((i=>{if(e.exec(i))return this.trigger("data",{type:"custom",data:n(i),customType:t,segment:r}),!0}))}addTagMapper({expression:e,map:t}){this.tagMappers.push((n=>e.test(n)?t(n):n))}}const I=function(e){const t={};return Object.keys(e).forEach((function(n){var r;t[(r=n,r.toLowerCase().replace(/-(\w)/g,(e=>e[1].toUpperCase())))]=e[n]})),t},C=function(e){const{serverControl:t,targetDuration:n,partTargetDuration:r}=e;if(!t)return;const i="#EXT-X-SERVER-CONTROL",a="holdBack",s="partHoldBack",o=n&&3*n,l=r&&2*r;n&&!t.hasOwnProperty(a)&&(t[a]=o,this.trigger("info",{message:`${i} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})),o&&t[a]<o&&(this.trigger("warn",{message:`${i} clamping HOLD-BACK (${t[a]}) to targetDuration * 3 (${o})`}),t[a]=o),r&&!t.hasOwnProperty(s)&&(t[s]=3*r,this.trigger("info",{message:`${i} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${t[s]}).`})),r&&t[s]<l&&(this.trigger("warn",{message:`${i} clamping PART-HOLD-BACK (${t[s]}) to partTargetDuration * 2 (${l}).`}),t[s]=l)};class R extends _{constructor(){super(),this.lineStream=new E,this.parseStream=new w,this.lineStream.pipe(this.parseStream),this.lastProgramDateTime=null;const e=this,t=[];let n,r,i={},a=!1;const s=function(){},o={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}};let l=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],segments:[]};let u=0,c=0;const d={};this.on("end",(()=>{i.uri||!i.parts&&!i.preloadHints||(!i.map&&n&&(i.map=n),!i.key&&r&&(i.key=r),i.timeline||"number"!=typeof l||(i.timeline=l),this.manifest.preloadSegment=i)})),this.parseStream.on("data",(function(f){let h,p;({tag(){({version(){f.version&&(this.manifest.version=f.version)},"allow-cache"(){this.manifest.allowCache=f.allowed,"allowed"in f||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const e={};"length"in f&&(i.byterange=e,e.length=f.length,"offset"in f||(f.offset=u)),"offset"in f&&(i.byterange=e,e.offset=f.offset),u=e.offset+e.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"})),f.title&&(i.title=f.title),f.duration>0&&(i.duration=f.duration),0===f.duration&&(i.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=t},key(){if(f.attributes)if("NONE"!==f.attributes.METHOD)if(f.attributes.URI){if("com.apple.streamingkeydelivery"===f.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:f.attributes});if("com.microsoft.playready"===f.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.microsoft.playready"]={uri:f.attributes.URI});if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===f.attributes.KEYFORMAT)return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(f.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===f.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==f.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):f.attributes.KEYID&&"0x"===f.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:f.attributes.KEYFORMAT,keyId:f.attributes.KEYID.substring(2)},pssh:T(f.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}));f.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),r={method:f.attributes.METHOD||"AES-128",uri:f.attributes.URI},void 0!==f.attributes.IV&&(r.iv=f.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else r=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence"(){isFinite(f.number)?this.manifest.mediaSequence=f.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+f.number})},"discontinuity-sequence"(){isFinite(f.number)?(this.manifest.discontinuitySequence=f.number,l=f.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+f.number})},"playlist-type"(){/VOD|EVENT/.test(f.playlistType)?this.manifest.playlistType=f.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+f.playlist})},map(){n={},f.uri&&(n.uri=f.uri),f.byterange&&(n.byterange=f.byterange),r&&(n.key=r)},"stream-inf"(){this.manifest.playlists=t,this.manifest.mediaGroups=this.manifest.mediaGroups||o,f.attributes?(i.attributes||(i.attributes={}),(0,g.Z)(i.attributes,f.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||o,!(f.attributes&&f.attributes.TYPE&&f.attributes["GROUP-ID"]&&f.attributes.NAME))return void this.trigger("warn",{message:"ignoring incomplete or missing media group"});const e=this.manifest.mediaGroups[f.attributes.TYPE];e[f.attributes["GROUP-ID"]]=e[f.attributes["GROUP-ID"]]||{},h=e[f.attributes["GROUP-ID"]],p={default:/yes/i.test(f.attributes.DEFAULT)},p.default?p.autoselect=!0:p.autoselect=/yes/i.test(f.attributes.AUTOSELECT),f.attributes.LANGUAGE&&(p.language=f.attributes.LANGUAGE),f.attributes.URI&&(p.uri=f.attributes.URI),f.attributes["INSTREAM-ID"]&&(p.instreamId=f.attributes["INSTREAM-ID"]),f.attributes.CHARACTERISTICS&&(p.characteristics=f.attributes.CHARACTERISTICS),f.attributes.FORCED&&(p.forced=/yes/i.test(f.attributes.FORCED)),h[f.attributes.NAME]=p},discontinuity(){l+=1,i.discontinuity=!0,this.manifest.discontinuityStarts.push(t.length)},"program-date-time"(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=f.dateTimeString,this.manifest.dateTimeObject=f.dateTimeObject),i.dateTimeString=f.dateTimeString,i.dateTimeObject=f.dateTimeObject;const{lastProgramDateTime:e}=this;this.lastProgramDateTime=new Date(f.dateTimeString).getTime(),null===e&&this.manifest.segments.reduceRight(((e,t)=>(t.programDateTime=e-1e3*t.duration,t.programDateTime)),this.lastProgramDateTime)},targetduration(){!isFinite(f.duration)||f.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+f.duration}):(this.manifest.targetDuration=f.duration,C.call(this,this.manifest))},start(){f.attributes&&!isNaN(f.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:f.attributes["TIME-OFFSET"],precise:f.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out"(){i.cueOut=f.data},"cue-out-cont"(){i.cueOutCont=f.data},"cue-in"(){i.cueIn=f.data},skip(){this.manifest.skip=I(f.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",f.attributes,["SKIPPED-SEGMENTS"])},part(){a=!0;const e=this.manifest.segments.length,t=I(f.attributes);i.parts=i.parts||[],i.parts.push(t),t.byterange&&(t.byterange.hasOwnProperty("offset")||(t.byterange.offset=c),c=t.byterange.offset+t.byterange.length);const n=i.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${n} for segment #${e}`,f.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(((e,t)=>{e.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${t} lacks required attribute(s): LAST-PART`})}))},"server-control"(){const e=this.manifest.serverControl=I(f.attributes);e.hasOwnProperty("canBlockReload")||(e.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),C.call(this,this.manifest),e.canSkipDateranges&&!e.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 e=this.manifest.segments.length,t=I(f.attributes),n=t.type&&"PART"===t.type;i.preloadHints=i.preloadHints||[],i.preloadHints.push(t),t.byterange&&(t.byterange.hasOwnProperty("offset")||(t.byterange.offset=n?c:0,n&&(c=t.byterange.offset+t.byterange.length)));const r=i.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${r} for segment #${e}`,f.attributes,["TYPE","URI"]),t.type)for(let n=0;n<i.preloadHints.length-1;n++){const a=i.preloadHints[n];a.type&&a.type===t.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${r} for segment #${e} has the same TYPE ${t.type} as preload hint #${n}`})}},"rendition-report"(){const e=I(f.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(e);const t=this.manifest.renditionReports.length-1,n=["LAST-MSN","URI"];a&&n.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${t}`,f.attributes,n)},"part-inf"(){this.manifest.partInf=I(f.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",f.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),C.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(I(f.attributes));const e=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${e}`,f.attributes,["ID","START-DATE"]);const t=this.manifest.dateRanges[e];t.endDate&&t.startDate&&new Date(t.endDate)<new Date(t.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),t.duration&&t.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),t.plannedDuration&&t.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});const n=!!t.endOnNext;if(n&&!t.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute"}),n&&(t.duration||t.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),t.duration&&t.endDate){const n=t.startDate.getTime()+1e3*t.duration;this.manifest.dateRanges[e].endDate=new Date(n)}if(d[t.id]){for(const e in d[t.id])if(t[e]&&JSON.stringify(d[t.id][e])!==JSON.stringify(t[e])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}const e=this.manifest.dateRanges.findIndex((e=>e.id===t.id));this.manifest.dateRanges[e]=(0,g.Z)(this.manifest.dateRanges[e],t),d[t.id]=(0,g.Z)(d[t.id],t),this.manifest.dateRanges.pop()}else d[t.id]=t},"independent-segments"(){this.manifest.independentSegments=!0},"content-steering"(){this.manifest.contentSteering=I(f.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",f.attributes,["SERVER-URI"])}}[f.tagType]||s).call(e)},uri(){i.uri=f.uri,t.push(i),this.manifest.targetDuration&&!("duration"in i)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),i.duration=this.manifest.targetDuration),r&&(i.key=r),i.timeline=l,n&&(i.map=n),c=0,null!==this.lastProgramDateTime&&(i.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=1e3*i.duration),i={}},comment(){},custom(){f.segment?(i.custom=i.custom||{},i.custom[f.customType]=f.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[f.customType]=f.data)}})[f.type].call(e)}))}warnOnMissingAttributes_(e,t,n){const r=[];n.forEach((function(e){t.hasOwnProperty(e)||r.push(e)})),r.length&&this.trigger("warn",{message:`${e} lacks required attribute(s): ${r.join(", ")}`})}push(e){this.lineStream.push(e)}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(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}}var D={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^/},N=["video","audio","text"],O=["Video","Audio","Text"],P=function(e){return e?e.replace(/avc1\.(\d+)\.(\d+)/i,(function(e,t,n){return"avc1."+("00"+Number(t).toString(16)).slice(-2)+"00"+("00"+Number(n).toString(16)).slice(-2)})):e},M=function(e){void 0===e&&(e="");var t=e.split(","),n=[];return t.forEach((function(e){var t;e=e.trim(),N.forEach((function(r){var i=D[r].exec(e.toLowerCase());if(i&&!(i.length<=1)){t=r;var a=e.substring(0,i[1].length),s=e.replace(a,"");n.push({type:a,details:s,mediaType:r})}})),t||n.push({type:e,details:"",mediaType:"unknown"})})),n},x=function(e){return void 0===e&&(e=""),D.audio.test(e.trim().toLowerCase())},L=function(e){if(e&&"string"==typeof e){var t,n=e.toLowerCase().split(",").map((function(e){return P(e.trim())})),r="video";1===n.length&&x(n[0])?r="audio":1===n.length&&(void 0===(t=n[0])&&(t=""),D.text.test(t.trim().toLowerCase()))&&(r="application");var i="mp4";return n.every((function(e){return D.mp4.test(e)}))?i="mp4":n.every((function(e){return D.webm.test(e)}))?i="webm":n.every((function(e){return D.ogg.test(e)}))&&(i="ogg"),r+"/"+i+';codecs="'+e+'"'}},k=function(e){return void 0===e&&(e=""),i().MediaSource&&i().MediaSource.isTypeSupported&&i().MediaSource.isTypeSupported(L(e))||!1},F=function(e){return void 0===e&&(e=""),e.toLowerCase().split(",").every((function(e){e=e.trim();for(var t=0;t<O.length;t++)if(D["muxer"+O[t]].test(e))return!0;return!1}))},U="mp4a.40.2",B=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,j=/^application\/dash\+xml/i,q=function(e){return B.test(e)?"hls":j.test(e)?"dash":"application/vnd.videojs.vhs+json"===e?"vhs-json":null},H=function(e){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},G=function(e){return e instanceof Uint8Array?e:(Array.isArray(e)||H(e)||e instanceof ArrayBuffer||(e="number"!=typeof e||"number"==typeof e&&e!=e?0:[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},V=i().BigInt||Number,Y=[V("0x1"),V("0x100"),V("0x10000"),V("0x1000000"),V("0x100000000"),V("0x10000000000"),V("0x1000000000000"),V("0x100000000000000"),V("0x10000000000000000")],Z=(function(){var e=new Uint16Array([65484]),t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);255===t[0]||t[0]}(),function(e,t){var n=void 0===t?{}:t,r=n.signed,i=void 0!==r&&r,a=n.le,s=void 0!==a&&a;e=G(e);var o=s?"reduce":"reduceRight",l=(e[o]?e[o]:Array.prototype[o]).call(e,(function(t,n,r){var i=s?r:Math.abs(r+1-e.length);return t+V(n)*Y[i]}),V(0));if(i){var u=Y[e.length]/V(2)-V(1);(l=V(l))>u&&(l-=u,l-=u,l-=V(2))}return Number(l)}),K=function(e,t){if("string"!=typeof e&&e&&"function"==typeof e.toString&&(e=e.toString()),"string"!=typeof e)return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var n=new Uint8Array(e.length),r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return n},z=function(e,t,n){var r=void 0===n?{}:n,i=r.offset,a=void 0===i?0:i,s=r.mask,o=void 0===s?[]:s;e=G(e);var l=(t=G(t)).every?t.every:Array.prototype.every;return t.length&&e.length-a>=t.length&&l.call(t,(function(t,n){return t===(o[n]?o[n]&e[a+n]:e[a+n])}))};var W=n(3969);const X=e=>!!e&&"object"==typeof e,$=(...e)=>e.reduce(((e,t)=>("object"!=typeof t||Object.keys(t).forEach((n=>{Array.isArray(e[n])&&Array.isArray(t[n])?e[n]=e[n].concat(t[n]):X(e[n])&&X(t[n])?e[n]=$(e[n],t[n]):e[n]=t[n]})),e)),{}),Q=e=>Object.keys(e).map((t=>e[t])),J=e=>e.reduce(((e,t)=>e.concat(t)),[]),ee=e=>{if(!e.length)return[];const t=[];for(let n=0;n<e.length;n++)t.push(e[n]);return t};const te=({baseUrl:e="",source:t="",range:n="",indexRange:r=""})=>{const a={uri:t,resolvedUri:v(e||"",t)};if(n||r){const e=(n||r).split("-");let t,s=i().BigInt?i().BigInt(e[0]):parseInt(e[0],10),o=i().BigInt?i().BigInt(e[1]):parseInt(e[1],10);s<Number.MAX_SAFE_INTEGER&&"bigint"==typeof s&&(s=Number(s)),o<Number.MAX_SAFE_INTEGER&&"bigint"==typeof o&&(o=Number(o)),t="bigint"==typeof o||"bigint"==typeof s?i().BigInt(o)-i().BigInt(s)+i().BigInt(1):o-s+1,"bigint"==typeof t&&t<Number.MAX_SAFE_INTEGER&&(t=Number(t)),a.byterange={length:t,offset:s}}return a},ne=e=>(e&&"number"!=typeof e&&(e=parseInt(e,10)),isNaN(e)?null:e),re={static(e){const{duration:t,timescale:n=1,sourceDuration:r,periodDuration:i}=e,a=ne(e.endNumber),s=t/n;return"number"==typeof a?{start:0,end:a}:"number"==typeof i?{start:0,end:i/s}:{start:0,end:r/s}},dynamic(e){const{NOW:t,clientOffset:n,availabilityStartTime:r,timescale:i=1,duration:a,periodStart:s=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:l=1/0}=e,u=ne(e.endNumber),c=(t+n)/1e3,d=r+s,f=c+o-d,h=Math.ceil(f*i/a),p=Math.floor((c-d-l)*i/a),g=Math.floor((c-d)*i/a);return{start:Math.max(0,p),end:"number"==typeof u?u:Math.min(h,g)}}},ie=e=>{const{type:t,duration:n,timescale:r=1,periodDuration:i,sourceDuration:a}=e,{start:s,end:o}=re[t](e),l=((e,t)=>{const n=[];for(let r=e;r<t;r++)n.push(r);return n})(s,o).map((e=>t=>{const{duration:n,timescale:r=1,periodStart:i,startNumber:a=1}=e;return{number:a+t,duration:n/r,timeline:i,time:t*n}})(e));if("static"===t){const e=l.length-1,t="number"==typeof i?i:a;l[e].duration=t-n/r*e}return l},ae=e=>{const{baseUrl:t,initialization:n={},sourceDuration:r,indexRange:i="",periodStart:a,presentationTime:s,number:o=0,duration:l}=e;if(!t)throw new Error("NO_BASE_URL");const u=te({baseUrl:t,source:n.sourceURL,range:n.range}),c=te({baseUrl:t,source:t,indexRange:i});if(c.map=u,l){const t=ie(e);t.length&&(c.duration=t[0].duration,c.timeline=t[0].timeline)}else r&&(c.duration=r,c.timeline=a);return c.presentationTime=s||a,c.number=o,[c]},se=(e,t,n)=>{const r=e.sidx.map?e.sidx.map:null,a=e.sidx.duration,s=e.timeline||0,o=e.sidx.byterange,l=o.offset+o.length,u=t.timescale,c=t.references.filter((e=>1!==e.referenceType)),d=[],f=e.endList?"static":"dynamic",h=e.sidx.timeline;let p,g=h,m=e.mediaSequence||0;p="bigint"==typeof t.firstOffset?i().BigInt(l)+t.firstOffset:l+t.firstOffset;for(let e=0;e<c.length;e++){const o=t.references[e],l=o.referencedSize,c=o.subsegmentDuration;let y;y="bigint"==typeof p?p+i().BigInt(l)-i().BigInt(1):p+l-1;const v=ae({baseUrl:n,timescale:u,timeline:s,periodStart:h,presentationTime:g,number:m,duration:c,sourceDuration:a,indexRange:`${p}-${y}`,type:f})[0];r&&(v.map=r),d.push(v),p+="bigint"==typeof p?i().BigInt(l):l,g+=c/u,m++}return e.segments=d,e},oe=["AUDIO","SUBTITLES"],le=e=>{return(t=e,n=({timeline:e})=>e,Q(t.reduce(((e,t)=>(t.forEach((t=>{e[n(t)]=t})),e)),{}))).sort(((e,t)=>e.timeline>t.timeline?1:-1));var t,n},ue=e=>{let t=[];var n,r;return n=e,r=(e,n,r,i)=>{t=t.concat(e.playlists||[])},oe.forEach((function(e){for(var t in n.mediaGroups[e])for(var i in n.mediaGroups[e][t]){var a=n.mediaGroups[e][t][i];r(a)}})),t},ce=({playlist:e,mediaSequence:t})=>{e.mediaSequence=t,e.segments.forEach(((t,n)=>{t.number=e.mediaSequence+n}))},de=e=>e&&e.uri+"-"+(e=>{let t;return t="bigint"==typeof e.offset||"bigint"==typeof e.length?i().BigInt(e.offset)+i().BigInt(e.length)-i().BigInt(1):e.offset+e.length-1,`${e.offset}-${t}`})(e.byterange),fe=e=>{const t=e.reduce((function(e,t){return e[t.attributes.baseUrl]||(e[t.attributes.baseUrl]=[]),e[t.attributes.baseUrl].push(t),e}),{});let n=[];return Object.values(t).forEach((e=>{const t=Q(e.reduce(((e,t)=>{const n=t.attributes.id+(t.attributes.lang||"");return e[n]?(t.segments&&(t.segments[0]&&(t.segments[0].discontinuity=!0),e[n].segments.push(...t.segments)),t.attributes.contentProtection&&(e[n].attributes.contentProtection=t.attributes.contentProtection)):(e[n]=t,e[n].attributes.timelineStarts=[]),e[n].attributes.timelineStarts.push({start:t.attributes.periodStart,timeline:t.attributes.periodStart}),e}),{}));n=n.concat(t)})),n.map((e=>{var t;return e.discontinuityStarts=(t=e.segments||[],"discontinuity",t.reduce(((e,t,n)=>(t.discontinuity&&e.push(n),e)),[])),e}))},he=(e,t)=>{const n=de(e.sidx),r=n&&t[n]&&t[n].sidx;return r&&se(e,r,e.sidx.resolvedUri),e},pe=(e,t={})=>{if(!Object.keys(t).length)return e;for(const n in e)e[n]=he(e[n],t);return e},ge=({attributes:e,segments:t,sidx:n,discontinuityStarts:r})=>{const i={attributes:{NAME:e.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:e.width,height:e.height},CODECS:e.codecs,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1},uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuityStarts:r,timelineStarts:e.timelineStarts,segments:t};return e.frameRate&&(i.attributes["FRAME-RATE"]=e.frameRate),e.contentProtection&&(i.contentProtection=e.contentProtection),e.serviceLocation&&(i.attributes.serviceLocation=e.serviceLocation),n&&(i.sidx=n),i},me=({attributes:e})=>"video/mp4"===e.mimeType||"video/webm"===e.mimeType||"video"===e.contentType,ye=({attributes:e})=>"audio/mp4"===e.mimeType||"audio/webm"===e.mimeType||"audio"===e.contentType,ve=({attributes:e})=>"text/vtt"===e.mimeType||"text"===e.contentType,_e=e=>e?Object.keys(e).reduce(((t,n)=>{const r=e[n];return t.concat(r.playlists)}),[]):[],Te=({dashPlaylists:e,locations:t,contentSteering:n,sidxMapping:r={},previousManifest:i,eventStream:a})=>{if(!e.length)return{};const{sourceDuration:s,type:o,suggestedPresentationDelay:l,minimumUpdatePeriod:u}=e[0].attributes,c=fe(e.filter(me)).map(ge),d=fe(e.filter(ye)),f=fe(e.filter(ve)),h=e.map((e=>e.attributes.captionServices)).filter(Boolean),p={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:s,playlists:pe(c,r)};u>=0&&(p.minimumUpdatePeriod=1e3*u),t&&(p.locations=t),n&&(p.contentSteering=n),"dynamic"===o&&(p.suggestedPresentationDelay=l),a&&a.length>0&&(p.eventStream=a);const g=0===p.playlists.length,m=d.length?((e,t={},n=!1)=>{let r;const i=e.reduce(((e,i)=>{const a=i.attributes.role&&i.attributes.role.value||"",s=i.attributes.lang||"";let o=i.attributes.label||"main";if(s&&!i.attributes.label){const e=a?` (${a})`:"";o=`${i.attributes.lang}${e}`}e[o]||(e[o]={language:s,autoselect:!0,default:"main"===a,playlists:[],uri:""});const l=he((({attributes:e,segments:t,sidx:n,mediaSequence:r,discontinuitySequence:i,discontinuityStarts:a},s)=>{const o={attributes:{NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs,"PROGRAM-ID":1},uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuitySequence:i,discontinuityStarts:a,timelineStarts:e.timelineStarts,mediaSequence:r,segments:t};return e.contentProtection&&(o.contentProtection=e.contentProtection),e.serviceLocation&&(o.attributes.serviceLocation=e.serviceLocation),n&&(o.sidx=n),s&&(o.attributes.AUDIO="audio",o.attributes.SUBTITLES="subs"),o})(i,n),t);return e[o].playlists.push(l),void 0===r&&"main"===a&&(r=i,r.default=!0),e}),{});return r||(i[Object.keys(i)[0]].default=!0),i})(d,r,g):null,y=f.length?((e,t={})=>e.reduce(((e,n)=>{const r=n.attributes.label||n.attributes.lang||"text";return e[r]||(e[r]={language:r,default:!1,autoselect:!1,playlists:[],uri:""}),e[r].playlists.push(he((({attributes:e,segments:t,mediaSequence:n,discontinuityStarts:r,discontinuitySequence:i})=>{void 0===t&&(t=[{uri:e.baseUrl,timeline:e.periodStart,resolvedUri:e.baseUrl||"",duration:e.sourceDuration,number:0}],e.duration=e.sourceDuration);const a={NAME:e.id,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1};e.codecs&&(a.CODECS=e.codecs);const s={attributes:a,uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,timelineStarts:e.timelineStarts,discontinuityStarts:r,discontinuitySequence:i,mediaSequence:n,segments:t};return e.serviceLocation&&(s.attributes.serviceLocation=e.serviceLocation),s})(n),t)),e}),{}))(f,r):null,v=c.concat(_e(m),_e(y)),_=v.map((({timelineStarts:e})=>e));var T,E;return p.timelineStarts=le(_),T=v,E=p.timelineStarts,T.forEach((e=>{e.mediaSequence=0,e.discontinuitySequence=E.findIndex((function({timeline:t}){return t===e.timeline})),e.segments&&e.segments.forEach(((e,t)=>{e.number=t}))})),m&&(p.mediaGroups.AUDIO.audio=m),y&&(p.mediaGroups.SUBTITLES.subs=y),h.length&&(p.mediaGroups["CLOSED-CAPTIONS"].cc=h.reduce(((e,t)=>t?(t.forEach((t=>{const{channel:n,language:r}=t;e[r]={autoselect:!1,default:!1,instreamId:n,language:r},t.hasOwnProperty("aspectRatio")&&(e[r].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[r].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[r]["3D"]=t["3D"])})),e):e),{})),i?(({oldManifest:e,newManifest:t})=>{const n=e.playlists.concat(ue(e)),r=t.playlists.concat(ue(t));return t.timelineStarts=le([e.timelineStarts,t.timelineStarts]),(({oldPlaylists:e,newPlaylists:t,timelineStarts:n})=>{t.forEach((t=>{t.discontinuitySequence=n.findIndex((function({timeline:e}){return e===t.timeline}));const r=((e,t)=>{for(let n=0;n<e.length;n++)if(e[n].attributes.NAME===t)return e[n];return null})(e,t.attributes.NAME);if(!r)return;if(t.sidx)return;const i=t.segments[0],a=r.segments.findIndex((function(e){return Math.abs(e.presentationTime-i.presentationTime)<.016666666666666666}));if(-1===a)return ce({playlist:t,mediaSequence:r.mediaSequence+r.segments.length}),t.segments[0].discontinuity=!0,t.discontinuityStarts.unshift(0),void((!r.segments.length&&t.timeline>r.timeline||r.segments.length&&t.timeline>r.segments[r.segments.length-1].timeline)&&t.discontinuitySequence--);r.segments[a].discontinuity&&!i.discontinuity&&(i.discontinuity=!0,t.discontinuityStarts.unshift(0),t.discontinuitySequence--),ce({playlist:t,mediaSequence:r.segments[a].number})}))})({oldPlaylists:n,newPlaylists:r,timelineStarts:t.timelineStarts}),t})({oldManifest:i,newManifest:p}):p},Ee=(e,t,n)=>{const{NOW:r,clientOffset:i,availabilityStartTime:a,timescale:s=1,periodStart:o=0,minimumUpdatePeriod:l=0}=e,u=(r+i)/1e3+l-(a+o);return Math.ceil((u*s-t)/n)},be=(e,t)=>{const{type:n,minimumUpdatePeriod:r=0,media:i="",sourceDuration:a,timescale:s=1,startNumber:o=1,periodStart:l}=e,u=[];let c=-1;for(let d=0;d<t.length;d++){const f=t[d],h=f.d,p=f.r||0,g=f.t||0;let m;if(c<0&&(c=g),g&&g>c&&(c=g),p<0){const o=d+1;m=o===t.length?"dynamic"===n&&r>0&&i.indexOf("$Number$")>0?Ee(e,c,h):(a*s-c)/h:(t[o].t-c)/h}else m=p+1;const y=o+u.length+m;let v=o+u.length;for(;v<y;)u.push({number:v,duration:h/s,time:c,timeline:l}),c+=h,v++}return u},Se=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,Ae=(e,t)=>e.replace(Se,(e=>(t,n,r,i)=>{if("$$"===t)return"$";if(void 0===e[n])return t;const a=""+e[n];return"RepresentationID"===n?a:(i=r?parseInt(i,10):1,a.length>=i?a:`${new Array(i-a.length+1).join("0")}${a}`)})(t)),we=(e,t)=>{const n={RepresentationID:e.id,Bandwidth:e.bandwidth||0},{initialization:r={sourceURL:"",range:""}}=e,i=te({baseUrl:e.baseUrl,source:Ae(r.sourceURL,n),range:r.range}),a=((e,t)=>e.duration||t?e.duration?ie(e):be(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}])(e,t);return a.map((t=>{n.Number=t.number,n.Time=t.time;const r=Ae(e.media||"",n),a=e.timescale||1,s=e.presentationTimeOffset||0,o=e.periodStart+(t.time-s)/a;return{uri:r,timeline:t.timeline,duration:t.duration,resolvedUri:v(e.baseUrl||"",r),map:i,number:t.number,presentationTime:o}}))},Ie=(e,t)=>{const{duration:n,segmentUrls:r=[],periodStart:i}=e;if(!n&&!t||n&&t)throw new Error("SEGMENT_TIME_UNSPECIFIED");const a=r.map((t=>((e,t)=>{const{baseUrl:n,initialization:r={}}=e,i=te({baseUrl:n,source:r.sourceURL,range:r.range}),a=te({baseUrl:n,source:t.media,range:t.mediaRange});return a.map=i,a})(e,t)));let s;return n&&(s=ie(e)),t&&(s=be(e,t)),s.map(((t,n)=>{if(a[n]){const r=a[n],s=e.timescale||1,o=e.presentationTimeOffset||0;return r.timeline=t.timeline,r.duration=t.duration,r.number=t.number,r.presentationTime=i+(t.time-o)/s,r}})).filter((e=>e))},Ce=({attributes:e,segmentInfo:t})=>{let n,r;t.template?(r=we,n=$(e,t.template)):t.base?(r=ae,n=$(e,t.base)):t.list&&(r=Ie,n=$(e,t.list));const i={attributes:e};if(!r)return i;const a=r(n,t.segmentTimeline);if(n.duration){const{duration:e,timescale:t=1}=n;n.duration=e/t}else a.length?n.duration=a.reduce(((e,t)=>Math.max(e,Math.ceil(t.duration))),0):n.duration=0;return i.attributes=n,i.segments=a,t.base&&n.indexRange&&(i.sidx=a[0],i.segments=[]),i},Re=(e,t)=>ee(e.childNodes).filter((({tagName:e})=>e===t)),De=e=>e.textContent.trim(),Ne=e=>{const t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t)return 0;const[n,r,i,a,s,o]=t.slice(1);return 31536e3*parseFloat(n||0)+2592e3*parseFloat(r||0)+86400*parseFloat(i||0)+3600*parseFloat(a||0)+60*parseFloat(s||0)+parseFloat(o||0)},Oe={mediaPresentationDuration:e=>Ne(e),availabilityStartTime(e){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t=e)&&(t+="Z"),Date.parse(t)/1e3;var t},minimumUpdatePeriod:e=>Ne(e),suggestedPresentationDelay:e=>Ne(e),type:e=>e,timeShiftBufferDepth:e=>Ne(e),start:e=>Ne(e),width:e=>parseInt(e,10),height:e=>parseInt(e,10),bandwidth:e=>parseInt(e,10),frameRate:e=>(e=>parseFloat(e.split("/").reduce(((e,t)=>e/t))))(e),startNumber:e=>parseInt(e,10),timescale:e=>parseInt(e,10),presentationTimeOffset:e=>parseInt(e,10),duration(e){const t=parseInt(e,10);return isNaN(t)?Ne(e):t},d:e=>parseInt(e,10),t:e=>parseInt(e,10),r:e=>parseInt(e,10),presentationTime:e=>parseInt(e,10),DEFAULT:e=>e},Pe=e=>e&&e.attributes?ee(e.attributes).reduce(((e,t)=>{const n=Oe[t.name]||Oe.DEFAULT;return e[t.name]=n(t.value),e}),{}):{},Me={"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"},xe=(e,t)=>t.length?J(e.map((function(e){return t.map((function(t){const n=De(t),r=v(e.baseUrl,n),i=$(Pe(t),{baseUrl:r});return r!==n&&!i.serviceLocation&&e.serviceLocation&&(i.serviceLocation=e.serviceLocation),i}))}))):e,Le=e=>{const t=Re(e,"SegmentTemplate")[0],n=Re(e,"SegmentList")[0],r=n&&Re(n,"SegmentURL").map((e=>$({tag:"SegmentURL"},Pe(e)))),i=Re(e,"SegmentBase")[0],a=n||t,s=a&&Re(a,"SegmentTimeline")[0],o=n||i||t,l=o&&Re(o,"Initialization")[0],u=t&&Pe(t);u&&l?u.initialization=l&&Pe(l):u&&u.initialization&&(u.initialization={sourceURL:u.initialization});const c={template:u,segmentTimeline:s&&Re(s,"S").map((e=>Pe(e))),list:n&&$(Pe(n),{segmentUrls:r,initialization:Pe(l)}),base:i&&$(Pe(i),{initialization:Pe(l)})};return Object.keys(c).forEach((e=>{c[e]||delete c[e]})),c},ke=e=>J(Re(e.node,"EventStream").map((t=>{const n=Pe(t),r=n.schemeIdUri;return Re(t,"Event").map((t=>{const i=Pe(t),a=i.presentationTime||0,s=n.timescale||1,o=i.duration||0,l=a/s+e.attributes.start;return{schemeIdUri:r,value:n.value,id:i.id,start:l,end:l+o/s,messageData:De(t)||i.messageData,contentEncoding:n.contentEncoding,presentationTimeOffset:n.presentationTimeOffset||0}}))}))),Fe=(e,t,n)=>r=>{const a=Pe(r),s=xe(t,Re(r,"BaseURL")),o=Re(r,"Role")[0],l={role:Pe(o)};let u=$(e,a,l);const c=Re(r,"Accessibility")[0],d="urn:scte:dash:cc:cea-608:2015"===(f=Pe(c)).schemeIdUri?("string"!=typeof f.value?[]:f.value.split(";")).map((e=>{let t,n;return n=e,/^CC\d=/.test(e)?[t,n]=e.split("="):/^CC\d$/.test(e)&&(t=e),{channel:t,language:n}})):"urn:scte:dash:cc:cea-708:2015"===f.schemeIdUri?("string"!=typeof f.value?[]:f.value.split(";")).map((e=>{const t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){const[n,r=""]=e.split("=");t.channel=n,t.language=e,r.split(",").forEach((e=>{const[n,r]=e.split(":");"lang"===n?t.language=r:"er"===n?t.easyReader=Number(r):"war"===n?t.aspectRatio=Number(r):"3D"===n&&(t["3D"]=Number(r))}))}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t})):void 0;var f;d&&(u=$(u,{captionServices:d}));const h=Re(r,"Label")[0];if(h&&h.childNodes.length){const e=h.childNodes[0].nodeValue.trim();u=$(u,{label:e})}const p=Re(r,"ContentProtection").reduce(((e,t)=>{const n=Pe(t);n.schemeIdUri&&(n.schemeIdUri=n.schemeIdUri.toLowerCase());const r=Me[n.schemeIdUri];if(r){e[r]={attributes:n};const a=Re(t,"cenc:pssh")[0];if(a){const t=De(a);e[r].pssh=t&&function(e){for(var t=function(e){return i().atob?i().atob(e):Buffer.from(e,"base64").toString("binary")}(e),n=new Uint8Array(t.length),r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}(t)}}return e}),{});Object.keys(p).length&&(u=$(u,{contentProtection:p}));const g=Le(r),m=Re(r,"Representation"),y=$(n,g);return J(m.map(((e,t,n)=>r=>{const i=Re(r,"BaseURL"),a=xe(t,i),s=$(e,Pe(r)),o=Le(r);return a.map((e=>({segmentInfo:$(n,o),attributes:$(s,e)})))})(u,s,y)))},Ue=(e,t)=>(n,r)=>{const i=xe(t,Re(n.node,"BaseURL")),a=$(e,{periodStart:n.attributes.start});"number"==typeof n.attributes.duration&&(a.periodDuration=n.attributes.duration);const s=Re(n.node,"AdaptationSet"),o=Le(n.node);return J(s.map(Fe(a,i,o)))},Be=(e,t)=>{if(e.length>1&&t({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!e.length)return null;const n=$({serverURL:De(e[0])},Pe(e[0]));return n.queryBeforeStart="true"===n.queryBeforeStart,n},je=e=>{if(""===e)throw new Error("DASH_EMPTY_MANIFEST");const t=new W.DOMParser;let n,r;try{n=t.parseFromString(e,"application/xml"),r=n&&"MPD"===n.documentElement.tagName?n.documentElement:null}catch(e){}if(!r||r&&r.getElementsByTagName("parsererror").length>0)throw new Error("DASH_INVALID_XML");return r};var qe,He=n(4221),Ge=n.n(He),Ve=G([73,68,51]),Ye=function e(t,n){return void 0===n&&(n=0),(t=G(t)).length-n<10||!z(t,Ve,{offset:n})?n:(n+=function(e,t){void 0===t&&(t=0);var n=(e=G(e))[t+5],r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&n)>>4?r+20:r+10}(t,n),e(t,n))},Ze=(new Uint8Array([79,112,117,115,72,101,97,100]),function(e){return"string"==typeof e?K(e):e}),Ke=function(e){e=G(e);for(var t=[],n=0;e.length>n;){var r=e[n],i=0,a=0,s=e[++a];for(a++;128&s;)i=(127&s)<<7,s=e[a],a++;i+=127&s;for(var o=0;o<qe.length;o++){var l=qe[o],u=l.id,c=l.parser;if(r===u){t.push(c(e.subarray(a,a+i)));break}}n+=i+a}return t};qe=[{id:3,parser:function(e){var t={tag:3,id:e[0]<<8|e[1],flags:e[2],size:3,dependsOnEsId:0,ocrEsId:0,descriptors:[],url:""};if(128&t.flags&&(t.dependsOnEsId=e[t.size]<<8|e[t.size+1],t.size+=2),64&t.flags){var n=e[t.size];t.url=function(e){if(!e)return"";e=Array.prototype.slice.call(e);var t=String.fromCharCode.apply(null,G(e));try{return decodeURIComponent(escape(t))}catch(e){}return t}(e.subarray(t.size+1,t.size+1+n)),t.size+=n}return 32&t.flags&&(t.ocrEsId=e[t.size]<<8|e[t.size+1],t.size+=2),t.descriptors=Ke(e.subarray(t.size))||[],t}},{id:4,parser:function(e){return{tag:4,oti:e[0],streamType:e[1],bufferSize:e[2]<<16|e[3]<<8|e[4],maxBitrate:e[5]<<24|e[6]<<16|e[7]<<8|e[8],avgBitrate:e[9]<<24|e[10]<<16|e[11]<<8|e[12],descriptors:Ke(e.subarray(13))}}},{id:5,parser:function(e){return{tag:5,bytes:e}}},{id:6,parser:function(e){return{tag:6,bytes:e}}}];var ze=function e(t,n,r){void 0===r&&(r=!1),n=function(e){return Array.isArray(e)?e.map((function(e){return Ze(e)})):[Ze(e)]}(n),t=G(t);var i=[];if(!n.length)return i;for(var a=0;a<t.length;){var s=(t[a]<<24|t[a+1]<<16|t[a+2]<<8|t[a+3])>>>0,o=t.subarray(a+4,a+8);if(0===s)break;var l=a+s;if(l>t.length){if(r)break;l=t.length}var u=t.subarray(a+8,l);z(o,n[0])&&(1===n.length?i.push(u):i.push.apply(i,e(u,n.slice(1),r))),a=l}return i},We={EBML:G([26,69,223,163]),DocType:G([66,130]),Segment:G([24,83,128,103]),SegmentInfo:G([21,73,169,102]),Tracks:G([22,84,174,107]),Track:G([174]),TrackNumber:G([215]),DefaultDuration:G([35,227,131]),TrackEntry:G([174]),TrackType:G([131]),FlagDefault:G([136]),CodecID:G([134]),CodecPrivate:G([99,162]),VideoTrack:G([224]),AudioTrack:G([225]),Cluster:G([31,67,182,117]),Timestamp:G([231]),TimestampScale:G([42,215,177]),BlockGroup:G([160]),BlockDuration:G([155]),Block:G([161]),SimpleBlock:G([163])},Xe=[128,64,32,16,8,4,2,1],$e=function(e,t,n,r){void 0===n&&(n=!0),void 0===r&&(r=!1);var i=function(e){for(var t=1,n=0;n<Xe.length&&!(e&Xe[n]);n++)t++;return t}(e[t]),a=e.subarray(t,t+i);return n&&((a=Array.prototype.slice.call(e,t,t+i))[0]^=Xe[i-1]),{length:i,value:Z(a,{signed:r}),bytes:a}},Qe=function e(t){return"string"==typeof t?t.match(/.{1,2}/g).map((function(t){return e(t)})):"number"==typeof t?function(e,t){var n=(void 0===t?{}:t).le,r=void 0!==n&&n;("bigint"!=typeof e&&"number"!=typeof e||"number"==typeof e&&e!=e)&&(e=0);for(var i,a=(i=e=V(e),Math.ceil(function(e){return e.toString(2).length}(i)/8)),s=new Uint8Array(new ArrayBuffer(a)),o=0;o<a;o++){var l=r?o:Math.abs(o+1-s.length);s[l]=Number(e/Y[o]&V(255)),e<0&&(s[l]=Math.abs(~s[l]),s[l]-=0===o?1:2)}return s}(t):t},Je=function e(t,n,r){if(r>=n.length)return n.length;var i=$e(n,r,!1);if(z(t.bytes,i.bytes))return r;var a=$e(n,r+i.length);return e(t,n,r+a.length+a.value+i.length)},et=function e(t,n){n=function(e){return Array.isArray(e)?e.map((function(e){return Qe(e)})):[Qe(e)]}(n),t=G(t);var r=[];if(!n.length)return r;for(var i=0;i<t.length;){var a=$e(t,i,!1),s=$e(t,i+a.length),o=i+a.length+s.length;127===s.value&&(s.value=Je(a,t,o),s.value!==t.length&&(s.value-=o));var l=o+s.value>t.length?t.length:o+s.value,u=t.subarray(o,l);z(n[0],a.bytes)&&(1===n.length?r.push(u):r=r.concat(e(u,n.slice(1)))),i+=a.length+s.length+u.length}return r},tt=G([0,0,0,1]),nt=G([0,0,1]),rt=G([0,0,3]),it=function(e){for(var t=[],n=1;n<e.length-2;)z(e.subarray(n,n+3),rt)&&(t.push(n+2),n++),n++;if(0===t.length)return e;var r=e.length-t.length,i=new Uint8Array(r),a=0;for(n=0;n<r;a++,n++)a===t[0]&&(a++,t.shift()),i[n]=e[a];return i},at=function(e,t,n,r){void 0===r&&(r=1/0),e=G(e),n=[].concat(n);for(var i,a=0,s=0;a<e.length&&(s<r||i);){var o=void 0;if(z(e.subarray(a),tt)?o=4:z(e.subarray(a),nt)&&(o=3),o){if(s++,i)return it(e.subarray(i,a));var l=void 0;"h264"===t?l=31&e[a+o]:"h265"===t&&(l=e[a+o]>>1&63),-1!==n.indexOf(l)&&(i=a+o),a+=o+("h264"===t?1:2)}else a++}return e.subarray(0,0)},st={webm:G([119,101,98,109]),matroska:G([109,97,116,114,111,115,107,97]),flac:G([102,76,97,67]),ogg:G([79,103,103,83]),ac3:G([11,119]),riff:G([82,73,70,70]),avi:G([65,86,73]),wav:G([87,65,86,69]),"3gp":G([102,116,121,112,51,103]),mp4:G([102,116,121,112]),fmp4:G([115,116,121,112]),mov:G([102,116,121,112,113,116]),moov:G([109,111,111,118]),moof:G([109,111,111,102])},ot={aac:function(e){var t=Ye(e);return z(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Ye(e);return z(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=et(e,[We.EBML,We.DocType])[0];return z(t,st.webm)},mkv:function(e){var t=et(e,[We.EBML,We.DocType])[0];return z(t,st.matroska)},mp4:function(e){return!ot["3gp"](e)&&!ot.mov(e)&&(!(!z(e,st.mp4,{offset:4})&&!z(e,st.fmp4,{offset:4}))||!(!z(e,st.moof,{offset:4})&&!z(e,st.moov,{offset:4}))||void 0)},mov:function(e){return z(e,st.mov,{offset:4})},"3gp":function(e){return z(e,st["3gp"],{offset:4})},ac3:function(e){var t=Ye(e);return z(e,st.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return 71===e[0];for(var t=0;t+188<e.length&&t<188;){if(71===e[t]&&71===e[t+188])return!0;t+=1}return!1},flac:function(e){var t=Ye(e);return z(e,st.flac,{offset:t})},ogg:function(e){return z(e,st.ogg)},avi:function(e){return z(e,st.riff)&&z(e,st.avi,{offset:8})},wav:function(e){return z(e,st.riff)&&z(e,st.wav,{offset:8})},h264:function(e){return function(e,t,n){return at(e,"h264",7,3)}(e).length},h265:function(e){return function(e,t,n){return at(e,"h265",[32,33],3)}(e).length}},lt=Object.keys(ot).filter((function(e){return"ts"!==e&&"h264"!==e&&"h265"!==e})).concat(["ts","h264","h265"]);lt.forEach((function(e){var t=ot[e];ot[e]=function(e){return t(G(e))}}));var ut=ot,ct=function(e){e=G(e);for(var t=0;t<lt.length;t++){var n=lt[t];if(ut[n](e))return n}return""},dt=n(1489),ft="8.9.0";const ht={},pt=function(e,t){return ht[e]=ht[e]||[],t&&(ht[e]=ht[e].concat(t)),ht[e]},gt=function(e,t){const n=pt(e).indexOf(t);return!(n<=-1||(ht[e]=ht[e].slice(),ht[e].splice(n,1),0))},mt={prefixed:!0},yt=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],vt=yt[0];let _t;for(let e=0;e<yt.length;e++)if(yt[e][1]in s()){_t=yt[e];break}if(_t){for(let e=0;e<_t.length;e++)mt[vt[e]]=_t[e];mt.prefixed=_t[0]!==vt[0]}let Tt=[];const Et=function e(t,n=":",r=""){let a,s="info";const o=function(...e){a("log",s,e)};return a=((e,t,n)=>(r,a,s)=>{const o=t.levels[a],l=new RegExp(`^(${o})$`);let u=e;if("log"!==r&&s.unshift(r.toUpperCase()+":"),n&&(u=`%c${e}`,s.unshift(n)),s.unshift(u+":"),Tt){Tt.push([].concat(s));const e=Tt.length-1e3;Tt.splice(0,e>0?e:0)}if(!i().console)return;let c=i().console[r];c||"debug"!==r||(c=i().console.info||i().console.log),c&&o&&l.test(r)&&c[Array.isArray(s)?"apply":"call"](i().console,s)})(t,o,r),o.createLogger=(i,a,s)=>{const o=void 0!==a?a:n;return e(`${t} ${o} ${i}`,o,void 0!==s?s:r)},o.createNewLogger=(t,n,r)=>e(t,n,r),o.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:s},o.level=e=>{if("string"==typeof e){if(!o.levels.hasOwnProperty(e))throw new Error(`"${e}" in not a valid log level`);s=e}return s},(o.history=()=>Tt?[].concat(Tt):[]).filter=e=>(Tt||[]).filter((t=>new RegExp(`.*${e}.*`).test(t[0]))),o.history.clear=()=>{Tt&&(Tt.length=0)},o.history.disable=()=>{null!==Tt&&(Tt.length=0,Tt=null)},o.history.enable=()=>{null===Tt&&(Tt=[])},o.error=(...e)=>a("error",s,e),o.warn=(...e)=>a("warn",s,e),o.debug=(...e)=>a("debug",s,e),o}("VIDEOJS"),bt=Et.createLogger,St=Object.prototype.toString,At=function(e){return Ct(e)?Object.keys(e):[]};function wt(e,t){At(e).forEach((n=>t(e[n],n)))}function It(e,t,n=0){return At(e).reduce(((n,r)=>t(n,e[r],r)),n)}function Ct(e){return!!e&&"object"==typeof e}function Rt(e){return Ct(e)&&"[object Object]"===St.call(e)&&e.constructor===Object}function Dt(...e){const t={};return e.forEach((e=>{e&&wt(e,((e,n)=>{Rt(e)?(Rt(t[n])||(t[n]={}),t[n]=Dt(t[n],e)):t[n]=e}))})),t}function Nt(e={}){const t=[];for(const n in e)if(e.hasOwnProperty(n)){const r=e[n];t.push(r)}return t}function Ot(e,t,n,r=!0){const i=n=>Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0}),a={configurable:!0,enumerable:!0,get(){const e=n();return i(e),e}};return r&&(a.set=i),Object.defineProperty(e,t,a)}var Pt=Object.freeze({__proto__:null,each:wt,reduce:It,isObject:Ct,isPlain:Rt,merge:Dt,values:Nt,defineLazyProperty:Ot});let Mt,xt=!1,Lt=null,kt=!1,Ft=!1,Ut=!1,Bt=!1,jt=!1,qt=null,Ht=null,Gt=null,Vt=!1,Yt=!1,Zt=!1,Kt=!1;const zt=Boolean(en()&&("ontouchstart"in i()||i().navigator.maxTouchPoints||i().DocumentTouch&&i().document instanceof i().DocumentTouch)),Wt=i().navigator&&i().navigator.userAgentData;if(Wt&&Wt.platform&&Wt.brands&&(kt="Android"===Wt.platform,Ut=Boolean(Wt.brands.find((e=>"Microsoft Edge"===e.brand))),Bt=Boolean(Wt.brands.find((e=>"Chromium"===e.brand))),jt=!Ut&&Bt,qt=Ht=(Wt.brands.find((e=>"Chromium"===e.brand))||{}).version||null,Yt="Windows"===Wt.platform),!Bt){const e=i().navigator&&i().navigator.userAgent||"";xt=/iPod/i.test(e),Lt=function(){const t=e.match(/OS (\d+)_/i);return t&&t[1]?t[1]:null}(),kt=/Android/i.test(e),Mt=function(){const t=e.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!t)return null;const n=t[1]&&parseFloat(t[1]),r=t[2]&&parseFloat(t[2]);return n&&r?parseFloat(t[1]+"."+t[2]):n||null}(),Ft=/Firefox/i.test(e),Ut=/Edg/i.test(e),Bt=/Chrome/i.test(e)||/CriOS/i.test(e),jt=!Ut&&Bt,qt=Ht=function(){const t=e.match(/(Chrome|CriOS)\/(\d+)/);return t&&t[2]?parseFloat(t[2]):null}(),Gt=function(){const t=/MSIE\s(\d+)\.\d/.exec(e);let n=t&&parseFloat(t[1]);return!n&&/Trident\/7.0/i.test(e)&&/rv:11.0/.test(e)&&(n=11),n}(),Vt=/Safari/i.test(e)&&!jt&&!kt&&!Ut,Yt=/Windows/i.test(e),Zt=/iPad/i.test(e)||Vt&&zt&&!/iPhone/i.test(e),Kt=/iPhone/i.test(e)&&!Zt}const Xt=Kt||Zt||xt,$t=(Vt||Xt)&&!jt;var Qt=Object.freeze({__proto__:null,get IS_IPOD(){return xt},get IOS_VERSION(){return Lt},get IS_ANDROID(){return kt},get ANDROID_VERSION(){return Mt},get IS_FIREFOX(){return Ft},get IS_EDGE(){return Ut},get IS_CHROMIUM(){return Bt},get IS_CHROME(){return jt},get CHROMIUM_VERSION(){return qt},get CHROME_VERSION(){return Ht},get IE_VERSION(){return Gt},get IS_SAFARI(){return Vt},get IS_WINDOWS(){return Yt},get IS_IPAD(){return Zt},get IS_IPHONE(){return Kt},TOUCH_ENABLED:zt,IS_IOS:Xt,IS_ANY_SAFARI:$t});function Jt(e){return"string"==typeof e&&Boolean(e.trim())}function en(){return s()===i().document}function tn(e){return Ct(e)&&1===e.nodeType}function nn(){try{return i().parent!==i().self}catch(e){return!0}}function rn(e){return function(t,n){if(!Jt(t))return s()[e](null);Jt(n)&&(n=s().querySelector(n));const r=tn(n)?n:s();return r[e]&&r[e](t)}}function an(e="div",t={},n={},r){const i=s().createElement(e);return Object.getOwnPropertyNames(t).forEach((function(e){const n=t[e];"textContent"===e?sn(i,n):i[e]===n&&"tabIndex"!==e||(i[e]=n)})),Object.getOwnPropertyNames(n).forEach((function(e){i.setAttribute(e,n[e])})),r&&wn(i,r),i}function sn(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function on(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function ln(e,t){return function(e){if(e.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}(t),e.classList.contains(t)}function un(e,...t){return e.classList.add(...t.reduce(((e,t)=>e.concat(t.split(/\s+/))),[])),e}function cn(e,...t){return e?(e.classList.remove(...t.reduce(((e,t)=>e.concat(t.split(/\s+/))),[])),e):(Et.warn("removeClass was called with an element that doesn't exist"),null)}function dn(e,t,n){return"function"==typeof n&&(n=n(e,t)),"boolean"!=typeof n&&(n=void 0),t.split(/\s+/).forEach((t=>e.classList.toggle(t,n))),e}function fn(e,t){Object.getOwnPropertyNames(t).forEach((function(n){const r=t[n];null==r||!1===r?e.removeAttribute(n):e.setAttribute(n,!0===r?"":r)}))}function hn(e){const t={},n=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(e&&e.attributes&&e.attributes.length>0){const r=e.attributes;for(let e=r.length-1;e>=0;e--){const i=r[e].name;let a=r[e].value;n.includes(i)&&(a=null!==a),t[i]=a}}return t}function pn(e,t){return e.getAttribute(t)}function gn(e,t,n){e.setAttribute(t,n)}function mn(e,t){e.removeAttribute(t)}function yn(){s().body.focus(),s().onselectstart=function(){return!1}}function vn(){s().onselectstart=function(){return!0}}function _n(e){if(e&&e.getBoundingClientRect&&e.parentNode){const t=e.getBoundingClientRect(),n={};return["bottom","height","left","right","top","width"].forEach((e=>{void 0!==t[e]&&(n[e]=t[e])})),n.height||(n.height=parseFloat(Nn(e,"height"))),n.width||(n.width=parseFloat(Nn(e,"width"))),n}}function Tn(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};const t=e.offsetWidth,n=e.offsetHeight;let r=0,i=0;for(;e.offsetParent&&e!==s()[mt.fullscreenElement];)r+=e.offsetLeft,i+=e.offsetTop,e=e.offsetParent;return{left:r,top:i,width:t,height:n}}function En(e,t){const n={x:0,y:0};if(Xt){let t=e;for(;t&&"html"!==t.nodeName.toLowerCase();){const e=Nn(t,"transform");if(/^matrix/.test(e)){const t=e.slice(7,-1).split(/,\s/).map(Number);n.x+=t[4],n.y+=t[5]}else if(/^matrix3d/.test(e)){const t=e.slice(9,-1).split(/,\s/).map(Number);n.x+=t[12],n.y+=t[13]}t=t.parentNode}}const r={},i=Tn(t.target),a=Tn(e),s=a.width,o=a.height;let l=t.offsetY-(a.top-i.top),u=t.offsetX-(a.left-i.left);return t.changedTouches&&(u=t.changedTouches[0].pageX-a.left,l=t.changedTouches[0].pageY+a.top,Xt&&(u-=n.x,l-=n.y)),r.y=1-Math.max(0,Math.min(1,l/o)),r.x=Math.max(0,Math.min(1,u/s)),r}function bn(e){return Ct(e)&&3===e.nodeType}function Sn(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function An(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map((e=>("function"==typeof e&&(e=e()),tn(e)||bn(e)?e:"string"==typeof e&&/\S/.test(e)?s().createTextNode(e):void 0))).filter((e=>e))}function wn(e,t){return An(t).forEach((t=>e.appendChild(t))),e}function In(e,t){return wn(Sn(e),t)}function Cn(e){return void 0===e.button&&void 0===e.buttons||0===e.button&&void 0===e.buttons||"mouseup"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons}const Rn=rn("querySelector"),Dn=rn("querySelectorAll");function Nn(e,t){if(!e||!t)return"";if("function"==typeof i().getComputedStyle){let n;try{n=i().getComputedStyle(e)}catch(e){return""}return n?n.getPropertyValue(t)||n[t]:""}return""}function On(e){[...s().styleSheets].forEach((t=>{try{const n=[...t.cssRules].map((e=>e.cssText)).join(""),r=s().createElement("style");r.textContent=n,e.document.head.appendChild(r)}catch(n){const r=s().createElement("link");r.rel="stylesheet",r.type=t.type,r.media=t.media.mediaText,r.href=t.href,e.document.head.appendChild(r)}}))}var Pn=Object.freeze({__proto__:null,isReal:en,isEl:tn,isInFrame:nn,createEl:an,textContent:sn,prependTo:on,hasClass:ln,addClass:un,removeClass:cn,toggleClass:dn,setAttributes:fn,getAttributes:hn,getAttribute:pn,setAttribute:gn,removeAttribute:mn,blockTextSelection:yn,unblockTextSelection:vn,getBoundingClientRect:_n,findPosition:Tn,getPointerPosition:En,isTextNode:bn,emptyEl:Sn,normalizeContent:An,appendContent:wn,insertContent:In,isSingleLeftClick:Cn,$:Rn,$$:Dn,computedStyle:Nn,copyStyleSheetsToWindow:On});let Mn,xn=!1;const Ln=function(){if(!1===Mn.options.autoSetup)return;const e=Array.prototype.slice.call(s().getElementsByTagName("video")),t=Array.prototype.slice.call(s().getElementsByTagName("audio")),n=Array.prototype.slice.call(s().getElementsByTagName("video-js")),r=e.concat(t,n);if(r&&r.length>0)for(let e=0,t=r.length;e<t;e++){const t=r[e];if(!t||!t.getAttribute){kn(1);break}void 0===t.player&&null!==t.getAttribute("data-setup")&&Mn(t)}else xn||kn(1)};function kn(e,t){en()&&(t&&(Mn=t),i().setTimeout(Ln,e))}function Fn(){xn=!0,i().removeEventListener("load",Fn)}en()&&("complete"===s().readyState?Fn():i().addEventListener("load",Fn));const Un=function(e){const t=s().createElement("style");return t.className=e,t},Bn=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t};var jn=new WeakMap;let qn,Hn=3;function Gn(){return Hn++}function Vn(e,t){if(!jn.has(e))return;const n=jn.get(e);0===n.handlers[t].length&&(delete n.handlers[t],e.removeEventListener?e.removeEventListener(t,n.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,n.dispatcher)),Object.getOwnPropertyNames(n.handlers).length<=0&&(delete n.handlers,delete n.dispatcher,delete n.disabled),0===Object.getOwnPropertyNames(n).length&&jn.delete(e)}function Yn(e,t,n,r){n.forEach((function(n){e(t,n,r)}))}function Zn(e){if(e.fixed_)return e;function t(){return!0}function n(){return!1}if(!e||!e.isPropagationStopped||!e.isImmediatePropagationStopped){const r=e||i().event;e={};for(const t in r)"layerX"!==t&&"layerY"!==t&&"keyLocation"!==t&&"webkitMovementX"!==t&&"webkitMovementY"!==t&&"path"!==t&&("returnValue"===t&&r.preventDefault||(e[t]=r[t]));if(e.target||(e.target=e.srcElement||s()),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){r.preventDefault&&r.preventDefault(),e.returnValue=!1,r.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){r.stopPropagation&&r.stopPropagation(),e.cancelBubble=!0,r.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=n,e.stopImmediatePropagation=function(){r.stopImmediatePropagation&&r.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=n,null!==e.clientX&&void 0!==e.clientX){const t=s().documentElement,n=s().body;e.pageX=e.clientX+(t&&t.scrollLeft||n&&n.scrollLeft||0)-(t&&t.clientLeft||n&&n.clientLeft||0),e.pageY=e.clientY+(t&&t.scrollTop||n&&n.scrollTop||0)-(t&&t.clientTop||n&&n.clientTop||0)}e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e.fixed_=!0,e}const Kn=function(){if("boolean"!=typeof qn){qn=!1;try{const e=Object.defineProperty({},"passive",{get(){qn=!0}});i().addEventListener("test",null,e),i().removeEventListener("test",null,e)}catch(e){}}return qn},zn=["touchstart","touchmove"];function Wn(e,t,n){if(Array.isArray(t))return Yn(Wn,e,t,n);jn.has(e)||jn.set(e,{});const r=jn.get(e);if(r.handlers||(r.handlers={}),r.handlers[t]||(r.handlers[t]=[]),n.guid||(n.guid=Gn()),r.handlers[t].push(n),r.dispatcher||(r.disabled=!1,r.dispatcher=function(t,n){if(r.disabled)return;t=Zn(t);const i=r.handlers[t.type];if(i){const r=i.slice(0);for(let i=0,a=r.length;i<a&&!t.isImmediatePropagationStopped();i++)try{r[i].call(e,t,n)}catch(e){Et.error(e)}}}),1===r.handlers[t].length)if(e.addEventListener){let n=!1;Kn()&&zn.indexOf(t)>-1&&(n={passive:!0}),e.addEventListener(t,r.dispatcher,n)}else e.attachEvent&&e.attachEvent("on"+t,r.dispatcher)}function Xn(e,t,n){if(!jn.has(e))return;const r=jn.get(e);if(!r.handlers)return;if(Array.isArray(t))return Yn(Xn,e,t,n);const i=function(e,t){r.handlers[t]=[],Vn(e,t)};if(void 0===t){for(const t in r.handlers)Object.prototype.hasOwnProperty.call(r.handlers||{},t)&&i(e,t);return}const a=r.handlers[t];if(a)if(n){if(n.guid)for(let e=0;e<a.length;e++)a[e].guid===n.guid&&a.splice(e--,1);Vn(e,t)}else i(e,t)}function $n(e,t,n){const r=jn.has(e)?jn.get(e):{},i=e.parentNode||e.ownerDocument;if("string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=Zn(t),r.dispatcher&&r.dispatcher.call(e,t,n),i&&!t.isPropagationStopped()&&!0===t.bubbles)$n.call(null,i,t,n);else if(!i&&!t.defaultPrevented&&t.target&&t.target[t.type]){jn.has(t.target)||jn.set(t.target,{});const e=jn.get(t.target);t.target[t.type]&&(e.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),e.disabled=!1)}return!t.defaultPrevented}function Qn(e,t,n){if(Array.isArray(t))return Yn(Qn,e,t,n);const r=function(){Xn(e,t,r),n.apply(this,arguments)};r.guid=n.guid=n.guid||Gn(),Wn(e,t,r)}function Jn(e,t,n){const r=function(){Xn(e,t,r),n.apply(this,arguments)};r.guid=n.guid=n.guid||Gn(),Wn(e,t,r)}var er=Object.freeze({__proto__:null,fixEvent:Zn,on:Wn,off:Xn,trigger:$n,one:Qn,any:Jn});const tr=30,nr=function(e,t,n){t.guid||(t.guid=Gn());const r=t.bind(e);return r.guid=n?n+"_"+t.guid:t.guid,r},rr=function(e,t){let n=i().performance.now();return function(...r){const a=i().performance.now();a-n>=t&&(e(...r),n=a)}},ir=function(e,t,n,r=i()){let a;const s=function(){const i=this,s=arguments;let o=function(){a=null,o=null,n||e.apply(i,s)};!a&&n&&e.apply(i,s),r.clearTimeout(a),a=r.setTimeout(o,t)};return s.cancel=()=>{r.clearTimeout(a),a=null},s};var ar=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:tr,bind_:nr,throttle:rr,debounce:ir});let sr;class or{on(e,t){const n=this.addEventListener;this.addEventListener=()=>{},Wn(this,e,t),this.addEventListener=n}off(e,t){Xn(this,e,t)}one(e,t){const n=this.addEventListener;this.addEventListener=()=>{},Qn(this,e,t),this.addEventListener=n}any(e,t){const n=this.addEventListener;this.addEventListener=()=>{},Jn(this,e,t),this.addEventListener=n}trigger(e){const t=e.type||e;"string"==typeof e&&(e={type:t}),e=Zn(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),$n(this,e)}queueTrigger(e){sr||(sr=new Map);const t=e.type||e;let n=sr.get(this);n||(n=new Map,sr.set(this,n));const r=n.get(t);n.delete(t),i().clearTimeout(r);const a=i().setTimeout((()=>{n.delete(t),0===n.size&&(n=null,sr.delete(this)),this.trigger(e)}),0);n.set(t,a)}}or.prototype.allowedEvents_={},or.prototype.addEventListener=or.prototype.on,or.prototype.removeEventListener=or.prototype.off,or.prototype.dispatchEvent=or.prototype.trigger;const lr=e=>"function"==typeof e.name?e.name():"string"==typeof e.name?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e,ur=e=>e instanceof or||!!e.eventBusEl_&&["on","one","off","trigger"].every((t=>"function"==typeof e[t])),cr=e=>"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length,dr=(e,t,n)=>{if(!e||!e.nodeName&&!ur(e))throw new Error(`Invalid target for ${lr(t)}#${n}; must be a DOM node or evented object.`)},fr=(e,t,n)=>{if(!cr(e))throw new Error(`Invalid event type for ${lr(t)}#${n}; must be a non-empty string or array.`)},hr=(e,t,n)=>{if("function"!=typeof e)throw new Error(`Invalid listener for ${lr(t)}#${n}; must be a function.`)},pr=(e,t,n)=>{const r=t.length<3||t[0]===e||t[0]===e.eventBusEl_;let i,a,s;return r?(i=e.eventBusEl_,t.length>=3&&t.shift(),[a,s]=t):[i,a,s]=t,dr(i,e,n),fr(a,e,n),hr(s,e,n),s=nr(e,s),{isTargetingSelf:r,target:i,type:a,listener:s}},gr=(e,t,n,r)=>{dr(e,e,t),e.nodeName?er[t](e,n,r):e[t](n,r)},mr={on(...e){const{isTargetingSelf:t,target:n,type:r,listener:i}=pr(this,e,"on");if(gr(n,"on",r,i),!t){const e=()=>this.off(n,r,i);e.guid=i.guid;const t=()=>this.off("dispose",e);t.guid=i.guid,gr(this,"on","dispose",e),gr(n,"on","dispose",t)}},one(...e){const{isTargetingSelf:t,target:n,type:r,listener:i}=pr(this,e,"one");if(t)gr(n,"one",r,i);else{const e=(...t)=>{this.off(n,r,e),i.apply(null,t)};e.guid=i.guid,gr(n,"one",r,e)}},any(...e){const{isTargetingSelf:t,target:n,type:r,listener:i}=pr(this,e,"any");if(t)gr(n,"any",r,i);else{const e=(...t)=>{this.off(n,r,e),i.apply(null,t)};e.guid=i.guid,gr(n,"any",r,e)}},off(e,t,n){if(!e||cr(e))Xn(this.eventBusEl_,e,t);else{const r=e,i=t;dr(r,this,"off"),fr(i,this,"off"),hr(n,this,"off"),n=nr(this,n),this.off("dispose",n),r.nodeName?(Xn(r,i,n),Xn(r,"dispose",n)):ur(r)&&(r.off(i,n),r.off("dispose",n))}},trigger(e,t){dr(this.eventBusEl_,this,"trigger");const n=e&&"string"!=typeof e?e.type:e;if(!cr(n))throw new Error(`Invalid event type for ${lr(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return $n(this.eventBusEl_,e,t)}};function yr(e,t={}){const{eventBusKey:n}=t;if(n){if(!e[n].nodeName)throw new Error(`The eventBusKey "${n}" does not refer to an element.`);e.eventBusEl_=e[n]}else e.eventBusEl_=an("span",{className:"vjs-event-bus"});return Object.assign(e,mr),e.eventedCallbacks&&e.eventedCallbacks.forEach((e=>{e()})),e.on("dispose",(()=>{e.off(),[e,e.el_,e.eventBusEl_].forEach((function(e){e&&jn.has(e)&&jn.delete(e)})),i().setTimeout((()=>{e.eventBusEl_=null}),0)})),e}const vr={state:{},setState(e){let t;return"function"==typeof e&&(e=e()),wt(e,((e,n)=>{this.state[n]!==e&&(t=t||{},t[n]={from:this.state[n],to:e}),this.state[n]=e})),t&&ur(this)&&this.trigger({changes:t,type:"statechanged"}),t}};function _r(e,t){return Object.assign(e,vr),e.state=Object.assign({},e.state,t),"function"==typeof e.handleStateChanged&&ur(e)&&e.on("statechanged",e.handleStateChanged),e}const Tr=function(e){return"string"!=typeof e?e:e.replace(/./,(e=>e.toLowerCase()))},Er=function(e){return"string"!=typeof e?e:e.replace(/./,(e=>e.toUpperCase()))},br=function(e,t){return Er(e)===Er(t)};var Sr=Object.freeze({__proto__:null,toLowerCase:Tr,toTitleCase:Er,titleCaseEquals:br});class Ar{constructor(e,t,n){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=Dt({},this.options_),t=this.options_=Dt(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const t=e&&e.id&&e.id()||"no_player";this.id_=`${t}_component_${Gn()}`}this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach((e=>this.addClass(e))),["on","off","one","any","trigger"].forEach((e=>{this[e]=void 0})),!1!==t.evented&&(yr(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),_r(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!==t.initChildren&&this.initChildren(),this.ready(n),!1!==t.reportTouchActivity&&this.enableTouchActivity()}on(e,t){}off(e,t){}one(e,t){}any(e,t){}trigger(e,t){}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let e=this.children_.length-1;e>=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return Boolean(this.isDisposed_)}player(){return this.player_}options(e){return e?(this.options_=Dt(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,n){return an(e,t,n)}localize(e,t,n=e){const r=this.player_.language&&this.player_.language(),i=this.player_.languages&&this.player_.languages(),a=i&&i[r],s=r&&r.split("-")[0],o=i&&i[s];let l=n;return a&&a[e]?l=a[e]:o&&o[e]&&(l=o[e]),t&&(l=l.replace(/\{(\d+)\}/g,(function(e,n){const r=t[n-1];let i=r;return void 0===r&&(i=e),i}))),l}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce(((e,t)=>e.concat(t)),[]);let t=this;for(let n=0;n<e.length;n++)if(t=t.getChild(e[n]),!t||!t.getChild)return;return t}setIcon(e,t=this.el()){if(!this.player_.options_.experimentalSvgIcons)return;const n="http://www.w3.org/2000/svg",r=an("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),i=s().createElementNS(n,"svg");i.setAttributeNS(null,"viewBox","0 0 512 512");const a=s().createElementNS(n,"use");return i.appendChild(a),a.setAttributeNS(null,"href",`#vjs-icon-${e}`),r.appendChild(i),this.iconIsSet_?t.replaceChild(r,t.querySelector(".vjs-icon-placeholder")):t.appendChild(r),this.iconIsSet_=!0,r}addChild(e,t={},n=this.children_.length){let r,i;if("string"==typeof e){i=Er(e);const n=t.componentClass||i;t.name=i;const a=Ar.getComponent(n);if(!a)throw new Error(`Component ${n} does not exist`);if("function"!=typeof a)return null;r=new a(this.player_||this,t)}else r=e;if(r.parentComponent_&&r.parentComponent_.removeChild(r),this.children_.splice(n,0,r),r.parentComponent_=this,"function"==typeof r.id&&(this.childIndex_[r.id()]=r),i=i||r.name&&Er(r.name()),i&&(this.childNameIndex_[i]=r,this.childNameIndex_[Tr(i)]=r),"function"==typeof r.el&&r.el()){let e=null;this.children_[n+1]&&(this.children_[n+1].el_?e=this.children_[n+1].el_:tn(this.children_[n+1])&&(e=this.children_[n+1])),this.contentEl().insertBefore(r.el(),e)}return r}removeChild(e){if("string"==typeof e&&(e=this.getChild(e)),!e||!this.children_)return;let t=!1;for(let n=this.children_.length-1;n>=0;n--)if(this.children_[n]===e){t=!0,this.children_.splice(n,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[Er(e.name())]=null,this.childNameIndex_[Tr(e.name())]=null;const n=e.el();n&&n.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,n=e=>{const n=e.name;let r=e.opts;if(void 0!==t[n]&&(r=t[n]),!1===r)return;!0===r&&(r={}),r.playerOptions=this.options_.playerOptions;const i=this.addChild(n,r);i&&(this[n]=i)};let r;const i=Ar.getComponent("Tech");r=Array.isArray(e)?e:Object.keys(e),r.concat(Object.keys(this.options_).filter((function(e){return!r.some((function(t){return"string"==typeof t?e===t:e===t.name}))}))).map((t=>{let n,r;return"string"==typeof t?(n=t,r=e[n]||this.options_[n]||{}):(n=t.name,r=t),{name:n,opts:r}})).filter((e=>{const t=Ar.getComponent(e.opts.componentClass||Er(e.name));return t&&!i.isTech(t)})).forEach(n)}}buildCSSClass(){return""}ready(e,t=!1){if(e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))}triggerReady(){this.isReady_=!0,this.setTimeout((function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach((function(e){e.call(this)}),this),this.trigger("ready")}),1)}$(e,t){return Rn(e,t||this.contentEl())}$$(e,t){return Dn(e,t||this.contentEl())}hasClass(e){return ln(this.el_,e)}addClass(...e){un(this.el_,...e)}removeClass(...e){cn(this.el_,...e)}toggleClass(e,t){dn(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return pn(this.el_,e)}setAttribute(e,t){gn(this.el_,e,t)}removeAttribute(e){mn(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,n){if(void 0!==t)return null!==t&&t==t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(n||this.trigger("componentresize"));if(!this.el_)return 0;const r=this.el_.style[e],i=r.indexOf("px");return-1!==i?parseInt(r.slice(0,i),10):parseInt(this.el_["offset"+Er(e)],10)}currentDimension(e){let t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if(t=Nn(this.el_,e),t=parseFloat(t),0===t||isNaN(t)){const n=`offset${Er(e)}`;t=this.el_[n]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(l().isEventKey(e,"Tab")||e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e,t=0,n=null;this.on("touchstart",(function(r){1===r.touches.length&&(n={pageX:r.touches[0].pageX,pageY:r.touches[0].pageY},t=i().performance.now(),e=!0)})),this.on("touchmove",(function(t){if(t.touches.length>1)e=!1;else if(n){const r=t.touches[0].pageX-n.pageX,i=t.touches[0].pageY-n.pageY;Math.sqrt(r*r+i*i)>10&&(e=!1)}}));const r=function(){e=!1};this.on("touchleave",r),this.on("touchcancel",r),this.on("touchend",(function(r){n=null,!0===e&&i().performance.now()-t<200&&(r.preventDefault(),this.trigger("tap"))}))}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const e=nr(this.player(),this.player().reportUserActivity);let t;this.on("touchstart",(function(){e(),this.clearInterval(t),t=this.setInterval(e,250)}));const n=function(n){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",n),this.on("touchcancel",n)}setTimeout(e,t){var n;return e=nr(this,e),this.clearTimersOnDispose_(),n=i().setTimeout((()=>{this.setTimeoutIds_.has(n)&&this.setTimeoutIds_.delete(n),e()}),t),this.setTimeoutIds_.add(n),n}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),i().clearTimeout(e)),e}setInterval(e,t){e=nr(this,e),this.clearTimersOnDispose_();const n=i().setInterval(e,t);return this.setIntervalIds_.add(n),n}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),i().clearInterval(e)),e}requestAnimationFrame(e){var t;return this.clearTimersOnDispose_(),e=nr(this,e),t=i().requestAnimationFrame((()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()})),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){if(this.namedRafs_.has(e))return;this.clearTimersOnDispose_(),t=nr(this,t);const n=this.requestAnimationFrame((()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)}));return this.namedRafs_.set(e,n),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),i().cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",(()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach((([e,t])=>{this[e].forEach(((e,n)=>this[t](n)))})),this.clearingTimersOnDispose_=!1})))}static registerComponent(e,t){if("string"!=typeof e||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const n=Ar.getComponent("Tech"),r=n&&n.isTech(t),i=Ar===t||Ar.prototype.isPrototypeOf(t.prototype);if(r||!i){let t;throw t=r?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error(`Illegal component, "${e}"; ${t}.`)}e=Er(e),Ar.components_||(Ar.components_={});const a=Ar.getComponent("Player");if("Player"===e&&a&&a.players){const e=a.players,t=Object.keys(e);if(e&&t.length>0&&t.map((t=>e[t])).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return Ar.components_[e]=t,Ar.components_[Tr(e)]=t,t}static getComponent(e){if(e&&Ar.components_)return Ar.components_[e]}}function wr(e,t,n,r){return function(e,t,n){if("number"!=typeof t||t<0||t>n)throw new Error(`Failed to execute '${e}' on 'TimeRanges': The index provided (${t}) is non-numeric or out of bounds (0-${n}).`)}(e,r,n.length-1),n[r][t]}function Ir(e){let t;return t=void 0===e||0===e.length?{length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:wr.bind(null,"start",0,e),end:wr.bind(null,"end",1,e)},i().Symbol&&i().Symbol.iterator&&(t[i().Symbol.iterator]=()=>(e||[]).values()),t}function Cr(e,t){return Array.isArray(e)?Ir(e):void 0===e||void 0===t?Ir():Ir([[e,t]])}Ar.registerComponent("Component",Ar);const Rr=function(e,t){e=e<0?0:e;let n=Math.floor(e%60),r=Math.floor(e/60%60),i=Math.floor(e/3600);const a=Math.floor(t/60%60),s=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(i=r=n="-"),i=i>0||s>0?i+":":"",r=((i||a>=10)&&r<10?"0"+r:r)+":",n=n<10?"0"+n:n,i+r+n};let Dr=Rr;function Nr(e){Dr=e}function Or(){Dr=Rr}function Pr(e,t=e){return Dr(e,t)}var Mr=Object.freeze({__proto__:null,createTimeRanges:Cr,createTimeRange:Cr,setFormatTime:Nr,resetFormatTime:Or,formatTime:Pr});function xr(e,t){let n,r,i=0;if(!t)return 0;e&&e.length||(e=Cr(0,0));for(let a=0;a<e.length;a++)n=e.start(a),r=e.end(a),r>t&&(r=t),i+=r-n;return i/t}function Lr(e){if(e instanceof Lr)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:Ct(e)&&("number"==typeof e.code&&(this.code=e.code),Object.assign(this,e)),this.message||(this.message=Lr.defaultMessages[this.code]||"")}Lr.prototype.code=0,Lr.prototype.message="",Lr.prototype.status=null,Lr.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Lr.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(let e=0;e<Lr.errorTypes.length;e++)Lr[Lr.errorTypes[e]]=e,Lr.prototype[Lr.errorTypes[e]]=e;function kr(e){return null!=e&&"function"==typeof e.then}function Fr(e){kr(e)&&e.then(null,(e=>{}))}const Ur=function(e){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(((t,n,r)=>(e[n]&&(t[n]=e[n]),t)),{cues:e.cues&&Array.prototype.map.call(e.cues,(function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}}))})};const Br="vjs-modal-dialog";class jr extends Ar{constructor(e,t){super(e,t),this.handleKeyDown_=e=>this.handleKeyDown(e),this.close_=e=>this.close(e),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=an("div",{className:`${Br}-content`},{role:"document"}),this.descEl_=an("p",{className:`${Br}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),sn(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"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${Br} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(!this.opened_){const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}}opened(e){return"boolean"==typeof e&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if("boolean"==typeof e){const t=this.closeable_=!!e;let n=this.getChild("closeButton");if(t&&!n){const e=this.contentEl_;this.contentEl_=this.el_,n=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=e,this.on(n,"close",this.close_)}!t&&n&&(this.off(n,"close",this.close_),this.removeChild(n),n.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),n=t.parentNode,r=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,n.removeChild(t),this.empty(),In(t,e),this.trigger("modalfill"),r?n.insertBefore(t,r):n.appendChild(t);const i=this.getChild("closeButton");i&&n.appendChild(i.el_)}empty(){this.trigger("beforemodalempty"),Sn(this.contentEl()),this.trigger("modalempty")}content(e){return void 0!==e&&(this.content_=e),this.content_}conditionalFocus_(){const e=s().activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(e.stopPropagation(),l().isEventKey(e,"Escape")&&this.closeable())return e.preventDefault(),void this.close();if(!l().isEventKey(e,"Tab"))return;const t=this.focusableEls_(),n=this.el_.querySelector(":focus");let r;for(let e=0;e<t.length;e++)if(n===t[e]){r=e;break}s().activeElement===this.el_&&(r=0),e.shiftKey&&0===r?(t[t.length-1].focus(),e.preventDefault()):e.shiftKey||r!==t.length-1||(t[0].focus(),e.preventDefault())}focusableEls_(){const e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,(e=>(e instanceof i().HTMLAnchorElement||e instanceof i().HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof i().HTMLInputElement||e instanceof i().HTMLSelectElement||e instanceof i().HTMLTextAreaElement||e instanceof i().HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof i().HTMLIFrameElement||e instanceof i().HTMLObjectElement||e instanceof i().HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable")))}}jr.prototype.options_={pauseOnOpen:!0,temporary:!0},Ar.registerComponent("ModalDialog",jr);class qr extends or{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t<e.length;t++)this.addTrack(e[t])}addTrack(e){const t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.tracks_[t]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=()=>{this.trigger({track:e,type:"labelchange",target:this})},ur(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let n=0,r=this.length;n<r;n++)if(this[n]===e){t=this[n],t.off&&t.off(),this.tracks_.splice(n,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})}getTrackById(e){let t=null;for(let n=0,r=this.length;n<r;n++){const r=this[n];if(r.id===e){t=r;break}}return t}}qr.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const e in qr.prototype.allowedEvents_)qr.prototype["on"+e]=null;const Hr=function(e,t){for(let n=0;n<e.length;n++)Object.keys(e[n]).length&&t.id!==e[n].id&&(e[n].enabled=!1)},Gr=function(e,t){for(let n=0;n<e.length;n++)Object.keys(e[n]).length&&t.id!==e[n].id&&(e[n].selected=!1)};class Vr extends qr{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),-1===["metadata","chapters"].indexOf(e.kind)&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}}class Yr{constructor(e){Yr.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){const t=this.length||0;let n=0;const r=e.length;this.cues_=e,this.length_=e.length;const i=function(e){""+e in this||Object.defineProperty(this,""+e,{get(){return this.cues_[e]}})};if(t<r)for(n=t;n<r;n++)i.call(this,n)}getCueById(e){let t=null;for(let n=0,r=this.length;n<r;n++){const r=this[n];if(r.id===e){t=r;break}}return t}}const Zr={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},Kr={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},zr={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Wr={disabled:"disabled",hidden:"hidden",showing:"showing"};class Xr extends or{constructor(e={}){super();const t={id:e.id||"vjs_track_"+Gn(),kind:e.kind||"",language:e.language||""};let n=e.label||"";for(const e in t)Object.defineProperty(this,e,{get:()=>t[e],set(){}});Object.defineProperty(this,"label",{get:()=>n,set(e){e!==n&&(n=e,this.trigger("labelchange"))}})}}const $r=function(e){const t=["protocol","hostname","port","pathname","search","hash","host"],n=s().createElement("a");n.href=e;const r={};for(let e=0;e<t.length;e++)r[t[e]]=n[t[e]];return"http:"===r.protocol&&(r.host=r.host.replace(/:80$/,"")),"https:"===r.protocol&&(r.host=r.host.replace(/:443$/,"")),r.protocol||(r.protocol=i().location.protocol),r.host||(r.host=i().location.host),r},Qr=function(e){if(!e.match(/^https?:\/\//)){const t=s().createElement("a");t.href=e,e=t.href}return e},Jr=function(e){if("string"==typeof e){const t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e);if(t)return t.pop().toLowerCase()}return""},ei=function(e,t=i().location){const n=$r(e);return(":"===n.protocol?t.protocol:n.protocol)+n.host!==t.protocol+t.host};var ti=Object.freeze({__proto__:null,parseUrl:$r,getAbsoluteURL:Qr,getFileExtension:Jr,isCrossOrigin:ei});const ni=function(e,t){const n=new(i().WebVTT.Parser)(i(),i().vttjs,i().WebVTT.StringDecoder()),r=[];n.oncue=function(e){t.addCue(e)},n.onparsingerror=function(e){r.push(e)},n.onflush=function(){t.trigger({type:"loadeddata",target:t})},n.parse(e),r.length>0&&(i().console&&i().console.groupCollapsed&&i().console.groupCollapsed(`Text Track parsing errors for ${t.src}`),r.forEach((e=>Et.error(e))),i().console&&i().console.groupEnd&&i().console.groupEnd()),n.flush()},ri=function(e,t){const n={uri:e},r=ei(e);r&&(n.cors=r);const a="use-credentials"===t.tech_.crossOrigin();a&&(n.withCredentials=a),f()(n,nr(this,(function(e,n,r){if(e)return Et.error(e,n);t.loaded_=!0,"function"!=typeof i().WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],(e=>{if("vttjserror"!==e.type)return ni(r,t);Et.error(`vttjs failed to load, stopping trying to process ${t.src}`)})):ni(r,t)})))};class ii extends Xr{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=Dt(e,{kind:zr[e.kind]||"subtitles",language:e.language||e.srclang||""});let n=Wr[t.mode]||"disabled";const r=t.default;"metadata"!==t.kind&&"chapters"!==t.kind||(n="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=!1!==this.tech_.preloadTextTracks;const i=new Yr(this.cues_),a=new Yr(this.activeCues_);let s=!1;this.timeupdateHandler=nr(this,(function(e={}){this.tech_.isDisposed()||(this.tech_.isReady_?(this.activeCues=this.activeCues,s&&(this.trigger("cuechange"),s=!1),"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))):"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)))})),this.tech_.one("dispose",(()=>{this.stopTracking()})),"disabled"!==n&&this.startTracking(),Object.defineProperties(this,{default:{get:()=>r,set(){}},mode:{get:()=>n,set(e){Wr[e]&&n!==e&&(n=e,this.preload_||"disabled"===n||0!==this.cues.length||ri(this.src,this),this.stopTracking(),"disabled"!==n&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?i:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(0===this.cues.length)return a;const e=this.tech_.currentTime(),t=[];for(let n=0,r=this.cues.length;n<r;n++){const r=this.cues[n];r.startTime<=e&&r.endTime>=e&&t.push(r)}if(s=!1,t.length!==this.activeCues_.length)s=!0;else for(let e=0;e<t.length;e++)-1===this.activeCues_.indexOf(t[e])&&(s=!0);return this.activeCues_=t,a.setCues_(this.activeCues_),a},set(){}}}),t.src?(this.src=t.src,this.preload_||(this.loaded_=!0),(this.preload_||"subtitles"!==t.kind&&"captions"!==t.kind)&&ri(this.src,this)):this.loaded_=!0}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)}stopTracking(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)}addCue(e){let t=e;if(!("getCueAsHTML"in t)){t=new(i().vttjs.VTTCue)(e.startTime,e.endTime,e.text);for(const n in e)n in t||(t[n]=e[n]);t.id=e.id,t.originalCue_=e}const n=this.tech_.textTracks();for(let e=0;e<n.length;e++)n[e]!==this&&n[e].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}removeCue(e){let t=this.cues_.length;for(;t--;){const n=this.cues_[t];if(n===e||n.originalCue_&&n.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}}ii.prototype.allowedEvents_={cuechange:"cuechange"};class ai extends Xr{constructor(e={}){const t=Dt(e,{kind:Kr[e.kind]||""});super(t);let n=!1;Object.defineProperty(this,"enabled",{get:()=>n,set(e){"boolean"==typeof e&&e!==n&&(n=e,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}}class si extends Xr{constructor(e={}){const t=Dt(e,{kind:Zr[e.kind]||""});super(t);let n=!1;Object.defineProperty(this,"selected",{get:()=>n,set(e){"boolean"==typeof e&&e!==n&&(n=e,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}}class oi extends or{constructor(e={}){let t;super();const n=new ii(e);this.kind=n.kind,this.src=n.src,this.srclang=n.language,this.label=n.label,this.default=n.default,Object.defineProperties(this,{readyState:{get:()=>t},track:{get:()=>n}}),t=oi.NONE,n.addEventListener("loadeddata",(()=>{t=oi.LOADED,this.trigger({type:"load",target:this})}))}}oi.prototype.allowedEvents_={load:"load"},oi.NONE=0,oi.LOADING=1,oi.LOADED=2,oi.ERROR=3;const li={audio:{ListClass:class extends qr{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){Hr(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&Hr(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,Hr(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}},TrackClass:ai,capitalName:"Audio"},video:{ListClass:class extends qr{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){Gr(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set(){}})}addTrack(e){e.selected&&Gr(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,Gr(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}},TrackClass:si,capitalName:"Video"},text:{ListClass:Vr,TrackClass:ii,capitalName:"Text"}};Object.keys(li).forEach((function(e){li[e].getterName=`${e}Tracks`,li[e].privateName=`${e}Tracks_`}));const ui={remoteText:{ListClass:Vr,TrackClass:ii,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:class{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,n=e.length;t<n;t++)this.addTrackElement_(e[t])}addTrackElement_(e){const t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.trackElements_[t]}}),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)}getTrackElementByTrack_(e){let t;for(let n=0,r=this.trackElements_.length;n<r;n++)if(e===this.trackElements_[n].track){t=this.trackElements_[n];break}return t}removeTrackElement_(e){for(let t=0,n=this.trackElements_.length;t<n;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&"function"==typeof this.trackElements_[t].track.off&&this.trackElements_[t].track.off(),"function"==typeof this.trackElements_[t].off&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}}},TrackClass:oi,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},ci=Object.assign({},li,ui);ui.names=Object.keys(ui),li.names=Object.keys(li),ci.names=[].concat(ui.names).concat(li.names);class di extends Ar{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=e=>this.onDurationChange(e),this.trackProgress_=e=>this.trackProgress(e),this.trackCurrentTime_=e=>this.trackCurrentTime(e),this.stopTrackingCurrentTime_=e=>this.stopTrackingCurrentTime(e),this.disposeSourceHandler_=e=>this.disposeSourceHandler(e),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",(function(){this.hasStarted_=!0})),this.on("loadstart",(function(){this.hasStarted_=!1})),ci.names.forEach((t=>{const n=ci[t];e&&e[n.getterName]&&(this[n.privateName]=e[n.getterName])})),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach((t=>{!1===e[`native${t}Tracks`]&&(this[`featuresNative${t}Tracks`]=!1)})),!1===e.nativeCaptions||!1===e.nativeTextTracks?this.featuresNativeTextTracks=!1:!0!==e.nativeCaptions&&!0!==e.nativeTextTracks||(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=!1!==e.preloadTextTracks,this.autoRemoteTextTracks_=new ci.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",(()=>this.setTimeout((()=>this.triggerSourceset(e)),1))),this.trigger({src:e,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(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(nr(this,(function(){const e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()})),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return Cr(0,0)}bufferedPercent(){return xr(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(li.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){(e=[].concat(e)).forEach((e=>{const t=this[`${e}Tracks`]()||[];let n=t.length;for(;n--;){const r=t[n];"text"===e&&this.removeRemoteTextTrack(r),t.removeTrack(r)}}))}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const n=e[t];this.removeRemoteTextTrack(n)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return void 0!==e&&(this.error_=new Lr(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?Cr(0,0):Cr()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){li.names.forEach((e=>{const t=li[e],n=()=>{this.trigger(`${e}trackchange`)},r=this[t.getterName]();r.addEventListener("removetrack",n),r.addEventListener("addtrack",n),this.on("dispose",(()=>{r.removeEventListener("removetrack",n),r.removeEventListener("addtrack",n)}))}))}addWebVttScript_(){if(!i().WebVTT)if(s().body.contains(this.el())){if(!this.options_["vtt.js"]&&Rt(p())&&Object.keys(p()).length>0)return void this.trigger("vttjsloaded");const e=s().createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",(()=>{e.onload=null,e.onerror=null})),i().WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),n=t=>e.addTrack(t.track),r=t=>e.removeTrack(t.track);t.on("addtrack",n),t.on("removetrack",r),this.addWebVttScript_();const i=()=>this.trigger("texttrackchange"),a=()=>{i();for(let t=0;t<e.length;t++){const n=e[t];n.removeEventListener("cuechange",i),"showing"===n.mode&&n.addEventListener("cuechange",i)}};a(),e.addEventListener("change",a),e.addEventListener("addtrack",a),e.addEventListener("removetrack",a),this.on("dispose",(function(){t.off("addtrack",n),t.off("removetrack",r),e.removeEventListener("change",a),e.removeEventListener("addtrack",a),e.removeEventListener("removetrack",a);for(let t=0;t<e.length;t++)e[t].removeEventListener("cuechange",i)}))}addTextTrack(e,t,n){if(!e)throw new Error("TextTrack kind is required but was not provided");return function(e,t,n,r,i={}){const a=e.textTracks();i.kind=t,n&&(i.label=n),r&&(i.language=r),i.tech=e;const s=new ci.text.TrackClass(i);return a.addTrack(s),s}(this,e,t,n)}createRemoteTextTrack(e){const t=Dt(e,{tech:this});return new ui.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){const n=this.createRemoteTextTrack(e);return"boolean"!=typeof t&&(t=!1),this.remoteTextTrackEls().addTrackElement_(n),this.remoteTextTracks().addTrack(n.track),!1===t&&this.ready((()=>this.autoRemoteTextTracks_.addTrack(n.track))),n}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=Gn();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",(()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())}))):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return di.canPlayType(e.type)}static isTech(e){return e.prototype instanceof di||e instanceof di||e===di}static registerTech(e,t){if(di.techs_||(di.techs_={}),!di.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!di.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!di.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=Er(e),di.techs_[e]=t,di.techs_[Tr(e)]=t,"Tech"!==e&&di.defaultTechOrder_.push(e),t}static getTech(e){if(e)return di.techs_&&di.techs_[e]?di.techs_[e]:(e=Er(e),i()&&i().videojs&&i().videojs[e]?(Et.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),i().videojs[e]):void 0)}}ci.names.forEach((function(e){const t=ci[e];di.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}})),di.prototype.featuresVolumeControl=!0,di.prototype.featuresMuteControl=!0,di.prototype.featuresFullscreenResize=!1,di.prototype.featuresPlaybackRate=!1,di.prototype.featuresProgressEvents=!1,di.prototype.featuresSourceset=!1,di.prototype.featuresTimeupdateEvents=!1,di.prototype.featuresNativeTextTracks=!1,di.prototype.featuresVideoFrameCallback=!1,di.withSourceHandlers=function(e){e.registerSourceHandler=function(t,n){let r=e.sourceHandlers;r||(r=e.sourceHandlers=[]),void 0===n&&(n=r.length),r.splice(n,0,t)},e.canPlayType=function(t){const n=e.sourceHandlers||[];let r;for(let e=0;e<n.length;e++)if(r=n[e].canPlayType(t),r)return r;return""},e.selectSourceHandler=function(t,n){const r=e.sourceHandlers||[];let i;for(let e=0;e<r.length;e++)if(i=r[e].canHandleSource(t,n),i)return r[e];return null},e.canPlaySource=function(t,n){const r=e.selectSourceHandler(t,n);return r?r.canHandleSource(t,n):""},["seekable","seeking","duration"].forEach((function(e){const t=this[e];"function"==typeof t&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})}),e.prototype),e.prototype.setSource=function(t){let n=e.selectSourceHandler(t,this.options_);n||(e.nativeSourceHandler?n=e.nativeSourceHandler:Et.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),n!==e.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=n.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},e.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}},Ar.registerComponent("Tech",di),di.registerTech("Tech",di),di.defaultTechOrder_=[];const fi={},hi={},pi={};function gi(e,t,n){e.setTimeout((()=>Ei(t,fi[t.type],n,e)),1)}function mi(e,t,n,r=null){const i="call"+Er(n),a=e.reduce(Ti(i),r),s=a===pi,o=s?null:t[n](a);return function(e,t,n,r){for(let i=e.length-1;i>=0;i--){const a=e[i];a[t]&&a[t](r,n)}}(e,n,o,s),o}const yi={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},vi={setCurrentTime:1,setMuted:1,setVolume:1},_i={play:1,pause:1};function Ti(e){return(t,n)=>t===pi?pi:n[e]?n[e](t):t}function Ei(e={},t=[],n,r,i=[],a=!1){const[s,...o]=t;if("string"==typeof s)Ei(e,fi[s],n,r,i,a);else if(s){const t=function(e,t){const n=hi[e.id()];let r=null;if(null==n)return r=t(e),hi[e.id()]=[[t,r]],r;for(let e=0;e<n.length;e++){const[i,a]=n[e];i===t&&(r=a)}return null===r&&(r=t(e),n.push([t,r])),r}(r,s);if(!t.setSource)return i.push(t),Ei(e,o,n,r,i,a);t.setSource(Object.assign({},e),(function(s,l){if(s)return Ei(e,o,n,r,i,a);i.push(t),Ei(l,e.type===l.type?o:fi[l.type],n,r,i,a)}))}else o.length?Ei(e,o,n,r,i,a):a?n(e,i):Ei(e,fi["*"],n,r,i,!0)}const bi={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},Si=function(e=""){const t=Jr(e);return bi[t.toLowerCase()]||""},Ai=function(e){if(Array.isArray(e)){let t=[];e.forEach((function(e){e=Ai(e),Array.isArray(e)?t=t.concat(e):Ct(e)&&t.push(e)})),e=t}else e="string"==typeof e&&e.trim()?[wi({src:e})]:Ct(e)&&"string"==typeof e.src&&e.src&&e.src.trim()?[wi(e)]:[];return e};function wi(e){if(!e.type){const t=Si(e.src);t&&(e.type=t)}return e}Ar.registerComponent("MediaLoader",class extends Ar{constructor(e,t,n){if(super(e,Dt({createEl:!1},t),n),t.playerOptions.sources&&0!==t.playerOptions.sources.length)e.src(t.playerOptions.sources);else for(let n=0,r=t.playerOptions.techOrder;n<r.length;n++){const t=Er(r[n]);let i=di.getTech(t);if(t||(i=Ar.getComponent(t)),i&&i.isSupported()){e.loadTech_(t);break}}}});class Ii extends Ar{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=e=>this.handleMouseOver(e),this.handleMouseOut_=e=>this.handleMouseOut(e),this.handleClick_=e=>this.handleClick(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.emitTapEvents(),this.enable()}createEl(e="div",t={},n={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),"button"===e&&Et.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),n=Object.assign({role:"button"},n),this.tabIndex_=t.tabIndex;const r=an(e,t,n);return this.player_.options_.experimentalSvgIcons||r.appendChild(an("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=an("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(void 0===e)return this.controlText_||"Need Text";const n=this.localize(e);this.controlText_=e,sn(this.controlTextEl_,n),this.nonIconControl||this.player_.options_.noUITitleAttributes||t.setAttribute("title",n)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){l().isEventKey(e,"Space")||l().isEventKey(e,"Enter")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}Ar.registerComponent("ClickableComponent",Ii);class Ci extends Ii{constructor(e,t){super(e,t),this.update(),this.update_=e=>this.update(e),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return an("div",{className:"vjs-poster"})}crossOrigin(e){if(void 0===e)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===e||"anonymous"===e||"use-credentials"===e?this.$("img")&&(this.$("img").crossOrigin=e):this.player_.log.warn(`crossOrigin must be null,  "anonymous" or "use-credentials", given "${e}"`)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){e?(this.$("img")||this.el_.appendChild(an("picture",{className:"vjs-poster",tabIndex:-1},{},an("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e):this.el_.textContent=""}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?Fr(this.player_.play()):this.player_.pause())}}Ci.prototype.crossorigin=Ci.prototype.crossOrigin,Ar.registerComponent("PosterImage",Ci);const Ri="#222",Di="#ccc",Ni={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Oi(e,t){let n;if(4===e.length)n=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");n=e.slice(1)}return"rgba("+parseInt(n.slice(0,2),16)+","+parseInt(n.slice(2,4),16)+","+parseInt(n.slice(4,6),16)+","+t+")"}function Pi(e,t,n){try{e.style[t]=n}catch(e){return}}function Mi(e){return e?`${e}px`:""}Ar.registerComponent("TextTrackDisplay",class extends Ar{constructor(e,t,n){super(e,t,n);const r=e=>{this.updateDisplayOverlay(),this.updateDisplay(e)};e.on("loadstart",(e=>this.toggleDisplay(e))),e.on("texttrackchange",(e=>this.updateDisplay(e))),e.on("loadedmetadata",(e=>{this.updateDisplayOverlay(),this.preselectTrack(e)})),e.ready(nr(this,(function(){if(e.tech_&&e.tech_.featuresNativeTextTracks)return void this.hide();e.on("fullscreenchange",r),e.on("playerresize",r);const t=i().screen.orientation||i(),n=i().screen.orientation?"change":"orientationchange";t.addEventListener(n,r),e.on("dispose",(()=>t.removeEventListener(n,r)));const a=this.options_.playerOptions.tracks||[];for(let e=0;e<a.length;e++)this.player_.addRemoteTextTrack(a[e],!0);this.preselectTrack()})))}preselectTrack(){const e={captions:1,subtitles:1},t=this.player_.textTracks(),n=this.player_.cache_.selectedLanguage;let r,i,a;for(let s=0;s<t.length;s++){const o=t[s];n&&n.enabled&&n.language&&n.language===o.language&&o.kind in e?o.kind===n.kind?a=o:a||(a=o):n&&!n.enabled?(a=null,r=null,i=null):o.default&&("descriptions"!==o.kind||r?o.kind in e&&!i&&(i=o):r=o)}a?a.mode="showing":i?i.mode="showing":r&&(r.mode="showing")}toggleDisplay(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()}createEl(){return super.createEl("div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})}clearDisplay(){"function"==typeof i().WebVTT&&i().WebVTT.processCues(i(),[],this.el_)}updateDisplay(){const e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){const t=[];for(let n=0;n<e.length;++n){const r=e[n];"showing"===r.mode&&t.push(r)}return void this.updateForTrack(t)}let n=null,r=null,i=e.length;for(;i--;){const t=e[i];"showing"===t.mode&&("descriptions"===t.kind?n=t:r=t)}r?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(r)):n&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(n))}updateDisplayOverlay(){if(!this.player_.videoHeight()||!i().CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),n=e/t,r=this.player_.videoWidth()/this.player_.videoHeight();let a=0,s=0;Math.abs(n-r)>.1&&(n>r?a=Math.round((e-t*r)/2):s=Math.round((t-e/r)/2)),Pi(this.el_,"insetInline",Mi(a)),Pi(this.el_,"insetBlock",Mi(s))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),n=e.activeCues;let r=n.length;for(;r--;){const e=n[r];if(!e)continue;const a=e.displayState;if(t.color&&(a.firstChild.style.color=t.color),t.textOpacity&&Pi(a.firstChild,"color",Oi(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(a.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&Pi(a.firstChild,"backgroundColor",Oi(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?Pi(a,"backgroundColor",Oi(t.windowColor,t.windowOpacity)):a.style.backgroundColor=t.windowColor),t.edgeStyle&&("dropshadow"===t.edgeStyle?a.firstChild.style.textShadow=`2px 2px 3px ${Ri}, 2px 2px 4px ${Ri}, 2px 2px 5px ${Ri}`:"raised"===t.edgeStyle?a.firstChild.style.textShadow=`1px 1px ${Ri}, 2px 2px ${Ri}, 3px 3px ${Ri}`:"depressed"===t.edgeStyle?a.firstChild.style.textShadow=`1px 1px ${Di}, 0 1px ${Di}, -1px -1px ${Ri}, 0 -1px ${Ri}`:"uniform"===t.edgeStyle&&(a.firstChild.style.textShadow=`0 0 4px ${Ri}, 0 0 4px ${Ri}, 0 0 4px ${Ri}, 0 0 4px ${Ri}`)),t.fontPercent&&1!==t.fontPercent){const e=i().parseFloat(a.style.fontSize);a.style.fontSize=e*t.fontPercent+"px",a.style.height="auto",a.style.top="auto"}t.fontFamily&&"default"!==t.fontFamily&&("small-caps"===t.fontFamily?a.firstChild.style.fontVariant="small-caps":a.firstChild.style.fontFamily=Ni[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),"function"!=typeof i().WebVTT||e.every((e=>!e.activeCues)))return;const t=[];for(let n=0;n<e.length;++n){const r=e[n];for(let e=0;e<r.activeCues.length;++e)t.push(r.activeCues[e])}i().WebVTT.processCues(i(),t,this.el_);for(let t=0;t<e.length;++t){const n=e[t];for(let e=0;e<n.activeCues.length;++e){const r=n.activeCues[e].displayState;un(r,"vjs-text-track-cue","vjs-text-track-cue-"+(n.language?n.language:t)),n.language&&gn(r,"lang",n.language)}this.player_.textTrackSettings&&this.updateDisplayState(n)}}}),Ar.registerComponent("LoadingSpinner",class extends Ar{createEl(){const e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"Video Player"),n=an("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])}),r=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});return r.appendChild(n),r}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}});class xi extends Ii{createEl(e,t={},n={}){const r=an("button",t=Object.assign({className:this.buildCSSClass()},t),n=Object.assign({type:"button"},n));return this.player_.options_.experimentalSvgIcons||r.appendChild(an("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}addChild(e,t={}){const n=this.constructor.name;return Et.warn(`Adding an actionable (user controllable) child to a Button (${n}) is not supported; use a ClickableComponent instead.`),Ar.prototype.addChild.call(this,e,t)}enable(){super.enable(),this.el_.removeAttribute("disabled")}disable(){super.disable(),this.el_.setAttribute("disabled","disabled")}handleKeyDown(e){l().isEventKey(e,"Space")||l().isEventKey(e,"Enter")?e.stopPropagation():super.handleKeyDown(e)}}Ar.registerComponent("Button",xi);class Li extends xi{constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon("play"),this.on("mousedown",(e=>this.handleMouseDown(e)))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(this.mouseused_&&"clientX"in e&&"clientY"in e)return Fr(t),void(this.player_.tech(!0)&&this.player_.tech(!0).focus());const n=this.player_.getChild("controlBar"),r=n&&n.getChild("playToggle");if(!r)return void this.player_.tech(!0).focus();const i=()=>r.focus();kr(t)?t.then(i,(()=>{})):this.setTimeout(i,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}Li.prototype.controlText_="Play Video",Ar.registerComponent("BigPlayButton",Li),Ar.registerComponent("CloseButton",class extends xi{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){l().isEventKey(e,"Esc")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}});class ki extends xi{constructor(e,t={}){super(e,t),t.replay=void 0===t.replay||t.replay,this.setIcon("play"),this.on(e,"play",(e=>this.handlePlay(e))),this.on(e,"pause",(e=>this.handlePause(e))),t.replay&&this.on(e,"ended",(e=>this.handleEnded(e)))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?Fr(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",(e=>this.handleSeeked(e)))}}ki.prototype.controlText_="Play",Ar.registerComponent("PlayToggle",ki);class Fi extends Ar{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],(e=>this.update(e))),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),n=an("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return t.appendChild(n),this.contentEl_=an("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){(this.player_.options_.enableSmoothSeeking||"seeking"!==e.type)&&this.updateContent(e)}updateTextNode_(e=0){e=Pr(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",(()=>{if(!this.contentEl_)return;let e=this.textNode_;e&&this.contentEl_.firstChild!==e&&(e=null,Et.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_=s().createTextNode(this.formattedTime_),this.textNode_&&(e?this.contentEl_.replaceChild(this.textNode_,e):this.contentEl_.appendChild(this.textNode_))})))}updateContent(e){}}Fi.prototype.labelText_="Time",Fi.prototype.controlText_="Time",Ar.registerComponent("TimeDisplay",Fi);class Ui extends Fi{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;t=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}Ui.prototype.labelText_="Current Time",Ui.prototype.controlText_="Current Time",Ar.registerComponent("CurrentTimeDisplay",Ui);class Bi extends Fi{constructor(e,t){super(e,t);const n=e=>this.updateContent(e);this.on(e,"durationchange",n),this.on(e,"loadstart",n),this.on(e,"loadedmetadata",n)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}Bi.prototype.labelText_="Duration",Bi.prototype.controlText_="Duration",Ar.registerComponent("DurationDisplay",Bi),Ar.registerComponent("TimeDivider",class extends Ar{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),n=super.createEl("span",{textContent:"/"});return t.appendChild(n),e.appendChild(t),e}});class ji extends Fi{constructor(e,t){super(e,t),this.on(e,"durationchange",(e=>this.updateContent(e)))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return!1!==this.options_.displayNegative&&e.insertBefore(an("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if("number"!=typeof this.player_.duration())return;let t;t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t)}}ji.prototype.labelText_="Remaining Time",ji.prototype.controlText_="Remaining Time",Ar.registerComponent("RemainingTimeDisplay",ji),Ar.registerComponent("LiveDisplay",class extends Ar{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",(e=>this.updateShowing(e)))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=an("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(an("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(s().createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}});class qi extends xi{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=e=>this.updateLiveEdgeStatus(e),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=an("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}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()}}function Hi(e,t,n){return e=Number(e),Math.min(n,Math.max(t,isNaN(e)?t:e))}qi.prototype.controlText_="Seek to live, currently playing live",Ar.registerComponent("SeekToLive",qi);var Gi=Object.freeze({__proto__:null,clamp:Hi});class Vi extends Ar{constructor(e,t){super(e,t),this.handleMouseDown_=e=>this.handleMouseDown(e),this.handleMouseUp_=e=>this.handleMouseUp(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.handleClick_=e=>this.handleClick(e),this.handleMouseMove_=e=>this.handleMouseMove(e),this.update_=e=>this.update(e),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},n={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),n=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},n),super.createEl(e,t,n)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||jt||e.preventDefault(),yn(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;vn(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",(()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(100*e).toFixed(2)+"%"}))),e}getProgress(){return Number(Hi(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=En(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){l().isEventKey(e,"Left")||l().isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepBack()):l().isEventKey(e,"Right")||l().isEventKey(e,"Up")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}Ar.registerComponent("Slider",Vi);const Yi=(e,t)=>Hi(e/t*100,0,100).toFixed(2)+"%";Ar.registerComponent("LoadProgressBar",class extends Ar{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",(e=>this.update(e)))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=an("span",{className:"vjs-control-text"}),n=an("span",{textContent:this.localize("Loaded")}),r=s().createTextNode(": ");return this.percentageEl_=an("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(n),t.appendChild(r),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",(()=>{const e=this.player_.liveTracker,t=this.player_.buffered(),n=e&&e.isLive()?e.seekableEnd():this.player_.duration(),r=this.player_.bufferedEnd(),i=this.partEls_,a=Yi(r,n);this.percent_!==a&&(this.el_.style.width=a,sn(this.percentageEl_,a),this.percent_=a);for(let e=0;e<t.length;e++){const n=t.start(e),a=t.end(e);let s=i[e];s||(s=this.el_.appendChild(an()),i[e]=s),s.dataset.start===n&&s.dataset.end===a||(s.dataset.start=n,s.dataset.end=a,s.style.left=Yi(n,r),s.style.width=Yi(a-n,r))}for(let e=i.length;e>t.length;e--)this.el_.removeChild(i[e-1]);i.length=t.length}))}}),Ar.registerComponent("TimeTooltip",class extends Ar{constructor(e,t){super(e,t),this.update=rr(nr(this,this.update),tr)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,n){const r=Tn(this.el_),i=_n(this.player_.el()),a=e.width*t;if(!i||!r)return;const s=e.left-i.left+a,o=e.width-a+(i.right-e.right);let l=r.width/2;s<l?l+=l-s:o<l&&(l=o),l<0?l=0:l>r.width&&(l=r.width),l=Math.round(l),this.el_.style.right=`-${l}px`,this.write(n)}write(e){sn(this.el_,e)}updateTime(e,t,n,r){this.requestNamedAnimationFrame("TimeTooltip#updateTime",(()=>{let i;const a=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const e=this.player_.liveTracker.liveWindow(),n=e-t*e;i=(n<1?"":"-")+Pr(n,e)}else i=Pr(n,a);this.update(e,t,i),r&&r()}))}});class Zi extends Ar{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=rr(nr(this,this.update),tr)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){const n=this.getChild("timeTooltip");if(!n)return;const r=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();n.updateTime(e,t,r)}}Zi.prototype.options_={children:[]},Xt||kt||Zi.prototype.options_.children.push("timeTooltip"),Ar.registerComponent("PlayProgressBar",Zi);class Ki extends Ar{constructor(e,t){super(e,t),this.update=rr(nr(this,this.update),tr)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const n=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,n,(()=>{this.el_.style.left=e.width*t+"px"}))}}Ki.prototype.options_={children:["timeTooltip"]},Ar.registerComponent("MouseTimeDisplay",Ki);class zi extends Vi{constructor(e,t){super(e,t),this.setEventHandlers_()}setEventHandlers_(){this.update_=nr(this,this.update),this.update=rr(this.update_,tr),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in s()&&"visibilityState"in s()&&this.on(s(),"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){"hidden"===s().visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,tr))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.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(e){if("hidden"===s().visibilityState)return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",(()=>{const e=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),n=this.player_.liveTracker;let r=this.player_.duration();n&&n.isLive()&&(r=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.percent_=t),this.currentTime_===e&&this.duration_===r||(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[Pr(e,r),Pr(r,r)],"{1} of {2}")),this.currentTime_=e,this.duration_=r),this.bar&&this.bar.update(_n(this.el()),this.getProgress())})),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){const e=this.getCurrentTime_();let t;const n=this.player_.liveTracker;return n&&n.isLive()?(t=(e-n.seekableStart())/n.liveWindow(),n.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){Cn(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!Cn(e)||isNaN(this.player_.duration()))return;let n;t||this.player_.scrubbing()||this.player_.scrubbing(!0);const r=this.calculateDistance(e),i=this.player_.liveTracker;if(i&&i.isLive()){if(r>=.99)return void i.seekToLiveEdge();const e=i.seekableStart(),t=i.liveCurrentTime();if(n=e+r*i.liveWindow(),n>=t&&(n=t),n<=e&&(n=e+.1),n===1/0)return}else n=r*this.player_.duration(),n===this.player_.duration()&&(n-=.1);this.userSeek_(n),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?Fr(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+5)}stepBack(){this.userSeek_(this.player_.currentTime()-5)}handleAction(e){this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(l().isEventKey(e,"Space")||l().isEventKey(e,"Enter"))e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(l().isEventKey(e,"Home"))e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(l().isEventKey(e,"End"))e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(l()(e))){e.preventDefault(),e.stopPropagation();const n=10*(l().codes[l()(e)]-l().codes[0])/100;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*n):this.userSeek_(this.player_.duration()*n)}else l().isEventKey(e,"PgDn")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):l().isEventKey(e,"PgUp")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):super.handleKeyDown(e)}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 s()&&"visibilityState"in s()&&this.off(s(),"visibilitychange",this.toggleVisibility_),super.dispose()}}zi.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},Xt||kt||zi.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),Ar.registerComponent("SeekBar",zi);class Wi extends Ar{constructor(e,t){super(e,t),this.handleMouseMove=rr(nr(this,this.handleMouseMove),tr),this.throttledHandleMouseSeek=rr(nr(this,this.handleMouseSeek),tr),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.handleMouseDownHandler_=e=>this.handleMouseDown(e),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const n=t.getChild("playProgressBar"),r=t.getChild("mouseTimeDisplay");if(!n&&!r)return;const i=t.el(),a=Tn(i);let s=En(i,e).x;s=Hi(s,0,1),r&&r.update(a,s),n&&n.update(a,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach((e=>e.disable&&e.disable())),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&Fr(this.player_.play())}}enable(){this.children().forEach((e=>e.enable&&e.enable())),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument,n=this.getChild("seekBar");n&&n.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}Wi.prototype.options_={children:["seekBar"]},Ar.registerComponent("ProgressControl",Wi);class Xi extends xi{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],(e=>this.handlePictureInPictureChange(e))),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],(e=>this.handlePictureInPictureEnabledChange(e))),this.on(e,["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(){s().pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in i()?this.enable():this.disable()}handlePictureInPictureChange(e){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(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){"function"==typeof s().exitPictureInPicture&&super.show()}}Xi.prototype.controlText_="Picture-in-Picture",Ar.registerComponent("PictureInPictureToggle",Xi);class $i extends xi{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",(e=>this.handleFullscreenChange(e))),!1===s()[e.fsApi_.fullscreenEnabled]&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}$i.prototype.controlText_="Fullscreen",Ar.registerComponent("FullscreenToggle",$i),Ar.registerComponent("VolumeLevel",class extends Ar{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}),Ar.registerComponent("VolumeLevelTooltip",class extends Ar{constructor(e,t){super(e,t),this.update=rr(nr(this,this.update),tr)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,n,r){if(!n){const n=_n(this.el_),r=_n(this.player_.el()),i=e.width*t;if(!r||!n)return;const a=e.left-r.left+i,s=e.width-i+(r.right-e.right);let o=n.width/2;a<o?o+=o-a:s<o&&(o=s),o<0?o=0:o>n.width&&(o=n.width),this.el_.style.right=`-${o}px`}this.write(`${r}%`)}write(e){sn(this.el_,e)}updateVolume(e,t,n,r,i){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",(()=>{this.update(e,t,n,r.toFixed(0)),i&&i()}))}});class Qi extends Ar{constructor(e,t){super(e,t),this.update=rr(nr(this,this.update),tr)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,n){const r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,n,r,(()=>{n?this.el_.style.bottom=e.height*t+"px":this.el_.style.left=e.width*t+"px"}))}}Qi.prototype.options_={children:["volumeLevelTooltip"]},Ar.registerComponent("MouseVolumeLevelDisplay",Qi);class Ji extends Vi{constructor(e,t){super(e,t),this.on("slideractive",(e=>this.updateLastVolume_(e))),this.on(e,"volumechange",(e=>this.updateARIAAttributes(e))),e.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(e){Cn(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const n=this.el(),r=_n(n),i=this.vertical();let a=En(n,e);a=i?a.y:a.x,a=Hi(a,0,1),t.update(r,a,i)}Cn(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}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(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(100*this.player_.volume())}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",(()=>{0===this.player_.volume()&&this.player_.lastVolume_(e)}))}}Ji.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},Xt||kt||Ji.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),Ji.prototype.playerEvent="volumechange",Ar.registerComponent("VolumeBar",Ji);class ea extends Ar{constructor(e,t={}){t.vertical=t.vertical||!1,(void 0===t.volumeBar||Rt(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))}(this,e),this.throttledHandleMouseMove=rr(nr(this,this.handleMouseMove),tr),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.on("mousedown",(e=>this.handleMouseDown(e))),this.on("touchstart",(e=>this.handleMouseDown(e))),this.on("mousemove",(e=>this.handleMouseMove(e))),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 e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}ea.prototype.options_={children:["volumeBar"]},Ar.registerComponent("VolumeControl",ea);class ta extends xi{constructor(e,t){super(e,t),function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))}(this,e),this.on(e,["loadstart","volumechange"],(e=>this.update(e)))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),n=this.player_.lastVolume_();if(0===t){const e=n<.1?.1:n;this.player_.volume(e),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high"),Xt&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?(this.setIcon("volume-mute"),t=0):e<.33?(this.setIcon("volume-low"),t=1):e<.67&&(this.setIcon("volume-medium"),t=2),cn(this.el_,[0,1,2,3].reduce(((e,t)=>e+`${t?" ":""}vjs-vol-${t}`),"")),un(this.el_,`vjs-vol-${t}`)}updateControlText_(){const e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)}}ta.prototype.controlText_="Mute",Ar.registerComponent("MuteToggle",ta);class na extends Ar{constructor(e,t={}){void 0!==t.inline?t.inline=t.inline:t.inline=!0,(void 0===t.volumeControl||Rt(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=e=>this.handleKeyPress(e),this.on(e,["loadstart"],(e=>this.volumePanelState_(e))),this.on(this.muteToggle,"keyup",(e=>this.handleKeyPress(e))),this.on(this.volumeControl,"keyup",(e=>this.handleVolumeControlKeyUp(e))),this.on("keydown",(e=>this.handleKeyPress(e))),this.on("mouseover",(e=>this.handleMouseOver(e))),this.on("mouseout",(e=>this.handleMouseOut(e))),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 e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){l().isEventKey(e,"Esc")&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),Wn(s(),"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),Xn(s(),"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){l().isEventKey(e,"Esc")&&this.handleMouseOut()}}na.prototype.options_={children:["muteToggle","volumeControl"]},Ar.registerComponent("VolumePanel",na);class ra extends xi{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const t=this.player_.currentTime(),n=this.player_.liveTracker,r=n&&n.isLive()?n.seekableEnd():this.player_.duration();let i;i=t+this.skipTime<=r?t+this.skipTime:r,this.player_.currentTime(i)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}ra.prototype.controlText_="Skip Forward",Ar.registerComponent("SkipForward",ra);class ia extends xi{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime(),n=this.player_.liveTracker,r=n&&n.isLive()&&n.seekableStart();let i;i=r&&t-this.skipTime<=r?r:t>=this.skipTime?t-this.skipTime:0,this.player_.currentTime(i)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}ia.prototype.controlText_="Skip Backward",Ar.registerComponent("SkipBackward",ia);class aa extends Ar{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",(e=>this.handleKeyDown(e))),this.boundHandleBlur_=e=>this.handleBlur(e),this.boundHandleTapClick_=e=>this.handleTapClick(e)}addEventListenerForItem(e){e instanceof Ar&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof Ar&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){"string"==typeof e&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=an(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),Wn(t,"click",(function(e){e.preventDefault(),e.stopImmediatePropagation()})),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||s().activeElement;if(!this.children().some((e=>e.el()===t))){const e=this.menuButton_;e&&e.buttonPressed_&&t!==e.el().firstChild&&e.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const n=t.filter((t=>t.el()===e.target))[0];if(!n)return;"CaptionSettingsMenuItem"!==n.name()&&this.menuButton_.focus()}}handleKeyDown(e){l().isEventKey(e,"Left")||l().isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(l().isEventKey(e,"Right")||l().isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}Ar.registerComponent("Menu",aa);class sa extends Ar{constructor(e,t={}){super(e,t),this.menuButton_=new xi(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const n=xi.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+n,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const r=e=>this.handleClick(e);this.handleMenuKeyUp_=e=>this.handleMenuKeyUp(e),this.on(this.menuButton_,"tap",r),this.on(this.menuButton_,"click",r),this.on(this.menuButton_,"keydown",(e=>this.handleKeyDown(e))),this.on(this.menuButton_,"mouseenter",(()=>{this.addClass("vjs-hover"),this.menu.show(),Wn(s(),"keyup",this.handleMenuKeyUp_)})),this.on("mouseleave",(e=>this.handleMouseLeave(e))),this.on("keydown",(e=>this.handleSubmenuKeyDown(e)))}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new aa(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=an("li",{className:"vjs-menu-title",textContent:Er(this.options_.title),tabIndex:-1}),n=new Ar(this.player_,{el:t});e.addItem(n)}if(this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}createItems(){}createEl(){return super.createEl("div",{className:this.buildWrapperCSSClass()},{})}setIcon(e){super.setIcon(e,this.menuButton_.el_)}buildWrapperCSSClass(){let e="vjs-menu-button";return!0===this.options_.inline?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${xi.prototype.buildCSSClass()} ${super.buildCSSClass()}`}buildCSSClass(){let e="vjs-menu-button";return!0===this.options_.inline?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${super.buildCSSClass()}`}controlText(e,t=this.menuButton_.el()){return this.menuButton_.controlText(e,t)}dispose(){this.handleMouseLeave(),super.dispose()}handleClick(e){this.buttonPressed_?this.unpressButton():this.pressButton()}handleMouseLeave(e){this.removeClass("vjs-hover"),Xn(s(),"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(e){l().isEventKey(e,"Esc")||l().isEventKey(e,"Tab")?(this.buttonPressed_&&this.unpressButton(),l().isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus())):(l().isEventKey(e,"Up")||l().isEventKey(e,"Down"))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))}handleMenuKeyUp(e){(l().isEventKey(e,"Esc")||l().isEventKey(e,"Tab"))&&this.removeClass("vjs-hover")}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e)}handleSubmenuKeyDown(e){(l().isEventKey(e,"Esc")||l().isEventKey(e,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),l().isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus()))}pressButton(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),Xt&&nn())return;this.menu.focus()}}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))}disable(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()}enable(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()}}Ar.registerComponent("MenuButton",sa);class oa extends sa{constructor(e,t){const n=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),!n)return;const r=nr(this,this.update);n.addEventListener("removetrack",r),n.addEventListener("addtrack",r),n.addEventListener("labelchange",r),this.player_.on("ready",r),this.player_.on("dispose",(function(){n.removeEventListener("removetrack",r),n.removeEventListener("addtrack",r),n.removeEventListener("labelchange",r)}))}}Ar.registerComponent("TrackButton",oa);const la=["Tab","Esc","Up","Down","Right","Left"];class ua extends Ii{constructor(e,t){super(e,t),this.selectable=t.selectable,this.isSelected_=t.selected||!1,this.multiSelectable=t.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(e,t,n){this.nonIconControl=!0;const r=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),n),i=an("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?r.appendChild(i):r.replaceChild(i,r.querySelector(".vjs-icon-placeholder")),r}handleKeyDown(e){la.some((t=>l().isEventKey(e,t)))||super.handleKeyDown(e)}handleClick(e){this.selected(!0)}selected(e){this.selectable&&(e?(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))}}Ar.registerComponent("MenuItem",ua);class ca extends ua{constructor(e,t){const n=t.track,r=e.textTracks();t.label=n.label||n.language||"Unknown",t.selected="showing"===n.mode,super(e,t),this.track=n,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);const a=(...e)=>{this.handleTracksChange.apply(this,e)},o=(...e)=>{this.handleSelectedLanguageChange.apply(this,e)};if(e.on(["loadstart","texttrackchange"],a),r.addEventListener("change",a),r.addEventListener("selectedlanguagechange",o),this.on("dispose",(function(){e.off(["loadstart","texttrackchange"],a),r.removeEventListener("change",a),r.removeEventListener("selectedlanguagechange",o)})),void 0===r.onchange){let e;this.on(["tap","click"],(function(){if("object"!=typeof i().Event)try{e=new(i().Event)("change")}catch(e){}e||(e=s().createEvent("Event"),e.initEvent("change",!0,!0)),r.dispatchEvent(e)}))}this.handleTracksChange()}handleClick(e){const t=this.track,n=this.player_.textTracks();if(super.handleClick(e),n)for(let e=0;e<n.length;e++){const r=n[e];-1!==this.kinds.indexOf(r.kind)&&(r===t?"showing"!==r.mode&&(r.mode="showing"):"disabled"!==r.mode&&(r.mode="disabled"))}}handleTracksChange(e){const t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)}handleSelectedLanguageChange(e){if("showing"===this.track.mode){const e=this.player_.cache_.selectedLanguage;if(e&&e.enabled&&e.language===this.track.language&&e.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}}dispose(){this.track=null,super.dispose()}}Ar.registerComponent("TextTrackMenuItem",ca);class da extends ca{constructor(e,t){t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:"disabled"},t.kinds||(t.kinds=[t.kind]),t.label?t.track.label=t.label:t.track.label=t.kinds.join(" and ")+" off",t.selectable=!0,t.multiSelectable=!1,super(e,t)}handleTracksChange(e){const t=this.player().textTracks();let n=!0;for(let e=0,r=t.length;e<r;e++){const r=t[e];if(this.options_.kinds.indexOf(r.kind)>-1&&"showing"===r.mode){n=!1;break}}n!==this.isSelected_&&this.selected(n)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let n=!0;for(let e=0,r=t.length;e<r;e++){const r=t[e];if(["captions","descriptions","subtitles"].indexOf(r.kind)>-1&&"showing"===r.mode){n=!1;break}}n&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}Ar.registerComponent("OffTextTrackMenuItem",da);class fa extends oa{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=ca){let n;this.label_&&(n=`${this.label_} off`),e.push(new da(this.player_,{kinds:this.kinds_,kind:this.kind_,label:n})),this.hideThreshold_+=1;const r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let n=0;n<r.length;n++){const i=r[n];if(this.kinds_.indexOf(i.kind)>-1){const n=new t(this.player_,{track:i,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});n.addClass(`vjs-${i.kind}-menu-item`),e.push(n)}}return e}}Ar.registerComponent("TextTrackButton",fa);class ha extends ua{constructor(e,t){const n=t.track,r=t.cue,i=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=r.text,t.selected=r.startTime<=i&&i<r.endTime,super(e,t),this.track=n,this.cue=r}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}}Ar.registerComponent("ChaptersTrackMenuItem",ha);class pa extends fa{constructor(e,t,n){super(e,t,n),this.setIcon("chapters"),this.selectCurrentItem_=()=>{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(e){if(e&&e.track&&"chapters"!==e.track.kind)return;const t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.kind===this.kind_)return n}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(Er(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let n=0,r=t.length;n<r;n++){const r=t[n],i=new ha(this.player_,{track:this.track_,cue:r});e.push(i)}return e}}pa.prototype.kind_="chapters",pa.prototype.controlText_="Chapters",Ar.registerComponent("ChaptersButton",pa);class ga extends fa{constructor(e,t,n){super(e,t,n),this.setIcon("audio-description");const r=e.textTracks(),i=nr(this,this.handleTracksChange);r.addEventListener("change",i),this.on("dispose",(function(){r.removeEventListener("change",i)}))}handleTracksChange(e){const t=this.player().textTracks();let n=!1;for(let e=0,r=t.length;e<r;e++){const r=t[e];if(r.kind!==this.kind_&&"showing"===r.mode){n=!0;break}}n?this.disable():this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}}ga.prototype.kind_="descriptions",ga.prototype.controlText_="Descriptions",Ar.registerComponent("DescriptionsButton",ga);class ma extends fa{constructor(e,t,n){super(e,t,n),this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}}ma.prototype.kind_="subtitles",ma.prototype.controlText_="Subtitles",Ar.registerComponent("SubtitlesButton",ma);class ya extends ca{constructor(e,t){t.track={player:e,kind:t.kind,label:t.kind+" settings",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="CaptionSettingsMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.controlText(", opens "+t.kind+" settings dialog")}handleClick(e){this.player().getChild("textTrackSettings").open()}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.kind+" settings"),super.handleLanguagechange()}}Ar.registerComponent("CaptionSettingsMenuItem",ya);class va extends fa{constructor(e,t,n){super(e,t,n),this.setIcon("captions")}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){const e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new ya(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}}va.prototype.kind_="captions",va.prototype.controlText_="Captions",Ar.registerComponent("CaptionsButton",va);class _a extends ca{createEl(e,t,n){const r=super.createEl(e,t,n),i=r.querySelector(".vjs-menu-item-text");return"captions"===this.options_.track.kind&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",r):i.appendChild(an("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),i.appendChild(an("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))),r}}Ar.registerComponent("SubsCapsMenuItem",_a);class Ta extends fa{constructor(e,t={}){super(e,t),this.label_="subtitles",this.setIcon("subtitles"),["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)>-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(Er(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new ya(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,_a),e}}Ta.prototype.kinds_=["captions","subtitles"],Ta.prototype.controlText_="Subtitles",Ar.registerComponent("SubsCapsButton",Ta);class Ea extends ua{constructor(e,t){const n=t.track,r=e.audioTracks();t.label=n.label||n.language||"Unknown",t.selected=n.enabled,super(e,t),this.track=n,this.addClass(`vjs-${n.kind}-menu-item`);const i=(...e)=>{this.handleTracksChange.apply(this,e)};r.addEventListener("change",i),this.on("dispose",(()=>{r.removeEventListener("change",i)}))}createEl(e,t,n){const r=super.createEl(e,t,n),i=r.querySelector(".vjs-menu-item-text");return["main-desc","description"].indexOf(this.options_.track.kind)>=0&&(i.appendChild(an("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),i.appendChild(an("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),r}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const e=this.player_.audioTracks();for(let t=0;t<e.length;t++){const n=e[t];n!==this.track&&(n.enabled=n===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}}Ar.registerComponent("AudioTrackMenuItem",Ea);class ba extends oa{constructor(e,t={}){t.tracks=e.audioTracks(),super(e,t),this.setIcon("audio")}buildCSSClass(){return`vjs-audio-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-audio-button ${super.buildWrapperCSSClass()}`}createItems(e=[]){this.hideThreshold_=1;const t=this.player_.audioTracks();for(let n=0;n<t.length;n++){const r=t[n];e.push(new Ea(this.player_,{track:r,selectable:!0,multiSelectable:!1}))}return e}}ba.prototype.controlText_="Audio Track",Ar.registerComponent("AudioTrackButton",ba);class Sa extends ua{constructor(e,t){const n=t.rate,r=parseFloat(n,10);t.label=n,t.selected=r===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=n,this.rate=r,this.on(e,"ratechange",(e=>this.update(e)))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}Sa.prototype.contentElType="button",Ar.registerComponent("PlaybackRateMenuItem",Sa);class Aa extends sa{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",(e=>this.updateVisibility(e))),this.on(e,"ratechange",(e=>this.updateLabel(e))),this.on(e,"playbackrateschange",(e=>this.handlePlaybackRateschange(e)))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=an("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),t=[];for(let n=e.length-1;n>=0;n--)t.push(new Sa(this.player(),{rate:e[n]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}Aa.prototype.controlText_="Playback Rate",Ar.registerComponent("PlaybackRateMenuButton",Aa);class wa extends Ar{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},n={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,n)}}Ar.registerComponent("Spacer",wa),Ar.registerComponent("CustomControlSpacer",class extends wa{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}});class Ia extends Ar{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}Ia.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]},Ar.registerComponent("ControlBar",Ia);class Ca extends jr{constructor(e,t){super(e,t),this.on(e,"error",(e=>{this.close(),this.open(e)}))}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}Ca.prototype.options_=Object.assign({},jr.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),Ar.registerComponent("ErrorDisplay",Ca);const Ra="vjs-text-track-settings",Da=["#000","Black"],Na=["#00F","Blue"],Oa=["#0FF","Cyan"],Pa=["#0F0","Green"],Ma=["#F0F","Magenta"],xa=["#F00","Red"],La=["#FFF","White"],ka=["#FF0","Yellow"],Fa=["1","Opaque"],Ua=["0.5","Semi-Transparent"],Ba=["0","Transparent"],ja={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Da,La,xa,Pa,Na,ka,Ma,Oa]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[Fa,Ua,Ba]},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[La,Da,xa,Pa,Na,ka,Ma,Oa]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:e=>"1.00"===e?null:Number(e)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[Fa,Ua]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[Ba,Ua,Fa]}};function qa(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}ja.windowColor.options=ja.backgroundColor.options,Ar.registerComponent("TextTrackSettings",class extends jr{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.endDialog=an("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),void 0===t.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()})),wt(ja,(e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})),this.options_.persistTextTrackSettings&&this.restoreSettings()}dispose(){this.endDialog=null,super.dispose()}createElSelect_(e,t="",n="label"){const r=ja[e],i=r.id.replace("%s",this.id_),a=[t,i].join(" ").trim();return[`<${n} id="${i}" class="${"label"===n?"vjs-label":""}">`,this.localize(r.label),`</${n}>`,`<select aria-labelledby="${a}">`].concat(r.options.map((e=>{const t=i+"-"+e[1].replace(/\W+/g,"");return[`<option id="${t}" value="${e[0]}" `,`aria-labelledby="${a} ${t}">`,this.localize(e[1]),"</option>"].join("")}))).concat("</select>").join("")}createElFgColor_(){const e=`captions-text-legend-${this.id_}`;return['<fieldset class="vjs-fg vjs-track-setting">',`<legend id="${e}">`,this.localize("Text"),"</legend>",'<span class="vjs-text-color">',this.createElSelect_("color",e),"</span>",'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",e),"</span>","</fieldset>"].join("")}createElBgColor_(){const e=`captions-background-${this.id_}`;return['<fieldset class="vjs-bg vjs-track-setting">',`<legend id="${e}">`,this.localize("Text Background"),"</legend>",'<span class="vjs-bg-color">',this.createElSelect_("backgroundColor",e),"</span>",'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",e),"</span>","</fieldset>"].join("")}createElWinColor_(){const e=`captions-window-${this.id_}`;return['<fieldset class="vjs-window vjs-track-setting">',`<legend id="${e}">`,this.localize("Caption Area Background"),"</legend>",'<span class="vjs-window-color">',this.createElSelect_("windowColor",e),"</span>",'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",e),"</span>","</fieldset>"].join("")}createElColors_(){return an("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})}createElFont_(){return an("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})}createElControls_(){const e=this.localize("restore all settings to the default values");return an("div",{className:"vjs-track-settings-controls",innerHTML:[`<button type="button" class="vjs-default-button" title="${e}">`,this.localize("Reset"),`<span class="vjs-control-text"> ${e}</span>`,"</button>",`<button type="button" class="vjs-done-button">${this.localize("Done")}</button>`].join("")})}content(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return It(ja,((e,t,n)=>{const r=(i=this.$(t.selector),a=t.parser,qa(i.options[i.options.selectedIndex].value,a));var i,a;return void 0!==r&&(e[n]=r),e}),{})}setValues(e){wt(ja,((t,n)=>{!function(e,t,n){if(t)for(let r=0;r<e.options.length;r++)if(qa(e.options[r].value,n)===t){e.selectedIndex=r;break}}(this.$(t.selector),e[n],t.parser)}))}setDefaults(){wt(ja,(e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t}))}restoreSettings(){let e;try{e=JSON.parse(i().localStorage.getItem(Ra))}catch(e){Et.warn(e)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?i().localStorage.setItem(Ra,JSON.stringify(e)):i().localStorage.removeItem(Ra)}catch(e){Et.warn(e)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}conditionalBlur_(){this.previouslyActiveEl_=null;const e=this.player_.controlBar,t=e&&e.subsCapsButton,n=e&&e.captionsButton;t?t.focus():n&&n.focus()}handleLanguagechange(){this.fill()}}),Ar.registerComponent("ResizeManager",class extends Ar{constructor(e,t){let n=t.ResizeObserver||i().ResizeObserver;null===t.ResizeObserver&&(n=!1),super(e,Dt({createEl:!n,reportTouchActivity:!1},t)),this.ResizeObserver=t.ResizeObserver||i().ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=ir((()=>{this.resizeHandler()}),100,!1,this),n?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const e=this.debouncedHandler_;let t=this.unloadListener_=function(){Xn(this,"resize",e),Xn(this,"unload",t),t=null};Wn(this.el_.contentWindow,"unload",t),Wn(this.el_.contentWindow,"resize",e)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}});const Ha={trackingThreshold:20,liveTolerance:15};Ar.registerComponent("LiveTracker",class extends Ar{constructor(e,t){super(e,Dt(Ha,t,{createEl:!1})),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=e=>this.handlePlay(e),this.handleFirstTimeupdate_=e=>this.handleFirstTimeupdate(e),this.handleSeeked_=e=>this.handleSeeked(e),this.seekToLiveEdge_=e=>this.seekToLiveEdge(e),this.reset_(),this.on(this.player_,"durationchange",(e=>this.handleDurationchange(e))),this.on(this.player_,"canplay",(()=>this.toggleTracking()))}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(i().performance.now().toFixed(4)),n=-1===this.lastTime_?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+n;const r=this.liveCurrentTime(),a=this.player_.currentTime();let s=this.player_.paused()||this.seekedBehindLive_||Math.abs(r-a)>this.options_.liveTolerance;this.timeupdateSeen_&&r!==1/0||(s=!1),s!==this.behindLiveEdge_&&(this.behindLiveEdge_=s,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,tr),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),t=[];let n=e?e.length:0;for(;n--;)t.push(e.end(n));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let n=e?e.length:0;for(;n--;)t.push(e.start(n));return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return-1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return"number"==typeof this.trackingInterval_}seekToLiveEdge(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}),Ar.registerComponent("TitleBar",class extends Ar{constructor(e,t){super(e,t),this.on("statechanged",(e=>this.updateDom_())),this.updateDom_()}createEl(){return this.els={title:an("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${Gn()}`}),description:an("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${Gn()}`})},an("div",{className:"vjs-title-bar"},{},Nt(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,n={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach((e=>{const r=this.state[e],i=this.els[e],a=n[e];Sn(i),r&&sn(i,r),t&&(t.removeAttribute(a),r&&t.setAttribute(a,i.id))})),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}});const Ga=e=>{const t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;const n=e.$$("source"),r=[];let i="";if(!n.length)return!1;for(let e=0;e<n.length;e++){const t=n[e].src;t&&-1===r.indexOf(t)&&r.push(t)}return!!r.length&&(1===r.length&&(i=r[0]),e.triggerSourceset(i),!0)},Va=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(e){const t=s().createElement(this.nodeName.toLowerCase());t.innerHTML=e;const n=s().createDocumentFragment();for(;t.childNodes.length;)n.appendChild(t.childNodes[0]);return this.innerText="",i().Element.prototype.appendChild.call(this,n),this.innerHTML}}),Ya=(e,t)=>{let n={};for(let r=0;r<e.length&&(n=Object.getOwnPropertyDescriptor(e[r],t),!(n&&n.set&&n.get));r++);return n.enumerable=!0,n.configurable=!0,n},Za=function(e){const t=e.el();if(t.resetSourceWatch_)return;const n={},r=(e=>Ya([e.el(),i().HTMLMediaElement.prototype,i().Element.prototype,Va],"innerHTML"))(e),a=n=>(...r)=>{const i=n.apply(t,r);return Ga(e),i};["append","appendChild","insertAdjacentHTML"].forEach((e=>{t[e]&&(n[e]=t[e],t[e]=a(n[e]))})),Object.defineProperty(t,"innerHTML",Dt(r,{set:a(r.set)})),t.resetSourceWatch_=()=>{t.resetSourceWatch_=null,Object.keys(n).forEach((e=>{t[e]=n[e]})),Object.defineProperty(t,"innerHTML",r)},e.one("sourceset",t.resetSourceWatch_)},Ka=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?Qr(i().Element.prototype.getAttribute.call(this,"src")):""},set(e){return i().Element.prototype.setAttribute.call(this,"src",e),e}});class za extends di{constructor(e,t){super(e,t);const n=e.source;let r=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&"VIDEO"===this.el_.tagName,n&&(this.el_.currentSrc!==n.src||e.tag&&3===e.tag.initNetworkState_)?this.setSource(n):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const e=this.el_.childNodes;let t=e.length;const n=[];for(;t--;){const i=e[t];"track"===i.nodeName.toLowerCase()&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(i),this.remoteTextTracks().addTrack(i.track),this.textTracks().addTrack(i.track),r||this.el_.hasAttribute("crossorigin")||!ei(i.src)||(r=!0)):n.push(i))}for(let e=0;e<n.length;e++)this.el_.removeChild(n[e])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&r&&Et.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading."),this.restoreMetadataTracksInIOSNativePlayer_(),(zt||Kt)&&!0===e.nativeControlsForTouch&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),za.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){!function(e){if(!e.featuresSourceset)return;const t=e.el();if(t.resetSourceset_)return;const n=(e=>Ya([e.el(),i().HTMLMediaElement.prototype,Ka],"src"))(e),r=t.setAttribute,a=t.load;Object.defineProperty(t,"src",Dt(n,{set:r=>{const i=n.set.call(t,r);return e.triggerSourceset(t.src),i}})),t.setAttribute=(n,i)=>{const a=r.call(t,n,i);return/src/i.test(n)&&e.triggerSourceset(t.src),a},t.load=()=>{const n=a.call(t);return Ga(e)||(e.triggerSourceset(""),Za(e)),n},t.currentSrc?e.triggerSourceset(t.currentSrc):Ga(e)||Za(e),t.resetSourceset_=()=>{t.resetSourceset_=null,t.load=a,t.setAttribute=r,Object.defineProperty(t,"src",n),t.resetSourceWatch_&&t.resetSourceWatch_()}}(this)}restoreMetadataTracksInIOSNativePlayer_(){const e=this.textTracks();let t;const n=()=>{t=[];for(let n=0;n<e.length;n++){const r=e[n];"metadata"===r.kind&&t.push({track:r,storedMode:r.mode})}};n(),e.addEventListener("change",n),this.on("dispose",(()=>e.removeEventListener("change",n)));const r=()=>{for(let e=0;e<t.length;e++){const n=t[e];"disabled"===n.track.mode&&n.track.mode!==n.storedMode&&(n.track.mode=n.storedMode)}e.removeEventListener("change",r)};this.on("webkitbeginfullscreen",(()=>{e.removeEventListener("change",n),e.removeEventListener("change",r),e.addEventListener("change",r)})),this.on("webkitendfullscreen",(()=>{e.removeEventListener("change",n),e.addEventListener("change",n),e.removeEventListener("change",r)}))}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const n=e.toLowerCase();this[`${n}TracksListeners_`]&&Object.keys(this[`${n}TracksListeners_`]).forEach((e=>{this.el()[`${n}Tracks`].removeEventListener(e,this[`${n}TracksListeners_`][e])})),this[`featuresNative${e}Tracks`]=!t,this[`${n}TracksListeners_`]=null,this.proxyNativeTracksForType_(n)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=li[e],n=this.el()[t.getterName],r=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!n||!n.addEventListener)return;const i={change:t=>{const n={type:"change",target:r,currentTarget:r,srcElement:r};r.trigger(n),"text"===e&&this[ui.remoteText.getterName]().trigger(n)},addtrack(e){r.addTrack(e.track)},removetrack(e){r.removeTrack(e.track)}},a=function(){const e=[];for(let t=0;t<r.length;t++){let i=!1;for(let e=0;e<n.length;e++)if(n[e]===r[t]){i=!0;break}i||e.push(r[t])}for(;e.length;)r.removeTrack(e.shift())};this[t.getterName+"Listeners_"]=i,Object.keys(i).forEach((e=>{const t=i[e];n.addEventListener(e,t),this.on("dispose",(r=>n.removeEventListener(e,t)))})),this.on("loadstart",a),this.on("dispose",(e=>this.off("loadstart",a)))}proxyNativeTracks_(){li.names.forEach((e=>{this.proxyNativeTracksForType_(e)}))}createEl(){let e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){const t=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(t,e),za.disposeMediaElement(e),e=t}else{e=s().createElement("video");const t=Dt({},this.options_.tag&&hn(this.options_.tag));zt&&!0===this.options_.nativeControlsForTouch||delete t.controls,fn(e,Object.assign(t,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}void 0!==this.options_.preload&&gn(e,"preload",this.options_.preload),void 0!==this.options_.disablePictureInPicture&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let n=0;n<t.length;n++){const r=t[n],i=this.options_[r];void 0!==i&&(i?gn(e,r,r):mn(e,r),e[r]=i)}return e}handleLateInit_(e){if(0===e.networkState||3===e.networkState)return;if(0===e.readyState){let e=!1;const t=function(){e=!0};this.on("loadstart",t);const n=function(){e||this.trigger("loadstart")};return this.on("loadedmetadata",n),void this.ready((function(){this.off("loadstart",t),this.off("loadedmetadata",n),e||this.trigger("loadstart")}))}const t=["loadstart"];t.push("loadedmetadata"),e.readyState>=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready((function(){t.forEach((function(e){this.trigger(e)}),this)}))}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&$t?this.el_.fastSeek(e):this.el_.currentTime=e}catch(e){Et(e,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&kt&&jt&&0===this.el_.currentTime){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",(()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)}))}supportsFullScreen(){return"function"==typeof this.el_.webkitEnterFullScreen}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)Fr(this.el_.play()),this.setTimeout((function(){e.pause();try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}}),0);else try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}}exitFullScreen(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(void 0===e)return this.el_.src;this.setSrc(e)}reset(){za.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,n):super.addTextTrack(e,t,n)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=s().createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){const n=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(n),n}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let n=t.length;for(;n--;)e!==t[n]&&e!==t[n].track||this.el().removeChild(t[n])}}getVideoPlaybackQuality(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();const e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),i().performance&&(e.creationTime=i().performance.now()),e}}Ot(za,"TEST_VID",(function(){if(!en())return;const e=s().createElement("video"),t=s().createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e})),za.isSupported=function(){try{za.TEST_VID.volume=.5}catch(e){return!1}return!(!za.TEST_VID||!za.TEST_VID.canPlayType)},za.canPlayType=function(e){return za.TEST_VID.canPlayType(e)},za.canPlaySource=function(e,t){return za.canPlayType(e.type)},za.canControlVolume=function(){try{const e=za.TEST_VID.volume;za.TEST_VID.volume=e/2+.1;const t=e!==za.TEST_VID.volume;return t&&Xt?(i().setTimeout((()=>{za&&za.prototype&&(za.prototype.featuresVolumeControl=e!==za.TEST_VID.volume)})),!1):t}catch(e){return!1}},za.canMuteVolume=function(){try{const e=za.TEST_VID.muted;return za.TEST_VID.muted=!e,za.TEST_VID.muted?gn(za.TEST_VID,"muted","muted"):mn(za.TEST_VID,"muted"),e!==za.TEST_VID.muted}catch(e){return!1}},za.canControlPlaybackRate=function(){if(kt&&jt&&Ht<58)return!1;try{const e=za.TEST_VID.playbackRate;return za.TEST_VID.playbackRate=e/2+.1,e!==za.TEST_VID.playbackRate}catch(e){return!1}},za.canOverrideAttributes=function(){try{const e=()=>{};Object.defineProperty(s().createElement("video"),"src",{get:e,set:e}),Object.defineProperty(s().createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(s().createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(s().createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return!1}return!0},za.supportsNativeTextTracks=function(){return $t||Xt&&jt},za.supportsNativeVideoTracks=function(){return!(!za.TEST_VID||!za.TEST_VID.videoTracks)},za.supportsNativeAudioTracks=function(){return!(!za.TEST_VID||!za.TEST_VID.audioTracks)},za.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach((function([e,t]){Ot(za.prototype,e,(()=>za[t]()),!0)})),za.prototype.featuresVolumeControl=za.canControlVolume(),za.prototype.movingMediaElementInDOM=!Xt,za.prototype.featuresFullscreenResize=!0,za.prototype.featuresProgressEvents=!0,za.prototype.featuresTimeupdateEvents=!0,za.prototype.featuresVideoFrameCallback=!(!za.TEST_VID||!za.TEST_VID.requestVideoFrameCallback),za.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},za.resetMediaElement=function(e){if(!e)return;const t=e.querySelectorAll("source");let n=t.length;for(;n--;)e.removeChild(t[n]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach((function(e){za.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}})),["muted","defaultMuted","autoplay","loop","playsinline"].forEach((function(e){za.prototype["set"+Er(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}})),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach((function(e){za.prototype[e]=function(){return this.el_[e]}})),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach((function(e){za.prototype["set"+Er(e)]=function(t){this.el_[e]=t}})),["pause","load","play"].forEach((function(e){za.prototype[e]=function(){return this.el_[e]()}})),di.withSourceHandlers(za),za.nativeSourceHandler={},za.nativeSourceHandler.canPlayType=function(e){try{return za.TEST_VID.canPlayType(e)}catch(e){return""}},za.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return za.nativeSourceHandler.canPlayType(e.type);if(e.src){const t=Jr(e.src);return za.nativeSourceHandler.canPlayType(`video/${t}`)}return""},za.nativeSourceHandler.handleSource=function(e,t,n){t.setSrc(e.src)},za.nativeSourceHandler.dispose=function(){},za.registerSourceHandler(za.nativeSourceHandler),di.registerTech("Html5",za);const Wa=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Xa={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},$a=["tiny","xsmall","small","medium","large","xlarge","huge"],Qa={};$a.forEach((e=>{const t="x"===e.charAt(0)?`x-${e.substring(1)}`:e;Qa[e]=`vjs-layout-${t}`}));const Ja={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class es extends Ar{constructor(e,t,n){if(e.id=e.id||t.id||`vjs_video_${Gn()}`,(t=Object.assign(es.getTagSettings(e),t)).initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const n=e.closest("[lang]");n&&(t.language=n.getAttribute("lang"))}if(super(null,t,n),this.boundDocumentFullscreenChange_=e=>this.documentFullscreenChange_(e),this.boundFullWindowOnEscKey_=e=>this.fullWindowOnEscKey(e),this.boundUpdateStyleEl_=e=>this.updateStyleEl_(e),this.boundApplyInitTime_=e=>this.applyInitTime_(e),this.boundUpdateCurrentBreakpoint_=e=>this.updateCurrentBreakpoint_(e),this.boundHandleTechClick_=e=>this.handleTechClick_(e),this.boundHandleTechDoubleClick_=e=>this.handleTechDoubleClick_(e),this.boundHandleTechTouchStart_=e=>this.handleTechTouchStart_(e),this.boundHandleTechTouchMove_=e=>this.handleTechTouchMove_(e),this.boundHandleTechTouchEnd_=e=>this.handleTechTouchEnd_(e),this.boundHandleTechTap_=e=>this.handleTechTap_(e),this.isFullscreen_=!1,this.log=bt(this.id_),this.fsApi_=mt,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&hn(e),this.language(this.options_.language),t.languages){const e={};Object.getOwnPropertyNames(t.languages).forEach((function(n){e[n.toLowerCase()]=t.languages[n]})),this.languages_=e}else this.languages_=es.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach((e=>{if("function"!=typeof this[e])throw new Error(`plugin "${e}" does not exist`)})),this.scrubbing_=!1,this.el_=this.createEl(),yr(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(Wn(s(),this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const r=Dt(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach((e=>{this[e](t.plugins[e])})),t.debug&&this.debug(!0),this.options_.playerOptions=r,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const e=(new(i().DOMParser)).parseFromString('<svg xmlns="http://www.w3.org/2000/svg">\n  <defs>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-play">\n      <path d="M16 10v28l22-14z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-pause">\n      <path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-audio">\n      <path d="M24 2C14.06 2 6 10.06 6 20v14c0 3.31 2.69 6 6 6h6V24h-8v-4c0-7.73 6.27-14 14-14s14 6.27 14 14v4h-8v16h6c3.31 0 6-2.69 6-6V20c0-9.94-8.06-18-18-18z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-captions">\n      <path d="M38 8H10c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM22 22h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2zm14 0h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-subtitles">\n      <path d="M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-enter">\n      <path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-exit">\n      <path d="M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-play-circle">\n      <path d="M20 33l12-9-12-9v18zm4-29C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-volume-mute">\n      <path d="M33 24c0-3.53-2.04-6.58-5-8.05v4.42l4.91 4.91c.06-.42.09-.85.09-1.28zm5 0c0 1.88-.41 3.65-1.08 5.28l3.03 3.03C41.25 29.82 42 27 42 24c0-8.56-5.99-15.72-14-17.54v4.13c5.78 1.72 10 7.07 10 13.41zM8.55 6L6 8.55 15.45 18H6v12h8l10 10V26.55l8.51 8.51c-1.34 1.03-2.85 1.86-4.51 2.36v4.13a17.94 17.94 0 0 0 7.37-3.62L39.45 42 42 39.45l-18-18L8.55 6zM24 8l-4.18 4.18L24 16.36V8z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-volume-low">\n      <path d="M14 18v12h8l10 10V8L22 18h-8z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-volume-medium">\n      <path d="M37 24c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zm-27-6v12h8l10 10V8L18 18h-8z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-volume-high">\n      <path d="M6 18v12h8l10 10V8L14 18H6zm27 6c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zM28 6.46v4.13c5.78 1.72 10 7.07 10 13.41s-4.22 11.69-10 13.41v4.13c8.01-1.82 14-8.97 14-17.54S36.01 8.28 28 6.46z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-spinner">\n      <path d="M18.8 21l9.53-16.51C26.94 4.18 25.49 4 24 4c-4.8 0-9.19 1.69-12.64 4.51l7.33 12.69.11-.2zm24.28-3c-1.84-5.85-6.3-10.52-11.99-12.68L23.77 18h19.31zm.52 2H28.62l.58 1 9.53 16.5C41.99 33.94 44 29.21 44 24c0-1.37-.14-2.71-.4-4zm-26.53 4l-7.8-13.5C6.01 14.06 4 18.79 4 24c0 1.37.14 2.71.4 4h14.98l-2.31-4zM4.92 30c1.84 5.85 6.3 10.52 11.99 12.68L24.23 30H4.92zm22.54 0l-7.8 13.51c1.4.31 2.85.49 4.34.49 4.8 0 9.19-1.69 12.64-4.51L29.31 26.8 27.46 30z"></path>\n    </symbol>\n    <symbol viewBox="0 0 24 24" id="vjs-icon-hd">\n      <path d="M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12H9.5v-2h-2v2H6V9h1.5v2.5h2V9H11v6zm2-6h4c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1h-4V9zm1.5 4.5h2v-3h-2v3z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-chapters">\n      <path d="M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"></path>\n    </symbol>\n    <symbol viewBox="0 0 40 40" id="vjs-icon-downloading">\n      <path d="M18.208 36.875q-3.208-.292-5.979-1.729-2.771-1.438-4.812-3.729-2.042-2.292-3.188-5.229-1.146-2.938-1.146-6.23 0-6.583 4.334-11.416 4.333-4.834 10.833-5.5v3.166q-5.167.75-8.583 4.646Q6.25 14.75 6.25 19.958q0 5.209 3.396 9.104 3.396 3.896 8.562 4.646zM20 28.417L11.542 20l2.083-2.083 4.917 4.916v-11.25h2.916v11.25l4.875-4.916L28.417 20zm1.792 8.458v-3.167q1.833-.25 3.541-.958 1.709-.708 3.167-1.875l2.333 2.292q-1.958 1.583-4.25 2.541-2.291.959-4.791 1.167zm6.791-27.792q-1.541-1.125-3.25-1.854-1.708-.729-3.541-1.021V3.042q2.5.25 4.77 1.208 2.271.958 4.271 2.5zm4.584 21.584l-2.25-2.25q1.166-1.5 1.854-3.209.687-1.708.937-3.541h3.209q-.292 2.5-1.229 4.791-.938 2.292-2.521 4.209zm.541-12.417q-.291-1.833-.958-3.562-.667-1.73-1.833-3.188l2.375-2.208q1.541 1.916 2.458 4.208.917 2.292 1.167 4.75z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-file-download">\n      <path d="M10.8 40.55q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h26.35v-7.7h3.4v7.7q0 1.4-1 2.4t-2.4 1zM24 32.1L13.9 22.05l2.45-2.45 5.95 5.95V7.15h3.4v18.4l5.95-5.95 2.45 2.45z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-done">\n      <path d="M9.8 40.5v-3.45h28.4v3.45zm9.2-9.05L7.4 19.85l2.45-2.35L19 26.65l19.2-19.2 2.4 2.4z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-off">\n      <path d="M4.9 4.75L43.25 43.1 41 45.3l-4.75-4.75q-.05.05-.075.025-.025-.025-.075-.025H10.8q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h22.05l-7-7-1.85 1.8L13.9 21.9l1.85-1.85L2.7 7zm26.75 14.7l2.45 2.45-3.75 3.8-2.45-2.5zM25.7 7.15V21.1l-3.4-3.45V7.15z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-share">\n      <path d="M36 32.17c-1.52 0-2.89.59-3.93 1.54L17.82 25.4c.11-.45.18-.92.18-1.4s-.07-.95-.18-1.4l14.1-8.23c1.07 1 2.5 1.62 4.08 1.62 3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6c0 .48.07.95.18 1.4l-14.1 8.23c-1.07-1-2.5-1.62-4.08-1.62-3.31 0-6 2.69-6 6s2.69 6 6 6c1.58 0 3.01-.62 4.08-1.62l14.25 8.31c-.1.42-.16.86-.16 1.31A5.83 5.83 0 1 0 36 32.17z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-cog">\n      <path d="M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97L29 4.84c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3a14.8 14.8 0 0 0-3.38 1.97L9.9 10.1a1 1 0 0 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31C9.06 22.69 9 23.34 9 24s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3a14.8 14.8 0 0 0 3.38-1.97l4.98 2.01a1 1 0 0 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zM24 31c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-square">\n      <path d="M36 8H12c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h24c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zm0 28H12V12h24v24z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-circle">\n      <circle cx="24" cy="24" r="20"></circle>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-circle-outline">\n      <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-circle-inner-circle">\n      <path d="M24 4C12.97 4 4 12.97 4 24s8.97 20 20 20 20-8.97 20-20S35.03 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16zm6-16c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6 6 2.69 6 6z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-cancel">\n      <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm10 27.17L31.17 34 24 26.83 16.83 34 14 31.17 21.17 24 14 16.83 16.83 14 24 21.17 31.17 14 34 16.83 26.83 24 34 31.17z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-replay">\n      <path d="M24 10V2L14 12l10 10v-8c6.63 0 12 5.37 12 12s-5.37 12-12 12-12-5.37-12-12H8c0 8.84 7.16 16 16 16s16-7.16 16-16-7.16-16-16-16z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-repeat">\n      <path d="M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"></path>\n    </symbol>\n    <symbol viewBox="0 96 48 48" id="vjs-icon-replay-5">\n      <path d="M17.689 98l-8.697 8.696 8.697 8.697 2.486-2.485-4.32-4.319h1.302c4.93 0 9.071 1.722 12.424 5.165 3.352 3.443 5.029 7.638 5.029 12.584h3.55c0-2.958-.553-5.73-1.658-8.313-1.104-2.583-2.622-4.841-4.555-6.774-1.932-1.932-4.19-3.45-6.773-4.555-2.584-1.104-5.355-1.657-8.313-1.657H15.5l4.615-4.615zm-8.08 21.659v13.861h11.357v5.008H9.609V143h12.7c.834 0 1.55-.298 2.146-.894.596-.597.895-1.31.895-2.145v-7.781c0-.835-.299-1.55-.895-2.147a2.929 2.929 0 0 0-2.147-.894h-8.227v-5.096H25.35v-4.384z"></path>\n    </symbol>\n    <symbol viewBox="0 96 48 48" id="vjs-icon-replay-10">\n      <path d="M42.315 125.63c0-4.997-1.694-9.235-5.08-12.713-3.388-3.479-7.571-5.218-12.552-5.218h-1.315l4.363 4.363-2.51 2.51-8.787-8.786L25.221 97l2.45 2.45-4.662 4.663h1.375c2.988 0 5.788.557 8.397 1.673 2.61 1.116 4.892 2.65 6.844 4.602 1.953 1.953 3.487 4.234 4.602 6.844 1.116 2.61 1.674 5.41 1.674 8.398zM8.183 142v-19.657H3.176V117.8h9.643V142zm13.63 0c-1.156 0-2.127-.393-2.912-1.178-.778-.778-1.168-1.746-1.168-2.902v-16.04c0-1.156.393-2.127 1.178-2.912.779-.779 1.746-1.168 2.902-1.168h7.696c1.156 0 2.126.392 2.911 1.177.779.78 1.168 1.747 1.168 2.903v16.04c0 1.156-.392 2.127-1.177 2.912-.779.779-1.746 1.168-2.902 1.168zm.556-4.636h6.583v-15.02H22.37z"></path>\n    </symbol>\n    <symbol viewBox="0 96 48 48" id="vjs-icon-replay-30">\n      <path d="M26.047 97l-8.733 8.732 8.733 8.733 2.496-2.494-4.336-4.338h1.307c4.95 0 9.108 1.73 12.474 5.187 3.367 3.458 5.051 7.668 5.051 12.635h3.565c0-2.97-.556-5.751-1.665-8.346-1.109-2.594-2.633-4.862-4.574-6.802-1.94-1.941-4.208-3.466-6.803-4.575-2.594-1.109-5.375-1.664-8.345-1.664H23.85l4.634-4.634zM2.555 117.531v4.688h10.297v5.25H5.873v4.687h6.979v5.156H2.555V142H13.36c1.061 0 1.95-.395 2.668-1.186.718-.79 1.076-1.772 1.076-2.94v-16.218c0-1.168-.358-2.149-1.076-2.94-.717-.79-1.607-1.185-2.668-1.185zm22.482.14c-1.149 0-2.11.39-2.885 1.165-.78.78-1.172 1.744-1.172 2.893v15.943c0 1.149.388 2.11 1.163 2.885.78.78 1.745 1.172 2.894 1.172h7.649c1.148 0 2.11-.388 2.884-1.163.78-.78 1.17-1.745 1.17-2.894v-15.943c0-1.15-.386-2.111-1.16-2.885-.78-.78-1.746-1.172-2.894-1.172zm.553 4.518h6.545v14.93H25.59z"></path>\n    </symbol>\n    <symbol viewBox="0 96 48 48" id="vjs-icon-forward-5">\n      <path d="M29.508 97l-2.431 2.43 4.625 4.625h-1.364c-2.965 0-5.742.554-8.332 1.66-2.589 1.107-4.851 2.629-6.788 4.566-1.937 1.937-3.458 4.2-4.565 6.788-1.107 2.59-1.66 5.367-1.66 8.331h3.557c0-4.957 1.68-9.16 5.04-12.611 3.36-3.45 7.51-5.177 12.451-5.177h1.304l-4.326 4.33 2.49 2.49 8.715-8.716zm-9.783 21.61v13.89h11.382v5.018H19.725V142h12.727a2.93 2.93 0 0 0 2.15-.896 2.93 2.93 0 0 0 .896-2.15v-7.798c0-.837-.299-1.554-.896-2.152a2.93 2.93 0 0 0-2.15-.896h-8.245V123h11.29v-4.392z"></path>\n    </symbol>\n    <symbol viewBox="0 96 48 48" id="vjs-icon-forward-10">\n      <path d="M23.119 97l-2.386 2.383 4.538 4.538h-1.339c-2.908 0-5.633.543-8.173 1.63-2.54 1.085-4.76 2.577-6.66 4.478-1.9 1.9-3.392 4.12-4.478 6.66-1.085 2.54-1.629 5.264-1.629 8.172h3.49c0-4.863 1.648-8.986 4.944-12.372 3.297-3.385 7.368-5.078 12.216-5.078h1.279l-4.245 4.247 2.443 2.442 8.55-8.55zm-9.52 21.45v4.42h4.871V142h4.513v-23.55zm18.136 0c-1.125 0-2.066.377-2.824 1.135-.764.764-1.148 1.709-1.148 2.834v15.612c0 1.124.38 2.066 1.139 2.824.764.764 1.708 1.145 2.833 1.145h7.489c1.125 0 2.066-.378 2.824-1.136.764-.764 1.145-1.709 1.145-2.833v-15.612c0-1.125-.378-2.067-1.136-2.825-.764-.764-1.708-1.145-2.833-1.145zm.54 4.42h6.408v14.617h-6.407z"></path>\n    </symbol>\n    <symbol viewBox="0 96 48 48" id="vjs-icon-forward-30">\n      <path d="M25.549 97l-2.437 2.434 4.634 4.635H26.38c-2.97 0-5.753.555-8.347 1.664-2.594 1.109-4.861 2.633-6.802 4.574-1.94 1.94-3.465 4.207-4.574 6.802-1.109 2.594-1.664 5.377-1.664 8.347h3.565c0-4.967 1.683-9.178 5.05-12.636 3.366-3.458 7.525-5.187 12.475-5.187h1.307l-4.335 4.338 2.495 2.494 8.732-8.732zm-11.553 20.53v4.689h10.297v5.249h-6.978v4.688h6.978v5.156H13.996V142h10.808c1.06 0 1.948-.395 2.666-1.186.718-.79 1.077-1.771 1.077-2.94v-16.217c0-1.169-.36-2.15-1.077-2.94-.718-.79-1.605-1.186-2.666-1.186zm21.174.168c-1.149 0-2.11.389-2.884 1.163-.78.78-1.172 1.745-1.172 2.894v15.942c0 1.15.388 2.11 1.162 2.885.78.78 1.745 1.17 2.894 1.17h7.649c1.149 0 2.11-.386 2.885-1.16.78-.78 1.17-1.746 1.17-2.895v-15.942c0-1.15-.387-2.11-1.161-2.885-.78-.78-1.745-1.172-2.894-1.172zm.552 4.516h6.542v14.931h-6.542z"></path>\n    </symbol>\n    <symbol viewBox="0 0 512 512" id="vjs-icon-audio-description">\n      <g fill-rule="evenodd"><path d="M227.29 381.351V162.993c50.38-1.017 89.108-3.028 117.631 17.126 27.374 19.342 48.734 56.965 44.89 105.325-4.067 51.155-41.335 94.139-89.776 98.475-24.085 2.155-71.972 0-71.972 0s-.84-1.352-.773-2.568m48.755-54.804c31.43 1.26 53.208-16.633 56.495-45.386 4.403-38.51-21.188-63.552-58.041-60.796v103.612c-.036 1.466.575 2.22 1.546 2.57"></path><path d="M383.78 381.328c13.336 3.71 17.387-11.06 23.215-21.408 12.722-22.571 22.294-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.226 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M425.154 381.328c13.336 3.71 17.384-11.061 23.215-21.408 12.721-22.571 22.291-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.511c-.586 3.874 2.226 7.315 3.866 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M466.26 381.328c13.337 3.71 17.385-11.061 23.216-21.408 12.722-22.571 22.292-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.225 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894M4.477 383.005H72.58l18.573-28.484 64.169-.135s.065 19.413.065 28.62h48.756V160.307h-58.816c-5.653 9.537-140.85 222.697-140.85 222.697zm152.667-145.282v71.158l-40.453-.27 40.453-70.888z"></path></g>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-next-item">\n      <path d="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-previous-item">\n      <path d="M12 12h4v24h-4zm7 12l17 12V12z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-shuffle">\n      <path d="M21.17 18.34L10.83 8 8 10.83l10.34 10.34 2.83-2.83zM29 8l4.09 4.09L8 37.17 10.83 40l25.09-25.09L40 19V8H29zm.66 18.83l-2.83 2.83 6.26 6.26L29 40h11V29l-4.09 4.09-6.25-6.26z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-cast">\n      <path d="M42 6H6c-2.21 0-4 1.79-4 4v6h4v-6h36v28H28v4h14c2.21 0 4-1.79 4-4V10c0-2.21-1.79-4-4-4zM2 36v6h6c0-3.31-2.69-6-6-6zm0-8v4c5.52 0 10 4.48 10 10h4c0-7.73-6.27-14-14-14zm0-8v4c9.94 0 18 8.06 18 18h4c0-12.15-9.85-22-22-22z"></path>\n    </symbol>\n    <symbol viewBox="0 0 48 48" id="vjs-icon-picture-in-picture-enter">\n      <path d="M38 22H22v11.99h16V22zm8 16V9.96C46 7.76 44.2 6 42 6H6C3.8 6 2 7.76 2 9.96V38c0 2.2 1.8 4 4 4h36c2.2 0 4-1.8 4-4zm-4 .04H6V9.94h36v28.1z"></path>\n    </symbol>\n    <symbol viewBox="0 0 22 18" id="vjs-icon-picture-in-picture-exit">\n      <path d="M18 4H4v10h14V4zm4 12V1.98C22 .88 21.1 0 20 0H2C.9 0 0 .88 0 1.98V16c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H2V1.97h18v14.05z"></path>\n      <path fill="none" d="M-1-3h24v24H-1z"></path>\n    </symbol>\n    <symbol viewBox="0 0 1792 1792" id="vjs-icon-facebook">\n      <path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"></path>\n    </symbol>\n    <symbol viewBox="0 0 1792 1792" id="vjs-icon-linkedin">\n      <path d="M477 625v991H147V625h330zm21-306q1 73-50.5 122T312 490h-2q-82 0-132-49t-50-122q0-74 51.5-122.5T314 148t133 48.5T498 319zm1166 729v568h-329v-530q0-105-40.5-164.5T1168 862q-63 0-105.5 34.5T999 982q-11 30-11 81v553H659q2-399 2-647t-1-296l-1-48h329v144h-2q20-32 41-56t56.5-52 87-43.5T1285 602q171 0 275 113.5t104 332.5z"></path>\n    </symbol>\n    <symbol viewBox="0 0 1792 1792" id="vjs-icon-twitter">\n      <path d="M1684 408q-67 98-162 167 1 14 1 42 0 130-38 259.5T1369.5 1125 1185 1335.5t-258 146-323 54.5q-271 0-496-145 35 4 78 4 225 0 401-138-105-2-188-64.5T285 1033q33 5 61 5 43 0 85-11-112-23-185.5-111.5T172 710v-4q68 38 146 41-66-44-105-115t-39-154q0-88 44-163 121 149 294.5 238.5T884 653q-8-38-8-74 0-134 94.5-228.5T1199 256q140 0 236 102 109-21 205-78-37 115-142 178 93-10 186-50z"></path>\n    </symbol>\n    <symbol viewBox="0 0 1792 1792" id="vjs-icon-tumblr">\n      <path d="M1328 1329l80 237q-23 35-111 66t-177 32q-104 2-190.5-26T787 1564t-95-106-55.5-120-16.5-118V676H452V461q72-26 129-69.5t91-90 58-102 34-99T779 12q1-5 4.5-8.5T791 0h244v424h333v252h-334v518q0 30 6.5 56t22.5 52.5 49.5 41.5 81.5 14q78-2 134-29z"></path>\n    </symbol>\n    <symbol viewBox="0 0 1792 1792" id="vjs-icon-pinterest">\n      <path d="M1664 896q0 209-103 385.5T1281.5 1561 896 1664q-111 0-218-32 59-93 78-164 9-34 54-211 20 39 73 67.5t114 28.5q121 0 216-68.5t147-188.5 52-270q0-114-59.5-214T1180 449t-255-63q-105 0-196 29t-154.5 77-109 110.5-67 129.5T377 866q0 104 40 183t117 111q30 12 38-20 2-7 8-31t8-30q6-23-11-43-51-61-51-151 0-151 104.5-259.5T904 517q151 0 235.5 82t84.5 213q0 170-68.5 289T980 1220q-61 0-98-43.5T859 1072q8-35 26.5-93.5t30-103T927 800q0-50-27-83t-77-33q-62 0-105 57t-43 142q0 73 25 122l-99 418q-17 70-13 177-206-91-333-281T128 896q0-209 103-385.5T510.5 231 896 128t385.5 103T1561 510.5 1664 896z"></path>\n    </symbol>\n  </defs>\n</svg>',"image/svg+xml");if(e.querySelector("parsererror"))Et.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const t=e.documentElement;t.style.display="none",this.el_.appendChild(t),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio("audio"===e.nodeName.toLowerCase()),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),zt&&this.addClass("vjs-touch-enabled"),Xt||this.addClass("vjs-workinghover"),es.players[this.id_]=this;const a=ft.split(".")[0];this.addClass(`vjs-v${a}`),this.userActive(!0),this.reportUserActivity(),this.one("play",(e=>this.listenForUserActivity_(e))),this.on("keydown",(e=>this.handleKeyDown(e))),this.on("languagechange",(e=>this.handleLanguagechange(e))),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",(()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)}))}dispose(){this.trigger("dispose"),this.off("dispose"),Xn(s(),this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Xn(s(),"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),es.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),hi[this.id()]=null,ci.names.forEach((e=>{const t=this[ci[e].getterName]();t&&t.off&&t.off()})),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e,t=this.tag,n=this.playerElIngest_=t.parentNode&&t.parentNode.hasAttribute&&t.parentNode.hasAttribute("data-vjs-player");const r="video-js"===this.tag.tagName.toLowerCase();n?e=this.el_=t.parentNode:r||(e=this.el_=super.createEl("div"));const a=hn(t);if(r){for(e=this.el_=t,t=this.tag=s().createElement("video");e.children.length;)t.appendChild(e.firstChild);ln(e,"video-js")||un(e,"video-js"),e.appendChild(t),n=this.playerElIngest_=e,Object.keys(e).forEach((n=>{try{t[n]=e[n]}catch(e){}}))}if(t.setAttribute("tabindex","-1"),a.tabindex="-1",jt&&Yt&&(t.setAttribute("role","application"),a.role="application"),t.removeAttribute("width"),t.removeAttribute("height"),"width"in a&&delete a.width,"height"in a&&delete a.height,Object.getOwnPropertyNames(a).forEach((function(n){r&&"class"===n||e.setAttribute(n,a[n]),r&&t.setAttribute(n,a[n])})),t.playerId=t.id,t.id+="_html5_api",t.className="vjs-tech",t.player=e.player=this,this.addClass("vjs-paused"),!0!==i().VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=Un("vjs-styles-dimensions");const e=Rn(".vjs-styles-defaults"),t=Rn("head");t.insertBefore(this.styleEl_,e?e.nextSibling:t.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const o=t.getElementsByTagName("a");for(let e=0;e<o.length;e++){const t=o.item(e);un(t,"vjs-hidden"),t.setAttribute("hidden","hidden")}return t.initNetworkState_=t.networkState,t.parentNode&&!n&&t.parentNode.insertBefore(e,t),on(t,e),this.children_.unshift(t),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=e,e}crossOrigin(e){if(void 0===e)return this.techGet_("crossOrigin");null===e||"anonymous"===e||"use-credentials"===e?(this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e)):Et.warn(`crossOrigin must be null,  "anonymous" or "use-credentials", given "${e}"`)}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){const n=e+"_";if(void 0===t)return this[n]||0;if(""===t||"auto"===t)return this[n]=void 0,void this.updateStyleEl_();const r=parseFloat(t);isNaN(r)?Et.error(`Improper value "${t}" supplied for for ${e}`):(this[n]=r,this.updateStyleEl_())}fluid(e){if(void 0===e)return!!this.fluid_;var t,n;this.fluid_=!!e,ur(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),n=()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)},ur(t=this)?n():(t.eventedCallbacks||(t.eventedCallbacks=[]),t.eventedCallbacks.push(n))):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(void 0===e)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(!0===i().VIDEOJS_NO_DYNAMIC_STYLE){const e="number"==typeof this.width_?this.width_:this.options_.width,t="number"==typeof this.height_?this.height_:this.options_.height,n=this.tech_&&this.tech_.el();return void(n&&(e>=0&&(n.width=e),t>=0&&(n.height=t)))}let e,t,n,r;n=void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9";const a=n.split(":"),s=a[1]/a[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/s:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*s,r=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(r),Bn(this.styleEl_,`\n      .${r} {\n        width: ${e}px;\n        height: ${t}px;\n      }\n\n      .${r}.vjs-fluid:not(.vjs-audio-only-mode) {\n        padding-top: ${100*s}%;\n      }\n    `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const n=Er(e),r=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==n&&this.tag&&(di.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=n,this.isReady_=!1;let i=this.autoplay();("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(i=!1);const a={source:t,autoplay:i,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${r}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};ci.names.forEach((e=>{const t=ci[e];a[t.getterName]=this[t.privateName]})),Object.assign(a,this.options_[n]),Object.assign(a,this.options_[r]),Object.assign(a,this.options_[e.toLowerCase()]),this.tag&&(a.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(a.startTime=this.cache_.currentTime);const s=di.getTech(e);if(!s)throw new Error(`No Tech named '${n}' exists! '${n}' should be registered using videojs.registerTech()'`);var o,l;this.tech_=new s(a),this.tech_.ready(nr(this,this.handleTechReady_),!0),o=this.textTracksJson_||[],l=this.tech_,o.forEach((function(e){const t=l.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach((e=>t.addCue(e)))})),l.textTracks(),Wa.forEach((e=>{this.on(this.tech_,e,(t=>this[`handleTech${Er(e)}_`](t)))})),Object.keys(Xa).forEach((e=>{this.on(this.tech_,e,(t=>{0===this.tech_.playbackRate()&&this.tech_.seeking()?this.queuedCallbacks_.push({callback:this[`handleTech${Xa[e]}_`].bind(this),event:t}):this[`handleTech${Xa[e]}_`](t)}))})),this.on(this.tech_,"loadstart",(e=>this.handleTechLoadStart_(e))),this.on(this.tech_,"sourceset",(e=>this.handleTechSourceset_(e))),this.on(this.tech_,"waiting",(e=>this.handleTechWaiting_(e))),this.on(this.tech_,"ended",(e=>this.handleTechEnded_(e))),this.on(this.tech_,"seeking",(e=>this.handleTechSeeking_(e))),this.on(this.tech_,"play",(e=>this.handleTechPlay_(e))),this.on(this.tech_,"pause",(e=>this.handleTechPause_(e))),this.on(this.tech_,"durationchange",(e=>this.handleTechDurationChange_(e))),this.on(this.tech_,"fullscreenchange",((e,t)=>this.handleTechFullscreenChange_(e,t))),this.on(this.tech_,"fullscreenerror",((e,t)=>this.handleTechFullscreenError_(e,t))),this.on(this.tech_,"enterpictureinpicture",(e=>this.handleTechEnterPictureInPicture_(e))),this.on(this.tech_,"leavepictureinpicture",(e=>this.handleTechLeavePictureInPicture_(e))),this.on(this.tech_,"error",(e=>this.handleTechError_(e))),this.on(this.tech_,"posterchange",(e=>this.handleTechPosterChange_(e))),this.on(this.tech_,"textdata",(e=>this.handleTechTextData_(e))),this.on(this.tech_,"ratechange",(e=>this.handleTechRateChange_(e))),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===n&&this.tag||on(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){ci.names.forEach((e=>{const t=ci[e];this[t.privateName]=this[t.getterName]()})),this.textTracksJson_=function(e){const t=e.$$("track"),n=Array.prototype.map.call(t,(e=>e.track));return Array.prototype.map.call(t,(function(e){const t=Ur(e.track);return e.src&&(t.src=e.src),t})).concat(Array.prototype.filter.call(e.textTracks(),(function(e){return-1===n.indexOf(e)})).map(Ur))}(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return void 0===e&&Et.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||"string"!=typeof e)return;const t=()=>{const e=this.muted();this.muted(!0);const t=()=>{this.muted(e)};this.playTerminatedQueue_.push(t);const n=this.play();if(kr(n))return n.catch((e=>{throw t(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${e||""}`)}))};let n;return"any"!==e||this.muted()?n="muted"!==e||this.muted()?this.play():t():(n=this.play(),kr(n)&&(n=n.catch(t))),kr(n)?n.then((()=>{this.trigger({type:"autoplay-success",autoplay:e})})).catch((()=>{this.trigger({type:"autoplay-failure",autoplay:e})})):void 0}updateSourceCaches_(e=""){let t=e,n="";"string"!=typeof t&&(t=e.src,n=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!n&&(n=((e,t)=>{if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;const n=e.cache_.sources.filter((e=>e.src===t));if(n.length)return n[0].type;const r=e.$$("source");for(let e=0;e<r.length;e++){const n=r[e];if(n.type&&n.src&&n.src===t)return n.type}return Si(t)})(this,t)),this.cache_.source=Dt({},e,{src:t,type:n});const r=this.cache_.sources.filter((e=>e.src&&e.src===t)),i=[],a=this.$$("source"),s=[];for(let e=0;e<a.length;e++){const n=hn(a[e]);i.push(n),n.src&&n.src===t&&s.push(n.src)}s.length&&!r.length?this.cache_.sources=i:r.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=e=>this.updateSourceCaches_(e);const n=this.currentSource().src,r=e.src;n&&!/^blob:/.test(n)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==n)&&(t=()=>{}),t(r),e.src||this.tech_.any(["sourceset","loadstart"],(e=>{if("sourceset"===e.type)return;const t=this.techGet_("currentSrc");this.lastSource_.tech=t,this.updateSourceCaches_(t)}))}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(void 0===e)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach((e=>e.callback(e.event))),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.click&&!1===this.options_.userActions.click||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.click?this.options_.userActions.click.call(this,e):this.paused()?Fr(this.play()):this.pause()))}handleTechDoubleClick_(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),(t=>t.contains(e.target)))||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this)return;const n=this.el();let r=s()[this.fsApi_.fullscreenElement]===n;!r&&n.matches&&(r=n.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(r)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",(()=>{this.removeClass("vjs-ios-native-fs")}))),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready((function(){if(e in vi)return function(e,t,n,r){return t[n](e.reduce(Ti(n),r))}(this.middleware_,this.tech_,e,t);if(e in _i)return mi(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(e){throw Et(e),e}}),!0)}techGet_(e){if(this.tech_&&this.tech_.isReady_){if(e in yi)return function(e,t,n){return e.reduceRight(Ti(n),t[n]())}(this.middleware_,this.tech_,e);if(e in _i)return mi(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw Et(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t;if("TypeError"===t.name)throw Et(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t;throw Et(t),t}}}play(){return new Promise((e=>{this.play_(e)}))}play_(e=Fr){this.playCallbacks_.push(e);const t=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc())),n=Boolean($t||Xt);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t)return this.waitToPlay_=e=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(!t&&n&&this.load());const r=this.techGet_("play");n&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),null===r?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach((function(e){e()}))}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach((function(t){t(e)}))}pause(){this.techCall_("pause")}paused(){return!1!==this.techGet_("paused")}played(){return this.techGet_("played")||Cr(0,0)}scrubbing(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){return void 0===e?(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime):(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),this.cache_.initTime=0,void(isFinite(e)&&(this.cache_.currentTime=Number(e)))):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_)))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return e&&e.length||(e=Cr(0,0)),e}seekable(){let e=this.techGet_("seekable");return e&&e.length||(e=Cr(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return xr(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let n=e.end(e.length-1);return n>t&&(n=t),n}volume(e){let t;return void 0!==e?(t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)}muted(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)}defaultMuted(e){return void 0!==e&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(void 0!==e){const t=this.isFullscreen_;return this.isFullscreen_=Boolean(e),this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise(((n,r)=>{function i(){t.off("fullscreenerror",s),t.off("fullscreenchange",a)}function a(){i(),n()}function s(e,t){i(),r(t)}t.one("fullscreenchange",a),t.one("fullscreenerror",s);const o=t.requestFullscreenHelper_(e);o&&(o.then(i,i),o.then(n,r))}))}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(t=e)),this.fsApi_.requestFullscreen){const e=this.el_[this.fsApi_.requestFullscreen](t);return e&&e.then((()=>this.isFullscreen(!0)),(()=>this.isFullscreen(!1))),e}this.tech_.supportsFullScreen()&&1==!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise(((t,n)=>{function r(){e.off("fullscreenerror",a),e.off("fullscreenchange",i)}function i(){r(),t()}function a(e,t){r(),n(t)}e.one("fullscreenchange",i),e.one("fullscreenerror",a);const s=e.exitFullscreenHelper_();s&&(s.then(r,r),s.then(t,n))}))}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=s()[this.fsApi_.exitFullscreen]();return e&&Fr(e.then((()=>this.isFullscreen(!1)))),e}this.tech_.supportsFullScreen()&&1==!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=s().documentElement.style.overflow,Wn(s(),"keydown",this.boundFullWindowOnEscKey_),s().documentElement.style.overflow="hidden",un(s().body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){l().isEventKey(e,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,Xn(s(),"keydown",this.boundFullWindowOnEscKey_),s().documentElement.style.overflow=this.docOrigOverflow,cn(s().body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){return void 0!==e?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&i().documentPictureInPicture){const e=s().createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(an("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),i().documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then((t=>(On(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger("enterpictureinpicture"),t.addEventListener("pagehide",(t=>{const n=t.target.querySelector(".video-js");e.parentNode.replaceChild(n,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")})),t)))}return"pictureInPictureEnabled"in s()&&!1===this.disablePictureInPicture()?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){return i().documentPictureInPicture&&i().documentPictureInPicture.window?(i().documentPictureInPicture.window.close(),Promise.resolve()):"pictureInPictureEnabled"in s()?s().exitPictureInPicture():void 0}handleKeyDown(e){const{userActions:t}=this.options_;t&&t.hotkeys&&((e=>{const t=e.tagName.toLowerCase();return!!e.isContentEditable||("input"===t?-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(e.type):-1!==["textarea"].indexOf(t))})(this.el_.ownerDocument.activeElement)||("function"==typeof t.hotkeys?t.hotkeys.call(this,e):this.handleHotkeys(e)))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:n=(e=>l().isEventKey(e,"f")),muteKey:r=(e=>l().isEventKey(e,"m")),playPauseKey:i=(e=>l().isEventKey(e,"k")||l().isEventKey(e,"Space"))}=t;if(n.call(this,e)){e.preventDefault(),e.stopPropagation();const t=Ar.getComponent("FullscreenToggle");!1!==s()[this.fsApi_.fullscreenEnabled]&&t.prototype.handleClick.call(this,e)}else r.call(this,e)?(e.preventDefault(),e.stopPropagation(),Ar.getComponent("MuteToggle").prototype.handleClick.call(this,e)):i.call(this,e)&&(e.preventDefault(),e.stopPropagation(),Ar.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let n=0,r=this.options_.techOrder;n<r.length;n++){const i=r[n];let a=di.getTech(i);if(a||(a=Ar.getComponent(i)),a){if(a.isSupported()&&(t=a.canPlayType(e),t))return t}else Et.error(`The "${i}" tech is undefined. Skipped browser support check for that tech.`)}return""}selectSource(e){const t=this.options_.techOrder.map((e=>[e,di.getTech(e)])).filter((([e,t])=>t?t.isSupported():(Et.error(`The "${e}" tech is undefined. Skipped browser support check for that tech.`),!1))),n=function(e,t,n){let r;return e.some((e=>t.some((t=>{if(r=n(e,t),r)return!0})))),r};let r;const i=([e,t],n)=>{if(t.canPlaySource(n,this.options_[e.toLowerCase()]))return{source:n,tech:e}};var a;return r=this.options_.sourceOrder?n(e,t,(a=i,(e,t)=>a(t,e))):n(t,e,i),r||!1}handleSrc_(e,t){if(void 0===e)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const n=Ai(e);if(n.length){if(this.changingSrc_=!0,t||(this.cache_.sources=n),this.updateSourceCaches_(n[0]),gi(this,n[0],((e,r)=>{if(this.middleware_=r,t||(this.cache_.sources=n),this.updateSourceCaches_(e),this.src_(e))return n.length>1?this.handleSrc_(n.slice(1)):(this.changingSrc_=!1,this.setTimeout((function(){this.error({code:4,message:this.options_.notSupportedMessage})}),0),void this.triggerReady());var i,a;i=r,a=this.tech_,i.forEach((e=>e.setTech&&e.setTech(a)))})),n.length>1){const e=()=>{this.error(null),this.handleSrc_(n.slice(1),!0)},t=()=>{this.off("error",e)};this.one("error",e),this.one("playing",t),this.resetRetryOnError_=()=>{this.off("error",e),this.off("playing",t)}}}else this.setTimeout((function(){this.error({code:4,message:this.options_.notSupportedMessage})}),0)}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return!t||(br(t.tech,this.techName_)?(this.ready((function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1}),!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready((()=>{this.changingSrc_=!1})),!1))}load(){this.tech_&&this.tech_.vhs?this.src(this.currentSource()):this.techCall_("load")}reset(){this.paused()?this.doReset_():Fr(this.play().then((()=>this.doReset_())))}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),ur(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:n,remainingTimeDisplay:r}=this.controlBar||{},{seekBar:i}=n||{};e&&e.updateContent(),t&&t.updateContent(),r&&r.updateContent(),i&&(i.update(),i.loadProgressBar&&i.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")}autoplay(e){if(void 0===e)return this.options_.autoplay||!1;let t;"string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"==typeof e?e:"play"),t=!1):this.options_.autoplay=!!e,t=void 0===t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return void 0!==e&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")}poster(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(void 0===e)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(void 0===e)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(void 0===e)return this.error_||null;if(pt("beforeerror").forEach((t=>{const n=t(this,e);Ct(n)&&!Array.isArray(n)||"string"==typeof n||"number"==typeof n||null===n?e=n:this.log.error("please return a value that MediaError expects in beforeerror hooks")})),this.options_.suppressNotSupportedError&&e&&4===e.code){const t=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),void this.one("loadstart",(function(){this.off(["click","touchstart"],t)}))}if(null===e)return this.error_=null,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new Lr(e),this.addClass("vjs-error"),Et.error(`(CODE:${this.error_.code} ${Lr.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),pt("error").forEach((e=>e(this,this.error_)))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",(function(e){e.stopPropagation(),e.preventDefault()})),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,n;const r=nr(this,this.reportUserActivity),i=function(t){r(),this.clearInterval(e)};this.on("mousedown",(function(){r(),this.clearInterval(e),e=this.setInterval(r,250)})),this.on("mousemove",(function(e){e.screenX===t&&e.screenY===n||(t=e.screenX,n=e.screenY,r())})),this.on("mouseup",i),this.on("mouseleave",i);const a=this.getChild("controlBar");let s;!a||Xt||kt||(a.on("mouseenter",(function(e){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0})),a.on("mouseleave",(function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout}))),this.on("keydown",r),this.on("keyup",r),this.setInterval((function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(s);const e=this.options_.inactivityTimeout;e<=0||(s=this.setTimeout((function(){this.userActivity_||this.userActive(!1)}),e))}),250)}playbackRate(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)}defaultPlaybackRate(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),n=t&&t.currentHeight();e.forEach((e=>{e!==t&&e.el_&&!e.hasClass("vjs-hidden")&&(e.hide(),this.audioOnlyCache_.hiddenChildren.push(e))})),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(n),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.audioOnlyCache_.hiddenChildren.forEach((e=>e.show())),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if("boolean"!=typeof e||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const e=[];return this.isInPictureInPicture()&&e.push(this.exitPictureInPicture()),this.isFullscreen()&&e.push(this.exitFullscreen()),this.audioPosterMode()&&e.push(this.audioPosterMode(!1)),Promise.all(e).then((()=>this.enableAudioOnlyUI_()))}return Promise.resolve().then((()=>this.disableAudioOnlyUI_()))}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return"boolean"!=typeof e||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then((()=>{this.enablePosterModeUI_()})):Promise.resolve().then((()=>{this.enablePosterModeUI_()})):Promise.resolve().then((()=>{this.disablePosterModeUI_()})))}addTextTrack(e,t,n){if(this.tech_)return this.tech_.addTextTrack(e,t,n)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),ur(this)&&this.trigger("languagechange"))}languages(){return Dt(es.prototype.options_.languages,this.languages_)}toJSON(){const e=Dt(this.options_),t=e.tracks;e.tracks=[];for(let n=0;n<t.length;n++){let r=t[n];r=Dt(r),r.player=void 0,e.tracks[n]=r}return e}createModal(e,t){(t=t||{}).content=e||"";const n=new jr(this,t);return this.addChild(n),n.on("dispose",(()=>{this.removeChild(n)})),n.open(),n}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let n=0;n<$a.length;n++){const r=$a[n];if(t<=this.breakpoints_[r]){if(e===r)return;e&&this.removeClass(Qa[e]),this.addClass(Qa[r]),this.breakpoint_=r;break}}}removeCurrentBreakpoint_(){const e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)}breakpoints(e){return void 0===e||(this.breakpoint_="",this.breakpoints_=Object.assign({},Ja,e),this.updateCurrentBreakpoint_()),Object.assign(this.breakpoints_)}responsive(e){return void 0===e?this.responsive_:(e=Boolean(e))!==this.responsive_?(this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return Qa[this.breakpoint_]||""}loadMedia(e,t){if(!e||"object"!=typeof e)return;const n=this.crossOrigin();this.reset(),this.cache_.media=Dt(e);const{artist:r,artwork:i,description:a,poster:s,src:o,textTracks:l,title:u}=this.cache_.media;!i&&s&&(this.cache_.media.artwork=[{src:s,type:Si(s)}]),n&&this.crossOrigin(n),o&&this.src(o),s&&this.poster(s),Array.isArray(l)&&l.forEach((e=>this.addRemoteTextTrack(e,!1))),this.titleBar&&this.titleBar.update({title:u,description:a||r||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),(e=>({kind:e.kind,label:e.label,language:e.language,src:e.src})))};return e&&(t.poster=e,t.artwork=[{src:t.poster,type:Si(t.poster)}]),t}return Dt(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},n=hn(e),r=n["data-setup"];if(ln(e,"vjs-fill")&&(n.fill=!0),ln(e,"vjs-fluid")&&(n.fluid=!0),null!==r){const[e,t]=c()(r||"{}");e&&Et.error(e),Object.assign(n,t)}if(Object.assign(t,n),e.hasChildNodes()){const n=e.childNodes;for(let e=0,r=n.length;e<r;e++){const r=n[e],i=r.nodeName.toLowerCase();"source"===i?t.sources.push(hn(r)):"track"===i&&t.tracks.push(hn(r))}}return t}debug(e){if(void 0===e)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)}playbackRates(e){if(void 0===e)return this.cache_.playbackRates;Array.isArray(e)&&e.every((e=>"number"==typeof e))&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}}ci.names.forEach((function(e){const t=ci[e];es.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}})),es.prototype.crossorigin=es.prototype.crossOrigin,es.players={};const ts=i().navigator;es.prototype.options_={techOrder:di.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:ts&&(ts.languages&&ts.languages[0]||ts.userLanguage||ts.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,enableSmoothSeeking:!1},Wa.forEach((function(e){es.prototype[`handleTech${Er(e)}_`]=function(){return this.trigger(e)}})),Ar.registerComponent("Player",es);const ns="plugin",rs="activePlugins_",is={},as=e=>is.hasOwnProperty(e),ss=e=>as(e)?is[e]:void 0,os=(e,t)=>{e[rs]=e[rs]||{},e[rs][t]=!0},ls=(e,t,n)=>{const r=(n?"before":"")+"pluginsetup";e.trigger(r,t),e.trigger(r+":"+t.name,t)},us=(e,t)=>(t.prototype.name=e,function(...n){ls(this,{name:e,plugin:t,instance:null},!0);const r=new t(...[this,...n]);return this[e]=()=>r,ls(this,r.getEventHash()),r});class cs{constructor(e){if(this.constructor===cs)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),yr(this),delete this.trigger,_r(this,this.constructor.defaultState),os(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return $n(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[rs][e]=!1,this.player=this.state=null,t[e]=us(e,is[e])}static isBasic(e){const t="string"==typeof e?ss(e):e;return"function"==typeof t&&!cs.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if("string"!=typeof e)throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(as(e))Et.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(es.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if("function"!=typeof t)throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return is[e]=t,e!==ns&&(cs.isBasic(t)?es.prototype[e]=function(e,t){const n=function(){ls(this,{name:e,plugin:t,instance:null},!0);const n=t.apply(this,arguments);return os(this,e),ls(this,{name:e,plugin:t,instance:n}),n};return Object.keys(t).forEach((function(e){n[e]=t[e]})),n}(e,t):es.prototype[e]=us(e,t)),t}static deregisterPlugin(e){if(e===ns)throw new Error("Cannot de-register base plugin.");as(e)&&(delete is[e],delete es.prototype[e])}static getPlugins(e=Object.keys(is)){let t;return e.forEach((e=>{const n=ss(e);n&&(t=t||{},t[e]=n)})),t}static getPluginVersion(e){const t=ss(e);return t&&t.VERSION||""}}function ds(e,t,n,r){return function(e,t){let n=!1;return function(...r){return n||Et.warn(e),n=!0,t.apply(this,r)}}(`${t} is deprecated and will be removed in ${e}.0; please use ${n} instead.`,r)}cs.getPlugin=ss,cs.BASE_PLUGIN_NAME=ns,cs.registerPlugin(ns,cs),es.prototype.usingPlugin=function(e){return!!this[rs]&&!0===this[rs][e]},es.prototype.hasPlugin=function(e){return!!as(e)};const fs=e=>0===e.indexOf("#")?e.slice(1):e;function hs(e,t,n){let r=hs.getPlayer(e);if(r)return t&&Et.warn(`Player "${e}" is already initialised. Options will not be applied.`),n&&r.ready(n),r;const a="string"==typeof e?Rn("#"+fs(e)):e;if(!tn(a))throw new TypeError("The element or ID supplied is not valid. (videojs)");const s="getRootNode"in a&&a.getRootNode()instanceof i().ShadowRoot?a.getRootNode():a.ownerDocument.body;a.ownerDocument.defaultView&&s.contains(a)||Et.warn("The element supplied is not included in the DOM"),!0===(t=t||{}).restoreEl&&(t.restoreEl=(a.parentNode&&a.parentNode.hasAttribute("data-vjs-player")?a.parentNode:a).cloneNode(!0)),pt("beforesetup").forEach((e=>{const n=e(a,Dt(t));Ct(n)&&!Array.isArray(n)?t=Dt(t,n):Et.error("please return an object in beforesetup hooks")}));const o=Ar.getComponent("Player");return r=new o(a,t,n),pt("setup").forEach((e=>e(r))),r}if(hs.hooks_=ht,hs.hooks=pt,hs.hook=function(e,t){pt(e,t)},hs.hookOnce=function(e,t){pt(e,[].concat(t).map((t=>{const n=(...r)=>(gt(e,n),t(...r));return n})))},hs.removeHook=gt,!0!==i().VIDEOJS_NO_DYNAMIC_STYLE&&en()){let e=Rn(".vjs-styles-defaults");if(!e){e=Un("vjs-styles-defaults");const t=Rn("head");t&&t.insertBefore(e,t.firstChild),Bn(e,"\n      .video-js {\n        width: 300px;\n        height: 150px;\n      }\n\n      .vjs-fluid:not(.vjs-audio-only-mode) {\n        padding-top: 56.25%\n      }\n    ")}}kn(1,hs),hs.VERSION=ft,hs.options=es.prototype.options_,hs.getPlayers=()=>es.players,hs.getPlayer=e=>{const t=es.players;let n;if("string"==typeof e){const r=fs(e),i=t[r];if(i)return i;n=Rn("#"+r)}else n=e;if(tn(n)){const{player:e,playerId:r}=n;if(e||t[r])return e||t[r]}},hs.getAllPlayers=()=>Object.keys(es.players).map((e=>es.players[e])).filter(Boolean),hs.players=es.players,hs.getComponent=Ar.getComponent,hs.registerComponent=(e,t)=>(di.isTech(t)&&Et.warn(`The ${e} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),Ar.registerComponent.call(Ar,e,t)),hs.getTech=di.getTech,hs.registerTech=di.registerTech,hs.use=function(e,t){fi[e]=fi[e]||[],fi[e].push(t)},Object.defineProperty(hs,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(hs.middleware,"TERMINATOR",{value:pi,writeable:!1,enumerable:!0}),hs.browser=Qt,hs.obj=Pt,hs.mergeOptions=ds(9,"videojs.mergeOptions","videojs.obj.merge",Dt),hs.defineLazyProperty=ds(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",Ot),hs.bind=ds(9,"videojs.bind","native Function.prototype.bind",nr),hs.registerPlugin=cs.registerPlugin,hs.deregisterPlugin=cs.deregisterPlugin,hs.plugin=(e,t)=>(Et.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),cs.registerPlugin(e,t)),hs.getPlugins=cs.getPlugins,hs.getPlugin=cs.getPlugin,hs.getPluginVersion=cs.getPluginVersion,hs.addLanguage=function(e,t){return e=(""+e).toLowerCase(),hs.options.languages=Dt(hs.options.languages,{[e]:t}),hs.options.languages[e]},hs.log=Et,hs.createLogger=bt,hs.time=Mr,hs.createTimeRange=ds(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Cr),hs.createTimeRanges=ds(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Cr),hs.formatTime=ds(9,"videojs.formatTime","videojs.time.formatTime",Pr),hs.setFormatTime=ds(9,"videojs.setFormatTime","videojs.time.setFormatTime",Nr),hs.resetFormatTime=ds(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",Or),hs.parseUrl=ds(9,"videojs.parseUrl","videojs.url.parseUrl",$r),hs.isCrossOrigin=ds(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",ei),hs.EventTarget=or,hs.any=Jn,hs.on=Wn,hs.one=Qn,hs.off=Xn,hs.trigger=$n,hs.xhr=f(),hs.TextTrack=ii,hs.AudioTrack=ai,hs.VideoTrack=si,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach((e=>{hs[e]=function(){return Et.warn(`videojs.${e}() is deprecated; use videojs.dom.${e}() instead`),Pn[e].apply(null,arguments)}})),hs.computedStyle=ds(9,"videojs.computedStyle","videojs.dom.computedStyle",Nn),hs.dom=Pn,hs.fn=ar,hs.num=Gi,hs.str=Sr,hs.url=ti;class ps{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get:()=>t.enabled_(),set(e){t.enabled_(e)}}),t}}class gs extends hs.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get:()=>e.selectedIndex_}),Object.defineProperty(e,"length",{get:()=>e.levels_.length}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const n=this.levels_.length;return t=new ps(e),""+n in this||Object.defineProperty(this,n,{get(){return this.levels_[n]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let n=0,r=this.length;n<r;n++)if(this[n]===e){t=this.levels_.splice(n,1)[0],this.selectedIndex_===n?this.selectedIndex_=-1:this.selectedIndex_>n&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,n=this.length;t<n;t++){const n=this[t];if(n.id===e)return n}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}}gs.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const e in gs.prototype.allowedEvents_)gs.prototype["on"+e]=null;var ms="4.0.0";const ys=function(e){return function(e,t){const n=e.qualityLevels,r=new gs,i=function(){r.dispose(),e.qualityLevels=n,e.off("dispose",i)};return e.on("dispose",i),e.qualityLevels=()=>r,e.qualityLevels.VERSION=ms,r}(this,hs.obj.merge({},e))};hs.registerPlugin("qualityLevels",ys),ys.VERSION=ms;const vs=v,_s=(e,t)=>t&&t.responseURL&&e!==t.responseURL?t.responseURL:e,Ts=e=>hs.log.debug?hs.log.debug.bind(hs,"VHS:",`${e} >`):function(){};function Es(...e){const t=hs.obj||hs;return(t.merge||t.mergeOptions).apply(t,e)}function bs(...e){const t=hs.time||hs;return(t.createTimeRanges||t.createTimeRanges).apply(t,e)}const Ss=1/30,As=.1,ws=function(e,t){const n=[];let r;if(e&&e.length)for(r=0;r<e.length;r++)t(e.start(r),e.end(r))&&n.push([e.start(r),e.end(r)]);return bs(n)},Is=function(e,t){return ws(e,(function(e,n){return e-As<=t&&n+As>=t}))},Cs=function(e,t){return ws(e,(function(e){return e-Ss>=t}))},Rs=e=>{const t=[];if(!e||!e.length)return"";for(let n=0;n<e.length;n++)t.push(e.start(n)+" => "+e.end(n));return t.join(", ")},Ds=e=>{const t=[];for(let n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t},Ns=function(e){if(e&&e.length&&e.end)return e.end(e.length-1)},Os=function(e,t){let n=0;if(!e||!e.length)return n;for(let r=0;r<e.length;r++){const i=e.start(r),a=e.end(r);t>a||(n+=t>i&&t<=a?a-t:a-i)}return n},Ps=(e,t)=>{if(!t.preload)return t.duration;let n=0;return(t.parts||[]).forEach((function(e){n+=e.duration})),(t.preloadHints||[]).forEach((function(t){"PART"===t.type&&(n+=e.partTargetDuration)})),n},Ms=e=>(e.segments||[]).reduce(((e,t,n)=>(t.parts?t.parts.forEach((function(r,i){e.push({duration:r.duration,segmentIndex:n,partIndex:i,part:r,segment:t})})):e.push({duration:t.duration,segmentIndex:n,partIndex:null,segment:t,part:null}),e)),[]),xs=e=>{const t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},Ls=({preloadSegment:e})=>{if(!e)return;const{parts:t,preloadHints:n}=e;let r=(n||[]).reduce(((e,t)=>e+("PART"===t.type?1:0)),0);return r+=t&&t.length?t.length:0,r},ks=(e,t)=>{if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;const n=xs(t).length>0;return n&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:n&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},Fs=function(e,t,n){if(void 0===t&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;const r=function(e,t){let n=0,r=t-e.mediaSequence,i=e.segments[r];if(i){if(void 0!==i.start)return{result:i.start,precise:!0};if(void 0!==i.end)return{result:i.end-i.duration,precise:!0}}for(;r--;){if(i=e.segments[r],void 0!==i.end)return{result:n+i.end,precise:!0};if(n+=Ps(e,i),void 0!==i.start)return{result:n+i.start,precise:!0}}return{result:n,precise:!1}}(e,t);if(r.precise)return r.result;const i=function(e,t){let n,r=0,i=t-e.mediaSequence;for(;i<e.segments.length;i++){if(n=e.segments[i],void 0!==n.start)return{result:n.start-r,precise:!0};if(r+=Ps(e,n),void 0!==n.end)return{result:n.end-r,precise:!0}}return{result:-1,precise:!1}}(e,t);return i.precise?i.result:r.result+n},Us=function(e,t,n){if(!e)return 0;if("number"!=typeof n&&(n=0),void 0===t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return i()[1/0]}return Fs(e,t,n)},Bs=function({defaultDuration:e,durationList:t,startIndex:n,endIndex:r}){let i=0;if(n>r&&([n,r]=[r,n]),n<0){for(let t=n;t<Math.min(0,r);t++)i+=e;n=0}for(let e=n;e<r;e++)i+=t[e].duration;return i},js=function(e,t,n,r){if(!e||!e.segments)return null;if(e.endList)return Us(e);if(null===t)return null;t=t||0;let i=Fs(e,e.mediaSequence+e.segments.length,t);return n&&(i-=r="number"==typeof r?r:ks(null,e)),Math.max(0,i)},qs=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},Hs=function(e){return e.excludeUntil&&e.excludeUntil===1/0},Gs=function(e){const t=qs(e);return!e.disabled&&!t},Vs=function(e,t){return t.attributes&&t.attributes[e]},Ys=(e,t)=>{if(1===e.playlists.length)return!0;const n=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter((e=>!!Gs(e)&&(e.attributes.BANDWIDTH||0)<n)).length},Zs=(e,t)=>!(!e&&!t||!e&&t||e&&!t||e!==t&&(!e.id||!t.id||e.id!==t.id)&&(!e.resolvedUri||!t.resolvedUri||e.resolvedUri!==t.resolvedUri)&&(!e.uri||!t.uri||e.uri!==t.uri)),Ks=function(e,t){const n=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{};let r=!1;for(const e in n){for(const i in n[e])if(r=t(n[e][i]),r)break;if(r)break}return!!r},zs=e=>{if(!e||!e.playlists||!e.playlists.length)return Ks(e,(e=>e.playlists&&e.playlists.length||e.uri));for(let t=0;t<e.playlists.length;t++){const n=e.playlists[t],r=n.attributes&&n.attributes.CODECS;if((!r||!r.split(",").every((e=>x(e))))&&!Ks(e,(e=>Zs(n,e))))return!1}return!0};var Ws={liveEdgeDelay:ks,duration:Us,seekable:function(e,t,n){const r=t||0;let i=js(e,t,!0,n);return null===i?bs():(i<r&&(i=r),bs(r,i))},getMediaInfoForTime:function({playlist:e,currentTime:t,startingSegmentIndex:n,startingPartIndex:r,startTime:i,exactManifestTimings:a}){let s=t-i;const o=Ms(e);let l=0;for(let e=0;e<o.length;e++){const t=o[e];if(n===t.segmentIndex&&("number"!=typeof r||"number"!=typeof t.partIndex||r===t.partIndex)){l=e;break}}if(s<0){if(l>0)for(let t=l-1;t>=0;t--){const n=o[t];if(s+=n.duration,a){if(s<0)continue}else if(s+Ss<=0)continue;return{partIndex:n.partIndex,segmentIndex:n.segmentIndex,startTime:i-Bs({defaultDuration:e.targetDuration,durationList:o,startIndex:l,endIndex:t})}}return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t}}if(l<0){for(let n=l;n<0;n++)if(s-=e.targetDuration,s<0)return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t};l=0}for(let t=l;t<o.length;t++){const n=o[t];s-=n.duration;const r=n.duration>Ss;if(0!==s&&!(r&&s+Ss>=0)||t===o.length-1){if(a){if(s>0)continue}else if(s-Ss>=0)continue;return{partIndex:n.partIndex,segmentIndex:n.segmentIndex,startTime:i+Bs({defaultDuration:e.targetDuration,durationList:o,startIndex:l,endIndex:t})}}}return{segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:t}},isEnabled:Gs,isDisabled:function(e){return e.disabled},isExcluded:qs,isIncompatible:Hs,playlistEnd:js,isAes:function(e){for(let t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},hasAttribute:Vs,estimateSegmentRequestTime:function(e,t,n,r=0){return Vs("BANDWIDTH",n)?(e*n.attributes.BANDWIDTH-8*r)/t:NaN},isLowestEnabledRendition:Ys,isAudioOnly:zs,playlistMatch:Zs,segmentDurationWithParts:Ps};const{log:Xs}=hs,$s=(e,t)=>`${e}-${t}`,Qs=(e,t,n)=>`placeholder-uri-${e}-${t}-${n}`,Js=(e,t)=>{e.mediaGroups&&["AUDIO","SUBTITLES"].forEach((n=>{if(e.mediaGroups[n])for(const r in e.mediaGroups[n])for(const i in e.mediaGroups[n][r]){const a=e.mediaGroups[n][r][i];t(a,n,r,i)}}))},eo=({playlist:e,uri:t,id:n})=>{e.id=n,e.playlistErrors_=0,t&&(e.uri=t),e.attributes=e.attributes||{}},to=(e,t,n=Qs)=>{e.uri=t;for(let t=0;t<e.playlists.length;t++)if(!e.playlists[t].uri){const n=`placeholder-uri-${t}`;e.playlists[t].uri=n}const r=zs(e);Js(e,((t,i,a,s)=>{if(!t.playlists||!t.playlists.length){if(r&&"AUDIO"===i&&!t.uri)for(let t=0;t<e.playlists.length;t++){const n=e.playlists[t];if(n.attributes&&n.attributes.AUDIO&&n.attributes.AUDIO===a)return}t.playlists=[(0,g.Z)({},t)]}t.playlists.forEach((function(t,r){const o=n(i,a,s,t),l=$s(r,o);t.uri?t.resolvedUri=t.resolvedUri||vs(e.uri,t.uri):(t.uri=0===r?o:l,t.resolvedUri=t.uri),t.id=t.id||l,t.attributes=t.attributes||{},e.playlists[t.id]=t,e.playlists[t.uri]=t}))})),(e=>{let t=e.playlists.length;for(;t--;){const n=e.playlists[t];eo({playlist:n,id:$s(t,n.uri)}),n.resolvedUri=vs(e.uri,n.uri),e.playlists[n.id]=n,e.playlists[n.uri]=n,n.attributes.BANDWIDTH||Xs.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}})(e),(e=>{Js(e,(t=>{t.uri&&(t.resolvedUri=vs(e.uri,t.uri))}))})(e)};class no{constructor(){this.offset_=null,this.pendingDateRanges_=new Map,this.processedDateRanges_=new Map}setOffset(e=[]){if(null!==this.offset_)return;if(!e.length)return;const[t]=e;void 0!==t.programDateTime&&(this.offset_=t.programDateTime/1e3)}setPendingDateRanges(e=[]){if(!e.length)return;const[t]=e,n=t.startDate.getTime();this.trimProcessedDateRanges_(n),this.pendingDateRanges_=e.reduce(((e,t)=>(e.set(t.id,t),e)),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(null===this.offset_)return[];const e={},t=[];this.pendingDateRanges_.forEach(((n,r)=>{if(!this.processedDateRanges_.has(r)&&(n.startTime=n.startDate.getTime()/1e3-this.offset_,n.processDateRange=()=>this.processDateRange(n),t.push(n),n.class))if(e[n.class]){const t=e[n.class].push(n);n.classListIndex=t-1}else e[n.class]=[n],n.classListIndex=0}));for(const n of t){const t=e[n.class]||[];n.endDate?n.endTime=n.endDate.getTime()/1e3-this.offset_:n.endOnNext&&t[n.classListIndex+1]?n.endTime=t[n.classListIndex+1].startTime:n.duration?n.endTime=n.startTime+n.duration:n.plannedDuration?n.endTime=n.startTime+n.plannedDuration:n.endTime=n.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach(((t,n)=>{t.startDate.getTime()<e&&this.processedDateRanges_.delete(n)}))}}const{EventTarget:ro}=hs,io=(e,t)=>{if(!e)return t;const n=Es(e,t);if(e.preloadHints&&!t.preloadHints&&delete n.preloadHints,e.parts&&!t.parts)delete n.parts;else if(e.parts&&t.parts)for(let r=0;r<t.parts.length;r++)e.parts&&e.parts[r]&&(n.parts[r]=Es(e.parts[r],t.parts[r]));return!e.skipped&&t.skipped&&(n.skipped=!1),e.preload&&!t.preload&&(n.preload=!1),n},ao=(e,t)=>{!e.resolvedUri&&e.uri&&(e.resolvedUri=vs(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=vs(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=vs(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=vs(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach((e=>{e.resolvedUri||(e.resolvedUri=vs(t,e.uri))})),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach((e=>{e.resolvedUri||(e.resolvedUri=vs(t,e.uri))}))},so=function(e){const t=e.segments||[],n=e.preloadSegment;if(n&&n.parts&&n.parts.length){if(n.preloadHints)for(let e=0;e<n.preloadHints.length;e++)if("MAP"===n.preloadHints[e].type)return t;n.duration=e.targetDuration,n.preload=!0,t.push(n)}return t},oo=(e,t)=>e===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence&&e.preloadSegment===t.preloadSegment,lo=(e,t,n=oo)=>{const r=Es(e,{}),i=r.playlists[t.id];if(!i)return null;if(n(i,t))return null;t.segments=so(t);const a=Es(i,t);if(a.preloadSegment&&!t.preloadSegment&&delete a.preloadSegment,i.segments){if(t.skip){t.segments=t.segments||[];for(let e=0;e<t.skip.skippedSegments;e++)t.segments.unshift({skipped:!0})}a.segments=((e,t,n)=>{const r=e.slice(),i=t.slice();n=n||0;const a=[];let s;for(let e=0;e<i.length;e++){const t=r[e+n],o=i[e];t?(s=t.map||s,a.push(io(t,o))):(s&&!o.map&&(o.map=s),a.push(o))}return a})(i.segments,t.segments,t.mediaSequence-i.mediaSequence)}a.segments.forEach((e=>{ao(e,a.resolvedUri)}));for(let e=0;e<r.playlists.length;e++)r.playlists[e].id===t.id&&(r.playlists[e]=a);return r.playlists[t.id]=a,r.playlists[t.uri]=a,Js(e,((e,n,r,i)=>{if(e.playlists)for(let n=0;n<e.playlists.length;n++)t.id===e.playlists[n].id&&(e.playlists[n]=a)})),r},uo=(e,t)=>{const n=e.segments||[],r=n[n.length-1],i=r&&r.parts&&r.parts[r.parts.length-1],a=i&&i.duration||r&&r.duration;return t&&a?1e3*a:500*(e.partTargetDuration||e.targetDuration||10)};class co extends ro{constructor(e,t,n={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=Ts("PlaylistLoader");const{withCredentials:r=!1}=n;this.src=e,this.vhs_=t,this.withCredentials=r,this.addDateRangesToTextTrack_=n.addDateRangesToTextTrack;const i=t.options_;this.customTagParsers=i&&i.customTagParsers||[],this.customTagMappers=i&&i.customTagMappers||[],this.llhls=i&&i.llhls,this.dateRangesStorage_=new no,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();t.length&&this.addDateRangesToTextTrack_&&this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if("HAVE_METADATA"!==this.state)return;const e=this.media();let t=vs(this.main.uri,e.uri);this.llhls&&(t=((e,t)=>{if(t.endList||!t.serverControl)return e;const n={};if(t.serverControl.canBlockReload){const{preloadSegment:e}=t;let r=t.mediaSequence+t.segments.length;if(e){const i=e.parts||[],a=Ls(t)-1;a>-1&&a!==i.length-1&&(n._HLS_part=a),(a>-1||i.length)&&r--}n._HLS_msn=r}if(t.serverControl&&t.serverControl.canSkipUntil&&(n._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(n).length){const t=new(i().URL)(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach((function(e){n.hasOwnProperty(e)&&t.searchParams.set(e,n[e])})),e=t.toString()}return e})(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials},((e,t)=>{if(this.request)return e?this.playlistRequestError(this.request,this.media(),"HAVE_METADATA"):void this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}))}playlistRequestError(e,t,n){const{uri:r,id:i}=t;this.request=null,n&&(this.state=n),this.error={playlist:this.main.playlists[i],status:e.status,message:`HLS playlist request error at URL: ${r}.`,responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error")}parseManifest_({url:e,manifestString:t}){return(({onwarn:e,oninfo:t,manifestString:n,customTagParsers:r=[],customTagMappers:i=[],llhls:a})=>{const s=new R;e&&s.on("warn",e),t&&s.on("info",t),r.forEach((e=>s.addParser(e))),i.forEach((e=>s.addTagMapper(e))),s.push(n),s.end();const o=s.manifest;if(a||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach((function(e){o.hasOwnProperty(e)&&delete o[e]})),o.segments&&o.segments.forEach((function(e){["parts","preloadHints"].forEach((function(t){e.hasOwnProperty(t)&&delete e[t]}))}))),!o.targetDuration){let t=10;o.segments&&o.segments.length&&(t=o.segments.reduce(((e,t)=>Math.max(e,t.duration)),0)),e&&e({message:`manifest has no targetDuration defaulting to ${t}`}),o.targetDuration=t}const l=xs(o);if(l.length&&!o.partTargetDuration){const t=l.reduce(((e,t)=>Math.max(e,t.duration)),0);e&&(e({message:`manifest has no partTargetDuration defaulting to ${t}`}),Xs.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),o.partTargetDuration=t}return o})({onwarn:({message:t})=>this.logger_(`m3u8-parser warn for ${e}: ${t}`),oninfo:({message:t})=>this.logger_(`m3u8-parser info for ${e}: ${t}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls})}haveMetadata({playlistString:e,playlistObject:t,url:n,id:r}){this.request=null,this.state="HAVE_METADATA";const i=t||this.parseManifest_({url:n,manifestString:e});i.lastRequest=Date.now(),eo({playlist:i,uri:n,id:r});const a=lo(this.main,i);this.targetDuration=i.partTargetDuration||i.targetDuration,this.pendingMedia_=null,a?(this.main=a,this.media_=this.main.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(uo(this.media(),!!a)),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),i().clearTimeout(this.mediaUpdateTimeout),i().clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new no,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"==typeof e){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(i().clearTimeout(this.finalRenditionTimeout),t){const t=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;return void(this.finalRenditionTimeout=i().setTimeout(this.media.bind(this,e,!1),t))}const n=this.state,r=!this.media_||e.id!==this.media_.id,a=this.main.playlists[e.id];if(a&&a.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(r&&(this.trigger("mediachanging"),"HAVE_MAIN_MANIFEST"===n?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(uo(e,!0)),r){if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},((t,r)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=_s(e.resolvedUri,r),t)return this.playlistRequestError(this.request,e,n);this.haveMetadata({playlistString:r.responseText,url:e.uri,id:e.id}),"HAVE_MAIN_MANIFEST"===n?this.trigger("loadedmetadata"):this.trigger("mediachange")}}))}}pause(){this.mediaUpdateTimeout&&(i().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(i().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const e=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=i().setTimeout((()=>{this.mediaUpdateTimeout=null,this.load()}),e)}else this.started?t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(i().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=i().setTimeout((()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)}),e))}start(){if(this.started=!0,"object"==typeof this.src)return this.src.uri||(this.src.uri=i().location.href),this.src.resolvedUri=this.src.uri,void setTimeout((()=>{this.setupInitialPlaylist(this.src)}),0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},((e,t)=>{if(!this.request)return;if(this.request=null,e)return this.error={status:t.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:t.responseText,code:2},"HAVE_NOTHING"===this.state&&(this.started=!1),this.trigger("error");this.src=_s(this.src,t);const n=this.parseManifest_({manifestString:t.responseText,url:this.src});this.setupInitialPlaylist(n)}))}srcUri(){return"string"==typeof this.src?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists)return this.main=e,to(this.main,this.srcUri()),e.playlists.forEach((e=>{e.segments=so(e),e.segments.forEach((t=>{ao(t,e.resolvedUri)}))})),this.trigger("loadedplaylist"),void(this.request||this.media(this.main.playlists[0]));const t=this.srcUri()||i().location.href;this.main=((e,t)=>{const n=$s(0,t),r={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:i().location.href,resolvedUri:i().location.href,playlists:[{uri:t,id:n,resolvedUri:t,attributes:{}}]};return r.playlists[n]=r.playlists[0],r.playlists[t]=r.playlists[0],r})(0,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const n=this.main,r=e.ID;let i=n.playlists.length;for(;i--;){const a=n.playlists[i];if(a.attributes["PATHWAY-ID"]===r){const s=a.resolvedUri,o=a.id;if(t){const t=this.createCloneURI_(a.resolvedUri,e),s=$s(r,t),o=this.createCloneAttributes_(r,a.attributes),l=this.createClonePlaylist_(a,s,e,o);n.playlists[i]=l,n.playlists[s]=l,n.playlists[t]=l}else n.playlists.splice(i,1);delete n.playlists[o],delete n.playlists[s]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const n=this.main,r=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((e=>{if(n.mediaGroups[e]&&n.mediaGroups[e][r])for(const t in n.mediaGroups[e])if(t===r){for(const r in n.mediaGroups[e][t])n.mediaGroups[e][t][r].playlists.forEach(((e,t)=>{const r=n.playlists[e.id],i=r.id,a=r.resolvedUri;delete n.playlists[i],delete n.playlists[a]}));delete n.mediaGroups[e][t]}})),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const n=this.main,r=n.playlists.length,i=this.createCloneURI_(t.resolvedUri,e),a=$s(e.ID,i),s=this.createCloneAttributes_(e.ID,t.attributes),o=this.createClonePlaylist_(t,a,e,s);n.playlists[r]=o,n.playlists[a]=o,n.playlists[i]=o,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,n=e["BASE-ID"],r=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((i=>{if(r.mediaGroups[i]&&!r.mediaGroups[i][t])for(const a in r.mediaGroups[i])if(a===n){r.mediaGroups[i][t]={};for(const n in r.mediaGroups[i][a]){const s=r.mediaGroups[i][a][n];r.mediaGroups[i][t][n]=(0,g.Z)({},s);const o=r.mediaGroups[i][t][n],l=this.createCloneURI_(s.resolvedUri,e);o.resolvedUri=l,o.uri=l,o.playlists=[],s.playlists.forEach(((a,s)=>{const l=r.playlists[a.id],u=Qs(i,t,n),c=$s(t,u);if(l&&!r.playlists[c]){const t=this.createClonePlaylist_(l,c,e),n=t.resolvedUri;r.playlists[c]=t,r.playlists[n]=t}o.playlists[s]=this.createClonePlaylist_(a,c,e)}))}}}))}createClonePlaylist_(e,t,n,r){const i=this.createCloneURI_(e.resolvedUri,n),a={resolvedUri:i,uri:i,id:t};return e.segments&&(a.segments=[]),r&&(a.attributes=r),Es(e,a)}createCloneURI_(e,t){const n=new URL(e);n.hostname=t["URI-REPLACEMENT"].HOST;const r=t["URI-REPLACEMENT"].PARAMS;for(const e of Object.keys(r))n.searchParams.set(e,r[e]);return n.href}createCloneAttributes_(e,t){const n={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((r=>{t[r]&&(n[r]=e)})),n}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const n in e.contentProtection){const r=e.contentProtection[n].attributes.keyId;r&&t.add(r.toLowerCase())}return t}}}const{xhr:fo}=hs,ho=function(e,t,n,r){const i="arraybuffer"===e.responseType?e.response:e.responseText;!t&&i&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=i.byteLength||i.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),n.headers&&(e.responseHeaders=n.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),t||e.aborted||200===n.statusCode||206===n.statusCode||0===n.statusCode||(t=new Error("XHR Failed with a response of: "+(e&&(i||e.responseText)))),r(t,e)},po=function(){const e=function e(t,n){t=Es({timeout:45e3},t);const r=e.beforeRequest||hs.Vhs.xhr.beforeRequest,i=e._requestCallbackSet||hs.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||hs.Vhs.xhr._responseCallbackSet;r&&"function"==typeof r&&(hs.log.warn("beforeRequest is deprecated, use onRequest instead."),i.add(r));const s=!0===hs.Vhs.xhr.original?fo:hs.Vhs.xhr,o=((e,t)=>{if(!e||!e.size)return;let n=t;return e.forEach((e=>{n=e(n)})),n})(i,t);i.delete(r);const l=s(o||t,(function(e,t){return((e,t,n,r)=>{e&&e.size&&e.forEach((e=>{e(t,n,r)}))})(a,l,e,t),ho(l,e,t,n)})),u=l.abort;return l.abort=function(){return l.aborted=!0,u.apply(l,arguments)},l.uri=t.uri,l.requestTime=Date.now(),l};return e.original=!0,e},go=function(e){const t={};return e.byterange&&(t.Range=function(e){let t;const n=e.offset;return t="bigint"==typeof e.offset||"bigint"==typeof e.length?i().BigInt(e.offset)+i().BigInt(e.length)-i().BigInt(1):e.offset+e.length-1,"bytes="+n+"-"+t}(e.byterange)),t},mo=function(e,t){return e.start(t)+"-"+e.end(t)},yo=function(e,t){const n=e.toString(16);return"00".substring(0,2-n.length)+n+(t%2?" ":"")},vo=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},_o=function(e){const t={};return Object.keys(e).forEach((n=>{const r=e[n];H(r)?t[n]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:t[n]=r})),t},To=function(e){const t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},Eo=function(e){return e.resolvedUri},bo=e=>{const t=Array.prototype.slice.call(e),n=16;let r,i,a="";for(let e=0;e<t.length/n;e++)r=t.slice(e*n,e*n+n).map(yo).join(""),i=t.slice(e*n,e*n+n).map(vo).join(""),a+=r+" "+i+"\n";return a};var So=Object.freeze({__proto__:null,createTransferableMessage:_o,initSegmentId:To,segmentKeyId:Eo,hexDump:bo,tagDump:({bytes:e})=>bo(e),textRanges:e=>{let t,n="";for(t=0;t<e.length;t++)n+=mo(e,t)+" ";return n}});const Ao=({programTime:e,playlist:t,retryCount:n=2,seekTo:r,pauseAfterSeek:i=!0,tech:a,callback:s})=>{if(!s)throw new Error("seekToProgramTime: callback must be provided");if(void 0===e||!t||!r)return s({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!t.endList&&!a.hasStarted_)return s({message:"player must be playing a live stream to start buffering"});if(!(e=>{if(!e.segments||0===e.segments.length)return!1;for(let t=0;t<e.segments.length;t++)if(!e.segments[t].dateTimeObject)return!1;return!0})(t))return s({message:"programDateTime tags must be provided in the manifest "+t.resolvedUri});const o=((e,t)=>{let n;try{n=new Date(e)}catch(e){return null}if(!t||!t.segments||0===t.segments.length)return null;let r=t.segments[0];if(n<new Date(r.dateTimeObject))return null;for(let e=0;e<t.segments.length-1&&(r=t.segments[e],!(n<new Date(t.segments[e+1].dateTimeObject)));e++);const i=t.segments[t.segments.length-1],a=i.dateTimeObject,s=i.videoTimingInfo?(o=i.videoTimingInfo).transmuxedPresentationEnd-o.transmuxedPresentationStart-o.transmuxerPrependedSeconds:i.duration+.25*i.duration;var o;return n>new Date(a.getTime()+1e3*s)?null:(n>new Date(a)&&(r=i),{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:Ws.duration(t,t.mediaSequence+t.segments.indexOf(r)),type:r.videoTimingInfo?"accurate":"estimate"})})(e,t);if(!o)return s({message:`${e} was not found in the stream`});const l=o.segment,u=((e,t)=>{let n,r;try{n=new Date(e),r=new Date(t)}catch(e){}const i=n.getTime();return(r.getTime()-i)/1e3})(l.dateTimeObject,e);if("estimate"===o.type)return 0===n?s({message:`${e} is not buffered yet. Try again`}):(r(o.estimatedStart+u),void a.one("seeked",(()=>{Ao({programTime:e,playlist:t,retryCount:n-1,seekTo:r,pauseAfterSeek:i,tech:a,callback:s})})));const c=l.start+u;a.one("seeked",(()=>s(null,a.currentTime()))),i&&a.pause(),r(c)},wo=(e,t)=>{if(4===e.readyState)return t()},{EventTarget:Io}=hs,Co=function(e,t){if(!oo(e,t))return!1;if(e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length))return!1;if(!e.sidx&&t.sidx||e.sidx&&!t.sidx)return!1;if(e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(let n=0;n<e.segments.length;n++){const r=e.segments[n],i=t.segments[n];if(r.uri!==i.uri)return!1;if(!r.byterange&&!i.byterange)continue;const a=r.byterange,s=i.byterange;if(a&&!s||!a&&s)return!1;if(a.offset!==s.offset||a.length!==s.length)return!1}return!0},Ro=(e,t,n,r)=>`placeholder-uri-${e}-${t}-${r.attributes.NAME||n}`,Do=(e,t)=>(Boolean(!e.map&&!t.map)||Boolean(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length))&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length,No=(e,t)=>{const n={};for(const r in e){const i=e[r].sidx;if(i){const e=de(i);if(!t[e])break;const r=t[e].sidxInfo;Do(r,i)&&(n[e]=t[e])}}return n};class Oo extends Io{constructor(e,t,n={},r){super(),this.mainPlaylistLoader_=r||this,r||(this.isMain_=!0);const{withCredentials:i=!1}=n;if(this.vhs_=t,this.withCredentials=i,this.addMetadataToTextTrack=n.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",(()=>{this.refreshXml_()})),this.on("mediaupdatetimeout",(()=>{this.refreshMedia_(this.media().id)})),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=Ts("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}requestErrored_(e,t,n){return!this.request||(this.request=null,e?(this.error="object"!=typeof e||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2}:e,n&&(this.state=n),this.trigger("error"),!0):void 0)}addSidxSegments_(e,t,n){const r=e.sidx&&de(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r])return void(this.mediaRequest_=i().setTimeout((()=>n(!1)),0));const a=_s(e.sidx.resolvedUri),s=(i,a)=>{if(this.requestErrored_(i,a,t))return;const s=this.mainPlaylistLoader_.sidxMapping_;let o;try{o=Ge()(G(a.response).subarray(8))}catch(e){return void this.requestErrored_(e,a,t)}return s[r]={sidxInfo:e.sidx,sidx:o},se(e,o,e.sidx.resolvedUri),n(!0)};this.request=((e,t,n)=>{let r,i=[],a=!1;const s=function(e,t,r,i){return t.abort(),a=!0,n(e,t,r,i)},o=function(e,t){if(a)return;if(e)return s(e,t,"",i);const n=t.responseText.substring(i&&i.byteLength||0,t.responseText.length);if(i=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if((t=t.filter((function(e){return e&&(e.byteLength||e.length)&&"string"!=typeof e}))).length<=1)return G(t[0]);var r=t.reduce((function(e,t,n){return e+(t.byteLength||t.length)}),0),i=new Uint8Array(r),a=0;return t.forEach((function(e){e=G(e),i.set(e,a),a+=e.byteLength})),i}(i,K(n,!0)),r=r||Ye(i),i.length<10||r&&i.length<r+2)return wo(t,(()=>s(e,t,"",i)));const o=ct(i);return"ts"===o&&i.length<188||!o&&i.length<376?wo(t,(()=>s(e,t,"",i))):s(null,t,o,i)},l={uri:e,beforeSend(e){e.overrideMimeType("text/plain; charset=x-user-defined"),e.addEventListener("progress",(function({total:t,loaded:n}){return ho(e,null,{statusCode:e.status},o)}))}},u=t(l,(function(e,t){return ho(u,e,t,o)}));return u})(a,this.vhs_.xhr,((t,n,r,i)=>{if(t)return s(t,n);if(!r||"mp4"!==r)return s({status:n.status,message:`Unsupported ${r||"unknown"} container type for sidx segment at URL: ${a}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},n);const{offset:o,length:l}=e.sidx.byterange;if(i.length>=l+o)return s(t,{response:i.subarray(o,o+l),status:n.status,uri:n.uri});this.request=this.vhs_.xhr({uri:a,responseType:"arraybuffer",headers:go({byterange:e.sidx.byterange})},s)}))}dispose(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},i().clearTimeout(this.minimumUpdatePeriodTimeout_),i().clearTimeout(this.mediaRequest_),i().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if("string"==typeof e){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const n=!this.media_||e.id!==this.media_.id;if(n&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(n&&(this.trigger("mediachanging"),this.trigger("mediachange")));n&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,(n=>{this.haveMetadata({startingState:t,playlist:e})})))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,this.mediaRequest_=null,this.refreshMedia_(t.id),"HAVE_MAIN_MANIFEST"===e?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),i().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(i().clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)}load(e){i().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const e=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=i().setTimeout((()=>this.load()),e)}else this.started?t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()}start(){this.started=!0,this.isMain_?this.requestMain_(((e,t)=>{this.haveMain_(),this.hasPendingRequest()||this.media_||this.media(this.mainPlaylistLoader_.main.playlists[0])})):this.mediaRequest_=i().setTimeout((()=>this.haveMain_()),0)}requestMain_(e){this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},((t,n)=>{if(this.requestErrored_(t,n))return void("HAVE_NOTHING"===this.state&&(this.started=!1));const r=n.responseText!==this.mainPlaylistLoader_.mainXml_;return this.mainPlaylistLoader_.mainXml_=n.responseText,n.responseHeaders&&n.responseHeaders.date?this.mainLoaded_=Date.parse(n.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=_s(this.mainPlaylistLoader_.srcUrl,n),r?(this.handleMain_(),void this.syncClientServerClock_((()=>e(n,r)))):e(n,r)}))}syncClientServerClock_(e){const t=(n=this.mainPlaylistLoader_.mainXml_,(e=>{const t=Re(e,"UTCTiming")[0];if(!t)return null;const n=Pe(t);switch(n.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":n.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":n.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":n.method="DIRECT",n.value=Date.parse(n.value);break;default:throw new Error("UNSUPPORTED_UTC_TIMING_SCHEME")}return n})(je(n)));var n;return null===t?(this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()):"DIRECT"===t.method?(this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:vs(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials},((n,r)=>{if(!this.request)return;if(n)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();let i;i="HEAD"===t.method?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):this.mainLoaded_:Date.parse(r.responseText),this.mainPlaylistLoader_.clientOffset_=i-Date.now(),e()})))}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main;let t=(({mainXml:e,srcUrl:t,clientOffset:n,sidxMapping:r,previousManifest:i})=>{const a=((e,t={})=>{const n=((e,t={})=>{const{manifestUri:n="",NOW:r=Date.now(),clientOffset:i=0,eventHandler:a=function(){}}=t,s=Re(e,"Period");if(!s.length)throw new Error("INVALID_NUMBER_OF_PERIOD");const o=Re(e,"Location"),l=Pe(e),u=xe([{baseUrl:n}],Re(e,"BaseURL")),c=Re(e,"ContentSteering");l.type=l.type||"static",l.sourceDuration=l.mediaPresentationDuration||0,l.NOW=r,l.clientOffset=i,o.length&&(l.locations=o.map(De));const d=[];return s.forEach(((e,t)=>{const n=Pe(e),r=d[t-1];n.start=(({attributes:e,priorPeriodAttributes:t,mpdType:n})=>"number"==typeof e.start?e.start:t&&"number"==typeof t.start&&"number"==typeof t.duration?t.start+t.duration:t||"static"!==n?null:0)({attributes:n,priorPeriodAttributes:r?r.attributes:null,mpdType:l.type}),d.push({node:e,attributes:n})})),{locations:l.locations,contentSteeringInfo:Be(c,a),representationInfo:J(d.map(Ue(l,u))),eventStream:J(d.map(ke))}})(je(e),t),r=n.representationInfo.map(Ce);return Te({dashPlaylists:r,locations:n.locations,contentSteering:n.contentSteeringInfo,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest,eventStream:n.eventStream})})(e,{manifestUri:t,clientOffset:n,sidxMapping:r,previousManifest:i});return to(a,t,Ro),a})({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e});e&&(t=((e,t,n)=>{let r=!0,i=Es(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts});for(let e=0;e<t.playlists.length;e++){const a=t.playlists[e];if(a.sidx){const e=de(a.sidx);n&&n[e]&&n[e].sidx&&se(a,n[e].sidx,a.sidx.resolvedUri)}const s=lo(i,a,Co);s&&(i=s,r=!1)}return Js(t,((e,t,n,a)=>{if(e.playlists&&e.playlists.length){const s=e.playlists[0].id,o=lo(i,e.playlists[0],Co);o&&(i=o,a in i.mediaGroups[t][n]||(i.mediaGroups[t][n][a]=e),i.mediaGroups[t][n][a].playlists[0]=i.playlists[s],r=!1)}})),((e,t)=>{Js(e,((n,r,i,a)=>{a in t.mediaGroups[r][i]||delete e.mediaGroups[r][i][a]}))})(i,t),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(r=!1),r?null:i})(e,t,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=t||e;const n=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];return n&&n!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=n),(!e||t&&t.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(t),Boolean(t)}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(i().clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;0===t&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),"number"!=typeof t||t<=0?t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`):this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=i().setTimeout((()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)}),e)}refreshXml_(){this.requestMain_(((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=((e,t)=>{let n=No(e.playlists,t);return Js(e,((e,r,i,a)=>{if(e.playlists&&e.playlists.length){const r=e.playlists;n=Es(n,No(r,t))}})),n})(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,(e=>{this.refreshMedia_(this.media().id)})))}))}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,n=!this.media_||this.media_!==t[e];if(n?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const e=()=>{this.media().endList||(this.mediaUpdateTimeout=i().setTimeout((()=>{this.trigger("mediaupdatetimeout"),e()}),uo(this.media(),Boolean(n))))};e()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const e=this.mainPlaylistLoader_.main.eventStream.map((e=>({cueTime:e.start,frames:[{data:e.messageData}]})));this.addMetadataToTextTrack("EventStream",e,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const n in e.contentProtection){const r=e.contentProtection[n].attributes["cenc:default_KID"];r&&t.add(r.replace(/-/g,"").toLowerCase())}return t}}}var Po={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const Mo=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},xo=function(e){return function(){const t=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch(t){const n=new BlobBuilder;return n.append(e),URL.createObjectURL(n.getBlob())}}(e),n=Mo(new Worker(t));n.objURL=t;const r=n.terminate;return n.on=n.addEventListener,n.off=n.removeEventListener,n.terminate=function(){return URL.revokeObjectURL(t),r.call(this)},n}},Lo=function(e){return`var browserWorkerPolyFill = ${Mo.toString()};\nbrowserWorkerPolyFill(self);\n`+e},ko=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)},Fo=Lo(ko((function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},t=function(){this.init=function(){var e={};this.on=function(t,n){e[t]||(e[t]=[]),e[t]=e[t].concat(n)},this.off=function(t,n){var r;return!!e[t]&&(r=e[t].indexOf(n),e[t]=e[t].slice(),e[t].splice(r,1),r>-1)},this.trigger=function(t){var n,r,i,a;if(n=e[t])if(2===arguments.length)for(i=n.length,r=0;r<i;++r)n[r].call(this,arguments[1]);else{for(a=[],r=arguments.length,r=1;r<arguments.length;++r)a.push(arguments[r]);for(i=n.length,r=0;r<i;++r)n[r].apply(this,a)}},this.dispose=function(){e={}}}};t.prototype.pipe=function(e){return this.on("data",(function(t){e.push(t)})),this.on("done",(function(t){e.flush(t)})),this.on("partialdone",(function(t){e.partialFlush(t)})),this.on("endedtimeline",(function(t){e.endTimeline(t)})),this.on("reset",(function(t){e.reset(t)})),e},t.prototype.push=function(e){this.trigger("data",e)},t.prototype.flush=function(e){this.trigger("done",e)},t.prototype.partialFlush=function(e){this.trigger("partialdone",e)},t.prototype.endTimeline=function(e){this.trigger("endedtimeline",e)},t.prototype.reset=function(e){this.trigger("reset",e)};var r,i,a,s,o,l,u,c,d,f,h,p,g,m,y,v,_,T,E,b,S,A,w,I,C,R,D,N,O,P,M,x,L,k,F,U,B,j,q,H,G=t,V=Math.pow(2,32),Y={getUint64:function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getBigUint64?(t=n.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(t):t:n.getUint32(0)*V+n.getUint32(4)},MAX_UINT32:V},Z=Y.MAX_UINT32;!function(){var e;if(A={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!=typeof Uint8Array){for(e in A)A.hasOwnProperty(e)&&(A[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);w=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),C=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),I=new Uint8Array([0,0,0,1]),R=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),D=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),N={video:R,audio:D},M=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),P=new Uint8Array([0,0,0,0,0,0,0,0]),x=new Uint8Array([0,0,0,0,0,0,0,0]),L=x,k=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),F=x,O=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),r=function(e){var t,n,r=[],i=0;for(t=1;t<arguments.length;t++)r.push(arguments[t]);for(t=r.length;t--;)i+=r[t].byteLength;for(n=new Uint8Array(i+8),new DataView(n.buffer,n.byteOffset,n.byteLength).setUint32(0,n.byteLength),n.set(e,4),t=0,i=8;t<r.length;t++)n.set(r[t],i),i+=r[t].byteLength;return n},i=function(){return r(A.dinf,r(A.dref,M))},a=function(e){return r(A.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,e.audioobjecttype<<3|e.samplingfrequencyindex>>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},y=function(e){return r(A.hdlr,N[e])},m=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(t[12]=e.samplerate>>>24&255,t[13]=e.samplerate>>>16&255,t[14]=e.samplerate>>>8&255,t[15]=255&e.samplerate),r(A.mdhd,t)},g=function(e){return r(A.mdia,m(e),y(e.type),l(e))},o=function(e){return r(A.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},l=function(e){return r(A.minf,"video"===e.type?r(A.vmhd,O):r(A.smhd,P),i(),_(e))},u=function(e,t){for(var n=[],i=t.length;i--;)n[i]=E(t[i]);return r.apply(null,[A.moof,o(e)].concat(n))},c=function(e){for(var t=e.length,n=[];t--;)n[t]=h(e[t]);return r.apply(null,[A.moov,f(4294967295)].concat(n).concat(d(e)))},d=function(e){for(var t=e.length,n=[];t--;)n[t]=b(e[t]);return r.apply(null,[A.mvex].concat(n))},f=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return r(A.mvhd,t)},v=function(e){var t,n,i=e.samples||[],a=new Uint8Array(4+i.length);for(n=0;n<i.length;n++)t=i[n].flags,a[n+4]=t.dependsOn<<4|t.isDependedOn<<2|t.hasRedundancy;return r(A.sdtp,a)},_=function(e){return r(A.stbl,T(e),r(A.stts,F),r(A.stsc,L),r(A.stsz,k),r(A.stco,x))},T=function(e){return r(A.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===e.type?U(e):B(e))},U=function(e){var t,n,i=e.sps||[],a=e.pps||[],s=[],o=[];for(t=0;t<i.length;t++)s.push((65280&i[t].byteLength)>>>8),s.push(255&i[t].byteLength),s=s.concat(Array.prototype.slice.call(i[t]));for(t=0;t<a.length;t++)o.push((65280&a[t].byteLength)>>>8),o.push(255&a[t].byteLength),o=o.concat(Array.prototype.slice.call(a[t]));if(n=[A.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),r(A.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([i.length],s,[a.length],o))),r(A.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var l=e.sarRatio[0],u=e.sarRatio[1];n.push(r(A.pasp,new Uint8Array([(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l,(4278190080&u)>>24,(16711680&u)>>16,(65280&u)>>8,255&u])))}return r.apply(null,n)},B=function(e){return r(A.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),a(e))},p=function(e){var t=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return r(A.tkhd,t)},E=function(e){var t,n,i,a,s,o;return t=r(A.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),s=Math.floor(e.baseMediaDecodeTime/Z),o=Math.floor(e.baseMediaDecodeTime%Z),n=r(A.tfdt,new Uint8Array([1,0,0,0,s>>>24&255,s>>>16&255,s>>>8&255,255&s,o>>>24&255,o>>>16&255,o>>>8&255,255&o])),"audio"===e.type?(i=S(e,92),r(A.traf,t,n,i)):(a=v(e),i=S(e,a.length+92),r(A.traf,t,n,i,a))},h=function(e){return e.duration=e.duration||4294967295,r(A.trak,p(e),g(e))},b=function(e){var t=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(t[t.length-1]=0),r(A.trex,t)},H=function(e,t){var n=0,r=0,i=0,a=0;return e.length&&(void 0!==e[0].duration&&(n=1),void 0!==e[0].size&&(r=2),void 0!==e[0].flags&&(i=4),void 0!==e[0].compositionTimeOffset&&(a=8)),[0,0,n|r|i|a,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},q=function(e,t){var n,i,a,s,o,l;for(t+=20+16*(s=e.samples||[]).length,a=H(s,t),(i=new Uint8Array(a.length+16*s.length)).set(a),n=a.length,l=0;l<s.length;l++)o=s[l],i[n++]=(4278190080&o.duration)>>>24,i[n++]=(16711680&o.duration)>>>16,i[n++]=(65280&o.duration)>>>8,i[n++]=255&o.duration,i[n++]=(4278190080&o.size)>>>24,i[n++]=(16711680&o.size)>>>16,i[n++]=(65280&o.size)>>>8,i[n++]=255&o.size,i[n++]=o.flags.isLeading<<2|o.flags.dependsOn,i[n++]=o.flags.isDependedOn<<6|o.flags.hasRedundancy<<4|o.flags.paddingValue<<1|o.flags.isNonSyncSample,i[n++]=61440&o.flags.degradationPriority,i[n++]=15&o.flags.degradationPriority,i[n++]=(4278190080&o.compositionTimeOffset)>>>24,i[n++]=(16711680&o.compositionTimeOffset)>>>16,i[n++]=(65280&o.compositionTimeOffset)>>>8,i[n++]=255&o.compositionTimeOffset;return r(A.trun,i)},j=function(e,t){var n,i,a,s,o,l;for(t+=20+8*(s=e.samples||[]).length,a=H(s,t),(n=new Uint8Array(a.length+8*s.length)).set(a),i=a.length,l=0;l<s.length;l++)o=s[l],n[i++]=(4278190080&o.duration)>>>24,n[i++]=(16711680&o.duration)>>>16,n[i++]=(65280&o.duration)>>>8,n[i++]=255&o.duration,n[i++]=(4278190080&o.size)>>>24,n[i++]=(16711680&o.size)>>>16,n[i++]=(65280&o.size)>>>8,n[i++]=255&o.size;return r(A.trun,n)},S=function(e,t){return"audio"===e.type?j(e,t):q(e,t)};var K,z,W,X,$,Q,J,ee,te={ftyp:s=function(){return r(A.ftyp,w,I,w,C)},mdat:function(e){return r(A.mdat,e)},moof:u,moov:c,initSegment:function(e){var t,n=s(),r=c(e);return(t=new Uint8Array(n.byteLength+r.byteLength)).set(n),t.set(r,n.byteLength),t}},ne=function(e,t){var n={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return n.dataOffset=t,n.compositionTimeOffset=e.pts-e.dts,n.duration=e.duration,n.size=4*e.length,n.size+=e.byteLength,e.keyFrame&&(n.flags.dependsOn=2,n.flags.isNonSyncSample=0),n},re={groupNalsIntoFrames:function(e){var t,n,r=[],i=[];for(i.byteLength=0,i.nalCount=0,i.duration=0,r.byteLength=0,t=0;t<e.length;t++)"access_unit_delimiter_rbsp"===(n=e[t]).nalUnitType?(r.length&&(r.duration=n.dts-r.dts,i.byteLength+=r.byteLength,i.nalCount+=r.length,i.duration+=r.duration,i.push(r)),(r=[n]).byteLength=n.data.byteLength,r.pts=n.pts,r.dts=n.dts):("slice_layer_without_partitioning_rbsp_idr"===n.nalUnitType&&(r.keyFrame=!0),r.duration=n.dts-r.dts,r.byteLength+=n.data.byteLength,r.push(n));return i.length&&(!r.duration||r.duration<=0)&&(r.duration=i[i.length-1].duration),i.byteLength+=r.byteLength,i.nalCount+=r.length,i.duration+=r.duration,i.push(r),i},groupFramesIntoGops:function(e){var t,n,r=[],i=[];for(r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,i.byteLength=0,i.nalCount=0,i.duration=0,i.pts=e[0].pts,i.dts=e[0].dts,t=0;t<e.length;t++)(n=e[t]).keyFrame?(r.length&&(i.push(r),i.byteLength+=r.byteLength,i.nalCount+=r.nalCount,i.duration+=r.duration),(r=[n]).nalCount=n.length,r.byteLength=n.byteLength,r.pts=n.pts,r.dts=n.dts,r.duration=n.duration):(r.duration+=n.duration,r.nalCount+=n.length,r.byteLength+=n.byteLength,r.push(n));return i.length&&r.duration<=0&&(r.duration=i[i.length-1].duration),i.byteLength+=r.byteLength,i.nalCount+=r.nalCount,i.duration+=r.duration,i.push(r),i},extendFirstKeyFrame:function(e){var t;return!e[0][0].keyFrame&&e.length>1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},generateSampleTable:function(e,t){var n,r,i,a,s,o=t||0,l=[];for(n=0;n<e.length;n++)for(a=e[n],r=0;r<a.length;r++)s=a[r],o+=(i=ne(s,o)).size,l.push(i);return l},concatenateNalData:function(e){var t,n,r,i,a,s,o=0,l=e.byteLength,u=e.nalCount,c=new Uint8Array(l+4*u),d=new DataView(c.buffer);for(t=0;t<e.length;t++)for(i=e[t],n=0;n<i.length;n++)for(a=i[n],r=0;r<a.length;r++)s=a[r],d.setUint32(o,s.data.byteLength),o+=4,c.set(s.data,o),o+=s.data.byteLength;return c},generateSampleTableForFrame:function(e,t){var n,r=[];return n=ne(e,t||0),r.push(n),r},concatenateNalDataForFrame:function(e){var t,n,r=0,i=e.byteLength,a=e.length,s=new Uint8Array(i+4*a),o=new DataView(s.buffer);for(t=0;t<e.length;t++)n=e[t],o.setUint32(r,n.data.byteLength),r+=4,s.set(n.data,r),r+=n.data.byteLength;return s}},ie=[33,16,5,32,164,27],ae=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],se=function(e){for(var t=[];e--;)t.push(0);return t},oe=9e4;Q=function(e,t){return z($(e,t))},J=function(e,t){return W(X(e),t)},ee=function(e,t,n){return X(n?e:e-t)};var le={ONE_SECOND_IN_TS:oe,secondsToVideoTs:z=function(e){return e*oe},secondsToAudioTs:W=function(e,t){return e*t},videoTsToSeconds:X=function(e){return e/oe},audioTsToSeconds:$=function(e,t){return e/t},audioTsToVideoTs:Q,videoTsToAudioTs:J,metadataTsToSeconds:ee},ue=le,ce={prefixWithSilence:function(e,t,n,r){var i,a,s,o,l,u=0,c=0,d=0;if(t.length&&(i=ue.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),a=Math.ceil(ue.ONE_SECOND_IN_TS/(e.samplerate/1024)),n&&r&&(u=i-Math.max(n,r),d=(c=Math.floor(u/a))*a),!(c<1||d>ue.ONE_SECOND_IN_TS/2))){for((s=function(){if(!K){var e={96e3:[ie,[227,64],se(154),[56]],88200:[ie,[231],se(170),[56]],64e3:[ie,[248,192],se(240),[56]],48e3:[ie,[255,192],se(268),[55,148,128],se(54),[112]],44100:[ie,[255,192],se(268),[55,163,128],se(84),[112]],32e3:[ie,[255,192],se(268),[55,234],se(226),[112]],24e3:[ie,[255,192],se(268),[55,255,128],se(268),[111,112],se(126),[224]],16e3:[ie,[255,192],se(268),[55,255,128],se(268),[111,255],se(269),[223,108],se(195),[1,192]],12e3:[ae,se(268),[3,127,248],se(268),[6,255,240],se(268),[13,255,224],se(268),[27,253,128],se(259),[56]],11025:[ae,se(268),[3,127,248],se(268),[6,255,240],se(268),[13,255,224],se(268),[27,255,192],se(268),[55,175,128],se(108),[112]],8e3:[ae,se(268),[3,121,16],se(47),[7]]};t=e,K=Object.keys(t).reduce((function(e,n){return e[n]=new Uint8Array(t[n].reduce((function(e,t){return e.concat(t)}),[])),e}),{})}var t;return K}()[e.samplerate])||(s=t[0].data),o=0;o<c;o++)l=t[0],t.splice(0,0,{data:s,dts:l.dts-a,pts:l.pts-a});return e.baseMediaDecodeTime-=Math.floor(ue.videoTsToAudioTs(d,e.samplerate)),d}},trimAdtsFramesByEarliestDts:function(e,t,n){return t.minSegmentDts>=n?e:(t.minSegmentDts=1/0,e.filter((function(e){return e.dts>=n&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)})))},generateSampleTable:function(e){var t,n,r=[];for(t=0;t<e.length;t++)n=e[t],r.push({size:n.data.byteLength,duration:1024});return r},concatenateFrameData:function(e){var t,n,r=0,i=new Uint8Array(function(e){var t,n=0;for(t=0;t<e.length;t++)n+=e[t].data.byteLength;return n}(e));for(t=0;t<e.length;t++)n=e[t],i.set(n.data,r),r+=n.data.byteLength;return i}},de=le.ONE_SECOND_IN_TS,fe={clearDtsInfo:function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},calculateTrackBaseMediaDecodeTime:function(e,t){var n,r=e.minSegmentDts;return t||(r-=e.timelineStartInfo.dts),n=e.timelineStartInfo.baseMediaDecodeTime,n+=r,n=Math.max(0,n),"audio"===e.type&&(n*=e.samplerate/de,n=Math.floor(n)),n},collectDtsInfo:function(e,t){"number"==typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),void 0===e.minSegmentPts?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),void 0===e.maxSegmentPts?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),"number"==typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),void 0===e.minSegmentDts?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),void 0===e.maxSegmentDts?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts))}},he={parseSei:function(e){for(var t=0,n={payloadType:-1,payloadSize:0},r=0,i=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)r+=255,t++;for(r+=e[t++];255===e[t];)i+=255,t++;if(i+=e[t++],!n.payload&&4===r){if("GA94"===String.fromCharCode(e[t+3],e[t+4],e[t+5],e[t+6])){n.payloadType=r,n.payloadSize=i,n.payload=e.subarray(t,t+i);break}n.payload=void 0}t+=i,r=0,i=0}return n},parseUserData:function(e){return 181!==e.payload[0]||49!=(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},parseCaptionPackets:function(e,t){var n,r,i,a,s=[];if(!(64&t[0]))return s;for(r=31&t[0],n=0;n<r;n++)a={type:3&t[2+(i=3*n)],pts:e},4&t[i+2]&&(a.ccData=t[i+3]<<8|t[i+4],s.push(a));return s},discardEmulationPreventionBytes:function(e){for(var t,n,r=e.byteLength,i=[],a=1;a<r-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(i.push(a+2),a+=2):a++;if(0===i.length)return e;t=r-i.length,n=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===i[0]&&(s++,i.shift()),n[a]=e[s];return n},USER_DATA_REGISTERED_ITU_T_T35:4},pe=G,ge=he,me=function(e){e=e||{},me.prototype.init.call(this),this.parse708captions_="boolean"!=typeof e.parse708captions||e.parse708captions,this.captionPackets_=[],this.ccStreams_=[new Ie(0,0),new Ie(0,1),new Ie(1,0),new Ie(1,1)],this.parse708captions_&&(this.cc708Stream_=new Ee({captionServices:e.captionServices})),this.reset(),this.ccStreams_.forEach((function(e){e.on("data",this.trigger.bind(this,"data")),e.on("partialdone",this.trigger.bind(this,"partialdone")),e.on("done",this.trigger.bind(this,"done"))}),this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};me.prototype=new pe,me.prototype.push=function(e){var t,n,r;if("sei_rbsp"===e.nalUnitType&&(t=ge.parseSei(e.escapedRBSP)).payload&&t.payloadType===ge.USER_DATA_REGISTERED_ITU_T_T35&&(n=ge.parseUserData(t)))if(e.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));r=ge.parseCaptionPackets(e.pts,n),this.captionPackets_=this.captionPackets_.concat(r),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},me.prototype.flushCCStreams=function(e){this.ccStreams_.forEach((function(t){return"flush"===e?t.flush():t.partialFlush()}),this)},me.prototype.flushStream=function(e){this.captionPackets_.length?(this.captionPackets_.forEach((function(e,t){e.presortIndex=t})),this.captionPackets_.sort((function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts})),this.captionPackets_.forEach((function(e){e.type<2?this.dispatchCea608Packet(e):this.dispatchCea708Packet(e)}),this),this.captionPackets_.length=0,this.flushCCStreams(e)):this.flushCCStreams(e)},me.prototype.flush=function(){return this.flushStream("flush")},me.prototype.partialFlush=function(){return this.flushStream("partialFlush")},me.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach((function(e){e.reset()}))},me.prototype.dispatchCea608Packet=function(e){this.setsTextOrXDSActive(e)?this.activeCea608Channel_[e.type]=null:this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},me.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},me.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)},me.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData)},me.prototype.dispatchCea708Packet=function(e){this.parse708captions_&&this.cc708Stream_.push(e)};var ye={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},ve=function(e){return 32<=e&&e<=127||160<=e&&e<=255},_e=function(e){this.windowNum=e,this.reset()};_e.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},_e.prototype.getText=function(){return this.rows.join("\n")},_e.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},_e.prototype.newLine=function(e){for(this.rows.length>=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},_e.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},_e.prototype.addText=function(e){this.rows[this.rowIdx]+=e},_e.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var Te=function(e,t,n){this.serviceNum=e,this.text="",this.currentWindow=new _e(-1),this.windows=[],this.stream=n,"string"==typeof t&&this.createTextDecoder(t)};Te.prototype.init=function(e,t){this.startPts=e;for(var n=0;n<8;n++)this.windows[n]=new _e(n),"function"==typeof t&&(this.windows[n].beforeRowOverflow=t)},Te.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]},Te.prototype.createTextDecoder=function(e){if("undefined"==typeof TextDecoder)this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(e)}catch(t){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+e+" encoding. "+t})}};var Ee=function(e){e=e||{},Ee.prototype.init.call(this);var t,n=this,r=e.captionServices||{},i={};Object.keys(r).forEach((e=>{t=r[e],/^SERVICE/.test(e)&&(i[e]=t.encoding)})),this.serviceEncodings=i,this.current708Packet=null,this.services={},this.push=function(e){3===e.type?(n.new708Packet(),n.add708Bytes(e)):(null===n.current708Packet&&n.new708Packet(),n.add708Bytes(e))}};Ee.prototype=new pe,Ee.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},Ee.prototype.add708Bytes=function(e){var t=e.ccData,n=t>>>8,r=255&t;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(n),this.current708Packet.data.push(r)},Ee.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,n=null,r=null,i=0,a=t[i++];for(e.seq=a>>6,e.sizeCode=63&a;i<t.length;i++)r=31&(a=t[i++]),7==(n=a>>5)&&r>0&&(n=a=t[i++]),this.pushServiceBlock(n,i,r),r>0&&(i+=r-1)},Ee.prototype.pushServiceBlock=function(e,t,n){var r,i=t,a=this.current708Packet.data,s=this.services[e];for(s||(s=this.initService(e,i));i<t+n&&i<a.length;i++)r=a[i],ve(r)?i=this.handleText(i,s):24===r?i=this.multiByteCharacter(i,s):16===r?i=this.extendedCommands(i,s):128<=r&&r<=135?i=this.setCurrentWindow(i,s):152<=r&&r<=159?i=this.defineWindow(i,s):136===r?i=this.clearWindows(i,s):140===r?i=this.deleteWindows(i,s):137===r?i=this.displayWindows(i,s):138===r?i=this.hideWindows(i,s):139===r?i=this.toggleWindows(i,s):151===r?i=this.setWindowAttributes(i,s):144===r?i=this.setPenAttributes(i,s):145===r?i=this.setPenColor(i,s):146===r?i=this.setPenLocation(i,s):143===r?s=this.reset(i,s):8===r?s.currentWindow.backspace():12===r?s.currentWindow.clearText():13===r?s.currentWindow.pendingNewLine=!0:14===r?s.currentWindow.clearText():141===r&&i++},Ee.prototype.extendedCommands=function(e,t){var n=this.current708Packet.data[++e];return ve(n)&&(e=this.handleText(e,t,{isExtended:!0})),e},Ee.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)]},Ee.prototype.initService=function(e,t){var n,r,i=this;return(n="SERVICE"+e)in this.serviceEncodings&&(r=this.serviceEncodings[n]),this.services[e]=new Te(e,r,i),this.services[e].init(this.getPts(t),(function(t){i.flushDisplayed(t,i.services[e])})),this.services[e]},Ee.prototype.handleText=function(e,t,n){var r,i,a,s,o=n&&n.isExtended,l=n&&n.isMultiByte,u=this.current708Packet.data,c=o?4096:0,d=u[e],f=u[e+1],h=t.currentWindow;if(l?(i=[d,f],e++):i=[d],t.textDecoder_&&!o)r=t.textDecoder_.decode(new Uint8Array(i));else if(l){const e=i.map((e=>("0"+(255&e).toString(16)).slice(-2))).join("");r=String.fromCharCode(parseInt(e,16))}else s=ye[a=c|d]||a,r=4096&a&&a===s?"":String.fromCharCode(s);return h.pendingNewLine&&!h.isEmpty()&&h.newLine(this.getPts(e)),h.pendingNewLine=!1,h.addText(r),e},Ee.prototype.multiByteCharacter=function(e,t){var n=this.current708Packet.data,r=n[e+1],i=n[e+2];return ve(r)&&ve(i)&&(e=this.handleText(++e,t,{isMultiByte:!0})),e},Ee.prototype.setCurrentWindow=function(e,t){var n=7&this.current708Packet.data[e];return t.setCurrentWindow(n),e},Ee.prototype.defineWindow=function(e,t){var n=this.current708Packet.data,r=n[e],i=7&r;t.setCurrentWindow(i);var a=t.currentWindow;return r=n[++e],a.visible=(32&r)>>5,a.rowLock=(16&r)>>4,a.columnLock=(8&r)>>3,a.priority=7&r,r=n[++e],a.relativePositioning=(128&r)>>7,a.anchorVertical=127&r,r=n[++e],a.anchorHorizontal=r,r=n[++e],a.anchorPoint=(240&r)>>4,a.rowCount=15&r,r=n[++e],a.columnCount=63&r,r=n[++e],a.windowStyle=(56&r)>>3,a.penStyle=7&r,a.virtualRowCount=a.rowCount+1,e},Ee.prototype.setWindowAttributes=function(e,t){var n=this.current708Packet.data,r=n[e],i=t.currentWindow.winAttr;return r=n[++e],i.fillOpacity=(192&r)>>6,i.fillRed=(48&r)>>4,i.fillGreen=(12&r)>>2,i.fillBlue=3&r,r=n[++e],i.borderType=(192&r)>>6,i.borderRed=(48&r)>>4,i.borderGreen=(12&r)>>2,i.borderBlue=3&r,r=n[++e],i.borderType+=(128&r)>>5,i.wordWrap=(64&r)>>6,i.printDirection=(48&r)>>4,i.scrollDirection=(12&r)>>2,i.justify=3&r,r=n[++e],i.effectSpeed=(240&r)>>4,i.effectDirection=(12&r)>>2,i.displayEffect=3&r,e},Ee.prototype.flushDisplayed=function(e,t){for(var n=[],r=0;r<8;r++)t.windows[r].visible&&!t.windows[r].isEmpty()&&n.push(t.windows[r].getText());t.endPts=e,t.text=n.join("\n\n"),this.pushCaption(t),t.startPts=e},Ee.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts)},Ee.prototype.displayWindows=function(e,t){var n=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var i=0;i<8;i++)n&1<<i&&(t.windows[i].visible=1);return e},Ee.prototype.hideWindows=function(e,t){var n=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var i=0;i<8;i++)n&1<<i&&(t.windows[i].visible=0);return e},Ee.prototype.toggleWindows=function(e,t){var n=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var i=0;i<8;i++)n&1<<i&&(t.windows[i].visible^=1);return e},Ee.prototype.clearWindows=function(e,t){var n=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var i=0;i<8;i++)n&1<<i&&t.windows[i].clearText();return e},Ee.prototype.deleteWindows=function(e,t){var n=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var i=0;i<8;i++)n&1<<i&&t.windows[i].reset();return e},Ee.prototype.setPenAttributes=function(e,t){var n=this.current708Packet.data,r=n[e],i=t.currentWindow.penAttr;return r=n[++e],i.textTag=(240&r)>>4,i.offset=(12&r)>>2,i.penSize=3&r,r=n[++e],i.italics=(128&r)>>7,i.underline=(64&r)>>6,i.edgeType=(56&r)>>3,i.fontStyle=7&r,e},Ee.prototype.setPenColor=function(e,t){var n=this.current708Packet.data,r=n[e],i=t.currentWindow.penColor;return r=n[++e],i.fgOpacity=(192&r)>>6,i.fgRed=(48&r)>>4,i.fgGreen=(12&r)>>2,i.fgBlue=3&r,r=n[++e],i.bgOpacity=(192&r)>>6,i.bgRed=(48&r)>>4,i.bgGreen=(12&r)>>2,i.bgBlue=3&r,r=n[++e],i.edgeRed=(48&r)>>4,i.edgeGreen=(12&r)>>2,i.edgeBlue=3&r,e},Ee.prototype.setPenLocation=function(e,t){var n=this.current708Packet.data,r=n[e],i=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,r=n[++e],i.row=15&r,r=n[++e],i.column=63&r,e},Ee.prototype.reset=function(e,t){var n=this.getPts(e);return this.flushDisplayed(n,t),this.initService(t.serviceNum,e)};var be={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Se=function(e){return null===e?"":(e=be[e]||e,String.fromCharCode(e))},Ae=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],we=function(){for(var e=[],t=15;t--;)e.push({text:"",indent:0,offset:0});return e},Ie=function(e,t){Ie.prototype.init.call(this),this.field_=e||0,this.dataChannel_=t||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,n,r,i,a;if((t=32639&e.ccData)!==this.lastControlCode_){if(4096==(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),r=t>>>8,i=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),n=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=n,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=we();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=we();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=we()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(r,i))a=Se((r=(3&r)<<8)|i),this[this.mode_](e.pts,a),this.column_++;else if(this.isExtCharacter(r,i))"popOn"===this.mode_?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),a=Se((r=(3&r)<<8)|i),this[this.mode_](e.pts,a),this.column_++;else if(this.isMidRowCode(r,i))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14==(14&i)&&this.addFormatting(e.pts,["i"]),1==(1&i)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(r,i)){const e=3&i;this.nonDisplayed_[this.row_].offset=e,this.column_+=e}else if(this.isPAC(r,i)){var s=Ae.indexOf(7968&t);if("rollUp"===this.mode_&&(s-this.rollUpRows_+1<0&&(s=this.rollUpRows_-1),this.setRollUp(e.pts,s)),s!==this.row_&&(this.clearFormatting(e.pts),this.row_=s),1&i&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16==(16&t)){const e=(14&t)>>1;this.column_=4*e,this.nonDisplayed_[this.row_].indent+=e}this.isColorPAC(i)&&14==(14&i)&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(r)&&(0===i&&(i=null),a=Se(r),a+=Se(i),this[this.mode_](e.pts,a),this.column_+=a.length)}else this.lastControlCode_=null}};Ie.prototype=new pe,Ie.prototype.flushDisplayed=function(e){const t=e=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+e+"."})},n=[];this.displayed_.forEach(((e,r)=>{if(e&&e.text&&e.text.length){try{e.text=e.text.trim()}catch(e){t(r)}e.text.length&&n.push({text:e.text,line:r+1,position:10+Math.min(70,10*e.indent)+2.5*e.offset})}else null==e&&t(r)})),n.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,content:n,stream:this.name_})},Ie.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=we(),this.nonDisplayed_=we(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},Ie.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},Ie.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},Ie.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},Ie.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},Ie.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},Ie.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},Ie.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},Ie.prototype.isNormalChar=function(e){return e>=32&&e<=127},Ie.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=we(),this.displayed_=we()),void 0!==t&&t!==this.row_)for(var n=0;n<this.rollUpRows_;n++)this.displayed_[t-n]=this.displayed_[this.row_-n],this.displayed_[this.row_-n]={text:"",indent:0,offset:0};void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},Ie.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var n=t.reduce((function(e,t){return e+"<"+t+">"}),"");this[this.mode_](e,n)},Ie.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce((function(e,t){return e+"</"+t+">"}),"");this.formatting_=[],this[this.mode_](e,t)}},Ie.prototype.popOn=function(e,t){var n=this.nonDisplayed_[this.row_].text;n+=t,this.nonDisplayed_[this.row_].text=n},Ie.prototype.rollUp=function(e,t){var n=this.displayed_[this.row_].text;n+=t,this.displayed_[this.row_].text=n},Ie.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++)this.displayed_[e]={text:"",indent:0,offset:0};for(e=this.row_+1;e<15;e++)this.displayed_[e]={text:"",indent:0,offset:0};for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]={text:"",indent:0,offset:0}},Ie.prototype.paintOn=function(e,t){var n=this.displayed_[this.row_].text;n+=t,this.displayed_[this.row_].text=n};var Ce={CaptionStream:me,Cea608Stream:Ie,Cea708Stream:Ee},Re={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},De=G,Ne="shared",Oe=function(e,t){var n=1;for(e>t&&(n=-1);Math.abs(t-e)>4294967296;)e+=8589934592*n;return e},Pe=function(e){var t,n;Pe.prototype.init.call(this),this.type_=e||Ne,this.push=function(e){"metadata"!==e.type?this.type_!==Ne&&e.type!==this.type_||(void 0===n&&(n=e.dts),e.dts=Oe(e.dts,n),e.pts=Oe(e.pts,n),t=e.dts,this.trigger("data",e)):this.trigger("data",e)},this.flush=function(){n=t,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){n=void 0,t=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Pe.prototype=new De;var Me,xe={TimestampRolloverStream:Pe,handleRollover:Oe},Le=(e,t,n)=>{if(!e)return-1;for(var r=n;r<e.length;r++)if(e[r]===t)return r;return-1},ke=function(e,t,n){var r,i="";for(r=t;r<n;r++)i+="%"+("00"+e[r].toString(16)).slice(-2);return i},Fe=function(e,t,n){return decodeURIComponent(ke(e,t,n))},Ue=function(e,t,n){return unescape(ke(e,t,n))},Be=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},je={APIC:function(e){var t,n,r=1;3===e.data[0]&&((t=Le(e.data,0,r))<0||(e.mimeType=Ue(e.data,r,t),r=t+1,e.pictureType=e.data[r],r++,(n=Le(e.data,0,r))<0||(e.description=Fe(e.data,r,n),r=n+1,"--\x3e"===e.mimeType?e.url=Ue(e.data,r,e.data.length):e.pictureData=e.data.subarray(r,e.data.length))))},"T*":function(e){3===e.data[0]&&(e.value=Fe(e.data,1,e.data.length).replace(/\0*$/,""),e.values=e.value.split("\0"))},TXXX:function(e){var t;3===e.data[0]&&-1!==(t=Le(e.data,0,1))&&(e.description=Fe(e.data,1,t),e.value=Fe(e.data,t+1,e.data.length).replace(/\0*$/,""),e.data=e.value)},"W*":function(e){e.url=Ue(e.data,0,e.data.length).replace(/\0.*$/,"")},WXXX:function(e){var t;3===e.data[0]&&-1!==(t=Le(e.data,0,1))&&(e.description=Fe(e.data,1,t),e.url=Ue(e.data,t+1,e.data.length).replace(/\0.*$/,""))},PRIV:function(e){var t;for(t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=Ue(e.data,0,t);break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}},qe={parseId3Frames:function(e){var t,n=10,r=0,i=[];if(!(e.length<10||e[0]!=="I".charCodeAt(0)||e[1]!=="D".charCodeAt(0)||e[2]!=="3".charCodeAt(0))){r=Be(e.subarray(6,10)),r+=10,64&e[5]&&(n+=4,n+=Be(e.subarray(10,14)),r-=Be(e.subarray(16,20)));do{if((t=Be(e.subarray(n+4,n+8)))<1)break;var a={id:String.fromCharCode(e[n],e[n+1],e[n+2],e[n+3]),data:e.subarray(n+10,n+t+10)};a.key=a.id,je[a.id]?je[a.id](a):"T"===a.id[0]?je["T*"](a):"W"===a.id[0]&&je["W*"](a),i.push(a),n+=10,n+=t}while(n<r);return i}},parseSyncSafeInteger:Be,frameParsers:je},He=Re,Ge=qe;(Me=function(e){var t,n={descriptor:e&&e.descriptor},r=0,i=[],a=0;if(Me.prototype.init.call(this),this.dispatchType=He.METADATA_STREAM_TYPE.toString(16),n.descriptor)for(t=0;t<n.descriptor.length;t++)this.dispatchType+=("00"+n.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,n,s,o,l;if("timed-metadata"===e.type)if(e.dataAlignmentIndicator&&(a=0,i.length=0),0===i.length&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});else if(i.push(e),a+=e.data.byteLength,1===i.length&&(r=Ge.parseSyncSafeInteger(e.data.subarray(6,10)),r+=10),!(a<r)){for(t={data:new Uint8Array(r),frames:[],pts:i[0].pts,dts:i[0].dts},l=0;l<r;)t.data.set(i[0].data.subarray(0,r-l),l),l+=i[0].data.byteLength,a-=i[0].data.byteLength,i.shift();n=10,64&t.data[5]&&(n+=4,n+=Ge.parseSyncSafeInteger(t.data.subarray(10,14)),r-=Ge.parseSyncSafeInteger(t.data.subarray(16,20)));do{if((s=Ge.parseSyncSafeInteger(t.data.subarray(n+4,n+8)))<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if((o={id:String.fromCharCode(t.data[n],t.data[n+1],t.data[n+2],t.data[n+3]),data:t.data.subarray(n+10,n+s+10)}).key=o.id,Ge.frameParsers[o.id]?Ge.frameParsers[o.id](o):"T"===o.id[0]?Ge.frameParsers["T*"](o):"W"===o.id[0]&&Ge.frameParsers["W*"](o),"com.apple.streaming.transportStreamTimestamp"===o.owner){var u=o.data,c=(1&u[3])<<30|u[4]<<22|u[5]<<14|u[6]<<6|u[7]>>>2;c*=4,c+=3&u[7],o.timeStamp=c,void 0===t.pts&&void 0===t.dts&&(t.pts=o.timeStamp,t.dts=o.timeStamp),this.trigger("timestamp",o)}t.frames.push(o),n+=10,n+=s}while(n<r);this.trigger("data",t)}}}).prototype=new G;var Ve,Ye,Ze,Ke=Me,ze=G,We=Ce,Xe=Re,$e=xe.TimestampRolloverStream,Qe=188;(Ve=function(){var e=new Uint8Array(Qe),t=0;Ve.prototype.init.call(this),this.push=function(n){var r,i=0,a=Qe;for(t?((r=new Uint8Array(n.byteLength+t)).set(e.subarray(0,t)),r.set(n,t),t=0):r=n;a<r.byteLength;)71!==r[i]||71!==r[a]?(i++,a++):(this.trigger("data",r.subarray(i,a)),i+=Qe,a+=Qe);i<r.byteLength&&(e.set(r.subarray(i),0),t=r.byteLength-i)},this.flush=function(){t===Qe&&71===e[0]&&(this.trigger("data",e),t=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){t=0,this.trigger("reset")}}).prototype=new ze,(Ye=function(){var e,t,n,r;Ye.prototype.init.call(this),r=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,r){var i=0;r.payloadUnitStartIndicator&&(i+=e[i]+1),"pat"===r.type?t(e.subarray(i),r):n(e.subarray(i),r)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],r.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=r.pmtPid},n=function(e,t){var n,i;if(1&e[5]){for(r.programMapTable={video:null,audio:null,"timed-metadata":{}},n=3+((15&e[1])<<8|e[2])-4,i=12+((15&e[10])<<8|e[11]);i<n;){var a=e[i],s=(31&e[i+1])<<8|e[i+2];a===Xe.H264_STREAM_TYPE&&null===r.programMapTable.video?r.programMapTable.video=s:a===Xe.ADTS_STREAM_TYPE&&null===r.programMapTable.audio?r.programMapTable.audio=s:a===Xe.METADATA_STREAM_TYPE&&(r.programMapTable["timed-metadata"][s]=a),i+=5+((15&e[i+3])<<8|e[i+4])}t.programMapTable=r.programMapTable}},this.push=function(t){var n={},r=4;if(n.payloadUnitStartIndicator=!!(64&t[1]),n.pid=31&t[1],n.pid<<=8,n.pid|=t[2],(48&t[3])>>>4>1&&(r+=t[r]+1),0===n.pid)n.type="pat",e(t.subarray(r),n),this.trigger("data",n);else if(n.pid===this.pmtPid)for(n.type="pmt",e(t.subarray(r),n),this.trigger("data",n);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,r,n]):this.processPes_(t,r,n)},this.processPes_=function(e,t,n){n.pid===this.programMapTable.video?n.streamType=Xe.H264_STREAM_TYPE:n.pid===this.programMapTable.audio?n.streamType=Xe.ADTS_STREAM_TYPE:n.streamType=this.programMapTable["timed-metadata"][n.pid],n.type="pes",n.data=e.subarray(t),this.trigger("data",n)}}).prototype=new ze,Ye.STREAM_TYPES={h264:27,adts:15},Ze=function(){var e,t=this,n=!1,r={data:[],size:0},i={data:[],size:0},a={data:[],size:0},s=function(e,n,r){var i,a,s=new Uint8Array(e.size),o={type:n},l=0,u=0;if(e.data.length&&!(e.size<9)){for(o.trackId=e.data[0].pid,l=0;l<e.data.length;l++)a=e.data[l],s.set(a.data,u),u+=a.data.byteLength;!function(e,t){var n;const r=e[0]<<16|e[1]<<8|e[2];t.data=new Uint8Array,1===r&&(t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=0!=(4&e[6]),192&(n=e[7])&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&n&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1)),t.data=e.subarray(9+e[8]))}(s,o),i="video"===n||o.packetLength<=e.size,(r||i)&&(e.size=0,e.data.length=0),i&&t.trigger("data",o)}};Ze.prototype.init.call(this),this.push=function(o){({pat:function(){},pes:function(){var e,t;switch(o.streamType){case Xe.H264_STREAM_TYPE:e=r,t="video";break;case Xe.ADTS_STREAM_TYPE:e=i,t="audio";break;case Xe.METADATA_STREAM_TYPE:e=a,t="timed-metadata";break;default:return}o.payloadUnitStartIndicator&&s(e,t,!0),e.data.push(o),e.size+=o.data.byteLength},pmt:function(){var r={type:"metadata",tracks:[]};null!==(e=o.programMapTable).video&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),n=!0,t.trigger("data",r)}})[o.type]()},this.reset=function(){r.size=0,r.data.length=0,i.size=0,i.data.length=0,this.trigger("reset")},this.flushStreams_=function(){s(r,"video"),s(i,"audio"),s(a,"timed-metadata")},this.flush=function(){if(!n&&e){var r={type:"metadata",tracks:[]};null!==e.video&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),t.trigger("data",r)}n=!1,this.flushStreams_(),this.trigger("done")}},Ze.prototype=new ze;var Je={PAT_PID:0,MP2T_PACKET_LENGTH:Qe,TransportPacketStream:Ve,TransportParseStream:Ye,ElementaryStream:Ze,TimestampRolloverStream:$e,CaptionStream:We.CaptionStream,Cea608Stream:We.Cea608Stream,Cea708Stream:We.Cea708Stream,MetadataStream:Ke};for(var et in Xe)Xe.hasOwnProperty(et)&&(Je[et]=Xe[et]);var tt,nt=Je,rt=le.ONE_SECOND_IN_TS,it=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];(tt=function(e){var t,n=0;tt.prototype.init.call(this),this.skipWarn_=function(e,t){this.trigger("log",{level:"warn",message:`adts skiping bytes ${e} to ${t} in frame ${n} outside syncword`})},this.push=function(r){var i,a,s,o,l,u=0;if(e||(n=0),"audio"===r.type){var c;for(t&&t.length?(s=t,(t=new Uint8Array(s.byteLength+r.data.byteLength)).set(s),t.set(r.data,s.byteLength)):t=r.data;u+7<t.length;)if(255===t[u]&&240==(246&t[u+1])){if("number"==typeof c&&(this.skipWarn_(c,u),c=null),a=2*(1&~t[u+1]),i=(3&t[u+3])<<11|t[u+4]<<3|(224&t[u+5])>>5,l=(o=1024*(1+(3&t[u+6])))*rt/it[(60&t[u+2])>>>2],t.byteLength-u<i)break;this.trigger("data",{pts:r.pts+n*l,dts:r.dts+n*l,sampleCount:o,audioobjecttype:1+(t[u+2]>>>6&3),channelcount:(1&t[u+2])<<2|(192&t[u+3])>>>6,samplerate:it[(60&t[u+2])>>>2],samplingfrequencyindex:(60&t[u+2])>>>2,samplesize:16,data:t.subarray(u+7+a,u+i)}),n++,u+=i}else"number"!=typeof c&&(c=u),u++;"number"==typeof c&&(this.skipWarn_(c,u),c=null),t=t.subarray(u)}},this.flush=function(){n=0,this.trigger("done")},this.reset=function(){t=void 0,this.trigger("reset")},this.endTimeline=function(){t=void 0,this.trigger("endedtimeline")}}).prototype=new G;var at,st,ot,lt=tt,ut=G,ct=function(e){var t=e.byteLength,n=0,r=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+r},this.loadWord=function(){var i=e.byteLength-t,a=new Uint8Array(4),s=Math.min(4,t);if(0===s)throw new Error("no bytes available");a.set(e.subarray(i,i+s)),n=new DataView(a.buffer).getUint32(0),r=8*s,t-=s},this.skipBits=function(e){var i;r>e?(n<<=e,r-=e):(e-=r,e-=8*(i=Math.floor(e/8)),t-=i,this.loadWord(),n<<=e,r-=e)},this.readBits=function(e){var i=Math.min(r,e),a=n>>>32-i;return(r-=i)>0?n<<=i:t>0&&this.loadWord(),(i=e-i)>0?a<<i|this.readBits(i):a},this.skipLeadingZeros=function(){var e;for(e=0;e<r;++e)if(0!=(n&2147483648>>>e))return n<<=e,r-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};(st=function(){var e,t,n=0;st.prototype.init.call(this),this.push=function(r){var i;t?((i=new Uint8Array(t.byteLength+r.data.byteLength)).set(t),i.set(r.data,t.byteLength),t=i):t=r.data;for(var a=t.byteLength;n<a-3;n++)if(1===t[n+2]){e=n+5;break}for(;e<a;)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}n+3!==e-2&&this.trigger("data",t.subarray(n+3,e-2));do{e++}while(1!==t[e]&&e<a);n=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(n+3,e-2)),n=e-2,e+=3;break;default:e+=3}t=t.subarray(n),e-=n,n=0},this.reset=function(){t=null,n=0,this.trigger("reset")},this.flush=function(){t&&t.byteLength>3&&this.trigger("data",t.subarray(n+3)),t=null,n=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}}).prototype=new ut,ot={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},at=function(){var e,t,n,r,i,a,s,o=new st;at.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,n=e.pts,r=e.dts,o.push(e))},o.on("data",(function(s){var o={trackId:t,pts:n,dts:r,data:s,nalUnitTypeCode:31&s[0]};switch(o.nalUnitTypeCode){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=i(s.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=i(s.subarray(1)),o.config=a(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",o)})),o.on("done",(function(){e.trigger("done")})),o.on("partialdone",(function(){e.trigger("partialdone")})),o.on("reset",(function(){e.trigger("reset")})),o.on("endedtimeline",(function(){e.trigger("endedtimeline")})),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},s=function(e,t){var n,r=8,i=8;for(n=0;n<e;n++)0!==i&&(i=(r+t.readExpGolomb()+256)%256),r=0===i?r:i},i=function(e){for(var t,n,r=e.byteLength,i=[],a=1;a<r-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(i.push(a+2),a+=2):a++;if(0===i.length)return e;t=r-i.length,n=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===i[0]&&(s++,i.shift()),n[a]=e[s];return n},a=function(e){var t,n,r,i,a,o,l,u,c,d,f,h,p=0,g=0,m=0,y=0,v=[1,1];if(n=(t=new ct(e)).readUnsignedByte(),i=t.readUnsignedByte(),r=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),ot[n]&&(3===(a=t.readUnsignedExpGolomb())&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(f=3!==a?8:12,h=0;h<f;h++)t.readBoolean()&&s(h<6?16:64,t);if(t.skipUnsignedExpGolomb(),0===(o=t.readUnsignedExpGolomb()))t.readUnsignedExpGolomb();else if(1===o)for(t.skipBits(1),t.skipExpGolomb(),t.skipExpGolomb(),l=t.readUnsignedExpGolomb(),h=0;h<l;h++)t.skipExpGolomb();if(t.skipUnsignedExpGolomb(),t.skipBits(1),u=t.readUnsignedExpGolomb(),c=t.readUnsignedExpGolomb(),0===(d=t.readBits(1))&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(p=t.readUnsignedExpGolomb(),g=t.readUnsignedExpGolomb(),m=t.readUnsignedExpGolomb(),y=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(t.readUnsignedByte()){case 1:v=[1,1];break;case 2:v=[12,11];break;case 3:v=[10,11];break;case 4:v=[16,11];break;case 5:v=[40,33];break;case 6:v=[24,11];break;case 7:v=[20,11];break;case 8:v=[32,11];break;case 9:v=[80,33];break;case 10:v=[18,11];break;case 11:v=[15,11];break;case 12:v=[64,33];break;case 13:v=[160,99];break;case 14:v=[4,3];break;case 15:v=[3,2];break;case 16:v=[2,1];break;case 255:v=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()]}v&&(v[0],v[1])}return{profileIdc:n,levelIdc:r,profileCompatibility:i,width:16*(u+1)-2*p-2*g,height:(2-d)*(c+1)*16-2*m-2*y,sarRatio:v}}},at.prototype=new ut;var dt,ft={H264Stream:at,NalByteStream:st},ht=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],pt=function(e,t){var n=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return n=n>=0?n:0,(16&e[t+5])>>4?n+20:n+10},gt=function(e,t){return e.length-t<10||e[t]!=="I".charCodeAt(0)||e[t+1]!=="D".charCodeAt(0)||e[t+2]!=="3".charCodeAt(0)?t:(t+=pt(e,t),gt(e,t))},mt=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},yt={isLikelyAacData:function(e){var t=gt(e,0);return e.length>=t+2&&255==(255&e[t])&&240==(240&e[t+1])&&16==(22&e[t+1])},parseId3TagSize:pt,parseAdtsSize:function(e,t){var n=(224&e[t+5])>>5,r=e[t+4]<<3;return 6144&e[t+3]|r|n},parseType:function(e,t){return e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&240==(240&e[t+1])?"audio":null},parseSampleRate:function(e){for(var t=0;t+5<e.length;){if(255===e[t]&&240==(246&e[t+1]))return ht[(60&e[t+2])>>>2];t++}return null},parseAacTimestamp:function(e){var t,n,r;t=10,64&e[5]&&(t+=4,t+=mt(e.subarray(10,14)));do{if((n=mt(e.subarray(t+4,t+8)))<1)return null;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){r=e.subarray(t+10,t+n+10);for(var i=0;i<r.byteLength;i++)if(0===r[i]){var a=unescape(function(e,t,n){var r,i="";for(r=0;r<n;r++)i+="%"+("00"+e[r].toString(16)).slice(-2);return i}(r,0,i));if("com.apple.streaming.transportStreamTimestamp"===a){var s=r.subarray(i+1),o=(1&s[3])<<30|s[4]<<22|s[5]<<14|s[6]<<6|s[7]>>>2;return(o*=4)+(3&s[7])}break}}t+=10,t+=n}while(t<e.byteLength);return null}},vt=yt;(dt=function(){var e=new Uint8Array,t=0;dt.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(n){var r,i,a,s,o=0,l=0;for(e.length?(s=e.length,(e=new Uint8Array(n.byteLength+s)).set(e.subarray(0,s)),e.set(n,s)):e=n;e.length-l>=3;)if(e[l]!=="I".charCodeAt(0)||e[l+1]!=="D".charCodeAt(0)||e[l+2]!=="3".charCodeAt(0))if(255!=(255&e[l])||240!=(240&e[l+1]))l++;else{if(e.length-l<7)break;if(l+(o=vt.parseAdtsSize(e,l))>e.length)break;a={type:"audio",data:e.subarray(l,l+o),pts:t,dts:t},this.trigger("data",a),l+=o}else{if(e.length-l<10)break;if(l+(o=vt.parseId3TagSize(e,l))>e.length)break;i={type:"timed-metadata",data:e.subarray(l,l+o)},this.trigger("data",i),l+=o}r=e.length-l,e=r>0?e.subarray(l):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){e=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new G;var _t,Tt,Et,bt,St=G,At=te,wt=re,It=ce,Ct=fe,Rt=nt,Dt=le,Nt=lt,Ot=ft.H264Stream,Pt=dt,Mt=yt.isLikelyAacData,xt=le.ONE_SECOND_IN_TS,Lt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],kt=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Ft=function(e,t){t.stream=e,this.trigger("log",t)},Ut=function(e,t){for(var n=Object.keys(t),r=0;r<n.length;r++){var i=n[r];"headOfPipeline"!==i&&t[i].on&&t[i].on("log",Ft.bind(e,i))}},Bt=function(e,t){var n;if(e.length!==t.length)return!1;for(n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0},jt=function(e,t,n,r,i,a){return{start:{dts:e,pts:e+(n-t)},end:{dts:e+(r-t),pts:e+(i-n)},prependedContentDuration:a,baseMediaDecodeTime:e}};Tt=function(e,t){var n,r=[],i=0,a=0,s=1/0;n=(t=t||{}).firstSequenceNumber||0,Tt.prototype.init.call(this),this.push=function(t){Ct.collectDtsInfo(e,t),e&&Lt.forEach((function(n){e[n]=t[n]})),r.push(t)},this.setEarliestDts=function(e){i=e},this.setVideoBaseMediaDecodeTime=function(e){s=e},this.setAudioAppendStart=function(e){a=e},this.flush=function(){var o,l,u,c,d,f,h;0!==r.length?(o=It.trimAdtsFramesByEarliestDts(r,e,i),e.baseMediaDecodeTime=Ct.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),h=It.prefixWithSilence(e,o,a,s),e.samples=It.generateSampleTable(o),u=At.mdat(It.concatenateFrameData(o)),r=[],l=At.moof(n,[e]),c=new Uint8Array(l.byteLength+u.byteLength),n++,c.set(l),c.set(u,l.byteLength),Ct.clearDtsInfo(e),d=Math.ceil(1024*xt/e.samplerate),o.length&&(f=o.length*d,this.trigger("segmentTimingInfo",jt(Dt.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),o[0].dts,o[0].pts,o[0].dts+f,o[0].pts+f,h||0)),this.trigger("timingInfo",{start:o[0].pts,end:o[0].pts+f})),this.trigger("data",{track:e,boxes:c}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")},this.reset=function(){Ct.clearDtsInfo(e),r=[],this.trigger("reset")}},Tt.prototype=new St,_t=function(e,t){var n,r,i,a=[],s=[];n=(t=t||{}).firstSequenceNumber||0,_t.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){Ct.collectDtsInfo(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||r||(r=t.config,e.sps=[t.data],kt.forEach((function(t){e[t]=r[t]}),this)),"pic_parameter_set_rbsp"!==t.nalUnitType||i||(i=t.data,e.pps=[t.data]),a.push(t)},this.flush=function(){for(var r,i,o,l,u,c,d,f,h=0;a.length&&"access_unit_delimiter_rbsp"!==a[0].nalUnitType;)a.shift();if(0===a.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(r=wt.groupNalsIntoFrames(a),(o=wt.groupFramesIntoGops(r))[0][0].keyFrame||((i=this.getGopForFusion_(a[0],e))?(h=i.duration,o.unshift(i),o.byteLength+=i.byteLength,o.nalCount+=i.nalCount,o.pts=i.pts,o.dts=i.dts,o.duration+=i.duration):o=wt.extendFirstKeyFrame(o)),s.length){var p;if(!(p=t.alignGopsAtEnd?this.alignGopsAtEnd_(o):this.alignGopsAtStart_(o)))return this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");Ct.clearDtsInfo(e),o=p}Ct.collectDtsInfo(e,o),e.samples=wt.generateSampleTable(o),u=At.mdat(wt.concatenateNalData(o)),e.baseMediaDecodeTime=Ct.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",o.map((function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}}))),d=o[0],f=o[o.length-1],this.trigger("segmentTimingInfo",jt(e.baseMediaDecodeTime,d.dts,d.pts,f.dts+f.duration,f.pts+f.duration,h)),this.trigger("timingInfo",{start:o[0].pts,end:o[o.length-1].pts+o[o.length-1].duration}),this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),l=At.moof(n,[e]),c=new Uint8Array(l.byteLength+u.byteLength),n++,c.set(l),c.set(u,l.byteLength),this.trigger("data",{track:e,boxes:c}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),a=[],this.gopCache_.length=0,s.length=0,this.trigger("reset")},this.resetStream_=function(){Ct.clearDtsInfo(e),r=void 0,i=void 0},this.getGopForFusion_=function(t){var n,r,i,a,s,o=1/0;for(s=0;s<this.gopCache_.length;s++)i=(a=this.gopCache_[s]).gop,e.pps&&Bt(e.pps[0],a.pps[0])&&e.sps&&Bt(e.sps[0],a.sps[0])&&(i.dts<e.timelineStartInfo.dts||(n=t.dts-i.dts-i.duration)>=-1e4&&n<=45e3&&(!r||o>n)&&(r=a,o=n));return r?r.gop:null},this.alignGopsAtStart_=function(e){var t,n,r,i,a,o,l,u;for(a=e.byteLength,o=e.nalCount,l=e.duration,t=n=0;t<s.length&&n<e.length&&(r=s[t],i=e[n],r.pts!==i.pts);)i.pts>r.pts?t++:(n++,a-=i.byteLength,o-=i.nalCount,l-=i.duration);return 0===n?e:n===e.length?null:((u=e.slice(n)).byteLength=a,u.duration=l,u.nalCount=o,u.pts=u[0].pts,u.dts=u[0].dts,u)},this.alignGopsAtEnd_=function(e){var t,n,r,i,a,o,l;for(t=s.length-1,n=e.length-1,a=null,o=!1;t>=0&&n>=0;){if(r=s[t],i=e[n],r.pts===i.pts){o=!0;break}r.pts>i.pts?t--:(t===s.length-1&&(a=n),n--)}if(!o&&null===a)return null;if(0===(l=o?n:a))return e;var u=e.slice(l),c=u.reduce((function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e}),{byteLength:0,duration:0,nalCount:0});return u.byteLength=c.byteLength,u.duration=c.duration,u.nalCount=c.nalCount,u.pts=u[0].pts,u.dts=u[0].dts,u},this.alignGopsWith=function(e){s=e}},_t.prototype=new St,bt=function(e,t){this.numberOfTracks=0,this.metadataStream=t,void 0!==(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps?this.keepOriginalTimestamps=e.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,bt.prototype.init.call(this),this.push=function(e){return e.content||e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),void("audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes))))}},bt.prototype=new St,bt.prototype.flush=function(e){var t,n,r,i,a=0,s={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,kt.forEach((function(e){s.info[e]=this.videoTrack[e]}),this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,Lt.forEach((function(e){s.info[e]=this.audioTrack[e]}),this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?s.type=this.pendingTracks[0].type:s.type="combined",this.emittedTracks+=this.pendingTracks.length,r=At.initSegment(this.pendingTracks),s.initSegment=new Uint8Array(r.byteLength),s.initSegment.set(r),s.data=new Uint8Array(this.pendingBytes),i=0;i<this.pendingBoxes.length;i++)s.data.set(this.pendingBoxes[i],a),a+=this.pendingBoxes[i].byteLength;for(i=0;i<this.pendingCaptions.length;i++)(t=this.pendingCaptions[i]).startTime=Dt.metadataTsToSeconds(t.startPts,o,this.keepOriginalTimestamps),t.endTime=Dt.metadataTsToSeconds(t.endPts,o,this.keepOriginalTimestamps),s.captionStreams[t.stream]=!0,s.captions.push(t);for(i=0;i<this.pendingMetadata.length;i++)(n=this.pendingMetadata[i]).cueTime=Dt.metadataTsToSeconds(n.pts,o,this.keepOriginalTimestamps),s.metadata.push(n);for(s.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",s),i=0;i<s.captions.length;i++)t=s.captions[i],this.trigger("caption",t);for(i=0;i<s.metadata.length;i++)n=s.metadata[i],this.trigger("id3Frame",n)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},bt.prototype.setRemux=function(e){this.remuxTracks=e},(Et=function(e){var t,n,r=this,i=!0;Et.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var i={};this.transmuxPipeline_=i,i.type="aac",i.metadataStream=new Rt.MetadataStream,i.aacStream=new Pt,i.audioTimestampRolloverStream=new Rt.TimestampRolloverStream("audio"),i.timedMetadataTimestampRolloverStream=new Rt.TimestampRolloverStream("timed-metadata"),i.adtsStream=new Nt,i.coalesceStream=new bt(e,i.metadataStream),i.headOfPipeline=i.aacStream,i.aacStream.pipe(i.audioTimestampRolloverStream).pipe(i.adtsStream),i.aacStream.pipe(i.timedMetadataTimestampRolloverStream).pipe(i.metadataStream).pipe(i.coalesceStream),i.metadataStream.on("timestamp",(function(e){i.aacStream.setTimestamp(e.timeStamp)})),i.aacStream.on("data",(function(a){"timed-metadata"!==a.type&&"audio"!==a.type||i.audioSegmentStream||(n=n||{timelineStartInfo:{baseMediaDecodeTime:r.baseMediaDecodeTime},codec:"adts",type:"audio"},i.coalesceStream.numberOfTracks++,i.audioSegmentStream=new Tt(n,e),i.audioSegmentStream.on("log",r.getLogTrigger_("audioSegmentStream")),i.audioSegmentStream.on("timingInfo",r.trigger.bind(r,"audioTimingInfo")),i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream),r.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!t}))})),i.coalesceStream.on("data",this.trigger.bind(this,"data")),i.coalesceStream.on("done",this.trigger.bind(this,"done")),Ut(this,i)},this.setupTsPipeline=function(){var i={};this.transmuxPipeline_=i,i.type="ts",i.metadataStream=new Rt.MetadataStream,i.packetStream=new Rt.TransportPacketStream,i.parseStream=new Rt.TransportParseStream,i.elementaryStream=new Rt.ElementaryStream,i.timestampRolloverStream=new Rt.TimestampRolloverStream,i.adtsStream=new Nt,i.h264Stream=new Ot,i.captionStream=new Rt.CaptionStream(e),i.coalesceStream=new bt(e,i.metadataStream),i.headOfPipeline=i.packetStream,i.packetStream.pipe(i.parseStream).pipe(i.elementaryStream).pipe(i.timestampRolloverStream),i.timestampRolloverStream.pipe(i.h264Stream),i.timestampRolloverStream.pipe(i.adtsStream),i.timestampRolloverStream.pipe(i.metadataStream).pipe(i.coalesceStream),i.h264Stream.pipe(i.captionStream).pipe(i.coalesceStream),i.elementaryStream.on("data",(function(a){var s;if("metadata"===a.type){for(s=a.tracks.length;s--;)t||"video"!==a.tracks[s].type?n||"audio"!==a.tracks[s].type||((n=a.tracks[s]).timelineStartInfo.baseMediaDecodeTime=r.baseMediaDecodeTime):(t=a.tracks[s]).timelineStartInfo.baseMediaDecodeTime=r.baseMediaDecodeTime;t&&!i.videoSegmentStream&&(i.coalesceStream.numberOfTracks++,i.videoSegmentStream=new _t(t,e),i.videoSegmentStream.on("log",r.getLogTrigger_("videoSegmentStream")),i.videoSegmentStream.on("timelineStartInfo",(function(t){n&&!e.keepOriginalTimestamps&&(n.timelineStartInfo=t,i.audioSegmentStream.setEarliestDts(t.dts-r.baseMediaDecodeTime))})),i.videoSegmentStream.on("processedGopsInfo",r.trigger.bind(r,"gopInfo")),i.videoSegmentStream.on("segmentTimingInfo",r.trigger.bind(r,"videoSegmentTimingInfo")),i.videoSegmentStream.on("baseMediaDecodeTime",(function(e){n&&i.audioSegmentStream.setVideoBaseMediaDecodeTime(e)})),i.videoSegmentStream.on("timingInfo",r.trigger.bind(r,"videoTimingInfo")),i.h264Stream.pipe(i.videoSegmentStream).pipe(i.coalesceStream)),n&&!i.audioSegmentStream&&(i.coalesceStream.numberOfTracks++,i.audioSegmentStream=new Tt(n,e),i.audioSegmentStream.on("log",r.getLogTrigger_("audioSegmentStream")),i.audioSegmentStream.on("timingInfo",r.trigger.bind(r,"audioTimingInfo")),i.audioSegmentStream.on("segmentTimingInfo",r.trigger.bind(r,"audioSegmentTimingInfo")),i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream)),r.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!t})}})),i.coalesceStream.on("data",this.trigger.bind(this,"data")),i.coalesceStream.on("id3Frame",(function(e){e.dispatchType=i.metadataStream.dispatchType,r.trigger("id3Frame",e)})),i.coalesceStream.on("caption",this.trigger.bind(this,"caption")),i.coalesceStream.on("done",this.trigger.bind(this,"done")),Ut(this,i)},this.setBaseMediaDecodeTime=function(r){var i=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=r),n&&(n.timelineStartInfo.dts=void 0,n.timelineStartInfo.pts=void 0,Ct.clearDtsInfo(n),i.audioTimestampRolloverStream&&i.audioTimestampRolloverStream.discontinuity()),t&&(i.videoSegmentStream&&(i.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,Ct.clearDtsInfo(t),i.captionStream.reset()),i.timestampRolloverStream&&i.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){n&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(t){var n=this.transmuxPipeline_;e.remux=t,n&&n.coalesceStream&&n.coalesceStream.setRemux(t)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.getLogTrigger_=function(e){var t=this;return function(n){n.stream=e,t.trigger("log",n)}},this.push=function(e){if(i){var t=Mt(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),i=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){i=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new St;var qt,Ht,Gt,Vt,Yt={Transmuxer:Et,VideoSegmentStream:_t,AudioSegmentStream:Tt,AUDIO_PROPERTIES:Lt,VIDEO_PROPERTIES:kt,generateSegmentTimingInfo:jt},Zt=function(e){return e>>>0},Kt=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),(t+=String.fromCharCode(e[2]))+String.fromCharCode(e[3])},zt=Zt,Wt=Kt,Xt=function(e,t){var n,r,i,a,s,o=[];if(!t.length)return null;for(n=0;n<e.byteLength;)r=zt(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3]),i=Wt(e.subarray(n+4,n+8)),a=r>1?n+r:e.byteLength,i===t[0]&&(1===t.length?o.push(e.subarray(n+8,a)):(s=Xt(e.subarray(n+8,a),t.slice(1))).length&&(o=o.concat(s))),n=a;return o},$t=Zt,Qt=Y.getUint64,Jt=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};return 1===t.version?t.baseMediaDecodeTime=Qt(e.subarray(4)):t.baseMediaDecodeTime=$t(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),t},en=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},tn=function(e){var t,n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},r=new DataView(e.buffer,e.byteOffset,e.byteLength),i=1&n.flags[2],a=4&n.flags[2],s=1&n.flags[1],o=2&n.flags[1],l=4&n.flags[1],u=8&n.flags[1],c=r.getUint32(4),d=8;for(i&&(n.dataOffset=r.getInt32(d),d+=4),a&&c&&(t={flags:en(e.subarray(d,d+4))},d+=4,s&&(t.duration=r.getUint32(d),d+=4),o&&(t.size=r.getUint32(d),d+=4),u&&(1===n.version?t.compositionTimeOffset=r.getInt32(d):t.compositionTimeOffset=r.getUint32(d),d+=4),n.samples.push(t),c--);c--;)t={},s&&(t.duration=r.getUint32(d),d+=4),o&&(t.size=r.getUint32(d),d+=4),l&&(t.flags=en(e.subarray(d,d+4)),d+=4),u&&(1===n.version?t.compositionTimeOffset=r.getInt32(d):t.compositionTimeOffset=r.getUint32(d),d+=4),n.samples.push(t);return n},nn=function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:n.getUint32(4)},i=1&r.flags[2],a=2&r.flags[2],s=8&r.flags[2],o=16&r.flags[2],l=32&r.flags[2],u=65536&r.flags[0],c=131072&r.flags[0];return t=8,i&&(t+=4,r.baseDataOffset=n.getUint32(12),t+=4),a&&(r.sampleDescriptionIndex=n.getUint32(t),t+=4),s&&(r.defaultSampleDuration=n.getUint32(t),t+=4),o&&(r.defaultSampleSize=n.getUint32(t),t+=4),l&&(r.defaultSampleFlags=n.getUint32(t)),u&&(r.durationIsEmpty=!0),!i&&c&&(r.baseDataOffsetIsMoof=!0),r},rn=(qt="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},he.discardEmulationPreventionBytes),an=Ce.CaptionStream,sn=Xt,on=Jt,ln=tn,un=nn,cn=qt,dn=function(e,t){for(var n=e,r=0;r<t.length;r++){var i=t[r];if(n<i.size)return i;n-=i.size}return null},fn=function(){var e,t,n,r,i,a,s=!1;this.isInitialized=function(){return s},this.init=function(t){e=new an,s=!0,a=!!t&&t.isPartial,e.on("data",(function(e){e.startTime=e.startPts/r,e.endTime=e.endPts/r,i.captions.push(e),i.captionStreams[e.stream]=!0})),e.on("log",(function(e){i.logs.push(e)}))},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"==typeof t&&0===Object.keys(t).length||n===e[0]&&r===t[n])},this.parse=function(e,a,s){var o;if(!this.isInitialized())return null;if(!a||!s)return null;if(this.isNewInit(a,s))n=a[0],r=s[n];else if(null===n||!r)return t.push(e),null;for(;t.length>0;){var l=t.shift();this.parse(l,a,s)}return o=function(e,t,n){if(null===t)return null;var r=function(e,t){var n=sn(e,["moof","traf"]),r=sn(e,["mdat"]),i={},a=[];return r.forEach((function(e,t){var r=n[t];a.push({mdat:e,traf:r})})),a.forEach((function(e){var n,r,a=e.mdat,s=e.traf,o=sn(s,["tfhd"]),l=un(o[0]),u=l.trackId,c=sn(s,["tfdt"]),d=c.length>0?on(c[0]).baseMediaDecodeTime:0,f=sn(s,["trun"]);t===u&&f.length>0&&(n=function(e,t,n){var r=t,i=n.defaultSampleDuration||0,a=n.defaultSampleSize||0,s=n.trackId,o=[];return e.forEach((function(e){var t=ln(e).samples;t.forEach((function(e){void 0===e.duration&&(e.duration=i),void 0===e.size&&(e.size=a),e.trackId=s,e.dts=r,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),"bigint"==typeof r?(e.pts=r+cn.BigInt(e.compositionTimeOffset),r+=cn.BigInt(e.duration)):(e.pts=r+e.compositionTimeOffset,r+=e.duration)})),o=o.concat(t)})),o}(f,d,l),r=function(e,t,n){var r,i,a,s,o=new DataView(e.buffer,e.byteOffset,e.byteLength),l={logs:[],seiNals:[]};for(i=0;i+4<e.length;i+=a)if(a=o.getUint32(i),i+=4,!(a<=0))switch(31&e[i]){case 6:var u=e.subarray(i+1,i+1+a),c=dn(i,t);if(r={nalUnitType:"sei_rbsp",size:a,data:u,escapedRBSP:rn(u),trackId:n},c)r.pts=c.pts,r.dts=c.dts,s=c;else{if(!s){l.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+i+" for trackId "+n+". See mux.js#223."});break}r.pts=s.pts,r.dts=s.dts}l.seiNals.push(r)}return l}(a,n,u),i[u]||(i[u]={seiNals:[],logs:[]}),i[u].seiNals=i[u].seiNals.concat(r.seiNals),i[u].logs=i[u].logs.concat(r.logs))})),i}(e,t)[t]||{};return{seiNals:r.seiNals,logs:r.logs,timescale:n}}(e,n,r),o&&o.logs&&(i.logs=i.logs.concat(o.logs)),null!==o&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),i):i.logs.length?{logs:i.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach((function(t){e.push(t)}))},this.flushStream=function(){if(!this.isInitialized())return null;a?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){i.captions=[],i.captionStreams={},i.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],n=null,r=null,i?this.clearParsedCaptions():i={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},hn=function(e){for(var t=0,n=String.fromCharCode(e[t]),r="";"\0"!==n;)r+=n,t++,n=String.fromCharCode(e[t]);return r+n},pn=Y.getUint64,gn=function(e){return void 0!==e||null!==e},mn={parseEmsgBox:function(e){var t,n,r,i,a,s,o,l=4,u=e[0];if(0===u)l+=(t=hn(e.subarray(l))).length,l+=(n=hn(e.subarray(l))).length,r=(c=new DataView(e.buffer)).getUint32(l),l+=4,a=c.getUint32(l),l+=4,s=c.getUint32(l),l+=4,o=c.getUint32(l),l+=4;else if(1===u){var c;r=(c=new DataView(e.buffer)).getUint32(l),l+=4,i=pn(e.subarray(l)),l+=8,s=c.getUint32(l),l+=4,o=c.getUint32(l),l+=4,l+=(t=hn(e.subarray(l))).length,l+=(n=hn(e.subarray(l))).length}var d={scheme_id_uri:t,value:n,timescale:r||1,presentation_time:i,presentation_time_delta:a,event_duration:s,id:o,message_data:new Uint8Array(e.subarray(l,e.byteLength))};return function(e,t){var n="\0"!==t.scheme_id_uri,r=0===e&&gn(t.presentation_time_delta)&&n,i=1===e&&gn(t.presentation_time)&&n;return!(e>1)&&r||i}(u,d)?d:void 0},scaleTime:function(e,t,n,r){return e||0===e?e/t:r+n/t}},yn=Zt,vn=function(e){return("00"+e.toString(16)).slice(-2)},_n=Xt,Tn=Kt,En=mn,bn=Y.getUint64,Sn=qt,An=qe.parseId3Frames;Ht=function(e,t){var n=_n(t,["moof","traf"]).reduce((function(t,n){var r,i=_n(n,["tfhd"])[0],a=yn(i[4]<<24|i[5]<<16|i[6]<<8|i[7]),s=e[a]||9e4,o=_n(n,["tfdt"])[0],l=new DataView(o.buffer,o.byteOffset,o.byteLength);let u;return"bigint"==typeof(r=1===o[0]?bn(o.subarray(4,12)):l.getUint32(4))?u=r/Sn.BigInt(s):"number"!=typeof r||isNaN(r)||(u=r/s),u<Number.MAX_SAFE_INTEGER&&(u=Number(u)),u<t&&(t=u),t}),1/0);return"bigint"==typeof n||isFinite(n)?n:0},Vt=function(e){var t=0===e[0]?12:20;return yn(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])},Gt=function(e){var t=_n(e,["moov","trak"]),n=[];return t.forEach((function(e){var t,r,i={},a=_n(e,["tkhd"])[0];a&&(r=(t=new DataView(a.buffer,a.byteOffset,a.byteLength)).getUint8(0),i.id=0===r?t.getUint32(12):t.getUint32(20));var s=_n(e,["mdia","hdlr"])[0];if(s){var o=Tn(s.subarray(8,12));i.type="vide"===o?"video":"soun"===o?"audio":o}var l=_n(e,["mdia","minf","stbl","stsd"])[0];if(l){var u=l.subarray(8);i.codec=Tn(u.subarray(4,8));var c,d=_n(u,[i.codec])[0];d&&(/^[asm]vc[1-9]$/i.test(i.codec)?(c=d.subarray(78),"avcC"===Tn(c.subarray(4,8))&&c.length>11?(i.codec+=".",i.codec+=vn(c[9]),i.codec+=vn(c[10]),i.codec+=vn(c[11])):i.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(i.codec)?(c=d.subarray(28),"esds"===Tn(c.subarray(4,8))&&c.length>20&&0!==c[19]?(i.codec+="."+vn(c[19]),i.codec+="."+vn(c[20]>>>2&63).replace(/^0/,"")):i.codec="mp4a.40.2"):i.codec=i.codec.toLowerCase())}var f=_n(e,["mdia","mdhd"])[0];f&&(i.timescale=Vt(f)),n.push(i)})),n};var wn=Ht,In=Gt,Cn=function(e,t=0){return _n(e,["emsg"]).map((e=>{var n=En.parseEmsgBox(new Uint8Array(e)),r=An(n.message_data);return{cueTime:En.scaleTime(n.presentation_time,n.timescale,n.presentation_time_delta,t),duration:En.scaleTime(n.event_duration,n.timescale),frames:r}}))},Rn=Re,Dn=function(e){var t=31&e[1];return(t<<=8)|e[2]},Nn=function(e){return!!(64&e[1])},On=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},Pn=function(e){switch(e){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},Mn={parseType:function(e,t){var n=Dn(e);return 0===n?"pat":n===t?"pmt":t?"pes":null},parsePat:function(e){var t=Nn(e),n=4+On(e);return t&&(n+=e[n]+1),(31&e[n+10])<<8|e[n+11]},parsePmt:function(e){var t={},n=Nn(e),r=4+On(e);if(n&&(r+=e[r]+1),1&e[r+5]){var i;i=3+((15&e[r+1])<<8|e[r+2])-4;for(var a=12+((15&e[r+10])<<8|e[r+11]);a<i;){var s=r+a;t[(31&e[s+1])<<8|e[s+2]]=e[s],a+=5+((15&e[s+3])<<8|e[s+4])}return t}},parsePayloadUnitStartIndicator:Nn,parsePesType:function(e,t){switch(t[Dn(e)]){case Rn.H264_STREAM_TYPE:return"video";case Rn.ADTS_STREAM_TYPE:return"audio";case Rn.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(e){if(!Nn(e))return null;var t=4+On(e);if(t>=e.byteLength)return null;var n,r=null;return 192&(n=e[t+7])&&((r={}).pts=(14&e[t+9])<<27|(255&e[t+10])<<20|(254&e[t+11])<<12|(255&e[t+12])<<5|(254&e[t+13])>>>3,r.pts*=4,r.pts+=(6&e[t+13])>>>1,r.dts=r.pts,64&n&&(r.dts=(14&e[t+14])<<27|(255&e[t+15])<<20|(254&e[t+16])<<12|(255&e[t+17])<<5|(254&e[t+18])>>>3,r.dts*=4,r.dts+=(6&e[t+18])>>>1)),r},videoPacketContainsKeyFrame:function(e){for(var t=4+On(e),n=e.subarray(t),r=0,i=0,a=!1;i<n.byteLength-3;i++)if(1===n[i+2]){r=i+5;break}for(;r<n.byteLength;)switch(n[r]){case 0:if(0!==n[r-1]){r+=2;break}if(0!==n[r-2]){r++;break}i+3!==r-2&&"slice_layer_without_partitioning_rbsp_idr"===Pn(31&n[i+3])&&(a=!0);do{r++}while(1!==n[r]&&r<n.length);i=r-2,r+=3;break;case 1:if(0!==n[r-1]||0!==n[r-2]){r+=3;break}"slice_layer_without_partitioning_rbsp_idr"===Pn(31&n[i+3])&&(a=!0),i=r-2,r+=3;break;default:r+=3}return n=n.subarray(i),r-=i,i=0,n&&n.byteLength>3&&"slice_layer_without_partitioning_rbsp_idr"===Pn(31&n[i+3])&&(a=!0),a}},xn=Re,Ln=xe.handleRollover,kn={};kn.ts=Mn,kn.aac=yt;var Fn=le.ONE_SECOND_IN_TS,Un=188,Bn=71,jn=function(e,t,n){for(var r,i,a,s,o=0,l=Un,u=!1;l<=e.byteLength;)if(e[o]!==Bn||e[l]!==Bn&&l!==e.byteLength)o++,l++;else{if(r=e.subarray(o,l),"pes"===kn.ts.parseType(r,t.pid)&&(i=kn.ts.parsePesType(r,t.table),a=kn.ts.parsePayloadUnitStartIndicator(r),"audio"===i&&a&&(s=kn.ts.parsePesTime(r))&&(s.type="audio",n.audio.push(s),u=!0)),u)break;o+=Un,l+=Un}for(o=(l=e.byteLength)-Un,u=!1;o>=0;)if(e[o]!==Bn||e[l]!==Bn&&l!==e.byteLength)o--,l--;else{if(r=e.subarray(o,l),"pes"===kn.ts.parseType(r,t.pid)&&(i=kn.ts.parsePesType(r,t.table),a=kn.ts.parsePayloadUnitStartIndicator(r),"audio"===i&&a&&(s=kn.ts.parsePesTime(r))&&(s.type="audio",n.audio.push(s),u=!0)),u)break;o-=Un,l-=Un}},qn=function(e,t,n){for(var r,i,a,s,o,l,u,c=0,d=Un,f=!1,h={data:[],size:0};d<e.byteLength;)if(e[c]!==Bn||e[d]!==Bn)c++,d++;else{if(r=e.subarray(c,d),"pes"===kn.ts.parseType(r,t.pid)&&(i=kn.ts.parsePesType(r,t.table),a=kn.ts.parsePayloadUnitStartIndicator(r),"video"===i&&(a&&!f&&(s=kn.ts.parsePesTime(r))&&(s.type="video",n.video.push(s),f=!0),!n.firstKeyFrame))){if(a&&0!==h.size){for(o=new Uint8Array(h.size),l=0;h.data.length;)u=h.data.shift(),o.set(u,l),l+=u.byteLength;if(kn.ts.videoPacketContainsKeyFrame(o)){var p=kn.ts.parsePesTime(o);p?(n.firstKeyFrame=p,n.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}h.size=0}h.data.push(r),h.size+=r.byteLength}if(f&&n.firstKeyFrame)break;c+=Un,d+=Un}for(c=(d=e.byteLength)-Un,f=!1;c>=0;)if(e[c]!==Bn||e[d]!==Bn)c--,d--;else{if(r=e.subarray(c,d),"pes"===kn.ts.parseType(r,t.pid)&&(i=kn.ts.parsePesType(r,t.table),a=kn.ts.parsePayloadUnitStartIndicator(r),"video"===i&&a&&(s=kn.ts.parsePesTime(r))&&(s.type="video",n.video.push(s),f=!0)),f)break;c-=Un,d-=Un}},Hn=function(e,t){var n;return n=kn.aac.isLikelyAacData(e)?function(e){for(var t,n=!1,r=0,i=null,a=null,s=0,o=0;e.length-o>=3;){switch(kn.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10){n=!0;break}if((s=kn.aac.parseId3TagSize(e,o))>e.length){n=!0;break}null===a&&(t=e.subarray(o,o+s),a=kn.aac.parseAacTimestamp(t)),o+=s;break;case"audio":if(e.length-o<7){n=!0;break}if((s=kn.aac.parseAdtsSize(e,o))>e.length){n=!0;break}null===i&&(t=e.subarray(o,o+s),i=kn.aac.parseSampleRate(t)),r++,o+=s;break;default:o++}if(n)return null}if(null===i||null===a)return null;var l=Fn/i;return{audio:[{type:"audio",dts:a,pts:a},{type:"audio",dts:a+1024*r*l,pts:a+1024*r*l}]}}(e):function(e){var t={pid:null,table:null},n={};for(var r in function(e,t){for(var n,r=0,i=Un;i<e.byteLength;)if(e[r]!==Bn||e[i]!==Bn)r++,i++;else{switch(n=e.subarray(r,i),kn.ts.parseType(n,t.pid)){case"pat":t.pid=kn.ts.parsePat(n);break;case"pmt":var a=kn.ts.parsePmt(n);t.table=t.table||{},Object.keys(a).forEach((function(e){t.table[e]=a[e]}))}r+=Un,i+=Un}}(e,t),t.table)if(t.table.hasOwnProperty(r))switch(t.table[r]){case xn.H264_STREAM_TYPE:n.video=[],qn(e,t,n),0===n.video.length&&delete n.video;break;case xn.ADTS_STREAM_TYPE:n.audio=[],jn(e,t,n),0===n.audio.length&&delete n.audio}return n}(e),n&&(n.audio||n.video)?(function(e,t){if(e.audio&&e.audio.length){var n=t;(void 0===n||isNaN(n))&&(n=e.audio[0].dts),e.audio.forEach((function(e){e.dts=Ln(e.dts,n),e.pts=Ln(e.pts,n),e.dtsTime=e.dts/Fn,e.ptsTime=e.pts/Fn}))}if(e.video&&e.video.length){var r=t;if((void 0===r||isNaN(r))&&(r=e.video[0].dts),e.video.forEach((function(e){e.dts=Ln(e.dts,r),e.pts=Ln(e.pts,r),e.dtsTime=e.dts/Fn,e.ptsTime=e.pts/Fn})),e.firstKeyFrame){var i=e.firstKeyFrame;i.dts=Ln(i.dts,r),i.pts=Ln(i.pts,r),i.dtsTime=i.dts/Fn,i.ptsTime=i.pts/Fn}}}(n,t),n):null};class Gn{constructor(e,t){this.options=t||{},this.self=e,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Yt.Transmuxer(this.options),function(e,t){t.on("data",(function(t){const n=t.initSegment;t.initSegment={data:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength};const r=t.data;t.data=r.buffer,e.postMessage({action:"data",segment:t,byteOffset:r.byteOffset,byteLength:r.byteLength},[t.data])})),t.on("done",(function(t){e.postMessage({action:"done"})})),t.on("gopInfo",(function(t){e.postMessage({action:"gopInfo",gopInfo:t})})),t.on("videoSegmentTimingInfo",(function(t){const n={start:{decode:le.videoTsToSeconds(t.start.dts),presentation:le.videoTsToSeconds(t.start.pts)},end:{decode:le.videoTsToSeconds(t.end.dts),presentation:le.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:le.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(n.prependedContentDuration=le.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:n})})),t.on("audioSegmentTimingInfo",(function(t){const n={start:{decode:le.videoTsToSeconds(t.start.dts),presentation:le.videoTsToSeconds(t.start.pts)},end:{decode:le.videoTsToSeconds(t.end.dts),presentation:le.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:le.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(n.prependedContentDuration=le.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:n})})),t.on("id3Frame",(function(t){e.postMessage({action:"id3Frame",id3Frame:t})})),t.on("caption",(function(t){e.postMessage({action:"caption",caption:t})})),t.on("trackinfo",(function(t){e.postMessage({action:"trackinfo",trackInfo:t})})),t.on("audioTimingInfo",(function(t){e.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:le.videoTsToSeconds(t.start),end:le.videoTsToSeconds(t.end)}})})),t.on("videoTimingInfo",(function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:le.videoTsToSeconds(t.start),end:le.videoTsToSeconds(t.end)}})})),t.on("log",(function(t){e.postMessage({action:"log",log:t})}))}(this.self,this.transmuxer)}pushMp4Captions(e){this.captionParser||(this.captionParser=new fn,this.captionParser.init());const t=new Uint8Array(e.data,e.byteOffset,e.byteLength),n=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:n&&n.captions||[],logs:n&&n.logs||[],data:t.buffer},[t.buffer])}probeMp4StartTime({timescales:e,data:t}){const n=wn(e,t);this.self.postMessage({action:"probeMp4StartTime",startTime:n,data:t},[t.buffer])}probeMp4Tracks({data:e}){const t=In(e);this.self.postMessage({action:"probeMp4Tracks",tracks:t,data:e},[e.buffer])}probeEmsgID3({data:e,offset:t}){const n=Cn(e,t);this.self.postMessage({action:"probeEmsgID3",id3Frames:n,emsgData:e},[e.buffer])}probeTs({data:e,baseStartTime:t}){const n="number"!=typeof t||isNaN(t)?void 0:t*le.ONE_SECOND_IN_TS,r=Hn(e,n);let i=null;r&&(i={hasVideo:r.video&&2===r.video.length||!1,hasAudio:r.audio&&2===r.audio.length||!1},i.hasVideo&&(i.videoStart=r.video[0].ptsTime),i.hasAudio&&(i.audioStart=r.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:i,data:e},[e.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(e){const t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)}reset(){this.transmuxer.reset()}setTimestampOffset(e){const t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(le.secondsToVideoTs(t)))}setAudioAppendStart(e){this.transmuxer.setAudioAppendStart(Math.ceil(le.secondsToVideoTs(e.appendStart)))}setRemux(e){this.transmuxer.setRemux(e.remux)}flush(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())}}self.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new Gn(self,e.data.options):(this.messageHandlers||(this.messageHandlers=new Gn(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}})));var Uo=xo(Fo);const Bo=e=>{const{transmuxer:t,bytes:n,audioAppendStart:r,gopsToAlignWith:i,remux:a,onData:s,onTrackInfo:o,onAudioTimingInfo:l,onVideoTimingInfo:u,onVideoSegmentTimingInfo:c,onAudioSegmentTimingInfo:d,onId3:f,onCaptions:h,onDone:p,onEndedTimeline:g,onTransmuxerLog:m,isEndOfTimeline:y}=e,v={buffer:[]};let _=y;if(t.onmessage=n=>{t.currentTransmux===e&&("data"===n.data.action&&((e,t,n)=>{const{type:r,initSegment:i,captions:a,captionStreams:s,metadata:o,videoFrameDtsTime:l,videoFramePtsTime:u}=e.data.segment;t.buffer.push({captions:a,captionStreams:s,metadata:o});const c=e.data.segment.boxes||{data:e.data.segment.data},d={type:r,data:new Uint8Array(c.data,c.data.byteOffset,c.data.byteLength),initSegment:new Uint8Array(i.data,i.byteOffset,i.byteLength)};void 0!==l&&(d.videoFrameDtsTime=l),void 0!==u&&(d.videoFramePtsTime=u),n(d)})(n,v,s),"trackinfo"===n.data.action&&o(n.data.trackInfo),"gopInfo"===n.data.action&&((e,t)=>{t.gopInfo=e.data.gopInfo})(n,v),"audioTimingInfo"===n.data.action&&l(n.data.audioTimingInfo),"videoTimingInfo"===n.data.action&&u(n.data.videoTimingInfo),"videoSegmentTimingInfo"===n.data.action&&c(n.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===n.data.action&&d(n.data.audioSegmentTimingInfo),"id3Frame"===n.data.action&&f([n.data.id3Frame],n.data.id3Frame.dispatchType),"caption"===n.data.action&&h(n.data.caption),"endedtimeline"===n.data.action&&(_=!1,g()),"log"===n.data.action&&m(n.data.log),"transmuxed"===n.data.type&&(_||(t.onmessage=null,(({transmuxedData:e,callback:t})=>{e.buffer=[],t(e)})({transmuxedData:v,callback:p}),jo(t))))},r&&t.postMessage({action:"setAudioAppendStart",appendStart:r}),Array.isArray(i)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:i}),void 0!==a&&t.postMessage({action:"setRemux",remux:a}),n.byteLength){const e=n instanceof ArrayBuffer?n:n.buffer,r=n instanceof ArrayBuffer?0:n.byteOffset;t.postMessage({action:"push",data:e,byteOffset:r,byteLength:n.byteLength},[e])}y&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},jo=e=>{e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():Bo(e.currentTransmux))},qo=(e,t)=>{e.postMessage({action:t}),jo(e)};var Ho=e=>{((e,t)=>{if(!t.currentTransmux)return t.currentTransmux=e,void qo(t,e);t.transmuxQueue.push(qo.bind(null,t,e))})("reset",e)};const Go=function(e){const t=e.transmuxer,n=e.endAction||e.action,r=e.callback,i=(0,g.Z)({},e,{endAction:null,transmuxer:null,callback:null}),a=i=>{i.data.action===n&&(t.removeEventListener("message",a),i.data.data&&(i.data.data=new Uint8Array(i.data.data,e.byteOffset||0,e.byteLength||i.data.data.byteLength),e.data&&(e.data=i.data.data)),r(i.data))};if(t.addEventListener("message",a),e.data){const n=e.data instanceof ArrayBuffer;i.byteOffset=n?0:e.data.byteOffset,i.byteLength=e.data.byteLength;const r=[n?e.data:e.data.buffer];t.postMessage(i,r)}else t.postMessage(i)},Vo=-101,Yo=-102,Zo=e=>{e.forEach((e=>{e.abort()}))},Ko=(e,t)=>t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:Vo,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:Yo,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:2,xhr:t}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:2,xhr:t}:null,zo=(e,t,n)=>(r,i)=>{const a=i.response,s=Ko(r,i);if(s)return n(s,e);if(16!==a.byteLength)return n({status:i.status,message:"Invalid HLS key at URL: "+i.uri,code:2,xhr:i},e);const o=new DataView(a),l=new Uint32Array([o.getUint32(0),o.getUint32(4),o.getUint32(8),o.getUint32(12)]);for(let e=0;e<t.length;e++)t[e].bytes=l;return n(null,e)},Wo=(e,t)=>{const n=ct(e.map.bytes);if("mp4"!==n){const r=e.map.resolvedUri||e.map.uri;return t({internal:!0,message:`Found unsupported ${n||"unknown"} container for initialization segment at URL: ${r}`,code:2})}Go({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:({tracks:n,data:r})=>(e.map.bytes=r,n.forEach((function(t){e.map.tracks=e.map.tracks||{},e.map.tracks[t.type]||(e.map.tracks[t.type]=t,"number"==typeof t.id&&t.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[t.id]=t.timescale))})),t(null))})},Xo=({segment:e,bytes:t,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:a,id3Fn:s,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:d,onTransmuxerLog:f})=>{const h=e.map&&e.map.tracks||{},p=Boolean(h.audio&&h.video);let g=r.bind(null,e,"audio","start");const m=r.bind(null,e,"audio","end");let y=r.bind(null,e,"video","start");const v=r.bind(null,e,"video","end");Go({action:"probeTs",transmuxer:e.transmuxer,data:t,baseStartTime:e.baseStartTime,callback:r=>{e.bytes=t=r.data;const h=r.result;h&&(n(e,{hasAudio:h.hasAudio,hasVideo:h.hasVideo,isMuxed:p}),n=null),(e=>{if(!e.transmuxer.currentTransmux)return e.transmuxer.currentTransmux=e,void Bo(e);e.transmuxer.transmuxQueue.push(e)})({bytes:t,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,remux:p,onData:t=>{t.type="combined"===t.type?"video":t.type,c(e,t)},onTrackInfo:t=>{n&&(p&&(t.isMuxed=!0),n(e,t))},onAudioTimingInfo:e=>{g&&void 0!==e.start&&(g(e.start),g=null),m&&void 0!==e.end&&m(e.end)},onVideoTimingInfo:e=>{y&&void 0!==e.start&&(y(e.start),y=null),v&&void 0!==e.end&&v(e.end)},onVideoSegmentTimingInfo:e=>{i(e)},onAudioSegmentTimingInfo:e=>{a(e)},onId3:(t,n)=>{s(e,t,n)},onCaptions:t=>{o(e,[t])},isEndOfTimeline:l,onEndedTimeline:()=>{u()},onTransmuxerLog:f,onDone:t=>{d&&(t.type="combined"===t.type?"video":t.type,d(null,e,t))}})}})},$o=({segment:e,bytes:t,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:a,id3Fn:s,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:d,onTransmuxerLog:f})=>{let h=new Uint8Array(t);if(function(e){return ze(e,["moof"]).length>0}(h)){e.isFmp4=!0;const{tracks:i}=e.map,a={isFmp4:!0,hasVideo:!!i.video,hasAudio:!!i.audio};i.audio&&i.audio.codec&&"enca"!==i.audio.codec&&(a.audioCodec=i.audio.codec),i.video&&i.video.codec&&"encv"!==i.video.codec&&(a.videoCodec=i.video.codec),i.video&&i.audio&&(a.isMuxed=!0),n(e,a);const l=(t,n)=>{c(e,{data:h,type:a.hasAudio&&!a.isMuxed?"audio":"video"}),n&&n.length&&s(e,n),t&&t.length&&o(e,t),d(null,e,{})};Go({action:"probeMp4StartTime",timescales:e.map.timescales,data:h,transmuxer:e.transmuxer,callback:({data:n,startTime:s})=>{t=n.buffer,e.bytes=h=n,a.hasAudio&&!a.isMuxed&&r(e,"audio","start",s),a.hasVideo&&r(e,"video","start",s),Go({action:"probeEmsgID3",data:h,transmuxer:e.transmuxer,offset:s,callback:({emsgData:n,id3Frames:r})=>{t=n.buffer,e.bytes=h=n,i.video&&n.byteLength&&e.transmuxer?Go({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:e.transmuxer,data:h,timescales:e.map.timescales,trackIds:[i.video.id],callback:n=>{t=n.data.buffer,e.bytes=h=n.data,n.logs.forEach((function(e){f(Es(e,{stream:"mp4CaptionParser"}))})),l(n.captions,r)}}):l(void 0,r)}})}})}else if(e.transmuxer){if(void 0===e.container&&(e.container=ct(h)),"ts"!==e.container&&"aac"!==e.container)return n(e,{hasAudio:!1,hasVideo:!1}),void d(null,e,{});Xo({segment:e,bytes:t,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:a,id3Fn:s,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:d,onTransmuxerLog:f})}else d(null,e,{})},Qo=function({id:e,key:t,encryptedBytes:n,decryptionWorker:r},i){const a=t=>{if(t.data.source===e){r.removeEventListener("message",a);const e=t.data.decrypted;i(new Uint8Array(e.bytes,e.byteOffset,e.byteLength))}};let s;r.addEventListener("message",a),s=t.bytes.slice?t.bytes.slice():new Uint32Array(Array.prototype.slice.call(t.bytes)),r.postMessage(_o({source:e,encrypted:n,key:s,iv:t.iv}),[n.buffer,s.buffer])},Jo=({xhr:e,xhrOptions:t,decryptionWorker:n,segment:r,abortFn:i,progressFn:a,trackInfoFn:s,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:c,captionsFn:d,isEndOfTimeline:f,endedTimelineFn:h,dataFn:p,doneFn:g,onTransmuxerLog:m})=>{const y=[],v=(({activeXhrs:e,decryptionWorker:t,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:a,id3Fn:s,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:d,onTransmuxerLog:f})=>{let h=0,p=!1;return(g,m)=>{if(!p){if(g)return p=!0,Zo(e),d(g,m);if(h+=1,h===e.length){const h=function(){if(m.encryptedBytes)return(({decryptionWorker:e,segment:t,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:a,id3Fn:s,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:d,onTransmuxerLog:f})=>{Qo({id:t.requestId,key:t.key,encryptedBytes:t.encryptedBytes,decryptionWorker:e},(e=>{t.bytes=e,$o({segment:t,bytes:t.bytes,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:a,id3Fn:s,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:d,onTransmuxerLog:f})}))})({decryptionWorker:t,segment:m,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:a,id3Fn:s,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:d,onTransmuxerLog:f});$o({segment:m,bytes:m.bytes,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:a,id3Fn:s,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:d,onTransmuxerLog:f})};if(m.endOfAllRequests=Date.now(),m.map&&m.map.encryptedBytes&&!m.map.bytes)return Qo({decryptionWorker:t,id:m.requestId+"-init",encryptedBytes:m.map.encryptedBytes,key:m.map.key},(t=>{m.map.bytes=t,Wo(m,(t=>{if(t)return Zo(e),d(t,m);h()}))}));h()}}}})({activeXhrs:y,decryptionWorker:n,trackInfoFn:s,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:c,captionsFn:d,isEndOfTimeline:f,endedTimelineFn:h,dataFn:p,doneFn:g,onTransmuxerLog:m});if(r.key&&!r.key.bytes){const n=[r.key];r.map&&!r.map.bytes&&r.map.key&&r.map.key.resolvedUri===r.key.resolvedUri&&n.push(r.map.key);const i=e(Es(t,{uri:r.key.resolvedUri,responseType:"arraybuffer"}),zo(r,n,v));y.push(i)}if(r.map&&!r.map.bytes){if(r.map.key&&(!r.key||r.key.resolvedUri!==r.map.key.resolvedUri)){const n=e(Es(t,{uri:r.map.key.resolvedUri,responseType:"arraybuffer"}),zo(r,[r.map.key],v));y.push(n)}const n=Es(t,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:go(r.map)}),i=(({segment:e,finishProcessingFn:t})=>(n,r)=>{const i=Ko(n,r);if(i)return t(i,e);const a=new Uint8Array(r.response);if(e.map.key)return e.map.encryptedBytes=a,t(null,e);e.map.bytes=a,Wo(e,(function(n){if(n)return n.xhr=r,n.status=r.status,t(n,e);t(null,e)}))})({segment:r,finishProcessingFn:v}),a=e(n,i);y.push(a)}const _=Es(t,{uri:r.part&&r.part.resolvedUri||r.resolvedUri,responseType:"arraybuffer",headers:go(r)}),T=e(_,(({segment:e,finishProcessingFn:t,responseType:n})=>(r,i)=>{const a=Ko(r,i);if(a)return t(a,e);const s="arraybuffer"!==n&&i.responseText?(e=>{const t=new Uint8Array(new ArrayBuffer(e.length));for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t.buffer})(i.responseText.substring(e.lastReachedChar||0)):i.response;return e.stats=(e=>({bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}))(i),e.key?e.encryptedBytes=new Uint8Array(s):e.bytes=new Uint8Array(s),t(null,e)})({segment:r,finishProcessingFn:v,responseType:_.responseType}));T.addEventListener("progress",(({segment:e,progressFn:t,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:a,id3Fn:s,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c})=>n=>{if(!n.target.aborted)return e.stats=Es(e.stats,(e=>{const t=e.target,n={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-t.requestTime||0};return n.bytesReceived=e.loaded,n.bandwidth=Math.floor(n.bytesReceived/n.roundTripTime*8*1e3),n})(n)),!e.stats.firstBytesReceivedAt&&e.stats.bytesReceived&&(e.stats.firstBytesReceivedAt=Date.now()),t(n,e)})({segment:r,progressFn:a,trackInfoFn:s,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:c,captionsFn:d,isEndOfTimeline:f,endedTimelineFn:h,dataFn:p})),y.push(T);const E={};return y.forEach((e=>{e.addEventListener("loadend",(({loadendState:e,abortFn:t})=>n=>{n.target.aborted&&t&&!e.calledAbortFn&&(t(),e.calledAbortFn=!0)})({loadendState:E,abortFn:i}))})),()=>Zo(y)},el=Ts("CodecUtils"),tl=(e,t)=>{const n=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&n.AUDIO&&e.mediaGroups.AUDIO[n.AUDIO]},nl=function(e){const t={};return e.forEach((({mediaType:e,type:n,details:r})=>{t[e]=t[e]||[],t[e].push(P(`${n}${r}`))})),Object.keys(t).forEach((function(e){if(t[e].length>1)return el(`multiple ${e} codecs found as attributes: ${t[e].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),void(t[e]=null);t[e]=t[e][0]})),t},rl=function(e){let t=0;return e.audio&&t++,e.video&&t++,t},il=function(e,t){const n=t.attributes||{},r=nl(function(e){const t=e.attributes||{};if(t.CODECS)return M(t.CODECS)}(t)||[]);if(tl(e,t)&&!r.audio&&!((e,t)=>{if(!tl(e,t))return!0;const n=t.attributes||{},r=e.mediaGroups.AUDIO[n.AUDIO];for(const e in r)if(!r[e].uri&&!r[e].playlists)return!0;return!1})(e,t)){const t=nl(function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var n=e.mediaGroups.AUDIO[t];if(!n)return null;for(var r in n){var i=n[r];if(i.default&&i.playlists)return M(i.playlists[0].attributes.CODECS)}return null}(e,n.AUDIO)||[]);t.audio&&(r.audio=t.audio)}return r},al=Ts("PlaylistSelector"),sl=function(e){if(!e||!e.playlist)return;const t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})},ol=function(e,t){if(!e)return"";const n=i().getComputedStyle(e);return n?n[t]:""},ll=function(e,t){const n=e.slice();e.sort((function(e,r){const i=t(e,r);return 0===i?n.indexOf(e)-n.indexOf(r):i}))},ul=function(e,t){let n,r;return e.attributes.BANDWIDTH&&(n=e.attributes.BANDWIDTH),n=n||i().Number.MAX_VALUE,t.attributes.BANDWIDTH&&(r=t.attributes.BANDWIDTH),r=r||i().Number.MAX_VALUE,n-r};let cl=function(e,t,n,r,a,s){if(!e)return;const o={bandwidth:t,width:n,height:r,limitRenditionByPlayerDimensions:a};let l=e.playlists;Ws.isAudioOnly(e)&&(l=s.getAudioTrackPlaylists_(),o.audioOnly=!0);let u=l.map((e=>{let t;const n=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,r=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return t=e.attributes&&e.attributes.BANDWIDTH,t=t||i().Number.MAX_VALUE,{bandwidth:t,width:n,height:r,playlist:e}}));ll(u,((e,t)=>e.bandwidth-t.bandwidth)),u=u.filter((e=>!Ws.isIncompatible(e.playlist)));let c=u.filter((e=>Ws.isEnabled(e.playlist)));c.length||(c=u.filter((e=>!Ws.isDisabled(e.playlist))));const d=c.filter((e=>e.bandwidth*Po.BANDWIDTH_VARIANCE<t));let f=d[d.length-1];const h=d.filter((e=>e.bandwidth===f.bandwidth))[0];if(!1===a){const e=h||c[0]||u[0];if(e&&e.playlist){let t="sortedPlaylistReps";return h&&(t="bandwidthBestRep"),c[0]&&(t="enabledPlaylistReps"),al(`choosing ${sl(e)} using ${t} with options`,o),e.playlist}return al("could not choose a playlist with options",o),null}const p=d.filter((e=>e.width&&e.height));ll(p,((e,t)=>e.width-t.width));const g=p.filter((e=>e.width===n&&e.height===r));f=g[g.length-1];const m=g.filter((e=>e.bandwidth===f.bandwidth))[0];let y,v,_,T;if(m||(y=p.filter((e=>e.width>n||e.height>r)),v=y.filter((e=>e.width===y[0].width&&e.height===y[0].height)),f=v[v.length-1],_=v.filter((e=>e.bandwidth===f.bandwidth))[0]),s.leastPixelDiffSelector){const e=p.map((e=>(e.pixelDiff=Math.abs(e.width-n)+Math.abs(e.height-r),e)));ll(e,((e,t)=>e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff)),T=e[0]}const E=T||_||m||h||c[0]||u[0];if(E&&E.playlist){let e="sortedPlaylistReps";return T?e="leastPixelDiffRep":_?e="resolutionPlusOneRep":m?e="resolutionBestRep":h?e="bandwidthBestRep":c[0]&&(e="enabledPlaylistReps"),al(`choosing ${sl(E)} using ${e} with options`,o),E.playlist}return al("could not choose a playlist with options",o),null};const dl=function(){const e=this.useDevicePixelRatio&&i().devicePixelRatio||1;return cl(this.playlists.main,this.systemBandwidth,parseInt(ol(this.tech_.el(),"width"),10)*e,parseInt(ol(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.playlistController_)},fl={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},hl=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),pl=(e,t,n)=>{e.metadataTrack_||(e.metadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,hs.browser.IS_ANY_SAFARI||(e.metadataTrack_.inBandMetadataTrackDispatchType=t))},gl=function(e,t,n){let r,i;if(n&&n.cues)for(r=n.cues.length;r--;)i=n.cues[r],i.startTime>=e&&i.endTime<=t&&n.removeCue(i)},ml=e=>"number"==typeof e&&isFinite(e),yl=1/60,vl=e=>{const{startOfSegment:t,duration:n,segment:r,part:i,playlist:{mediaSequence:a,id:s,segments:o=[]},mediaIndex:l,partIndex:u,timeline:c}=e,d=o.length-1;let f="mediaIndex/partIndex increment";e.getMediaInfoForTime?f=`getMediaInfoForTime (${e.getMediaInfoForTime})`:e.isSyncRequest&&(f="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(f+=` with independent ${e.independent}`);const h="number"==typeof u,p=e.segment.uri?"segment":"pre-segment",g=h?Ls({preloadSegment:r})-1:0;return`${p} [${a+l}/${a+d}]`+(h?` part [${u}/${g}]`:"")+` segment start/end [${r.start} => ${r.end}]`+(h?` part start/end [${i.start} => ${i.end}]`:"")+` startOfSegment [${t}]`+` duration [${n}]`+` timeline [${c}]`+` selected by [${f}]`+` playlist [${s}]`},_l=e=>`${e}TimingInfo`,Tl=({timelineChangeController:e,currentTimeline:t,segmentTimeline:n,loaderType:r,audioDisabled:i})=>{if(t===n)return!1;if("audio"===r){const t=e.lastTimelineChange({type:"main"});return!t||t.to!==n}if("main"===r&&i){const t=e.pendingTimelineChange({type:"audio"});return!t||t.to!==n}return!1},El=({segmentDuration:e,maxDuration:t})=>!!e&&Math.round(e)>t+Ss;class bl extends hs.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if("function"!=typeof e.currentTime)throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",(()=>{this.isEndOfStream_()||(this.ended_=!1)})),this.fetchAtBuffer_=!1,this.logger_=Ts(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(e){e!==this.state_&&(this.logger_(`${this.state_} -> ${e}`),this.state_=e,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",(()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_()})),"main"===this.loaderType_&&this.timelineChangeController_.on("pendingtimelinechange",(()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_()})),"audio"===this.loaderType_&&this.timelineChangeController_.on("timelinechange",(()=>{this.hasEnoughInfoToLoad_()&&this.processLoadQueue_(),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}))}createTransmuxer_(){return(e=>{const t=new Uo;t.currentTransmux=null,t.transmuxQueue=[];const n=t.terminate;return t.terminate=()=>(t.currentTransmux=null,t.transmuxQueue.length=0,n.call(t)),t.postMessage({action:"init",options:e}),t})({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&i().clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,i().clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)}error(e){return void 0!==e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&Ho(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return bs();if("main"===this.loaderType_){const{hasAudio:t,hasVideo:n,isMuxed:r}=e;if(n&&t&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(n)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const n=To(e);let r=this.initSegments_[n];return t&&!r&&e.bytes&&(this.initSegments_[n]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),r||e}segmentKey(e,t=!1){if(!e)return null;const n=Eo(e);let r=this.keyCache_[n];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[n]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});const i={resolvedUri:(r||e).resolvedUri};return r&&(i.bytes=r.bytes),i}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),this.playlist_)return"INIT"===this.state&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY"))}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e)return;const n=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));let i=null;if(n&&(n.id?i=n.id:n.uri&&(i=n.uri)),this.logger_(`playlist update [${i} => ${e.id||e.uri}]`),this.syncController_.updateMediaSequenceMap(e,this.currentTime_(),this.loaderType_),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!n||n.uri!==e.uri)return null!==this.mediaIndex&&(e.endList||"number"!=typeof e.partTargetDuration?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");const a=e.mediaSequence-n.mediaSequence;if(this.logger_(`live window shift [${a}]`),null!==this.mediaIndex)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const e=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!e.parts||!e.parts.length||!e.parts[this.partIndex])){const e=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=e}}r&&(r.mediaIndex-=a,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex]),r.partIndex>=0&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(n,e)}pause(){this.checkBufferTimeout_&&(i().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return null===this.checkBufferTimeout_}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.resyncLoader()}resyncLoader(){this.transmuxer_&&Ho(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.shouldForceTimestampOffsetAfterResync_=!0,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,n=(()=>{}),r=!1){if(t===1/0&&(t=this.duration_()),t<=e)return void this.logger_("skipping remove because end ${end} is <= start ${start}");if(!this.sourceUpdater_||!this.getMediaInfo_())return void this.logger_("skipping remove because no source updater or starting media info");let i=1;const a=()=>{i--,0===i&&n()};!r&&this.audioDisabled_||(i++,this.sourceUpdater_.removeAudio(e,t,a)),(r||"main"===this.loaderType_)&&(this.gopBuffer_=((e,t,n,r)=>{const i=Math.ceil((t-r)*dt.ONE_SECOND_IN_TS),a=Math.ceil((n-r)*dt.ONE_SECOND_IN_TS),s=e.slice();let o=e.length;for(;o--&&!(e[o].pts<=a););if(-1===o)return s;let l=o+1;for(;l--&&!(e[l].pts<=i););return l=Math.max(l,0),s.splice(l,o-l+1),s})(this.gopBuffer_,e,t,this.timeMapping_),i++,this.sourceUpdater_.removeVideo(e,t,a));for(const n in this.inbandTextTracks_)gl(e,t,this.inbandTextTracks_[n]);gl(e,t,this.segmentMetadataTrack_),a()}monitorBuffer_(){this.checkBufferTimeout_&&i().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=i().setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&i().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=i().setTimeout(this.monitorBufferTick_.bind(this),500)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();e&&("number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,n=this.partIndex){if(!t||!this.mediaSource_)return!1;const r="number"==typeof e&&t.segments[e],i=e+1===t.segments.length,a=!r||!r.parts||n+1===r.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&i&&a}chooseNextRequest_(){const e=this.buffered_(),t=Ns(e)||0,n=Os(e,this.currentTime_()),r=!this.hasPlayed_()&&n>=1,i=n>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||r||i)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const s={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(s.isSyncRequest)s.mediaIndex=function(e,t,n){t=t||[];const r=[];let i=0;for(let a=0;a<t.length;a++){const s=t[a];if(e===s.timeline&&(r.push(a),i+=s.duration,i>n))return a}return 0===r.length?0:r[r.length-1]}(this.currentTimeline_,a,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${s.mediaIndex}`);else if(null!==this.mediaIndex){const e=a[this.mediaIndex],n="number"==typeof this.partIndex?this.partIndex:-1;s.startOfSegment=e.end?e.end:t,e.parts&&e.parts[n+1]?(s.mediaIndex=this.mediaIndex,s.partIndex=n+1):s.mediaIndex=this.mediaIndex+1}else{const{segmentIndex:e,startTime:n,partIndex:r}=Ws.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?t:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});s.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${t}`:`currentTime ${this.currentTime_()}`,s.mediaIndex=e,s.startOfSegment=n,s.partIndex=r,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${s.mediaIndex} `)}const o=a[s.mediaIndex];let l=o&&"number"==typeof s.partIndex&&o.parts&&o.parts[s.partIndex];if(!o||"number"==typeof s.partIndex&&!l)return null;"number"!=typeof s.partIndex&&o.parts&&(s.partIndex=0,l=o.parts[0]);const u=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!n&&l&&!u&&!l.independent)if(0===s.partIndex){const e=a[s.mediaIndex-1],t=e.parts&&e.parts.length&&e.parts[e.parts.length-1];t&&t.independent&&(s.mediaIndex-=1,s.partIndex=e.parts.length-1,s.independent="previous segment")}else o.parts[s.partIndex-1].independent&&(s.partIndex-=1,s.independent="previous part");const c=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return s.mediaIndex>=a.length-1&&c&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,s.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(s))}generateSegmentInfo_(e){const{independent:t,playlist:n,mediaIndex:r,startOfSegment:i,isSyncRequest:a,partIndex:s,forceTimestampOffset:o,getMediaInfoForTime:l}=e,u=n.segments[r],c="number"==typeof s&&u.parts[s],d={requestId:"segment-loader-"+Math.random(),uri:c&&c.resolvedUri||u.resolvedUri,mediaIndex:r,partIndex:c?s:null,isSyncRequest:a,startOfSegment:i,playlist:n,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:u.timeline,duration:c&&c.duration||u.duration,segment:u,part:c,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:l,independent:t},f=void 0!==o?o:this.isPendingTimestampOffset_;d.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:u.timeline,currentTimeline:this.currentTimeline_,startOfSegment:i,buffered:this.buffered_(),overrideCheck:f});const h=Ns(this.sourceUpdater_.audioBuffered());return"number"==typeof h&&(d.audioAppendStart=h-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(d.gopsToAlignWith=((e,t,n)=>{if(null==t||!e.length)return[];const r=Math.ceil((t-n+3)*dt.ONE_SECOND_IN_TS);let i;for(i=0;i<e.length&&!(e[i].pts>r);i++);return e.slice(i)})(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),d}timestampOffsetForSegment_(e){return(({segmentTimeline:e,currentTimeline:t,startOfSegment:n,buffered:r,overrideCheck:i})=>i||e!==t?e<t?n:r.length?r.end(r.length-1):n:null)(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)return;if(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),n=e.bandwidth,r=this.pendingSegment_.duration,i=Ws.estimateSegmentRequestTime(r,n,this.playlist_,e.bytesReceived),a=function(e,t,n=1){return((e.length?e.end(e.length-1):0)-t)/n}(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(i<=a)return;const s=function(e){const{main:t,currentTime:n,bandwidth:r,duration:i,segmentDuration:a,timeUntilRebuffer:s,currentTimeline:o,syncController:l}=e,u=t.playlists.filter((e=>!Ws.isIncompatible(e)));let c=u.filter(Ws.isEnabled);c.length||(c=u.filter((e=>!Ws.isDisabled(e))));const d=c.filter(Ws.hasAttribute.bind(null,"BANDWIDTH")).map((e=>{const t=l.getSyncPoint(e,i,o,n)?1:2;return{playlist:e,rebufferingImpact:Ws.estimateSegmentRequestTime(a,r,e)*t-s}})),f=d.filter((e=>e.rebufferingImpact<=0));return ll(f,((e,t)=>ul(t.playlist,e.playlist))),f.length?f[0]:(ll(d,((e,t)=>e.rebufferingImpact-t.rebufferingImpact)),d[0]||null)}({main:this.vhs_.playlists.main,currentTime:t,bandwidth:n,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!s)return;const o=i-a-s.rebufferingImpact;let l=.5;a<=Ss&&(l=1),!s.playlist||s.playlist.uri===this.playlist_.uri||o<l||(this.bandwidth=s.playlist.attributes.BANDWIDTH*Po.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${vl(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId)||this.trigger("progress")}handleTrackInfo_(e,t){this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||this.checkForIllegalMediaSwitch(t)||(t=t||{},function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;const n=Object.keys(e).sort(),r=Object.keys(t).sort();if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++){const a=n[i];if(a!==r[i])return!1;if(e[a]!==t[a])return!1}return!0}(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),this.checkForAbort_(e.requestId)||(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()&&this.processCallQueue_()))}handleTimingInfo_(e,t,n,r){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const i=this.pendingSegment_,a=_l(t);i[a]=i[a]||{},i[a][n]=r,this.logger_(`timinginfo: ${t} - ${n} - ${r}`),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(0===t.length)return void this.logger_("SegmentLoader received no captions from a caption event");if(!this.pendingSegment_.hasAppendedData_)return void this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));const n=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),r={};t.forEach((e=>{r[e.stream]=r[e.stream]||{startTime:1/0,captions:[],endTime:0};const t=r[e.stream];t.startTime=Math.min(t.startTime,e.startTime+n),t.endTime=Math.max(t.endTime,e.endTime+n),t.captions.push(e)})),Object.keys(r).forEach((e=>{const{startTime:t,endTime:a,captions:s}=r[e],o=this.inbandTextTracks_;this.logger_(`adding cues from ${t} -> ${a} for ${e}`),function(e,t,n){if(!e[n]){t.trigger({type:"usage",name:"vhs-608"});let r=n;/^cc708_/.test(n)&&(r="SERVICE"+n.split("_")[1]);const i=t.textTracks().getTrackById(r);if(i)e[n]=i;else{let i=n,a=n,s=!1;const o=(t.options_.vhs&&t.options_.vhs.captionServices||{})[r];o&&(i=o.label,a=o.language,s=o.default),e[n]=t.addRemoteTextTrack({kind:"captions",id:r,default:s,label:i,language:a},!1).track}}}(o,this.vhs_.tech_,e),gl(t,a,o[e]),function({inbandTextTracks:e,captionArray:t,timestampOffset:n}){if(!t)return;const r=i().WebKitDataCue||i().VTTCue;t.forEach((t=>{const i=t.stream;t.content?t.content.forEach((a=>{const s=new r(t.startTime+n,t.endTime+n,a.text);s.line=a.line,s.align="left",s.position=a.position,s.positionAlign="line-left",e[i].addCue(s)})):e[i].addCue(new r(t.startTime+n,t.endTime+n,t.text))}))}({captionArray:s,inbandTextTracks:o,timestampOffset:n})})),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,n){this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||(this.pendingSegment_.hasAppendedData_?this.addMetadataToTextTrack(n,t,this.duration_()):this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,n)))}processMetadataQueue_(){this.metadataQueue_.id3.forEach((e=>e())),this.metadataQueue_.caption.forEach((e=>e())),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach((e=>e()))}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach((e=>e()))}hasEnoughInfoToLoad_(){if("audio"!==this.loaderType_)return!0;const e=this.pendingSegment_;return!(!e||this.getCurrentMediaInfo_()&&Tl({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready())return!1;if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:n,hasVideo:r,isMuxed:i}=t;return!(r&&!e.videoTimingInfo||n&&!this.audioDisabled_&&!i&&!e.audioTimingInfo||Tl({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_())return void this.callQueue_.push(this.handleData_.bind(this,e,t));const n=this.pendingSegment_;if(this.setTimeMapping_(n.timeline),this.updateMediaSecondsLoaded_(n.part||n.segment),"closed"!==this.mediaSource_.readyState){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),n.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),n.isFmp4=e.isFmp4,n.timingInfo=n.timingInfo||{},n.isFmp4)this.trigger("fmp4"),n.timingInfo.start=n[_l(t.type)].start;else{const e=this.getCurrentMediaInfo_(),t="main"===this.loaderType_&&e&&e.hasVideo;let r;t&&(r=n.videoTimingInfo.start),n.timingInfo.start=this.trueSegmentStart_({currentStart:n.timingInfo.start,playlist:n.playlist,mediaIndex:n.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:t,firstVideoFrameTimeForData:r,videoTimingInfo:n.videoTimingInfo,audioTimingInfo:n.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(n,t.type),this.updateSourceBufferTimestampOffset_(n),n.isSyncRequest){this.updateTimingInfoEnd_(n),this.syncController_.saveSegmentTimingInfo({segmentInfo:n,shouldSaveTimelineMapping:"main"===this.loaderType_});const e=this.chooseNextRequest_();if(e.mediaIndex!==n.mediaIndex||e.partIndex!==n.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}n.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(n,t)}}updateAppendInitSegmentStatus(e,t){"main"!==this.loaderType_||"number"!=typeof e.timestampOffset||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:n,playlist:r}){if(n){const e=To(n);if(this.activeInitSegmentId_===e)return null;t=this.initSegmentForMap(n,!0).bytes,this.activeInitSegmentId_=e}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=r,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:n},r){const a=this.sourceUpdater_.audioBuffered(),s=this.sourceUpdater_.videoBuffered();a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Ds(a).join(", ")),s.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Ds(s).join(", "));const o=a.length?a.start(0):0,l=a.length?a.end(a.length-1):0,u=s.length?s.start(0):0,c=s.length?s.end(s.length-1):0;if(l-o<=1&&c-u<=1)return this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${n.byteLength}, audio buffer: ${Ds(a).join(", ")}, video buffer: ${Ds(s).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:n}));const d=this.currentTime_()-1;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${d}`),this.remove(0,d,(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=i().setTimeout((()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()}),1e3)}),!0)}handleAppendError_({segmentInfo:e,type:t,bytes:n},r){r&&(22!==r.code?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error(`${t} append of ${n.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:n}))}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:n,data:r,bytes:i}){if(!i){const e=[r];let t=r.byteLength;n&&(e.unshift(n),t+=n.byteLength),i=(e=>{let t,n=0;return e.bytes&&(t=new Uint8Array(e.bytes),e.segments.forEach((e=>{t.set(e,n),n+=e.byteLength}))),t})({bytes:t,segments:e})}this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:i},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:i}))}handleSegmentTimingInfo_(e,t,n){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const r=this.pendingSegment_.segment,i=`${e}TimingInfo`;r[i]||(r[i]={}),r[i].transmuxerPrependedSeconds=n.prependedContentDuration||0,r[i].transmuxedPresentationStart=n.start.presentation,r[i].transmuxedDecodeStart=n.start.decode,r[i].transmuxedPresentationEnd=n.end.presentation,r[i].transmuxedDecodeEnd=n.end.decode,r[i].baseMediaDecodeTime=n.baseMediaDecodeTime}appendData_(e,t){const{type:n,data:r}=t;if(!r||!r.byteLength)return;if("audio"===n&&this.audioDisabled_)return;const i=this.getInitSegmentAndUpdateState_({type:n,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:n,initSegment:i,data:r})}loadSegment_(e){this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(e):this.loadQueue_.push((()=>{const t=(0,g.Z)({},e,{forceTimestampOffset:!0});(0,g.Z)(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)}))}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),n=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=null!==this.mediaIndex,i=e.timeline!==this.currentTimeline_&&e.timeline>0,a=n||r&&i;this.logger_(`Requesting ${vl(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=Jo({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:a,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:t,level:n,stream:r})=>{this.logger_(`${vl(e)} logged from transmuxer stream ${r} as a ${n}: ${t}`)}})}trimBackBuffer_(e){const t=((e,t,n)=>{let r=t-Po.BACK_BUFFER_LENGTH;e.length&&(r=Math.max(r,e.start(0)));const i=t-n;return Math.min(i,r)})(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,n=e.part,r={resolvedUri:n?n.resolvedUri:t.resolvedUri,byterange:n?n.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},i=e.playlist.segments[e.mediaIndex-1];if(i&&i.timeline===t.timeline&&(i.videoTimingInfo?r.baseStartTime=i.videoTimingInfo.transmuxedDecodeEnd:i.audioTimingInfo&&(r.baseStartTime=i.audioTimingInfo.transmuxedDecodeEnd)),t.key){const n=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);r.key=this.segmentKey(t.key),r.key.iv=n}return t.map&&(r.map=this.initSegmentForMap(t.map)),r}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){this.pendingSegment_.byteLength=t.bytesReceived,e<yl?this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record 0.016666666666666666`):(this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime)}handleTimeout_(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")}segmentRequestFinished_(e,t,n){if(this.callQueue_.length)return void this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,n));if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return;if(t.requestId!==this.pendingSegment_.requestId)return;if(e){if(this.pendingSegment_=null,this.state="READY",e.code===Yo)return;return this.pause(),e.code===Vo?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error"))}const r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),r.endOfAllRequests=t.endOfAllRequests,n.gopInfo&&(this.gopBuffer_=((e,t,n)=>{if(!t.length)return e;if(n)return t.slice();const r=t[0].pts;let i=0;for(;i<e.length&&!(e[i].pts>=r);i++);return e.slice(0,i).concat(t)})(this.gopBuffer_,n.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(r)}setTimeMapping_(e){const t=this.syncController_.mappingForTimeline(e);null!==t&&(this.timeMapping_=t)}updateMediaSecondsLoaded_(e){"number"==typeof e.start&&"number"==typeof e.end?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration}shouldUpdateTransmuxerTimestampOffset_(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())}trueSegmentStart_({currentStart:e,playlist:t,mediaIndex:n,firstVideoFrameTimeForData:r,currentVideoTimestampOffset:i,useVideoTimingInfo:a,videoTimingInfo:s,audioTimingInfo:o}){if(void 0!==e)return e;if(!a)return o.start;const l=t.segments[n-1];return 0!==n&&l&&void 0!==l.start&&l.end===r+i?s.start:r}waitForAppendsToComplete_(e){const t=this.getCurrentMediaInfo_(e);if(!t)return this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),void this.trigger("error");const{hasAudio:n,hasVideo:r,isMuxed:i}=t,a="main"===this.loaderType_&&r,s=!this.audioDisabled_&&n&&!i;if(e.waitingOnAppends=0,!e.hasAppendedData_)return e.timingInfo||"number"!=typeof e.timestampOffset||(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),void this.checkAppendsDone_(e);a&&e.waitingOnAppends++,s&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),s&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=((e,t,n)=>"main"===e&&t&&n?n.hasAudio||n.hasVideo?t.hasVideo&&!n.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!t.hasVideo&&n.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null)(this.loaderType_,this.getCurrentMediaInfo_(),e);return!!t&&(this.error({message:t,playlistExclusionDuration:1/0}),this.trigger("error"),!0)}updateSourceBufferTimestampOffset_(e){if(null===e.timestampOffset||"number"!=typeof e.timingInfo.start||e.changedTimestampOffset||"main"!==this.loaderType_)return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:n}){return this.useDtsForTimestampOffset_?e&&"number"==typeof e.transmuxedDecodeStart?e.transmuxedDecodeStart:t&&"number"==typeof t.transmuxedDecodeStart?t.transmuxedDecodeStart:n.start:n.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),n="main"===this.loaderType_&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;n&&(e.timingInfo.end="number"==typeof n.end?n.end:n.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());const e=this.pendingSegment_;this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});const t=((e,t)=>{if("hls"!==t)return null;const n=(e=>{let t=0;return["video","audio"].forEach((function(n){const r=e[`${n}TimingInfo`];if(!r)return;const{start:a,end:s}=r;let o;"bigint"==typeof a||"bigint"==typeof s?o=i().BigInt(s)-i().BigInt(a):"number"==typeof a&&"number"==typeof s&&(o=s-a),void 0!==o&&o>t&&(t=o)})),"bigint"==typeof t&&t<Number.MAX_SAFE_INTEGER&&(t=Number(t)),t})({audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo});if(!n)return null;const r=e.playlist.targetDuration,a=El({segmentDuration:n,maxDuration:2*r}),s=El({segmentDuration:n,maxDuration:r}),o=`Segment with index ${e.mediaIndex} from playlist ${e.playlist.id} has a duration of ${n} when the reported duration is ${e.duration} and the target duration is ${r}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return a||s?{severity:a?"warn":"info",message:o}:null})(e,this.sourceType_);if(t&&("warn"===t.severity?hs.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_))return void this.logger_(`Throwing away un-appended sync request ${vl(e)}`);this.logger_(`Appended ${vl(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),"main"!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const n=e.segment,r=e.part,a=n.end&&this.currentTime_()-n.end>3*e.playlist.targetDuration,s=r&&r.end&&this.currentTime_()-r.end>3*e.playlist.partTargetDuration;if(a||s)return this.logger_(`bad ${a?"segment":"part"} ${vl(e)}`),void this.resetEverything();null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duration<yl)return void this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record 0.016666666666666666`);const t=this.throughput.rate,n=Date.now()-e.endOfAllRequests+1,r=Math.floor(e.byteLength/n*8*1e3);this.throughput.rate+=(r-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;const t=e.segment,n=t.start,r=t.end;if(!ml(n)||!ml(r))return;gl(n,r,this.segmentMetadataTrack_);const a=i().WebKitDataCue||i().VTTCue,s={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,programDateTime:t.programDateTime,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:n,end:r},o=new a(n,r,JSON.stringify(s));o.value=s,this.segmentMetadataTrack_.addCue(o)}}function Sl(){}const Al=function(e){return"string"!=typeof e?e:e.replace(/./,(e=>e.toUpperCase()))},wl=["video","audio"],Il=(e,t)=>{const n=t[`${e}Buffer`];return n&&n.updating||t.queuePending[e]},Cl=(e,t)=>{if(0===t.queue.length)return;let n=0,r=t.queue[n];if("mediaSource"!==r.type){if("mediaSource"!==e&&t.ready()&&"closed"!==t.mediaSource.readyState&&!Il(e,t)){if(r.type!==e){if(n=((e,t)=>{for(let n=0;n<t.length;n++){const r=t[n];if("mediaSource"===r.type)return null;if(r.type===e)return n}return null})(e,t.queue),null===n)return;r=t.queue[n]}return t.queue.splice(n,1),t.queuePending[e]=r,r.action(e,t),r.doneFn?void 0:(t.queuePending[e]=null,void Cl(e,t))}}else t.updating()||"closed"===t.mediaSource.readyState||(t.queue.shift(),r.action(t),r.doneFn&&r.doneFn(),Cl("audio",t),Cl("video",t))},Rl=(e,t)=>{const n=t[`${e}Buffer`],r=Al(e);n&&(n.removeEventListener("updateend",t[`on${r}UpdateEnd_`]),n.removeEventListener("error",t[`on${r}Error_`]),t.codecs[e]=null,t[`${e}Buffer`]=null)},Dl=(e,t)=>e&&t&&-1!==Array.prototype.indexOf.call(e.sourceBuffers,t),Nl=(e,t,n)=>(r,i)=>{const a=i[`${r}Buffer`];if(Dl(i.mediaSource,a)){i.logger_(`Appending segment ${t.mediaIndex}'s ${e.length} bytes to ${r}Buffer`);try{a.appendBuffer(e)}catch(e){i.logger_(`Error with code ${e.code} `+(22===e.code?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${t.mediaIndex} to ${r}Buffer`),i.queuePending[r]=null,n(e)}}},Ol=(e,t)=>(n,r)=>{const i=r[`${n}Buffer`];if(Dl(r.mediaSource,i)){r.logger_(`Removing ${e} to ${t} from ${n}Buffer`);try{i.remove(e,t)}catch(i){r.logger_(`Remove ${e} to ${t} from ${n}Buffer failed`)}}},Pl=e=>(t,n)=>{const r=n[`${t}Buffer`];Dl(n.mediaSource,r)&&(n.logger_(`Setting ${t}timestampOffset to ${e}`),r.timestampOffset=e)},Ml=e=>(t,n)=>{e()},xl=e=>t=>{if("open"===t.mediaSource.readyState){t.logger_(`Calling mediaSource endOfStream(${e||""})`);try{t.mediaSource.endOfStream(e)}catch(e){hs.log.warn("Failed to call media source endOfStream",e)}}},Ll=e=>t=>{t.logger_(`Setting mediaSource duration to ${e}`);try{t.mediaSource.duration=e}catch(e){hs.log.warn("Failed to set media source duration",e)}},kl=(e,t)=>n=>{const r=Al(e),i=L(t);n.logger_(`Adding ${e}Buffer with codec ${t} to mediaSource`);const a=n.mediaSource.addSourceBuffer(i);a.addEventListener("updateend",n[`on${r}UpdateEnd_`]),a.addEventListener("error",n[`on${r}Error_`]),n.codecs[e]=t,n[`${e}Buffer`]=a},Fl=e=>t=>{const n=t[`${e}Buffer`];if(Rl(e,t),Dl(t.mediaSource,n)){t.logger_(`Removing ${e}Buffer with codec ${t.codecs[e]} from mediaSource`);try{t.mediaSource.removeSourceBuffer(n)}catch(t){hs.log.warn(`Failed to removeSourceBuffer ${e}Buffer`,t)}}},Ul=e=>(t,n)=>{const r=n[`${t}Buffer`],i=L(e);Dl(n.mediaSource,r)&&n.codecs[t]!==e&&(n.logger_(`changing ${t}Buffer codec from ${n.codecs[t]} to ${e}`),r.changeType(i),n.codecs[t]=e)},Bl=({type:e,sourceUpdater:t,action:n,doneFn:r,name:i})=>{t.queue.push({type:e,action:n,doneFn:r,name:i}),Cl(e,t)},jl=(e,t)=>n=>{if(t.queuePending[e]){const n=t.queuePending[e].doneFn;t.queuePending[e]=null,n&&n(t[`${e}Error_`])}Cl(e,t)};class ql extends hs.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>Cl("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=Ts("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=jl("video",this),this.onAudioUpdateEnd_=jl("audio",this),this.onVideoError_=e=>{this.videoError_=e},this.onAudioError_=e=>{this.audioError_=e},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){Bl({type:"mediaSource",sourceUpdater:this,action:kl(e,t),name:"addSourceBuffer"})}abort(e){Bl({type:e,sourceUpdater:this,action:(e,t)=>{if("open"!==t.mediaSource.readyState)return;const n=t[`${e}Buffer`];if(Dl(t.mediaSource,n)){t.logger_(`calling abort on ${e}Buffer`);try{n.abort()}catch(t){hs.log.warn(`Failed to abort on ${e}Buffer`,t)}}},name:"abort"})}removeSourceBuffer(e){this.canRemoveSourceBuffer()?Bl({type:"mediaSource",sourceUpdater:this,action:Fl(e),name:"removeSourceBuffer"}):hs.log.error("removeSourceBuffer is not supported!")}canRemoveSourceBuffer(){return!hs.browser.IS_FIREFOX&&i().MediaSource&&i().MediaSource.prototype&&"function"==typeof i().MediaSource.prototype.removeSourceBuffer}static canChangeType(){return i().SourceBuffer&&i().SourceBuffer.prototype&&"function"==typeof i().SourceBuffer.prototype.changeType}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){this.canChangeType()?Bl({type:e,sourceUpdater:this,action:Ul(t),name:"changeType"}):hs.log.error("changeType is not supported!")}addOrChangeSourceBuffers(e){if(!e||"object"!=typeof e||0===Object.keys(e).length)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach((t=>{const n=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,n);this.canChangeType()&&this.changeType(t,n)}))}appendBuffer(e,t){const{segmentInfo:n,type:r,bytes:i}=e;if(this.processedAppend_=!0,"audio"===r&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([e,t]),void this.logger_(`delayed audio append of ${i.length} until video append`);if(Bl({type:r,sourceUpdater:this,action:Nl(i,n||{mediaIndex:-1},t),doneFn:t,name:"appendBuffer"}),"video"===r){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const e=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${e.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,e.forEach((e=>{this.appendBuffer.apply(this,e)}))}}audioBuffered(){return Dl(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:bs()}videoBuffered(){return Dl(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:bs()}buffered(){const e=Dl(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=Dl(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():function(e,t){let n=null,r=null,i=0;const a=[],s=[];if(!(e&&e.length&&t&&t.length))return bs();let o=e.length;for(;o--;)a.push({time:e.start(o),type:"start"}),a.push({time:e.end(o),type:"end"});for(o=t.length;o--;)a.push({time:t.start(o),type:"start"}),a.push({time:t.end(o),type:"end"});for(a.sort((function(e,t){return e.time-t.time})),o=0;o<a.length;o++)"start"===a[o].type?(i++,2===i&&(n=a[o].time)):"end"===a[o].type&&(i--,1===i&&(r=a[o].time)),null!==n&&null!==r&&(s.push([n,r]),n=null,r=null);return bs(s)}(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=Sl){Bl({type:"mediaSource",sourceUpdater:this,action:Ll(e),name:"duration",doneFn:t})}endOfStream(e=null,t=Sl){"string"!=typeof e&&(e=void 0),Bl({type:"mediaSource",sourceUpdater:this,action:xl(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,n=Sl){this.audioBuffered().length&&0!==this.audioBuffered().end(0)?Bl({type:"audio",sourceUpdater:this,action:Ol(e,t),doneFn:n,name:"remove"}):n()}removeVideo(e,t,n=Sl){this.videoBuffered().length&&0!==this.videoBuffered().end(0)?Bl({type:"video",sourceUpdater:this,action:Ol(e,t),doneFn:n,name:"remove"}):n()}updating(){return!(!Il("audio",this)&&!Il("video",this))}audioTimestampOffset(e){return void 0!==e&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(Bl({type:"audio",sourceUpdater:this,action:Pl(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return void 0!==e&&this.videoBuffer&&this.videoTimestampOffset!==e&&(Bl({type:"video",sourceUpdater:this,action:Pl(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&Bl({type:"audio",sourceUpdater:this,action:Ml(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&Bl({type:"video",sourceUpdater:this,action:Ml(e),name:"callback"})}dispose(){this.trigger("dispose"),wl.forEach((e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`]((()=>Rl(e,this)))})),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const Hl=e=>decodeURIComponent(escape(String.fromCharCode.apply(null,e))),Gl=new Uint8Array("\n\n".split("").map((e=>e.charCodeAt(0))));class Vl extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class Yl extends bl{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.loaderType_="subtitle",this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}createTransmuxer_(){return null}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return bs();const e=this.subtitlesTrack_.cues;return bs([[e[0].startTime,e[e.length-1].startTime]])}initSegmentForMap(e,t=!1){if(!e)return null;const n=To(e);let r=this.initSegments_[n];if(t&&!r&&e.bytes){const t=Gl.byteLength+e.bytes.byteLength,i=new Uint8Array(t);i.set(e.bytes),i.set(Gl,e.bytes.byteLength),this.initSegments_[n]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:i}}return r||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return void 0===e||(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_}remove(e,t){gl(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(null===this.syncController_.timestampOffsetForTimeline(e.timeline)){const e=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};return this.syncController_.one("timestampoffset",e),void(this.state="WAITING_ON_TIMELINE")}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,n){if(!this.subtitlesTrack_)return void(this.state="READY");if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===Vo&&this.handleTimeout_(),e.code===Yo?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);const r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const a=r.segment;if(a.map&&(a.map.bytes=t.map.bytes),r.bytes=t.bytes,"function"!=typeof i().WebVTT&&"function"==typeof this.loadVttJs)return this.state="WAITING_ON_VTTJS",void this.loadVttJs().then((()=>this.segmentRequestFinished_(e,t,n)),(()=>this.stopForError({message:"Error loading vtt.js"})));a.requested=!0;try{this.parseVTTCues_(r)}catch(e){return void this.stopForError({message:e.message})}if(this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=a.duration,r.cues.forEach((e=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new(i().VTTCue)(e.startTime,e.endTime,e.text):e)})),function(e){const t=e.cues;if(!t)return;const n={};for(let r=t.length-1;r>=0;r--){const i=t[r],a=`${i.startTime}-${i.endTime}-${i.text}`;n[a]?e.removeCue(i):n[a]=i}}(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(e){let t,n=!1;if("function"!=typeof i().WebVTT)throw new Vl;"function"==typeof i().TextDecoder?t=new(i().TextDecoder)("utf8"):(t=i().WebVTT.StringDecoder(),n=!0);const r=new(i().WebVTT.Parser)(i(),i().vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=t=>{e.timestampmap=t},r.onparsingerror=e=>{hs.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){let t=e.segment.map.bytes;n&&(t=Hl(t)),r.parse(t)}let a=e.bytes;n&&(a=Hl(a)),r.parse(a),r.flush()}updateTimeMapping_(e,t,n){const r=e.segment;if(!t)return;if(!e.cues.length)return void(r.empty=!0);const i=e.timestampmap,a=i.MPEGTS/dt.ONE_SECOND_IN_TS-i.LOCAL+t.mapping;if(e.cues.forEach((e=>{e.startTime+=a,e.endTime+=a})),!n.syncInfo){const t=e.cues[0].startTime,i=e.cues[e.cues.length-1].startTime;n.syncInfo={mediaSequence:n.mediaSequence+e.mediaIndex,time:Math.min(t,i-r.duration)}}}}const Zl=function(e,t){const n=e.cues;for(let e=0;e<n.length;e++){const r=n[e];if(t>=r.adStartTime&&t<=r.adEndTime)return r}return null},Kl=[{name:"VOD",run:(e,t,n,r,i)=>n!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(e,t,n,r,i,a)=>{if(!a)return null;const s=e.getMediaSequenceMap(a);if(!s||0===s.size)return null;if(void 0===t.mediaSequence||!Array.isArray(t.segments)||!t.segments.length)return null;let o=t.mediaSequence,l=0;for(const e of t.segments){const t=s.get(o);if(!t)break;if(i>=t.start&&i<t.end){if(Array.isArray(e.parts)&&e.parts.length){let n=t.start,r=0;for(const a of e.parts){const e=n,s=e+a.duration;if(i>=e&&i<s)return{time:t.start,segmentIndex:l,partIndex:r};r++,n=s}}return{time:t.start,segmentIndex:l,partIndex:null}}l++,o++}return null}},{name:"ProgramDateTime",run:(e,t,n,r,i)=>{if(!Object.keys(e.timelineToDatetimeMappings).length)return null;let a=null,s=null;const o=Ms(t);i=i||0;for(let n=0;n<o.length;n++){const r=o[t.endList||0===i?n:o.length-(n+1)],l=r.segment,u=e.timelineToDatetimeMappings[l.timeline];if(!u||!l.dateTimeObject)continue;let c=l.dateTimeObject.getTime()/1e3+u;if(l.parts&&"number"==typeof r.partIndex)for(let e=0;e<r.partIndex;e++)c+=l.parts[e].duration;const d=Math.abs(i-c);if(null!==s&&(0===d||s<d))break;s=d,a={time:c,segmentIndex:r.segmentIndex,partIndex:r.partIndex}}return a}},{name:"Segment",run:(e,t,n,r,i)=>{let a=null,s=null;i=i||0;const o=Ms(t);for(let e=0;e<o.length;e++){const n=o[t.endList||0===i?e:o.length-(e+1)],l=n.segment,u=n.part&&n.part.start||l&&l.start;if(l.timeline===r&&void 0!==u){const e=Math.abs(i-u);if(null!==s&&s<e)break;(!a||null===s||s>=e)&&(s=e,a={time:u,segmentIndex:n.segmentIndex,partIndex:n.partIndex})}}return a}},{name:"Discontinuity",run:(e,t,n,r,i)=>{let a=null;if(i=i||0,t.discontinuityStarts&&t.discontinuityStarts.length){let n=null;for(let r=0;r<t.discontinuityStarts.length;r++){const s=t.discontinuityStarts[r],o=t.discontinuitySequence+r+1,l=e.discontinuities[o];if(l){const e=Math.abs(i-l.time);if(null!==n&&n<e)break;(!a||null===n||n>=e)&&(n=e,a={time:l.time,segmentIndex:s,partIndex:null})}}}return a}},{name:"Playlist",run:(e,t,n,r,i)=>t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}];class zl extends hs.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={},this.mediaSequenceStorage_=new Map,this.logger_=Ts("SyncController")}getMediaSequenceMap(e){return this.mediaSequenceStorage_.get(e)}updateMediaSequenceMap(e,t,n){if(void 0===e.mediaSequence||!Array.isArray(e.segments)||!e.segments.length)return;const r=this.getMediaSequenceMap(n),i=new Map;let a,s=e.mediaSequence;r?r.has(e.mediaSequence)?a=r.get(e.mediaSequence).start:(this.logger_(`MediaSequence sync for ${n} segment loader - received a gap between playlists.\nFallback base time to: ${t}.\nReceived media sequence: ${s}.\nCurrent map: `,r),a=t):a=0,this.logger_(`MediaSequence sync for ${n} segment loader.\nReceived media sequence: ${s}.\nbase time is ${a}\nCurrent map: `,r),e.segments.forEach((e=>{const t=a,n=t+e.duration,r={start:t,end:n};i.set(s,r),s++,a=n})),this.mediaSequenceStorage_.set(n,i)}getSyncPoint(e,t,n,r,i){if(t!==1/0)return Kl.find((({name:e})=>"VOD"===e)).run(this,e,t);const a=this.runStrategies_(e,t,n,r,i);if(!a.length)return null;for(const t of a){const{syncPoint:n,strategy:i}=t,{segmentIndex:a,time:s}=n;if(a<0)continue;const o=s,l=o+e.segments[a].duration;if(this.logger_(`Strategy: ${i}. Current time: ${r}. selected segment: ${a}. Time: [${o} -> ${l}]}`),r>=o&&r<l)return this.logger_("Found sync point with exact match: ",n),n}return this.selectSyncPoint_(a,{key:"time",value:r})}getExpiredTime(e,t){if(!e||!e.segments)return null;const n=this.runStrategies_(e,t,e.discontinuitySequence,0,"main");if(!n.length)return null;const r=this.selectSyncPoint_(n,{key:"segmentIndex",value:0});return r.segmentIndex>0&&(r.time*=-1),Math.abs(r.time+Bs({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,n,r,i){const a=[];for(let s=0;s<Kl.length;s++){const o=Kl[s],l=o.run(this,e,t,n,r,i);l&&(l.strategy=o.name,a.push({strategy:o.name,syncPoint:l}))}return a}selectSyncPoint_(e,t){let n=e[0].syncPoint,r=Math.abs(e[0].syncPoint[t.key]-t.value),i=e[0].strategy;for(let a=1;a<e.length;a++){const s=Math.abs(e[a].syncPoint[t.key]-t.value);s<r&&(r=s,n=e[a].syncPoint,i=e[a].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${i}]: [time:${n.time}, segmentIndex:${n.segmentIndex}`+("number"==typeof n.partIndex?`,partIndex:${n.partIndex}`:"")+"]"),n}saveExpiredSegmentInfo(e,t){const n=t.mediaSequence-e.mediaSequence;if(n>86400)hs.log.warn(`Not saving expired segment info. Media sequence gap ${n} is too large.`);else for(let r=n-1;r>=0;r--){const n=e.segments[r];if(n&&void 0!==n.start){t.syncInfo={mediaSequence:e.mediaSequence+r,time:n.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],n=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-n}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const n=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),r=e.segment;n&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:r.start}));const i=r.dateTimeObject;r.discontinuity&&t&&i&&(this.timelineToDatetimeMappings[r.timeline]=-i.getTime()/1e3)}timestampOffsetForTimeline(e){return void 0===this.timelines[e]?null:this.timelines[e].time}mappingForTimeline(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,n){const r=e.segment,i=e.part;let a,s,o=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)o={time:e.startOfSegment,mapping:e.startOfSegment-t.start},n&&(this.timelines[e.timeline]=o,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${o.time}] [mapping: ${o.mapping}]`)),a=e.startOfSegment,s=t.end+o.mapping;else{if(!o)return!1;a=t.start+o.mapping,s=t.end+o.mapping}return i&&(i.start=a,i.end=s),(!r.start||a<r.start)&&(r.start=a),r.end=s,!0}saveDiscontinuitySyncInfo_(e){const t=e.playlist,n=e.segment;if(n.discontinuity)this.discontinuities[n.timeline]={time:n.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(let r=0;r<t.discontinuityStarts.length;r++){const i=t.discontinuityStarts[r],a=t.discontinuitySequence+r+1,s=i-e.mediaIndex,o=Math.abs(s);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>o){let r;r=s<0?n.start-Bs({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:i}):n.end+Bs({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:i}),this.discontinuities[a]={time:r,accuracy:o}}}}dispose(){this.trigger("dispose"),this.off()}}class Wl extends hs.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:n}){return"number"==typeof t&&"number"==typeof n&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:n},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:n}){return"number"==typeof t&&"number"==typeof n&&(this.lastTimelineChanges_[e]={type:e,from:t,to:n},delete this.pendingTimelineChanges_[e],this.trigger("timelinechange")),this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const Xl=Lo(ko((function(){var e=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var n=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(n,1),n>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var n=t.length,r=0;r<n;++r)t[r].call(this,arguments[1]);else for(var i=Array.prototype.slice.call(arguments,1),a=t.length,s=0;s<a;++s)t[s].apply(this,i)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}();let t=null;class r{constructor(e){let n,r,i;t||(t=function(){const e=[[[],[],[],[],[]],[[],[],[],[],[]]],t=e[0],n=e[1],r=t[4],i=n[4];let a,s,o;const l=[],u=[];let c,d,f,h,p,g;for(a=0;a<256;a++)u[(l[a]=a<<1^283*(a>>7))^a]=a;for(s=o=0;!r[s];s^=c||1,o=u[o]||1)for(h=o^o<<1^o<<2^o<<3^o<<4,h=h>>8^255&h^99,r[s]=h,i[h]=s,f=l[d=l[c=l[s]]],g=16843009*f^65537*d^257*c^16843008*s,p=257*l[h]^16843008*h,a=0;a<4;a++)t[a][s]=p=p<<24^p>>>8,n[a][h]=g=g<<24^g>>>8;for(a=0;a<5;a++)t[a]=t[a].slice(0),n[a]=n[a].slice(0);return e}()),this._tables=[[t[0][0].slice(),t[0][1].slice(),t[0][2].slice(),t[0][3].slice(),t[0][4].slice()],[t[1][0].slice(),t[1][1].slice(),t[1][2].slice(),t[1][3].slice(),t[1][4].slice()]];const a=this._tables[0][4],s=this._tables[1],o=e.length;let l=1;if(4!==o&&6!==o&&8!==o)throw new Error("Invalid aes key size");const u=e.slice(0),c=[];for(this._key=[u,c],n=o;n<4*o+28;n++)i=u[n-1],(n%o==0||8===o&&n%o==4)&&(i=a[i>>>24]<<24^a[i>>16&255]<<16^a[i>>8&255]<<8^a[255&i],n%o==0&&(i=i<<8^i>>>24^l<<24,l=l<<1^283*(l>>7))),u[n]=u[n-o]^i;for(r=0;n;r++,n--)i=u[3&r?n:n-4],c[r]=n<=4||r<4?i:s[0][a[i>>>24]]^s[1][a[i>>16&255]]^s[2][a[i>>8&255]]^s[3][a[255&i]]}decrypt(e,t,n,r,i,a){const s=this._key[1];let o,l,u,c=e^s[0],d=r^s[1],f=n^s[2],h=t^s[3];const p=s.length/4-2;let g,m=4;const y=this._tables[1],v=y[0],_=y[1],T=y[2],E=y[3],b=y[4];for(g=0;g<p;g++)o=v[c>>>24]^_[d>>16&255]^T[f>>8&255]^E[255&h]^s[m],l=v[d>>>24]^_[f>>16&255]^T[h>>8&255]^E[255&c]^s[m+1],u=v[f>>>24]^_[h>>16&255]^T[c>>8&255]^E[255&d]^s[m+2],h=v[h>>>24]^_[c>>16&255]^T[d>>8&255]^E[255&f]^s[m+3],m+=4,c=o,d=l,f=u;for(g=0;g<4;g++)i[(3&-g)+a]=b[c>>>24]<<24^b[d>>16&255]<<16^b[f>>8&255]<<8^b[255&h]^s[m++],o=c,c=d,d=f,f=h,h=o}}class i extends e{constructor(){super(e),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const a=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24};class s{constructor(e,t,n,r){const o=s.STEP,l=new Int32Array(e.buffer),u=new Uint8Array(e.byteLength);let c=0;for(this.asyncStream_=new i,this.asyncStream_.push(this.decryptChunk_(l.subarray(c,c+o),t,n,u)),c=o;c<l.length;c+=o)n=new Uint32Array([a(l[c-4]),a(l[c-3]),a(l[c-2]),a(l[c-1])]),this.asyncStream_.push(this.decryptChunk_(l.subarray(c,c+o),t,n,u));this.asyncStream_.push((function(){var e;r(null,(e=u).subarray(0,e.byteLength-e[e.byteLength-1]))}))}static get STEP(){return 32e3}decryptChunk_(e,t,n,i){return function(){const s=function(e,t,n){const i=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),s=new r(Array.prototype.slice.call(t)),o=new Uint8Array(e.byteLength),l=new Int32Array(o.buffer);let u,c,d,f,h,p,g,m,y;for(u=n[0],c=n[1],d=n[2],f=n[3],y=0;y<i.length;y+=4)h=a(i[y]),p=a(i[y+1]),g=a(i[y+2]),m=a(i[y+3]),s.decrypt(h,p,g,m,l,y),l[y]=a(l[y]^u),l[y+1]=a(l[y+1]^c),l[y+2]=a(l[y+2]^d),l[y+3]=a(l[y+3]^f),u=h,c=p,d=g,f=m;return o}(e,t,n);i.set(s,e.byteOffset)}}}var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},l=("undefined"!=typeof window?window:void 0!==o?o:"undefined"!=typeof self?self:{}).BigInt||Number;l("0x1"),l("0x100"),l("0x10000"),l("0x1000000"),l("0x100000000"),l("0x10000000000"),l("0x1000000000000"),l("0x100000000000000"),l("0x10000000000000000"),function(){var e=new Uint16Array([65484]),t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);255===t[0]||t[0]}();self.onmessage=function(e){const t=e.data,n=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),r=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),i=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new s(n,r,i,(function(e,n){self.postMessage(function(e){const t={};return Object.keys(e).forEach((n=>{const r=e[n];var i;i=r,("function"===ArrayBuffer.isView?ArrayBuffer.isView(i):i&&i.buffer instanceof ArrayBuffer)?t[n]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:t[n]=r})),t}({source:t.source,decrypted:n}),[n.buffer])}))}})));var $l=xo(Xl);const Ql=e=>{let t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},Jl=(e,t)=>{e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},eu=(e,t)=>{t.activePlaylistLoader=e,e.load()},tu={AUDIO:(e,t)=>()=>{const{mediaTypes:{[e]:n},excludePlaylist:r}=t,i=n.activeTrack(),a=n.activeGroup(),s=(a.filter((e=>e.default))[0]||a[0]).id,o=n.tracks[s];if(i!==o){hs.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const e in n.tracks)n.tracks[e].enabled=n.tracks[e]===o;n.onTrackChanged()}else r({error:{message:"Problem encountered loading the default audio track."}})},SUBTITLES:(e,t)=>()=>{const{mediaTypes:{[e]:n}}=t;hs.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const r=n.activeTrack();r&&(r.mode="disabled"),n.onTrackChanged()}},nu={AUDIO:(e,t,n)=>{if(!t)return;const{tech:r,requestOptions:i,segmentLoaders:{[e]:a}}=n;t.on("loadedmetadata",(()=>{const e=t.media();a.playlist(e,i),(!r.paused()||e.endList&&"none"!==r.preload())&&a.load()})),t.on("loadedplaylist",(()=>{a.playlist(t.media(),i),r.paused()||a.load()})),t.on("error",tu[e](e,n))},SUBTITLES:(e,t,n)=>{const{tech:r,requestOptions:i,segmentLoaders:{[e]:a},mediaTypes:{[e]:s}}=n;t.on("loadedmetadata",(()=>{const e=t.media();a.playlist(e,i),a.track(s.activeTrack()),(!r.paused()||e.endList&&"none"!==r.preload())&&a.load()})),t.on("loadedplaylist",(()=>{a.playlist(t.media(),i),r.paused()||a.load()})),t.on("error",tu[e](e,n))}},ru={AUDIO:(e,t)=>{const{vhs:n,sourceType:r,segmentLoaders:{[e]:i},requestOptions:a,main:{mediaGroups:s},mediaTypes:{[e]:{groups:o,tracks:l,logger_:u}},mainPlaylistLoader:c}=t,d=zs(c.main);s[e]&&0!==Object.keys(s[e]).length||(s[e]={main:{default:{default:!0}}},d&&(s[e].main.default.playlists=c.main.playlists));for(const i in s[e]){o[i]||(o[i]=[]);for(const f in s[e][i]){let h,p=s[e][i][f];if(d?(u(`AUDIO group '${i}' label '${f}' is a main playlist`),p.isMainPlaylist=!0,h=null):h="vhs-json"===r&&p.playlists?new co(p.playlists[0],n,a):p.resolvedUri?new co(p.resolvedUri,n,a):p.playlists&&"dash"===r?new Oo(p.playlists[0],n,a,c):null,p=Es({id:f,playlistLoader:h},p),nu[e](e,p.playlistLoader,t),o[i].push(p),void 0===l[f]){const e=new hs.AudioTrack({id:f,kind:Ql(p),enabled:!1,language:p.language,default:p.default,label:f});l[f]=e}}}i.on("error",tu[e](e,t))},SUBTITLES:(e,t)=>{const{tech:n,vhs:r,sourceType:i,segmentLoaders:{[e]:a},requestOptions:s,main:{mediaGroups:o},mediaTypes:{[e]:{groups:l,tracks:u}},mainPlaylistLoader:c}=t;for(const a in o[e]){l[a]||(l[a]=[]);for(const d in o[e][a]){if(!r.options_.useForcedSubtitles&&o[e][a][d].forced)continue;let f,h=o[e][a][d];if("hls"===i)f=new co(h.resolvedUri,r,s);else if("dash"===i){if(!h.playlists.filter((e=>e.excludeUntil!==1/0)).length)return;f=new Oo(h.playlists[0],r,s,c)}else"vhs-json"===i&&(f=new co(h.playlists?h.playlists[0]:h.resolvedUri,r,s));if(h=Es({id:d,playlistLoader:f},h),nu[e](e,h.playlistLoader,t),l[a].push(h),void 0===u[d]){const e=n.addRemoteTextTrack({id:d,kind:"subtitles",default:h.default&&h.autoselect,language:h.language,label:d},!1).track;u[d]=e}}}a.on("error",tu[e](e,t))},"CLOSED-CAPTIONS":(e,t)=>{const{tech:n,main:{mediaGroups:r},mediaTypes:{[e]:{groups:i,tracks:a}}}=t;for(const t in r[e]){i[t]||(i[t]=[]);for(const s in r[e][t]){const o=r[e][t][s];if(!/^(?:CC|SERVICE)/.test(o.instreamId))continue;const l=n.options_.vhs&&n.options_.vhs.captionServices||{};let u={label:s,language:o.language,instreamId:o.instreamId,default:o.default&&o.autoselect};if(l[u.instreamId]&&(u=Es(u,l[u.instreamId])),void 0===u.default&&delete u.default,i[t].push(Es({id:s},o)),void 0===a[s]){const e=n.addRemoteTextTrack({id:u.instreamId,kind:"captions",default:u.default,language:u.language,label:u.label},!1).track;a[s]=e}}}}},iu=(e,t)=>{for(let n=0;n<e.length;n++){if(Zs(t,e[n]))return!0;if(e[n].playlists&&iu(e[n].playlists,t))return!0}return!1},au={AUDIO:(e,t)=>()=>{const{mediaTypes:{[e]:{tracks:n}}}=t;for(const e in n)if(n[e].enabled)return n[e];return null},SUBTITLES:(e,t)=>()=>{const{mediaTypes:{[e]:{tracks:n}}}=t;for(const e in n)if("showing"===n[e].mode||"hidden"===n[e].mode)return n[e];return null}};class su{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){1===e&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=vs(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map((e=>[e.ID,e]))))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class ou extends hs.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new su,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=Ts("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const n=t.serverUri||t.serverURL;if(!n)return this.logger_(`steering manifest URL is ${n}, cannot request steering manifest.`),void this.trigger("error");n.startsWith("data:")?this.decodeDataUriManifest_(n.substring(n.indexOf(",")+1)):(this.steeringManifest.reloadUri=vs(e,n),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering"))}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t)return;const n=e?t:this.getRequestURI(t);if(!n)return this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),void this.dispose();this.request_=this.xhr_({uri:n},((e,t)=>{if(e){if(410===t.status)return this.logger_(`manifest request 410 ${e}.`),this.logger_(`There will be no more content steering requests to ${n} this session.`),void this.excludedSteeringManifestURLs.add(n);if(429===t.status){const n=t.responseHeaders["retry-after"];return this.logger_(`manifest request 429 ${e}.`),this.logger_(`content steering will retry in ${n} seconds.`),void this.startTTLTimeout_(parseInt(n,10))}return this.logger_(`manifest failed to load ${e}.`),void this.startTTLTimeout_()}const r=JSON.parse(this.request_.responseText);this.assignSteeringProperties_(r),this.startTTLTimeout_()}))}setProxyServerUrl_(e){const t=new(i().URL)(e),n=new(i().URL)(this.proxyServerUrl_);return n.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(n.toString())}decodeDataUriManifest_(e){const t=JSON.parse(i().atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new(i().URL)(e),n=this.getPathway(),r=this.getBandwidth_();if(n){const e=`_${this.manifestType_}_pathway`;t.searchParams.set(e,n)}if(r){const e=`_${this.manifestType_}_throughput`;t.searchParams.set(e,r)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version)return this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),void this.trigger("error");this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const t=(e=>{for(const t of e)if(this.availablePathways_.has(t))return t;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==t&&(this.currentPathway=t,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=e=>this.excludedSteeringManifestURLs.has(e);if(this.proxyServerUrl_){const n=this.setProxyServerUrl_(e);if(!t(n))return n}const n=this.setSteeringParams_(e);return t(n)?null:n}startTTLTimeout_(e=this.steeringManifest.ttl){const t=1e3*e;this.ttlTimeout_=i().setTimeout((()=>{this.requestSteeringManifest()}),t)}clearTTLTimeout_(){i().clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new su}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(vs(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}let lu;const uu=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],cu=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]};class du extends hs.EventTarget{constructor(e){super();const{src:t,withCredentials:n,tech:r,bandwidth:a,externVhs:s,useCueTags:o,playlistExclusionDuration:l,enableLowInitialPlaylist:u,sourceType:c,cacheEncryptionKeys:d,bufferBasedABR:f,leastPixelDiffSelector:h,captionServices:p}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:g}=e;null==g&&(g=1/0),lu=s,this.bufferBasedABR=Boolean(f),this.leastPixelDiffSelector=Boolean(h),this.withCredentials=n,this.tech_=r,this.vhs_=r.vhs,this.sourceType_=c,this.useCueTags_=o,this.playlistExclusionDuration=l,this.maxPlaylistRetries=g,this.enableLowInitialPlaylist=u,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:n,maxPlaylistRetries:g,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=(()=>{const e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((t=>{e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Sl,activeTrack:Sl,getActiveGroup:Sl,onGroupChanged:Sl,onTrackChanged:Sl,lastTrack_:null,logger_:Ts(`MediaGroups[${t}]`)}})),e})(),this.mediaSource=new(i().MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.seekable_=bs(),this.hasPlayed_=!1,this.syncController_=new zl(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new $l,this.sourceUpdater_=new ql(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new Wl,this.keyStatusMap_=new Map;const m={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:p,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:a,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:d,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_="dash"===this.sourceType_?new Oo(t,this.vhs_,Es(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new co(t,this.vhs_,Es(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new bl(Es(m,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new bl(Es(m,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new Yl(Es(m,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise(((e,t)=>{function n(){r.off("vttjserror",i),e()}function i(){r.off("vttjsloaded",n),t()}r.one("vttjsloaded",n),r.one("vttjserror",i),r.addWebVttScript_()}))}),e),this.contentSteeringController_=new ou(this.vhs_.xhr,(()=>this.mainSegmentLoader_.bandwidth)),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",(()=>this.startABRTimer_())),this.tech_.on("pause",(()=>this.stopABRTimer_())),this.tech_.on("play",(()=>this.startABRTimer_()))),uu.forEach((e=>{this[e+"_"]=cu.bind(this,e)})),this.logger_=Ts("pc"),this.triggeredFmp4Usage=!1,"none"===this.tech_.preload()?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const y="none"===this.tech_.preload()?"play":"loadstart";this.tech_.one(y,(()=>{const e=Date.now();this.tech_.one("loadeddata",(()=>{this.timeToLoadedData__=Date.now()-e,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends}))}))}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return-1===e||-1===t?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,n){const r=this.media(),i=r&&(r.id||r.uri),a=e&&(e.id||e.uri);i&&i!==a&&(this.logger_(`switch media ${i} -> ${a} from ${t}`),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})),this.mainPlaylistLoader_.media(e,n)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((e=>{const t=this.mediaTypes_[e],n=t?t.activeGroup():null,r=this.contentSteeringController_.getPathway();if(n&&r){const t=(n.length?n[0].playlists:n.playlists).filter((e=>e.attributes.serviceLocation===r));t.length&&this.mediaTypes_[e].activePlaylistLoader.media(t[0])}}))}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=i().setInterval((()=>this.checkABR_()),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(i().clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const n=e.mediaGroups.AUDIO,r=Object.keys(n);let i;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)i=this.mediaTypes_.AUDIO.activeTrack();else{const e=n.main||r.length&&n[r[0]];for(const t in e)if(e[t].default){i={label:t};break}}if(!i)return t;const a=[];for(const t in n)if(n[t][i.label]){const r=n[t][i.label];if(r.playlists&&r.playlists.length)a.push.apply(a,r.playlists);else if(r.uri)a.push(r);else if(e.playlists.length)for(let n=0;n<e.playlists.length;n++){const r=e.playlists[n];r.attributes&&r.attributes.AUDIO&&r.attributes.AUDIO===t&&a.push(r)}}return a.length?a:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",(()=>{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;Ys(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,e.endList&&"none"!==this.tech_.preload()&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),(e=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((t=>{ru[t](t,e)}));const{mediaTypes:t,mainPlaylistLoader:n,tech:r,vhs:i,segmentLoaders:{AUDIO:a,main:s}}=e;["AUDIO","SUBTITLES"].forEach((n=>{t[n].activeGroup=((e,t)=>n=>{const{mainPlaylistLoader:r,mediaTypes:{[e]:{groups:i}}}=t,a=r.media();if(!a)return null;let s=null;a.attributes[e]&&(s=i[a.attributes[e]]);const o=Object.keys(i);if(!s)if("AUDIO"===e&&o.length>1&&zs(t.main))for(let e=0;e<o.length;e++){const t=i[o[e]];if(iu(t,a)){s=t;break}}else i.main?s=i.main:1===o.length&&(s=i[o[0]]);return void 0===n?s:null!==n&&s&&s.filter((e=>e.id===n.id))[0]||null})(n,e),t[n].activeTrack=au[n](n,e),t[n].onGroupChanged=((e,t)=>()=>{const{segmentLoaders:{[e]:n,main:r},mediaTypes:{[e]:i}}=t,a=i.activeTrack(),s=i.getActiveGroup(),o=i.activePlaylistLoader,l=i.lastGroup_;s&&l&&s.id===l.id||(i.lastGroup_=s,i.lastTrack_=a,Jl(n,i),s&&!s.isMainPlaylist&&(s.playlistLoader?(n.resyncLoader(),eu(s.playlistLoader,i)):o&&r.resetEverything()))})(n,e),t[n].onGroupChanging=((e,t)=>()=>{const{segmentLoaders:{[e]:n},mediaTypes:{[e]:r}}=t;r.lastGroup_=null,n.abort(),n.pause()})(n,e),t[n].onTrackChanged=((e,t)=>()=>{const{mainPlaylistLoader:n,segmentLoaders:{[e]:r,main:i},mediaTypes:{[e]:a}}=t,s=a.activeTrack(),o=a.getActiveGroup(),l=a.activePlaylistLoader,u=a.lastTrack_;if((!u||!s||u.id!==s.id)&&(a.lastGroup_=o,a.lastTrack_=s,Jl(r,a),o)){if(o.isMainPlaylist){if(!s||!u||s.id===u.id)return;const e=t.vhs.playlistController_,r=e.selectPlaylist();if(e.media()===r)return;return a.logger_(`track change. Switching main audio from ${u.id} to ${s.id}`),n.pause(),i.resetEverything(),void e.fastQualityChange_(r)}if("AUDIO"===e){if(!o.playlistLoader)return i.setAudio(!0),void i.resetEverything();r.setAudio(!0),i.setAudio(!1)}l!==o.playlistLoader?(r.track&&r.track(s),r.resetEverything(),eu(o.playlistLoader,a)):eu(o.playlistLoader,a)}})(n,e),t[n].getActiveGroup=((e,{mediaTypes:t})=>()=>{const n=t[e].activeTrack();return n?t[e].activeGroup(n):null})(n,e)}));const o=t.AUDIO.activeGroup();if(o){const e=(o.filter((e=>e.default))[0]||o[0]).id;t.AUDIO.tracks[e].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged(),t.AUDIO.getActiveGroup().playlistLoader?(s.setAudio(!1),a.setAudio(!0)):s.setAudio(!0)}n.on("mediachange",(()=>{["AUDIO","SUBTITLES"].forEach((e=>t[e].onGroupChanged()))})),n.on("mediachanging",(()=>{["AUDIO","SUBTITLES"].forEach((e=>t[e].onGroupChanging()))}));const l=()=>{t.AUDIO.onTrackChanged(),r.trigger({type:"usage",name:"vhs-audio-change"})};r.audioTracks().addEventListener("change",l),r.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),i.on("dispose",(()=>{r.audioTracks().removeEventListener("change",l),r.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)})),r.clearTracks("audio");for(const e in t.AUDIO.tracks)r.audioTracks().addTrack(t.AUDIO.tracks[e])})({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),e),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",(()=>{this.trigger("selectedinitialmedia")}))})),this.mainPlaylistLoader_.on("loadedplaylist",(()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let e=this.mainPlaylistLoader_.media();if(!e){let t;if(this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_(),this.enableLowInitialPlaylist&&(t=this.selectInitialPlaylist()),t||(t=this.selectPlaylist()),!t||!this.shouldSwitchToMedia_(t))return;if(this.initialMedia_=t,this.switchMedia_(this.initialMedia_,"initial"),"vhs-json"!==this.sourceType_||!this.initialMedia_.segments)return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)})),this.mainPlaylistLoader_.on("error",(()=>{const e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})})),this.mainPlaylistLoader_.on("mediachanging",(()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()})),this.mainPlaylistLoader_.on("mediachange",(()=>{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;Ys(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,"dash"===this.sourceType_&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})})),this.mainPlaylistLoader_.on("playlistunchanged",(()=>{const e=this.mainPlaylistLoader_.media();"playlist-unchanged"!==e.lastExcludeReason_&&this.stuckAtPlaylistEnd_(e)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))})),this.mainPlaylistLoader_.on("renditiondisabled",(()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})})),this.mainPlaylistLoader_.on("renditionenabled",(()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}))}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const n=e.mediaGroups||{};let r=!0;const i=Object.keys(n.AUDIO);for(const e in n.AUDIO)for(const t in n.AUDIO[e])n.AUDIO[e][t].uri||(r=!1);r&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(n.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),lu.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),i.length&&Object.keys(n.AUDIO[i[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,n=this.tech_.currentTime(),r=this.bufferLowWaterLine(),i=this.bufferHighWaterLine();return function({currentPlaylist:e,buffered:t,currentTime:n,nextPlaylist:r,bufferLowWaterLine:i,bufferHighWaterLine:a,duration:s,bufferBasedABR:o,log:l}){if(!r)return hs.log.warn("We received no playlist to switch to. Please check your stream."),!1;const u=`allowing switch ${e&&e.id||"null"} -> ${r.id}`;if(!e)return l(`${u} as current playlist is not set`),!0;if(r.id===e.id)return!1;const c=Boolean(Is(t,n).length);if(!e.endList)return c||"number"!=typeof e.partTargetDuration?(l(`${u} as current playlist is live`),!0):(l(`not ${u} as current playlist is live llhls, but currentTime isn't in buffered.`),!1);const d=Os(t,n),f=o?Po.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Po.MAX_BUFFER_LOW_WATER_LINE;if(s<f)return l(`${u} as duration < max low water line (${s} < ${f})`),!0;const h=r.attributes.BANDWIDTH,p=e.attributes.BANDWIDTH;if(h<p&&(!o||d<a)){let e=`${u} as next bandwidth < current bandwidth (${h} < ${p})`;return o&&(e+=` and forwardBuffer < bufferHighWaterLine (${d} < ${a})`),l(e),!0}if((!o||h>p)&&d>=i){let e=`${u} as forwardBuffer >= bufferLowWaterLine (${d} >= ${i})`;return o&&(e+=` and next bandwidth > current bandwidth (${h} > ${p})`),l(e),!0}return l(`not ${u} as no switching criteria met`),!1}({buffered:this.tech_.buffered(),currentTime:n,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:i,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",(()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")})),this.mainSegmentLoader_.on("timeout",(()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()})),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",(()=>{this.trigger("progress")})),this.mainSegmentLoader_.on("error",(()=>{const e=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:e.playlist,error:e})})),this.mainSegmentLoader_.on("appenderror",(()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")})),this.mainSegmentLoader_.on("syncinfoupdate",(()=>{this.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("timestampoffset",(()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})})),this.audioSegmentLoader_.on("syncinfoupdate",(()=>{this.onSyncInfoUpdate_()})),this.audioSegmentLoader_.on("appenderror",(()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")})),this.mainSegmentLoader_.on("ended",(()=>{this.logger_("main segment loader ended"),this.onEndOfStream()})),this.mainSegmentLoader_.on("earlyabort",(e=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:10}))}));const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const e=this.getCodecsOrExclude_();e&&this.sourceUpdater_.addOrChangeSourceBuffers(e)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",(()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("fmp4",(()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("ended",(()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}))}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}fastQualityChange_(e=this.selectPlaylist()){e&&e===this.mainPlaylistLoader_.media()?this.logger_("skipping fastQualityChange because new media is same as old"):(this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0)}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything((()=>{this.tech_.setCurrentTime(this.tech_.currentTime())}))}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0)?this.tech_.setCurrentTime(e.end(e.length-1)):void 0}setupFirstPlay(){const e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList||e.start){const t=this.seekable();if(!t.length)return!1;const n=t.end(0);let r=n;if(e.start){const i=e.start.timeOffset;r=i<0?Math.max(n+i,t.start(0)):Math.min(n,i)}this.trigger("firstplay"),this.tech_.setCurrentTime(r)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){const e=this.tech_.play();void 0!==e&&"function"==typeof e.then&&e.then(null,(e=>{}))}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();e=!t||t.hasVideo?e&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const t=this.syncController_.getExpiredTime(e,this.duration());if(null===t)return!1;const n=lu.Playlist.playlistEnd(e,t),r=this.tech_.currentTime(),i=this.tech_.buffered();if(!i.length)return n-r<=As;const a=i.end(i.length-1);return a-r<=As&&n-a<=As}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:n}){if(e=e||this.mainPlaylistLoader_.media(),n=n||t.playlistExclusionDuration||this.playlistExclusionDuration,!e)return this.error=t,void("open"!==this.mediaSource.readyState?this.trigger("error"):this.sourceUpdater_.endOfStream("network"));e.playlistErrors_++;const r=this.mainPlaylistLoader_.main.playlists,i=r.filter(Gs),a=1===i.length&&i[0]===e;if(1===r.length&&n!==1/0)return hs.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(a);if(a){if(this.main().contentSteering){const t=this.pathwayAttribute_(e),n=1e3*this.contentSteeringController_.steeringManifest.ttl;return this.contentSteeringController_.excludePathway(t),this.excludeThenChangePathway_(),void setTimeout((()=>{this.contentSteeringController_.addAvailablePathway(t)}),n)}let t=!1;r.forEach((n=>{if(n===e)return;const r=n.excludeUntil;void 0!==r&&r!==1/0&&(t=!0,delete n.excludeUntil)})),t&&(hs.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let s;s=e.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*n,e.excludeUntil=s,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const o=this.selectPlaylist();if(!o)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");const l=t.internal?this.logger_:hs.log.warn,u=t.message?" "+t.message:"";l(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${u} Switching to playlist ${o.id}.`),o.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),o.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const c=o.targetDuration/2*1e3||5e3,d="number"==typeof o.lastRequest&&Date.now()-o.lastRequest<=c;return this.switchMedia_(o,"exclude",a||d)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const n=[],r="all"===e;(r||"main"===e)&&n.push(this.mainPlaylistLoader_);const i=[];(r||"audio"===e)&&i.push("AUDIO"),(r||"subtitle"===e)&&(i.push("CLOSED-CAPTIONS"),i.push("SUBTITLES")),i.forEach((e=>{const t=this.mediaTypes_[e]&&this.mediaTypes_[e].activePlaylistLoader;t&&n.push(t)})),["main","audio","subtitle"].forEach((t=>{const r=this[`${t}SegmentLoader_`];!r||e!==t&&"all"!==e||n.push(r)})),n.forEach((e=>t.forEach((t=>{"function"==typeof e[t]&&e[t]()}))))}setCurrentTime(e){const t=Is(this.tech_.buffered(),e);return this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media()&&this.mainPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),void this.load()):0}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:lu.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}onSyncInfoUpdate_(){let e;if(!this.mainPlaylistLoader_)return;let t=this.mainPlaylistLoader_.media();if(!t)return;let n=this.syncController_.getExpiredTime(t,this.duration());if(null===n)return;const r=this.mainPlaylistLoader_.main,i=lu.Playlist.seekable(t,n,lu.Playlist.liveEdgeDelay(r,t));if(0===i.length)return;if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),n=this.syncController_.getExpiredTime(t,this.duration()),null===n)return;if(e=lu.Playlist.seekable(t,n,lu.Playlist.liveEdgeDelay(r,t)),0===e.length)return}let a,s;this.seekable_&&this.seekable_.length&&(a=this.seekable_.end(0),s=this.seekable_.start(0)),e?e.start(0)>i.end(0)||i.start(0)>e.end(0)?this.seekable_=i:this.seekable_=bs([[e.start(0)>i.start(0)?e.start(0):i.start(0),e.end(0)<i.end(0)?e.end(0):i.end(0)]]):this.seekable_=i,this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===a&&this.seekable_.start(0)===s||(this.logger_(`seekable updated [${Rs(this.seekable_)}]`),this.tech_.trigger("seekablechanged"))}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),"open"!==this.mediaSource.readyState)return this.updateDuration_=this.updateDuration.bind(this,e),void this.mediaSource.addEventListener("sourceopen",this.updateDuration_);if(e){const e=this.seekable();if(!e.length)return;return void((isNaN(this.mediaSource.duration)||this.mediaSource.duration<e.end(e.length-1))&&this.sourceUpdater_.setDuration(e.end(e.length-1)))}const t=this.tech_.buffered();let n=lu.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(n=Math.max(n,t.end(t.length-1))),this.mediaSource.duration!==n&&this.sourceUpdater_.setDuration(n)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach((e=>{const t=this.mediaTypes_[e].groups;for(const e in t)t[e].forEach((e=>{e.playlistLoader&&e.playlistLoader.dispose()}))})),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),n=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!n)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const n=il(this.main(),t),r={},i=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=n.video||e.main.videoCodec||"avc1.4d400d"),e.main.isMuxed&&(r.video+=`,${n.audio||e.main.audioCodec||U}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||i)&&(r.audio=n.audio||e.main.audioCodec||e.audio.audioCodec||U,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!r.audio&&!r.video)return void this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});const a={};let s;if(["video","audio"].forEach((function(t){if(r.hasOwnProperty(t)&&(n=e[t].isFmp4,i=r[t],!(n?k(i):F(i)))){const n=e[t].isFmp4?"browser":"muxer";a[n]=a[n]||[],a[n].push(r[t]),"audio"===t&&(s=n)}var n,i})),i&&s&&t.attributes.AUDIO){const e=t.attributes.AUDIO;this.main().playlists.forEach((n=>{(n.attributes&&n.attributes.AUDIO)===e&&n!==t&&(n.excludeUntil=1/0)})),this.logger_(`excluding audio group ${e} as ${s} does not support codec(s): "${r.audio}"`)}if(!Object.keys(a).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const e=[];if(["video","audio"].forEach((t=>{const n=(M(this.sourceUpdater_.codecs[t]||"")[0]||{}).type,i=(M(r[t]||"")[0]||{}).type;n&&i&&n.toLowerCase()!==i.toLowerCase()&&e.push(`"${this.sourceUpdater_.codecs[t]}" -> "${r[t]}"`)})),e.length)return void this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${e.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0})}return r}{const e=Object.keys(a).reduce(((e,t)=>(e&&(e+=", "),e+`${t} does not support codec(s): "${a[t].join(",")}"`)),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:e},playlistExclusionDuration:1/0})}}tryToCreateSourceBuffers_(){if("open"!==this.mediaSource.readyState||this.sourceUpdater_.hasCreatedSourceBuffers())return;if(!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach((n=>{const r=e[n];if(-1!==t.indexOf(r.id))return;t.push(r.id);const i=il(this.main,r),a=[];!i.audio||F(i.audio)||k(i.audio)||a.push(`audio codec ${i.audio}`),!i.video||F(i.video)||k(i.video)||a.push(`video codec ${i.video}`),i.text&&"stpp.ttml.im1t"===i.text&&a.push(`text codec ${i.text}`),a.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${a.join(", ")}`))}))}excludeIncompatibleVariants_(e){const t=[],n=this.main().playlists,r=nl(M(e)),i=rl(r),a=r.video&&M(r.video)[0]||null,s=r.audio&&M(r.audio)[0]||null;Object.keys(n).forEach((e=>{const r=n[e];if(-1!==t.indexOf(r.id)||r.excludeUntil===1/0)return;t.push(r.id);const o=[],l=il(this.mainPlaylistLoader_.main,r),u=rl(l);if(l.audio||l.video){if(u!==i&&o.push(`codec count "${u}" !== "${i}"`),!this.sourceUpdater_.canChangeType()){const e=l.video&&M(l.video)[0]||null,t=l.audio&&M(l.audio)[0]||null;e&&a&&e.type.toLowerCase()!==a.type.toLowerCase()&&o.push(`video codec "${e.type}" !== "${a.type}"`),t&&s&&t.type.toLowerCase()!==s.type.toLowerCase()&&o.push(`audio codec "${t.type}" !== "${s.type}"`)}o.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id}: ${o.join(" && ")}`))}}))}updateAdCues_(e){let t=0;const n=this.seekable();n.length&&(t=n.start(0)),function(e,t,n=0){if(!e.segments)return;let r,a=n;for(let n=0;n<e.segments.length;n++){const s=e.segments[n];if(r||(r=Zl(t,a+s.duration/2)),r){if("cueIn"in s){r.endTime=a,r.adEndTime=a,a+=s.duration,r=null;continue}if(a<r.endTime){a+=s.duration;continue}r.endTime+=s.duration}else if("cueOut"in s&&(r=new(i().VTTCue)(a,a+s.duration,s.cueOut),r.adStartTime=a,r.adEndTime=a+parseFloat(s.cueOut),t.addCue(r)),"cueOutCont"in s){const[e,n]=s.cueOutCont.split("/").map(parseFloat);r=new(i().VTTCue)(a,a+s.duration,""),r.adStartTime=a-e,r.adEndTime=r.adStartTime+n,t.addCue(r)}a+=s.duration}}(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=Po.GOAL_BUFFER_LENGTH,n=Po.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,Po.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*n,r)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=Po.BUFFER_LOW_WATER_LINE,n=Po.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,Po.MAX_BUFFER_LOW_WATER_LINE),i=Math.max(t,Po.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*n,this.bufferBasedABR?i:r)}bufferHighWaterLine(){return Po.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){pl(this.inbandTextTracks_,"com.apple.streaming",this.tech_),(({inbandTextTracks:e,dateRanges:t})=>{const n=e.metadataTrack_;if(!n)return;const r=i().WebKitDataCue||i().VTTCue;t.forEach((e=>{for(const t of Object.keys(e)){if(hl.has(t))continue;const i=new r(e.startTime,e.endTime,"");i.id=e.id,i.type="com.apple.quicktime.HLS",i.value={key:fl[t],data:e[t]},"scte35Out"!==t&&"scte35In"!==t||(i.value.data=new Uint8Array(i.value.data.match(/[\da-f]{2}/gi)).buffer),n.addCue(i)}e.processDateRange()}))})({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,n){const r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();pl(this.inbandTextTracks_,e,this.tech_),(({inbandTextTracks:e,metadataArray:t,timestampOffset:n,videoDuration:r})=>{if(!t)return;const a=i().WebKitDataCue||i().VTTCue,s=e.metadataTrack_;if(!s)return;if(t.forEach((e=>{const t=e.cueTime+n;!("number"!=typeof t||i().isNaN(t)||t<0)&&t<1/0&&e.frames&&e.frames.length&&e.frames.forEach((e=>{const n=new a(t,t,e.value||e.url||e.data||"");n.frame=e,n.value=e,function(e){Object.defineProperties(e.frame,{id:{get:()=>(hs.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key)},value:{get:()=>(hs.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data)},privateData:{get:()=>(hs.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data)}})}(n),s.addCue(n)}))})),!s.cues||!s.cues.length)return;const o=s.cues,l=[];for(let e=0;e<o.length;e++)o[e]&&l.push(o[e]);const u=l.reduce(((e,t)=>{const n=e[t.startTime]||[];return n.push(t),e[t.startTime]=n,e}),{}),c=Object.keys(u).sort(((e,t)=>Number(e)-Number(t)));c.forEach(((e,t)=>{const n=u[e],i=isFinite(r)?r:e,a=Number(c[t+1])||i;n.forEach((e=>{e.endTime=a}))}))})({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:n})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart?this.contentSteeringController_.requestSteeringManifest(!0):this.tech_.one("canplay",(()=>{this.contentSteeringController_.requestSteeringManifest()}))}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),"dash"===this.sourceType_&&this.mainPlaylistLoader_.on("loadedplaylist",(()=>{const e=this.main();(this.contentSteeringController_.didDASHTagChange(e.uri,e.contentSteering)||(()=>{const t=this.contentSteeringController_.getAvailablePathways(),n=[];for(const r of e.playlists){const e=r.attributes.serviceLocation;if(e&&(n.push(e),!t.has(e)))return!0}return!(n.length||!t.size)})())&&this.resetContentSteeringController_()}))}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const t=this.main().playlists,n=new Set;let r=!1;Object.keys(t).forEach((i=>{const a=t[i],s=this.pathwayAttribute_(a),o=s&&e!==s;a.excludeUntil===1/0&&"content-steering"===a.lastExcludeReason_&&!o&&(delete a.excludeUntil,delete a.lastExcludeReason_,r=!0);const l=!a.excludeUntil&&a.excludeUntil!==1/0;!n.has(a.id)&&o&&l&&(n.add(a.id),a.excludeUntil=1/0,a.lastExcludeReason_="content-steering",this.logger_(`excluding ${a.id} for ${a.lastExcludeReason_}`))})),"DASH"===this.contentSteeringController_.manifestType_&&Object.keys(this.mediaTypes_).forEach((t=>{const n=this.mediaTypes_[t];if(n.activePlaylistLoader){const t=n.activePlaylistLoader.media_;t&&t.attributes.serviceLocation!==e&&(r=!0)}})),r&&this.changeSegmentPathway_()}handlePathwayClones_(){const e=this.main().playlists,t=this.contentSteeringController_.currentPathwayClones,n=this.contentSteeringController_.nextPathwayClones;if(t&&t.size||n&&n.size){for(const[e,r]of t.entries())n.get(e)||(this.mainPlaylistLoader_.updateOrDeleteClone(r),this.contentSteeringController_.excludePathway(e));for(const[r,i]of n.entries()){const n=t.get(r);n?this.equalPathwayClones_(n,i)||(this.mainPlaylistLoader_.updateOrDeleteClone(i,!0),this.contentSteeringController_.addAvailablePathway(r)):(e.filter((e=>e.attributes["PATHWAY-ID"]===i["BASE-ID"])).forEach((e=>{this.mainPlaylistLoader_.addClonePathway(i,e)})),this.contentSteeringController_.addAvailablePathway(r))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...n])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;const n=e["URI-REPLACEMENT"].PARAMS,r=t["URI-REPLACEMENT"].PARAMS;for(const e in n)if(n[e]!==r[e])return!1;for(const e in r)if(n[e]!==r[e])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),"DASH"===this.contentSteeringController_.manifestType_&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach((n=>{const r=this.mainPlaylistLoader_.getKeyIdSet(n);r&&r.size&&r.forEach((r=>{const i="usable",a=this.keyStatusMap_.has(r)&&this.keyStatusMap_.get(r)===i,s=n.lastExcludeReason_===t&&n.excludeUntil===1/0;a?a&&s&&(delete n.excludeUntil,delete n.lastExcludeReason_,this.logger_(`enabling playlist ${n.id} because key ID ${r} is ${i}`)):(n.excludeUntil!==1/0&&n.lastExcludeReason_!==t&&(n.excludeUntil=1/0,n.lastExcludeReason_=t,this.logger_(`excluding playlist ${n.id} because the key ID ${r} doesn't exist in the keyStatusMap or is not ${i}`)),e++)}))})),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach((e=>{const n=e&&e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height<720,r=e.excludeUntil===1/0&&e.lastExcludeReason_===t;n&&r&&(delete e.excludeUntil,hs.log.warn(`enabling non-HD playlist ${e.id} because all playlists were excluded due to ${t} key IDs`))}))}addKeyStatus_(e,t){const n=("string"==typeof e?e:(e=>{const t=new Uint8Array(e);return Array.from(t).map((e=>e.toString(16).padStart(2,"0"))).join("")})(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${n} added to the keyStatusMap`),this.keyStatusMap_.set(n,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}class fu{constructor(e,t,n){const{playlistController_:r}=e,i=r.fastQualityChange_.bind(r);if(t.attributes){const e=t.attributes.RESOLUTION;this.width=e&&e.width,this.height=e&&e.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}var a,s,o;this.codecs=il(r.main(),t),this.playlist=t,this.id=n,this.enabled=(a=e.playlists,s=t.id,o=i,e=>{const t=a.main.playlists[s],n=Hs(t),r=Gs(t);return void 0===e?r:(e?delete t.disabled:t.disabled=!0,e===r||n||(o(),e?a.trigger("renditionenabled"):a.trigger("renditiondisabled")),e)})}}const hu=["seeking","seeked","pause","playing","error"];class pu{constructor(e){this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=Ts("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),n=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),a=()=>this.resetTimeUpdate_(),s=this.playlistController_,o=["main","subtitle","audio"],l={};o.forEach((e=>{l[e]={reset:()=>this.resetSegmentDownloads_(e),updateend:()=>this.checkSegmentDownloads_(e)},s[`${e}SegmentLoader_`].on("appendsdone",l[e].updateend),s[`${e}SegmentLoader_`].on("playlistupdate",l[e].reset),this.tech_.on(["seeked","seeking"],l[e].reset)}));const u=e=>{["main","audio"].forEach((t=>{s[`${t}SegmentLoader_`][e]("appended",this.seekingAppendCheck_)}))};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),u("off"))},this.clearSeekingAppendCheck_=()=>u("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),u("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(hu,a),this.tech_.on("canplay",n),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",r),this.tech_.off(hu,a),this.tech_.off("canplay",n),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),o.forEach((e=>{s[`${e}SegmentLoader_`].off("appendsdone",l[e].updateend),s[`${e}SegmentLoader_`].off("playlistupdate",l[e].reset),this.tech_.off(["seeked","seeking"],l[e].reset)})),this.checkCurrentTimeTimeout_&&i().clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&i().clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=i().setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,n=t[`${e}SegmentLoader_`],r=n.buffered_(),i=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e)return!0;if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++)if(e.start(n)!==t.start(n)||e.end(n)!==t.end(n))return!0;return!1}(this[`${e}Buffered_`],r);this[`${e}Buffered_`]=r,i?this.resetSegmentDownloads_(e):(this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:n.playlist_&&n.playlist_.id,buffered:Ds(r)}),this[`${e}StalledDownloads_`]<10||(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),"subtitle"!==e&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0})))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+As>=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const e=this.seekable(),t=this.tech_.currentTime();let n;if(this.afterSeekableWindow_(e,t,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(n=e.end(e.length-1)),this.beforeSeekableWindow_(e,t)){const t=e.start(0);n=t+(t===e.end(0)?0:As)}if(void 0!==n)return this.logger_(`Trying to seek outside of seekable at time ${t} with seekable range ${Rs(e)}. Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0;const r=this.playlistController_.sourceUpdater_,i=this.tech_.buffered(),a=r.audioBuffer?r.audioBuffered():null,s=r.videoBuffer?r.videoBuffered():null,o=this.media(),l=o.partTargetDuration?o.partTargetDuration:2*(o.targetDuration-Ss),u=[a,s];for(let e=0;e<u.length;e++)if(u[e]&&Os(u[e],t)<l)return!1;const c=Cs(i,t);return 0!==c.length&&(n=c.start(0)+As,this.logger_(`Buffered region starts (${c.start(0)})  just beyond seek point (${t}). Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0)}waiting_(){if(this.techWaiting_())return;const e=this.tech_.currentTime(),t=this.tech_.buffered(),n=Is(t,e);return n.length&&e+3<=n.end(0)?(this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${n.start(0)} -> ${n.end(0)}]. Attempting to resume playback by seeking to the current time.`),void this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"})):void 0}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const n=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${n}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(n),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const n=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:n.audioBuffered(),videoBuffered:n.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const i=Cs(r,t);return i.length>0&&(this.logger_(`Stopped at ${t} and seeking to ${i.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0)}afterSeekableWindow_(e,t,n,r=!1){if(!e.length)return!1;let i=e.end(e.length-1)+As;const a=!n.endList,s="number"==typeof n.partTargetDuration;return a&&(s||r)&&(i=e.end(e.length-1)+3*n.targetDuration),t>i}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:n}){if(!e)return;let r;if(e.length&&t.length){const i=Is(e,n-3),a=Is(e,n),s=Is(t,n);s.length&&!a.length&&i.length&&(r={start:i.end(0),end:s.end(0)})}else Cs(e,n).length||(r=this.gapFromVideoUnderflow_(e,n));return!!r&&(this.logger_(`Encountered a gap in video from ${r.start} to ${r.end}. Seeking to current time ${n}`),!0)}skipTheGap_(e){const t=this.tech_.buffered(),n=this.tech_.currentTime(),r=Cs(t,n);this.resetTimeUpdate_(),0!==r.length&&n===e&&(this.logger_("skipTheGap_:","currentTime:",n,"scheduled currentTime:",e,"nextRange start:",r.start(0)),this.tech_.setCurrentTime(r.start(0)+Ss),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}))}gapFromVideoUnderflow_(e,t){const n=function(e){if(e.length<2)return bs();const t=[];for(let n=1;n<e.length;n++){const r=e.end(n-1),i=e.start(n);t.push([r,i])}return bs(t)}(e);for(let e=0;e<n.length;e++){const r=n.start(e),i=n.end(e);if(t-r<4&&t-r>2)return{start:r,end:i}}return null}}const gu={errorInterval:30,getSource(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},mu=function(e,t){let n=0,r=0;const i=Es(gu,t);e.ready((()=>{e.trigger({type:"usage",name:"vhs-error-reload-initialized"})}));const a=function(){r&&e.currentTime(r)},s=function(t){null!=t&&(r=e.duration()!==1/0&&e.currentTime()||0,e.one("loadedmetadata",a),e.src(t),e.trigger({type:"usage",name:"vhs-error-reload"}),e.play())},o=function(){if(Date.now()-n<1e3*i.errorInterval)e.trigger({type:"usage",name:"vhs-error-reload-canceled"});else{if(i.getSource&&"function"==typeof i.getSource)return n=Date.now(),i.getSource.call(e,s);hs.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}},l=function(){e.off("loadedmetadata",a),e.off("error",o),e.off("dispose",l)};e.on("error",o),e.on("dispose",l),e.reloadSourceOnError=function(t){l(),mu(e,t)}};var yu="3.9.1";const vu={PlaylistLoader:co,Playlist:Ws,utils:So,STANDARD_PLAYLIST_SELECTOR:dl,INITIAL_PLAYLIST_SELECTOR:function(){const e=this.playlists.main.playlists.filter(Ws.isEnabled);return ll(e,((e,t)=>ul(e,t))),e.filter((e=>!!il(this.playlists.main,e).video))[0]||null},lastBandwidthSelector:dl,movingAverageBandwidthSelector:function(e){let t=-1,n=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){const r=this.useDevicePixelRatio&&i().devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,n=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==n&&(t=e*this.systemBandwidth+(1-e)*t,n=this.systemBandwidth),cl(this.playlists.main,t,parseInt(ol(this.tech_.el(),"width"),10)*r,parseInt(ol(this.tech_.el(),"height"),10)*r,this.limitRenditionByPlayerDimensions,this.playlistController_)}},comparePlaylistBandwidth:ul,comparePlaylistResolution:function(e,t){let n,r;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(n=e.attributes.RESOLUTION.width),n=n||i().Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(r=t.attributes.RESOLUTION.width),r=r||i().Number.MAX_VALUE,n===r&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:n-r},xhr:po()};Object.keys(Po).forEach((e=>{Object.defineProperty(vu,e,{get:()=>(hs.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),Po[e]),set(t){hs.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),"number"!=typeof t||t<0?hs.log.warn(`value of Vhs.${e} must be greater than or equal to 0`):Po[e]=t}})}));const _u="videojs-vhs",Tu=function(e,t){const n=t.media();let r=-1;for(let t=0;t<e.length;t++)if(e[t].id===n.id){r=t;break}e.selectedIndex_=r,e.trigger({selectedIndex:r,type:"change"})};vu.canPlaySource=function(){return hs.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const Eu=()=>{if(!i().localStorage)return null;const e=i().localStorage.getItem(_u);if(!e)return null;try{return JSON.parse(e)}catch(e){return null}},bu=(e,t)=>{e._requestCallbackSet||(e._requestCallbackSet=new Set),e._requestCallbackSet.add(t)},Su=(e,t)=>{e._responseCallbackSet||(e._responseCallbackSet=new Set),e._responseCallbackSet.add(t)},Au=(e,t)=>{e._requestCallbackSet&&(e._requestCallbackSet.delete(t),e._requestCallbackSet.size||delete e._requestCallbackSet)},wu=(e,t)=>{e._responseCallbackSet&&(e._responseCallbackSet.delete(t),e._responseCallbackSet.size||delete e._responseCallbackSet)};vu.supportsNativeHls=function(){if(!s()||!s().createElement)return!1;const e=s().createElement("video");return!!hs.getTech("Html5").isSupported()&&["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some((function(t){return/maybe|probably/i.test(e.canPlayType(t))}))}(),vu.supportsNativeDash=!!(s()&&s().createElement&&hs.getTech("Html5").isSupported())&&/maybe|probably/i.test(s().createElement("video").canPlayType("application/dash+xml")),vu.supportsTypeNatively=e=>"hls"===e?vu.supportsNativeHls:"dash"===e&&vu.supportsNativeDash,vu.isSupported=function(){return hs.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},vu.xhr.onRequest=function(e){bu(vu.xhr,e)},vu.xhr.onResponse=function(e){Su(vu.xhr,e)},vu.xhr.offRequest=function(e){Au(vu.xhr,e)},vu.xhr.offResponse=function(e){wu(vu.xhr,e)};const Iu=hs.getComponent("Component");class Cu extends Iu{constructor(e,t,n){if(super(t,n.vhs),"number"==typeof n.initialBandwidth&&(this.options_.bandwidth=n.initialBandwidth),this.logger_=Ts("VhsHandler"),t.options_&&t.options_.playerId){const e=hs.getPlayer(t.options_.playerId);this.player_=e}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(s(),["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],(e=>{const t=s().fullscreenElement||s().webkitFullscreenElement||s().mozFullScreenElement||s().msFullscreenElement;t&&t.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()})),this.on(this.tech_,"seeking",(function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())})),this.on(this.tech_,"error",(function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()})),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=Es(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage=void 0!==this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=!1!==this.options_.llhls,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,"number"!=typeof this.options_.playlistExclusionDuration&&(this.options_.playlistExclusionDuration=60),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){const e=Eu();e&&e.bandwidth&&(this.options_.bandwidth=e.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),e&&e.throughput&&(this.options_.throughput=e.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}"number"!=typeof this.options_.bandwidth&&(this.options_.bandwidth=Po.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Po.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach((e=>{void 0!==this.source_[e]&&(this.options_[e]=this.source_[e])})),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;var n;this.setOptions_(),this.options_.src=0===(n=this.source_.src).toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")?JSON.parse(n.substring(n.indexOf(",")+1)):n,this.options_.tech=this.tech_,this.options_.externVhs=vu,this.options_.sourceType=q(t),this.options_.seekTo=e=>{this.tech_.setCurrentTime(e)},this.playlistController_=new du(this.options_);const r=Es({liveRangeSafeTimeDelta:As},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new pu(r),this.playlistController_.on("error",(()=>{const e=hs.players[this.tech_.options_.playerId];let t=this.playlistController_.error;"object"!=typeof t||t.code?"string"==typeof t&&(t={message:t,code:3}):t.code=3,e.error(t)}));const a=this.options_.bufferBasedABR?vu.movingAverageBandwidthSelector(.55):vu.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):a.bind(this),this.playlistController_.selectInitialPlaylist=vu.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(e){this.playlistController_.selectPlaylist=e.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(e){this.playlistController_.mainSegmentLoader_.throughput.rate=e,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let e=this.playlistController_.mainSegmentLoader_.bandwidth;const t=i().navigator.connection||i().navigator.mozConnection||i().navigator.webkitConnection,n=1e7;if(this.options_.useNetworkInformationApi&&t){const r=1e3*t.downlink*1e3;e=r>=n&&e>=n?Math.max(e,r):r}return e},set(e){this.playlistController_.mainSegmentLoader_.bandwidth=e,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const e=1/(this.bandwidth||1);let t;return t=this.throughput>0?1/this.throughput:0,Math.floor(1/(e+t))},set(){hs.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>Ds(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>Ds(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",(()=>{this.options_.useBandwidthFromLocalStorage&&(e=>{if(!i().localStorage)return!1;let t=Eu();t=t?Es(t,e):e;try{i().localStorage.setItem(_u,JSON.stringify(t))}catch(e){return!1}})({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})})),this.playlistController_.on("selectedinitialmedia",(()=>{var e;(e=this).representations=()=>{const t=e.playlistController_.main(),n=zs(t)?e.playlistController_.getAudioTrackPlaylists_():t.playlists;return n?n.filter((e=>!Hs(e))).map(((t,n)=>new fu(e,t,t.id))):[]}})),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",(()=>{this.setupEme_()})),this.on(this.playlistController_,"progress",(function(){this.tech_.trigger("progress")})),this.on(this.playlistController_,"firstplay",(function(){this.ignoreNextSeekingEvent_=!0})),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=i().URL.createObjectURL(this.playlistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),(({player:e,sourceKeySystems:t,audioMedia:n,mainPlaylists:r})=>{if(!e.eme.initializeMediaKeys)return Promise.resolve();const i=(o=n?r.concat([n]):r,l=Object.keys(t),o.reduce(((e,t)=>{if(!t.contentProtection)return e;const n=l.reduce(((e,n)=>{const r=t.contentProtection[n];return r&&r.pssh&&(e[n]={pssh:r.pssh}),e}),{});return Object.keys(n).length&&e.push(n),e}),[])),a=[],s=[];var o,l;return i.forEach((t=>{s.push(new Promise(((t,n)=>{e.tech_.one("keysessioncreated",t)}))),a.push(new Promise(((n,r)=>{e.eme.initializeMediaKeys({keySystems:t},(e=>{e?r(e):n()}))})))})),Promise.race([Promise.all(a),Promise.race(s)])})({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then((()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()})).catch((e=>{this.logger_("error while creating EME key session",e),this.player_.error({message:"Failed to initialize media keys for EME",code:3})}))}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=(({player:e,sourceKeySystems:t,media:n,audioMedia:r})=>{const i=((e,t,n)=>{if(!e)return e;let r={};t&&t.attributes&&t.attributes.CODECS&&(r=nl(M(t.attributes.CODECS))),n&&n.attributes&&n.attributes.CODECS&&(r.audio=n.attributes.CODECS);const i=L(r.video),a=L(r.audio),s={};for(const n in e)s[n]={},a&&(s[n].audioContentType=a),i&&(s[n].videoContentType=i),t.contentProtection&&t.contentProtection[n]&&t.contentProtection[n].pssh&&(s[n].pssh=t.contentProtection[n].pssh),"string"==typeof e[n]&&(s[n].url=e[n]);return Es(e,s)})(t,n,r);return!(!i||(e.currentSource().keySystems=i,i&&!e.eme&&(hs.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),1)))})({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});this.player_.tech_.on("keystatuschange",(e=>{this.playlistController_.updatePlaylistByKeyStatus(e.keyId,e.status)})),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),t?this.createKeySessions_():this.playlistController_.sourceUpdater_.initializedEme()}setupQualityLevels_(){const e=hs.players[this.tech_.options_.playerId];e&&e.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",(()=>{!function(e,t){t.representations().forEach((t=>{e.addQualityLevel(t)})),Tu(e,t.playlists)}(this.qualityLevels_,this)})),this.playlists.on("mediachange",(()=>{Tu(this.qualityLevels_,this.playlists)})))}static version(){return{"@videojs/http-streaming":yu,"mux.js":"7.0.2","mpd-parser":"1.3.0","m3u8-parser":"7.1.0","aes-decrypter":"4.0.1"}}version(){return this.constructor.version()}canChangeType(){return ql.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&i().URL.revokeObjectURL&&(i().URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return(({playlist:e,time:t,callback:n})=>{if(!n)throw new Error("getProgramTime: callback must be provided");if(!e||void 0===t)return n({message:"getProgramTime: playlist and time must be provided"});const r=((e,t)=>{if(!t||!t.segments||0===t.segments.length)return null;let n,r=0;for(let i=0;i<t.segments.length&&(n=t.segments[i],r=n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationEnd:r+n.duration,!(e<=r));i++);const i=t.segments[t.segments.length-1];if(i.videoTimingInfo&&i.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>r){if(e>r+.25*i.duration)return null;n=i}return{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:r-n.duration,type:n.videoTimingInfo?"accurate":"estimate"}})(t,e);if(!r)return n({message:"valid programTime was not found"});if("estimate"===r.type)return n({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:r.estimatedStart});const i={mediaSeconds:t},a=((e,t)=>{if(!t.dateTimeObject)return null;const n=t.videoTimingInfo.transmuxerPrependedSeconds,r=e-(t.videoTimingInfo.transmuxedPresentationStart+n);return new Date(t.dateTimeObject.getTime()+1e3*r)})(t,r.segment);return a&&(i.programDateTime=a.toISOString()),n(null,i)})({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,n=!0,r=2){return Ao({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:n,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{bu(this.xhr,e)},this.xhr.onResponse=e=>{Su(this.xhr,e)},this.xhr.offRequest=e=>{Au(this.xhr,e)},this.xhr.offResponse=e=>{wu(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}}const Ru={name:"videojs-http-streaming",VERSION:yu,canHandleSource(e,t={}){const n=Es(hs.options,t);return Ru.canPlayType(e.type,n)},handleSource(e,t,n={}){const r=Es(hs.options,n);return t.vhs=new Cu(e,t,r),t.vhs.xhr=po(),t.vhs.setupXhrHooks_(),t.vhs.src(e.src,e.type),t.vhs},canPlayType(e,t){const n=q(e);if(!n)return"";const r=Ru.getOverrideNative(t);return!vu.supportsTypeNatively(n)||r?"maybe":""},getOverrideNative(e={}){const{vhs:t={}}=e,n=!(hs.browser.IS_ANY_SAFARI||hs.browser.IS_IOS),{overrideNative:r=n}=t;return r}};k("avc1.4d400d,mp4a.40.2")&&hs.getTech("Html5").registerSourceHandler(Ru,0),hs.VhsHandler=Cu,hs.VhsSourceHandler=Ru,hs.Vhs=vu,hs.use||hs.registerComponent("Vhs",vu),hs.options.vhs=hs.options.vhs||{},hs.getPlugin&&hs.getPlugin("reloadSourceOnError")||hs.registerPlugin("reloadSourceOnError",(function(e){mu(this,e)}))},825:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>ac});var r=n(8908),i=n.n(r),o=n(9144),l=n.n(o),u=n(7462),c=n(7537),d=n.n(c);function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}function p(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,h(e,t)}var g=n(5974),m=n.n(g),y=n(9603),v=n.n(y),_=n(3407),T=n.n(_);function E(e,t,n){return E=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&h(i,n.prototype),i},E.apply(null,arguments)}var b=n(9945),S=n.n(b);const A=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=i().location&&i().location.href||"");var n="function"==typeof i().URL,r=/^\/\//.test(e),a=!i().location&&!/\/\//i.test(e);if(n?e=new(i().URL)(e,i().location||"http://example.com"):/\/\//i.test(e)||(e=S().buildAbsoluteURL(i().location&&i().location.href||"",e)),n){var s=new URL(t,e);return a?s.href.slice(18):r?s.href.slice(s.protocol.length):s.href}return S().buildAbsoluteURL(e,t)};var w=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var n=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(n,1),n>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var n=t.length,r=0;r<n;++r)t[r].call(this,arguments[1]);else for(var i=Array.prototype.slice.call(arguments,1),a=t.length,s=0;s<a;++s)t[s].apply(this,i)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}();function I(e){for(var t=function(e){return i().atob?i().atob(e):Buffer.from(e,"base64").toString("binary")}(e),n=new Uint8Array(t.length),r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}var C,R=function(e){function t(){var t;return(t=e.call(this)||this).buffer="",t}return p(t,e),t.prototype.push=function(e){var t;for(this.buffer+=e,t=this.buffer.indexOf("\n");t>-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},t}(w),D=String.fromCharCode(9),N=function(e){var t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),n={};return t[1]&&(n.length=parseInt(t[1],10)),t[2]&&(n.offset=parseInt(t[2],10)),n},O=function(e){for(var t,n=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),r={},i=n.length;i--;)""!==n[i]&&((t=/([^=]*)=(.*)/.exec(n[i]).slice(1))[0]=t[0].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^['"](.*)['"]$/g,"$1"),r[t[0]]=t[1]);return r},P=function(e){function t(){var t;return(t=e.call(this)||this).customParsers=[],t.tagMappers=[],t}p(t,e);var n=t.prototype;return n.push=function(e){var t,n,r=this;0!==(e=e.trim()).length&&("#"===e[0]?this.tagMappers.reduce((function(t,n){var r=n(e);return r===e?t:t.concat([r])}),[e]).forEach((function(e){for(var i=0;i<r.customParsers.length;i++)if(r.customParsers[i].call(r,e))return;if(0===e.indexOf("#EXT"))if(e=e.replace("\r",""),t=/^#EXTM3U/.exec(e))r.trigger("data",{type:"tag",tagType:"m3u"});else{if(t=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(e))return n={type:"tag",tagType:"inf"},t[1]&&(n.duration=parseFloat(t[1])),t[2]&&(n.title=t[2]),void r.trigger("data",n);if(t=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(e))return n={type:"tag",tagType:"targetduration"},t[1]&&(n.duration=parseInt(t[1],10)),void r.trigger("data",n);if(t=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(e))return n={type:"tag",tagType:"version"},t[1]&&(n.version=parseInt(t[1],10)),void r.trigger("data",n);if(t=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))return n={type:"tag",tagType:"media-sequence"},t[1]&&(n.number=parseInt(t[1],10)),void r.trigger("data",n);if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))return n={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(n.number=parseInt(t[1],10)),void r.trigger("data",n);if(t=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(e))return n={type:"tag",tagType:"playlist-type"},t[1]&&(n.playlistType=t[1]),void r.trigger("data",n);if(t=/^#EXT-X-BYTERANGE:?(.*)?$/.exec(e))return n=(0,u.Z)(N(t[1]),{type:"tag",tagType:"byterange"}),void r.trigger("data",n);if(t=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(e))return n={type:"tag",tagType:"allow-cache"},t[1]&&(n.allowed=!/NO/.test(t[1])),void r.trigger("data",n);if(t=/^#EXT-X-MAP:?(.*)$/.exec(e)){if(n={type:"tag",tagType:"map"},t[1]){var a=O(t[1]);a.URI&&(n.uri=a.URI),a.BYTERANGE&&(n.byterange=N(a.BYTERANGE))}r.trigger("data",n)}else if(t=/^#EXT-X-STREAM-INF:?(.*)$/.exec(e)){if(n={type:"tag",tagType:"stream-inf"},t[1]){if(n.attributes=O(t[1]),n.attributes.RESOLUTION){var s=n.attributes.RESOLUTION.split("x"),o={};s[0]&&(o.width=parseInt(s[0],10)),s[1]&&(o.height=parseInt(s[1],10)),n.attributes.RESOLUTION=o}n.attributes.BANDWIDTH&&(n.attributes.BANDWIDTH=parseInt(n.attributes.BANDWIDTH,10)),n.attributes["FRAME-RATE"]&&(n.attributes["FRAME-RATE"]=parseFloat(n.attributes["FRAME-RATE"])),n.attributes["PROGRAM-ID"]&&(n.attributes["PROGRAM-ID"]=parseInt(n.attributes["PROGRAM-ID"],10))}r.trigger("data",n)}else{if(t=/^#EXT-X-MEDIA:?(.*)$/.exec(e))return n={type:"tag",tagType:"media"},t[1]&&(n.attributes=O(t[1])),void r.trigger("data",n);if(t=/^#EXT-X-ENDLIST/.exec(e))r.trigger("data",{type:"tag",tagType:"endlist"});else if(t=/^#EXT-X-DISCONTINUITY/.exec(e))r.trigger("data",{type:"tag",tagType:"discontinuity"});else{if(t=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(e))return n={type:"tag",tagType:"program-date-time"},t[1]&&(n.dateTimeString=t[1],n.dateTimeObject=new Date(t[1])),void r.trigger("data",n);if(t=/^#EXT-X-KEY:?(.*)$/.exec(e))return n={type:"tag",tagType:"key"},t[1]&&(n.attributes=O(t[1]),n.attributes.IV&&("0x"===n.attributes.IV.substring(0,2).toLowerCase()&&(n.attributes.IV=n.attributes.IV.substring(2)),n.attributes.IV=n.attributes.IV.match(/.{8}/g),n.attributes.IV[0]=parseInt(n.attributes.IV[0],16),n.attributes.IV[1]=parseInt(n.attributes.IV[1],16),n.attributes.IV[2]=parseInt(n.attributes.IV[2],16),n.attributes.IV[3]=parseInt(n.attributes.IV[3],16),n.attributes.IV=new Uint32Array(n.attributes.IV))),void r.trigger("data",n);if(t=/^#EXT-X-START:?(.*)$/.exec(e))return n={type:"tag",tagType:"start"},t[1]&&(n.attributes=O(t[1]),n.attributes["TIME-OFFSET"]=parseFloat(n.attributes["TIME-OFFSET"]),n.attributes.PRECISE=/YES/.test(n.attributes.PRECISE)),void r.trigger("data",n);if(t=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(e))return n={type:"tag",tagType:"cue-out-cont"},t[1]?n.data=t[1]:n.data="",void r.trigger("data",n);if(t=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(e))return n={type:"tag",tagType:"cue-out"},t[1]?n.data=t[1]:n.data="",void r.trigger("data",n);if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(e))return n={type:"tag",tagType:"cue-in"},t[1]?n.data=t[1]:n.data="",void r.trigger("data",n);if((t=/^#EXT-X-SKIP:(.*)$/.exec(e))&&t[1])return(n={type:"tag",tagType:"skip"}).attributes=O(t[1]),n.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(n.attributes["SKIPPED-SEGMENTS"]=parseInt(n.attributes["SKIPPED-SEGMENTS"],10)),n.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(n.attributes["RECENTLY-REMOVED-DATERANGES"]=n.attributes["RECENTLY-REMOVED-DATERANGES"].split(D)),void r.trigger("data",n);if((t=/^#EXT-X-PART:(.*)$/.exec(e))&&t[1])return(n={type:"tag",tagType:"part"}).attributes=O(t[1]),["DURATION"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseFloat(n.attributes[e]))})),["INDEPENDENT","GAP"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=/YES/.test(n.attributes[e]))})),n.attributes.hasOwnProperty("BYTERANGE")&&(n.attributes.byterange=N(n.attributes.BYTERANGE)),void r.trigger("data",n);if((t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e))&&t[1])return(n={type:"tag",tagType:"server-control"}).attributes=O(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseFloat(n.attributes[e]))})),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=/YES/.test(n.attributes[e]))})),void r.trigger("data",n);if((t=/^#EXT-X-PART-INF:(.*)$/.exec(e))&&t[1])return(n={type:"tag",tagType:"part-inf"}).attributes=O(t[1]),["PART-TARGET"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseFloat(n.attributes[e]))})),void r.trigger("data",n);if((t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e))&&t[1])return(n={type:"tag",tagType:"preload-hint"}).attributes=O(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach((function(e){if(n.attributes.hasOwnProperty(e)){n.attributes[e]=parseInt(n.attributes[e],10);var t="BYTERANGE-LENGTH"===e?"length":"offset";n.attributes.byterange=n.attributes.byterange||{},n.attributes.byterange[t]=n.attributes[e],delete n.attributes[e]}})),void r.trigger("data",n);if((t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e))&&t[1])return(n={type:"tag",tagType:"rendition-report"}).attributes=O(t[1]),["LAST-MSN","LAST-PART"].forEach((function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseInt(n.attributes[e],10))})),void r.trigger("data",n);r.trigger("data",{type:"tag",data:e.slice(4)})}}}else r.trigger("data",{type:"comment",text:e.slice(1)})})):this.trigger("data",{type:"uri",uri:e}))},n.addParser=function(e){var t=this,n=e.expression,r=e.customType,i=e.dataParser,a=e.segment;"function"!=typeof i&&(i=function(e){return e}),this.customParsers.push((function(e){if(n.exec(e))return t.trigger("data",{type:"custom",data:i(e),customType:r,segment:a}),!0}))},n.addTagMapper=function(e){var t=e.expression,n=e.map;this.tagMappers.push((function(e){return t.test(e)?n(e):e}))},t}(w),M=function(e){var t={};return Object.keys(e).forEach((function(n){var r;t[(r=n,r.toLowerCase().replace(/-(\w)/g,(function(e){return e[1].toUpperCase()})))]=e[n]})),t},x=function(e){var t=e.serverControl,n=e.targetDuration,r=e.partTargetDuration;if(t){var i="#EXT-X-SERVER-CONTROL",a="holdBack",s="partHoldBack",o=n&&3*n,l=r&&2*r;n&&!t.hasOwnProperty(a)&&(t[a]=o,this.trigger("info",{message:i+" defaulting HOLD-BACK to targetDuration * 3 ("+o+")."})),o&&t[a]<o&&(this.trigger("warn",{message:i+" clamping HOLD-BACK ("+t[a]+") to targetDuration * 3 ("+o+")"}),t[a]=o),r&&!t.hasOwnProperty(s)&&(t[s]=3*r,this.trigger("info",{message:i+" defaulting PART-HOLD-BACK to partTargetDuration * 3 ("+t[s]+")."})),r&&t[s]<l&&(this.trigger("warn",{message:i+" clamping PART-HOLD-BACK ("+t[s]+") to partTargetDuration * 2 ("+l+")."}),t[s]=l)}},L=function(e){function t(){var t;(t=e.call(this)||this).lineStream=new R,t.parseStream=new P,t.lineStream.pipe(t.parseStream);var n,r,i=f(t),a=[],s={},o=!1,l=function(){},c={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},d=0;t.manifest={allowCache:!0,discontinuityStarts:[],segments:[]};var h=0,p=0;return t.on("end",(function(){s.uri||!s.parts&&!s.preloadHints||(!s.map&&n&&(s.map=n),!s.key&&r&&(s.key=r),s.timeline||"number"!=typeof d||(s.timeline=d),t.manifest.preloadSegment=s)})),t.parseStream.on("data",(function(e){var t,f;({tag:function(){({version:function(){e.version&&(this.manifest.version=e.version)},"allow-cache":function(){this.manifest.allowCache=e.allowed,"allowed"in e||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var t={};"length"in e&&(s.byterange=t,t.length=e.length,"offset"in e||(e.offset=h)),"offset"in e&&(s.byterange=t,t.offset=e.offset),h=t.offset+t.length},endlist:function(){this.manifest.endList=!0},inf:function(){"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"})),e.duration>0&&(s.duration=e.duration),0===e.duration&&(s.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=a},key:function(){if(e.attributes)if("NONE"!==e.attributes.METHOD)if(e.attributes.URI){if("com.apple.streamingkeydelivery"===e.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:e.attributes});if("com.microsoft.playready"===e.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.microsoft.playready"]={uri:e.attributes.URI});if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===e.attributes.KEYFORMAT)return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(e.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===e.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==e.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):e.attributes.KEYID&&"0x"===e.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:e.attributes.KEYFORMAT,keyId:e.attributes.KEYID.substring(2)},pssh:I(e.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}));e.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),r={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI},void 0!==e.attributes.IV&&(r.iv=e.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else r=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){isFinite(e.number)?this.manifest.mediaSequence=e.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+e.number})},"discontinuity-sequence":function(){isFinite(e.number)?(this.manifest.discontinuitySequence=e.number,d=e.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+e.number})},"playlist-type":function(){/VOD|EVENT/.test(e.playlistType)?this.manifest.playlistType=e.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+e.playlist})},map:function(){n={},e.uri&&(n.uri=e.uri),e.byterange&&(n.byterange=e.byterange),r&&(n.key=r)},"stream-inf":function(){this.manifest.playlists=a,this.manifest.mediaGroups=this.manifest.mediaGroups||c,e.attributes?(s.attributes||(s.attributes={}),(0,u.Z)(s.attributes,e.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||c,e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME){var n=this.manifest.mediaGroups[e.attributes.TYPE];n[e.attributes["GROUP-ID"]]=n[e.attributes["GROUP-ID"]]||{},t=n[e.attributes["GROUP-ID"]],(f={default:/yes/i.test(e.attributes.DEFAULT)}).default?f.autoselect=!0:f.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(f.language=e.attributes.LANGUAGE),e.attributes.URI&&(f.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(f.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(f.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(f.forced=/yes/i.test(e.attributes.FORCED)),t[e.attributes.NAME]=f}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){d+=1,s.discontinuity=!0,this.manifest.discontinuityStarts.push(a.length)},"program-date-time":function(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),s.dateTimeString=e.dateTimeString,s.dateTimeObject=e.dateTimeObject},targetduration:function(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration}):(this.manifest.targetDuration=e.duration,x.call(this,this.manifest))},start:function(){e.attributes&&!isNaN(e.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:e.attributes["TIME-OFFSET"],precise:e.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){s.cueOut=e.data},"cue-out-cont":function(){s.cueOutCont=e.data},"cue-in":function(){s.cueIn=e.data},skip:function(){this.manifest.skip=M(e.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",e.attributes,["SKIPPED-SEGMENTS"])},part:function(){var t=this;o=!0;var n=this.manifest.segments.length,r=M(e.attributes);s.parts=s.parts||[],s.parts.push(r),r.byterange&&(r.byterange.hasOwnProperty("offset")||(r.byterange.offset=p),p=r.byterange.offset+r.byterange.length);var i=s.parts.length-1;this.warnOnMissingAttributes_("#EXT-X-PART #"+i+" for segment #"+n,e.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((function(e,n){e.hasOwnProperty("lastPart")||t.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+n+" lacks required attribute(s): LAST-PART"})}))},"server-control":function(){var t=this.manifest.serverControl=M(e.attributes);t.hasOwnProperty("canBlockReload")||(t.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),x.call(this,this.manifest),t.canSkipDateranges&&!t.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint":function(){var t=this.manifest.segments.length,n=M(e.attributes),r=n.type&&"PART"===n.type;s.preloadHints=s.preloadHints||[],s.preloadHints.push(n),n.byterange&&(n.byterange.hasOwnProperty("offset")||(n.byterange.offset=r?p:0,r&&(p=n.byterange.offset+n.byterange.length)));var i=s.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+i+" for segment #"+t,e.attributes,["TYPE","URI"]),n.type)for(var a=0;a<s.preloadHints.length-1;a++){var o=s.preloadHints[a];o.type&&o.type===n.type&&this.trigger("warn",{message:"#EXT-X-PRELOAD-HINT #"+i+" for segment #"+t+" has the same TYPE "+n.type+" as preload hint #"+a})}},"rendition-report":function(){var t=M(e.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(t);var n=this.manifest.renditionReports.length-1,r=["LAST-MSN","URI"];o&&r.push("LAST-PART"),this.warnOnMissingAttributes_("#EXT-X-RENDITION-REPORT #"+n,e.attributes,r)},"part-inf":function(){this.manifest.partInf=M(e.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",e.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),x.call(this,this.manifest)}}[e.tagType]||l).call(i)},uri:function(){s.uri=e.uri,a.push(s),this.manifest.targetDuration&&!("duration"in s)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),s.duration=this.manifest.targetDuration),r&&(s.key=r),s.timeline=d,n&&(s.map=n),p=0,s={}},comment:function(){},custom:function(){e.segment?(s.custom=s.custom||{},s.custom[e.customType]=e.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[e.customType]=e.data)}})[e.type].call(i)})),t}p(t,e);var n=t.prototype;return n.warnOnMissingAttributes_=function(e,t,n){var r=[];n.forEach((function(e){t.hasOwnProperty(e)||r.push(e)})),r.length&&this.trigger("warn",{message:e+" lacks required attribute(s): "+r.join(", ")})},n.push=function(e){this.lineStream.push(e)},n.end=function(){this.lineStream.push("\n"),this.trigger("end")},n.addParser=function(e){this.parseStream.addParser(e)},n.addTagMapper=function(e){this.parseStream.addTagMapper(e)},t}(w),k={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^/},F=["video","audio","text"],U=["Video","Audio","Text"],B=function(e){return e?e.replace(/avc1\.(\d+)\.(\d+)/i,(function(e,t,n){return"avc1."+("00"+Number(t).toString(16)).slice(-2)+"00"+("00"+Number(n).toString(16)).slice(-2)})):e},j=function(e){void 0===e&&(e="");var t=e.split(","),n=[];return t.forEach((function(e){var t;e=e.trim(),F.forEach((function(r){var i=k[r].exec(e.toLowerCase());if(i&&!(i.length<=1)){t=r;var a=e.substring(0,i[1].length),s=e.replace(a,"");n.push({type:a,details:s,mediaType:r})}})),t||n.push({type:e,details:"",mediaType:"unknown"})})),n},q=function(e){return void 0===e&&(e=""),k.audio.test(e.trim().toLowerCase())},H=function(e){if(e&&"string"==typeof e){var t,n=e.toLowerCase().split(",").map((function(e){return B(e.trim())})),r="video";1===n.length&&q(n[0])?r="audio":1===n.length&&(void 0===(t=n[0])&&(t=""),k.text.test(t.trim().toLowerCase()))&&(r="application");var i="mp4";return n.every((function(e){return k.mp4.test(e)}))?i="mp4":n.every((function(e){return k.webm.test(e)}))?i="webm":n.every((function(e){return k.ogg.test(e)}))&&(i="ogg"),r+"/"+i+';codecs="'+e+'"'}},G=function(e){return void 0===e&&(e=""),i().MediaSource&&i().MediaSource.isTypeSupported&&i().MediaSource.isTypeSupported(H(e))||!1},V=function(e){return void 0===e&&(e=""),e.toLowerCase().split(",").every((function(e){e=e.trim();for(var t=0;t<U.length;t++)if(k["muxer"+U[t]].test(e))return!0;return!1}))},Y="mp4a.40.2",Z=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,K=/^application\/dash\+xml/i,z=function(e){return Z.test(e)?"hls":K.test(e)?"dash":"application/vnd.videojs.vhs+json"===e?"vhs-json":null},W=function(e){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},X=function(e){return e instanceof Uint8Array?e:(Array.isArray(e)||W(e)||e instanceof ArrayBuffer||(e="number"!=typeof e||"number"==typeof e&&e!=e?0:[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},$=i().BigInt||Number,Q=[$("0x1"),$("0x100"),$("0x10000"),$("0x1000000"),$("0x100000000"),$("0x10000000000"),$("0x1000000000000"),$("0x100000000000000"),$("0x10000000000000000")],J=(function(){var e=new Uint16Array([65484]),t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);255===t[0]||t[0]}(),function(e,t){var n=void 0===t?{}:t,r=n.signed,i=void 0!==r&&r,a=n.le,s=void 0!==a&&a;e=X(e);var o=s?"reduce":"reduceRight",l=(e[o]?e[o]:Array.prototype[o]).call(e,(function(t,n,r){var i=s?r:Math.abs(r+1-e.length);return t+$(n)*Q[i]}),$(0));if(i){var u=Q[e.length]/$(2)-$(1);(l=$(l))>u&&(l-=u,l-=u,l-=$(2))}return Number(l)}),ee=function(e,t){if("string"!=typeof e&&e&&"function"==typeof e.toString&&(e=e.toString()),"string"!=typeof e)return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var n=new Uint8Array(e.length),r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return n},te=function(e,t,n){var r=void 0===n?{}:n,i=r.offset,a=void 0===i?0:i,s=r.mask,o=void 0===s?[]:s;e=X(e);var l=(t=X(t)).every?t.every:Array.prototype.every;return t.length&&e.length-a>=t.length&&l.call(t,(function(t,n){return t===(o[n]?o[n]&e[a+n]:e[a+n])}))},ne=n(3969),re=function(e){return!!e&&"object"==typeof e},ie=function e(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return n.reduce((function(t,n){return"object"!=typeof n||Object.keys(n).forEach((function(r){Array.isArray(t[r])&&Array.isArray(n[r])?t[r]=t[r].concat(n[r]):re(t[r])&&re(n[r])?t[r]=e(t[r],n[r]):t[r]=n[r]})),t}),{})},ae=function(e){return Object.keys(e).map((function(t){return e[t]}))},se=function(e){return e.reduce((function(e,t){return e.concat(t)}),[])},oe=function(e){if(!e.length)return[];for(var t=[],n=0;n<e.length;n++)t.push(e[n]);return t},le=function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return-1},ue=function(e){var t=e.baseUrl,n=void 0===t?"":t,r=e.source,a=void 0===r?"":r,s=e.range,o=void 0===s?"":s,l=e.indexRange,u=void 0===l?"":l,c={uri:a,resolvedUri:A(n||"",a)};if(o||u){var d,f=(o||u).split("-"),h=i().BigInt?i().BigInt(f[0]):parseInt(f[0],10),p=i().BigInt?i().BigInt(f[1]):parseInt(f[1],10);h<Number.MAX_SAFE_INTEGER&&"bigint"==typeof h&&(h=Number(h)),p<Number.MAX_SAFE_INTEGER&&"bigint"==typeof p&&(p=Number(p)),"bigint"==typeof(d="bigint"==typeof p||"bigint"==typeof h?i().BigInt(p)-i().BigInt(h)+i().BigInt(1):p-h+1)&&d<Number.MAX_SAFE_INTEGER&&(d=Number(d)),c.byterange={length:d,offset:h}}return c},ce=function(e){return e&&"number"!=typeof e&&(e=parseInt(e,10)),isNaN(e)?null:e},de={static:function(e){var t=e.duration,n=e.timescale,r=void 0===n?1:n,i=e.sourceDuration,a=e.periodDuration,s=ce(e.endNumber),o=t/r;return"number"==typeof s?{start:0,end:s}:"number"==typeof a?{start:0,end:a/o}:{start:0,end:i/o}},dynamic:function(e){var t=e.NOW,n=e.clientOffset,r=e.availabilityStartTime,i=e.timescale,a=void 0===i?1:i,s=e.duration,o=e.periodStart,l=void 0===o?0:o,u=e.minimumUpdatePeriod,c=void 0===u?0:u,d=e.timeShiftBufferDepth,f=void 0===d?1/0:d,h=ce(e.endNumber),p=(t+n)/1e3,g=r+l,m=p+c-g,y=Math.ceil(m*a/s),v=Math.floor((p-g-f)*a/s),_=Math.floor((p-g)*a/s);return{start:Math.max(0,v),end:"number"==typeof h?h:Math.min(y,_)}}},fe=function(e){var t=e.type,n=e.duration,r=e.timescale,i=void 0===r?1:r,a=e.periodDuration,s=e.sourceDuration,o=de[t](e),l=function(e,t){for(var n=[],r=e;r<t;r++)n.push(r);return n}(o.start,o.end).map(function(e){return function(t){var n=e.duration,r=e.timescale,i=void 0===r?1:r,a=e.periodStart,s=e.startNumber;return{number:(void 0===s?1:s)+t,duration:n/i,timeline:a,time:t*n}}}(e));if("static"===t){var u=l.length-1,c="number"==typeof a?a:s;l[u].duration=c-n/i*u}return l},he=function(e){var t=e.baseUrl,n=e.initialization,r=void 0===n?{}:n,i=e.sourceDuration,a=e.indexRange,s=void 0===a?"":a,o=e.periodStart,l=e.presentationTime,u=e.number,c=void 0===u?0:u,d=e.duration;if(!t)throw new Error("NO_BASE_URL");var f=ue({baseUrl:t,source:r.sourceURL,range:r.range}),h=ue({baseUrl:t,source:t,indexRange:s});if(h.map=f,d){var p=fe(e);p.length&&(h.duration=p[0].duration,h.timeline=p[0].timeline)}else i&&(h.duration=i,h.timeline=o);return h.presentationTime=l||o,h.number=c,[h]},pe=function(e,t,n){var r,a=e.sidx.map?e.sidx.map:null,s=e.sidx.duration,o=e.timeline||0,l=e.sidx.byterange,u=l.offset+l.length,c=t.timescale,d=t.references.filter((function(e){return 1!==e.referenceType})),f=[],h=e.endList?"static":"dynamic",p=e.sidx.timeline,g=p,m=e.mediaSequence||0;r="bigint"==typeof t.firstOffset?i().BigInt(u)+t.firstOffset:u+t.firstOffset;for(var y=0;y<d.length;y++){var v,_=t.references[y],T=_.referencedSize,E=_.subsegmentDuration;v="bigint"==typeof r?r+i().BigInt(T)-i().BigInt(1):r+T-1;var b=he({baseUrl:n,timescale:c,timeline:o,periodStart:p,presentationTime:g,number:m,duration:E,sourceDuration:s,indexRange:r+"-"+v,type:h})[0];a&&(b.map=a),f.push(b),r+="bigint"==typeof r?i().BigInt(T):T,g+=E/c,m++}return e.segments=f,e},ge=["AUDIO","SUBTITLES"],me=function(e){return(t=e,n=function(e){return e.timeline},ae(t.reduce((function(e,t){return t.forEach((function(t){e[n(t)]=t})),e}),{}))).sort((function(e,t){return e.timeline>t.timeline?1:-1}));var t,n},ye=function(e){var t,n,r=[];return t=e,n=function(e,t,n,i){r=r.concat(e.playlists||[])},ge.forEach((function(e){for(var r in t.mediaGroups[e])for(var i in t.mediaGroups[e][r]){var a=t.mediaGroups[e][r][i];n(a)}})),r},ve=function(e){var t=e.playlist,n=e.mediaSequence;t.mediaSequence=n,t.segments.forEach((function(e,n){e.number=t.mediaSequence+n}))},_e=function(e){return e&&e.uri+"-"+(n="bigint"==typeof(t=e.byterange).offset||"bigint"==typeof t.length?i().BigInt(t.offset)+i().BigInt(t.length)-i().BigInt(1):t.offset+t.length-1,t.offset+"-"+n);var t,n},Te=function(e){return ae(e.reduce((function(e,t){var n,r=t.attributes.id+(t.attributes.lang||"");e[r]?(t.segments&&(t.segments[0]&&(t.segments[0].discontinuity=!0),(n=e[r].segments).push.apply(n,t.segments)),t.attributes.contentProtection&&(e[r].attributes.contentProtection=t.attributes.contentProtection)):(e[r]=t,e[r].attributes.timelineStarts=[]);return e[r].attributes.timelineStarts.push({start:t.attributes.periodStart,timeline:t.attributes.periodStart}),e}),{})).map((function(e){var t;return e.discontinuityStarts=(t=e.segments||[],"discontinuity",t.reduce((function(e,t,n){return t.discontinuity&&e.push(n),e}),[])),e}))},Ee=function(e,t){var n=_e(e.sidx),r=n&&t[n]&&t[n].sidx;return r&&pe(e,r,e.sidx.resolvedUri),e},be=function(e,t){if(void 0===t&&(t={}),!Object.keys(t).length)return e;for(var n in e)e[n]=Ee(e[n],t);return e},Se=function(e){var t,n=e.attributes,r=e.segments,i=e.sidx,a=e.discontinuityStarts,s={attributes:(t={NAME:n.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:n.width,height:n.height},CODECS:n.codecs,BANDWIDTH:n.bandwidth},t["PROGRAM-ID"]=1,t),uri:"",endList:"static"===n.type,timeline:n.periodStart,resolvedUri:"",targetDuration:n.duration,discontinuityStarts:a,timelineStarts:n.timelineStarts,segments:r};return n.frameRate&&(s.attributes["FRAME-RATE"]=n.frameRate),n.contentProtection&&(s.contentProtection=n.contentProtection),i&&(s.sidx=i),s},Ae=function(e){var t=e.attributes;return"video/mp4"===t.mimeType||"video/webm"===t.mimeType||"video"===t.contentType},we=function(e){var t=e.attributes;return"audio/mp4"===t.mimeType||"audio/webm"===t.mimeType||"audio"===t.contentType},Ie=function(e){var t=e.attributes;return"text/vtt"===t.mimeType||"text"===t.contentType},Ce=function(e){return e?Object.keys(e).reduce((function(t,n){var r=e[n];return t.concat(r.playlists)}),[]):[]},Re=function(e){var t,n=e.dashPlaylists,r=e.locations,i=e.sidxMapping,a=void 0===i?{}:i,s=e.previousManifest;if(!n.length)return{};var o=n[0].attributes,l=o.sourceDuration,u=o.type,c=o.suggestedPresentationDelay,d=o.minimumUpdatePeriod,f=Te(n.filter(Ae)).map(Se),h=Te(n.filter(we)),p=Te(n.filter(Ie)),g=n.map((function(e){return e.attributes.captionServices})).filter(Boolean),m={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(t={AUDIO:{},VIDEO:{}},t["CLOSED-CAPTIONS"]={},t.SUBTITLES={},t),uri:"",duration:l,playlists:be(f,a)};d>=0&&(m.minimumUpdatePeriod=1e3*d),r&&(m.locations=r),"dynamic"===u&&(m.suggestedPresentationDelay=c);var y,v,_,T,E,b,S,A=0===m.playlists.length,w=h.length?function(e,t,n){var r;void 0===t&&(t={}),void 0===n&&(n=!1);var i=e.reduce((function(e,i){var a=i.attributes.role&&i.attributes.role.value||"",s=i.attributes.lang||"",o=i.attributes.label||"main";if(s&&!i.attributes.label){var l=a?" ("+a+")":"";o=""+i.attributes.lang+l}e[o]||(e[o]={language:s,autoselect:!0,default:"main"===a,playlists:[],uri:""});var u=Ee(function(e,t){var n,r=e.attributes,i=e.segments,a=e.sidx,s=e.mediaSequence,o=e.discontinuitySequence,l=e.discontinuityStarts,u={attributes:(n={NAME:r.id,BANDWIDTH:r.bandwidth,CODECS:r.codecs},n["PROGRAM-ID"]=1,n),uri:"",endList:"static"===r.type,timeline:r.periodStart,resolvedUri:"",targetDuration:r.duration,discontinuitySequence:o,discontinuityStarts:l,timelineStarts:r.timelineStarts,mediaSequence:s,segments:i};return r.contentProtection&&(u.contentProtection=r.contentProtection),a&&(u.sidx=a),t&&(u.attributes.AUDIO="audio",u.attributes.SUBTITLES="subs"),u}(i,n),t);return e[o].playlists.push(u),void 0===r&&"main"===a&&((r=i).default=!0),e}),{});return r||(i[Object.keys(i)[0]].default=!0),i}(h,a,A):null,I=p.length?function(e,t){return void 0===t&&(t={}),e.reduce((function(e,n){var r=n.attributes.lang||"text";return e[r]||(e[r]={language:r,default:!1,autoselect:!1,playlists:[],uri:""}),e[r].playlists.push(Ee(function(e){var t,n=e.attributes,r=e.segments,i=e.mediaSequence,a=e.discontinuityStarts,s=e.discontinuitySequence;void 0===r&&(r=[{uri:n.baseUrl,timeline:n.periodStart,resolvedUri:n.baseUrl||"",duration:n.sourceDuration,number:0}],n.duration=n.sourceDuration);var o=((t={NAME:n.id,BANDWIDTH:n.bandwidth})["PROGRAM-ID"]=1,t);return n.codecs&&(o.CODECS=n.codecs),{attributes:o,uri:"",endList:"static"===n.type,timeline:n.periodStart,resolvedUri:n.baseUrl||"",targetDuration:n.duration,timelineStarts:n.timelineStarts,discontinuityStarts:a,discontinuitySequence:s,mediaSequence:i,segments:r}}(n),t)),e}),{})}(p,a):null,C=f.concat(Ce(w),Ce(I)),R=C.map((function(e){return e.timelineStarts}));return m.timelineStarts=me(R),y=C,v=m.timelineStarts,y.forEach((function(e){e.mediaSequence=0,e.discontinuitySequence=le(v,(function(t){return t.timeline===e.timeline})),e.segments&&e.segments.forEach((function(e,t){e.number=t}))})),w&&(m.mediaGroups.AUDIO.audio=w),I&&(m.mediaGroups.SUBTITLES.subs=I),g.length&&(m.mediaGroups["CLOSED-CAPTIONS"].cc=g.reduce((function(e,t){return t?(t.forEach((function(t){var n=t.channel,r=t.language;e[r]={autoselect:!1,default:!1,instreamId:n,language:r},t.hasOwnProperty("aspectRatio")&&(e[r].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[r].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[r]["3D"]=t["3D"])})),e):e}),{})),s?(T=(_={oldManifest:s,newManifest:m}).oldManifest,E=_.newManifest,b=T.playlists.concat(ye(T)),S=E.playlists.concat(ye(E)),E.timelineStarts=me([T.timelineStarts,E.timelineStarts]),function(e){var t=e.oldPlaylists,n=e.timelineStarts;e.newPlaylists.forEach((function(e){e.discontinuitySequence=le(n,(function(t){return t.timeline===e.timeline}));var r=function(e,t){for(var n=0;n<e.length;n++)if(e[n].attributes.NAME===t)return e[n];return null}(t,e.attributes.NAME);if(r&&!e.sidx){var i=e.segments[0],a=le(r.segments,(function(e){return Math.abs(e.presentationTime-i.presentationTime)<.016666666666666666}));if(-1===a)return ve({playlist:e,mediaSequence:r.mediaSequence+r.segments.length}),e.segments[0].discontinuity=!0,e.discontinuityStarts.unshift(0),void((!r.segments.length&&e.timeline>r.timeline||r.segments.length&&e.timeline>r.segments[r.segments.length-1].timeline)&&e.discontinuitySequence--);r.segments[a].discontinuity&&!i.discontinuity&&(i.discontinuity=!0,e.discontinuityStarts.unshift(0),e.discontinuitySequence--),ve({playlist:e,mediaSequence:r.segments[a].number})}}))}({oldPlaylists:b,newPlaylists:S,timelineStarts:E.timelineStarts}),E):m},De=function(e,t,n){var r=e.NOW,i=e.clientOffset,a=e.availabilityStartTime,s=e.timescale,o=void 0===s?1:s,l=e.periodStart,u=void 0===l?0:l,c=e.minimumUpdatePeriod,d=(r+i)/1e3+(void 0===c?0:c)-(a+u);return Math.ceil((d*o-t)/n)},Ne=function(e,t){for(var n=e.type,r=e.minimumUpdatePeriod,i=void 0===r?0:r,a=e.media,s=void 0===a?"":a,o=e.sourceDuration,l=e.timescale,u=void 0===l?1:l,c=e.startNumber,d=void 0===c?1:c,f=e.periodStart,h=[],p=-1,g=0;g<t.length;g++){var m=t[g],y=m.d,v=m.r||0,_=m.t||0;p<0&&(p=_),_&&_>p&&(p=_);var T=void 0;if(v<0){var E=g+1;T=E===t.length?"dynamic"===n&&i>0&&s.indexOf("$Number$")>0?De(e,p,y):(o*u-p)/y:(t[E].t-p)/y}else T=v+1;for(var b=d+h.length+T,S=d+h.length;S<b;)h.push({number:S,duration:y/u,time:p,timeline:f}),p+=y,S++}return h},Oe=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,Pe=function(e,t){return e.replace(Oe,function(e){return function(t,n,r,i){if("$$"===t)return"$";if(void 0===e[n])return t;var a=""+e[n];return"RepresentationID"===n?a:(i=r?parseInt(i,10):1,a.length>=i?a:""+new Array(i-a.length+1).join("0")+a)}}(t))},Me=function(e,t){var n={RepresentationID:e.id,Bandwidth:e.bandwidth||0},r=e.initialization,i=void 0===r?{sourceURL:"",range:""}:r,a=ue({baseUrl:e.baseUrl,source:Pe(i.sourceURL,n),range:i.range}),s=function(e,t){return e.duration||t?e.duration?fe(e):Ne(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}]}(e,t);return s.map((function(t){n.Number=t.number,n.Time=t.time;var r=Pe(e.media||"",n),i=e.timescale||1,s=e.presentationTimeOffset||0,o=e.periodStart+(t.time-s)/i;return{uri:r,timeline:t.timeline,duration:t.duration,resolvedUri:A(e.baseUrl||"",r),map:a,number:t.number,presentationTime:o}}))},xe=function(e,t){var n=e.duration,r=e.segmentUrls,i=void 0===r?[]:r,a=e.periodStart;if(!n&&!t||n&&t)throw new Error("SEGMENT_TIME_UNSPECIFIED");var s,o=i.map((function(t){return function(e,t){var n=e.baseUrl,r=e.initialization,i=void 0===r?{}:r,a=ue({baseUrl:n,source:i.sourceURL,range:i.range}),s=ue({baseUrl:n,source:t.media,range:t.mediaRange});return s.map=a,s}(e,t)}));return n&&(s=fe(e)),t&&(s=Ne(e,t)),s.map((function(t,n){if(o[n]){var r=o[n],i=e.timescale||1,s=e.presentationTimeOffset||0;return r.timeline=t.timeline,r.duration=t.duration,r.number=t.number,r.presentationTime=a+(t.time-s)/i,r}})).filter((function(e){return e}))},Le=function(e){var t,n,r=e.attributes,i=e.segmentInfo;i.template?(n=Me,t=ie(r,i.template)):i.base?(n=he,t=ie(r,i.base)):i.list&&(n=xe,t=ie(r,i.list));var a={attributes:r};if(!n)return a;var s=n(t,i.segmentTimeline);if(t.duration){var o=t,l=o.duration,u=o.timescale,c=void 0===u?1:u;t.duration=l/c}else s.length?t.duration=s.reduce((function(e,t){return Math.max(e,Math.ceil(t.duration))}),0):t.duration=0;return a.attributes=t,a.segments=s,i.base&&t.indexRange&&(a.sidx=s[0],a.segments=[]),a},ke=function(e,t){return oe(e.childNodes).filter((function(e){return e.tagName===t}))},Fe=function(e){return e.textContent.trim()},Ue=function(e){var t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t)return 0;var n=t.slice(1),r=n[0],i=n[1],a=n[2],s=n[3],o=n[4],l=n[5];return 31536e3*parseFloat(r||0)+2592e3*parseFloat(i||0)+86400*parseFloat(a||0)+3600*parseFloat(s||0)+60*parseFloat(o||0)+parseFloat(l||0)},Be={mediaPresentationDuration:function(e){return Ue(e)},availabilityStartTime:function(e){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t=e)&&(t+="Z"),Date.parse(t)/1e3;var t},minimumUpdatePeriod:function(e){return Ue(e)},suggestedPresentationDelay:function(e){return Ue(e)},type:function(e){return e},timeShiftBufferDepth:function(e){return Ue(e)},start:function(e){return Ue(e)},width:function(e){return parseInt(e,10)},height:function(e){return parseInt(e,10)},bandwidth:function(e){return parseInt(e,10)},frameRate:function(e){return function(e){return parseFloat(e.split("/").reduce((function(e,t){return e/t})))}(e)},startNumber:function(e){return parseInt(e,10)},timescale:function(e){return parseInt(e,10)},presentationTimeOffset:function(e){return parseInt(e,10)},duration:function(e){var t=parseInt(e,10);return isNaN(t)?Ue(e):t},d:function(e){return parseInt(e,10)},t:function(e){return parseInt(e,10)},r:function(e){return parseInt(e,10)},DEFAULT:function(e){return e}},je=function(e){return e&&e.attributes?oe(e.attributes).reduce((function(e,t){var n=Be[t.name]||Be.DEFAULT;return e[t.name]=n(t.value),e}),{}):{}},qe={"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"},He=function(e,t){return t.length?se(e.map((function(e){return t.map((function(t){return A(e,Fe(t))}))}))):e},Ge=function(e){var t=ke(e,"SegmentTemplate")[0],n=ke(e,"SegmentList")[0],r=n&&ke(n,"SegmentURL").map((function(e){return ie({tag:"SegmentURL"},je(e))})),i=ke(e,"SegmentBase")[0],a=n||t,s=a&&ke(a,"SegmentTimeline")[0],o=n||i||t,l=o&&ke(o,"Initialization")[0],u=t&&je(t);u&&l?u.initialization=l&&je(l):u&&u.initialization&&(u.initialization={sourceURL:u.initialization});var c={template:u,segmentTimeline:s&&ke(s,"S").map((function(e){return je(e)})),list:n&&ie(je(n),{segmentUrls:r,initialization:je(l)}),base:i&&ie(je(i),{initialization:je(l)})};return Object.keys(c).forEach((function(e){c[e]||delete c[e]})),c},Ve=function(e,t){return function(n,r){var i=He(t,ke(n.node,"BaseURL")),a=ie(e,{periodStart:n.attributes.start});"number"==typeof n.attributes.duration&&(a.periodDuration=n.attributes.duration);var s=ke(n.node,"AdaptationSet"),o=Ge(n.node);return se(s.map(function(e,t,n){return function(r){var i,a=je(r),s=He(t,ke(r,"BaseURL")),o=ke(r,"Role")[0],l={role:je(o)},u=ie(e,a,l),c=ke(r,"Accessibility")[0],d="urn:scte:dash:cc:cea-608:2015"===(i=je(c)).schemeIdUri?("string"!=typeof i.value?[]:i.value.split(";")).map((function(e){var t,n;if(n=e,/^CC\d=/.test(e)){var r=e.split("=");t=r[0],n=r[1]}else/^CC\d$/.test(e)&&(t=e);return{channel:t,language:n}})):"urn:scte:dash:cc:cea-708:2015"===i.schemeIdUri?("string"!=typeof i.value?[]:i.value.split(";")).map((function(e){var t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){var n=e.split("="),r=n[0],i=n[1],a=void 0===i?"":i;t.channel=r,t.language=e,a.split(",").forEach((function(e){var n=e.split(":"),r=n[0],i=n[1];"lang"===r?t.language=i:"er"===r?t.easyReader=Number(i):"war"===r?t.aspectRatio=Number(i):"3D"===r&&(t["3D"]=Number(i))}))}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t})):void 0;d&&(u=ie(u,{captionServices:d}));var f=ke(r,"Label")[0];if(f&&f.childNodes.length){var h=f.childNodes[0].nodeValue.trim();u=ie(u,{label:h})}var p=ke(r,"ContentProtection").reduce((function(e,t){var n=je(t);n.schemeIdUri&&(n.schemeIdUri=n.schemeIdUri.toLowerCase());var r=qe[n.schemeIdUri];if(r){e[r]={attributes:n};var i=ke(t,"cenc:pssh")[0];if(i){var a=Fe(i);e[r].pssh=a&&I(a)}}return e}),{});Object.keys(p).length&&(u=ie(u,{contentProtection:p}));var g=Ge(r),m=ke(r,"Representation"),y=ie(n,g);return se(m.map(function(e,t,n){return function(r){var i=ke(r,"BaseURL"),a=He(t,i),s=ie(e,je(r)),o=Ge(r);return a.map((function(e){return{segmentInfo:ie(n,o),attributes:ie(s,{baseUrl:e})}}))}}(u,s,y)))}}(a,i,o)))}},Ye=function(e){if(""===e)throw new Error("DASH_EMPTY_MANIFEST");var t,n,r=new ne.DOMParser;try{n=(t=r.parseFromString(e,"application/xml"))&&"MPD"===t.documentElement.tagName?t.documentElement:null}catch(e){}if(!n||n&&n.getElementsByTagName("parsererror").length>0)throw new Error("DASH_INVALID_XML");return n},Ze=n(1215),Ke=n.n(Ze),ze=X([73,68,51]),We=function e(t,n){return void 0===n&&(n=0),(t=X(t)).length-n<10||!te(t,ze,{offset:n})?n:(n+=function(e,t){void 0===t&&(t=0);var n=(e=X(e))[t+5],r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&n)>>4?r+20:r+10}(t,n),e(t,n))},Xe=(new Uint8Array([79,112,117,115,72,101,97,100]),function(e){return"string"==typeof e?ee(e):e}),$e=function(e){e=X(e);for(var t=[],n=0;e.length>n;){var r=e[n],i=0,a=0,s=e[++a];for(a++;128&s;)i=(127&s)<<7,s=e[a],a++;i+=127&s;for(var o=0;o<C.length;o++){var l=C[o],u=l.id,c=l.parser;if(r===u){t.push(c(e.subarray(a,a+i)));break}}n+=i+a}return t};C=[{id:3,parser:function(e){var t={tag:3,id:e[0]<<8|e[1],flags:e[2],size:3,dependsOnEsId:0,ocrEsId:0,descriptors:[],url:""};if(128&t.flags&&(t.dependsOnEsId=e[t.size]<<8|e[t.size+1],t.size+=2),64&t.flags){var n=e[t.size];t.url=function(e){if(!e)return"";e=Array.prototype.slice.call(e);var t=String.fromCharCode.apply(null,X(e));try{return decodeURIComponent(escape(t))}catch(e){}return t}(e.subarray(t.size+1,t.size+1+n)),t.size+=n}return 32&t.flags&&(t.ocrEsId=e[t.size]<<8|e[t.size+1],t.size+=2),t.descriptors=$e(e.subarray(t.size))||[],t}},{id:4,parser:function(e){return{tag:4,oti:e[0],streamType:e[1],bufferSize:e[2]<<16|e[3]<<8|e[4],maxBitrate:e[5]<<24|e[6]<<16|e[7]<<8|e[8],avgBitrate:e[9]<<24|e[10]<<16|e[11]<<8|e[12],descriptors:$e(e.subarray(13))}}},{id:5,parser:function(e){return{tag:5,bytes:e}}},{id:6,parser:function(e){return{tag:6,bytes:e}}}];var Qe=function e(t,n,r){void 0===r&&(r=!1),n=function(e){return Array.isArray(e)?e.map((function(e){return Xe(e)})):[Xe(e)]}(n),t=X(t);var i=[];if(!n.length)return i;for(var a=0;a<t.length;){var s=(t[a]<<24|t[a+1]<<16|t[a+2]<<8|t[a+3])>>>0,o=t.subarray(a+4,a+8);if(0===s)break;var l=a+s;if(l>t.length){if(r)break;l=t.length}var u=t.subarray(a+8,l);te(o,n[0])&&(1===n.length?i.push(u):i.push.apply(i,e(u,n.slice(1),r))),a=l}return i},Je={EBML:X([26,69,223,163]),DocType:X([66,130]),Segment:X([24,83,128,103]),SegmentInfo:X([21,73,169,102]),Tracks:X([22,84,174,107]),Track:X([174]),TrackNumber:X([215]),DefaultDuration:X([35,227,131]),TrackEntry:X([174]),TrackType:X([131]),FlagDefault:X([136]),CodecID:X([134]),CodecPrivate:X([99,162]),VideoTrack:X([224]),AudioTrack:X([225]),Cluster:X([31,67,182,117]),Timestamp:X([231]),TimestampScale:X([42,215,177]),BlockGroup:X([160]),BlockDuration:X([155]),Block:X([161]),SimpleBlock:X([163])},et=[128,64,32,16,8,4,2,1],tt=function(e,t,n,r){void 0===n&&(n=!0),void 0===r&&(r=!1);var i=function(e){for(var t=1,n=0;n<et.length&&!(e&et[n]);n++)t++;return t}(e[t]),a=e.subarray(t,t+i);return n&&((a=Array.prototype.slice.call(e,t,t+i))[0]^=et[i-1]),{length:i,value:J(a,{signed:r}),bytes:a}},nt=function e(t){return"string"==typeof t?t.match(/.{1,2}/g).map((function(t){return e(t)})):"number"==typeof t?function(e,t){var n=(void 0===t?{}:t).le,r=void 0!==n&&n;("bigint"!=typeof e&&"number"!=typeof e||"number"==typeof e&&e!=e)&&(e=0);for(var i,a=(i=e=$(e),Math.ceil(function(e){return e.toString(2).length}(i)/8)),s=new Uint8Array(new ArrayBuffer(a)),o=0;o<a;o++){var l=r?o:Math.abs(o+1-s.length);s[l]=Number(e/Q[o]&$(255)),e<0&&(s[l]=Math.abs(~s[l]),s[l]-=0===o?1:2)}return s}(t):t},rt=function e(t,n,r){if(r>=n.length)return n.length;var i=tt(n,r,!1);if(te(t.bytes,i.bytes))return r;var a=tt(n,r+i.length);return e(t,n,r+a.length+a.value+i.length)},it=function e(t,n){n=function(e){return Array.isArray(e)?e.map((function(e){return nt(e)})):[nt(e)]}(n),t=X(t);var r=[];if(!n.length)return r;for(var i=0;i<t.length;){var a=tt(t,i,!1),s=tt(t,i+a.length),o=i+a.length+s.length;127===s.value&&(s.value=rt(a,t,o),s.value!==t.length&&(s.value-=o));var l=o+s.value>t.length?t.length:o+s.value,u=t.subarray(o,l);te(n[0],a.bytes)&&(1===n.length?r.push(u):r=r.concat(e(u,n.slice(1)))),i+=a.length+s.length+u.length}return r},at=X([0,0,0,1]),st=X([0,0,1]),ot=X([0,0,3]),lt=function(e){for(var t=[],n=1;n<e.length-2;)te(e.subarray(n,n+3),ot)&&(t.push(n+2),n++),n++;if(0===t.length)return e;var r=e.length-t.length,i=new Uint8Array(r),a=0;for(n=0;n<r;a++,n++)a===t[0]&&(a++,t.shift()),i[n]=e[a];return i},ut=function(e,t,n,r){void 0===r&&(r=1/0),e=X(e),n=[].concat(n);for(var i,a=0,s=0;a<e.length&&(s<r||i);){var o=void 0;if(te(e.subarray(a),at)?o=4:te(e.subarray(a),st)&&(o=3),o){if(s++,i)return lt(e.subarray(i,a));var l=void 0;"h264"===t?l=31&e[a+o]:"h265"===t&&(l=e[a+o]>>1&63),-1!==n.indexOf(l)&&(i=a+o),a+=o+("h264"===t?1:2)}else a++}return e.subarray(0,0)},ct={webm:X([119,101,98,109]),matroska:X([109,97,116,114,111,115,107,97]),flac:X([102,76,97,67]),ogg:X([79,103,103,83]),ac3:X([11,119]),riff:X([82,73,70,70]),avi:X([65,86,73]),wav:X([87,65,86,69]),"3gp":X([102,116,121,112,51,103]),mp4:X([102,116,121,112]),fmp4:X([115,116,121,112]),mov:X([102,116,121,112,113,116]),moov:X([109,111,111,118]),moof:X([109,111,111,102])},dt={aac:function(e){var t=We(e);return te(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=We(e);return te(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=it(e,[Je.EBML,Je.DocType])[0];return te(t,ct.webm)},mkv:function(e){var t=it(e,[Je.EBML,Je.DocType])[0];return te(t,ct.matroska)},mp4:function(e){return!dt["3gp"](e)&&!dt.mov(e)&&(!(!te(e,ct.mp4,{offset:4})&&!te(e,ct.fmp4,{offset:4}))||!(!te(e,ct.moof,{offset:4})&&!te(e,ct.moov,{offset:4}))||void 0)},mov:function(e){return te(e,ct.mov,{offset:4})},"3gp":function(e){return te(e,ct["3gp"],{offset:4})},ac3:function(e){var t=We(e);return te(e,ct.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return 71===e[0];for(var t=0;t+188<e.length&&t<188;){if(71===e[t]&&71===e[t+188])return!0;t+=1}return!1},flac:function(e){var t=We(e);return te(e,ct.flac,{offset:t})},ogg:function(e){return te(e,ct.ogg)},avi:function(e){return te(e,ct.riff)&&te(e,ct.avi,{offset:8})},wav:function(e){return te(e,ct.riff)&&te(e,ct.wav,{offset:8})},h264:function(e){return function(e,t,n){return ut(e,"h264",7,3)}(e).length},h265:function(e){return function(e,t,n){return ut(e,"h265",[32,33],3)}(e).length}},ft=Object.keys(dt).filter((function(e){return"ts"!==e&&"h264"!==e&&"h265"!==e})).concat(["ts","h264","h265"]);ft.forEach((function(e){var t=dt[e];dt[e]=function(e){return t(X(e))}}));var ht=dt,pt=function(e){e=X(e);for(var t=0;t<ft.length;t++){var n=ft[t];if(ht[n](e))return n}return""},gt=n(9458);function mt(e){return mt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},mt(e)}function yt(e){var t="function"==typeof Map?new Map:void 0;return yt=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return E(e,arguments,mt(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),h(n,e)},yt(e)}for(var vt,_t="7.21.5",Tt={},Et=function(e,t){return Tt[e]=Tt[e]||[],t&&(Tt[e]=Tt[e].concat(t)),Tt[e]},bt=function(e,t){var n=Et(e).indexOf(t);return!(n<=-1||(Tt[e]=Tt[e].slice(),Tt[e].splice(n,1),0))},St={prefixed:!0},At=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],wt=At[0],It=0;It<At.length;It++)if(At[It][1]in l()){vt=At[It];break}if(vt){for(var Ct=0;Ct<vt.length;Ct++)St[wt[Ct]]=vt[Ct];St.prefixed=vt[0]!==wt[0]}var Rt=[],Dt=function e(t){var n,r="info",a=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n("log",r,t)};return n=function(e,t){return function(n,r,a){var s=t.levels[r],o=new RegExp("^("+s+")$");if("log"!==n&&a.unshift(n.toUpperCase()+":"),a.unshift(e+":"),Rt){Rt.push([].concat(a));var l=Rt.length-1e3;Rt.splice(0,l>0?l:0)}if(i().console){var u=i().console[n];u||"debug"!==n||(u=i().console.info||i().console.log),u&&s&&o.test(n)&&u[Array.isArray(a)?"apply":"call"](i().console,a)}}}(t,a),a.createLogger=function(n){return e(t+": "+n)},a.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:r},a.level=function(e){if("string"==typeof e){if(!a.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');r=e}return r},(a.history=function(){return Rt?[].concat(Rt):[]}).filter=function(e){return(Rt||[]).filter((function(t){return new RegExp(".*"+e+".*").test(t[0])}))},a.history.clear=function(){Rt&&(Rt.length=0)},a.history.disable=function(){null!==Rt&&(Rt.length=0,Rt=null)},a.history.enable=function(){null===Rt&&(Rt=[])},a.error=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return n("error",r,t)},a.warn=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return n("warn",r,t)},a.debug=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return n("debug",r,t)},a}("VIDEOJS"),Nt=Dt.createLogger,Ot=Object.prototype.toString,Pt=function(e){return Lt(e)?Object.keys(e):[]};function Mt(e,t){Pt(e).forEach((function(n){return t(e[n],n)}))}function xt(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Object.assign?u.Z.apply(void 0,[e].concat(n)):(n.forEach((function(t){t&&Mt(t,(function(t,n){e[n]=t}))})),e)}function Lt(e){return!!e&&"object"==typeof e}function kt(e){return Lt(e)&&"[object Object]"===Ot.call(e)&&e.constructor===Object}function Ft(e,t){if(!e||!t)return"";if("function"==typeof i().getComputedStyle){var n;try{n=i().getComputedStyle(e)}catch(e){return""}return n?n.getPropertyValue(t)||n[t]:""}return""}var Ut,Bt,jt,qt=i().navigator&&i().navigator.userAgent||"",Ht=/AppleWebKit\/([\d.]+)/i.exec(qt),Gt=Ht?parseFloat(Ht.pop()):null,Vt=/iPod/i.test(qt),Yt=(Ut=qt.match(/OS (\d+)_/i))&&Ut[1]?Ut[1]:null,Zt=/Android/i.test(qt),Kt=function(){var e=qt.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),n=e[2]&&parseFloat(e[2]);return t&&n?parseFloat(e[1]+"."+e[2]):t||null}(),zt=Zt&&Kt<5&&Gt<537,Wt=/Firefox/i.test(qt),Xt=/Edg/i.test(qt),$t=!Xt&&(/Chrome/i.test(qt)||/CriOS/i.test(qt)),Qt=function(){var e=qt.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),Jt=(Bt=/MSIE\s(\d+)\.\d/.exec(qt),!(jt=Bt&&parseFloat(Bt[1]))&&/Trident\/7.0/i.test(qt)&&/rv:11.0/.test(qt)&&(jt=11),jt),en=/Safari/i.test(qt)&&!$t&&!Zt&&!Xt,tn=/Windows/i.test(qt),nn=Boolean(dn()&&("ontouchstart"in i()||i().navigator.maxTouchPoints||i().DocumentTouch&&i().document instanceof i().DocumentTouch)),rn=/iPad/i.test(qt)||en&&nn&&!/iPhone/i.test(qt),an=/iPhone/i.test(qt)&&!rn,sn=an||rn||Vt,on=(en||sn)&&!$t,ln=Object.freeze({__proto__:null,IS_IPOD:Vt,IOS_VERSION:Yt,IS_ANDROID:Zt,ANDROID_VERSION:Kt,IS_NATIVE_ANDROID:zt,IS_FIREFOX:Wt,IS_EDGE:Xt,IS_CHROME:$t,CHROME_VERSION:Qt,IE_VERSION:Jt,IS_SAFARI:en,IS_WINDOWS:tn,TOUCH_ENABLED:nn,IS_IPAD:rn,IS_IPHONE:an,IS_IOS:sn,IS_ANY_SAFARI:on});function un(e){return"string"==typeof e&&Boolean(e.trim())}function cn(e){if(e.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function dn(){return l()===i().document}function fn(e){return Lt(e)&&1===e.nodeType}function hn(){try{return i().parent!==i().self}catch(e){return!0}}function pn(e){return function(t,n){if(!un(t))return l()[e](null);un(n)&&(n=l().querySelector(n));var r=fn(n)?n:l();return r[e]&&r[e](t)}}function gn(e,t,n,r){void 0===e&&(e="div"),void 0===t&&(t={}),void 0===n&&(n={});var i=l().createElement(e);return Object.getOwnPropertyNames(t).forEach((function(e){var n=t[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(Dt.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\ncreateEl(type, properties, attributes). Attempting to set "+e+" to "+n+"."),i.setAttribute(e,n)):"textContent"===e?mn(i,n):i[e]===n&&"tabIndex"!==e||(i[e]=n)})),Object.getOwnPropertyNames(n).forEach((function(e){i.setAttribute(e,n[e])})),r&&Ln(i,r),i}function mn(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function yn(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function vn(e,t){return cn(t),e.classList?e.classList.contains(t):(n=t,new RegExp("(^|\\s)"+n+"($|\\s)")).test(e.className);var n}function _n(e,t){return e.classList?e.classList.add(t):vn(e,t)||(e.className=(e.className+" "+t).trim()),e}function Tn(e,t){return e?(e.classList?e.classList.remove(t):(cn(t),e.className=e.className.split(/\s+/).filter((function(e){return e!==t})).join(" ")),e):(Dt.warn("removeClass was called with an element that doesn't exist"),null)}function En(e,t,n){var r=vn(e,t);if("function"==typeof n&&(n=n(e,t)),"boolean"!=typeof n&&(n=!r),n!==r)return n?_n(e,t):Tn(e,t),e}function bn(e,t){Object.getOwnPropertyNames(t).forEach((function(n){var r=t[n];null==r||!1===r?e.removeAttribute(n):e.setAttribute(n,!0===r?"":r)}))}function Sn(e){var t={};if(e&&e.attributes&&e.attributes.length>0)for(var n=e.attributes,r=n.length-1;r>=0;r--){var i=n[r].name,a=n[r].value;"boolean"!=typeof e[i]&&-1===",autoplay,controls,playsinline,loop,muted,default,defaultMuted,".indexOf(","+i+",")||(a=null!==a),t[i]=a}return t}function An(e,t){return e.getAttribute(t)}function wn(e,t,n){e.setAttribute(t,n)}function In(e,t){e.removeAttribute(t)}function Cn(){l().body.focus(),l().onselectstart=function(){return!1}}function Rn(){l().onselectstart=function(){return!0}}function Dn(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),n={};return["bottom","height","left","right","top","width"].forEach((function(e){void 0!==t[e]&&(n[e]=t[e])})),n.height||(n.height=parseFloat(Ft(e,"height"))),n.width||(n.width=parseFloat(Ft(e,"width"))),n}}function Nn(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};for(var t=e.offsetWidth,n=e.offsetHeight,r=0,i=0;e.offsetParent&&e!==l()[St.fullscreenElement];)r+=e.offsetLeft,i+=e.offsetTop,e=e.offsetParent;return{left:r,top:i,width:t,height:n}}function On(e,t){var n={x:0,y:0};if(sn)for(var r=e;r&&"html"!==r.nodeName.toLowerCase();){var i=Ft(r,"transform");if(/^matrix/.test(i)){var a=i.slice(7,-1).split(/,\s/).map(Number);n.x+=a[4],n.y+=a[5]}else if(/^matrix3d/.test(i)){var s=i.slice(9,-1).split(/,\s/).map(Number);n.x+=s[12],n.y+=s[13]}r=r.parentNode}var o={},l=Nn(t.target),u=Nn(e),c=u.width,d=u.height,f=t.offsetY-(u.top-l.top),h=t.offsetX-(u.left-l.left);return t.changedTouches&&(h=t.changedTouches[0].pageX-u.left,f=t.changedTouches[0].pageY+u.top,sn&&(h-=n.x,f-=n.y)),o.y=1-Math.max(0,Math.min(1,f/d)),o.x=Math.max(0,Math.min(1,h/c)),o}function Pn(e){return Lt(e)&&3===e.nodeType}function Mn(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function xn(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map((function(e){return"function"==typeof e&&(e=e()),fn(e)||Pn(e)?e:"string"==typeof e&&/\S/.test(e)?l().createTextNode(e):void 0})).filter((function(e){return e}))}function Ln(e,t){return xn(t).forEach((function(t){return e.appendChild(t)})),e}function kn(e,t){return Ln(Mn(e),t)}function Fn(e){return void 0===e.button&&void 0===e.buttons||0===e.button&&void 0===e.buttons||"mouseup"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons}var Un,Bn=pn("querySelector"),jn=pn("querySelectorAll"),qn=Object.freeze({__proto__:null,isReal:dn,isEl:fn,isInFrame:hn,createEl:gn,textContent:mn,prependTo:yn,hasClass:vn,addClass:_n,removeClass:Tn,toggleClass:En,setAttributes:bn,getAttributes:Sn,getAttribute:An,setAttribute:wn,removeAttribute:In,blockTextSelection:Cn,unblockTextSelection:Rn,getBoundingClientRect:Dn,findPosition:Nn,getPointerPosition:On,isTextNode:Pn,emptyEl:Mn,normalizeContent:xn,appendContent:Ln,insertContent:kn,isSingleLeftClick:Fn,$:Bn,$$:jn}),Hn=!1,Gn=function(){if(!1!==Un.options.autoSetup){var e=Array.prototype.slice.call(l().getElementsByTagName("video")),t=Array.prototype.slice.call(l().getElementsByTagName("audio")),n=Array.prototype.slice.call(l().getElementsByTagName("video-js")),r=e.concat(t,n);if(r&&r.length>0)for(var i=0,a=r.length;i<a;i++){var s=r[i];if(!s||!s.getAttribute){Vn(1);break}void 0===s.player&&null!==s.getAttribute("data-setup")&&Un(s)}else Hn||Vn(1)}};function Vn(e,t){dn()&&(t&&(Un=t),i().setTimeout(Gn,e))}function Yn(){Hn=!0,i().removeEventListener("load",Yn)}dn()&&("complete"===l().readyState?Yn():i().addEventListener("load",Yn));var Zn,Kn=function(e){var t=l().createElement("style");return t.className=e,t},zn=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t},Wn=3;function Xn(){return Wn++}i().WeakMap||(Zn=function(){function e(){this.vdata="vdata"+Math.floor(i().performance&&i().performance.now()||Date.now()),this.data={}}var t=e.prototype;return t.set=function(e,t){var n=e[this.vdata]||Xn();return e[this.vdata]||(e[this.vdata]=n),this.data[n]=t,this},t.get=function(e){var t=e[this.vdata];if(t)return this.data[t];Dt("We have no data for this element",e)},t.has=function(e){return e[this.vdata]in this.data},t.delete=function(e){var t=e[this.vdata];t&&(delete this.data[t],delete e[this.vdata])},e}());var $n,Qn=i().WeakMap?new WeakMap:new Zn;function Jn(e,t){if(Qn.has(e)){var n=Qn.get(e);0===n.handlers[t].length&&(delete n.handlers[t],e.removeEventListener?e.removeEventListener(t,n.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,n.dispatcher)),Object.getOwnPropertyNames(n.handlers).length<=0&&(delete n.handlers,delete n.dispatcher,delete n.disabled),0===Object.getOwnPropertyNames(n).length&&Qn.delete(e)}}function er(e,t,n,r){n.forEach((function(n){e(t,n,r)}))}function tr(e){if(e.fixed_)return e;function t(){return!0}function n(){return!1}if(!e||!e.isPropagationStopped||!e.isImmediatePropagationStopped){var r=e||i().event;for(var a in e={},r)"layerX"!==a&&"layerY"!==a&&"keyLocation"!==a&&"webkitMovementX"!==a&&"webkitMovementY"!==a&&"path"!==a&&("returnValue"===a&&r.preventDefault||(e[a]=r[a]));if(e.target||(e.target=e.srcElement||l()),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){r.preventDefault&&r.preventDefault(),e.returnValue=!1,r.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){r.stopPropagation&&r.stopPropagation(),e.cancelBubble=!0,r.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=n,e.stopImmediatePropagation=function(){r.stopImmediatePropagation&&r.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=n,null!==e.clientX&&void 0!==e.clientX){var s=l().documentElement,o=l().body;e.pageX=e.clientX+(s&&s.scrollLeft||o&&o.scrollLeft||0)-(s&&s.clientLeft||o&&o.clientLeft||0),e.pageY=e.clientY+(s&&s.scrollTop||o&&o.scrollTop||0)-(s&&s.clientTop||o&&o.clientTop||0)}e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e.fixed_=!0,e}var nr=function(){if("boolean"!=typeof $n){$n=!1;try{var e=Object.defineProperty({},"passive",{get:function(){$n=!0}});i().addEventListener("test",null,e),i().removeEventListener("test",null,e)}catch(e){}}return $n},rr=["touchstart","touchmove"];function ir(e,t,n){if(Array.isArray(t))return er(ir,e,t,n);Qn.has(e)||Qn.set(e,{});var r=Qn.get(e);if(r.handlers||(r.handlers={}),r.handlers[t]||(r.handlers[t]=[]),n.guid||(n.guid=Xn()),r.handlers[t].push(n),r.dispatcher||(r.disabled=!1,r.dispatcher=function(t,n){if(!r.disabled){t=tr(t);var i=r.handlers[t.type];if(i)for(var a=i.slice(0),s=0,o=a.length;s<o&&!t.isImmediatePropagationStopped();s++)try{a[s].call(e,t,n)}catch(e){Dt.error(e)}}}),1===r.handlers[t].length)if(e.addEventListener){var i=!1;nr()&&rr.indexOf(t)>-1&&(i={passive:!0}),e.addEventListener(t,r.dispatcher,i)}else e.attachEvent&&e.attachEvent("on"+t,r.dispatcher)}function ar(e,t,n){if(Qn.has(e)){var r=Qn.get(e);if(r.handlers){if(Array.isArray(t))return er(ar,e,t,n);var i=function(e,t){r.handlers[t]=[],Jn(e,t)};if(void 0!==t){var a=r.handlers[t];if(a)if(n){if(n.guid)for(var s=0;s<a.length;s++)a[s].guid===n.guid&&a.splice(s--,1);Jn(e,t)}else i(e,t)}else for(var o in r.handlers)Object.prototype.hasOwnProperty.call(r.handlers||{},o)&&i(e,o)}}}function sr(e,t,n){var r=Qn.has(e)?Qn.get(e):{},i=e.parentNode||e.ownerDocument;if("string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=tr(t),r.dispatcher&&r.dispatcher.call(e,t,n),i&&!t.isPropagationStopped()&&!0===t.bubbles)sr.call(null,i,t,n);else if(!i&&!t.defaultPrevented&&t.target&&t.target[t.type]){Qn.has(t.target)||Qn.set(t.target,{});var a=Qn.get(t.target);t.target[t.type]&&(a.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),a.disabled=!1)}return!t.defaultPrevented}function or(e,t,n){if(Array.isArray(t))return er(or,e,t,n);var r=function r(){ar(e,t,r),n.apply(this,arguments)};r.guid=n.guid=n.guid||Xn(),ir(e,t,r)}function lr(e,t,n){var r=function r(){ar(e,t,r),n.apply(this,arguments)};r.guid=n.guid=n.guid||Xn(),ir(e,t,r)}var ur,cr=Object.freeze({__proto__:null,fixEvent:tr,on:ir,off:ar,trigger:sr,one:or,any:lr}),dr=30,fr=function(e,t,n){t.guid||(t.guid=Xn());var r=t.bind(e);return r.guid=n?n+"_"+t.guid:t.guid,r},hr=function(e,t){var n=i().performance.now();return function(){var r=i().performance.now();r-n>=t&&(e.apply(void 0,arguments),n=r)}},pr=function(){};pr.prototype.allowedEvents_={},pr.prototype.on=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},ir(this,e,t),this.addEventListener=n},pr.prototype.addEventListener=pr.prototype.on,pr.prototype.off=function(e,t){ar(this,e,t)},pr.prototype.removeEventListener=pr.prototype.off,pr.prototype.one=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},or(this,e,t),this.addEventListener=n},pr.prototype.any=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},lr(this,e,t),this.addEventListener=n},pr.prototype.trigger=function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=tr(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),sr(this,e)},pr.prototype.dispatchEvent=pr.prototype.trigger,pr.prototype.queueTrigger=function(e){var t=this;ur||(ur=new Map);var n=e.type||e,r=ur.get(this);r||(r=new Map,ur.set(this,r));var a=r.get(n);r.delete(n),i().clearTimeout(a);var s=i().setTimeout((function(){r.delete(n),0===r.size&&(r=null,ur.delete(t)),t.trigger(e)}),0);r.set(n,s)};var gr=function(e){return"function"==typeof e.name?e.name():"string"==typeof e.name?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e},mr=function(e){return e instanceof pr||!!e.eventBusEl_&&["on","one","off","trigger"].every((function(t){return"function"==typeof e[t]}))},yr=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},vr=function(e,t,n){if(!e||!e.nodeName&&!mr(e))throw new Error("Invalid target for "+gr(t)+"#"+n+"; must be a DOM node or evented object.")},_r=function(e,t,n){if(!yr(e))throw new Error("Invalid event type for "+gr(t)+"#"+n+"; must be a non-empty string or array.")},Tr=function(e,t,n){if("function"!=typeof e)throw new Error("Invalid listener for "+gr(t)+"#"+n+"; must be a function.")},Er=function(e,t,n){var r,i,a,s=t.length<3||t[0]===e||t[0]===e.eventBusEl_;return s?(r=e.eventBusEl_,t.length>=3&&t.shift(),i=t[0],a=t[1]):(r=t[0],i=t[1],a=t[2]),vr(r,e,n),_r(i,e,n),Tr(a,e,n),{isTargetingSelf:s,target:r,type:i,listener:a=fr(e,a)}},br=function(e,t,n,r){vr(e,e,t),e.nodeName?cr[t](e,n,r):e[t](n,r)},Sr={on:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=Er(this,n,"on"),a=i.isTargetingSelf,s=i.target,o=i.type,l=i.listener;if(br(s,"on",o,l),!a){var u=function(){return e.off(s,o,l)};u.guid=l.guid;var c=function(){return e.off("dispose",u)};c.guid=l.guid,br(this,"on","dispose",u),br(s,"on","dispose",c)}},one:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=Er(this,n,"one"),a=i.isTargetingSelf,s=i.target,o=i.type,l=i.listener;if(a)br(s,"one",o,l);else{var u=function t(){e.off(s,o,t);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];l.apply(null,r)};u.guid=l.guid,br(s,"one",o,u)}},any:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=Er(this,n,"any"),a=i.isTargetingSelf,s=i.target,o=i.type,l=i.listener;if(a)br(s,"any",o,l);else{var u=function t(){e.off(s,o,t);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];l.apply(null,r)};u.guid=l.guid,br(s,"any",o,u)}},off:function(e,t,n){if(!e||yr(e))ar(this.eventBusEl_,e,t);else{var r=e,i=t;vr(r,this,"off"),_r(i,this,"off"),Tr(n,this,"off"),n=fr(this,n),this.off("dispose",n),r.nodeName?(ar(r,i,n),ar(r,"dispose",n)):mr(r)&&(r.off(i,n),r.off("dispose",n))}},trigger:function(e,t){vr(this.eventBusEl_,this,"trigger");var n=e&&"string"!=typeof e?e.type:e;if(!yr(n)){var r="Invalid event type for "+gr(this)+"#trigger; must be a non-empty string or object with a type key that has a non-empty value.";if(!e)throw new Error(r);(this.log||Dt).error(r)}return sr(this.eventBusEl_,e,t)}};function Ar(e,t){void 0===t&&(t={});var n=t.eventBusKey;if(n){if(!e[n].nodeName)throw new Error('The eventBusKey "'+n+'" does not refer to an element.');e.eventBusEl_=e[n]}else e.eventBusEl_=gn("span",{className:"vjs-event-bus"});return xt(e,Sr),e.eventedCallbacks&&e.eventedCallbacks.forEach((function(e){e()})),e.on("dispose",(function(){e.off(),[e,e.el_,e.eventBusEl_].forEach((function(e){e&&Qn.has(e)&&Qn.delete(e)})),i().setTimeout((function(){e.eventBusEl_=null}),0)})),e}var wr={state:{},setState:function(e){var t,n=this;return"function"==typeof e&&(e=e()),Mt(e,(function(e,r){n.state[r]!==e&&((t=t||{})[r]={from:n.state[r],to:e}),n.state[r]=e})),t&&mr(this)&&this.trigger({changes:t,type:"statechanged"}),t}};function Ir(e,t){return xt(e,wr),e.state=xt({},e.state,t),"function"==typeof e.handleStateChanged&&mr(e)&&e.on("statechanged",e.handleStateChanged),e}var Cr=function(e){return"string"!=typeof e?e:e.replace(/./,(function(e){return e.toLowerCase()}))},Rr=function(e){return"string"!=typeof e?e:e.replace(/./,(function(e){return e.toUpperCase()}))};function Dr(){for(var e={},t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return n.forEach((function(t){t&&Mt(t,(function(t,n){kt(t)?(kt(e[n])||(e[n]={}),e[n]=Dr(e[n],t)):e[n]=t}))})),e}var Nr=function(){function e(){this.map_={}}var t=e.prototype;return t.has=function(e){return e in this.map_},t.delete=function(e){var t=this.has(e);return delete this.map_[e],t},t.set=function(e,t){return this.map_[e]=t,this},t.forEach=function(e,t){for(var n in this.map_)e.call(t,this.map_[n],n,this)},e}(),Or=i().Map?i().Map:Nr,Pr=function(){function e(){this.set_={}}var t=e.prototype;return t.has=function(e){return e in this.set_},t.delete=function(e){var t=this.has(e);return delete this.set_[e],t},t.add=function(e){return this.set_[e]=1,this},t.forEach=function(e,t){for(var n in this.set_)e.call(t,n,n,this)},e}(),Mr=i().Set?i().Set:Pr,xr=function(){function e(e,t,n){var r=this;if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=Dr({},this.options_),t=this.options_=Dr(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){var i=e&&e.id&&e.id()||"no_player";this.id_=i+"_component_"+Xn()}this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach((function(e){return r.addClass(e)})),!1!==t.evented&&(Ar(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),Ir(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Mr,this.setIntervalIds_=new Mr,this.rafIds_=new Mr,this.namedRafs_=new Or,this.clearingTimersOnDispose_=!1,!1!==t.initChildren&&this.initChildren(),this.ready(n),!1!==t.reportTouchActivity&&this.enableTouchActivity()}var t=e.prototype;return t.dispose=function(e){if(void 0===e&&(e={}),!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(var t=this.children_.length-1;t>=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}},t.isDisposed=function(){return Boolean(this.isDisposed_)},t.player=function(){return this.player_},t.options=function(e){return e?(this.options_=Dr(this.options_,e),this.options_):this.options_},t.el=function(){return this.el_},t.createEl=function(e,t,n){return gn(e,t,n)},t.localize=function(e,t,n){void 0===n&&(n=e);var r=this.player_.language&&this.player_.language(),i=this.player_.languages&&this.player_.languages(),a=i&&i[r],s=r&&r.split("-")[0],o=i&&i[s],l=n;return a&&a[e]?l=a[e]:o&&o[e]&&(l=o[e]),t&&(l=l.replace(/\{(\d+)\}/g,(function(e,n){var r=t[n-1],i=r;return void 0===r&&(i=e),i}))),l},t.handleLanguagechange=function(){},t.contentEl=function(){return this.contentEl_||this.el_},t.id=function(){return this.id_},t.name=function(){return this.name_},t.children=function(){return this.children_},t.getChildById=function(e){return this.childIndex_[e]},t.getChild=function(e){if(e)return this.childNameIndex_[e]},t.getDescendant=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t=t.reduce((function(e,t){return e.concat(t)}),[]);for(var r=this,i=0;i<t.length;i++)if(!(r=r.getChild(t[i]))||!r.getChild)return;return r},t.addChild=function(t,n,r){var i,a;if(void 0===n&&(n={}),void 0===r&&(r=this.children_.length),"string"==typeof t){a=Rr(t);var s=n.componentClass||a;n.name=a;var o=e.getComponent(s);if(!o)throw new Error("Component "+s+" does not exist");if("function"!=typeof o)return null;i=new o(this.player_||this,n)}else i=t;if(i.parentComponent_&&i.parentComponent_.removeChild(i),this.children_.splice(r,0,i),i.parentComponent_=this,"function"==typeof i.id&&(this.childIndex_[i.id()]=i),(a=a||i.name&&Rr(i.name()))&&(this.childNameIndex_[a]=i,this.childNameIndex_[Cr(a)]=i),"function"==typeof i.el&&i.el()){var l=null;this.children_[r+1]&&(this.children_[r+1].el_?l=this.children_[r+1].el_:fn(this.children_[r+1])&&(l=this.children_[r+1])),this.contentEl().insertBefore(i.el(),l)}return i},t.removeChild=function(e){if("string"==typeof e&&(e=this.getChild(e)),e&&this.children_){for(var t=!1,n=this.children_.length-1;n>=0;n--)if(this.children_[n]===e){t=!0,this.children_.splice(n,1);break}if(t){e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[Rr(e.name())]=null,this.childNameIndex_[Cr(e.name())]=null;var r=e.el();r&&r.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},t.initChildren=function(){var t=this,n=this.options_.children;if(n){var r,i=this.options_,a=e.getComponent("Tech");(r=Array.isArray(n)?n:Object.keys(n)).concat(Object.keys(this.options_).filter((function(e){return!r.some((function(t){return"string"==typeof t?e===t:e===t.name}))}))).map((function(e){var r,i;return"string"==typeof e?i=n[r=e]||t.options_[r]||{}:(r=e.name,i=e),{name:r,opts:i}})).filter((function(t){var n=e.getComponent(t.opts.componentClass||Rr(t.name));return n&&!a.isTech(n)})).forEach((function(e){var n=e.name,r=e.opts;if(void 0!==i[n]&&(r=i[n]),!1!==r){!0===r&&(r={}),r.playerOptions=t.options_.playerOptions;var a=t.addChild(n,r);a&&(t[n]=a)}}))}},t.buildCSSClass=function(){return""},t.ready=function(e,t){if(void 0===t&&(t=!1),e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))},t.triggerReady=function(){this.isReady_=!0,this.setTimeout((function(){var e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach((function(e){e.call(this)}),this),this.trigger("ready")}),1)},t.$=function(e,t){return Bn(e,t||this.contentEl())},t.$$=function(e,t){return jn(e,t||this.contentEl())},t.hasClass=function(e){return vn(this.el_,e)},t.addClass=function(e){_n(this.el_,e)},t.removeClass=function(e){Tn(this.el_,e)},t.toggleClass=function(e,t){En(this.el_,e,t)},t.show=function(){this.removeClass("vjs-hidden")},t.hide=function(){this.addClass("vjs-hidden")},t.lockShowing=function(){this.addClass("vjs-lock-showing")},t.unlockShowing=function(){this.removeClass("vjs-lock-showing")},t.getAttribute=function(e){return An(this.el_,e)},t.setAttribute=function(e,t){wn(this.el_,e,t)},t.removeAttribute=function(e){In(this.el_,e)},t.width=function(e,t){return this.dimension("width",e,t)},t.height=function(e,t){return this.dimension("height",e,t)},t.dimensions=function(e,t){this.width(e,!0),this.height(t)},t.dimension=function(e,t,n){if(void 0!==t)return null!==t&&t==t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(n||this.trigger("componentresize"));if(!this.el_)return 0;var r=this.el_.style[e],i=r.indexOf("px");return-1!==i?parseInt(r.slice(0,i),10):parseInt(this.el_["offset"+Rr(e)],10)},t.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if(t=Ft(this.el_,e),0===(t=parseFloat(t))||isNaN(t)){var n="offset"+Rr(e);t=this.el_[n]}return t},t.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},t.currentWidth=function(){return this.currentDimension("width")},t.currentHeight=function(){return this.currentDimension("height")},t.focus=function(){this.el_.focus()},t.blur=function(){this.el_.blur()},t.handleKeyDown=function(e){this.player_&&(d().isEventKey(e,"Tab")||e.stopPropagation(),this.player_.handleKeyDown(e))},t.handleKeyPress=function(e){this.handleKeyDown(e)},t.emitTapEvents=function(){var e,t=0,n=null;this.on("touchstart",(function(r){1===r.touches.length&&(n={pageX:r.touches[0].pageX,pageY:r.touches[0].pageY},t=i().performance.now(),e=!0)})),this.on("touchmove",(function(t){if(t.touches.length>1)e=!1;else if(n){var r=t.touches[0].pageX-n.pageX,i=t.touches[0].pageY-n.pageY;Math.sqrt(r*r+i*i)>10&&(e=!1)}}));var r=function(){e=!1};this.on("touchleave",r),this.on("touchcancel",r),this.on("touchend",(function(r){n=null,!0===e&&i().performance.now()-t<200&&(r.preventDefault(),this.trigger("tap"))}))},t.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e,t=fr(this.player(),this.player().reportUserActivity);this.on("touchstart",(function(){t(),this.clearInterval(e),e=this.setInterval(t,250)}));var n=function(n){t(),this.clearInterval(e)};this.on("touchmove",t),this.on("touchend",n),this.on("touchcancel",n)}},t.setTimeout=function(e,t){var n,r=this;return e=fr(this,e),this.clearTimersOnDispose_(),n=i().setTimeout((function(){r.setTimeoutIds_.has(n)&&r.setTimeoutIds_.delete(n),e()}),t),this.setTimeoutIds_.add(n),n},t.clearTimeout=function(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),i().clearTimeout(e)),e},t.setInterval=function(e,t){e=fr(this,e),this.clearTimersOnDispose_();var n=i().setInterval(e,t);return this.setIntervalIds_.add(n),n},t.clearInterval=function(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),i().clearInterval(e)),e},t.requestAnimationFrame=function(e){var t,n=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),e=fr(this,e),t=i().requestAnimationFrame((function(){n.rafIds_.has(t)&&n.rafIds_.delete(t),e()})),this.rafIds_.add(t),t):this.setTimeout(e,1e3/60)},t.requestNamedAnimationFrame=function(e,t){var n=this;if(!this.namedRafs_.has(e)){this.clearTimersOnDispose_(),t=fr(this,t);var r=this.requestAnimationFrame((function(){t(),n.namedRafs_.has(e)&&n.namedRafs_.delete(e)}));return this.namedRafs_.set(e,r),e}},t.cancelNamedAnimationFrame=function(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))},t.cancelAnimationFrame=function(e){return this.supportsRaf_?(this.rafIds_.has(e)&&(this.rafIds_.delete(e),i().cancelAnimationFrame(e)),e):this.clearTimeout(e)},t.clearTimersOnDispose_=function(){var e=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",(function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach((function(t){var n=t[0],r=t[1];e[n].forEach((function(t,n){return e[r](n)}))})),e.clearingTimersOnDispose_=!1})))},e.registerComponent=function(t,n){if("string"!=typeof t||!t)throw new Error('Illegal component name, "'+t+'"; must be a non-empty string.');var r=e.getComponent("Tech"),i=r&&r.isTech(n),a=e===n||e.prototype.isPrototypeOf(n.prototype);if(i||!a)throw new Error('Illegal component, "'+t+'"; '+(i?"techs must be registered using Tech.registerTech()":"must be a Component subclass")+".");t=Rr(t),e.components_||(e.components_={});var s=e.getComponent("Player");if("Player"===t&&s&&s.players){var o=s.players,l=Object.keys(o);if(o&&l.length>0&&l.map((function(e){return o[e]})).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return e.components_[t]=n,e.components_[Cr(t)]=n,n},e.getComponent=function(t){if(t&&e.components_)return e.components_[t]},e}();function Lr(e,t,n,r){return function(e,t,n){if("number"!=typeof t||t<0||t>n)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+n+").")}(e,r,n.length-1),n[r][t]}function kr(e){var t;return t=void 0===e||0===e.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:Lr.bind(null,"start",0,e),end:Lr.bind(null,"end",1,e)},i().Symbol&&i().Symbol.iterator&&(t[i().Symbol.iterator]=function(){return(e||[]).values()}),t}function Fr(e,t){return Array.isArray(e)?kr(e):void 0===e||void 0===t?kr():kr([[e,t]])}function Ur(e,t){var n,r,i=0;if(!t)return 0;e&&e.length||(e=Fr(0,0));for(var a=0;a<e.length;a++)n=e.start(a),(r=e.end(a))>t&&(r=t),i+=r-n;return i/t}function Br(e){if(e instanceof Br)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:Lt(e)&&("number"==typeof e.code&&(this.code=e.code),xt(this,e)),this.message||(this.message=Br.defaultMessages[this.code]||"")}xr.prototype.supportsRaf_="function"==typeof i().requestAnimationFrame&&"function"==typeof i().cancelAnimationFrame,xr.registerComponent("Component",xr),Br.prototype.code=0,Br.prototype.message="",Br.prototype.status=null,Br.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Br.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(var jr=0;jr<Br.errorTypes.length;jr++)Br[Br.errorTypes[jr]]=jr,Br.prototype[Br.errorTypes[jr]]=jr;function qr(e){return null!=e&&"function"==typeof e.then}function Hr(e){qr(e)&&e.then(null,(function(e){}))}var Gr=function(e){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((function(t,n,r){return e[n]&&(t[n]=e[n]),t}),{cues:e.cues&&Array.prototype.map.call(e.cues,(function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}}))})},Vr="vjs-modal-dialog",Yr=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).handleKeyDown_=function(e){return r.handleKeyDown(e)},r.close_=function(e){return r.close(e)},r.opened_=r.hasBeenOpened_=r.hasBeenFilled_=!1,r.closeable(!r.options_.uncloseable),r.content(r.options_.content),r.contentEl_=gn("div",{className:Vr+"-content"},{role:"document"}),r.descEl_=gn("p",{className:Vr+"-description vjs-control-text",id:r.el().getAttribute("aria-describedby")}),mn(r.descEl_,r.description()),r.el_.appendChild(r.descEl_),r.el_.appendChild(r.contentEl_),r}p(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},n.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,e.prototype.dispose.call(this)},n.buildCSSClass=function(){return Vr+" vjs-hidden "+e.prototype.buildCSSClass.call(this)},n.label=function(){return this.localize(this.options_.label||"Modal Window")},n.description=function(){var e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e},n.open=function(){if(!this.opened_){var e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}},n.opened=function(e){return"boolean"==typeof e&&this[e?"open":"close"](),this.opened_},n.close=function(){if(this.opened_){var e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}},n.closeable=function(e){if("boolean"==typeof e){var t=this.closeable_=!!e,n=this.getChild("closeButton");if(t&&!n){var r=this.contentEl_;this.contentEl_=this.el_,n=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=r,this.on(n,"close",this.close_)}!t&&n&&(this.off(n,"close",this.close_),this.removeChild(n),n.dispose())}return this.closeable_},n.fill=function(){this.fillWith(this.content())},n.fillWith=function(e){var t=this.contentEl(),n=t.parentNode,r=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,n.removeChild(t),this.empty(),kn(t,e),this.trigger("modalfill"),r?n.insertBefore(t,r):n.appendChild(t);var i=this.getChild("closeButton");i&&n.appendChild(i.el_)},n.empty=function(){this.trigger("beforemodalempty"),Mn(this.contentEl()),this.trigger("modalempty")},n.content=function(e){return void 0!==e&&(this.content_=e),this.content_},n.conditionalFocus_=function(){var e=l().activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())},n.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)},n.handleKeyDown=function(e){if(e.stopPropagation(),d().isEventKey(e,"Escape")&&this.closeable())return e.preventDefault(),void this.close();if(d().isEventKey(e,"Tab")){for(var t,n=this.focusableEls_(),r=this.el_.querySelector(":focus"),i=0;i<n.length;i++)if(r===n[i]){t=i;break}l().activeElement===this.el_&&(t=0),e.shiftKey&&0===t?(n[n.length-1].focus(),e.preventDefault()):e.shiftKey||t!==n.length-1||(n[0].focus(),e.preventDefault())}},n.focusableEls_=function(){var e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,(function(e){return(e instanceof i().HTMLAnchorElement||e instanceof i().HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof i().HTMLInputElement||e instanceof i().HTMLSelectElement||e instanceof i().HTMLTextAreaElement||e instanceof i().HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof i().HTMLIFrameElement||e instanceof i().HTMLObjectElement||e instanceof i().HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable")}))},t}(xr);Yr.prototype.options_={pauseOnOpen:!0,temporary:!0},xr.registerComponent("ModalDialog",Yr);var Zr=function(e){function t(t){var n;void 0===t&&(t=[]),(n=e.call(this)||this).tracks_=[],Object.defineProperty(f(n),"length",{get:function(){return this.tracks_.length}});for(var r=0;r<t.length;r++)n.addTrack(t[r]);return n}p(t,e);var n=t.prototype;return n.addTrack=function(e){var t=this,n=this.tracks_.length;""+n in this||Object.defineProperty(this,n,{get:function(){return this.tracks_[n]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=function(){t.trigger({track:e,type:"labelchange",target:t})},mr(e)&&e.addEventListener("labelchange",e.labelchange_)},n.removeTrack=function(e){for(var t,n=0,r=this.length;n<r;n++)if(this[n]===e){(t=this[n]).off&&t.off(),this.tracks_.splice(n,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})},n.getTrackById=function(e){for(var t=null,n=0,r=this.length;n<r;n++){var i=this[n];if(i.id===e){t=i;break}}return t},t}(pr);for(var Kr in Zr.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"},Zr.prototype.allowedEvents_)Zr.prototype["on"+Kr]=null;var zr=function(e,t){for(var n=0;n<e.length;n++)Object.keys(e[n]).length&&t.id!==e[n].id&&(e[n].enabled=!1)},Wr=function(e){function t(t){var n;void 0===t&&(t=[]);for(var r=t.length-1;r>=0;r--)if(t[r].enabled){zr(t,t[r]);break}return(n=e.call(this,t)||this).changing_=!1,n}p(t,e);var n=t.prototype;return n.addTrack=function(t){var n=this;t.enabled&&zr(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.enabledChange_=function(){n.changing_||(n.changing_=!0,zr(n,t),n.changing_=!1,n.trigger("change"))},t.addEventListener("enabledchange",t.enabledChange_))},n.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&t.enabledChange_&&(t.removeEventListener("enabledchange",t.enabledChange_),t.enabledChange_=null)},t}(Zr),Xr=function(e,t){for(var n=0;n<e.length;n++)Object.keys(e[n]).length&&t.id!==e[n].id&&(e[n].selected=!1)},$r=function(e){function t(t){var n;void 0===t&&(t=[]);for(var r=t.length-1;r>=0;r--)if(t[r].selected){Xr(t,t[r]);break}return(n=e.call(this,t)||this).changing_=!1,Object.defineProperty(f(n),"selectedIndex",{get:function(){for(var e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set:function(){}}),n}p(t,e);var n=t.prototype;return n.addTrack=function(t){var n=this;t.selected&&Xr(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.selectedChange_=function(){n.changing_||(n.changing_=!0,Xr(n,t),n.changing_=!1,n.trigger("change"))},t.addEventListener("selectedchange",t.selectedChange_))},n.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&t.selectedChange_&&(t.removeEventListener("selectedchange",t.selectedChange_),t.selectedChange_=null)},t}(Zr),Qr=function(e){function t(){return e.apply(this,arguments)||this}p(t,e);var n=t.prototype;return n.addTrack=function(t){var n=this;e.prototype.addTrack.call(this,t),this.queueChange_||(this.queueChange_=function(){return n.queueTrigger("change")}),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=function(){return n.trigger("selectedlanguagechange")}),t.addEventListener("modechange",this.queueChange_),-1===["metadata","chapters"].indexOf(t.kind)&&t.addEventListener("modechange",this.triggerSelectedlanguagechange_)},n.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&(this.queueChange_&&t.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&t.removeEventListener("modechange",this.triggerSelectedlanguagechange_))},t}(Zr),Jr=function(){function e(e){void 0===e&&(e=[]),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var t=0,n=e.length;t<n;t++)this.addTrackElement_(e[t])}var t=e.prototype;return t.addTrackElement_=function(e){var t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.trackElements_[t]}}),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)},t.getTrackElementByTrack_=function(e){for(var t,n=0,r=this.trackElements_.length;n<r;n++)if(e===this.trackElements_[n].track){t=this.trackElements_[n];break}return t},t.removeTrackElement_=function(e){for(var t=0,n=this.trackElements_.length;t<n;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&"function"==typeof this.trackElements_[t].track.off&&this.trackElements_[t].track.off(),"function"==typeof this.trackElements_[t].off&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}},e}(),ei=function(){function e(t){e.prototype.setCues_.call(this,t),Object.defineProperty(this,"length",{get:function(){return this.length_}})}var t=e.prototype;return t.setCues_=function(e){var t=this.length||0,n=0,r=e.length;this.cues_=e,this.length_=e.length;var i=function(e){""+e in this||Object.defineProperty(this,""+e,{get:function(){return this.cues_[e]}})};if(t<r)for(n=t;n<r;n++)i.call(this,n)},t.getCueById=function(e){for(var t=null,n=0,r=this.length;n<r;n++){var i=this[n];if(i.id===e){t=i;break}}return t},e}(),ti={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},ni={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},ri={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},ii={disabled:"disabled",hidden:"hidden",showing:"showing"},ai=function(e){function t(t){var n;void 0===t&&(t={}),n=e.call(this)||this;var r={id:t.id||"vjs_track_"+Xn(),kind:t.kind||"",language:t.language||""},i=t.label||"",a=function(e){Object.defineProperty(f(n),e,{get:function(){return r[e]},set:function(){}})};for(var s in r)a(s);return Object.defineProperty(f(n),"label",{get:function(){return i},set:function(e){e!==i&&(i=e,this.trigger("labelchange"))}}),n}return p(t,e),t}(pr),si=function(e){var t=["protocol","hostname","port","pathname","search","hash","host"],n=l().createElement("a");n.href=e;for(var r={},a=0;a<t.length;a++)r[t[a]]=n[t[a]];return"http:"===r.protocol&&(r.host=r.host.replace(/:80$/,"")),"https:"===r.protocol&&(r.host=r.host.replace(/:443$/,"")),r.protocol||(r.protocol=i().location.protocol),r.host||(r.host=i().location.host),r},oi=function(e){if(!e.match(/^https?:\/\//)){var t=l().createElement("a");t.href=e,e=t.href}return e},li=function(e){if("string"==typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e);if(t)return t.pop().toLowerCase()}return""},ui=function(e,t){void 0===t&&(t=i().location);var n=si(e);return(":"===n.protocol?t.protocol:n.protocol)+n.host!==t.protocol+t.host},ci=Object.freeze({__proto__:null,parseUrl:si,getAbsoluteURL:oi,getFileExtension:li,isCrossOrigin:ui}),di=function(e,t){var n=new(i().WebVTT.Parser)(i(),i().vttjs,i().WebVTT.StringDecoder()),r=[];n.oncue=function(e){t.addCue(e)},n.onparsingerror=function(e){r.push(e)},n.onflush=function(){t.trigger({type:"loadeddata",target:t})},n.parse(e),r.length>0&&(i().console&&i().console.groupCollapsed&&i().console.groupCollapsed("Text Track parsing errors for "+t.src),r.forEach((function(e){return Dt.error(e)})),i().console&&i().console.groupEnd&&i().console.groupEnd()),n.flush()},fi=function(e,t){var n={uri:e},r=ui(e);r&&(n.cors=r);var a="use-credentials"===t.tech_.crossOrigin();a&&(n.withCredentials=a),v()(n,fr(this,(function(e,n,r){if(e)return Dt.error(e,n);t.loaded_=!0,"function"!=typeof i().WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],(function(e){if("vttjserror"!==e.type)return di(r,t);Dt.error("vttjs failed to load, stopping trying to process "+t.src)})):di(r,t)})))},hi=function(e){function t(t){var n;if(void 0===t&&(t={}),!t.tech)throw new Error("A tech was not provided.");var r=Dr(t,{kind:ri[t.kind]||"subtitles",language:t.language||t.srclang||""}),i=ii[r.mode]||"disabled",a=r.default;"metadata"!==r.kind&&"chapters"!==r.kind||(i="hidden"),(n=e.call(this,r)||this).tech_=r.tech,n.cues_=[],n.activeCues_=[],n.preload_=!1!==n.tech_.preloadTextTracks;var s=new ei(n.cues_),o=new ei(n.activeCues_),l=!1;return n.timeupdateHandler=fr(f(n),(function(e){void 0===e&&(e={}),this.tech_.isDisposed()||(this.tech_.isReady_?(this.activeCues=this.activeCues,l&&(this.trigger("cuechange"),l=!1),"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))):"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)))})),n.tech_.one("dispose",(function(){n.stopTracking()})),"disabled"!==i&&n.startTracking(),Object.defineProperties(f(n),{default:{get:function(){return a},set:function(){}},mode:{get:function(){return i},set:function(e){ii[e]&&i!==e&&(i=e,this.preload_||"disabled"===i||0!==this.cues.length||fi(this.src,this),this.stopTracking(),"disabled"!==i&&this.startTracking(),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?s:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return o;for(var e=this.tech_.currentTime(),t=[],n=0,r=this.cues.length;n<r;n++){var i=this.cues[n];(i.startTime<=e&&i.endTime>=e||i.startTime===i.endTime&&i.startTime<=e&&i.startTime+.5>=e)&&t.push(i)}if(l=!1,t.length!==this.activeCues_.length)l=!0;else for(var a=0;a<t.length;a++)-1===this.activeCues_.indexOf(t[a])&&(l=!0);return this.activeCues_=t,o.setCues_(this.activeCues_),o},set:function(){}}}),r.src?(n.src=r.src,n.preload_||(n.loaded_=!0),(n.preload_||"subtitles"!==r.kind&&"captions"!==r.kind)&&fi(n.src,f(n))):n.loaded_=!0,n}p(t,e);var n=t.prototype;return n.startTracking=function(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)},n.stopTracking=function(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)},n.addCue=function(e){var t=e;if(t.constructor&&"VTTCue"!==t.constructor.name){for(var n in t=new(i().vttjs.VTTCue)(e.startTime,e.endTime,e.text),e)n in t||(t[n]=e[n]);t.id=e.id,t.originalCue_=e}for(var r=this.tech_.textTracks(),a=0;a<r.length;a++)r[a]!==this&&r[a].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)},n.removeCue=function(e){for(var t=this.cues_.length;t--;){var n=this.cues_[t];if(n===e||n.originalCue_&&n.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}},t}(ai);hi.prototype.allowedEvents_={cuechange:"cuechange"};var pi=function(e){function t(t){var n;void 0===t&&(t={});var r=Dr(t,{kind:ni[t.kind]||""});n=e.call(this,r)||this;var i=!1;return Object.defineProperty(f(n),"enabled",{get:function(){return i},set:function(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("enabledchange"))}}),r.enabled&&(n.enabled=r.enabled),n.loaded_=!0,n}return p(t,e),t}(ai),gi=function(e){function t(t){var n;void 0===t&&(t={});var r=Dr(t,{kind:ti[t.kind]||""});n=e.call(this,r)||this;var i=!1;return Object.defineProperty(f(n),"selected",{get:function(){return i},set:function(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("selectedchange"))}}),r.selected&&(n.selected=r.selected),n}return p(t,e),t}(ai),mi=function(e){function t(t){var n,r;void 0===t&&(t={}),n=e.call(this)||this;var i=new hi(t);return n.kind=i.kind,n.src=i.src,n.srclang=i.language,n.label=i.label,n.default=i.default,Object.defineProperties(f(n),{readyState:{get:function(){return r}},track:{get:function(){return i}}}),r=0,i.addEventListener("loadeddata",(function(){r=2,n.trigger({type:"load",target:f(n)})})),n}return p(t,e),t}(pr);mi.prototype.allowedEvents_={load:"load"},mi.NONE=0,mi.LOADING=1,mi.LOADED=2,mi.ERROR=3;var yi={audio:{ListClass:Wr,TrackClass:pi,capitalName:"Audio"},video:{ListClass:$r,TrackClass:gi,capitalName:"Video"},text:{ListClass:Qr,TrackClass:hi,capitalName:"Text"}};Object.keys(yi).forEach((function(e){yi[e].getterName=e+"Tracks",yi[e].privateName=e+"Tracks_"}));var vi={remoteText:{ListClass:Qr,TrackClass:hi,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:Jr,TrackClass:mi,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},_i=(0,u.Z)({},yi,vi);vi.names=Object.keys(vi),yi.names=Object.keys(yi),_i.names=[].concat(vi.names).concat(yi.names);var Ti=function(e){function t(t,n){var r;return void 0===t&&(t={}),void 0===n&&(n=function(){}),t.reportTouchActivity=!1,(r=e.call(this,null,t,n)||this).onDurationChange_=function(e){return r.onDurationChange(e)},r.trackProgress_=function(e){return r.trackProgress(e)},r.trackCurrentTime_=function(e){return r.trackCurrentTime(e)},r.stopTrackingCurrentTime_=function(e){return r.stopTrackingCurrentTime(e)},r.disposeSourceHandler_=function(e){return r.disposeSourceHandler(e)},r.queuedHanders_=new Set,r.hasStarted_=!1,r.on("playing",(function(){this.hasStarted_=!0})),r.on("loadstart",(function(){this.hasStarted_=!1})),_i.names.forEach((function(e){var n=_i[e];t&&t[n.getterName]&&(r[n.privateName]=t[n.getterName])})),r.featuresProgressEvents||r.manualProgressOn(),r.featuresTimeupdateEvents||r.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach((function(e){!1===t["native"+e+"Tracks"]&&(r["featuresNative"+e+"Tracks"]=!1)})),!1===t.nativeCaptions||!1===t.nativeTextTracks?r.featuresNativeTextTracks=!1:!0!==t.nativeCaptions&&!0!==t.nativeTextTracks||(r.featuresNativeTextTracks=!0),r.featuresNativeTextTracks||r.emulateTextTracks(),r.preloadTextTracks=!1!==t.preloadTextTracks,r.autoRemoteTextTracks_=new _i.text.ListClass,r.initTrackListeners(),t.nativeControlsForTouch||r.emitTapEvents(),r.constructor&&(r.name_=r.constructor.name||"Unknown Tech"),r}p(t,e);var n=t.prototype;return n.triggerSourceset=function(e){var t=this;this.isReady_||this.one("ready",(function(){return t.setTimeout((function(){return t.triggerSourceset(e)}),1)})),this.trigger({src:e,type:"sourceset"})},n.manualProgressOn=function(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)},n.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)},n.trackProgress=function(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(fr(this,(function(){var e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()})),500)},n.onDurationChange=function(e){this.duration_=this.duration()},n.buffered=function(){return Fr(0,0)},n.bufferedPercent=function(){return Ur(this.buffered(),this.duration_)},n.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},n.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)},n.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)},n.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval((function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}),250)},n.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},n.dispose=function(){this.clearTracks(yi.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),e.prototype.dispose.call(this)},n.clearTracks=function(e){var t=this;(e=[].concat(e)).forEach((function(e){for(var n=t[e+"Tracks"]()||[],r=n.length;r--;){var i=n[r];"text"===e&&t.removeRemoteTextTrack(i),n.removeTrack(i)}}))},n.cleanupAutoTextTracks=function(){for(var e=this.autoRemoteTextTracks_||[],t=e.length;t--;){var n=e[t];this.removeRemoteTextTrack(n)}},n.reset=function(){},n.crossOrigin=function(){},n.setCrossOrigin=function(){},n.error=function(e){return void 0!==e&&(this.error_=new Br(e),this.trigger("error")),this.error_},n.played=function(){return this.hasStarted_?Fr(0,0):Fr()},n.play=function(){},n.setScrubbing=function(){},n.scrubbing=function(){},n.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},n.initTrackListeners=function(){var e=this;yi.names.forEach((function(t){var n=yi[t],r=function(){e.trigger(t+"trackchange")},i=e[n.getterName]();i.addEventListener("removetrack",r),i.addEventListener("addtrack",r),e.on("dispose",(function(){i.removeEventListener("removetrack",r),i.removeEventListener("addtrack",r)}))}))},n.addWebVttScript_=function(){var e=this;if(!i().WebVTT)if(l().body.contains(this.el())){if(!this.options_["vtt.js"]&&kt(T())&&Object.keys(T()).length>0)return void this.trigger("vttjsloaded");var t=l().createElement("script");t.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",t.onload=function(){e.trigger("vttjsloaded")},t.onerror=function(){e.trigger("vttjserror")},this.on("dispose",(function(){t.onload=null,t.onerror=null})),i().WebVTT=!0,this.el().parentNode.appendChild(t)}else this.ready(this.addWebVttScript_)},n.emulateTextTracks=function(){var e=this,t=this.textTracks(),n=this.remoteTextTracks(),r=function(e){return t.addTrack(e.track)},i=function(e){return t.removeTrack(e.track)};n.on("addtrack",r),n.on("removetrack",i),this.addWebVttScript_();var a=function(){return e.trigger("texttrackchange")},s=function(){a();for(var e=0;e<t.length;e++){var n=t[e];n.removeEventListener("cuechange",a),"showing"===n.mode&&n.addEventListener("cuechange",a)}};s(),t.addEventListener("change",s),t.addEventListener("addtrack",s),t.addEventListener("removetrack",s),this.on("dispose",(function(){n.off("addtrack",r),n.off("removetrack",i),t.removeEventListener("change",s),t.removeEventListener("addtrack",s),t.removeEventListener("removetrack",s);for(var e=0;e<t.length;e++)t[e].removeEventListener("cuechange",a)}))},n.addTextTrack=function(e,t,n){if(!e)throw new Error("TextTrack kind is required but was not provided");return function(e,t,n,r,i){void 0===i&&(i={});var a=e.textTracks();i.kind=t,n&&(i.label=n),r&&(i.language=r),i.tech=e;var s=new _i.text.TrackClass(i);return a.addTrack(s),s}(this,e,t,n)},n.createRemoteTextTrack=function(e){var t=Dr(e,{tech:this});return new vi.remoteTextEl.TrackClass(t)},n.addRemoteTextTrack=function(e,t){var n=this;void 0===e&&(e={});var r=this.createRemoteTextTrack(e);return!0!==t&&!1!==t&&(Dt.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),t=!0),this.remoteTextTrackEls().addTrackElement_(r),this.remoteTextTracks().addTrack(r.track),!0!==t&&this.ready((function(){return n.autoRemoteTextTracks_.addTrack(r.track)})),r},n.removeRemoteTextTrack=function(e){var t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)},n.getVideoPlaybackQuality=function(){return{}},n.requestPictureInPicture=function(){var e=this.options_.Promise||i().Promise;if(e)return e.reject()},n.disablePictureInPicture=function(){return!0},n.setDisablePictureInPicture=function(){},n.requestVideoFrameCallback=function(e){var t=this,n=Xn();return!this.isReady_||this.paused()?(this.queuedHanders_.add(n),this.one("playing",(function(){t.queuedHanders_.has(n)&&(t.queuedHanders_.delete(n),e())}))):this.requestNamedAnimationFrame(n,e),n},n.cancelVideoFrameCallback=function(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)},n.setPoster=function(){},n.playsinline=function(){},n.setPlaysinline=function(){},n.overrideNativeAudioTracks=function(){},n.overrideNativeVideoTracks=function(){},n.canPlayType=function(){return""},t.canPlayType=function(){return""},t.canPlaySource=function(e,n){return t.canPlayType(e.type)},t.isTech=function(e){return e.prototype instanceof t||e instanceof t||e===t},t.registerTech=function(e,n){if(t.techs_||(t.techs_={}),!t.isTech(n))throw new Error("Tech "+e+" must be a Tech");if(!t.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!t.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=Rr(e),t.techs_[e]=n,t.techs_[Cr(e)]=n,"Tech"!==e&&t.defaultTechOrder_.push(e),n},t.getTech=function(e){if(e)return t.techs_&&t.techs_[e]?t.techs_[e]:(e=Rr(e),i()&&i().videojs&&i().videojs[e]?(Dt.warn("The "+e+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),i().videojs[e]):void 0)},t}(xr);_i.names.forEach((function(e){var t=_i[e];Ti.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}})),Ti.prototype.featuresVolumeControl=!0,Ti.prototype.featuresMuteControl=!0,Ti.prototype.featuresFullscreenResize=!1,Ti.prototype.featuresPlaybackRate=!1,Ti.prototype.featuresProgressEvents=!1,Ti.prototype.featuresSourceset=!1,Ti.prototype.featuresTimeupdateEvents=!1,Ti.prototype.featuresNativeTextTracks=!1,Ti.prototype.featuresVideoFrameCallback=!1,Ti.withSourceHandlers=function(e){e.registerSourceHandler=function(t,n){var r=e.sourceHandlers;r||(r=e.sourceHandlers=[]),void 0===n&&(n=r.length),r.splice(n,0,t)},e.canPlayType=function(t){for(var n,r=e.sourceHandlers||[],i=0;i<r.length;i++)if(n=r[i].canPlayType(t))return n;return""},e.selectSourceHandler=function(t,n){for(var r=e.sourceHandlers||[],i=0;i<r.length;i++)if(r[i].canHandleSource(t,n))return r[i];return null},e.canPlaySource=function(t,n){var r=e.selectSourceHandler(t,n);return r?r.canHandleSource(t,n):""},["seekable","seeking","duration"].forEach((function(e){var t=this[e];"function"==typeof t&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})}),e.prototype),e.prototype.setSource=function(t){var n=e.selectSourceHandler(t,this.options_);n||(e.nativeSourceHandler?n=e.nativeSourceHandler:Dt.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),n!==e.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=n.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},e.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}},xr.registerComponent("Tech",Ti),Ti.registerTech("Tech",Ti),Ti.defaultTechOrder_=[];var Ei={},bi={},Si={};function Ai(e,t,n){e.setTimeout((function(){return Ni(t,Ei[t.type],n,e)}),1)}function wi(e,t,n,r){void 0===r&&(r=null);var i="call"+Rr(n),a=e.reduce(Di(i),r),s=a===Si,o=s?null:t[n](a);return function(e,t,n,r){for(var i=e.length-1;i>=0;i--){var a=e[i];a[t]&&a[t](r,n)}}(e,n,o,s),o}var Ii={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},Ci={setCurrentTime:1,setMuted:1,setVolume:1},Ri={play:1,pause:1};function Di(e){return function(t,n){return t===Si?Si:n[e]?n[e](t):t}}function Ni(e,t,n,r,i,a){void 0===e&&(e={}),void 0===t&&(t=[]),void 0===i&&(i=[]),void 0===a&&(a=!1);var s=t,o=s[0],l=s.slice(1);if("string"==typeof o)Ni(e,Ei[o],n,r,i,a);else if(o){var u=function(e,t){var n=bi[e.id()],r=null;if(null==n)return r=t(e),bi[e.id()]=[[t,r]],r;for(var i=0;i<n.length;i++){var a=n[i],s=a[0],o=a[1];s===t&&(r=o)}return null===r&&(r=t(e),n.push([t,r])),r}(r,o);if(!u.setSource)return i.push(u),Ni(e,l,n,r,i,a);u.setSource(xt({},e),(function(t,s){if(t)return Ni(e,l,n,r,i,a);i.push(u),Ni(s,e.type===s.type?l:Ei[s.type],n,r,i,a)}))}else l.length?Ni(e,l,n,r,i,a):a?n(e,i):Ni(e,Ei["*"],n,r,i,!0)}var Oi={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},Pi=function(e){void 0===e&&(e="");var t=li(e);return Oi[t.toLowerCase()]||""},Mi=function e(t){if(Array.isArray(t)){var n=[];t.forEach((function(t){t=e(t),Array.isArray(t)?n=n.concat(t):Lt(t)&&n.push(t)})),t=n}else t="string"==typeof t&&t.trim()?[xi({src:t})]:Lt(t)&&"string"==typeof t.src&&t.src&&t.src.trim()?[xi(t)]:[];return t};function xi(e){if(!e.type){var t=Pi(e.src);t&&(e.type=t)}return e}var Li=function(e){function t(t,n,r){var i,a=Dr({createEl:!1},n);if(i=e.call(this,t,a,r)||this,n.playerOptions.sources&&0!==n.playerOptions.sources.length)t.src(n.playerOptions.sources);else for(var s=0,o=n.playerOptions.techOrder;s<o.length;s++){var l=Rr(o[s]),u=Ti.getTech(l);if(l||(u=xr.getComponent(l)),u&&u.isSupported()){t.loadTech_(l);break}}return i}return p(t,e),t}(xr);xr.registerComponent("MediaLoader",Li);var ki=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).options_.controlText&&r.controlText(r.options_.controlText),r.handleMouseOver_=function(e){return r.handleMouseOver(e)},r.handleMouseOut_=function(e){return r.handleMouseOut(e)},r.handleClick_=function(e){return r.handleClick(e)},r.handleKeyDown_=function(e){return r.handleKeyDown(e)},r.emitTapEvents(),r.enable(),r}p(t,e);var n=t.prototype;return n.createEl=function(e,t,n){void 0===e&&(e="div"),void 0===t&&(t={}),void 0===n&&(n={}),t=xt({className:this.buildCSSClass(),tabIndex:0},t),"button"===e&&Dt.error("Creating a ClickableComponent with an HTML element of "+e+" is not supported; use a Button instead."),n=xt({role:"button"},n),this.tabIndex_=t.tabIndex;var r=gn(e,t,n);return r.appendChild(gn("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r},n.dispose=function(){this.controlTextEl_=null,e.prototype.dispose.call(this)},n.createControlTextEl=function(e){return this.controlTextEl_=gn("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_},n.controlText=function(e,t){if(void 0===t&&(t=this.el()),void 0===e)return this.controlText_||"Need Text";var n=this.localize(e);this.controlText_=e,mn(this.controlTextEl_,n),this.nonIconControl||this.player_.options_.noUITitleAttributes||t.setAttribute("title",n)},n.buildCSSClass=function(){return"vjs-control vjs-button "+e.prototype.buildCSSClass.call(this)},n.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))},n.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)},n.handleLanguagechange=function(){this.controlText(this.controlText_)},n.handleClick=function(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)},n.handleKeyDown=function(t){d().isEventKey(t,"Space")||d().isEventKey(t,"Enter")?(t.preventDefault(),t.stopPropagation(),this.trigger("click")):e.prototype.handleKeyDown.call(this,t)},t}(xr);xr.registerComponent("ClickableComponent",ki);var Fi=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).update(),r.update_=function(e){return r.update(e)},t.on("posterchange",r.update_),r}p(t,e);var n=t.prototype;return n.dispose=function(){this.player().off("posterchange",this.update_),e.prototype.dispose.call(this)},n.createEl=function(){return gn("div",{className:"vjs-poster",tabIndex:-1})},n.update=function(e){var t=this.player().poster();this.setSrc(t),t?this.show():this.hide()},n.setSrc=function(e){var t="";e&&(t='url("'+e+'")'),this.el_.style.backgroundImage=t},n.handleClick=function(e){if(this.player_.controls()){var t=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;!this.player_.tech(!0)||(Jt||Xt)&&t||this.player_.tech(!0).focus(),this.player_.paused()?Hr(this.player_.play()):this.player_.pause()}},t}(ki);xr.registerComponent("PosterImage",Fi);var Ui="#222",Bi={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function ji(e,t){var n;if(4===e.length)n=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");n=e.slice(1)}return"rgba("+parseInt(n.slice(0,2),16)+","+parseInt(n.slice(2,4),16)+","+parseInt(n.slice(4,6),16)+","+t+")"}function qi(e,t,n){try{e.style[t]=n}catch(e){return}}var Hi=function(e){function t(t,n,r){var a;a=e.call(this,t,n,r)||this;var s=function(e){return a.updateDisplay(e)};return t.on("loadstart",(function(e){return a.toggleDisplay(e)})),t.on("texttrackchange",s),t.on("loadedmetadata",(function(e){return a.preselectTrack(e)})),t.ready(fr(f(a),(function(){if(t.tech_&&t.tech_.featuresNativeTextTracks)this.hide();else{t.on("fullscreenchange",s),t.on("playerresize",s),i().addEventListener("orientationchange",s),t.on("dispose",(function(){return i().removeEventListener("orientationchange",s)}));for(var e=this.options_.playerOptions.tracks||[],n=0;n<e.length;n++)this.player_.addRemoteTextTrack(e[n],!0);this.preselectTrack()}}))),a}p(t,e);var n=t.prototype;return n.preselectTrack=function(){for(var e,t,n,r={captions:1,subtitles:1},i=this.player_.textTracks(),a=this.player_.cache_.selectedLanguage,s=0;s<i.length;s++){var o=i[s];a&&a.enabled&&a.language&&a.language===o.language&&o.kind in r?o.kind===a.kind?n=o:n||(n=o):a&&!a.enabled?(n=null,e=null,t=null):o.default&&("descriptions"!==o.kind||e?o.kind in r&&!t&&(t=o):e=o)}n?n.mode="showing":t?t.mode="showing":e&&(e.mode="showing")},n.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})},n.clearDisplay=function(){"function"==typeof i().WebVTT&&i().WebVTT.processCues(i(),[],this.el_)},n.updateDisplay=function(){var e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){for(var n=[],r=0;r<e.length;++r){var i=e[r];"showing"===i.mode&&n.push(i)}this.updateForTrack(n)}else{for(var a=null,s=null,o=e.length;o--;){var l=e[o];"showing"===l.mode&&("descriptions"===l.kind?a=l:s=l)}s?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(s)):a&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(a))}},n.updateDisplayState=function(e){for(var t=this.player_.textTrackSettings.getValues(),n=e.activeCues,r=n.length;r--;){var a=n[r];if(a){var s=a.displayState;if(t.color&&(s.firstChild.style.color=t.color),t.textOpacity&&qi(s.firstChild,"color",ji(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(s.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&qi(s.firstChild,"backgroundColor",ji(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?qi(s,"backgroundColor",ji(t.windowColor,t.windowOpacity)):s.style.backgroundColor=t.windowColor),t.edgeStyle&&("dropshadow"===t.edgeStyle?s.firstChild.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px "+Ui:"raised"===t.edgeStyle?s.firstChild.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px "+Ui:"depressed"===t.edgeStyle?s.firstChild.style.textShadow="1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px "+Ui:"uniform"===t.edgeStyle&&(s.firstChild.style.textShadow="0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px "+Ui)),t.fontPercent&&1!==t.fontPercent){var o=i().parseFloat(s.style.fontSize);s.style.fontSize=o*t.fontPercent+"px",s.style.height="auto",s.style.top="auto"}t.fontFamily&&"default"!==t.fontFamily&&("small-caps"===t.fontFamily?s.firstChild.style.fontVariant="small-caps":s.firstChild.style.fontFamily=Bi[t.fontFamily])}}},n.updateForTrack=function(e){if(Array.isArray(e)||(e=[e]),"function"==typeof i().WebVTT&&!e.every((function(e){return!e.activeCues}))){for(var t=[],n=0;n<e.length;++n)for(var r=e[n],a=0;a<r.activeCues.length;++a)t.push(r.activeCues[a]);i().WebVTT.processCues(i(),t,this.el_);for(var s=0;s<e.length;++s){for(var o=e[s],l=0;l<o.activeCues.length;++l){var u=o.activeCues[l].displayState;_n(u,"vjs-text-track-cue"),_n(u,"vjs-text-track-cue-"+(o.language?o.language:s)),o.language&&wn(u,"lang",o.language)}this.player_.textTrackSettings&&this.updateDisplayState(o)}}},t}(xr);xr.registerComponent("TextTrackDisplay",Hi);var Gi=function(e){function t(){return e.apply(this,arguments)||this}return p(t,e),t.prototype.createEl=function(){var t=this.player_.isAudio(),n=this.localize(t?"Audio Player":"Video Player"),r=gn("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[n])}),i=e.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return i.appendChild(r),i},t}(xr);xr.registerComponent("LoadingSpinner",Gi);var Vi=function(e){function t(){return e.apply(this,arguments)||this}p(t,e);var n=t.prototype;return n.createEl=function(e,t,n){void 0===t&&(t={}),void 0===n&&(n={});var r=gn("button",t=xt({className:this.buildCSSClass()},t),n=xt({type:"button"},n));return r.appendChild(gn("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r},n.addChild=function(e,t){void 0===t&&(t={});var n=this.constructor.name;return Dt.warn("Adding an actionable (user controllable) child to a Button ("+n+") is not supported; use a ClickableComponent instead."),xr.prototype.addChild.call(this,e,t)},n.enable=function(){e.prototype.enable.call(this),this.el_.removeAttribute("disabled")},n.disable=function(){e.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},n.handleKeyDown=function(t){d().isEventKey(t,"Space")||d().isEventKey(t,"Enter")?t.stopPropagation():e.prototype.handleKeyDown.call(this,t)},t}(ki);xr.registerComponent("Button",Vi);var Yi=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).mouseused_=!1,r.on("mousedown",(function(e){return r.handleMouseDown(e)})),r}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-big-play-button"},n.handleClick=function(e){var t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY){var n=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;return Hr(t),void(!this.player_.tech(!0)||(Jt||Xt)&&n||this.player_.tech(!0).focus())}var r=this.player_.getChild("controlBar"),i=r&&r.getChild("playToggle");if(i){var a=function(){return i.focus()};qr(t)?t.then(a,(function(){})):this.setTimeout(a,1)}else this.player_.tech(!0).focus()},n.handleKeyDown=function(t){this.mouseused_=!1,e.prototype.handleKeyDown.call(this,t)},n.handleMouseDown=function(e){this.mouseused_=!0},t}(Vi);Yi.prototype.controlText_="Play Video",xr.registerComponent("BigPlayButton",Yi);var Zi=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).controlText(n&&n.controlText||r.localize("Close")),r}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-close-button "+e.prototype.buildCSSClass.call(this)},n.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},n.handleKeyDown=function(t){d().isEventKey(t,"Esc")?(t.preventDefault(),t.stopPropagation(),this.trigger("click")):e.prototype.handleKeyDown.call(this,t)},t}(Vi);xr.registerComponent("CloseButton",Zi);var Ki=function(e){function t(t,n){var r;return void 0===n&&(n={}),r=e.call(this,t,n)||this,n.replay=void 0===n.replay||n.replay,r.on(t,"play",(function(e){return r.handlePlay(e)})),r.on(t,"pause",(function(e){return r.handlePause(e)})),n.replay&&r.on(t,"ended",(function(e){return r.handleEnded(e)})),r}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-play-control "+e.prototype.buildCSSClass.call(this)},n.handleClick=function(e){this.player_.paused()?Hr(this.player_.play()):this.player_.pause()},n.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},n.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},n.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},n.handleEnded=function(e){var t=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",(function(e){return t.handleSeeked(e)}))},t}(Vi);Ki.prototype.controlText_="Play",xr.registerComponent("PlayToggle",Ki);var zi=function(e,t){e=e<0?0:e;var n=Math.floor(e%60),r=Math.floor(e/60%60),i=Math.floor(e/3600),a=Math.floor(t/60%60),s=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(i=r=n="-"),(i=i>0||s>0?i+":":"")+(r=((i||a>=10)&&r<10?"0"+r:r)+":")+(n<10?"0"+n:n)},Wi=zi;function Xi(e,t){return void 0===t&&(t=e),Wi(e,t)}var $i=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).on(t,["timeupdate","ended"],(function(e){return r.updateContent(e)})),r.updateTextNode_(),r}p(t,e);var n=t.prototype;return n.createEl=function(){var t=this.buildCSSClass(),n=e.prototype.createEl.call(this,"div",{className:t+" vjs-time-control vjs-control"}),r=gn("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+" "},{role:"presentation"});return n.appendChild(r),this.contentEl_=gn("span",{className:t+"-display"},{"aria-live":"off",role:"presentation"}),n.appendChild(this.contentEl_),n},n.dispose=function(){this.contentEl_=null,this.textNode_=null,e.prototype.dispose.call(this)},n.updateTextNode_=function(e){var t=this;void 0===e&&(e=0),e=Xi(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",(function(){if(t.contentEl_){var e=t.textNode_;e&&t.contentEl_.firstChild!==e&&(e=null,Dt.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),t.textNode_=l().createTextNode(t.formattedTime_),t.textNode_&&(e?t.contentEl_.replaceChild(t.textNode_,e):t.contentEl_.appendChild(t.textNode_))}})))},n.updateContent=function(e){},t}(xr);$i.prototype.labelText_="Time",$i.prototype.controlText_="Time",xr.registerComponent("TimeDisplay",$i);var Qi=function(e){function t(){return e.apply(this,arguments)||this}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-current-time"},n.updateContent=function(e){var t;t=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)},t}($i);Qi.prototype.labelText_="Current Time",Qi.prototype.controlText_="Current Time",xr.registerComponent("CurrentTimeDisplay",Qi);var Ji=function(e){function t(t,n){var r,i=function(e){return r.updateContent(e)};return(r=e.call(this,t,n)||this).on(t,"durationchange",i),r.on(t,"loadstart",i),r.on(t,"loadedmetadata",i),r}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-duration"},n.updateContent=function(e){var t=this.player_.duration();this.updateTextNode_(t)},t}($i);Ji.prototype.labelText_="Duration",Ji.prototype.controlText_="Duration",xr.registerComponent("DurationDisplay",Ji);var ea=function(e){function t(){return e.apply(this,arguments)||this}return p(t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),n=e.prototype.createEl.call(this,"div"),r=e.prototype.createEl.call(this,"span",{textContent:"/"});return n.appendChild(r),t.appendChild(n),t},t}(xr);xr.registerComponent("TimeDivider",ea);var ta=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).on(t,"durationchange",(function(e){return r.updateContent(e)})),r}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-remaining-time"},n.createEl=function(){var t=e.prototype.createEl.call(this);return!1!==this.options_.displayNegative&&t.insertBefore(gn("span",{},{"aria-hidden":!0},"-"),this.contentEl_),t},n.updateContent=function(e){var t;"number"==typeof this.player_.duration()&&(t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t))},t}($i);ta.prototype.labelText_="Remaining Time",ta.prototype.controlText_="Remaining Time",xr.registerComponent("RemainingTimeDisplay",ta);var na=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).updateShowing(),r.on(r.player(),"durationchange",(function(e){return r.updateShowing(e)})),r}p(t,e);var n=t.prototype;return n.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=gn("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(gn("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+" "})),this.contentEl_.appendChild(l().createTextNode(this.localize("LIVE"))),t.appendChild(this.contentEl_),t},n.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},n.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},t}(xr);xr.registerComponent("LiveDisplay",na);var ra=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).updateLiveEdgeStatus(),r.player_.liveTracker&&(r.updateLiveEdgeStatusHandler_=function(e){return r.updateLiveEdgeStatus(e)},r.on(r.player_.liveTracker,"liveedgechange",r.updateLiveEdgeStatusHandler_)),r}p(t,e);var n=t.prototype;return n.createEl=function(){var t=e.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=gn("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),t.appendChild(this.textEl_),t},n.updateLiveEdgeStatus=function(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))},n.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},n.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,e.prototype.dispose.call(this)},t}(Vi);ra.prototype.controlText_="Seek to live, currently playing live",xr.registerComponent("SeekToLive",ra);var ia=function(e,t,n){return e=Number(e),Math.min(n,Math.max(t,isNaN(e)?t:e))},aa=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).handleMouseDown_=function(e){return r.handleMouseDown(e)},r.handleMouseUp_=function(e){return r.handleMouseUp(e)},r.handleKeyDown_=function(e){return r.handleKeyDown(e)},r.handleClick_=function(e){return r.handleClick(e)},r.handleMouseMove_=function(e){return r.handleMouseMove(e)},r.update_=function(e){return r.update(e)},r.bar=r.getChild(r.options_.barName),r.vertical(!!r.options_.vertical),r.enable(),r}p(t,e);var n=t.prototype;return n.enabled=function(){return this.enabled_},n.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},n.disable=function(){if(this.enabled()){var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},n.createEl=function(t,n,r){return void 0===n&&(n={}),void 0===r&&(r={}),n.className=n.className+" vjs-slider",n=xt({tabIndex:0},n),r=xt({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},r),e.prototype.createEl.call(this,t,n,r)},n.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||$t||e.preventDefault(),Cn(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)},n.handleMouseMove=function(e){},n.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;Rn(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.update()},n.update=function(){var e=this;if(this.el_&&this.bar){var t=this.getProgress();return t===this.progress_||(this.progress_=t,this.requestNamedAnimationFrame("Slider#update",(function(){var n=e.vertical()?"height":"width";e.bar.el().style[n]=(100*t).toFixed(2)+"%"}))),t}},n.getProgress=function(){return Number(ia(this.getPercent(),0,1).toFixed(4))},n.calculateDistance=function(e){var t=On(this.el_,e);return this.vertical()?t.y:t.x},n.handleKeyDown=function(t){d().isEventKey(t,"Left")||d().isEventKey(t,"Down")?(t.preventDefault(),t.stopPropagation(),this.stepBack()):d().isEventKey(t,"Right")||d().isEventKey(t,"Up")?(t.preventDefault(),t.stopPropagation(),this.stepForward()):e.prototype.handleKeyDown.call(this,t)},n.handleClick=function(e){e.stopPropagation(),e.preventDefault()},n.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},t}(xr);xr.registerComponent("Slider",aa);var sa=function(e,t){return ia(e/t*100,0,100).toFixed(2)+"%"},oa=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).partEls_=[],r.on(t,"progress",(function(e){return r.update(e)})),r}p(t,e);var n=t.prototype;return n.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),n=gn("span",{className:"vjs-control-text"}),r=gn("span",{textContent:this.localize("Loaded")}),i=l().createTextNode(": ");return this.percentageEl_=gn("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),t.appendChild(n),n.appendChild(r),n.appendChild(i),n.appendChild(this.percentageEl_),t},n.dispose=function(){this.partEls_=null,this.percentageEl_=null,e.prototype.dispose.call(this)},n.update=function(e){var t=this;this.requestNamedAnimationFrame("LoadProgressBar#update",(function(){var e=t.player_.liveTracker,n=t.player_.buffered(),r=e&&e.isLive()?e.seekableEnd():t.player_.duration(),i=t.player_.bufferedEnd(),a=t.partEls_,s=sa(i,r);t.percent_!==s&&(t.el_.style.width=s,mn(t.percentageEl_,s),t.percent_=s);for(var o=0;o<n.length;o++){var l=n.start(o),u=n.end(o),c=a[o];c||(c=t.el_.appendChild(gn()),a[o]=c),c.dataset.start===l&&c.dataset.end===u||(c.dataset.start=l,c.dataset.end=u,c.style.left=sa(l,i),c.style.width=sa(u-l,i))}for(var d=a.length;d>n.length;d--)t.el_.removeChild(a[d-1]);a.length=n.length}))},t}(xr);xr.registerComponent("LoadProgressBar",oa);var la=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).update=hr(fr(f(r),r.update),dr),r}p(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},n.update=function(e,t,n){var r=Nn(this.el_),i=Dn(this.player_.el()),a=e.width*t;if(i&&r){var s=e.left-i.left+a,o=e.width-a+(i.right-e.right),l=r.width/2;s<l?l+=l-s:o<l&&(l=o),l<0?l=0:l>r.width&&(l=r.width),l=Math.round(l),this.el_.style.right="-"+l+"px",this.write(n)}},n.write=function(e){mn(this.el_,e)},n.updateTime=function(e,t,n,r){var i=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",(function(){var a,s=i.player_.duration();if(i.player_.liveTracker&&i.player_.liveTracker.isLive()){var o=i.player_.liveTracker.liveWindow(),l=o-t*o;a=(l<1?"":"-")+Xi(l,o)}else a=Xi(n,s);i.update(e,t,a),r&&r()}))},t}(xr);xr.registerComponent("TimeTooltip",la);var ua=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).update=hr(fr(f(r),r.update),dr),r}p(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},n.update=function(e,t){var n=this.getChild("timeTooltip");if(n){var r=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();n.updateTime(e,t,r)}},t}(xr);ua.prototype.options_={children:[]},sn||Zt||ua.prototype.options_.children.push("timeTooltip"),xr.registerComponent("PlayProgressBar",ua);var ca=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).update=hr(fr(f(r),r.update),dr),r}p(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},n.update=function(e,t){var n=this,r=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,r,(function(){n.el_.style.left=e.width*t+"px"}))},t}(xr);ca.prototype.options_={children:["timeTooltip"]},xr.registerComponent("MouseTimeDisplay",ca);var da=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).setEventHandlers_(),r}p(t,e);var n=t.prototype;return n.setEventHandlers_=function(){var e=this;this.update_=fr(this,this.update),this.update=hr(this.update_,dr),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=function(t){return e.enableInterval_(t)},this.disableIntervalHandler_=function(t){return e.disableInterval_(t)},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in l()&&"visibilityState"in l()&&this.on(l(),"visibilitychange",this.toggleVisibility_)},n.toggleVisibility_=function(e){"hidden"===l().visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())},n.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,dr))},n.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)},n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},n.update=function(t){var n=this;if("hidden"!==l().visibilityState){var r=e.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",(function(){var e=n.player_.ended()?n.player_.duration():n.getCurrentTime_(),t=n.player_.liveTracker,i=n.player_.duration();t&&t.isLive()&&(i=n.player_.liveTracker.liveCurrentTime()),n.percent_!==r&&(n.el_.setAttribute("aria-valuenow",(100*r).toFixed(2)),n.percent_=r),n.currentTime_===e&&n.duration_===i||(n.el_.setAttribute("aria-valuetext",n.localize("progress bar timing: currentTime={1} duration={2}",[Xi(e,i),Xi(i,i)],"{1} of {2}")),n.currentTime_=e,n.duration_=i),n.bar&&n.bar.update(Dn(n.el()),n.getProgress())})),r}},n.userSeek_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)},n.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},n.getPercent=function(){var e,t=this.getCurrentTime_(),n=this.player_.liveTracker;return n&&n.isLive()?(e=(t-n.seekableStart())/n.liveWindow(),n.atLiveEdge()&&(e=1)):e=t/this.player_.duration(),e},n.handleMouseDown=function(t){Fn(t)&&(t.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),e.prototype.handleMouseDown.call(this,t))},n.handleMouseMove=function(e,t){if(void 0===t&&(t=!1),Fn(e)){var n;t||this.player_.scrubbing()||this.player_.scrubbing(!0);var r=this.calculateDistance(e),i=this.player_.liveTracker;if(i&&i.isLive()){if(r>=.99)return void i.seekToLiveEdge();var a=i.seekableStart(),s=i.liveCurrentTime();if((n=a+r*i.liveWindow())>=s&&(n=s),n<=a&&(n=a+.1),n===1/0)return}else(n=r*this.player_.duration())===this.player_.duration()&&(n-=.1);this.userSeek_(n)}},n.enable=function(){e.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.show()},n.disable=function(){e.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.hide()},n.handleMouseUp=function(t){e.prototype.handleMouseUp.call(this,t),t&&t.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?Hr(this.player_.play()):this.update_()},n.stepForward=function(){this.userSeek_(this.player_.currentTime()+5)},n.stepBack=function(){this.userSeek_(this.player_.currentTime()-5)},n.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},n.handleKeyDown=function(t){var n=this.player_.liveTracker;if(d().isEventKey(t,"Space")||d().isEventKey(t,"Enter"))t.preventDefault(),t.stopPropagation(),this.handleAction(t);else if(d().isEventKey(t,"Home"))t.preventDefault(),t.stopPropagation(),this.userSeek_(0);else if(d().isEventKey(t,"End"))t.preventDefault(),t.stopPropagation(),n&&n.isLive()?this.userSeek_(n.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(d()(t))){t.preventDefault(),t.stopPropagation();var r=10*(d().codes[d()(t)]-d().codes[0])/100;n&&n.isLive()?this.userSeek_(n.seekableStart()+n.liveWindow()*r):this.userSeek_(this.player_.duration()*r)}else d().isEventKey(t,"PgDn")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):d().isEventKey(t,"PgUp")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):e.prototype.handleKeyDown.call(this,t)},n.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in l()&&"visibilityState"in l()&&this.off(l(),"visibilitychange",this.toggleVisibility_),e.prototype.dispose.call(this)},t}(aa);da.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},sn||Zt||da.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),xr.registerComponent("SeekBar",da);var fa=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).handleMouseMove=hr(fr(f(r),r.handleMouseMove),dr),r.throttledHandleMouseSeek=hr(fr(f(r),r.handleMouseSeek),dr),r.handleMouseUpHandler_=function(e){return r.handleMouseUp(e)},r.handleMouseDownHandler_=function(e){return r.handleMouseDown(e)},r.enable(),r}p(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},n.handleMouseMove=function(e){var t=this.getChild("seekBar");if(t){var n=t.getChild("playProgressBar"),r=t.getChild("mouseTimeDisplay");if(n||r){var i=t.el(),a=Nn(i),s=On(i,e).x;s=ia(s,0,1),r&&r.update(a,s),n&&n.update(a,t.getProgress())}}},n.handleMouseSeek=function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)},n.enabled=function(){return this.enabled_},n.disable=function(){if(this.children().forEach((function(e){return e.disable&&e.disable()})),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){var e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&Hr(this.player_.play())}},n.enable=function(){this.children().forEach((function(e){return e.enable&&e.enable()})),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},n.removeListenersAddedOnMousedownAndTouchstart=function(){var e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)},n.handleMouseDown=function(e){var t=this.el_.ownerDocument,n=this.getChild("seekBar");n&&n.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)},n.handleMouseUp=function(e){var t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()},t}(xr);fa.prototype.options_={children:["seekBar"]},xr.registerComponent("ProgressControl",fa);var ha=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).on(t,["enterpictureinpicture","leavepictureinpicture"],(function(e){return r.handlePictureInPictureChange(e)})),r.on(t,["disablepictureinpicturechanged","loadedmetadata"],(function(e){return r.handlePictureInPictureEnabledChange(e)})),r.on(t,["loadedmetadata","audioonlymodechange","audiopostermodechange"],(function(){"audio"===t.currentType().substring(0,5)||t.audioPosterMode()||t.audioOnlyMode()?(t.isInPictureInPicture()&&t.exitPictureInPicture(),r.hide()):r.show()})),r.disable(),r}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-picture-in-picture-control "+e.prototype.buildCSSClass.call(this)},n.handlePictureInPictureEnabledChange=function(){l().pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()?this.enable():this.disable()},n.handlePictureInPictureChange=function(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},n.handleClick=function(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},t}(Vi);ha.prototype.controlText_="Picture-in-Picture",xr.registerComponent("PictureInPictureToggle",ha);var pa=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).on(t,"fullscreenchange",(function(e){return r.handleFullscreenChange(e)})),!1===l()[t.fsApi_.fullscreenEnabled]&&r.disable(),r}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)},n.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},n.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},t}(Vi);pa.prototype.controlText_="Fullscreen",xr.registerComponent("FullscreenToggle",pa);var ga=function(e){function t(){return e.apply(this,arguments)||this}return p(t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-volume-level"});return t.appendChild(e.prototype.createEl.call(this,"span",{className:"vjs-control-text"})),t},t}(xr);xr.registerComponent("VolumeLevel",ga);var ma=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).update=hr(fr(f(r),r.update),dr),r}p(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},n.update=function(e,t,n,r){if(!n){var i=Dn(this.el_),a=Dn(this.player_.el()),s=e.width*t;if(!a||!i)return;var o=e.left-a.left+s,l=e.width-s+(a.right-e.right),u=i.width/2;o<u?u+=u-o:l<u&&(u=l),u<0?u=0:u>i.width&&(u=i.width),this.el_.style.right="-"+u+"px"}this.write(r+"%")},n.write=function(e){mn(this.el_,e)},n.updateVolume=function(e,t,n,r,i){var a=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",(function(){a.update(e,t,n,r.toFixed(0)),i&&i()}))},t}(xr);xr.registerComponent("VolumeLevelTooltip",ma);var ya=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).update=hr(fr(f(r),r.update),dr),r}p(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},n.update=function(e,t,n){var r=this,i=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,n,i,(function(){n?r.el_.style.bottom=e.height*t+"px":r.el_.style.left=e.width*t+"px"}))},t}(xr);ya.prototype.options_={children:["volumeLevelTooltip"]},xr.registerComponent("MouseVolumeLevelDisplay",ya);var va=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).on("slideractive",(function(e){return r.updateLastVolume_(e)})),r.on(t,"volumechange",(function(e){return r.updateARIAAttributes(e)})),t.ready((function(){return r.updateARIAAttributes()})),r}p(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},n.handleMouseDown=function(t){Fn(t)&&e.prototype.handleMouseDown.call(this,t)},n.handleMouseMove=function(e){var t=this.getChild("mouseVolumeLevelDisplay");if(t){var n=this.el(),r=Dn(n),i=this.vertical(),a=On(n,e);a=i?a.y:a.x,a=ia(a,0,1),t.update(r,a,i)}Fn(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},n.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},n.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},n.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},n.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},n.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")},n.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},n.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",(function(){0===e.player_.volume()&&e.player_.lastVolume_(t)}))},t}(aa);va.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},sn||Zt||va.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),va.prototype.playerEvent="volumechange",xr.registerComponent("VolumeBar",va);var _a=function(e){function t(t,n){var r;return void 0===n&&(n={}),n.vertical=n.vertical||!1,(void 0===n.volumeBar||kt(n.volumeBar))&&(n.volumeBar=n.volumeBar||{},n.volumeBar.vertical=n.vertical),function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))}(f(r=e.call(this,t,n)||this),t),r.throttledHandleMouseMove=hr(fr(f(r),r.handleMouseMove),dr),r.handleMouseUpHandler_=function(e){return r.handleMouseUp(e)},r.on("mousedown",(function(e){return r.handleMouseDown(e)})),r.on("touchstart",(function(e){return r.handleMouseDown(e)})),r.on("mousemove",(function(e){return r.handleMouseMove(e)})),r.on(r.volumeBar,["focus","slideractive"],(function(){r.volumeBar.addClass("vjs-slider-active"),r.addClass("vjs-slider-active"),r.trigger("slideractive")})),r.on(r.volumeBar,["blur","sliderinactive"],(function(){r.volumeBar.removeClass("vjs-slider-active"),r.removeClass("vjs-slider-active"),r.trigger("sliderinactive")})),r}p(t,e);var n=t.prototype;return n.createEl=function(){var t="vjs-volume-horizontal";return this.options_.vertical&&(t="vjs-volume-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+t})},n.handleMouseDown=function(e){var t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)},n.handleMouseUp=function(e){var t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)},n.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},t}(xr);_a.prototype.options_={children:["volumeBar"]},xr.registerComponent("VolumeControl",_a);var Ta=function(e){function t(t,n){var r;return function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))}(f(r=e.call(this,t,n)||this),t),r.on(t,["loadstart","volumechange"],(function(e){return r.update(e)})),r}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this)},n.handleClick=function(e){var t=this.player_.volume(),n=this.player_.lastVolume_();if(0===t){var r=n<.1?.1:n;this.player_.volume(r),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},n.update=function(e){this.updateIcon_(),this.updateControlText_()},n.updateIcon_=function(){var e=this.player_.volume(),t=3;sn&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2);for(var n=0;n<4;n++)Tn(this.el_,"vjs-vol-"+n);_n(this.el_,"vjs-vol-"+t)},n.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)},t}(Vi);Ta.prototype.controlText_="Mute",xr.registerComponent("MuteToggle",Ta);var Ea=function(e){function t(t,n){var r;return void 0===n&&(n={}),void 0!==n.inline?n.inline=n.inline:n.inline=!0,(void 0===n.volumeControl||kt(n.volumeControl))&&(n.volumeControl=n.volumeControl||{},n.volumeControl.vertical=!n.inline),(r=e.call(this,t,n)||this).handleKeyPressHandler_=function(e){return r.handleKeyPress(e)},r.on(t,["loadstart"],(function(e){return r.volumePanelState_(e)})),r.on(r.muteToggle,"keyup",(function(e){return r.handleKeyPress(e)})),r.on(r.volumeControl,"keyup",(function(e){return r.handleVolumeControlKeyUp(e)})),r.on("keydown",(function(e){return r.handleKeyPress(e)})),r.on("mouseover",(function(e){return r.handleMouseOver(e)})),r.on("mouseout",(function(e){return r.handleMouseOut(e)})),r.on(r.volumeControl,["slideractive"],r.sliderActive_),r.on(r.volumeControl,["sliderinactive"],r.sliderInactive_),r}p(t,e);var n=t.prototype;return n.sliderActive_=function(){this.addClass("vjs-slider-active")},n.sliderInactive_=function(){this.removeClass("vjs-slider-active")},n.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},n.createEl=function(){var t="vjs-volume-panel-horizontal";return this.options_.inline||(t="vjs-volume-panel-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+t})},n.dispose=function(){this.handleMouseOut(),e.prototype.dispose.call(this)},n.handleVolumeControlKeyUp=function(e){d().isEventKey(e,"Esc")&&this.muteToggle.focus()},n.handleMouseOver=function(e){this.addClass("vjs-hover"),ir(l(),"keyup",this.handleKeyPressHandler_)},n.handleMouseOut=function(e){this.removeClass("vjs-hover"),ar(l(),"keyup",this.handleKeyPressHandler_)},n.handleKeyPress=function(e){d().isEventKey(e,"Esc")&&this.handleMouseOut()},t}(xr);Ea.prototype.options_={children:["muteToggle","volumeControl"]},xr.registerComponent("VolumePanel",Ea);var ba=function(e){function t(t,n){var r;return r=e.call(this,t,n)||this,n&&(r.menuButton_=n.menuButton),r.focusedChild_=-1,r.on("keydown",(function(e){return r.handleKeyDown(e)})),r.boundHandleBlur_=function(e){return r.handleBlur(e)},r.boundHandleTapClick_=function(e){return r.handleTapClick(e)},r}p(t,e);var n=t.prototype;return n.addEventListenerForItem=function(e){e instanceof xr&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))},n.removeEventListenerForItem=function(e){e instanceof xr&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))},n.removeChild=function(t){"string"==typeof t&&(t=this.getChild(t)),this.removeEventListenerForItem(t),e.prototype.removeChild.call(this,t)},n.addItem=function(e){var t=this.addChild(e);t&&this.addEventListenerForItem(t)},n.createEl=function(){var t=this.options_.contentElType||"ul";this.contentEl_=gn(t,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var n=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return n.appendChild(this.contentEl_),ir(n,"click",(function(e){e.preventDefault(),e.stopImmediatePropagation()})),n},n.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,e.prototype.dispose.call(this)},n.handleBlur=function(e){var t=e.relatedTarget||l().activeElement;if(!this.children().some((function(e){return e.el()===t}))){var n=this.menuButton_;n&&n.buttonPressed_&&t!==n.el().firstChild&&n.unpressButton()}},n.handleTapClick=function(e){if(this.menuButton_){this.menuButton_.unpressButton();var t=this.children();if(!Array.isArray(t))return;var n=t.filter((function(t){return t.el()===e.target}))[0];if(!n)return;"CaptionSettingsMenuItem"!==n.name()&&this.menuButton_.focus()}},n.handleKeyDown=function(e){d().isEventKey(e,"Left")||d().isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(d().isEventKey(e,"Right")||d().isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())},n.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},n.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},n.focus=function(e){void 0===e&&(e=0);var t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())},t}(xr);xr.registerComponent("Menu",ba);var Sa=function(e){function t(t,n){var r;void 0===n&&(n={}),(r=e.call(this,t,n)||this).menuButton_=new Vi(t,n),r.menuButton_.controlText(r.controlText_),r.menuButton_.el_.setAttribute("aria-haspopup","true");var i=Vi.prototype.buildCSSClass();r.menuButton_.el_.className=r.buildCSSClass()+" "+i,r.menuButton_.removeClass("vjs-control"),r.addChild(r.menuButton_),r.update(),r.enabled_=!0;var a=function(e){return r.handleClick(e)};return r.handleMenuKeyUp_=function(e){return r.handleMenuKeyUp(e)},r.on(r.menuButton_,"tap",a),r.on(r.menuButton_,"click",a),r.on(r.menuButton_,"keydown",(function(e){return r.handleKeyDown(e)})),r.on(r.menuButton_,"mouseenter",(function(){r.addClass("vjs-hover"),r.menu.show(),ir(l(),"keyup",r.handleMenuKeyUp_)})),r.on("mouseleave",(function(e){return r.handleMouseLeave(e)})),r.on("keydown",(function(e){return r.handleSubmenuKeyDown(e)})),r}p(t,e);var n=t.prototype;return n.update=function(){var e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))},n.createMenu=function(){var e=new ba(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var t=gn("li",{className:"vjs-menu-title",textContent:Rr(this.options_.title),tabIndex:-1}),n=new xr(this.player_,{el:t});e.addItem(n)}if(this.items=this.createItems(),this.items)for(var r=0;r<this.items.length;r++)e.addItem(this.items[r]);return e},n.createItems=function(){},n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},n.buildWrapperCSSClass=function(){var t="vjs-menu-button";return!0===this.options_.inline?t+="-inline":t+="-popup","vjs-menu-button "+t+" "+Vi.prototype.buildCSSClass()+" "+e.prototype.buildCSSClass.call(this)},n.buildCSSClass=function(){var t="vjs-menu-button";return!0===this.options_.inline?t+="-inline":t+="-popup","vjs-menu-button "+t+" "+e.prototype.buildCSSClass.call(this)},n.controlText=function(e,t){return void 0===t&&(t=this.menuButton_.el()),this.menuButton_.controlText(e,t)},n.dispose=function(){this.handleMouseLeave(),e.prototype.dispose.call(this)},n.handleClick=function(e){this.buttonPressed_?this.unpressButton():this.pressButton()},n.handleMouseLeave=function(e){this.removeClass("vjs-hover"),ar(l(),"keyup",this.handleMenuKeyUp_)},n.focus=function(){this.menuButton_.focus()},n.blur=function(){this.menuButton_.blur()},n.handleKeyDown=function(e){d().isEventKey(e,"Esc")||d().isEventKey(e,"Tab")?(this.buttonPressed_&&this.unpressButton(),d().isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus())):(d().isEventKey(e,"Up")||d().isEventKey(e,"Down"))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))},n.handleMenuKeyUp=function(e){(d().isEventKey(e,"Esc")||d().isEventKey(e,"Tab"))&&this.removeClass("vjs-hover")},n.handleSubmenuKeyPress=function(e){this.handleSubmenuKeyDown(e)},n.handleSubmenuKeyDown=function(e){(d().isEventKey(e,"Esc")||d().isEventKey(e,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),d().isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus()))},n.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),sn&&hn())return;this.menu.focus()}},n.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},n.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},n.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},t}(xr);xr.registerComponent("MenuButton",Sa);var Aa=function(e){function t(t,n){var r,i=n.tracks;if((r=e.call(this,t,n)||this).items.length<=1&&r.hide(),!i)return f(r);var a=fr(f(r),r.update);return i.addEventListener("removetrack",a),i.addEventListener("addtrack",a),i.addEventListener("labelchange",a),r.player_.on("ready",a),r.player_.on("dispose",(function(){i.removeEventListener("removetrack",a),i.removeEventListener("addtrack",a),i.removeEventListener("labelchange",a)})),r}return p(t,e),t}(Sa);xr.registerComponent("TrackButton",Aa);var wa=["Tab","Esc","Up","Down","Right","Left"],Ia=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).selectable=n.selectable,r.isSelected_=n.selected||!1,r.multiSelectable=n.multiSelectable,r.selected(r.isSelected_),r.selectable?r.multiSelectable?r.el_.setAttribute("role","menuitemcheckbox"):r.el_.setAttribute("role","menuitemradio"):r.el_.setAttribute("role","menuitem"),r}p(t,e);var n=t.prototype;return n.createEl=function(t,n,r){this.nonIconControl=!0;var i=e.prototype.createEl.call(this,"li",xt({className:"vjs-menu-item",tabIndex:-1},n),r);return i.replaceChild(gn("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)}),i.querySelector(".vjs-icon-placeholder")),i},n.handleKeyDown=function(t){wa.some((function(e){return d().isEventKey(t,e)}))||e.prototype.handleKeyDown.call(this,t)},n.handleClick=function(e){this.selected(!0)},n.selected=function(e){this.selectable&&(e?(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))},t}(ki);xr.registerComponent("MenuItem",Ia);var Ca=function(e){function t(t,n){var r,a=n.track,s=t.textTracks();n.label=a.label||a.language||"Unknown",n.selected="showing"===a.mode,(r=e.call(this,t,n)||this).track=a,r.kinds=(n.kinds||[n.kind||r.track.kind]).filter(Boolean);var o,u=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];r.handleTracksChange.apply(f(r),t)},c=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];r.handleSelectedLanguageChange.apply(f(r),t)};return t.on(["loadstart","texttrackchange"],u),s.addEventListener("change",u),s.addEventListener("selectedlanguagechange",c),r.on("dispose",(function(){t.off(["loadstart","texttrackchange"],u),s.removeEventListener("change",u),s.removeEventListener("selectedlanguagechange",c)})),void 0===s.onchange&&r.on(["tap","click"],(function(){if("object"!=typeof i().Event)try{o=new(i().Event)("change")}catch(e){}o||(o=l().createEvent("Event")).initEvent("change",!0,!0),s.dispatchEvent(o)})),r.handleTracksChange(),r}p(t,e);var n=t.prototype;return n.handleClick=function(t){var n=this.track,r=this.player_.textTracks();if(e.prototype.handleClick.call(this,t),r)for(var i=0;i<r.length;i++){var a=r[i];-1!==this.kinds.indexOf(a.kind)&&(a===n?"showing"!==a.mode&&(a.mode="showing"):"disabled"!==a.mode&&(a.mode="disabled"))}},n.handleTracksChange=function(e){var t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)},n.handleSelectedLanguageChange=function(e){if("showing"===this.track.mode){var t=this.player_.cache_.selectedLanguage;if(t&&t.enabled&&t.language===this.track.language&&t.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}},n.dispose=function(){this.track=null,e.prototype.dispose.call(this)},t}(Ia);xr.registerComponent("TextTrackMenuItem",Ca);var Ra=function(e){function t(t,n){return n.track={player:t,kind:n.kind,kinds:n.kinds,default:!1,mode:"disabled"},n.kinds||(n.kinds=[n.kind]),n.label?n.track.label=n.label:n.track.label=n.kinds.join(" and ")+" off",n.selectable=!0,n.multiSelectable=!1,e.call(this,t,n)||this}p(t,e);var n=t.prototype;return n.handleTracksChange=function(e){for(var t=this.player().textTracks(),n=!0,r=0,i=t.length;r<i;r++){var a=t[r];if(this.options_.kinds.indexOf(a.kind)>-1&&"showing"===a.mode){n=!1;break}}n!==this.isSelected_&&this.selected(n)},n.handleSelectedLanguageChange=function(e){for(var t=this.player().textTracks(),n=!0,r=0,i=t.length;r<i;r++){var a=t[r];if(["captions","descriptions","subtitles"].indexOf(a.kind)>-1&&"showing"===a.mode){n=!1;break}}n&&(this.player_.cache_.selectedLanguage={enabled:!1})},t}(Ca);xr.registerComponent("OffTextTrackMenuItem",Ra);var Da=function(e){function t(t,n){return void 0===n&&(n={}),n.tracks=t.textTracks(),e.call(this,t,n)||this}return p(t,e),t.prototype.createItems=function(e,t){var n;void 0===e&&(e=[]),void 0===t&&(t=Ca),this.label_&&(n=this.label_+" off"),e.push(new Ra(this.player_,{kinds:this.kinds_,kind:this.kind_,label:n})),this.hideThreshold_+=1;var r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var i=0;i<r.length;i++){var a=r[i];if(this.kinds_.indexOf(a.kind)>-1){var s=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});s.addClass("vjs-"+a.kind+"-menu-item"),e.push(s)}}return e},t}(Aa);xr.registerComponent("TextTrackButton",Da);var Na=function(e){function t(t,n){var r,i=n.track,a=n.cue,s=t.currentTime();return n.selectable=!0,n.multiSelectable=!1,n.label=a.text,n.selected=a.startTime<=s&&s<a.endTime,(r=e.call(this,t,n)||this).track=i,r.cue=a,r}return p(t,e),t.prototype.handleClick=function(t){e.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime)},t}(Ia);xr.registerComponent("ChaptersTrackMenuItem",Na);var Oa=function(e){function t(t,n,r){var i;return(i=e.call(this,t,n,r)||this).selectCurrentItem_=function(){i.items.forEach((function(e){e.selected(i.track_.activeCues[0]===e.cue)}))},i}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildWrapperCSSClass.call(this)},n.update=function(t){if(!t||!t.track||"chapters"===t.track.kind){var n=this.findChaptersTrack();n!==this.track_?(this.setTrack(n),e.prototype.update.call(this)):(!this.items||n&&n.cues&&n.cues.length!==this.items.length)&&e.prototype.update.call(this)}},n.setTrack=function(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){var t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";var n=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);n&&n.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}},n.findChaptersTrack=function(){for(var e=this.player_.textTracks()||[],t=e.length-1;t>=0;t--){var n=e[t];if(n.kind===this.kind_)return n}},n.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(Rr(this.kind_))},n.createMenu=function(){return this.options_.title=this.getMenuCaption(),e.prototype.createMenu.call(this)},n.createItems=function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var n=0,r=t.length;n<r;n++){var i=t[n],a=new Na(this.player_,{track:this.track_,cue:i});e.push(a)}return e},t}(Da);Oa.prototype.kind_="chapters",Oa.prototype.controlText_="Chapters",xr.registerComponent("ChaptersButton",Oa);var Pa=function(e){function t(t,n,r){var i;i=e.call(this,t,n,r)||this;var a=t.textTracks(),s=fr(f(i),i.handleTracksChange);return a.addEventListener("change",s),i.on("dispose",(function(){a.removeEventListener("change",s)})),i}p(t,e);var n=t.prototype;return n.handleTracksChange=function(e){for(var t=this.player().textTracks(),n=!1,r=0,i=t.length;r<i;r++){var a=t[r];if(a.kind!==this.kind_&&"showing"===a.mode){n=!0;break}}n?this.disable():this.enable()},n.buildCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildWrapperCSSClass.call(this)},t}(Da);Pa.prototype.kind_="descriptions",Pa.prototype.controlText_="Descriptions",xr.registerComponent("DescriptionsButton",Pa);var Ma=function(e){function t(t,n,r){return e.call(this,t,n,r)||this}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildWrapperCSSClass.call(this)},t}(Da);Ma.prototype.kind_="subtitles",Ma.prototype.controlText_="Subtitles",xr.registerComponent("SubtitlesButton",Ma);var xa=function(e){function t(t,n){var r;return n.track={player:t,kind:n.kind,label:n.kind+" settings",selectable:!1,default:!1,mode:"disabled"},n.selectable=!1,n.name="CaptionSettingsMenuItem",(r=e.call(this,t,n)||this).addClass("vjs-texttrack-settings"),r.controlText(", opens "+n.kind+" settings dialog"),r}return p(t,e),t.prototype.handleClick=function(e){this.player().getChild("textTrackSettings").open()},t}(Ca);xr.registerComponent("CaptionSettingsMenuItem",xa);var La=function(e){function t(t,n,r){return e.call(this,t,n,r)||this}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-captions-button "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-captions-button "+e.prototype.buildWrapperCSSClass.call(this)},n.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new xa(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),e.prototype.createItems.call(this,t)},t}(Da);La.prototype.kind_="captions",La.prototype.controlText_="Captions",xr.registerComponent("CaptionsButton",La);var ka=function(e){function t(){return e.apply(this,arguments)||this}return p(t,e),t.prototype.createEl=function(t,n,r){var i=e.prototype.createEl.call(this,t,n,r),a=i.querySelector(".vjs-menu-item-text");return"captions"===this.options_.track.kind&&(a.appendChild(gn("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),a.appendChild(gn("span",{className:"vjs-control-text",textContent:" "+this.localize("Captions")}))),i},t}(Ca);xr.registerComponent("SubsCapsMenuItem",ka);var Fa=function(e){function t(t,n){var r;return void 0===n&&(n={}),(r=e.call(this,t,n)||this).label_="subtitles",["en","en-us","en-ca","fr-ca"].indexOf(r.player_.language_)>-1&&(r.label_="captions"),r.menuButton_.controlText(Rr(r.label_)),r}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildWrapperCSSClass.call(this)},n.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new xa(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e.prototype.createItems.call(this,t,ka)},t}(Da);Fa.prototype.kinds_=["captions","subtitles"],Fa.prototype.controlText_="Subtitles",xr.registerComponent("SubsCapsButton",Fa);var Ua=function(e){function t(t,n){var r,i=n.track,a=t.audioTracks();n.label=i.label||i.language||"Unknown",n.selected=i.enabled,(r=e.call(this,t,n)||this).track=i,r.addClass("vjs-"+i.kind+"-menu-item");var s=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];r.handleTracksChange.apply(f(r),t)};return a.addEventListener("change",s),r.on("dispose",(function(){a.removeEventListener("change",s)})),r}p(t,e);var n=t.prototype;return n.createEl=function(t,n,r){var i=e.prototype.createEl.call(this,t,n,r),a=i.querySelector(".vjs-menu-item-text");return"main-desc"===this.options_.track.kind&&(a.appendChild(gn("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),a.appendChild(gn("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),i},n.handleClick=function(t){if(e.prototype.handleClick.call(this,t),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks)for(var n=this.player_.audioTracks(),r=0;r<n.length;r++){var i=n[r];i!==this.track&&(i.enabled=i===this.track)}},n.handleTracksChange=function(e){this.selected(this.track.enabled)},t}(Ia);xr.registerComponent("AudioTrackMenuItem",Ua);var Ba=function(e){function t(t,n){return void 0===n&&(n={}),n.tracks=t.audioTracks(),e.call(this,t,n)||this}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-audio-button "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-audio-button "+e.prototype.buildWrapperCSSClass.call(this)},n.createItems=function(e){void 0===e&&(e=[]),this.hideThreshold_=1;for(var t=this.player_.audioTracks(),n=0;n<t.length;n++){var r=t[n];e.push(new Ua(this.player_,{track:r,selectable:!0,multiSelectable:!1}))}return e},t}(Aa);Ba.prototype.controlText_="Audio Track",xr.registerComponent("AudioTrackButton",Ba);var ja=function(e){function t(t,n){var r,i=n.rate,a=parseFloat(i,10);return n.label=i,n.selected=a===t.playbackRate(),n.selectable=!0,n.multiSelectable=!1,(r=e.call(this,t,n)||this).label=i,r.rate=a,r.on(t,"ratechange",(function(e){return r.update(e)})),r}p(t,e);var n=t.prototype;return n.handleClick=function(t){e.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},n.update=function(e){this.selected(this.player().playbackRate()===this.rate)},t}(Ia);ja.prototype.contentElType="button",xr.registerComponent("PlaybackRateMenuItem",ja);var qa=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).menuButton_.el_.setAttribute("aria-describedby",r.labelElId_),r.updateVisibility(),r.updateLabel(),r.on(t,"loadstart",(function(e){return r.updateVisibility(e)})),r.on(t,"ratechange",(function(e){return r.updateLabel(e)})),r.on(t,"playbackrateschange",(function(e){return r.handlePlaybackRateschange(e)})),r}p(t,e);var n=t.prototype;return n.createEl=function(){var t=e.prototype.createEl.call(this);return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=gn("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),t.appendChild(this.labelEl_),t},n.dispose=function(){this.labelEl_=null,e.prototype.dispose.call(this)},n.buildCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildWrapperCSSClass.call(this)},n.createItems=function(){for(var e=this.playbackRates(),t=[],n=e.length-1;n>=0;n--)t.push(new ja(this.player(),{rate:e[n]+"x"}));return t},n.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},n.handleClick=function(e){var t=this.player().playbackRate(),n=this.playbackRates(),r=(n.indexOf(t)+1)%n.length;this.player().playbackRate(n[r])},n.handlePlaybackRateschange=function(e){this.update()},n.playbackRates=function(){var e=this.player();return e.playbackRates&&e.playbackRates()||[]},n.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},n.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},n.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")},t}(Sa);qa.prototype.controlText_="Playback Rate",xr.registerComponent("PlaybackRateMenuButton",qa);var Ha=function(e){function t(){return e.apply(this,arguments)||this}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-spacer "+e.prototype.buildCSSClass.call(this)},n.createEl=function(t,n,r){return void 0===t&&(t="div"),void 0===n&&(n={}),void 0===r&&(r={}),n.className||(n.className=this.buildCSSClass()),e.prototype.createEl.call(this,t,n,r)},t}(xr);xr.registerComponent("Spacer",Ha);var Ga=function(e){function t(){return e.apply(this,arguments)||this}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-custom-control-spacer "+e.prototype.buildCSSClass.call(this)},n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),textContent:" "})},t}(Ha);xr.registerComponent("CustomControlSpacer",Ga);var Va=function(e){function t(){return e.apply(this,arguments)||this}return p(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},t}(xr);Va.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in l()&&Va.prototype.options_.children.splice(Va.prototype.options_.children.length-1,0,"pictureInPictureToggle"),xr.registerComponent("ControlBar",Va);var Ya=function(e){function t(t,n){var r;return(r=e.call(this,t,n)||this).on(t,"error",(function(e){return r.open(e)})),r}p(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-error-display "+e.prototype.buildCSSClass.call(this)},n.content=function(){var e=this.player().error();return e?this.localize(e.message):""},t}(Yr);Ya.prototype.options_=(0,u.Z)({},Yr.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),xr.registerComponent("ErrorDisplay",Ya);var Za="vjs-text-track-settings",Ka=["#000","Black"],za=["#00F","Blue"],Wa=["#0FF","Cyan"],Xa=["#0F0","Green"],$a=["#F0F","Magenta"],Qa=["#F00","Red"],Ja=["#FFF","White"],es=["#FF0","Yellow"],ts=["1","Opaque"],ns=["0.5","Semi-Transparent"],rs=["0","Transparent"],is={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Ka,Ja,Qa,Xa,za,es,$a,Wa]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[ts,ns,rs]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Ja,Ka,Qa,Xa,za,es,$a,Wa]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(e){return"1.00"===e?null:Number(e)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[ts,ns]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[rs,ns,ts]}};function as(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}is.windowColor.options=is.backgroundColor.options;var ss=function(e){function t(t,n){var r;return n.temporary=!1,(r=e.call(this,t,n)||this).updateDisplay=r.updateDisplay.bind(f(r)),r.fill(),r.hasBeenOpened_=r.hasBeenFilled_=!0,r.endDialog=gn("p",{className:"vjs-control-text",textContent:r.localize("End of dialog window.")}),r.el().appendChild(r.endDialog),r.setDefaults(),void 0===n.persistTextTrackSettings&&(r.options_.persistTextTrackSettings=r.options_.playerOptions.persistTextTrackSettings),r.on(r.$(".vjs-done-button"),"click",(function(){r.saveSettings(),r.close()})),r.on(r.$(".vjs-default-button"),"click",(function(){r.setDefaults(),r.updateDisplay()})),Mt(is,(function(e){r.on(r.$(e.selector),"change",r.updateDisplay)})),r.options_.persistTextTrackSettings&&r.restoreSettings(),r}p(t,e);var n=t.prototype;return n.dispose=function(){this.endDialog=null,e.prototype.dispose.call(this)},n.createElSelect_=function(e,t,n){var r=this;void 0===t&&(t=""),void 0===n&&(n="label");var i=is[e],a=i.id.replace("%s",this.id_),s=[t,a].join(" ").trim();return["<"+n+' id="'+a+'" class="'+("label"===n?"vjs-label":"")+'">',this.localize(i.label),"</"+n+">",'<select aria-labelledby="'+s+'">'].concat(i.options.map((function(e){var t=a+"-"+e[1].replace(/\W+/g,"");return['<option id="'+t+'" value="'+e[0]+'" ','aria-labelledby="'+s+" "+t+'">',r.localize(e[1]),"</option>"].join("")}))).concat("</select>").join("")},n.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Text"),"</legend>",this.createElSelect_("color",e),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",e),"</span>","</fieldset>"].join("")},n.createElBgColor_=function(){var e="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",e),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",e),"</span>","</fieldset>"].join("")},n.createElWinColor_=function(){var e="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Window"),"</legend>",this.createElSelect_("windowColor",e),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",e),"</span>","</fieldset>"].join("")},n.createElColors_=function(){return gn("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},n.createElFont_=function(){return gn("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})},n.createElControls_=function(){var e=this.localize("restore all settings to the default values");return gn("div",{className:"vjs-track-settings-controls",innerHTML:['<button type="button" class="vjs-default-button" title="'+e+'">',this.localize("Reset"),'<span class="vjs-control-text"> '+e+"</span>","</button>",'<button type="button" class="vjs-done-button">'+this.localize("Done")+"</button>"].join("")})},n.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},n.label=function(){return this.localize("Caption Settings Dialog")},n.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},n.buildCSSClass=function(){return e.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},n.getValues=function(){var e,t,n,r=this;return t=function(e,t,n){var i,a,s=(i=r.$(t.selector),a=t.parser,as(i.options[i.options.selectedIndex].value,a));return void 0!==s&&(e[n]=s),e},void 0===(n={})&&(n=0),Pt(e=is).reduce((function(n,r){return t(n,e[r],r)}),n)},n.setValues=function(e){var t=this;Mt(is,(function(n,r){!function(e,t,n){if(t)for(var r=0;r<e.options.length;r++)if(as(e.options[r].value,n)===t){e.selectedIndex=r;break}}(t.$(n.selector),e[r],n.parser)}))},n.setDefaults=function(){var e=this;Mt(is,(function(t){var n=t.hasOwnProperty("default")?t.default:0;e.$(t.selector).selectedIndex=n}))},n.restoreSettings=function(){var e;try{e=JSON.parse(i().localStorage.getItem(Za))}catch(e){Dt.warn(e)}e&&this.setValues(e)},n.saveSettings=function(){if(this.options_.persistTextTrackSettings){var e=this.getValues();try{Object.keys(e).length?i().localStorage.setItem(Za,JSON.stringify(e)):i().localStorage.removeItem(Za)}catch(e){Dt.warn(e)}}},n.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()},n.conditionalBlur_=function(){this.previouslyActiveEl_=null;var e=this.player_.controlBar,t=e&&e.subsCapsButton,n=e&&e.captionsButton;t?t.focus():n&&n.focus()},t}(Yr);xr.registerComponent("TextTrackSettings",ss);var os=function(e){function t(t,n){var r,a=n.ResizeObserver||i().ResizeObserver;null===n.ResizeObserver&&(a=!1);var s=Dr({createEl:!a,reportTouchActivity:!1},n);return(r=e.call(this,t,s)||this).ResizeObserver=n.ResizeObserver||i().ResizeObserver,r.loadListener_=null,r.resizeObserver_=null,r.debouncedHandler_=function(e,t,n,r){var a;void 0===r&&(r=i());var s=function(){var t=this,n=arguments,i=function(){a=null,i=null,e.apply(t,n)};r.clearTimeout(a),a=r.setTimeout(i,100)};return s.cancel=function(){r.clearTimeout(a),a=null},s}((function(){r.resizeHandler()}),0,0,f(r)),a?(r.resizeObserver_=new r.ResizeObserver(r.debouncedHandler_),r.resizeObserver_.observe(t.el())):(r.loadListener_=function(){if(r.el_&&r.el_.contentWindow){var e=r.debouncedHandler_,t=r.unloadListener_=function(){ar(this,"resize",e),ar(this,"unload",t),t=null};ir(r.el_.contentWindow,"unload",t),ir(r.el_.contentWindow,"resize",e)}},r.one("load",r.loadListener_)),r}p(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})},n.resizeHandler=function(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")},n.dispose=function(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,e.prototype.dispose.call(this)},t}(xr);xr.registerComponent("ResizeManager",os);var ls={trackingThreshold:20,liveTolerance:15},us=function(e){function t(t,n){var r,i=Dr(ls,n,{createEl:!1});return(r=e.call(this,t,i)||this).handleVisibilityChange_=function(e){return r.handleVisibilityChange(e)},r.trackLiveHandler_=function(){return r.trackLive_()},r.handlePlay_=function(e){return r.handlePlay(e)},r.handleFirstTimeupdate_=function(e){return r.handleFirstTimeupdate(e)},r.handleSeeked_=function(e){return r.handleSeeked(e)},r.seekToLiveEdge_=function(e){return r.seekToLiveEdge(e)},r.reset_(),r.on(r.player_,"durationchange",(function(e){return r.handleDurationchange(e)})),r.on(r.player_,"canplay",(function(){return r.toggleTracking()})),Jt&&"hidden"in l()&&"visibilityState"in l()&&r.on(l(),"visibilitychange",r.handleVisibilityChange_),r}p(t,e);var n=t.prototype;return n.handleVisibilityChange=function(){this.player_.duration()===1/0&&(l().hidden?this.stopTracking():this.startTracking())},n.trackLive_=function(){var e=this.player_.seekable();if(e&&e.length){var t=Number(i().performance.now().toFixed(4)),n=-1===this.lastTime_?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+n;var r=this.liveCurrentTime(),a=this.player_.currentTime(),s=this.player_.paused()||this.seekedBehindLive_||Math.abs(r-a)>this.options_.liveTolerance;this.timeupdateSeen_&&r!==1/0||(s=!1),s!==this.behindLiveEdge_&&(this.behindLiveEdge_=s,this.trigger("liveedgechange"))}},n.handleDurationchange=function(){this.toggleTracking()},n.toggleTracking=function(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())},n.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,dr),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))},n.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)},n.handleSeeked=function(){var e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()},n.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)},n.reset_=function(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)},n.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},n.stopTracking=function(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))},n.seekableEnd=function(){for(var e=this.player_.seekable(),t=[],n=e?e.length:0;n--;)t.push(e.end(n));return t.length?t.sort()[t.length-1]:1/0},n.seekableStart=function(){for(var e=this.player_.seekable(),t=[],n=e?e.length:0;n--;)t.push(e.start(n));return t.length?t.sort()[0]:0},n.liveWindow=function(){var e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()},n.isLive=function(){return this.isTracking()},n.atLiveEdge=function(){return!this.behindLiveEdge()},n.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},n.pastSeekEnd=function(){var e=this.seekableEnd();return-1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_},n.behindLiveEdge=function(){return this.behindLiveEdge_},n.isTracking=function(){return"number"==typeof this.trackingInterval_},n.seekToLiveEdge=function(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},n.dispose=function(){this.off(l(),"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),e.prototype.dispose.call(this)},t}(xr);xr.registerComponent("LiveTracker",us);var cs,ds=function(e){var t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;var n=e.$$("source"),r=[],i="";if(!n.length)return!1;for(var a=0;a<n.length;a++){var s=n[a].src;s&&-1===r.indexOf(s)&&r.push(s)}return!!r.length&&(1===r.length&&(i=r[0]),e.triggerSourceset(i),!0)},fs=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(e){var t=l().createElement(this.nodeName.toLowerCase());t.innerHTML=e;for(var n=l().createDocumentFragment();t.childNodes.length;)n.appendChild(t.childNodes[0]);return this.innerText="",i().Element.prototype.appendChild.call(this,n),this.innerHTML}}),hs=function(e,t){for(var n={},r=0;r<e.length&&!((n=Object.getOwnPropertyDescriptor(e[r],t))&&n.set&&n.get);r++);return n.enumerable=!0,n.configurable=!0,n},ps=function(e){var t=e.el();if(!t.resetSourceWatch_){var n={},r=function(e){return hs([e.el(),i().HTMLMediaElement.prototype,i().Element.prototype,fs],"innerHTML")}(e),a=function(n){return function(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];var s=n.apply(t,i);return ds(e),s}};["append","appendChild","insertAdjacentHTML"].forEach((function(e){t[e]&&(n[e]=t[e],t[e]=a(n[e]))})),Object.defineProperty(t,"innerHTML",Dr(r,{set:a(r.set)})),t.resetSourceWatch_=function(){t.resetSourceWatch_=null,Object.keys(n).forEach((function(e){t[e]=n[e]})),Object.defineProperty(t,"innerHTML",r)},e.one("sourceset",t.resetSourceWatch_)}},gs=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?oi(i().Element.prototype.getAttribute.call(this,"src")):""},set:function(e){return i().Element.prototype.setAttribute.call(this,"src",e),e}}),ms=function(e,t,n,r){void 0===r&&(r=!0);var i=function(n){return Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0})},a={configurable:!0,enumerable:!0,get:function(){var e=n();return i(e),e}};return r&&(a.set=i),Object.defineProperty(e,t,a)},ys=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var i=t.source,a=!1;if(r.featuresVideoFrameCallback=r.featuresVideoFrameCallback&&"VIDEO"===r.el_.tagName,i&&(r.el_.currentSrc!==i.src||t.tag&&3===t.tag.initNetworkState_)?r.setSource(i):r.handleLateInit_(r.el_),t.enableSourceset&&r.setupSourcesetHandling_(),r.isScrubbing_=!1,r.el_.hasChildNodes()){for(var s=r.el_.childNodes,o=s.length,l=[];o--;){var u=s[o];"track"===u.nodeName.toLowerCase()&&(r.featuresNativeTextTracks?(r.remoteTextTrackEls().addTrackElement_(u),r.remoteTextTracks().addTrack(u.track),r.textTracks().addTrack(u.track),a||r.el_.hasAttribute("crossorigin")||!ui(u.src)||(a=!0)):l.push(u))}for(var c=0;c<l.length;c++)r.el_.removeChild(l[c])}return r.proxyNativeTracks_(),r.featuresNativeTextTracks&&a&&Dt.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading."),r.restoreMetadataTracksInIOSNativePlayer_(),(nn||an||zt)&&!0===t.nativeControlsForTouch&&r.setControls(!0),r.proxyWebkitFullscreen_(),r.triggerReady(),r}p(t,e);var n=t.prototype;return n.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),t.disposeMediaElement(this.el_),this.options_=null,e.prototype.dispose.call(this)},n.setupSourcesetHandling_=function(){!function(e){if(e.featuresSourceset){var t=e.el();if(!t.resetSourceset_){var n=function(e){return hs([e.el(),i().HTMLMediaElement.prototype,gs],"src")}(e),r=t.setAttribute,a=t.load;Object.defineProperty(t,"src",Dr(n,{set:function(r){var i=n.set.call(t,r);return e.triggerSourceset(t.src),i}})),t.setAttribute=function(n,i){var a=r.call(t,n,i);return/src/i.test(n)&&e.triggerSourceset(t.src),a},t.load=function(){var n=a.call(t);return ds(e)||(e.triggerSourceset(""),ps(e)),n},t.currentSrc?e.triggerSourceset(t.currentSrc):ds(e)||ps(e),t.resetSourceset_=function(){t.resetSourceset_=null,t.load=a,t.setAttribute=r,Object.defineProperty(t,"src",n),t.resetSourceWatch_&&t.resetSourceWatch_()}}}}(this)},n.restoreMetadataTracksInIOSNativePlayer_=function(){var e,t=this.textTracks(),n=function(){e=[];for(var n=0;n<t.length;n++){var r=t[n];"metadata"===r.kind&&e.push({track:r,storedMode:r.mode})}};n(),t.addEventListener("change",n),this.on("dispose",(function(){return t.removeEventListener("change",n)}));var r=function n(){for(var r=0;r<e.length;r++){var i=e[r];"disabled"===i.track.mode&&i.track.mode!==i.storedMode&&(i.track.mode=i.storedMode)}t.removeEventListener("change",n)};this.on("webkitbeginfullscreen",(function(){t.removeEventListener("change",n),t.removeEventListener("change",r),t.addEventListener("change",r)})),this.on("webkitendfullscreen",(function(){t.removeEventListener("change",n),t.addEventListener("change",n),t.removeEventListener("change",r)}))},n.overrideNative_=function(e,t){var n=this;if(t===this["featuresNative"+e+"Tracks"]){var r=e.toLowerCase();this[r+"TracksListeners_"]&&Object.keys(this[r+"TracksListeners_"]).forEach((function(e){n.el()[r+"Tracks"].removeEventListener(e,n[r+"TracksListeners_"][e])})),this["featuresNative"+e+"Tracks"]=!t,this[r+"TracksListeners_"]=null,this.proxyNativeTracksForType_(r)}},n.overrideNativeAudioTracks=function(e){this.overrideNative_("Audio",e)},n.overrideNativeVideoTracks=function(e){this.overrideNative_("Video",e)},n.proxyNativeTracksForType_=function(e){var t=this,n=yi[e],r=this.el()[n.getterName],i=this[n.getterName]();if(this["featuresNative"+n.capitalName+"Tracks"]&&r&&r.addEventListener){var a={change:function(n){var r={type:"change",target:i,currentTarget:i,srcElement:i};i.trigger(r),"text"===e&&t[vi.remoteText.getterName]().trigger(r)},addtrack:function(e){i.addTrack(e.track)},removetrack:function(e){i.removeTrack(e.track)}},s=function(){for(var e=[],t=0;t<i.length;t++){for(var n=!1,a=0;a<r.length;a++)if(r[a]===i[t]){n=!0;break}n||e.push(i[t])}for(;e.length;)i.removeTrack(e.shift())};this[n.getterName+"Listeners_"]=a,Object.keys(a).forEach((function(e){var n=a[e];r.addEventListener(e,n),t.on("dispose",(function(t){return r.removeEventListener(e,n)}))})),this.on("loadstart",s),this.on("dispose",(function(e){return t.off("loadstart",s)}))}},n.proxyNativeTracks_=function(){var e=this;yi.names.forEach((function(t){e.proxyNativeTracksForType_(t)}))},n.createEl=function(){var e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){var n=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(n,e),t.disposeMediaElement(e),e=n}else{e=l().createElement("video");var r=Dr({},this.options_.tag&&Sn(this.options_.tag));nn&&!0===this.options_.nativeControlsForTouch||delete r.controls,bn(e,xt(r,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}void 0!==this.options_.preload&&wn(e,"preload",this.options_.preload),void 0!==this.options_.disablePictureInPicture&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);for(var i=["loop","muted","playsinline","autoplay"],a=0;a<i.length;a++){var s=i[a],o=this.options_[s];void 0!==o&&(o?wn(e,s,s):In(e,s),e[s]=o)}return e},n.handleLateInit_=function(e){if(0!==e.networkState&&3!==e.networkState){if(0===e.readyState){var t=!1,n=function(){t=!0};this.on("loadstart",n);var r=function(){t||this.trigger("loadstart")};return this.on("loadedmetadata",r),void this.ready((function(){this.off("loadstart",n),this.off("loadedmetadata",r),t||this.trigger("loadstart")}))}var i=["loadstart"];i.push("loadedmetadata"),e.readyState>=2&&i.push("loadeddata"),e.readyState>=3&&i.push("canplay"),e.readyState>=4&&i.push("canplaythrough"),this.ready((function(){i.forEach((function(e){this.trigger(e)}),this)}))}},n.setScrubbing=function(e){this.isScrubbing_=e},n.scrubbing=function(){return this.isScrubbing_},n.setCurrentTime=function(e){try{this.isScrubbing_&&this.el_.fastSeek&&on?this.el_.fastSeek(e):this.el_.currentTime=e}catch(e){Dt(e,"Video is not ready. (Video.js)")}},n.duration=function(){var e=this;return this.el_.duration===1/0&&Zt&&$t&&0===this.el_.currentTime?(this.on("timeupdate",(function t(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",t))})),NaN):this.el_.duration||NaN},n.width=function(){return this.el_.offsetWidth},n.height=function(){return this.el_.offsetHeight},n.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var t=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},n=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",t),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",n),this.on("dispose",(function(){e.off("webkitbeginfullscreen",n),e.off("webkitendfullscreen",t)}))}},n.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var e=i().navigator&&i().navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},n.enterFullScreen=function(){var e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)Hr(this.el_.play()),this.setTimeout((function(){e.pause();try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}}),0);else try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}},n.exitFullScreen=function(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))},n.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},n.requestVideoFrameCallback=function(t){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(t):e.prototype.requestVideoFrameCallback.call(this,t)},n.cancelVideoFrameCallback=function(t){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(t):e.prototype.cancelVideoFrameCallback.call(this,t)},n.src=function(e){if(void 0===e)return this.el_.src;this.setSrc(e)},n.reset=function(){t.resetMediaElement(this.el_)},n.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},n.setControls=function(e){this.el_.controls=!!e},n.addTextTrack=function(t,n,r){return this.featuresNativeTextTracks?this.el_.addTextTrack(t,n,r):e.prototype.addTextTrack.call(this,t,n,r)},n.createRemoteTextTrack=function(t){if(!this.featuresNativeTextTracks)return e.prototype.createRemoteTextTrack.call(this,t);var n=l().createElement("track");return t.kind&&(n.kind=t.kind),t.label&&(n.label=t.label),(t.language||t.srclang)&&(n.srclang=t.language||t.srclang),t.default&&(n.default=t.default),t.id&&(n.id=t.id),t.src&&(n.src=t.src),n},n.addRemoteTextTrack=function(t,n){var r=e.prototype.addRemoteTextTrack.call(this,t,n);return this.featuresNativeTextTracks&&this.el().appendChild(r),r},n.removeRemoteTextTrack=function(t){if(e.prototype.removeRemoteTextTrack.call(this,t),this.featuresNativeTextTracks)for(var n=this.$$("track"),r=n.length;r--;)t!==n[r]&&t!==n[r].track||this.el().removeChild(n[r])},n.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),i().performance&&"function"==typeof i().performance.now?e.creationTime=i().performance.now():i().performance&&i().performance.timing&&"number"==typeof i().performance.timing.navigationStart&&(e.creationTime=i().Date.now()-i().performance.timing.navigationStart),e},t}(Ti);ms(ys,"TEST_VID",(function(){if(dn()){var e=l().createElement("video"),t=l().createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e}})),ys.isSupported=function(){try{ys.TEST_VID.volume=.5}catch(e){return!1}return!(!ys.TEST_VID||!ys.TEST_VID.canPlayType)},ys.canPlayType=function(e){return ys.TEST_VID.canPlayType(e)},ys.canPlaySource=function(e,t){return ys.canPlayType(e.type)},ys.canControlVolume=function(){try{var e=ys.TEST_VID.volume;ys.TEST_VID.volume=e/2+.1;var t=e!==ys.TEST_VID.volume;return t&&sn?(i().setTimeout((function(){ys&&ys.prototype&&(ys.prototype.featuresVolumeControl=e!==ys.TEST_VID.volume)})),!1):t}catch(e){return!1}},ys.canMuteVolume=function(){try{var e=ys.TEST_VID.muted;return ys.TEST_VID.muted=!e,ys.TEST_VID.muted?wn(ys.TEST_VID,"muted","muted"):In(ys.TEST_VID,"muted"),e!==ys.TEST_VID.muted}catch(e){return!1}},ys.canControlPlaybackRate=function(){if(Zt&&$t&&Qt<58)return!1;try{var e=ys.TEST_VID.playbackRate;return ys.TEST_VID.playbackRate=e/2+.1,e!==ys.TEST_VID.playbackRate}catch(e){return!1}},ys.canOverrideAttributes=function(){try{var e=function(){};Object.defineProperty(l().createElement("video"),"src",{get:e,set:e}),Object.defineProperty(l().createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(l().createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(l().createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return!1}return!0},ys.supportsNativeTextTracks=function(){return on||sn&&$t},ys.supportsNativeVideoTracks=function(){return!(!ys.TEST_VID||!ys.TEST_VID.videoTracks)},ys.supportsNativeAudioTracks=function(){return!(!ys.TEST_VID||!ys.TEST_VID.audioTracks)},ys.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach((function(e){var t=e[0],n=e[1];ms(ys.prototype,t,(function(){return ys[n]()}),!0)})),ys.prototype.featuresVolumeControl=ys.canControlVolume(),ys.prototype.movingMediaElementInDOM=!sn,ys.prototype.featuresFullscreenResize=!0,ys.prototype.featuresProgressEvents=!0,ys.prototype.featuresTimeupdateEvents=!0,ys.prototype.featuresVideoFrameCallback=!(!ys.TEST_VID||!ys.TEST_VID.requestVideoFrameCallback),ys.patchCanPlayType=function(){Kt>=4&&!Wt&&!$t&&(cs=ys.TEST_VID&&ys.TEST_VID.constructor.prototype.canPlayType,ys.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&/^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(e)?"maybe":cs.call(this,e)})},ys.unpatchCanPlayType=function(){var e=ys.TEST_VID.constructor.prototype.canPlayType;return cs&&(ys.TEST_VID.constructor.prototype.canPlayType=cs),e},ys.patchCanPlayType(),ys.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},ys.resetMediaElement=function(e){if(e){for(var t=e.querySelectorAll("source"),n=t.length;n--;)e.removeChild(t[n]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach((function(e){ys.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}})),["muted","defaultMuted","autoplay","loop","playsinline"].forEach((function(e){ys.prototype["set"+Rr(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}})),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach((function(e){ys.prototype[e]=function(){return this.el_[e]}})),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach((function(e){ys.prototype["set"+Rr(e)]=function(t){this.el_[e]=t}})),["pause","load","play"].forEach((function(e){ys.prototype[e]=function(){return this.el_[e]()}})),Ti.withSourceHandlers(ys),ys.nativeSourceHandler={},ys.nativeSourceHandler.canPlayType=function(e){try{return ys.TEST_VID.canPlayType(e)}catch(e){return""}},ys.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return ys.nativeSourceHandler.canPlayType(e.type);if(e.src){var n=li(e.src);return ys.nativeSourceHandler.canPlayType("video/"+n)}return""},ys.nativeSourceHandler.handleSource=function(e,t,n){t.setSrc(e.src)},ys.nativeSourceHandler.dispose=function(){},ys.registerSourceHandler(ys.nativeSourceHandler),Ti.registerTech("Html5",ys);var vs=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],_s={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Ts=["tiny","xsmall","small","medium","large","xlarge","huge"],Es={};Ts.forEach((function(e){var t="x"===e.charAt(0)?"x-"+e.substring(1):e;Es[e]="vjs-layout-"+t}));var bs={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Ss=function(e){function t(n,r,i){var a;if(n.id=n.id||r.id||"vjs_video_"+Xn(),(r=xt(t.getTagSettings(n),r)).initChildren=!1,r.createEl=!1,r.evented=!1,r.reportTouchActivity=!1,!r.language)if("function"==typeof n.closest){var s=n.closest("[lang]");s&&s.getAttribute&&(r.language=s.getAttribute("lang"))}else for(var o=n;o&&1===o.nodeType;){if(Sn(o).hasOwnProperty("lang")){r.language=o.getAttribute("lang");break}o=o.parentNode}if((a=e.call(this,null,r,i)||this).boundDocumentFullscreenChange_=function(e){return a.documentFullscreenChange_(e)},a.boundFullWindowOnEscKey_=function(e){return a.fullWindowOnEscKey(e)},a.boundUpdateStyleEl_=function(e){return a.updateStyleEl_(e)},a.boundApplyInitTime_=function(e){return a.applyInitTime_(e)},a.boundUpdateCurrentBreakpoint_=function(e){return a.updateCurrentBreakpoint_(e)},a.boundHandleTechClick_=function(e){return a.handleTechClick_(e)},a.boundHandleTechDoubleClick_=function(e){return a.handleTechDoubleClick_(e)},a.boundHandleTechTouchStart_=function(e){return a.handleTechTouchStart_(e)},a.boundHandleTechTouchMove_=function(e){return a.handleTechTouchMove_(e)},a.boundHandleTechTouchEnd_=function(e){return a.handleTechTouchEnd_(e)},a.boundHandleTechTap_=function(e){return a.handleTechTap_(e)},a.isFullscreen_=!1,a.log=Nt(a.id_),a.fsApi_=St,a.isPosterFromTech_=!1,a.queuedCallbacks_=[],a.isReady_=!1,a.hasStarted_=!1,a.userActive_=!1,a.debugEnabled_=!1,a.audioOnlyMode_=!1,a.audioPosterMode_=!1,a.audioOnlyCache_={playerHeight:null,hiddenChildren:[]},!a.options_||!a.options_.techOrder||!a.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(a.tag=n,a.tagAttributes=n&&Sn(n),a.language(a.options_.language),r.languages){var u={};Object.getOwnPropertyNames(r.languages).forEach((function(e){u[e.toLowerCase()]=r.languages[e]})),a.languages_=u}else a.languages_=t.prototype.options_.languages;a.resetCache_(),a.poster_=r.poster||"",a.controls_=!!r.controls,n.controls=!1,n.removeAttribute("controls"),a.changingSrc_=!1,a.playCallbacks_=[],a.playTerminatedQueue_=[],n.hasAttribute("autoplay")?a.autoplay(!0):a.autoplay(a.options_.autoplay),r.plugins&&Object.keys(r.plugins).forEach((function(e){if("function"!=typeof a[e])throw new Error('plugin "'+e+'" does not exist')})),a.scrubbing_=!1,a.el_=a.createEl(),Ar(f(a),{eventBusKey:"el_"}),a.fsApi_.requestFullscreen&&(ir(l(),a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_),a.on(a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_)),a.fluid_&&a.on(["playerreset","resize"],a.boundUpdateStyleEl_);var c=Dr(a.options_);r.plugins&&Object.keys(r.plugins).forEach((function(e){a[e](r.plugins[e])})),r.debug&&a.debug(!0),a.options_.playerOptions=c,a.middleware_=[],a.playbackRates(r.playbackRates),a.initChildren(),a.isAudio("audio"===n.nodeName.toLowerCase()),a.controls()?a.addClass("vjs-controls-enabled"):a.addClass("vjs-controls-disabled"),a.el_.setAttribute("role","region"),a.isAudio()?a.el_.setAttribute("aria-label",a.localize("Audio Player")):a.el_.setAttribute("aria-label",a.localize("Video Player")),a.isAudio()&&a.addClass("vjs-audio"),a.flexNotSupported_()&&a.addClass("vjs-no-flex"),nn&&a.addClass("vjs-touch-enabled"),sn||a.addClass("vjs-workinghover"),t.players[a.id_]=f(a);var d=_t.split(".")[0];return a.addClass("vjs-v"+d),a.userActive(!0),a.reportUserActivity(),a.one("play",(function(e){return a.listenForUserActivity_(e)})),a.on("stageclick",(function(e){return a.handleStageClick_(e)})),a.on("keydown",(function(e){return a.handleKeyDown(e)})),a.on("languagechange",(function(e){return a.handleLanguagechange(e)})),a.breakpoints(a.options_.breakpoints),a.responsive(a.options_.responsive),a.on("ready",(function(){a.audioPosterMode(a.options_.audioPosterMode),a.audioOnlyMode(a.options_.audioOnlyMode)})),a}p(t,e);var n=t.prototype;return n.dispose=function(){var n=this;this.trigger("dispose"),this.off("dispose"),ar(l(),this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),ar(l(),"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),t.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),bi[this.id()]=null,_i.names.forEach((function(e){var t=_i[e],r=n[t.getterName]();r&&r.off&&r.off()})),e.prototype.dispose.call(this,{restoreEl:this.options_.restoreEl})},n.createEl=function(){var t,n=this.tag,r=this.playerElIngest_=n.parentNode&&n.parentNode.hasAttribute&&n.parentNode.hasAttribute("data-vjs-player"),a="video-js"===this.tag.tagName.toLowerCase();r?t=this.el_=n.parentNode:a||(t=this.el_=e.prototype.createEl.call(this,"div"));var s=Sn(n);if(a){for(t=this.el_=n,n=this.tag=l().createElement("video");t.children.length;)n.appendChild(t.firstChild);vn(t,"video-js")||_n(t,"video-js"),t.appendChild(n),r=this.playerElIngest_=t,Object.keys(t).forEach((function(e){try{n[e]=t[e]}catch(e){}}))}if(n.setAttribute("tabindex","-1"),s.tabindex="-1",(Jt||$t&&tn)&&(n.setAttribute("role","application"),s.role="application"),n.removeAttribute("width"),n.removeAttribute("height"),"width"in s&&delete s.width,"height"in s&&delete s.height,Object.getOwnPropertyNames(s).forEach((function(e){a&&"class"===e||t.setAttribute(e,s[e]),a&&n.setAttribute(e,s[e])})),n.playerId=n.id,n.id+="_html5_api",n.className="vjs-tech",n.player=t.player=this,this.addClass("vjs-paused"),!0!==i().VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=Kn("vjs-styles-dimensions");var o=Bn(".vjs-styles-defaults"),u=Bn("head");u.insertBefore(this.styleEl_,o?o.nextSibling:u.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);for(var c=n.getElementsByTagName("a"),d=0;d<c.length;d++){var f=c.item(d);_n(f,"vjs-hidden"),f.setAttribute("hidden","hidden")}return n.initNetworkState_=n.networkState,n.parentNode&&!r&&n.parentNode.insertBefore(t,n),yn(n,t),this.children_.unshift(n),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=t,t},n.crossOrigin=function(e){if(!e)return this.techGet_("crossOrigin");"anonymous"===e||"use-credentials"===e?this.techCall_("setCrossOrigin",e):Dt.warn('crossOrigin must be "anonymous" or "use-credentials", given "'+e+'"')},n.width=function(e){return this.dimension("width",e)},n.height=function(e){return this.dimension("height",e)},n.dimension=function(e,t){var n=e+"_";if(void 0===t)return this[n]||0;if(""===t||"auto"===t)return this[n]=void 0,void this.updateStyleEl_();var r=parseFloat(t);isNaN(r)?Dt.error('Improper value "'+t+'" supplied for for '+e):(this[n]=r,this.updateStyleEl_())},n.fluid=function(e){var t,n,r=this;if(void 0===e)return!!this.fluid_;this.fluid_=!!e,mr(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),n=function(){r.on(["playerreset","resize"],r.boundUpdateStyleEl_)},mr(t=this)?n():(t.eventedCallbacks||(t.eventedCallbacks=[]),t.eventedCallbacks.push(n))):this.removeClass("vjs-fluid"),this.updateStyleEl_()},n.fill=function(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")},n.aspectRatio=function(e){if(void 0===e)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()},n.updateStyleEl_=function(){if(!0!==i().VIDEOJS_NO_DYNAMIC_STYLE){var e,t,n,r=(void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),a=r[1]/r[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/a:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*a,n=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(n),zn(this.styleEl_,"\n      ."+n+" {\n        width: "+e+"px;\n        height: "+t+"px;\n      }\n\n      ."+n+".vjs-fluid:not(.vjs-audio-only-mode) {\n        padding-top: "+100*a+"%;\n      }\n    ")}else{var s="number"==typeof this.width_?this.width_:this.options_.width,o="number"==typeof this.height_?this.height_:this.options_.height,l=this.tech_&&this.tech_.el();l&&(s>=0&&(l.width=s),o>=0&&(l.height=o))}},n.loadTech_=function(e,t){var n=this;this.tech_&&this.unloadTech_();var r=Rr(e),i=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==r&&this.tag&&(Ti.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=r,this.isReady_=!1;var a=this.autoplay();("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(a=!1);var s={source:t,autoplay:a,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+i+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset,Promise:this.options_.Promise};_i.names.forEach((function(e){var t=_i[e];s[t.getterName]=n[t.privateName]})),xt(s,this.options_[r]),xt(s,this.options_[i]),xt(s,this.options_[e.toLowerCase()]),this.tag&&(s.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(s.startTime=this.cache_.currentTime);var o,l,u=Ti.getTech(e);if(!u)throw new Error("No Tech named '"+r+"' exists! '"+r+"' should be registered using videojs.registerTech()'");this.tech_=new u(s),this.tech_.ready(fr(this,this.handleTechReady_),!0),o=this.textTracksJson_||[],l=this.tech_,o.forEach((function(e){var t=l.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach((function(e){return t.addCue(e)}))})),l.textTracks(),vs.forEach((function(e){n.on(n.tech_,e,(function(t){return n["handleTech"+Rr(e)+"_"](t)}))})),Object.keys(_s).forEach((function(e){n.on(n.tech_,e,(function(t){0===n.tech_.playbackRate()&&n.tech_.seeking()?n.queuedCallbacks_.push({callback:n["handleTech"+_s[e]+"_"].bind(n),event:t}):n["handleTech"+_s[e]+"_"](t)}))})),this.on(this.tech_,"loadstart",(function(e){return n.handleTechLoadStart_(e)})),this.on(this.tech_,"sourceset",(function(e){return n.handleTechSourceset_(e)})),this.on(this.tech_,"waiting",(function(e){return n.handleTechWaiting_(e)})),this.on(this.tech_,"ended",(function(e){return n.handleTechEnded_(e)})),this.on(this.tech_,"seeking",(function(e){return n.handleTechSeeking_(e)})),this.on(this.tech_,"play",(function(e){return n.handleTechPlay_(e)})),this.on(this.tech_,"firstplay",(function(e){return n.handleTechFirstPlay_(e)})),this.on(this.tech_,"pause",(function(e){return n.handleTechPause_(e)})),this.on(this.tech_,"durationchange",(function(e){return n.handleTechDurationChange_(e)})),this.on(this.tech_,"fullscreenchange",(function(e,t){return n.handleTechFullscreenChange_(e,t)})),this.on(this.tech_,"fullscreenerror",(function(e,t){return n.handleTechFullscreenError_(e,t)})),this.on(this.tech_,"enterpictureinpicture",(function(e){return n.handleTechEnterPictureInPicture_(e)})),this.on(this.tech_,"leavepictureinpicture",(function(e){return n.handleTechLeavePictureInPicture_(e)})),this.on(this.tech_,"error",(function(e){return n.handleTechError_(e)})),this.on(this.tech_,"posterchange",(function(e){return n.handleTechPosterChange_(e)})),this.on(this.tech_,"textdata",(function(e){return n.handleTechTextData_(e)})),this.on(this.tech_,"ratechange",(function(e){return n.handleTechRateChange_(e)})),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===r&&this.tag||yn(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},n.unloadTech_=function(){var e,t,n,r=this;_i.names.forEach((function(e){var t=_i[e];r[t.privateName]=r[t.getterName]()})),this.textTracksJson_=(e=this.tech_,t=e.$$("track"),n=Array.prototype.map.call(t,(function(e){return e.track})),Array.prototype.map.call(t,(function(e){var t=Gr(e.track);return e.src&&(t.src=e.src),t})).concat(Array.prototype.filter.call(e.textTracks(),(function(e){return-1===n.indexOf(e)})).map(Gr))),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},n.tech=function(e){return void 0===e&&Dt.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_},n.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)},n.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)},n.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},n.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())},n.manualAutoplay_=function(e){var t=this;if(this.tech_&&"string"==typeof e){var n,r=function(){var e=t.muted();t.muted(!0);var n=function(){t.muted(e)};t.playTerminatedQueue_.push(n);var r=t.play();if(qr(r))return r.catch((function(e){throw n(),new Error("Rejection at manualAutoplay. Restoring muted value. "+(e||""))}))};if("any"!==e||this.muted()?n="muted"!==e||this.muted()?this.play():r():qr(n=this.play())&&(n=n.catch(r)),qr(n))return n.then((function(){t.trigger({type:"autoplay-success",autoplay:e})})).catch((function(){t.trigger({type:"autoplay-failure",autoplay:e})}))}},n.updateSourceCaches_=function(e){void 0===e&&(e="");var t=e,n="";"string"!=typeof t&&(t=e.src,n=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!n&&(n=function(e,t){if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;var n=e.cache_.sources.filter((function(e){return e.src===t}));if(n.length)return n[0].type;for(var r=e.$$("source"),i=0;i<r.length;i++){var a=r[i];if(a.type&&a.src&&a.src===t)return a.type}return Pi(t)}(this,t)),this.cache_.source=Dr({},e,{src:t,type:n});for(var r=this.cache_.sources.filter((function(e){return e.src&&e.src===t})),i=[],a=this.$$("source"),s=[],o=0;o<a.length;o++){var l=Sn(a[o]);i.push(l),l.src&&l.src===t&&s.push(l.src)}s.length&&!r.length?this.cache_.sources=i:r.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t},n.handleTechSourceset_=function(e){var t=this;if(!this.changingSrc_){var n=function(e){return t.updateSourceCaches_(e)},r=this.currentSource().src,i=e.src;r&&!/^blob:/.test(r)&&/^blob:/.test(i)&&(!this.lastSource_||this.lastSource_.tech!==i&&this.lastSource_.player!==r)&&(n=function(){}),n(i),e.src||this.tech_.any(["sourceset","loadstart"],(function(e){if("sourceset"!==e.type){var n=t.techGet("currentSrc");t.lastSource_.tech=n,t.updateSourceCaches_(n)}}))}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})},n.hasStarted=function(e){if(void 0===e)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},n.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},n.handleTechRateChange_=function(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach((function(e){return e.callback(e.event)})),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},n.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting");var t=this.currentTime();this.on("timeupdate",(function n(){t!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",n))}))},n.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},n.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},n.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},n.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},n.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},n.handleTechFirstPlay_=function(){this.options_.starttime&&(Dt.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},n.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},n.handleTechEnded_=function(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},n.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},n.handleTechClick_=function(e){this.controls_&&(void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.click&&!1===this.options_.userActions.click||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.click?this.options_.userActions.click.call(this,e):this.paused()?Hr(this.play()):this.pause()))},n.handleTechDoubleClick_=function(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),(function(t){return t.contains(e.target)}))||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))},n.handleTechTap_=function(){this.userActive(!this.userActive())},n.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},n.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},n.handleTechTouchEnd_=function(e){e.cancelable&&e.preventDefault()},n.handleStageClick_=function(){this.reportUserActivity()},n.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},n.documentFullscreenChange_=function(e){var t=e.target.player;if(!t||t===this){var n=this.el(),r=l()[this.fsApi_.fullscreenElement]===n;!r&&n.matches?r=n.matches(":"+this.fsApi_.fullscreen):!r&&n.msMatchesSelector&&(r=n.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(r)}},n.handleTechFullscreenChange_=function(e,t){var n=this;t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",(function(){n.removeClass("vjs-ios-native-fs")}))),this.isFullscreen(t.isFullscreen))},n.handleTechFullscreenError_=function(e,t){this.trigger("fullscreenerror",t)},n.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},n.handleTechEnterPictureInPicture_=function(e){this.isInPictureInPicture(!0)},n.handleTechLeavePictureInPicture_=function(e){this.isInPictureInPicture(!1)},n.handleTechError_=function(){var e=this.tech_.error();this.error(e)},n.handleTechTextData_=function(){var e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)},n.getCache=function(){return this.cache_},n.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}},n.techCall_=function(e,t){this.ready((function(){if(e in Ci)return function(e,t,n,r){return t[n](e.reduce(Di(n),r))}(this.middleware_,this.tech_,e,t);if(e in Ri)return wi(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(e){throw Dt(e),e}}),!0)},n.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in Ii)return function(e,t,n){return e.reduceRight(Di(n),t[n]())}(this.middleware_,this.tech_,e);if(e in Ri)return wi(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw Dt("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",t),t;if("TypeError"===t.name)throw Dt("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",t),this.tech_.isReady_=!1,t;throw Dt(t),t}}},n.play=function(){var e=this,t=this.options_.Promise||i().Promise;return t?new t((function(t){e.play_(t)})):this.play_()},n.play_=function(e){var t=this;void 0===e&&(e=Hr),this.playCallbacks_.push(e);var n=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc())),r=Boolean(on||sn);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!n)return this.waitToPlay_=function(e){t.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(!n&&r&&this.load());var i=this.techGet_("play");r&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),null===i?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(i)},n.runPlayTerminatedQueue_=function(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach((function(e){e()}))},n.runPlayCallbacks_=function(e){var t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach((function(t){t(e)}))},n.pause=function(){this.techCall_("pause")},n.paused=function(){return!1!==this.techGet_("paused")},n.played=function(){return this.techGet_("played")||Fr(0,0)},n.scrubbing=function(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},n.currentTime=function(e){return void 0!==e?(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),void(this.cache_.initTime=0)):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_))):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},n.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},n.duration=function(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))},n.remainingTime=function(){return this.duration()-this.currentTime()},n.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},n.buffered=function(){var e=this.techGet_("buffered");return e&&e.length||(e=Fr(0,0)),e},n.bufferedPercent=function(){return Ur(this.buffered(),this.duration())},n.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),n=e.end(e.length-1);return n>t&&(n=t),n},n.volume=function(e){var t;return void 0!==e?(t=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)},n.muted=function(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)},n.defaultMuted=function(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},n.lastVolume_=function(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e},n.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},n.isFullscreen=function(e){if(void 0!==e){var t=this.isFullscreen_;return this.isFullscreen_=Boolean(e),this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_},n.requestFullscreen=function(e){var t=this.options_.Promise||i().Promise;if(t){var n=this;return new t((function(t,r){function i(){n.off("fullscreenerror",s),n.off("fullscreenchange",a)}function a(){i(),t()}function s(e,t){i(),r(t)}n.one("fullscreenchange",a),n.one("fullscreenerror",s);var o=n.requestFullscreenHelper_(e);o&&(o.then(i,i),o.then(t,r))}))}return this.requestFullscreenHelper_()},n.requestFullscreenHelper_=function(e){var t,n=this;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(t=e)),this.fsApi_.requestFullscreen){var r=this.el_[this.fsApi_.requestFullscreen](t);return r&&r.then((function(){return n.isFullscreen(!0)}),(function(){return n.isFullscreen(!1)})),r}this.tech_.supportsFullScreen()&&1==!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()},n.exitFullscreen=function(){var e=this.options_.Promise||i().Promise;if(e){var t=this;return new e((function(e,n){function r(){t.off("fullscreenerror",a),t.off("fullscreenchange",i)}function i(){r(),e()}function a(e,t){r(),n(t)}t.one("fullscreenchange",i),t.one("fullscreenerror",a);var s=t.exitFullscreenHelper_();s&&(s.then(r,r),s.then(e,n))}))}return this.exitFullscreenHelper_()},n.exitFullscreenHelper_=function(){var e=this;if(this.fsApi_.requestFullscreen){var t=l()[this.fsApi_.exitFullscreen]();return t&&Hr(t.then((function(){return e.isFullscreen(!1)}))),t}this.tech_.supportsFullScreen()&&1==!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()},n.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=l().documentElement.style.overflow,ir(l(),"keydown",this.boundFullWindowOnEscKey_),l().documentElement.style.overflow="hidden",_n(l().body,"vjs-full-window"),this.trigger("enterFullWindow")},n.fullWindowOnEscKey=function(e){d().isEventKey(e,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},n.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,ar(l(),"keydown",this.boundFullWindowOnEscKey_),l().documentElement.style.overflow=this.docOrigOverflow,Tn(l().body,"vjs-full-window"),this.trigger("exitFullWindow")},n.disablePictureInPicture=function(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")},n.isInPictureInPicture=function(e){return void 0!==e?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_},n.requestPictureInPicture=function(){if("pictureInPictureEnabled"in l()&&!1===this.disablePictureInPicture())return this.techGet_("requestPictureInPicture")},n.exitPictureInPicture=function(){if("pictureInPictureEnabled"in l())return l().exitPictureInPicture()},n.handleKeyDown=function(e){var t,n,r=this.options_.userActions;r&&r.hotkeys&&(t=this.el_.ownerDocument.activeElement,n=t.tagName.toLowerCase(),t.isContentEditable||("input"===n?-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(t.type):-1!==["textarea"].indexOf(n))||("function"==typeof r.hotkeys?r.hotkeys.call(this,e):this.handleHotkeys(e)))},n.handleHotkeys=function(e){var t=this.options_.userActions?this.options_.userActions.hotkeys:{},n=t.fullscreenKey,r=void 0===n?function(e){return d().isEventKey(e,"f")}:n,i=t.muteKey,a=void 0===i?function(e){return d().isEventKey(e,"m")}:i,s=t.playPauseKey,o=void 0===s?function(e){return d().isEventKey(e,"k")||d().isEventKey(e,"Space")}:s;if(r.call(this,e)){e.preventDefault(),e.stopPropagation();var u=xr.getComponent("FullscreenToggle");!1!==l()[this.fsApi_.fullscreenEnabled]&&u.prototype.handleClick.call(this,e)}else a.call(this,e)?(e.preventDefault(),e.stopPropagation(),xr.getComponent("MuteToggle").prototype.handleClick.call(this,e)):o.call(this,e)&&(e.preventDefault(),e.stopPropagation(),xr.getComponent("PlayToggle").prototype.handleClick.call(this,e))},n.canPlayType=function(e){for(var t,n=0,r=this.options_.techOrder;n<r.length;n++){var i=r[n],a=Ti.getTech(i);if(a||(a=xr.getComponent(i)),a){if(a.isSupported()&&(t=a.canPlayType(e)))return t}else Dt.error('The "'+i+'" tech is undefined. Skipped browser support check for that tech.')}return""},n.selectSource=function(e){var t,n=this,r=this.options_.techOrder.map((function(e){return[e,Ti.getTech(e)]})).filter((function(e){var t=e[0],n=e[1];return n?n.isSupported():(Dt.error('The "'+t+'" tech is undefined. Skipped browser support check for that tech.'),!1)})),i=function(e,t,n){var r;return e.some((function(e){return t.some((function(t){if(r=n(e,t))return!0}))})),r},a=function(e,t){var r=e[0];if(e[1].canPlaySource(t,n.options_[r.toLowerCase()]))return{source:t,tech:r}};return(this.options_.sourceOrder?i(e,r,(t=a,function(e,n){return t(n,e)})):i(r,e,a))||!1},n.handleSrc_=function(e,t){var n=this;if(void 0===e)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();var r=Mi(e);if(r.length){if(this.changingSrc_=!0,t||(this.cache_.sources=r),this.updateSourceCaches_(r[0]),Ai(this,r[0],(function(e,i){var a,s;if(n.middleware_=i,t||(n.cache_.sources=r),n.updateSourceCaches_(e),n.src_(e))return r.length>1?n.handleSrc_(r.slice(1)):(n.changingSrc_=!1,n.setTimeout((function(){this.error({code:4,message:this.options_.notSupportedMessage})}),0),void n.triggerReady());a=i,s=n.tech_,a.forEach((function(e){return e.setTech&&e.setTech(s)}))})),this.options_.retryOnError&&r.length>1){var i=function(){n.error(null),n.handleSrc_(r.slice(1),!0)},a=function(){n.off("error",i)};this.one("error",i),this.one("playing",a),this.resetRetryOnError_=function(){n.off("error",i),n.off("playing",a)}}}else this.setTimeout((function(){this.error({code:4,message:this.options_.notSupportedMessage})}),0)},n.src=function(e){return this.handleSrc_(e,!1)},n.src_=function(e){var t,n,r=this,i=this.selectSource([e]);return!i||(t=i.tech,n=this.techName_,Rr(t)!==Rr(n)?(this.changingSrc_=!0,this.loadTech_(i.tech,i.source),this.tech_.ready((function(){r.changingSrc_=!1})),!1):(this.ready((function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1}),!0),!1))},n.load=function(){this.techCall_("load")},n.reset=function(){var e=this,t=this.options_.Promise||i().Promise;this.paused()||!t?this.doReset_():Hr(this.play().then((function(){return e.doReset_()})))},n.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),mr(this)&&this.trigger("playerreset")},n.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},n.resetProgressBar_=function(){this.currentTime(0);var e=this.controlBar||{},t=e.durationDisplay,n=e.remainingTimeDisplay;t&&t.updateContent(),n&&n.updateContent()},n.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},n.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},n.currentSources=function(){var e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t},n.currentSource=function(){return this.cache_.source||{}},n.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},n.currentType=function(){return this.currentSource()&&this.currentSource().type||""},n.preload=function(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")},n.autoplay=function(e){if(void 0===e)return this.options_.autoplay||!1;var t;"string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"==typeof e?e:"play"),t=!1):this.options_.autoplay=!!e,t=void 0===t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)},n.playsinline=function(e){return void 0!==e?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},n.loop=function(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")},n.poster=function(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},n.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},n.controls=function(e){if(void 0===e)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},n.usingNativeControls=function(e){if(void 0===e)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},n.error=function(e){var t=this;if(void 0===e)return this.error_||null;if(Et("beforeerror").forEach((function(n){var r=n(t,e);Lt(r)&&!Array.isArray(r)||"string"==typeof r||"number"==typeof r||null===r?e=r:t.log.error("please return a value that MediaError expects in beforeerror hooks")})),this.options_.suppressNotSupportedError&&e&&4===e.code){var n=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],n),void this.one("loadstart",(function(){this.off(["click","touchstart"],n)}))}if(null===e)return this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new Br(e),this.addClass("vjs-error"),Dt.error("(CODE:"+this.error_.code+" "+Br.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),Et("error").forEach((function(e){return e(t,t.error_)}))},n.reportUserActivity=function(e){this.userActivity_=!0},n.userActive=function(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",(function(e){e.stopPropagation(),e.preventDefault()})),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},n.listenForUserActivity_=function(){var e,t,n,r=fr(this,this.reportUserActivity),i=function(t){r(),this.clearInterval(e)};this.on("mousedown",(function(){r(),this.clearInterval(e),e=this.setInterval(r,250)})),this.on("mousemove",(function(e){e.screenX===t&&e.screenY===n||(t=e.screenX,n=e.screenY,r())})),this.on("mouseup",i),this.on("mouseleave",i);var a,s=this.getChild("controlBar");!s||sn||Zt||(s.on("mouseenter",(function(e){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0})),s.on("mouseleave",(function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout}))),this.on("keydown",r),this.on("keyup",r),this.setInterval((function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(a);var e=this.options_.inactivityTimeout;e<=0||(a=this.setTimeout((function(){this.userActivity_||this.userActive(!1)}),e))}}),250)},n.playbackRate=function(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)},n.defaultPlaybackRate=function(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},n.isAudio=function(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e},n.enableAudioOnlyUI_=function(){var e=this;this.addClass("vjs-audio-only-mode");var t=this.children(),n=this.getChild("ControlBar"),r=n&&n.currentHeight();t.forEach((function(t){t!==n&&t.el_&&!t.hasClass("vjs-hidden")&&(t.hide(),e.audioOnlyCache_.hiddenChildren.push(t))})),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(r),this.trigger("audioonlymodechange")},n.disableAudioOnlyUI_=function(){this.removeClass("vjs-audio-only-mode"),this.audioOnlyCache_.hiddenChildren.forEach((function(e){return e.show()})),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")},n.audioOnlyMode=function(e){var t=this;if("boolean"!=typeof e||e===this.audioOnlyMode_)return this.audioOnlyMode_;this.audioOnlyMode_=e;var n=this.options_.Promise||i().Promise;if(n){if(e){var r=[];return this.isInPictureInPicture()&&r.push(this.exitPictureInPicture()),this.isFullscreen()&&r.push(this.exitFullscreen()),this.audioPosterMode()&&r.push(this.audioPosterMode(!1)),n.all(r).then((function(){return t.enableAudioOnlyUI_()}))}return n.resolve().then((function(){return t.disableAudioOnlyUI_()}))}e?(this.isInPictureInPicture()&&this.exitPictureInPicture(),this.isFullscreen()&&this.exitFullscreen(),this.enableAudioOnlyUI_()):this.disableAudioOnlyUI_()},n.enablePosterModeUI_=function(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},n.disablePosterModeUI_=function(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},n.audioPosterMode=function(e){var t=this;if("boolean"!=typeof e||e===this.audioPosterMode_)return this.audioPosterMode_;this.audioPosterMode_=e;var n=this.options_.Promise||i().Promise;return n?e?this.audioOnlyMode()?this.audioOnlyMode(!1).then((function(){t.enablePosterModeUI_()})):n.resolve().then((function(){t.enablePosterModeUI_()})):n.resolve().then((function(){t.disablePosterModeUI_()})):e?(this.audioOnlyMode()&&this.audioOnlyMode(!1),void this.enablePosterModeUI_()):void this.disablePosterModeUI_()},n.addTextTrack=function(e,t,n){if(this.tech_)return this.tech_.addTextTrack(e,t,n)},n.addRemoteTextTrack=function(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)},n.removeRemoteTextTrack=function(e){void 0===e&&(e={});var t=e.track;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)},n.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},n.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},n.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},n.language=function(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),mr(this)&&this.trigger("languagechange"))},n.languages=function(){return Dr(t.prototype.options_.languages,this.languages_)},n.toJSON=function(){var e=Dr(this.options_),t=e.tracks;e.tracks=[];for(var n=0;n<t.length;n++){var r=t[n];(r=Dr(r)).player=void 0,e.tracks[n]=r}return e},n.createModal=function(e,t){var n=this;(t=t||{}).content=e||"";var r=new Yr(this,t);return this.addChild(r),r.on("dispose",(function(){n.removeChild(r)})),r.open(),r},n.updateCurrentBreakpoint_=function(){if(this.responsive())for(var e=this.currentBreakpoint(),t=this.currentWidth(),n=0;n<Ts.length;n++){var r=Ts[n];if(t<=this.breakpoints_[r]){if(e===r)return;e&&this.removeClass(Es[e]),this.addClass(Es[r]),this.breakpoint_=r;break}}},n.removeCurrentBreakpoint_=function(){var e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)},n.breakpoints=function(e){return void 0===e||(this.breakpoint_="",this.breakpoints_=xt({},bs,e),this.updateCurrentBreakpoint_()),xt(this.breakpoints_)},n.responsive=function(e){return void 0===e?this.responsive_:(e=Boolean(e))!==this.responsive_?(this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0},n.currentBreakpoint=function(){return this.breakpoint_},n.currentBreakpointClass=function(){return Es[this.breakpoint_]||""},n.loadMedia=function(e,t){var n=this;if(e&&"object"==typeof e){this.reset(),this.cache_.media=Dr(e);var r=this.cache_.media,i=r.artwork,a=r.poster,s=r.src,o=r.textTracks;!i&&a&&(this.cache_.media.artwork=[{src:a,type:Pi(a)}]),s&&this.src(s),a&&this.poster(a),Array.isArray(o)&&o.forEach((function(e){return n.addRemoteTextTrack(e,!1)})),this.ready(t)}},n.getMedia=function(){if(!this.cache_.media){var e=this.poster(),t={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),(function(e){return{kind:e.kind,label:e.label,language:e.language,src:e.src}}))};return e&&(t.poster=e,t.artwork=[{src:t.poster,type:Pi(t.poster)}]),t}return Dr(this.cache_.media)},t.getTagSettings=function(e){var t={sources:[],tracks:[]},n=Sn(e),r=n["data-setup"];if(vn(e,"vjs-fill")&&(n.fill=!0),vn(e,"vjs-fluid")&&(n.fluid=!0),null!==r){var i=m()(r||"{}"),a=i[0],s=i[1];a&&Dt.error(a),xt(n,s)}if(xt(t,n),e.hasChildNodes())for(var o=e.childNodes,l=0,u=o.length;l<u;l++){var c=o[l],d=c.nodeName.toLowerCase();"source"===d?t.sources.push(Sn(c)):"track"===d&&t.tracks.push(Sn(c))}return t},n.flexNotSupported_=function(){var e=l().createElement("i");return!("flexBasis"in e.style||"webkitFlexBasis"in e.style||"mozFlexBasis"in e.style||"msFlexBasis"in e.style||"msFlexOrder"in e.style)},n.debug=function(e){if(void 0===e)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)},n.playbackRates=function(e){if(void 0===e)return this.cache_.playbackRates;Array.isArray(e)&&e.every((function(e){return"number"==typeof e}))&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))},t}(xr);_i.names.forEach((function(e){var t=_i[e];Ss.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}})),Ss.prototype.crossorigin=Ss.prototype.crossOrigin,Ss.players={};var As=i().navigator;Ss.prototype.options_={techOrder:Ti.defaultTechOrder_,html5:{},inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:As&&(As.languages&&As.languages[0]||As.userLanguage||As.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1},["ended","seeking","seekable","networkState","readyState"].forEach((function(e){Ss.prototype[e]=function(){return this.techGet_(e)}})),vs.forEach((function(e){Ss.prototype["handleTech"+Rr(e)+"_"]=function(){return this.trigger(e)}})),xr.registerComponent("Player",Ss);var ws="plugin",Is="activePlugins_",Cs={},Rs=function(e){return Cs.hasOwnProperty(e)},Ds=function(e){return Rs(e)?Cs[e]:void 0},Ns=function(e,t){e[Is]=e[Is]||{},e[Is][t]=!0},Os=function(e,t,n){var r=(n?"before":"")+"pluginsetup";e.trigger(r,t),e.trigger(r+":"+t.name,t)},Ps=function(e,t){return t.prototype.name=e,function(){Os(this,{name:e,plugin:t,instance:null},!0);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];var a=E(t,[this].concat(r));return this[e]=function(){return a},Os(this,a.getEventHash()),a}},Ms=function(){function e(t){if(this.constructor===e)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=t,this.log||(this.log=this.player.log.createLogger(this.name)),Ar(this),delete this.trigger,Ir(this,this.constructor.defaultState),Ns(t,this.name),this.dispose=this.dispose.bind(this),t.on("dispose",this.dispose)}var t=e.prototype;return t.version=function(){return this.constructor.VERSION},t.getEventHash=function(e){return void 0===e&&(e={}),e.name=this.name,e.plugin=this.constructor,e.instance=this,e},t.trigger=function(e,t){return void 0===t&&(t={}),sr(this.eventBusEl_,e,this.getEventHash(t))},t.handleStateChanged=function(e){},t.dispose=function(){var e=this.name,t=this.player;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[Is][e]=!1,this.player=this.state=null,t[e]=Ps(e,Cs[e])},e.isBasic=function(t){var n="string"==typeof t?Ds(t):t;return"function"==typeof n&&!e.prototype.isPrototypeOf(n.prototype)},e.registerPlugin=function(t,n){if("string"!=typeof t)throw new Error('Illegal plugin name, "'+t+'", must be a string, was '+typeof t+".");if(Rs(t))Dt.warn('A plugin named "'+t+'" already exists. You may want to avoid re-registering plugins!');else if(Ss.prototype.hasOwnProperty(t))throw new Error('Illegal plugin name, "'+t+'", cannot share a name with an existing player method!');if("function"!=typeof n)throw new Error('Illegal plugin for "'+t+'", must be a function, was '+typeof n+".");return Cs[t]=n,t!==ws&&(e.isBasic(n)?Ss.prototype[t]=function(e,t){var n=function(){Os(this,{name:e,plugin:t,instance:null},!0);var n=t.apply(this,arguments);return Ns(this,e),Os(this,{name:e,plugin:t,instance:n}),n};return Object.keys(t).forEach((function(e){n[e]=t[e]})),n}(t,n):Ss.prototype[t]=Ps(t,n)),n},e.deregisterPlugin=function(e){if(e===ws)throw new Error("Cannot de-register base plugin.");Rs(e)&&(delete Cs[e],delete Ss.prototype[e])},e.getPlugins=function(e){var t;return void 0===e&&(e=Object.keys(Cs)),e.forEach((function(e){var n=Ds(e);n&&((t=t||{})[e]=n)})),t},e.getPluginVersion=function(e){var t=Ds(e);return t&&t.VERSION||""},e}();Ms.getPlugin=Ds,Ms.BASE_PLUGIN_NAME=ws,Ms.registerPlugin(ws,Ms),Ss.prototype.usingPlugin=function(e){return!!this[Is]&&!0===this[Is][e]},Ss.prototype.hasPlugin=function(e){return!!Rs(e)};var xs=!1,Ls=function(e){return 0===e.indexOf("#")?e.slice(1):e};function ks(e,t,n){var r=ks.getPlayer(e);if(r)return t&&Dt.warn('Player "'+e+'" is already initialised. Options will not be applied.'),n&&r.ready(n),r;var i="string"==typeof e?Bn("#"+Ls(e)):e;if(!fn(i))throw new TypeError("The element or ID supplied is not valid. (videojs)");i.ownerDocument.defaultView&&i.ownerDocument.body.contains(i)||Dt.warn("The element supplied is not included in the DOM"),!0===(t=t||{}).restoreEl&&(t.restoreEl=(i.parentNode&&i.parentNode.hasAttribute("data-vjs-player")?i.parentNode:i).cloneNode(!0)),Et("beforesetup").forEach((function(e){var n=e(i,Dr(t));Lt(n)&&!Array.isArray(n)?t=Dr(t,n):Dt.error("please return an object in beforesetup hooks")}));var a=xr.getComponent("Player");return r=new a(i,t,n),Et("setup").forEach((function(e){return e(r)})),r}if(ks.hooks_=Tt,ks.hooks=Et,ks.hook=function(e,t){Et(e,t)},ks.hookOnce=function(e,t){Et(e,[].concat(t).map((function(t){return function n(){return bt(e,n),t.apply(void 0,arguments)}})))},ks.removeHook=bt,!0!==i().VIDEOJS_NO_DYNAMIC_STYLE&&dn()){var Fs=Bn(".vjs-styles-defaults");if(!Fs){Fs=Kn("vjs-styles-defaults");var Us=Bn("head");Us&&Us.insertBefore(Fs,Us.firstChild),zn(Fs,"\n      .video-js {\n        width: 300px;\n        height: 150px;\n      }\n\n      .vjs-fluid:not(.vjs-audio-only-mode) {\n        padding-top: 56.25%\n      }\n    ")}}Vn(1,ks),ks.VERSION=_t,ks.options=Ss.prototype.options_,ks.getPlayers=function(){return Ss.players},ks.getPlayer=function(e){var t,n=Ss.players;if("string"==typeof e){var r=Ls(e),i=n[r];if(i)return i;t=Bn("#"+r)}else t=e;if(fn(t)){var a=t,s=a.player,o=a.playerId;if(s||n[o])return s||n[o]}},ks.getAllPlayers=function(){return Object.keys(Ss.players).map((function(e){return Ss.players[e]})).filter(Boolean)},ks.players=Ss.players,ks.getComponent=xr.getComponent,ks.registerComponent=function(e,t){Ti.isTech(t)&&Dt.warn("The "+e+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),xr.registerComponent.call(xr,e,t)},ks.getTech=Ti.getTech,ks.registerTech=Ti.registerTech,ks.use=function(e,t){Ei[e]=Ei[e]||[],Ei[e].push(t)},Object.defineProperty(ks,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(ks.middleware,"TERMINATOR",{value:Si,writeable:!1,enumerable:!0}),ks.browser=ln,ks.TOUCH_ENABLED=nn,ks.extend=function(e,t){void 0===t&&(t={}),xs||(Dt.warn("videojs.extend is deprecated as of Video.js 7.22.0 and will be removed in Video.js 8.0.0"),xs=!0);var n=function(){e.apply(this,arguments)},r={};for(var i in"object"==typeof t?(t.constructor!==Object.prototype.constructor&&(n=t.constructor),r=t):"function"==typeof t&&(n=t),function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(n,e),e&&(n.super_=e),r)r.hasOwnProperty(i)&&(n.prototype[i]=r[i]);return n},ks.mergeOptions=Dr,ks.bind=fr,ks.registerPlugin=Ms.registerPlugin,ks.deregisterPlugin=Ms.deregisterPlugin,ks.plugin=function(e,t){return Dt.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Ms.registerPlugin(e,t)},ks.getPlugins=Ms.getPlugins,ks.getPlugin=Ms.getPlugin,ks.getPluginVersion=Ms.getPluginVersion,ks.addLanguage=function(e,t){var n;return e=(""+e).toLowerCase(),ks.options.languages=Dr(ks.options.languages,((n={})[e]=t,n)),ks.options.languages[e]},ks.log=Dt,ks.createLogger=Nt,ks.createTimeRange=ks.createTimeRanges=Fr,ks.formatTime=Xi,ks.setFormatTime=function(e){Wi=e},ks.resetFormatTime=function(){Wi=zi},ks.parseUrl=si,ks.isCrossOrigin=ui,ks.EventTarget=pr,ks.on=ir,ks.one=or,ks.off=ar,ks.trigger=sr,ks.xhr=v(),ks.TextTrack=hi,ks.AudioTrack=pi,ks.VideoTrack=gi,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach((function(e){ks[e]=function(){return Dt.warn("videojs."+e+"() is deprecated; use videojs.dom."+e+"() instead"),qn[e].apply(null,arguments)}})),ks.computedStyle=Ft,ks.dom=qn,ks.url=ci,ks.defineLazyProperty=ms,ks.addLanguage("en",{"Non-Fullscreen":"Exit Fullscreen"});var Bs=A,js=function(e,t,n){return e&&n&&n.responseURL&&t!==n.responseURL?n.responseURL:t},qs=function(e){return ks.log.debug?ks.log.debug.bind(ks,"VHS:",e+" >"):function(){}},Hs=1/30,Gs=.1,Vs=function(e,t){var n,r=[];if(e&&e.length)for(n=0;n<e.length;n++)t(e.start(n),e.end(n))&&r.push([e.start(n),e.end(n)]);return ks.createTimeRanges(r)},Ys=function(e,t){return Vs(e,(function(e,n){return e-Gs<=t&&n+Gs>=t}))},Zs=function(e,t){return Vs(e,(function(e){return e-Hs>=t}))},Ks=function(e){var t=[];if(!e||!e.length)return"";for(var n=0;n<e.length;n++)t.push(e.start(n)+" => "+e.end(n));return t.join(", ")},zs=function(e){for(var t=[],n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t},Ws=function(e){if(e&&e.length&&e.end)return e.end(e.length-1)},Xs=function(e,t){var n=0;if(!e||!e.length)return n;for(var r=0;r<e.length;r++){var i=e.start(r),a=e.end(r);t>a||(n+=t>i&&t<=a?a-t:a-i)}return n},$s=ks.createTimeRange,Qs=function(e,t){if(!t.preload)return t.duration;var n=0;return(t.parts||[]).forEach((function(e){n+=e.duration})),(t.preloadHints||[]).forEach((function(t){"PART"===t.type&&(n+=e.partTargetDuration)})),n},Js=function(e){return(e.segments||[]).reduce((function(e,t,n){return t.parts?t.parts.forEach((function(r,i){e.push({duration:r.duration,segmentIndex:n,partIndex:i,part:r,segment:t})})):e.push({duration:t.duration,segmentIndex:n,partIndex:null,segment:t,part:null}),e}),[])},eo=function(e){var t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},to=function(e){var t=e.preloadSegment;if(t){var n=t.parts;return(t.preloadHints||[]).reduce((function(e,t){return e+("PART"===t.type?1:0)}),0)+(n&&n.length?n.length:0)}},no=function(e,t){if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;var n=eo(t).length>0;return n&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:n&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},ro=function(e,t,n){if(void 0===t&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;var r=function(e,t){var n=0,r=t-e.mediaSequence,i=e.segments[r];if(i){if(void 0!==i.start)return{result:i.start,precise:!0};if(void 0!==i.end)return{result:i.end-i.duration,precise:!0}}for(;r--;){if(void 0!==(i=e.segments[r]).end)return{result:n+i.end,precise:!0};if(n+=Qs(e,i),void 0!==i.start)return{result:n+i.start,precise:!0}}return{result:n,precise:!1}}(e,t);if(r.precise)return r.result;var i=function(e,t){for(var n,r=0,i=t-e.mediaSequence;i<e.segments.length;i++){if(void 0!==(n=e.segments[i]).start)return{result:n.start-r,precise:!0};if(r+=Qs(e,n),void 0!==n.end)return{result:n.end-r,precise:!0}}return{result:-1,precise:!1}}(e,t);return i.precise?i.result:r.result+n},io=function(e,t,n){if(!e)return 0;if("number"!=typeof n&&(n=0),void 0===t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return i()[1/0]}return ro(e,t,n)},ao=function(e){var t=e.defaultDuration,n=e.durationList,r=e.startIndex,i=e.endIndex,a=0;if(r>i){var s=[i,r];r=s[0],i=s[1]}if(r<0){for(var o=r;o<Math.min(0,i);o++)a+=t;r=0}for(var l=r;l<i;l++)a+=n[l].duration;return a},so=function(e,t,n,r){if(!e||!e.segments)return null;if(e.endList)return io(e);if(null===t)return null;t=t||0;var i=ro(e,e.mediaSequence+e.segments.length,t);return n&&(i-=r="number"==typeof r?r:no(null,e)),Math.max(0,i)},oo=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},lo=function(e){return e.excludeUntil&&e.excludeUntil===1/0},uo=function(e){var t=oo(e);return!e.disabled&&!t},co=function(e,t){return t.attributes&&t.attributes[e]},fo=function(e,t){if(1===e.playlists.length)return!0;var n=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter((function(e){return!!uo(e)&&(e.attributes.BANDWIDTH||0)<n})).length},ho=function(e,t){return!(!e&&!t||!e&&t||e&&!t||e!==t&&(!e.id||!t.id||e.id!==t.id)&&(!e.resolvedUri||!t.resolvedUri||e.resolvedUri!==t.resolvedUri)&&(!e.uri||!t.uri||e.uri!==t.uri))},po=function(e,t){var n=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{},r=!1;for(var i in n){for(var a in n[i])if(r=t(n[i][a]))break;if(r)break}return!!r},go=function(e){if(!e||!e.playlists||!e.playlists.length)return po(e,(function(e){return e.playlists&&e.playlists.length||e.uri}));for(var t=function(t){var n=e.playlists[t],r=n.attributes&&n.attributes.CODECS;return r&&r.split(",").every((function(e){return q(e)}))||po(e,(function(e){return ho(n,e)}))?"continue":{v:!1}},n=0;n<e.playlists.length;n++){var r=t(n);if("continue"!==r&&"object"==typeof r)return r.v}return!0},mo={liveEdgeDelay:no,duration:io,seekable:function(e,t,n){var r=t||0,i=so(e,t,!0,n);return null===i?$s():$s(r,i)},getMediaInfoForTime:function(e){for(var t=e.playlist,n=e.currentTime,r=e.startingSegmentIndex,i=e.startingPartIndex,a=e.startTime,s=e.experimentalExactManifestTimings,o=n-a,l=Js(t),u=0,c=0;c<l.length;c++){var d=l[c];if(r===d.segmentIndex&&("number"!=typeof i||"number"!=typeof d.partIndex||i===d.partIndex)){u=c;break}}if(o<0){if(u>0)for(var f=u-1;f>=0;f--){var h=l[f];if(o+=h.duration,s){if(o<0)continue}else if(o+Hs<=0)continue;return{partIndex:h.partIndex,segmentIndex:h.segmentIndex,startTime:a-ao({defaultDuration:t.targetDuration,durationList:l,startIndex:u,endIndex:f})}}return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:n}}if(u<0){for(var p=u;p<0;p++)if((o-=t.targetDuration)<0)return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:n};u=0}for(var g=u;g<l.length;g++){var m=l[g];if(o-=m.duration,s){if(o>0)continue}else if(o-Hs>=0)continue;return{partIndex:m.partIndex,segmentIndex:m.segmentIndex,startTime:a+ao({defaultDuration:t.targetDuration,durationList:l,startIndex:u,endIndex:g})}}return{segmentIndex:l[l.length-1].segmentIndex,partIndex:l[l.length-1].partIndex,startTime:n}},isEnabled:uo,isDisabled:function(e){return e.disabled},isBlacklisted:oo,isIncompatible:lo,playlistEnd:so,isAes:function(e){for(var t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},hasAttribute:co,estimateSegmentRequestTime:function(e,t,n,r){return void 0===r&&(r=0),co("BANDWIDTH",n)?(e*n.attributes.BANDWIDTH-8*r)/t:NaN},isLowestEnabledRendition:fo,isAudioOnly:go,playlistMatch:ho,segmentDurationWithParts:Qs},yo=ks.log,vo=function(e,t){return e+"-"+t},_o=function(e,t,n){return"placeholder-uri-"+e+"-"+t+"-"+n},To=function(e,t){e.mediaGroups&&["AUDIO","SUBTITLES"].forEach((function(n){if(e.mediaGroups[n])for(var r in e.mediaGroups[n])for(var i in e.mediaGroups[n][r]){var a=e.mediaGroups[n][r][i];t(a,n,r,i)}}))},Eo=function(e){var t=e.playlist,n=e.uri,r=e.id;t.id=r,t.playlistErrors_=0,n&&(t.uri=n),t.attributes=t.attributes||{}},bo=function(e,t,n){void 0===n&&(n=_o),e.uri=t;for(var r=0;r<e.playlists.length;r++)if(!e.playlists[r].uri){var i="placeholder-uri-"+r;e.playlists[r].uri=i}var a=go(e);To(e,(function(t,r,i,s){if(!t.playlists||!t.playlists.length){if(a&&"AUDIO"===r&&!t.uri)for(var o=0;o<e.playlists.length;o++){var l=e.playlists[o];if(l.attributes&&l.attributes.AUDIO&&l.attributes.AUDIO===i)return}t.playlists=[(0,u.Z)({},t)]}t.playlists.forEach((function(t,a){var o=n(r,i,s,t),l=vo(a,o);t.uri?t.resolvedUri=t.resolvedUri||Bs(e.uri,t.uri):(t.uri=0===a?o:l,t.resolvedUri=t.uri),t.id=t.id||l,t.attributes=t.attributes||{},e.playlists[t.id]=t,e.playlists[t.uri]=t}))})),function(e){for(var t=e.playlists.length;t--;){var n=e.playlists[t];Eo({playlist:n,id:vo(t,n.uri)}),n.resolvedUri=Bs(e.uri,n.uri),e.playlists[n.id]=n,e.playlists[n.uri]=n,n.attributes.BANDWIDTH||yo.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}}(e),function(e){To(e,(function(t){t.uri&&(t.resolvedUri=Bs(e.uri,t.uri))}))}(e)},So=ks.mergeOptions,Ao=ks.EventTarget,wo=function(e,t){if(!e)return t;var n=So(e,t);if(e.preloadHints&&!t.preloadHints&&delete n.preloadHints,e.parts&&!t.parts)delete n.parts;else if(e.parts&&t.parts)for(var r=0;r<t.parts.length;r++)e.parts&&e.parts[r]&&(n.parts[r]=So(e.parts[r],t.parts[r]));return!e.skipped&&t.skipped&&(n.skipped=!1),e.preload&&!t.preload&&(n.preload=!1),n},Io=function(e,t){!e.resolvedUri&&e.uri&&(e.resolvedUri=Bs(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=Bs(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=Bs(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=Bs(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach((function(e){e.resolvedUri||(e.resolvedUri=Bs(t,e.uri))})),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach((function(e){e.resolvedUri||(e.resolvedUri=Bs(t,e.uri))}))},Co=function(e){var t=e.segments||[],n=e.preloadSegment;if(n&&n.parts&&n.parts.length){if(n.preloadHints)for(var r=0;r<n.preloadHints.length;r++)if("MAP"===n.preloadHints[r].type)return t;n.duration=e.targetDuration,n.preload=!0,t.push(n)}return t},Ro=function(e,t){return e===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence&&e.preloadSegment===t.preloadSegment},Do=function(e,t,n){void 0===n&&(n=Ro);var r=So(e,{}),i=r.playlists[t.id];if(!i)return null;if(n(i,t))return null;t.segments=Co(t);var a=So(i,t);if(a.preloadSegment&&!t.preloadSegment&&delete a.preloadSegment,i.segments){if(t.skip){t.segments=t.segments||[];for(var s=0;s<t.skip.skippedSegments;s++)t.segments.unshift({skipped:!0})}a.segments=function(e,t,n){var r=e.slice(),i=t.slice();n=n||0;for(var a,s=[],o=0;o<i.length;o++){var l=r[o+n],u=i[o];l?(a=l.map||a,s.push(wo(l,u))):(a&&!u.map&&(u.map=a),s.push(u))}return s}(i.segments,t.segments,t.mediaSequence-i.mediaSequence)}a.segments.forEach((function(e){Io(e,a.resolvedUri)}));for(var o=0;o<r.playlists.length;o++)r.playlists[o].id===t.id&&(r.playlists[o]=a);return r.playlists[t.id]=a,r.playlists[t.uri]=a,To(e,(function(e,n,r,i){if(e.playlists)for(var s=0;s<e.playlists.length;s++)t.id===e.playlists[s].id&&(e.playlists[s]=a)})),r},No=function(e,t){var n=e.segments||[],r=n[n.length-1],i=r&&r.parts&&r.parts[r.parts.length-1],a=i&&i.duration||r&&r.duration;return t&&a?1e3*a:500*(e.partTargetDuration||e.targetDuration||10)},Oo=function(e){function t(t,n,r){var i;if(void 0===r&&(r={}),i=e.call(this)||this,!t)throw new Error("A non-empty playlist URL or object is required");i.logger_=qs("PlaylistLoader");var a=r,s=a.withCredentials,o=void 0!==s&&s,l=a.handleManifestRedirects,u=void 0!==l&&l;i.src=t,i.vhs_=n,i.withCredentials=o,i.handleManifestRedirects=u;var c=n.options_;return i.customTagParsers=c&&c.customTagParsers||[],i.customTagMappers=c&&c.customTagMappers||[],i.experimentalLLHLS=c&&c.experimentalLLHLS||!1,ks.browser.IE_VERSION&&(i.experimentalLLHLS=!1),i.state="HAVE_NOTHING",i.handleMediaupdatetimeout_=i.handleMediaupdatetimeout_.bind(f(i)),i.on("mediaupdatetimeout",i.handleMediaupdatetimeout_),i}p(t,e);var n=t.prototype;return n.handleMediaupdatetimeout_=function(){var e=this;if("HAVE_METADATA"===this.state){var t=this.media(),n=Bs(this.master.uri,t.uri);this.experimentalLLHLS&&(n=function(e,t){if(t.endList||!t.serverControl)return e;var n={};if(t.serverControl.canBlockReload){var r=t.preloadSegment,a=t.mediaSequence+t.segments.length;if(r){var s=r.parts||[],o=to(t)-1;o>-1&&o!==s.length-1&&(n._HLS_part=o),(o>-1||s.length)&&a--}n._HLS_msn=a}if(t.serverControl&&t.serverControl.canSkipUntil&&(n._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(n).length){var l=new(i().URL)(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach((function(e){n.hasOwnProperty(e)&&l.searchParams.set(e,n[e])})),e=l.toString()}return e}(n,t)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:n,withCredentials:this.withCredentials},(function(t,n){if(e.request)return t?e.playlistRequestError(e.request,e.media(),"HAVE_METADATA"):void e.haveMetadata({playlistString:e.request.responseText,url:e.media().uri,id:e.media().id})}))}},n.playlistRequestError=function(e,t,n){var r=t.uri,i=t.id;this.request=null,n&&(this.state=n),this.error={playlist:this.master.playlists[i],status:e.status,message:"HLS playlist request error at URL: "+r+".",responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error")},n.parseManifest_=function(e){var t=this,n=e.url;return function(e){var t=e.onwarn,n=e.oninfo,r=e.manifestString,i=e.customTagParsers,a=void 0===i?[]:i,s=e.customTagMappers,o=void 0===s?[]:s,l=e.experimentalLLHLS,u=new L;t&&u.on("warn",t),n&&u.on("info",n),a.forEach((function(e){return u.addParser(e)})),o.forEach((function(e){return u.addTagMapper(e)})),u.push(r),u.end();var c=u.manifest;if(l||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach((function(e){c.hasOwnProperty(e)&&delete c[e]})),c.segments&&c.segments.forEach((function(e){["parts","preloadHints"].forEach((function(t){e.hasOwnProperty(t)&&delete e[t]}))}))),!c.targetDuration){var d=10;c.segments&&c.segments.length&&(d=c.segments.reduce((function(e,t){return Math.max(e,t.duration)}),0)),t&&t("manifest has no targetDuration defaulting to "+d),c.targetDuration=d}var f=eo(c);if(f.length&&!c.partTargetDuration){var h=f.reduce((function(e,t){return Math.max(e,t.duration)}),0);t&&(t("manifest has no partTargetDuration defaulting to "+h),yo.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),c.partTargetDuration=h}return c}({onwarn:function(e){var r=e.message;return t.logger_("m3u8-parser warn for "+n+": "+r)},oninfo:function(e){var r=e.message;return t.logger_("m3u8-parser info for "+n+": "+r)},manifestString:e.manifestString,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},n.haveMetadata=function(e){var t=e.playlistString,n=e.playlistObject,r=e.url,i=e.id;this.request=null,this.state="HAVE_METADATA";var a=n||this.parseManifest_({url:r,manifestString:t});a.lastRequest=Date.now(),Eo({playlist:a,uri:r,id:i});var s=Do(this.master,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,s?(this.master=s,this.media_=this.master.playlists[i]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(No(this.media(),!!s)),this.trigger("loadedplaylist")},n.dispose=function(){this.trigger("dispose"),this.stopRequest(),i().clearTimeout(this.mediaUpdateTimeout),i().clearTimeout(this.finalRenditionTimeout),this.off()},n.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},n.media=function(e,t){var n=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"==typeof e){if(!this.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.master.playlists[e]}if(i().clearTimeout(this.finalRenditionTimeout),t){var r=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=i().setTimeout(this.media.bind(this,e,!1),r)}else{var a=this.state,s=!this.media_||e.id!==this.media_.id,o=this.master.playlists[e.id];if(o&&o.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(s&&(this.trigger("mediachanging"),"HAVE_MASTER"===a?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(No(e,!0)),s){if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},(function(t,r){if(n.request){if(e.lastRequest=Date.now(),e.resolvedUri=js(n.handleManifestRedirects,e.resolvedUri,r),t)return n.playlistRequestError(n.request,e,a);n.haveMetadata({playlistString:r.responseText,url:e.uri,id:e.id}),"HAVE_MASTER"===a?n.trigger("loadedmetadata"):n.trigger("mediachange")}}))}}},n.pause=function(){this.mediaUpdateTimeout&&(i().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")},n.load=function(e){var t=this;this.mediaUpdateTimeout&&(i().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var n=this.media();if(e){var r=n?(n.partTargetDuration||n.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=i().setTimeout((function(){t.mediaUpdateTimeout=null,t.load()}),r)}else this.started?n&&!n.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()},n.updateMediaUpdateTimeout_=function(e){var t=this;this.mediaUpdateTimeout&&(i().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=i().setTimeout((function(){t.mediaUpdateTimeout=null,t.trigger("mediaupdatetimeout"),t.updateMediaUpdateTimeout_(e)}),e))},n.start=function(){var e=this;if(this.started=!0,"object"==typeof this.src)return this.src.uri||(this.src.uri=i().location.href),this.src.resolvedUri=this.src.uri,void setTimeout((function(){e.setupInitialPlaylist(e.src)}),0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},(function(t,n){if(e.request){if(e.request=null,t)return e.error={status:n.status,message:"HLS playlist request error at URL: "+e.src+".",responseText:n.responseText,code:2},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");e.src=js(e.handleManifestRedirects,e.src,n);var r=e.parseManifest_({manifestString:n.responseText,url:e.src});e.setupInitialPlaylist(r)}}))},n.srcUri=function(){return"string"==typeof this.src?this.src:this.src.uri},n.setupInitialPlaylist=function(e){if(this.state="HAVE_MASTER",e.playlists)return this.master=e,bo(this.master,this.srcUri()),e.playlists.forEach((function(e){e.segments=Co(e),e.segments.forEach((function(t){Io(t,e.resolvedUri)}))})),this.trigger("loadedplaylist"),void(this.request||this.media(this.master.playlists[0]));var t=this.srcUri()||i().location.href;this.master=function(e,t){var n=vo(0,t),r={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:i().location.href,resolvedUri:i().location.href,playlists:[{uri:t,id:n,resolvedUri:t,attributes:{}}]};return r.playlists[n]=r.playlists[0],r.playlists[t]=r.playlists[0],r}(0,t),this.haveMetadata({playlistObject:e,url:t,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},t}(Ao),Po=ks.xhr,Mo=ks.mergeOptions,xo=function(e,t,n,r){var i="arraybuffer"===e.responseType?e.response:e.responseText;!t&&i&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=i.byteLength||i.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),n.headers&&(e.responseHeaders=n.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),t||e.aborted||200===n.statusCode||206===n.statusCode||0===n.statusCode||(t=new Error("XHR Failed with a response of: "+(e&&(i||e.responseText)))),r(t,e)},Lo=function(){var e=function e(t,n){t=Mo({timeout:45e3},t);var r=e.beforeRequest||ks.Vhs.xhr.beforeRequest;if(r&&"function"==typeof r){var i=r(t);i&&(t=i)}var a=(!0===ks.Vhs.xhr.original?Po:ks.Vhs.xhr)(t,(function(e,t){return xo(a,e,t,n)})),s=a.abort;return a.abort=function(){return a.aborted=!0,s.apply(a,arguments)},a.uri=t.uri,a.requestTime=Date.now(),a};return e.original=!0,e},ko=function(e){var t,n={};return e.byterange&&(n.Range="bytes="+(t=e.byterange).offset+"-"+("bigint"==typeof t.offset||"bigint"==typeof t.length?i().BigInt(t.offset)+i().BigInt(t.length)-i().BigInt(1):t.offset+t.length-1)),n},Fo=function(e,t){return e.start(t)+"-"+e.end(t)},Uo=function(e,t){var n=e.toString(16);return"00".substring(0,2-n.length)+n+(t%2?" ":"")},Bo=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},jo=function(e){var t={};return Object.keys(e).forEach((function(n){var r=e[n];W(r)?t[n]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:t[n]=r})),t},qo=function(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},Ho=function(e){return e.resolvedUri},Go=function(e){for(var t=Array.prototype.slice.call(e),n=16,r="",i=0;i<t.length/n;i++)r+=t.slice(i*n,i*n+n).map(Uo).join("")+" "+t.slice(i*n,i*n+n).map(Bo).join("")+"\n";return r},Vo=Object.freeze({__proto__:null,createTransferableMessage:jo,initSegmentId:qo,segmentKeyId:Ho,hexDump:Go,tagDump:function(e){var t=e.bytes;return Go(t)},textRanges:function(e){var t,n="";for(t=0;t<e.length;t++)n+=Fo(e,t)+" ";return n}}),Yo=function e(t){var n=t.programTime,r=t.playlist,i=t.retryCount,a=void 0===i?2:i,s=t.seekTo,o=t.pauseAfterSeek,l=void 0===o||o,u=t.tech,c=t.callback;if(!c)throw new Error("seekToProgramTime: callback must be provided");if(void 0===n||!r||!s)return c({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!r.endList&&!u.hasStarted_)return c({message:"player must be playing a live stream to start buffering"});if(!function(e){if(!e.segments||0===e.segments.length)return!1;for(var t=0;t<e.segments.length;t++)if(!e.segments[t].dateTimeObject)return!1;return!0}(r))return c({message:"programDateTime tags must be provided in the manifest "+r.resolvedUri});var d=function(e,t){var n;try{n=new Date(e)}catch(e){return null}if(!t||!t.segments||0===t.segments.length)return null;var r=t.segments[0];if(n<r.dateTimeObject)return null;for(var i=0;i<t.segments.length-1&&(r=t.segments[i],!(n<t.segments[i+1].dateTimeObject));i++);var a,s=t.segments[t.segments.length-1],o=s.dateTimeObject,l=s.videoTimingInfo?(a=s.videoTimingInfo).transmuxedPresentationEnd-a.transmuxedPresentationStart-a.transmuxerPrependedSeconds:s.duration+.25*s.duration;return n>new Date(o.getTime()+1e3*l)?null:(n>o&&(r=s),{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:mo.duration(t,t.mediaSequence+t.segments.indexOf(r)),type:r.videoTimingInfo?"accurate":"estimate"})}(n,r);if(!d)return c({message:n+" was not found in the stream"});var f=d.segment,h=function(e,t){var n,r;try{n=new Date(e),r=new Date(t)}catch(e){}var i=n.getTime();return(r.getTime()-i)/1e3}(f.dateTimeObject,n);if("estimate"===d.type)return 0===a?c({message:n+" is not buffered yet. Try again"}):(s(d.estimatedStart+h),void u.one("seeked",(function(){e({programTime:n,playlist:r,retryCount:a-1,seekTo:s,pauseAfterSeek:l,tech:u,callback:c})})));var p=f.start+h;u.one("seeked",(function(){return c(null,u.currentTime())})),l&&u.pause(),s(p)},Zo=function(e,t){if(4===e.readyState)return t()},Ko=ks.EventTarget,zo=ks.mergeOptions,Wo=function(e,t){if(!Ro(e,t))return!1;if(e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length))return!1;if(!e.sidx&&t.sidx||e.sidx&&!t.sidx)return!1;if(e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(var n=0;n<e.segments.length;n++){var r=e.segments[n],i=t.segments[n];if(r.uri!==i.uri)return!1;if(r.byterange||i.byterange){var a=r.byterange,s=i.byterange;if(a&&!s||!a&&s)return!1;if(a.offset!==s.offset||a.length!==s.length)return!1}}return!0},Xo=function(e,t,n,r){return"placeholder-uri-"+e+"-"+t+"-"+(r.attributes.NAME||n)},$o=function(e,t){return(Boolean(!e.map&&!t.map)||Boolean(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length))&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length},Qo=function(e,t){var n={};for(var r in e){var i=e[r].sidx;if(i){var a=_e(i);if(!t[a])break;var s=t[a].sidxInfo;$o(s,i)&&(n[a]=t[a])}}return n},Jo=function(e){function t(t,n,r,i){var a;void 0===r&&(r={}),(a=e.call(this)||this).masterPlaylistLoader_=i||f(a),i||(a.isMaster_=!0);var s=r,o=s.withCredentials,l=void 0!==o&&o,u=s.handleManifestRedirects,c=void 0!==u&&u;if(a.vhs_=n,a.withCredentials=l,a.handleManifestRedirects=c,!t)throw new Error("A non-empty playlist URL or object is required");return a.on("minimumUpdatePeriod",(function(){a.refreshXml_()})),a.on("mediaupdatetimeout",(function(){a.refreshMedia_(a.media().id)})),a.state="HAVE_NOTHING",a.loadedPlaylists_={},a.logger_=qs("DashPlaylistLoader"),a.isMaster_?(a.masterPlaylistLoader_.srcUrl=t,a.masterPlaylistLoader_.sidxMapping_={}):a.childPlaylist_=t,a}p(t,e);var n=t.prototype;return n.requestErrored_=function(e,t,n){return!this.request||(this.request=null,e?(this.error="object"!=typeof e||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2}:e,n&&(this.state=n),this.trigger("error"),!0):void 0)},n.addSidxSegments_=function(e,t,n){var r=this,a=e.sidx&&_e(e.sidx);if(e.sidx&&a&&!this.masterPlaylistLoader_.sidxMapping_[a]){var s=js(this.handleManifestRedirects,e.sidx.resolvedUri),o=function(i,s){if(!r.requestErrored_(i,s,t)){var o,l=r.masterPlaylistLoader_.sidxMapping_;try{o=Ke()(X(s.response).subarray(8))}catch(e){return void r.requestErrored_(e,s,t)}return l[a]={sidxInfo:e.sidx,sidx:o},pe(e,o,e.sidx.resolvedUri),n(!0)}};this.request=function(e,t,n){var r,i=[],a=!1,s=function(e,t,r,i){return t.abort(),a=!0,n(e,t,r,i)},o=function(e,t){if(!a){if(e)return s(e,t,"",i);var n=t.responseText.substring(i&&i.byteLength||0,t.responseText.length);if(i=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if((t=t.filter((function(e){return e&&(e.byteLength||e.length)&&"string"!=typeof e}))).length<=1)return X(t[0]);var r=t.reduce((function(e,t,n){return e+(t.byteLength||t.length)}),0),i=new Uint8Array(r),a=0;return t.forEach((function(e){e=X(e),i.set(e,a),a+=e.byteLength})),i}(i,ee(n,!0)),r=r||We(i),i.length<10||r&&i.length<r+2)return Zo(t,(function(){return s(e,t,"",i)}));var o=pt(i);return"ts"===o&&i.length<188||!o&&i.length<376?Zo(t,(function(){return s(e,t,"",i)})):s(null,t,o,i)}},l={uri:e,beforeSend:function(e){e.overrideMimeType("text/plain; charset=x-user-defined"),e.addEventListener("progress",(function(t){return t.total,t.loaded,xo(e,null,{statusCode:e.status},o)}))}},u=t(l,(function(e,t){return xo(u,e,t,o)}));return u}(s,this.vhs_.xhr,(function(t,n,i,a){if(t)return o(t,n);if(!i||"mp4"!==i)return o({status:n.status,message:"Unsupported "+(i||"unknown")+" container type for sidx segment at URL: "+s,response:"",playlist:e,internal:!0,blacklistDuration:1/0,code:2},n);var l=e.sidx.byterange,u=l.offset,c=l.length;if(a.length>=c+u)return o(t,{response:a.subarray(u,u+c),status:n.status,uri:n.uri});r.request=r.vhs_.xhr({uri:s,responseType:"arraybuffer",headers:ko({byterange:e.sidx.byterange})},o)}))}else this.mediaRequest_=i().setTimeout((function(){return n(!1)}),0)},n.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},i().clearTimeout(this.minimumUpdatePeriodTimeout_),i().clearTimeout(this.mediaRequest_),i().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off()},n.hasPendingRequest=function(){return this.request||this.mediaRequest_},n.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},n.media=function(e){var t=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var n=this.state;if("string"==typeof e){if(!this.masterPlaylistLoader_.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.masterPlaylistLoader_.master.playlists[e]}var r=!this.media_||e.id!==this.media_.id;if(r&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(r&&(this.trigger("mediachanging"),this.trigger("mediachange")));r&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,n,(function(r){t.haveMetadata({startingState:n,playlist:e})})))},n.haveMetadata=function(e){var t=e.startingState,n=e.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[n.id]=n,this.mediaRequest_=null,this.refreshMedia_(n.id),"HAVE_MASTER"===t?this.trigger("loadedmetadata"):this.trigger("mediachange")},n.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),i().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(i().clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)},n.load=function(e){var t=this;i().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var n=this.media();if(e){var r=n?n.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=i().setTimeout((function(){return t.load()}),r)}else this.started?n&&!n.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()},n.start=function(){var e=this;this.started=!0,this.isMaster_?this.requestMaster_((function(t,n){e.haveMaster_(),e.hasPendingRequest()||e.media_||e.media(e.masterPlaylistLoader_.master.playlists[0])})):this.mediaRequest_=i().setTimeout((function(){return e.haveMaster_()}),0)},n.requestMaster_=function(e){var t=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},(function(n,r){if(!t.requestErrored_(n,r)){var i=r.responseText!==t.masterPlaylistLoader_.masterXml_;return t.masterPlaylistLoader_.masterXml_=r.responseText,r.responseHeaders&&r.responseHeaders.date?t.masterLoaded_=Date.parse(r.responseHeaders.date):t.masterLoaded_=Date.now(),t.masterPlaylistLoader_.srcUrl=js(t.handleManifestRedirects,t.masterPlaylistLoader_.srcUrl,r),i?(t.handleMaster_(),void t.syncClientServerClock_((function(){return e(r,i)}))):e(r,i)}"HAVE_NOTHING"===t.state&&(t.started=!1)}))},n.syncClientServerClock_=function(e){var t,n=this,r=(t=this.masterPlaylistLoader_.masterXml_,function(e){var t=ke(e,"UTCTiming")[0];if(!t)return null;var n=je(t);switch(n.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":n.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":n.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":n.method="DIRECT",n.value=Date.parse(n.value);break;default:throw new Error("UNSUPPORTED_UTC_TIMING_SCHEME")}return n}(Ye(t)));return null===r?(this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),e()):"DIRECT"===r.method?(this.masterPlaylistLoader_.clientOffset_=r.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:Bs(this.masterPlaylistLoader_.srcUrl,r.value),method:r.method,withCredentials:this.withCredentials},(function(t,i){if(n.request){if(t)return n.masterPlaylistLoader_.clientOffset_=n.masterLoaded_-Date.now(),e();var a;a="HEAD"===r.method?i.responseHeaders&&i.responseHeaders.date?Date.parse(i.responseHeaders.date):n.masterLoaded_:Date.parse(i.responseText),n.masterPlaylistLoader_.clientOffset_=a-Date.now(),e()}})))},n.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},n.handleMaster_=function(){this.mediaRequest_=null;var e,t,n,r=this.masterPlaylistLoader_.master,i=(n=function(e,t){void 0===t&&(t={});var n=function(e,t){void 0===t&&(t={});var n=t,r=n.manifestUri,i=void 0===r?"":r,a=n.NOW,s=void 0===a?Date.now():a,o=n.clientOffset,l=void 0===o?0:o,u=ke(e,"Period");if(!u.length)throw new Error("INVALID_NUMBER_OF_PERIOD");var c=ke(e,"Location"),d=je(e),f=He([i],ke(e,"BaseURL"));d.type=d.type||"static",d.sourceDuration=d.mediaPresentationDuration||0,d.NOW=s,d.clientOffset=l,c.length&&(d.locations=c.map(Fe));var h=[];return u.forEach((function(e,t){var n=je(e),r=h[t-1];n.start=function(e){var t=e.attributes,n=e.priorPeriodAttributes,r=e.mpdType;return"number"==typeof t.start?t.start:n&&"number"==typeof n.start&&"number"==typeof n.duration?n.start+n.duration:n||"static"!==r?null:0}({attributes:n,priorPeriodAttributes:r?r.attributes:null,mpdType:d.type}),h.push({node:e,attributes:n})})),{locations:d.locations,representationInfo:se(h.map(Ve(d,f)))}}(Ye(e),t),r=n.representationInfo.map(Le);return Re({dashPlaylists:r,locations:n.locations,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest})}((e={masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_,previousManifest:r}).masterXml,{manifestUri:t=e.srcUrl,clientOffset:e.clientOffset,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest}),bo(n,t,Xo),n);r&&(i=function(e,t,n){for(var r=!0,i=zo(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts}),a=0;a<t.playlists.length;a++){var s=t.playlists[a];if(s.sidx){var o=_e(s.sidx);n&&n[o]&&n[o].sidx&&pe(s,n[o].sidx,s.sidx.resolvedUri)}var l=Do(i,s,Wo);l&&(i=l,r=!1)}return To(t,(function(e,t,n,a){if(e.playlists&&e.playlists.length){var s=e.playlists[0].id,o=Do(i,e.playlists[0],Wo);o&&(a in(i=o).mediaGroups[t][n]||(i.mediaGroups[t][n][a]=e),i.mediaGroups[t][n][a].playlists[0]=i.playlists[s],r=!1)}})),function(e,t){To(e,(function(n,r,i,a){a in t.mediaGroups[r][i]||delete e.mediaGroups[r][i][a]}))}(i,t),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(r=!1),r?null:i}(r,i,this.masterPlaylistLoader_.sidxMapping_)),this.masterPlaylistLoader_.master=i||r;var a=this.masterPlaylistLoader_.master.locations&&this.masterPlaylistLoader_.master.locations[0];return a&&a!==this.masterPlaylistLoader_.srcUrl&&(this.masterPlaylistLoader_.srcUrl=a),(!r||i&&i.minimumUpdatePeriod!==r.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),Boolean(i)},n.updateMinimumUpdatePeriodTimeout_=function(){var e=this.masterPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(i().clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);var t=e.master&&e.master.minimumUpdatePeriod;0===t&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),"number"!=typeof t||t<=0?t<0&&this.logger_("found invalid minimumUpdatePeriod of "+t+", not setting a timeout"):this.createMUPTimeout_(t)},n.createMUPTimeout_=function(e){var t=this.masterPlaylistLoader_;t.minimumUpdatePeriodTimeout_=i().setTimeout((function(){t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)}),e)},n.refreshXml_=function(){var e=this;this.requestMaster_((function(t,n){var r,i,a;n&&(e.media_&&(e.media_=e.masterPlaylistLoader_.master.playlists[e.media_.id]),e.masterPlaylistLoader_.sidxMapping_=(r=e.masterPlaylistLoader_.master,i=e.masterPlaylistLoader_.sidxMapping_,a=Qo(r.playlists,i),To(r,(function(e,t,n,r){if(e.playlists&&e.playlists.length){var s=e.playlists;a=zo(a,Qo(s,i))}})),a),e.addSidxSegments_(e.media(),e.state,(function(t){e.refreshMedia_(e.media().id)})))}))},n.refreshMedia_=function(e){var t=this;if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMaster_&&this.handleMaster_();var n=this.masterPlaylistLoader_.master.playlists,r=!this.media_||this.media_!==n[e];r?this.media_=n[e]:this.trigger("playlistunchanged"),this.mediaUpdateTimeout||function e(){t.media().endList||(t.mediaUpdateTimeout=i().setTimeout((function(){t.trigger("mediaupdatetimeout"),e()}),No(t.media(),Boolean(r))))}(),this.trigger("loadedplaylist")},t}(Ko),el={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30},tl=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},nl=function(e){return function(){var t=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch(n){var t=new BlobBuilder;return t.append(e),URL.createObjectURL(t.getBlob())}}(e),n=tl(new Worker(t));n.objURL=t;var r=n.terminate;return n.on=n.addEventListener,n.off=n.removeEventListener,n.terminate=function(){return URL.revokeObjectURL(t),r.call(this)},n}},rl=function(e){return"var browserWorkerPolyFill = "+tl.toString()+";\nbrowserWorkerPolyFill(self);\n"+e},il=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)},al=rl(il((function(){var e=function(){this.init=function(){var e={};this.on=function(t,n){e[t]||(e[t]=[]),e[t]=e[t].concat(n)},this.off=function(t,n){var r;return!!e[t]&&(r=e[t].indexOf(n),e[t]=e[t].slice(),e[t].splice(r,1),r>-1)},this.trigger=function(t){var n,r,i,a;if(n=e[t])if(2===arguments.length)for(i=n.length,r=0;r<i;++r)n[r].call(this,arguments[1]);else{for(a=[],r=arguments.length,r=1;r<arguments.length;++r)a.push(arguments[r]);for(i=n.length,r=0;r<i;++r)n[r].apply(this,a)}},this.dispose=function(){e={}}}};e.prototype.pipe=function(e){return this.on("data",(function(t){e.push(t)})),this.on("done",(function(t){e.flush(t)})),this.on("partialdone",(function(t){e.partialFlush(t)})),this.on("endedtimeline",(function(t){e.endTimeline(t)})),this.on("reset",(function(t){e.reset(t)})),e},e.prototype.push=function(e){this.trigger("data",e)},e.prototype.flush=function(e){this.trigger("done",e)},e.prototype.partialFlush=function(e){this.trigger("partialdone",e)},e.prototype.endTimeline=function(e){this.trigger("endedtimeline",e)},e.prototype.reset=function(e){this.trigger("reset",e)};var t,r,i,a,s,o,l,u,c,d,f,h,p,g,m,y,v,_,T,E,b,S,A,w,I,C,R,D,N,O,P,M,x,L,k,F,U,B,j,q,H=e,G=Math.pow(2,32),V={getUint64:function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getBigUint64?(t=n.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(t):t:n.getUint32(0)*G+n.getUint32(4)},MAX_UINT32:G},Y=V.MAX_UINT32;!function(){var e;if(S={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!=typeof Uint8Array){for(e in S)S.hasOwnProperty(e)&&(S[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);A=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),I=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),w=new Uint8Array([0,0,0,1]),C=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),R=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),D={video:C,audio:R},P=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),O=new Uint8Array([0,0,0,0,0,0,0,0]),M=new Uint8Array([0,0,0,0,0,0,0,0]),x=M,L=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),k=M,N=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),t=function(e){var t,n,r=[],i=0;for(t=1;t<arguments.length;t++)r.push(arguments[t]);for(t=r.length;t--;)i+=r[t].byteLength;for(n=new Uint8Array(i+8),new DataView(n.buffer,n.byteOffset,n.byteLength).setUint32(0,n.byteLength),n.set(e,4),t=0,i=8;t<r.length;t++)n.set(r[t],i),i+=r[t].byteLength;return n},r=function(){return t(S.dinf,t(S.dref,P))},i=function(e){return t(S.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,e.audioobjecttype<<3|e.samplingfrequencyindex>>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},m=function(e){return t(S.hdlr,D[e])},g=function(e){var n=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(n[12]=e.samplerate>>>24&255,n[13]=e.samplerate>>>16&255,n[14]=e.samplerate>>>8&255,n[15]=255&e.samplerate),t(S.mdhd,n)},p=function(e){return t(S.mdia,g(e),m(e.type),o(e))},s=function(e){return t(S.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},o=function(e){return t(S.minf,"video"===e.type?t(S.vmhd,N):t(S.smhd,O),r(),v(e))},l=function(e,n){for(var r=[],i=n.length;i--;)r[i]=T(n[i]);return t.apply(null,[S.moof,s(e)].concat(r))},u=function(e){for(var n=e.length,r=[];n--;)r[n]=f(e[n]);return t.apply(null,[S.moov,d(4294967295)].concat(r).concat(c(e)))},c=function(e){for(var n=e.length,r=[];n--;)r[n]=E(e[n]);return t.apply(null,[S.mvex].concat(r))},d=function(e){var n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return t(S.mvhd,n)},y=function(e){var n,r,i=e.samples||[],a=new Uint8Array(4+i.length);for(r=0;r<i.length;r++)n=i[r].flags,a[r+4]=n.dependsOn<<4|n.isDependedOn<<2|n.hasRedundancy;return t(S.sdtp,a)},v=function(e){return t(S.stbl,_(e),t(S.stts,k),t(S.stsc,x),t(S.stsz,L),t(S.stco,M))},_=function(e){return t(S.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===e.type?F(e):U(e))},F=function(e){var n,r,i=e.sps||[],a=e.pps||[],s=[],o=[];for(n=0;n<i.length;n++)s.push((65280&i[n].byteLength)>>>8),s.push(255&i[n].byteLength),s=s.concat(Array.prototype.slice.call(i[n]));for(n=0;n<a.length;n++)o.push((65280&a[n].byteLength)>>>8),o.push(255&a[n].byteLength),o=o.concat(Array.prototype.slice.call(a[n]));if(r=[S.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),t(S.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([i.length],s,[a.length],o))),t(S.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var l=e.sarRatio[0],u=e.sarRatio[1];r.push(t(S.pasp,new Uint8Array([(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l,(4278190080&u)>>24,(16711680&u)>>16,(65280&u)>>8,255&u])))}return t.apply(null,r)},U=function(e){return t(S.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),i(e))},h=function(e){var n=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return t(S.tkhd,n)},T=function(e){var n,r,i,a,s,o;return n=t(S.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),s=Math.floor(e.baseMediaDecodeTime/Y),o=Math.floor(e.baseMediaDecodeTime%Y),r=t(S.tfdt,new Uint8Array([1,0,0,0,s>>>24&255,s>>>16&255,s>>>8&255,255&s,o>>>24&255,o>>>16&255,o>>>8&255,255&o])),"audio"===e.type?(i=b(e,92),t(S.traf,n,r,i)):(a=y(e),i=b(e,a.length+92),t(S.traf,n,r,i,a))},f=function(e){return e.duration=e.duration||4294967295,t(S.trak,h(e),p(e))},E=function(e){var n=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(n[n.length-1]=0),t(S.trex,n)},q=function(e,t){var n=0,r=0,i=0,a=0;return e.length&&(void 0!==e[0].duration&&(n=1),void 0!==e[0].size&&(r=2),void 0!==e[0].flags&&(i=4),void 0!==e[0].compositionTimeOffset&&(a=8)),[0,0,n|r|i|a,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},j=function(e,n){var r,i,a,s,o,l;for(n+=20+16*(s=e.samples||[]).length,a=q(s,n),(i=new Uint8Array(a.length+16*s.length)).set(a),r=a.length,l=0;l<s.length;l++)o=s[l],i[r++]=(4278190080&o.duration)>>>24,i[r++]=(16711680&o.duration)>>>16,i[r++]=(65280&o.duration)>>>8,i[r++]=255&o.duration,i[r++]=(4278190080&o.size)>>>24,i[r++]=(16711680&o.size)>>>16,i[r++]=(65280&o.size)>>>8,i[r++]=255&o.size,i[r++]=o.flags.isLeading<<2|o.flags.dependsOn,i[r++]=o.flags.isDependedOn<<6|o.flags.hasRedundancy<<4|o.flags.paddingValue<<1|o.flags.isNonSyncSample,i[r++]=61440&o.flags.degradationPriority,i[r++]=15&o.flags.degradationPriority,i[r++]=(4278190080&o.compositionTimeOffset)>>>24,i[r++]=(16711680&o.compositionTimeOffset)>>>16,i[r++]=(65280&o.compositionTimeOffset)>>>8,i[r++]=255&o.compositionTimeOffset;return t(S.trun,i)},B=function(e,n){var r,i,a,s,o,l;for(n+=20+8*(s=e.samples||[]).length,a=q(s,n),(r=new Uint8Array(a.length+8*s.length)).set(a),i=a.length,l=0;l<s.length;l++)o=s[l],r[i++]=(4278190080&o.duration)>>>24,r[i++]=(16711680&o.duration)>>>16,r[i++]=(65280&o.duration)>>>8,r[i++]=255&o.duration,r[i++]=(4278190080&o.size)>>>24,r[i++]=(16711680&o.size)>>>16,r[i++]=(65280&o.size)>>>8,r[i++]=255&o.size;return t(S.trun,r)},b=function(e,t){return"audio"===e.type?B(e,t):j(e,t)},a=function(){return t(S.ftyp,A,w,A,I)};var Z,K,z,W,X,$,Q,J,ee=function(e){return t(S.mdat,e)},te=l,ne=function(e,t){var n={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return n.dataOffset=t,n.compositionTimeOffset=e.pts-e.dts,n.duration=e.duration,n.size=4*e.length,n.size+=e.byteLength,e.keyFrame&&(n.flags.dependsOn=2,n.flags.isNonSyncSample=0),n},re=[33,16,5,32,164,27],ie=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],ae=function(e){for(var t=[];e--;)t.push(0);return t},se=9e4;$=function(e,t){return K(X(e,t))},Q=function(e,t){return z(W(e),t)},J=function(e,t,n){return W(n?e:e-t)};var oe=se,le=K=function(e){return e*se},ue=(z=function(e,t){return e*t},W=function(e){return e/se}),ce=(X=function(e,t){return e/t},$),de=Q,fe=J,he=function(e,t,n,r){var i,a,s,o,l,u=0,c=0,d=0;if(t.length&&(i=ce(e.baseMediaDecodeTime,e.samplerate),a=Math.ceil(oe/(e.samplerate/1024)),n&&r&&(u=i-Math.max(n,r),d=(c=Math.floor(u/a))*a),!(c<1||d>45e3))){for((s=function(){if(!Z){var e={96e3:[re,[227,64],ae(154),[56]],88200:[re,[231],ae(170),[56]],64e3:[re,[248,192],ae(240),[56]],48e3:[re,[255,192],ae(268),[55,148,128],ae(54),[112]],44100:[re,[255,192],ae(268),[55,163,128],ae(84),[112]],32e3:[re,[255,192],ae(268),[55,234],ae(226),[112]],24e3:[re,[255,192],ae(268),[55,255,128],ae(268),[111,112],ae(126),[224]],16e3:[re,[255,192],ae(268),[55,255,128],ae(268),[111,255],ae(269),[223,108],ae(195),[1,192]],12e3:[ie,ae(268),[3,127,248],ae(268),[6,255,240],ae(268),[13,255,224],ae(268),[27,253,128],ae(259),[56]],11025:[ie,ae(268),[3,127,248],ae(268),[6,255,240],ae(268),[13,255,224],ae(268),[27,255,192],ae(268),[55,175,128],ae(108),[112]],8e3:[ie,ae(268),[3,121,16],ae(47),[7]]};t=e,Z=Object.keys(t).reduce((function(e,n){return e[n]=new Uint8Array(t[n].reduce((function(e,t){return e.concat(t)}),[])),e}),{})}var t;return Z}()[e.samplerate])||(s=t[0].data),o=0;o<c;o++)l=t[0],t.splice(0,0,{data:s,dts:l.dts-a,pts:l.pts-a});return e.baseMediaDecodeTime-=Math.floor(de(d,e.samplerate)),d}},pe=function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},ge=function(e,t){var n,r=e.minSegmentDts;return t||(r-=e.timelineStartInfo.dts),n=e.timelineStartInfo.baseMediaDecodeTime,n+=r,n=Math.max(0,n),"audio"===e.type&&(n*=e.samplerate/9e4,n=Math.floor(n)),n},me=function(e,t){"number"==typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),void 0===e.minSegmentPts?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),void 0===e.maxSegmentPts?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),"number"==typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),void 0===e.minSegmentDts?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),void 0===e.maxSegmentDts?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts))},ye=function e(t){t=t||{},e.prototype.init.call(this),this.parse708captions_="boolean"!=typeof t.parse708captions||t.parse708captions,this.captionPackets_=[],this.ccStreams_=[new Ce(0,0),new Ce(0,1),new Ce(1,0),new Ce(1,1)],this.parse708captions_&&(this.cc708Stream_=new be({captionServices:t.captionServices})),this.reset(),this.ccStreams_.forEach((function(e){e.on("data",this.trigger.bind(this,"data")),e.on("partialdone",this.trigger.bind(this,"partialdone")),e.on("done",this.trigger.bind(this,"done"))}),this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};(ye.prototype=new H).push=function(e){var t,n,r;if("sei_rbsp"===e.nalUnitType&&(t=function(e){for(var t=0,n={payloadType:-1,payloadSize:0},r=0,i=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)r+=255,t++;for(r+=e[t++];255===e[t];)i+=255,t++;if(i+=e[t++],!n.payload&&4===r){if("GA94"===String.fromCharCode(e[t+3],e[t+4],e[t+5],e[t+6])){n.payloadType=r,n.payloadSize=i,n.payload=e.subarray(t,t+i);break}n.payload=void 0}t+=i,r=0,i=0}return n}(e.escapedRBSP)).payload&&4===t.payloadType&&(n=function(e){return 181!==e.payload[0]||49!=(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)}(t)))if(e.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));r=function(e,t){var n,r,i,a,s=[];if(!(64&t[0]))return s;for(r=31&t[0],n=0;n<r;n++)a={type:3&t[2+(i=3*n)],pts:e},4&t[i+2]&&(a.ccData=t[i+3]<<8|t[i+4],s.push(a));return s}(e.pts,n),this.captionPackets_=this.captionPackets_.concat(r),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},ye.prototype.flushCCStreams=function(e){this.ccStreams_.forEach((function(t){return"flush"===e?t.flush():t.partialFlush()}),this)},ye.prototype.flushStream=function(e){this.captionPackets_.length?(this.captionPackets_.forEach((function(e,t){e.presortIndex=t})),this.captionPackets_.sort((function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts})),this.captionPackets_.forEach((function(e){e.type<2?this.dispatchCea608Packet(e):this.dispatchCea708Packet(e)}),this),this.captionPackets_.length=0,this.flushCCStreams(e)):this.flushCCStreams(e)},ye.prototype.flush=function(){return this.flushStream("flush")},ye.prototype.partialFlush=function(){return this.flushStream("partialFlush")},ye.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach((function(e){e.reset()}))},ye.prototype.dispatchCea608Packet=function(e){this.setsTextOrXDSActive(e)?this.activeCea608Channel_[e.type]=null:this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},ye.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},ye.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)},ye.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData)},ye.prototype.dispatchCea708Packet=function(e){this.parse708captions_&&this.cc708Stream_.push(e)};var ve={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},_e=function(e){return 32<=e&&e<=127||160<=e&&e<=255},Te=function(e){this.windowNum=e,this.reset()};Te.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},Te.prototype.getText=function(){return this.rows.join("\n")},Te.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},Te.prototype.newLine=function(e){for(this.rows.length>=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},Te.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},Te.prototype.addText=function(e){this.rows[this.rowIdx]+=e},Te.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var Ee=function(e,t,n){this.serviceNum=e,this.text="",this.currentWindow=new Te(-1),this.windows=[],this.stream=n,"string"==typeof t&&this.createTextDecoder(t)};Ee.prototype.init=function(e,t){this.startPts=e;for(var n=0;n<8;n++)this.windows[n]=new Te(n),"function"==typeof t&&(this.windows[n].beforeRowOverflow=t)},Ee.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]},Ee.prototype.createTextDecoder=function(e){if("undefined"==typeof TextDecoder)this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(e)}catch(t){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+e+" encoding. "+t})}};var be=function e(t){t=t||{},e.prototype.init.call(this);var n,r=this,i=t.captionServices||{},a={};Object.keys(i).forEach((function(e){n=i[e],/^SERVICE/.test(e)&&(a[e]=n.encoding)})),this.serviceEncodings=a,this.current708Packet=null,this.services={},this.push=function(e){3===e.type?(r.new708Packet(),r.add708Bytes(e)):(null===r.current708Packet&&r.new708Packet(),r.add708Bytes(e))}};be.prototype=new H,be.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},be.prototype.add708Bytes=function(e){var t=e.ccData,n=t>>>8,r=255&t;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(n),this.current708Packet.data.push(r)},be.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,n=null,r=null,i=0,a=t[i++];for(e.seq=a>>6,e.sizeCode=63&a;i<t.length;i++)r=31&(a=t[i++]),7==(n=a>>5)&&r>0&&(n=a=t[i++]),this.pushServiceBlock(n,i,r),r>0&&(i+=r-1)},be.prototype.pushServiceBlock=function(e,t,n){var r,i=t,a=this.current708Packet.data,s=this.services[e];for(s||(s=this.initService(e,i));i<t+n&&i<a.length;i++)r=a[i],_e(r)?i=this.handleText(i,s):24===r?i=this.multiByteCharacter(i,s):16===r?i=this.extendedCommands(i,s):128<=r&&r<=135?i=this.setCurrentWindow(i,s):152<=r&&r<=159?i=this.defineWindow(i,s):136===r?i=this.clearWindows(i,s):140===r?i=this.deleteWindows(i,s):137===r?i=this.displayWindows(i,s):138===r?i=this.hideWindows(i,s):139===r?i=this.toggleWindows(i,s):151===r?i=this.setWindowAttributes(i,s):144===r?i=this.setPenAttributes(i,s):145===r?i=this.setPenColor(i,s):146===r?i=this.setPenLocation(i,s):143===r?s=this.reset(i,s):8===r?s.currentWindow.backspace():12===r?s.currentWindow.clearText():13===r?s.currentWindow.pendingNewLine=!0:14===r?s.currentWindow.clearText():141===r&&i++},be.prototype.extendedCommands=function(e,t){var n=this.current708Packet.data[++e];return _e(n)&&(e=this.handleText(e,t,{isExtended:!0})),e},be.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)]},be.prototype.initService=function(e,t){var n,r,i=this;return(n="SERVICE"+e)in this.serviceEncodings&&(r=this.serviceEncodings[n]),this.services[e]=new Ee(e,r,i),this.services[e].init(this.getPts(t),(function(t){i.flushDisplayed(t,i.services[e])})),this.services[e]},be.prototype.handleText=function(e,t,n){var r,i,a,s,o=n&&n.isExtended,l=n&&n.isMultiByte,u=this.current708Packet.data,c=o?4096:0,d=u[e],f=u[e+1],h=t.currentWindow;return t.textDecoder_&&!o?(l?(i=[d,f],e++):i=[d],r=t.textDecoder_.decode(new Uint8Array(i))):(s=ve[a=c|d]||a,r=4096&a&&a===s?"":String.fromCharCode(s)),h.pendingNewLine&&!h.isEmpty()&&h.newLine(this.getPts(e)),h.pendingNewLine=!1,h.addText(r),e},be.prototype.multiByteCharacter=function(e,t){var n=this.current708Packet.data,r=n[e+1],i=n[e+2];return _e(r)&&_e(i)&&(e=this.handleText(++e,t,{isMultiByte:!0})),e},be.prototype.setCurrentWindow=function(e,t){var n=7&this.current708Packet.data[e];return t.setCurrentWindow(n),e},be.prototype.defineWindow=function(e,t){var n=this.current708Packet.data,r=n[e],i=7&r;t.setCurrentWindow(i);var a=t.currentWindow;return r=n[++e],a.visible=(32&r)>>5,a.rowLock=(16&r)>>4,a.columnLock=(8&r)>>3,a.priority=7&r,r=n[++e],a.relativePositioning=(128&r)>>7,a.anchorVertical=127&r,r=n[++e],a.anchorHorizontal=r,r=n[++e],a.anchorPoint=(240&r)>>4,a.rowCount=15&r,r=n[++e],a.columnCount=63&r,r=n[++e],a.windowStyle=(56&r)>>3,a.penStyle=7&r,a.virtualRowCount=a.rowCount+1,e},be.prototype.setWindowAttributes=function(e,t){var n=this.current708Packet.data,r=n[e],i=t.currentWindow.winAttr;return r=n[++e],i.fillOpacity=(192&r)>>6,i.fillRed=(48&r)>>4,i.fillGreen=(12&r)>>2,i.fillBlue=3&r,r=n[++e],i.borderType=(192&r)>>6,i.borderRed=(48&r)>>4,i.borderGreen=(12&r)>>2,i.borderBlue=3&r,r=n[++e],i.borderType+=(128&r)>>5,i.wordWrap=(64&r)>>6,i.printDirection=(48&r)>>4,i.scrollDirection=(12&r)>>2,i.justify=3&r,r=n[++e],i.effectSpeed=(240&r)>>4,i.effectDirection=(12&r)>>2,i.displayEffect=3&r,e},be.prototype.flushDisplayed=function(e,t){for(var n=[],r=0;r<8;r++)t.windows[r].visible&&!t.windows[r].isEmpty()&&n.push(t.windows[r].getText());t.endPts=e,t.text=n.join("\n\n"),this.pushCaption(t),t.startPts=e},be.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts)},be.prototype.displayWindows=function(e,t){var n=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var i=0;i<8;i++)n&1<<i&&(t.windows[i].visible=1);return e},be.prototype.hideWindows=function(e,t){var n=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var i=0;i<8;i++)n&1<<i&&(t.windows[i].visible=0);return e},be.prototype.toggleWindows=function(e,t){var n=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var i=0;i<8;i++)n&1<<i&&(t.windows[i].visible^=1);return e},be.prototype.clearWindows=function(e,t){var n=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var i=0;i<8;i++)n&1<<i&&t.windows[i].clearText();return e},be.prototype.deleteWindows=function(e,t){var n=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var i=0;i<8;i++)n&1<<i&&t.windows[i].reset();return e},be.prototype.setPenAttributes=function(e,t){var n=this.current708Packet.data,r=n[e],i=t.currentWindow.penAttr;return r=n[++e],i.textTag=(240&r)>>4,i.offset=(12&r)>>2,i.penSize=3&r,r=n[++e],i.italics=(128&r)>>7,i.underline=(64&r)>>6,i.edgeType=(56&r)>>3,i.fontStyle=7&r,e},be.prototype.setPenColor=function(e,t){var n=this.current708Packet.data,r=n[e],i=t.currentWindow.penColor;return r=n[++e],i.fgOpacity=(192&r)>>6,i.fgRed=(48&r)>>4,i.fgGreen=(12&r)>>2,i.fgBlue=3&r,r=n[++e],i.bgOpacity=(192&r)>>6,i.bgRed=(48&r)>>4,i.bgGreen=(12&r)>>2,i.bgBlue=3&r,r=n[++e],i.edgeRed=(48&r)>>4,i.edgeGreen=(12&r)>>2,i.edgeBlue=3&r,e},be.prototype.setPenLocation=function(e,t){var n=this.current708Packet.data,r=n[e],i=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,r=n[++e],i.row=15&r,r=n[++e],i.column=63&r,e},be.prototype.reset=function(e,t){var n=this.getPts(e);return this.flushDisplayed(n,t),this.initService(t.serviceNum,e)};var Se={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Ae=function(e){return null===e?"":(e=Se[e]||e,String.fromCharCode(e))},we=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Ie=function(){for(var e=[],t=15;t--;)e.push("");return e},Ce=function e(t,n){e.prototype.init.call(this),this.field_=t||0,this.dataChannel_=n||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,n,r,i,a;if((t=32639&e.ccData)!==this.lastControlCode_){if(4096==(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),r=t>>>8,i=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),n=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=n,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=Ie();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Ie();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=Ie()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(r,i))a=Ae((r=(3&r)<<8)|i),this[this.mode_](e.pts,a),this.column_++;else if(this.isExtCharacter(r,i))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),a=Ae((r=(3&r)<<8)|i),this[this.mode_](e.pts,a),this.column_++;else if(this.isMidRowCode(r,i))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14==(14&i)&&this.addFormatting(e.pts,["i"]),1==(1&i)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(r,i))this.column_+=3&i;else if(this.isPAC(r,i)){var s=we.indexOf(7968&t);"rollUp"===this.mode_&&(s-this.rollUpRows_+1<0&&(s=this.rollUpRows_-1),this.setRollUp(e.pts,s)),s!==this.row_&&(this.clearFormatting(e.pts),this.row_=s),1&i&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16==(16&t)&&(this.column_=4*((14&t)>>1)),this.isColorPAC(i)&&14==(14&i)&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(r)&&(0===i&&(i=null),a=Ae(r),a+=Ae(i),this[this.mode_](e.pts,a),this.column_+=a.length)}else this.lastControlCode_=null}};Ce.prototype=new H,Ce.prototype.flushDisplayed=function(e){var t=this.displayed_.map((function(e,t){try{return e.trim()}catch(e){return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+t+"."}),""}}),this).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},Ce.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Ie(),this.nonDisplayed_=Ie(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},Ce.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},Ce.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},Ce.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},Ce.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},Ce.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},Ce.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},Ce.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},Ce.prototype.isNormalChar=function(e){return e>=32&&e<=127},Ce.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=Ie(),this.displayed_=Ie()),void 0!==t&&t!==this.row_)for(var n=0;n<this.rollUpRows_;n++)this.displayed_[t-n]=this.displayed_[this.row_-n],this.displayed_[this.row_-n]="";void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},Ce.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var n=t.reduce((function(e,t){return e+"<"+t+">"}),"");this[this.mode_](e,n)},Ce.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce((function(e,t){return e+"</"+t+">"}),"");this.formatting_=[],this[this.mode_](e,t)}},Ce.prototype.popOn=function(e,t){var n=this.nonDisplayed_[this.row_];n+=t,this.nonDisplayed_[this.row_]=n},Ce.prototype.rollUp=function(e,t){var n=this.displayed_[this.row_];n+=t,this.displayed_[this.row_]=n},Ce.prototype.shiftRowsUp_=function(){var e;for(e=0;e<this.topRow_;e++)this.displayed_[e]="";for(e=this.row_+1;e<15;e++)this.displayed_[e]="";for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]=""},Ce.prototype.paintOn=function(e,t){var n=this.displayed_[this.row_];n+=t,this.displayed_[this.row_]=n};var Re={CaptionStream:ye,Cea608Stream:Ce,Cea708Stream:be},De={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Ne="shared",Oe=function(e,t){var n=1;for(e>t&&(n=-1);Math.abs(t-e)>4294967296;)e+=8589934592*n;return e},Pe=function e(t){var n,r;e.prototype.init.call(this),this.type_=t||Ne,this.push=function(e){this.type_!==Ne&&e.type!==this.type_||(void 0===r&&(r=e.dts),e.dts=Oe(e.dts,r),e.pts=Oe(e.pts,r),n=e.dts,this.trigger("data",e))},this.flush=function(){r=n,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){r=void 0,n=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Pe.prototype=new H;var Me,xe=Pe,Le=Oe,ke=function(e,t,n){var r,i="";for(r=t;r<n;r++)i+="%"+("00"+e[r].toString(16)).slice(-2);return i},Fe=function(e,t,n){return decodeURIComponent(ke(e,t,n))},Ue=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},Be={TXXX:function(e){var t;if(3===e.data[0]){for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=Fe(e.data,1,t),e.value=Fe(e.data,t+1,e.data.length).replace(/\0*$/,"");break}e.data=e.value}},WXXX:function(e){var t;if(3===e.data[0])for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=Fe(e.data,1,t),e.url=Fe(e.data,t+1,e.data.length);break}},PRIV:function(e){var t,n;for(t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=(n=e.data,unescape(ke(n,0,t)));break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}};Me=function(e){var t,n={descriptor:e&&e.descriptor},r=0,i=[],a=0;if(Me.prototype.init.call(this),this.dispatchType=De.METADATA_STREAM_TYPE.toString(16),n.descriptor)for(t=0;t<n.descriptor.length;t++)this.dispatchType+=("00"+n.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,n,s,o,l;if("timed-metadata"===e.type)if(e.dataAlignmentIndicator&&(a=0,i.length=0),0===i.length&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});else if(i.push(e),a+=e.data.byteLength,1===i.length&&(r=Ue(e.data.subarray(6,10)),r+=10),!(a<r)){for(t={data:new Uint8Array(r),frames:[],pts:i[0].pts,dts:i[0].dts},l=0;l<r;)t.data.set(i[0].data.subarray(0,r-l),l),l+=i[0].data.byteLength,a-=i[0].data.byteLength,i.shift();n=10,64&t.data[5]&&(n+=4,n+=Ue(t.data.subarray(10,14)),r-=Ue(t.data.subarray(16,20)));do{if((s=Ue(t.data.subarray(n+4,n+8)))<1)return void this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping metadata parsing."});if((o={id:String.fromCharCode(t.data[n],t.data[n+1],t.data[n+2],t.data[n+3]),data:t.data.subarray(n+10,n+s+10)}).key=o.id,Be[o.id]&&(Be[o.id](o),"com.apple.streaming.transportStreamTimestamp"===o.owner)){var u=o.data,c=(1&u[3])<<30|u[4]<<22|u[5]<<14|u[6]<<6|u[7]>>>2;c*=4,c+=3&u[7],o.timeStamp=c,void 0===t.pts&&void 0===t.dts&&(t.pts=o.timeStamp,t.dts=o.timeStamp),this.trigger("timestamp",o)}t.frames.push(o),n+=10,n+=s}while(n<r);this.trigger("data",t)}}},Me.prototype=new H;var je,qe,He,Ge=Me,Ve=xe,Ye=188;(je=function(){var e=new Uint8Array(Ye),t=0;je.prototype.init.call(this),this.push=function(n){var r,i=0,a=Ye;for(t?((r=new Uint8Array(n.byteLength+t)).set(e.subarray(0,t)),r.set(n,t),t=0):r=n;a<r.byteLength;)71!==r[i]||71!==r[a]?(i++,a++):(this.trigger("data",r.subarray(i,a)),i+=Ye,a+=Ye);i<r.byteLength&&(e.set(r.subarray(i),0),t=r.byteLength-i)},this.flush=function(){t===Ye&&71===e[0]&&(this.trigger("data",e),t=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){t=0,this.trigger("reset")}}).prototype=new H,qe=function(){var e,t,n,r;qe.prototype.init.call(this),r=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,r){var i=0;r.payloadUnitStartIndicator&&(i+=e[i]+1),"pat"===r.type?t(e.subarray(i),r):n(e.subarray(i),r)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],r.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=r.pmtPid},n=function(e,t){var n,i;if(1&e[5]){for(r.programMapTable={video:null,audio:null,"timed-metadata":{}},n=3+((15&e[1])<<8|e[2])-4,i=12+((15&e[10])<<8|e[11]);i<n;){var a=e[i],s=(31&e[i+1])<<8|e[i+2];a===De.H264_STREAM_TYPE&&null===r.programMapTable.video?r.programMapTable.video=s:a===De.ADTS_STREAM_TYPE&&null===r.programMapTable.audio?r.programMapTable.audio=s:a===De.METADATA_STREAM_TYPE&&(r.programMapTable["timed-metadata"][s]=a),i+=5+((15&e[i+3])<<8|e[i+4])}t.programMapTable=r.programMapTable}},this.push=function(t){var n={},r=4;if(n.payloadUnitStartIndicator=!!(64&t[1]),n.pid=31&t[1],n.pid<<=8,n.pid|=t[2],(48&t[3])>>>4>1&&(r+=t[r]+1),0===n.pid)n.type="pat",e(t.subarray(r),n),this.trigger("data",n);else if(n.pid===this.pmtPid)for(n.type="pmt",e(t.subarray(r),n),this.trigger("data",n);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,r,n]):this.processPes_(t,r,n)},this.processPes_=function(e,t,n){n.pid===this.programMapTable.video?n.streamType=De.H264_STREAM_TYPE:n.pid===this.programMapTable.audio?n.streamType=De.ADTS_STREAM_TYPE:n.streamType=this.programMapTable["timed-metadata"][n.pid],n.type="pes",n.data=e.subarray(t),this.trigger("data",n)}},qe.prototype=new H,qe.STREAM_TYPES={h264:27,adts:15},He=function(){var e,t=this,n=!1,r={data:[],size:0},i={data:[],size:0},a={data:[],size:0},s=function(e,n,r){var i,a,s=new Uint8Array(e.size),o={type:n},l=0,u=0;if(e.data.length&&!(e.size<9)){for(o.trackId=e.data[0].pid,l=0;l<e.data.length;l++)a=e.data[l],s.set(a.data,u),u+=a.data.byteLength;var c,d,f,h;d=o,h=(c=s)[0]<<16|c[1]<<8|c[2],d.data=new Uint8Array,1===h&&(d.packetLength=6+(c[4]<<8|c[5]),d.dataAlignmentIndicator=0!=(4&c[6]),192&(f=c[7])&&(d.pts=(14&c[9])<<27|(255&c[10])<<20|(254&c[11])<<12|(255&c[12])<<5|(254&c[13])>>>3,d.pts*=4,d.pts+=(6&c[13])>>>1,d.dts=d.pts,64&f&&(d.dts=(14&c[14])<<27|(255&c[15])<<20|(254&c[16])<<12|(255&c[17])<<5|(254&c[18])>>>3,d.dts*=4,d.dts+=(6&c[18])>>>1)),d.data=c.subarray(9+c[8])),i="video"===n||o.packetLength<=e.size,(r||i)&&(e.size=0,e.data.length=0),i&&t.trigger("data",o)}};He.prototype.init.call(this),this.push=function(o){({pat:function(){},pes:function(){var e,t;switch(o.streamType){case De.H264_STREAM_TYPE:e=r,t="video";break;case De.ADTS_STREAM_TYPE:e=i,t="audio";break;case De.METADATA_STREAM_TYPE:e=a,t="timed-metadata";break;default:return}o.payloadUnitStartIndicator&&s(e,t,!0),e.data.push(o),e.size+=o.data.byteLength},pmt:function(){var r={type:"metadata",tracks:[]};null!==(e=o.programMapTable).video&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),n=!0,t.trigger("data",r)}})[o.type]()},this.reset=function(){r.size=0,r.data.length=0,i.size=0,i.data.length=0,this.trigger("reset")},this.flushStreams_=function(){s(r,"video"),s(i,"audio"),s(a,"timed-metadata")},this.flush=function(){if(!n&&e){var r={type:"metadata",tracks:[]};null!==e.video&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),t.trigger("data",r)}n=!1,this.flushStreams_(),this.trigger("done")}},He.prototype=new H;var Ze={PAT_PID:0,MP2T_PACKET_LENGTH:Ye,TransportPacketStream:je,TransportParseStream:qe,ElementaryStream:He,TimestampRolloverStream:Ve,CaptionStream:Re.CaptionStream,Cea608Stream:Re.Cea608Stream,Cea708Stream:Re.Cea708Stream,MetadataStream:Ge};for(var Ke in De)De.hasOwnProperty(Ke)&&(Ze[Ke]=De[Ke]);var ze,We=Ze,Xe=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];ze=function(e){var t,n=0;ze.prototype.init.call(this),this.skipWarn_=function(e,t){this.trigger("log",{level:"warn",message:"adts skiping bytes "+e+" to "+t+" in frame "+n+" outside syncword"})},this.push=function(r){var i,a,s,o,l,u=0;if(e||(n=0),"audio"===r.type){var c;for(t&&t.length?(s=t,(t=new Uint8Array(s.byteLength+r.data.byteLength)).set(s),t.set(r.data,s.byteLength)):t=r.data;u+7<t.length;)if(255===t[u]&&240==(246&t[u+1])){if("number"==typeof c&&(this.skipWarn_(c,u),c=null),a=2*(1&~t[u+1]),i=(3&t[u+3])<<11|t[u+4]<<3|(224&t[u+5])>>5,l=9e4*(o=1024*(1+(3&t[u+6])))/Xe[(60&t[u+2])>>>2],t.byteLength-u<i)break;this.trigger("data",{pts:r.pts+n*l,dts:r.dts+n*l,sampleCount:o,audioobjecttype:1+(t[u+2]>>>6&3),channelcount:(1&t[u+2])<<2|(192&t[u+3])>>>6,samplerate:Xe[(60&t[u+2])>>>2],samplingfrequencyindex:(60&t[u+2])>>>2,samplesize:16,data:t.subarray(u+7+a,u+i)}),n++,u+=i}else"number"!=typeof c&&(c=u),u++;"number"==typeof c&&(this.skipWarn_(c,u),c=null),t=t.subarray(u)}},this.flush=function(){n=0,this.trigger("done")},this.reset=function(){t=void 0,this.trigger("reset")},this.endTimeline=function(){t=void 0,this.trigger("endedtimeline")}},ze.prototype=new H;var $e,Qe,Je,et=ze,tt=function(e){var t=e.byteLength,n=0,r=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+r},this.loadWord=function(){var i=e.byteLength-t,a=new Uint8Array(4),s=Math.min(4,t);if(0===s)throw new Error("no bytes available");a.set(e.subarray(i,i+s)),n=new DataView(a.buffer).getUint32(0),r=8*s,t-=s},this.skipBits=function(e){var i;r>e?(n<<=e,r-=e):(e-=r,e-=8*(i=Math.floor(e/8)),t-=i,this.loadWord(),n<<=e,r-=e)},this.readBits=function(e){var i=Math.min(r,e),a=n>>>32-i;return(r-=i)>0?n<<=i:t>0&&this.loadWord(),(i=e-i)>0?a<<i|this.readBits(i):a},this.skipLeadingZeros=function(){var e;for(e=0;e<r;++e)if(0!=(n&2147483648>>>e))return n<<=e,r-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};Qe=function(){var e,t,n=0;Qe.prototype.init.call(this),this.push=function(r){var i;t?((i=new Uint8Array(t.byteLength+r.data.byteLength)).set(t),i.set(r.data,t.byteLength),t=i):t=r.data;for(var a=t.byteLength;n<a-3;n++)if(1===t[n+2]){e=n+5;break}for(;e<a;)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}n+3!==e-2&&this.trigger("data",t.subarray(n+3,e-2));do{e++}while(1!==t[e]&&e<a);n=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(n+3,e-2)),n=e-2,e+=3;break;default:e+=3}t=t.subarray(n),e-=n,n=0},this.reset=function(){t=null,n=0,this.trigger("reset")},this.flush=function(){t&&t.byteLength>3&&this.trigger("data",t.subarray(n+3)),t=null,n=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},Qe.prototype=new H,Je={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},$e=function(){var e,t,n,r,i,a,s,o=new Qe;$e.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,n=e.pts,r=e.dts,o.push(e))},o.on("data",(function(s){var o={trackId:t,pts:n,dts:r,data:s,nalUnitTypeCode:31&s[0]};switch(o.nalUnitTypeCode){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=i(s.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=i(s.subarray(1)),o.config=a(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",o)})),o.on("done",(function(){e.trigger("done")})),o.on("partialdone",(function(){e.trigger("partialdone")})),o.on("reset",(function(){e.trigger("reset")})),o.on("endedtimeline",(function(){e.trigger("endedtimeline")})),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},s=function(e,t){var n,r=8,i=8;for(n=0;n<e;n++)0!==i&&(i=(r+t.readExpGolomb()+256)%256),r=0===i?r:i},i=function(e){for(var t,n,r=e.byteLength,i=[],a=1;a<r-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(i.push(a+2),a+=2):a++;if(0===i.length)return e;t=r-i.length,n=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===i[0]&&(s++,i.shift()),n[a]=e[s];return n},a=function(e){var t,n,r,i,a,o,l,u,c,d,f,h,p=0,g=0,m=0,y=0,v=[1,1];if(n=(t=new tt(e)).readUnsignedByte(),i=t.readUnsignedByte(),r=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),Je[n]&&(3===(a=t.readUnsignedExpGolomb())&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(f=3!==a?8:12,h=0;h<f;h++)t.readBoolean()&&s(h<6?16:64,t);if(t.skipUnsignedExpGolomb(),0===(o=t.readUnsignedExpGolomb()))t.readUnsignedExpGolomb();else if(1===o)for(t.skipBits(1),t.skipExpGolomb(),t.skipExpGolomb(),l=t.readUnsignedExpGolomb(),h=0;h<l;h++)t.skipExpGolomb();if(t.skipUnsignedExpGolomb(),t.skipBits(1),u=t.readUnsignedExpGolomb(),c=t.readUnsignedExpGolomb(),0===(d=t.readBits(1))&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(p=t.readUnsignedExpGolomb(),g=t.readUnsignedExpGolomb(),m=t.readUnsignedExpGolomb(),y=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(t.readUnsignedByte()){case 1:v=[1,1];break;case 2:v=[12,11];break;case 3:v=[10,11];break;case 4:v=[16,11];break;case 5:v=[40,33];break;case 6:v=[24,11];break;case 7:v=[20,11];break;case 8:v=[32,11];break;case 9:v=[80,33];break;case 10:v=[18,11];break;case 11:v=[15,11];break;case 12:v=[64,33];break;case 13:v=[160,99];break;case 14:v=[4,3];break;case 15:v=[3,2];break;case 16:v=[2,1];break;case 255:v=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()]}v&&(v[0],v[1])}return{profileIdc:n,levelIdc:r,profileCompatibility:i,width:16*(u+1)-2*p-2*g,height:(2-d)*(c+1)*16-2*m-2*y,sarRatio:v}}},$e.prototype=new H;var nt,rt={H264Stream:$e,NalByteStream:Qe},it=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],at=function(e,t){var n=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return n=n>=0?n:0,(16&e[t+5])>>4?n+20:n+10},st=function e(t,n){return t.length-n<10||t[n]!=="I".charCodeAt(0)||t[n+1]!=="D".charCodeAt(0)||t[n+2]!=="3".charCodeAt(0)?n:e(t,n+=at(t,n))},ot=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},lt={isLikelyAacData:function(e){var t=st(e,0);return e.length>=t+2&&255==(255&e[t])&&240==(240&e[t+1])&&16==(22&e[t+1])},parseId3TagSize:at,parseAdtsSize:function(e,t){var n=(224&e[t+5])>>5,r=e[t+4]<<3;return 6144&e[t+3]|r|n},parseType:function(e,t){return e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&240==(240&e[t+1])?"audio":null},parseSampleRate:function(e){for(var t=0;t+5<e.length;){if(255===e[t]&&240==(246&e[t+1]))return it[(60&e[t+2])>>>2];t++}return null},parseAacTimestamp:function(e){var t,n,r;t=10,64&e[5]&&(t+=4,t+=ot(e.subarray(10,14)));do{if((n=ot(e.subarray(t+4,t+8)))<1)return null;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){r=e.subarray(t+10,t+n+10);for(var i=0;i<r.byteLength;i++)if(0===r[i]){var a=unescape(function(e,t,n){var r,i="";for(r=0;r<n;r++)i+="%"+("00"+e[r].toString(16)).slice(-2);return i}(r,0,i));if("com.apple.streaming.transportStreamTimestamp"===a){var s=r.subarray(i+1),o=(1&s[3])<<30|s[4]<<22|s[5]<<14|s[6]<<6|s[7]>>>2;return(o*=4)+(3&s[7])}break}}t+=10,t+=n}while(t<e.byteLength);return null}};(nt=function(){var e=new Uint8Array,t=0;nt.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(n){var r,i,a,s,o=0,l=0;for(e.length?(s=e.length,(e=new Uint8Array(n.byteLength+s)).set(e.subarray(0,s)),e.set(n,s)):e=n;e.length-l>=3;)if(e[l]!=="I".charCodeAt(0)||e[l+1]!=="D".charCodeAt(0)||e[l+2]!=="3".charCodeAt(0))if(255!=(255&e[l])||240!=(240&e[l+1]))l++;else{if(e.length-l<7)break;if(l+(o=lt.parseAdtsSize(e,l))>e.length)break;a={type:"audio",data:e.subarray(l,l+o),pts:t,dts:t},this.trigger("data",a),l+=o}else{if(e.length-l<10)break;if(l+(o=lt.parseId3TagSize(e,l))>e.length)break;i={type:"timed-metadata",data:e.subarray(l,l+o)},this.trigger("data",i),l+=o}r=e.length-l,e=r>0?e.subarray(l):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){e=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new H;var ut,ct,dt,ft,ht=nt,pt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],gt=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],mt=rt.H264Stream,yt=lt.isLikelyAacData,vt=function(e,t){t.stream=e,this.trigger("log",t)},_t=function(e,t){for(var n=Object.keys(t),r=0;r<n.length;r++){var i=n[r];"headOfPipeline"!==i&&t[i].on&&t[i].on("log",vt.bind(e,i))}},Tt=function(e,t){var n;if(e.length!==t.length)return!1;for(n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0},Et=function(e,t,n,r,i,a){return{start:{dts:e,pts:e+(n-t)},end:{dts:e+(r-t),pts:e+(i-n)},prependedContentDuration:a,baseMediaDecodeTime:e}};ct=function(e,t){var n,r=[],i=0,a=0,s=1/0;n=(t=t||{}).firstSequenceNumber||0,ct.prototype.init.call(this),this.push=function(t){me(e,t),e&&pt.forEach((function(n){e[n]=t[n]})),r.push(t)},this.setEarliestDts=function(e){i=e},this.setVideoBaseMediaDecodeTime=function(e){s=e},this.setAudioAppendStart=function(e){a=e},this.flush=function(){var o,l,u,c,d,f,h;0!==r.length?(o=function(e,t,n){return t.minSegmentDts>=n?e:(t.minSegmentDts=1/0,e.filter((function(e){return e.dts>=n&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)})))}(r,e,i),e.baseMediaDecodeTime=ge(e,t.keepOriginalTimestamps),h=he(e,o,a,s),e.samples=function(e){var t,n,r=[];for(t=0;t<e.length;t++)n=e[t],r.push({size:n.data.byteLength,duration:1024});return r}(o),u=ee(function(e){var t,n,r=0,i=new Uint8Array(function(e){var t,n=0;for(t=0;t<e.length;t++)n+=e[t].data.byteLength;return n}(e));for(t=0;t<e.length;t++)n=e[t],i.set(n.data,r),r+=n.data.byteLength;return i}(o)),r=[],l=te(n,[e]),c=new Uint8Array(l.byteLength+u.byteLength),n++,c.set(l),c.set(u,l.byteLength),pe(e),d=Math.ceil(9216e4/e.samplerate),o.length&&(f=o.length*d,this.trigger("segmentTimingInfo",Et(ce(e.baseMediaDecodeTime,e.samplerate),o[0].dts,o[0].pts,o[0].dts+f,o[0].pts+f,h||0)),this.trigger("timingInfo",{start:o[0].pts,end:o[0].pts+f})),this.trigger("data",{track:e,boxes:c}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")},this.reset=function(){pe(e),r=[],this.trigger("reset")}},ct.prototype=new H,ut=function(e,t){var n,r,i,a=[],s=[];n=(t=t||{}).firstSequenceNumber||0,ut.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){me(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||r||(r=t.config,e.sps=[t.data],gt.forEach((function(t){e[t]=r[t]}),this)),"pic_parameter_set_rbsp"!==t.nalUnitType||i||(i=t.data,e.pps=[t.data]),a.push(t)},this.flush=function(){for(var r,i,o,l,u,c,d,f,h=0;a.length&&"access_unit_delimiter_rbsp"!==a[0].nalUnitType;)a.shift();if(0===a.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(r=function(e){var t,n,r=[],i=[];for(i.byteLength=0,i.nalCount=0,i.duration=0,r.byteLength=0,t=0;t<e.length;t++)"access_unit_delimiter_rbsp"===(n=e[t]).nalUnitType?(r.length&&(r.duration=n.dts-r.dts,i.byteLength+=r.byteLength,i.nalCount+=r.length,i.duration+=r.duration,i.push(r)),(r=[n]).byteLength=n.data.byteLength,r.pts=n.pts,r.dts=n.dts):("slice_layer_without_partitioning_rbsp_idr"===n.nalUnitType&&(r.keyFrame=!0),r.duration=n.dts-r.dts,r.byteLength+=n.data.byteLength,r.push(n));return i.length&&(!r.duration||r.duration<=0)&&(r.duration=i[i.length-1].duration),i.byteLength+=r.byteLength,i.nalCount+=r.length,i.duration+=r.duration,i.push(r),i}(a),(o=function(e){var t,n,r=[],i=[];for(r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,i.byteLength=0,i.nalCount=0,i.duration=0,i.pts=e[0].pts,i.dts=e[0].dts,t=0;t<e.length;t++)(n=e[t]).keyFrame?(r.length&&(i.push(r),i.byteLength+=r.byteLength,i.nalCount+=r.nalCount,i.duration+=r.duration),(r=[n]).nalCount=n.length,r.byteLength=n.byteLength,r.pts=n.pts,r.dts=n.dts,r.duration=n.duration):(r.duration+=n.duration,r.nalCount+=n.length,r.byteLength+=n.byteLength,r.push(n));return i.length&&r.duration<=0&&(r.duration=i[i.length-1].duration),i.byteLength+=r.byteLength,i.nalCount+=r.nalCount,i.duration+=r.duration,i.push(r),i}(r))[0][0].keyFrame||((i=this.getGopForFusion_(a[0],e))?(h=i.duration,o.unshift(i),o.byteLength+=i.byteLength,o.nalCount+=i.nalCount,o.pts=i.pts,o.dts=i.dts,o.duration+=i.duration):o=function(e){var t;return!e[0][0].keyFrame&&e.length>1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e}(o)),s.length){var p;if(!(p=t.alignGopsAtEnd?this.alignGopsAtEnd_(o):this.alignGopsAtStart_(o)))return this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");pe(e),o=p}me(e,o),e.samples=function(e,t){var n,r,i,a,s,o=t||0,l=[];for(n=0;n<e.length;n++)for(a=e[n],r=0;r<a.length;r++)s=a[r],o+=(i=ne(s,o)).size,l.push(i);return l}(o),u=ee(function(e){var t,n,r,i,a,s,o=0,l=e.byteLength,u=e.nalCount,c=new Uint8Array(l+4*u),d=new DataView(c.buffer);for(t=0;t<e.length;t++)for(i=e[t],n=0;n<i.length;n++)for(a=i[n],r=0;r<a.length;r++)s=a[r],d.setUint32(o,s.data.byteLength),o+=4,c.set(s.data,o),o+=s.data.byteLength;return c}(o)),e.baseMediaDecodeTime=ge(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",o.map((function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}}))),d=o[0],f=o[o.length-1],this.trigger("segmentTimingInfo",Et(e.baseMediaDecodeTime,d.dts,d.pts,f.dts+f.duration,f.pts+f.duration,h)),this.trigger("timingInfo",{start:o[0].pts,end:o[o.length-1].pts+o[o.length-1].duration}),this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),l=te(n,[e]),c=new Uint8Array(l.byteLength+u.byteLength),n++,c.set(l),c.set(u,l.byteLength),this.trigger("data",{track:e,boxes:c}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),a=[],this.gopCache_.length=0,s.length=0,this.trigger("reset")},this.resetStream_=function(){pe(e),r=void 0,i=void 0},this.getGopForFusion_=function(t){var n,r,i,a,s,o=1/0;for(s=0;s<this.gopCache_.length;s++)i=(a=this.gopCache_[s]).gop,e.pps&&Tt(e.pps[0],a.pps[0])&&e.sps&&Tt(e.sps[0],a.sps[0])&&(i.dts<e.timelineStartInfo.dts||(n=t.dts-i.dts-i.duration)>=-1e4&&n<=45e3&&(!r||o>n)&&(r=a,o=n));return r?r.gop:null},this.alignGopsAtStart_=function(e){var t,n,r,i,a,o,l,u;for(a=e.byteLength,o=e.nalCount,l=e.duration,t=n=0;t<s.length&&n<e.length&&(r=s[t],i=e[n],r.pts!==i.pts);)i.pts>r.pts?t++:(n++,a-=i.byteLength,o-=i.nalCount,l-=i.duration);return 0===n?e:n===e.length?null:((u=e.slice(n)).byteLength=a,u.duration=l,u.nalCount=o,u.pts=u[0].pts,u.dts=u[0].dts,u)},this.alignGopsAtEnd_=function(e){var t,n,r,i,a,o,l;for(t=s.length-1,n=e.length-1,a=null,o=!1;t>=0&&n>=0;){if(r=s[t],i=e[n],r.pts===i.pts){o=!0;break}r.pts>i.pts?t--:(t===s.length-1&&(a=n),n--)}if(!o&&null===a)return null;if(0===(l=o?n:a))return e;var u=e.slice(l),c=u.reduce((function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e}),{byteLength:0,duration:0,nalCount:0});return u.byteLength=c.byteLength,u.duration=c.duration,u.nalCount=c.nalCount,u.pts=u[0].pts,u.dts=u[0].dts,u},this.alignGopsWith=function(e){s=e}},ut.prototype=new H,ft=function(e,t){this.numberOfTracks=0,this.metadataStream=t,void 0!==(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps?this.keepOriginalTimestamps=e.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,ft.prototype.init.call(this),this.push=function(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),void("audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes))))}},ft.prototype=new H,ft.prototype.flush=function(e){var t,n,r,i,s=0,o={captions:[],captionStreams:{},metadata:[],info:{}},l=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(l=this.videoTrack.timelineStartInfo.pts,gt.forEach((function(e){o.info[e]=this.videoTrack[e]}),this)):this.audioTrack&&(l=this.audioTrack.timelineStartInfo.pts,pt.forEach((function(e){o.info[e]=this.audioTrack[e]}),this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?o.type=this.pendingTracks[0].type:o.type="combined",this.emittedTracks+=this.pendingTracks.length,r=function(e){var t,n=a(),r=u(e);return(t=new Uint8Array(n.byteLength+r.byteLength)).set(n),t.set(r,n.byteLength),t}(this.pendingTracks),o.initSegment=new Uint8Array(r.byteLength),o.initSegment.set(r),o.data=new Uint8Array(this.pendingBytes),i=0;i<this.pendingBoxes.length;i++)o.data.set(this.pendingBoxes[i],s),s+=this.pendingBoxes[i].byteLength;for(i=0;i<this.pendingCaptions.length;i++)(t=this.pendingCaptions[i]).startTime=fe(t.startPts,l,this.keepOriginalTimestamps),t.endTime=fe(t.endPts,l,this.keepOriginalTimestamps),o.captionStreams[t.stream]=!0,o.captions.push(t);for(i=0;i<this.pendingMetadata.length;i++)(n=this.pendingMetadata[i]).cueTime=fe(n.pts,l,this.keepOriginalTimestamps),o.metadata.push(n);for(o.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",o),i=0;i<o.captions.length;i++)t=o.captions[i],this.trigger("caption",t);for(i=0;i<o.metadata.length;i++)n=o.metadata[i],this.trigger("id3Frame",n)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},ft.prototype.setRemux=function(e){this.remuxTracks=e},dt=function(e){var t,n,r=this,i=!0;dt.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var i={};this.transmuxPipeline_=i,i.type="aac",i.metadataStream=new We.MetadataStream,i.aacStream=new ht,i.audioTimestampRolloverStream=new We.TimestampRolloverStream("audio"),i.timedMetadataTimestampRolloverStream=new We.TimestampRolloverStream("timed-metadata"),i.adtsStream=new et,i.coalesceStream=new ft(e,i.metadataStream),i.headOfPipeline=i.aacStream,i.aacStream.pipe(i.audioTimestampRolloverStream).pipe(i.adtsStream),i.aacStream.pipe(i.timedMetadataTimestampRolloverStream).pipe(i.metadataStream).pipe(i.coalesceStream),i.metadataStream.on("timestamp",(function(e){i.aacStream.setTimestamp(e.timeStamp)})),i.aacStream.on("data",(function(a){"timed-metadata"!==a.type&&"audio"!==a.type||i.audioSegmentStream||(n=n||{timelineStartInfo:{baseMediaDecodeTime:r.baseMediaDecodeTime},codec:"adts",type:"audio"},i.coalesceStream.numberOfTracks++,i.audioSegmentStream=new ct(n,e),i.audioSegmentStream.on("log",r.getLogTrigger_("audioSegmentStream")),i.audioSegmentStream.on("timingInfo",r.trigger.bind(r,"audioTimingInfo")),i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream),r.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!t}))})),i.coalesceStream.on("data",this.trigger.bind(this,"data")),i.coalesceStream.on("done",this.trigger.bind(this,"done")),_t(this,i)},this.setupTsPipeline=function(){var i={};this.transmuxPipeline_=i,i.type="ts",i.metadataStream=new We.MetadataStream,i.packetStream=new We.TransportPacketStream,i.parseStream=new We.TransportParseStream,i.elementaryStream=new We.ElementaryStream,i.timestampRolloverStream=new We.TimestampRolloverStream,i.adtsStream=new et,i.h264Stream=new mt,i.captionStream=new We.CaptionStream(e),i.coalesceStream=new ft(e,i.metadataStream),i.headOfPipeline=i.packetStream,i.packetStream.pipe(i.parseStream).pipe(i.elementaryStream).pipe(i.timestampRolloverStream),i.timestampRolloverStream.pipe(i.h264Stream),i.timestampRolloverStream.pipe(i.adtsStream),i.timestampRolloverStream.pipe(i.metadataStream).pipe(i.coalesceStream),i.h264Stream.pipe(i.captionStream).pipe(i.coalesceStream),i.elementaryStream.on("data",(function(a){var s;if("metadata"===a.type){for(s=a.tracks.length;s--;)t||"video"!==a.tracks[s].type?n||"audio"!==a.tracks[s].type||((n=a.tracks[s]).timelineStartInfo.baseMediaDecodeTime=r.baseMediaDecodeTime):(t=a.tracks[s]).timelineStartInfo.baseMediaDecodeTime=r.baseMediaDecodeTime;t&&!i.videoSegmentStream&&(i.coalesceStream.numberOfTracks++,i.videoSegmentStream=new ut(t,e),i.videoSegmentStream.on("log",r.getLogTrigger_("videoSegmentStream")),i.videoSegmentStream.on("timelineStartInfo",(function(t){n&&!e.keepOriginalTimestamps&&(n.timelineStartInfo=t,i.audioSegmentStream.setEarliestDts(t.dts-r.baseMediaDecodeTime))})),i.videoSegmentStream.on("processedGopsInfo",r.trigger.bind(r,"gopInfo")),i.videoSegmentStream.on("segmentTimingInfo",r.trigger.bind(r,"videoSegmentTimingInfo")),i.videoSegmentStream.on("baseMediaDecodeTime",(function(e){n&&i.audioSegmentStream.setVideoBaseMediaDecodeTime(e)})),i.videoSegmentStream.on("timingInfo",r.trigger.bind(r,"videoTimingInfo")),i.h264Stream.pipe(i.videoSegmentStream).pipe(i.coalesceStream)),n&&!i.audioSegmentStream&&(i.coalesceStream.numberOfTracks++,i.audioSegmentStream=new ct(n,e),i.audioSegmentStream.on("log",r.getLogTrigger_("audioSegmentStream")),i.audioSegmentStream.on("timingInfo",r.trigger.bind(r,"audioTimingInfo")),i.audioSegmentStream.on("segmentTimingInfo",r.trigger.bind(r,"audioSegmentTimingInfo")),i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream)),r.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!t})}})),i.coalesceStream.on("data",this.trigger.bind(this,"data")),i.coalesceStream.on("id3Frame",(function(e){e.dispatchType=i.metadataStream.dispatchType,r.trigger("id3Frame",e)})),i.coalesceStream.on("caption",this.trigger.bind(this,"caption")),i.coalesceStream.on("done",this.trigger.bind(this,"done")),_t(this,i)},this.setBaseMediaDecodeTime=function(r){var i=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=r),n&&(n.timelineStartInfo.dts=void 0,n.timelineStartInfo.pts=void 0,pe(n),i.audioTimestampRolloverStream&&i.audioTimestampRolloverStream.discontinuity()),t&&(i.videoSegmentStream&&(i.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,pe(t),i.captionStream.reset()),i.timestampRolloverStream&&i.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){n&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(t){var n=this.transmuxPipeline_;e.remux=t,n&&n.coalesceStream&&n.coalesceStream.setRemux(t)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.getLogTrigger_=function(e){var t=this;return function(n){n.stream=e,t.trigger("log",n)}},this.push=function(e){if(i){var t=yt(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),i=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){i=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},dt.prototype=new H;var bt,St,At,wt={Transmuxer:dt,VideoSegmentStream:ut,AudioSegmentStream:ct,AUDIO_PROPERTIES:pt,VIDEO_PROPERTIES:gt,generateSegmentTimingInfo:Et},It=function(e){return e>>>0},Ct=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),(t+=String.fromCharCode(e[2]))+String.fromCharCode(e[3])},Rt=It,Dt=function e(t,n){var r,i,a,s,o,l=[];if(!n.length)return null;for(r=0;r<t.byteLength;)i=Rt(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3]),a=Ct(t.subarray(r+4,r+8)),s=i>1?r+i:t.byteLength,a===n[0]&&(1===n.length?l.push(t.subarray(r+8,s)):(o=e(t.subarray(r+8,s),n.slice(1))).length&&(l=l.concat(o))),r=s;return l},Nt=It,Ot=V.getUint64,Pt=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},Mt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},xt="undefined"!=typeof window?window:void 0!==Mt?Mt:"undefined"!=typeof self?self:{},Lt=function(e){for(var t,n,r=e.byteLength,i=[],a=1;a<r-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(i.push(a+2),a+=2):a++;if(0===i.length)return e;t=r-i.length,n=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===i[0]&&(s++,i.shift()),n[a]=e[s];return n},kt=Re.CaptionStream,Ft=function(e,t){for(var n=e,r=0;r<t.length;r++){var i=t[r];if(n<i.size)return i;n-=i.size}return null},Ut=function(e,t){var n=Dt(e,["moof","traf"]),r=Dt(e,["mdat"]),i={},a=[];return r.forEach((function(e,t){var r=n[t];a.push({mdat:e,traf:r})})),a.forEach((function(e){var n,r,a=e.mdat,s=e.traf,o=function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:n.getUint32(4)},i=1&r.flags[2],a=2&r.flags[2],s=8&r.flags[2],o=16&r.flags[2],l=32&r.flags[2],u=65536&r.flags[0],c=131072&r.flags[0];return t=8,i&&(t+=4,r.baseDataOffset=n.getUint32(12),t+=4),a&&(r.sampleDescriptionIndex=n.getUint32(t),t+=4),s&&(r.defaultSampleDuration=n.getUint32(t),t+=4),o&&(r.defaultSampleSize=n.getUint32(t),t+=4),l&&(r.defaultSampleFlags=n.getUint32(t)),u&&(r.durationIsEmpty=!0),!i&&c&&(r.baseDataOffsetIsMoof=!0),r}(Dt(s,["tfhd"])[0]),l=o.trackId,u=Dt(s,["tfdt"]),c=u.length>0?function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};return 1===t.version?t.baseMediaDecodeTime=Ot(e.subarray(4)):t.baseMediaDecodeTime=Nt(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),t}(u[0]).baseMediaDecodeTime:0,d=Dt(s,["trun"]);t===l&&d.length>0&&(n=function(e,t,n){var r=t,i=n.defaultSampleDuration||0,a=n.defaultSampleSize||0,s=n.trackId,o=[];return e.forEach((function(e){var t=function(e){var t,n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},r=new DataView(e.buffer,e.byteOffset,e.byteLength),i=1&n.flags[2],a=4&n.flags[2],s=1&n.flags[1],o=2&n.flags[1],l=4&n.flags[1],u=8&n.flags[1],c=r.getUint32(4),d=8;for(i&&(n.dataOffset=r.getInt32(d),d+=4),a&&c&&(t={flags:Pt(e.subarray(d,d+4))},d+=4,s&&(t.duration=r.getUint32(d),d+=4),o&&(t.size=r.getUint32(d),d+=4),u&&(1===n.version?t.compositionTimeOffset=r.getInt32(d):t.compositionTimeOffset=r.getUint32(d),d+=4),n.samples.push(t),c--);c--;)t={},s&&(t.duration=r.getUint32(d),d+=4),o&&(t.size=r.getUint32(d),d+=4),l&&(t.flags=Pt(e.subarray(d,d+4)),d+=4),u&&(1===n.version?t.compositionTimeOffset=r.getInt32(d):t.compositionTimeOffset=r.getUint32(d),d+=4),n.samples.push(t);return n}(e).samples;t.forEach((function(e){void 0===e.duration&&(e.duration=i),void 0===e.size&&(e.size=a),e.trackId=s,e.dts=r,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),"bigint"==typeof r?(e.pts=r+xt.BigInt(e.compositionTimeOffset),r+=xt.BigInt(e.duration)):(e.pts=r+e.compositionTimeOffset,r+=e.duration)})),o=o.concat(t)})),o}(d,c,o),r=function(e,t,n){var r,i,a,s,o=new DataView(e.buffer,e.byteOffset,e.byteLength),l={logs:[],seiNals:[]};for(i=0;i+4<e.length;i+=a)if(a=o.getUint32(i),i+=4,!(a<=0))switch(31&e[i]){case 6:var u=e.subarray(i+1,i+1+a),c=Ft(i,t);if(r={nalUnitType:"sei_rbsp",size:a,data:u,escapedRBSP:Lt(u),trackId:n},c)r.pts=c.pts,r.dts=c.dts,s=c;else{if(!s){l.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+i+" for trackId "+n+". See mux.js#223."});break}r.pts=s.pts,r.dts=s.dts}l.seiNals.push(r)}return l}(a,n,l),i[l]||(i[l]={seiNals:[],logs:[]}),i[l].seiNals=i[l].seiNals.concat(r.seiNals),i[l].logs=i[l].logs.concat(r.logs))})),i},Bt=function(){var e,t,n,r,i,a,s=!1;this.isInitialized=function(){return s},this.init=function(t){e=new kt,s=!0,a=!!t&&t.isPartial,e.on("data",(function(e){e.startTime=e.startPts/r,e.endTime=e.endPts/r,i.captions.push(e),i.captionStreams[e.stream]=!0})),e.on("log",(function(e){i.logs.push(e)}))},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"==typeof t&&0===Object.keys(t).length||n===e[0]&&r===t[n])},this.parse=function(e,a,s){var o;if(!this.isInitialized())return null;if(!a||!s)return null;if(this.isNewInit(a,s))n=a[0],r=s[n];else if(null===n||!r)return t.push(e),null;for(;t.length>0;){var l=t.shift();this.parse(l,a,s)}return o=function(e,t,n){if(null===t)return null;var r=Ut(e,t)[t]||{};return{seiNals:r.seiNals,logs:r.logs,timescale:n}}(e,n,r),o&&o.logs&&(i.logs=i.logs.concat(o.logs)),null!==o&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),i):i.logs.length?{logs:i.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach((function(t){e.push(t)}))},this.flushStream=function(){if(!this.isInitialized())return null;a?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){i.captions=[],i.captionStreams={},i.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],n=null,r=null,i?this.clearParsedCaptions():i={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},jt=It,qt=function(e){return("00"+e.toString(16)).slice(-2)},Ht=V.getUint64;bt=function(e,t){var n=Dt(t,["moof","traf"]).reduce((function(t,n){var r,i,a=Dt(n,["tfhd"])[0],s=jt(a[4]<<24|a[5]<<16|a[6]<<8|a[7]),o=e[s]||9e4,l=Dt(n,["tfdt"])[0],u=new DataView(l.buffer,l.byteOffset,l.byteLength);return"bigint"==typeof(r=1===l[0]?Ht(l.subarray(4,12)):u.getUint32(4))?i=r/xt.BigInt(o):"number"!=typeof r||isNaN(r)||(i=r/o),i<Number.MAX_SAFE_INTEGER&&(i=Number(i)),i<t&&(t=i),t}),1/0);return"bigint"==typeof n||isFinite(n)?n:0},At=function(e){var t=0===e[0]?12:20;return jt(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])},St=function(e){var t=Dt(e,["moov","trak"]),n=[];return t.forEach((function(e){var t,r,i={},a=Dt(e,["tkhd"])[0];a&&(r=(t=new DataView(a.buffer,a.byteOffset,a.byteLength)).getUint8(0),i.id=0===r?t.getUint32(12):t.getUint32(20));var s=Dt(e,["mdia","hdlr"])[0];if(s){var o=Ct(s.subarray(8,12));i.type="vide"===o?"video":"soun"===o?"audio":o}var l=Dt(e,["mdia","minf","stbl","stsd"])[0];if(l){var u=l.subarray(8);i.codec=Ct(u.subarray(4,8));var c,d=Dt(u,[i.codec])[0];d&&(/^[asm]vc[1-9]$/i.test(i.codec)?(c=d.subarray(78),"avcC"===Ct(c.subarray(4,8))&&c.length>11?(i.codec+=".",i.codec+=qt(c[9]),i.codec+=qt(c[10]),i.codec+=qt(c[11])):i.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(i.codec)?(c=d.subarray(28),"esds"===Ct(c.subarray(4,8))&&c.length>20&&0!==c[19]?(i.codec+="."+qt(c[19]),i.codec+="."+qt(c[20]>>>2&63).replace(/^0/,"")):i.codec="mp4a.40.2"):i.codec=i.codec.toLowerCase())}var f=Dt(e,["mdia","mdhd"])[0];f&&(i.timescale=At(f)),n.push(i)})),n};var Gt=bt,Vt=St,Yt=function(e){var t=31&e[1];return(t<<=8)|e[2]},Zt=function(e){return!!(64&e[1])},Kt=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},zt=function(e){switch(e){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},Wt={parseType:function(e,t){var n=Yt(e);return 0===n?"pat":n===t?"pmt":t?"pes":null},parsePat:function(e){var t=Zt(e),n=4+Kt(e);return t&&(n+=e[n]+1),(31&e[n+10])<<8|e[n+11]},parsePmt:function(e){var t={},n=Zt(e),r=4+Kt(e);if(n&&(r+=e[r]+1),1&e[r+5]){var i;i=3+((15&e[r+1])<<8|e[r+2])-4;for(var a=12+((15&e[r+10])<<8|e[r+11]);a<i;){var s=r+a;t[(31&e[s+1])<<8|e[s+2]]=e[s],a+=5+((15&e[s+3])<<8|e[s+4])}return t}},parsePayloadUnitStartIndicator:Zt,parsePesType:function(e,t){switch(t[Yt(e)]){case De.H264_STREAM_TYPE:return"video";case De.ADTS_STREAM_TYPE:return"audio";case De.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(e){if(!Zt(e))return null;var t=4+Kt(e);if(t>=e.byteLength)return null;var n,r=null;return 192&(n=e[t+7])&&((r={}).pts=(14&e[t+9])<<27|(255&e[t+10])<<20|(254&e[t+11])<<12|(255&e[t+12])<<5|(254&e[t+13])>>>3,r.pts*=4,r.pts+=(6&e[t+13])>>>1,r.dts=r.pts,64&n&&(r.dts=(14&e[t+14])<<27|(255&e[t+15])<<20|(254&e[t+16])<<12|(255&e[t+17])<<5|(254&e[t+18])>>>3,r.dts*=4,r.dts+=(6&e[t+18])>>>1)),r},videoPacketContainsKeyFrame:function(e){for(var t=4+Kt(e),n=e.subarray(t),r=0,i=0,a=!1;i<n.byteLength-3;i++)if(1===n[i+2]){r=i+5;break}for(;r<n.byteLength;)switch(n[r]){case 0:if(0!==n[r-1]){r+=2;break}if(0!==n[r-2]){r++;break}i+3!==r-2&&"slice_layer_without_partitioning_rbsp_idr"===zt(31&n[i+3])&&(a=!0);do{r++}while(1!==n[r]&&r<n.length);i=r-2,r+=3;break;case 1:if(0!==n[r-1]||0!==n[r-2]){r+=3;break}"slice_layer_without_partitioning_rbsp_idr"===zt(31&n[i+3])&&(a=!0),i=r-2,r+=3;break;default:r+=3}return n=n.subarray(i),r-=i,i=0,n&&n.byteLength>3&&"slice_layer_without_partitioning_rbsp_idr"===zt(31&n[i+3])&&(a=!0),a}},Xt=Le,$t={};$t.ts=Wt,$t.aac=lt;var Qt=oe,Jt=188,en=71,tn=function(e,t,n){for(var r,i,a,s,o=0,l=Jt,u=!1;l<=e.byteLength;)if(e[o]!==en||e[l]!==en&&l!==e.byteLength)o++,l++;else{if(r=e.subarray(o,l),"pes"===$t.ts.parseType(r,t.pid)&&(i=$t.ts.parsePesType(r,t.table),a=$t.ts.parsePayloadUnitStartIndicator(r),"audio"===i&&a&&(s=$t.ts.parsePesTime(r))&&(s.type="audio",n.audio.push(s),u=!0)),u)break;o+=Jt,l+=Jt}for(o=(l=e.byteLength)-Jt,u=!1;o>=0;)if(e[o]!==en||e[l]!==en&&l!==e.byteLength)o--,l--;else{if(r=e.subarray(o,l),"pes"===$t.ts.parseType(r,t.pid)&&(i=$t.ts.parsePesType(r,t.table),a=$t.ts.parsePayloadUnitStartIndicator(r),"audio"===i&&a&&(s=$t.ts.parsePesTime(r))&&(s.type="audio",n.audio.push(s),u=!0)),u)break;o-=Jt,l-=Jt}},nn=function(e,t,n){for(var r,i,a,s,o,l,u,c=0,d=Jt,f=!1,h={data:[],size:0};d<e.byteLength;)if(e[c]!==en||e[d]!==en)c++,d++;else{if(r=e.subarray(c,d),"pes"===$t.ts.parseType(r,t.pid)&&(i=$t.ts.parsePesType(r,t.table),a=$t.ts.parsePayloadUnitStartIndicator(r),"video"===i&&(a&&!f&&(s=$t.ts.parsePesTime(r))&&(s.type="video",n.video.push(s),f=!0),!n.firstKeyFrame))){if(a&&0!==h.size){for(o=new Uint8Array(h.size),l=0;h.data.length;)u=h.data.shift(),o.set(u,l),l+=u.byteLength;if($t.ts.videoPacketContainsKeyFrame(o)){var p=$t.ts.parsePesTime(o);p?(n.firstKeyFrame=p,n.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}h.size=0}h.data.push(r),h.size+=r.byteLength}if(f&&n.firstKeyFrame)break;c+=Jt,d+=Jt}for(c=(d=e.byteLength)-Jt,f=!1;c>=0;)if(e[c]!==en||e[d]!==en)c--,d--;else{if(r=e.subarray(c,d),"pes"===$t.ts.parseType(r,t.pid)&&(i=$t.ts.parsePesType(r,t.table),a=$t.ts.parsePayloadUnitStartIndicator(r),"video"===i&&a&&(s=$t.ts.parsePesTime(r))&&(s.type="video",n.video.push(s),f=!0)),f)break;c-=Jt,d-=Jt}},rn=function(e,t){var n;return n=$t.aac.isLikelyAacData(e)?function(e){for(var t,n=!1,r=0,i=null,a=null,s=0,o=0;e.length-o>=3;){switch($t.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10){n=!0;break}if((s=$t.aac.parseId3TagSize(e,o))>e.length){n=!0;break}null===a&&(t=e.subarray(o,o+s),a=$t.aac.parseAacTimestamp(t)),o+=s;break;case"audio":if(e.length-o<7){n=!0;break}if((s=$t.aac.parseAdtsSize(e,o))>e.length){n=!0;break}null===i&&(t=e.subarray(o,o+s),i=$t.aac.parseSampleRate(t)),r++,o+=s;break;default:o++}if(n)return null}if(null===i||null===a)return null;var l=Qt/i;return{audio:[{type:"audio",dts:a,pts:a},{type:"audio",dts:a+1024*r*l,pts:a+1024*r*l}]}}(e):function(e){var t={pid:null,table:null},n={};for(var r in function(e,t){for(var n,r=0,i=Jt;i<e.byteLength;)if(e[r]!==en||e[i]!==en)r++,i++;else{switch(n=e.subarray(r,i),$t.ts.parseType(n,t.pid)){case"pat":t.pid=$t.ts.parsePat(n);break;case"pmt":var a=$t.ts.parsePmt(n);t.table=t.table||{},Object.keys(a).forEach((function(e){t.table[e]=a[e]}))}r+=Jt,i+=Jt}}(e,t),t.table)if(t.table.hasOwnProperty(r))switch(t.table[r]){case De.H264_STREAM_TYPE:n.video=[],nn(e,t,n),0===n.video.length&&delete n.video;break;case De.ADTS_STREAM_TYPE:n.audio=[],tn(e,t,n),0===n.audio.length&&delete n.audio}return n}(e),n&&(n.audio||n.video)?(function(e,t){if(e.audio&&e.audio.length){var n=t;(void 0===n||isNaN(n))&&(n=e.audio[0].dts),e.audio.forEach((function(e){e.dts=Xt(e.dts,n),e.pts=Xt(e.pts,n),e.dtsTime=e.dts/Qt,e.ptsTime=e.pts/Qt}))}if(e.video&&e.video.length){var r=t;if((void 0===r||isNaN(r))&&(r=e.video[0].dts),e.video.forEach((function(e){e.dts=Xt(e.dts,r),e.pts=Xt(e.pts,r),e.dtsTime=e.dts/Qt,e.ptsTime=e.pts/Qt})),e.firstKeyFrame){var i=e.firstKeyFrame;i.dts=Xt(i.dts,r),i.pts=Xt(i.pts,r),i.dtsTime=i.dts/Qt,i.ptsTime=i.pts/Qt}}}(n,t),n):null},an=function(){function e(e,t){this.options=t||{},this.self=e,this.init()}var t=e.prototype;return t.init=function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new wt.Transmuxer(this.options),function(e,t){t.on("data",(function(t){var n=t.initSegment;t.initSegment={data:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength};var r=t.data;t.data=r.buffer,e.postMessage({action:"data",segment:t,byteOffset:r.byteOffset,byteLength:r.byteLength},[t.data])})),t.on("done",(function(t){e.postMessage({action:"done"})})),t.on("gopInfo",(function(t){e.postMessage({action:"gopInfo",gopInfo:t})})),t.on("videoSegmentTimingInfo",(function(t){var n={start:{decode:ue(t.start.dts),presentation:ue(t.start.pts)},end:{decode:ue(t.end.dts),presentation:ue(t.end.pts)},baseMediaDecodeTime:ue(t.baseMediaDecodeTime)};t.prependedContentDuration&&(n.prependedContentDuration=ue(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:n})})),t.on("audioSegmentTimingInfo",(function(t){var n={start:{decode:ue(t.start.dts),presentation:ue(t.start.pts)},end:{decode:ue(t.end.dts),presentation:ue(t.end.pts)},baseMediaDecodeTime:ue(t.baseMediaDecodeTime)};t.prependedContentDuration&&(n.prependedContentDuration=ue(t.prependedContentDuration)),e.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:n})})),t.on("id3Frame",(function(t){e.postMessage({action:"id3Frame",id3Frame:t})})),t.on("caption",(function(t){e.postMessage({action:"caption",caption:t})})),t.on("trackinfo",(function(t){e.postMessage({action:"trackinfo",trackInfo:t})})),t.on("audioTimingInfo",(function(t){e.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:ue(t.start),end:ue(t.end)}})})),t.on("videoTimingInfo",(function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:ue(t.start),end:ue(t.end)}})})),t.on("log",(function(t){e.postMessage({action:"log",log:t})}))}(this.self,this.transmuxer)},t.pushMp4Captions=function(e){this.captionParser||(this.captionParser=new Bt,this.captionParser.init());var t=new Uint8Array(e.data,e.byteOffset,e.byteLength),n=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:n&&n.captions||[],logs:n&&n.logs||[],data:t.buffer},[t.buffer])},t.probeMp4StartTime=function(e){var t=e.timescales,n=e.data,r=Gt(t,n);this.self.postMessage({action:"probeMp4StartTime",startTime:r,data:n},[n.buffer])},t.probeMp4Tracks=function(e){var t=e.data,n=Vt(t);this.self.postMessage({action:"probeMp4Tracks",tracks:n,data:t},[t.buffer])},t.probeTs=function(e){var t=e.data,n=e.baseStartTime,r="number"!=typeof n||isNaN(n)?void 0:n*oe,i=rn(t,r),a=null;i&&((a={hasVideo:i.video&&2===i.video.length||!1,hasAudio:i.audio&&2===i.audio.length||!1}).hasVideo&&(a.videoStart=i.video[0].ptsTime),a.hasAudio&&(a.audioStart=i.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:a,data:t},[t.buffer])},t.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions()},t.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions()},t.push=function(e){var t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)},t.reset=function(){this.transmuxer.reset()},t.setTimestampOffset=function(e){var t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(le(t)))},t.setAudioAppendStart=function(e){this.transmuxer.setAudioAppendStart(Math.ceil(le(e.appendStart)))},t.setRemux=function(e){this.transmuxer.setRemux(e.remux)},t.flush=function(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})},t.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})},t.alignGopsWith=function(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())},e}();self.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new an(self,e.data.options):(this.messageHandlers||(this.messageHandlers=new an(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}}))),sl=nl(al),ol=function(e){var t=e.transmuxer,n=e.bytes,r=e.audioAppendStart,i=e.gopsToAlignWith,a=e.remux,s=e.onData,o=e.onTrackInfo,l=e.onAudioTimingInfo,u=e.onVideoTimingInfo,c=e.onVideoSegmentTimingInfo,d=e.onAudioSegmentTimingInfo,f=e.onId3,h=e.onCaptions,p=e.onDone,g=e.onEndedTimeline,m=e.onTransmuxerLog,y=e.isEndOfTimeline,v={buffer:[]},_=y;if(t.onmessage=function(n){t.currentTransmux===e&&("data"===n.data.action&&function(e,t,n){var r=e.data.segment,i=r.type,a=r.initSegment,s=r.captions,o=r.captionStreams,l=r.metadata,u=r.videoFrameDtsTime,c=r.videoFramePtsTime;t.buffer.push({captions:s,captionStreams:o,metadata:l});var d=e.data.segment.boxes||{data:e.data.segment.data},f={type:i,data:new Uint8Array(d.data,d.data.byteOffset,d.data.byteLength),initSegment:new Uint8Array(a.data,a.byteOffset,a.byteLength)};void 0!==u&&(f.videoFrameDtsTime=u),void 0!==c&&(f.videoFramePtsTime=c),n(f)}(n,v,s),"trackinfo"===n.data.action&&o(n.data.trackInfo),"gopInfo"===n.data.action&&function(e,t){t.gopInfo=e.data.gopInfo}(n,v),"audioTimingInfo"===n.data.action&&l(n.data.audioTimingInfo),"videoTimingInfo"===n.data.action&&u(n.data.videoTimingInfo),"videoSegmentTimingInfo"===n.data.action&&c(n.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===n.data.action&&d(n.data.audioSegmentTimingInfo),"id3Frame"===n.data.action&&f([n.data.id3Frame],n.data.id3Frame.dispatchType),"caption"===n.data.action&&h(n.data.caption),"endedtimeline"===n.data.action&&(_=!1,g()),"log"===n.data.action&&m(n.data.log),"transmuxed"===n.data.type&&(_||(t.onmessage=null,function(e){var t=e.transmuxedData,n=e.callback;t.buffer=[],n(t)}({transmuxedData:v,callback:p}),ll(t))))},r&&t.postMessage({action:"setAudioAppendStart",appendStart:r}),Array.isArray(i)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:i}),void 0!==a&&t.postMessage({action:"setRemux",remux:a}),n.byteLength){var T=n instanceof ArrayBuffer?n:n.buffer,E=n instanceof ArrayBuffer?0:n.byteOffset;t.postMessage({action:"push",data:T,byteOffset:E,byteLength:n.byteLength},[T])}y&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},ll=function(e){e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():ol(e.currentTransmux))},ul=function(e,t){e.postMessage({action:t}),ll(e)},cl=function(e){!function(e,t){if(!t.currentTransmux)return t.currentTransmux=e,void ul(t,e);t.transmuxQueue.push(ul.bind(null,t,e))}("reset",e)},dl=function(e){var t=e.transmuxer,n=e.endAction||e.action,r=e.callback,i=(0,u.Z)({},e,{endAction:null,transmuxer:null,callback:null});if(t.addEventListener("message",(function i(a){a.data.action===n&&(t.removeEventListener("message",i),a.data.data&&(a.data.data=new Uint8Array(a.data.data,e.byteOffset||0,e.byteLength||a.data.data.byteLength),e.data&&(e.data=a.data.data)),r(a.data))})),e.data){var a=e.data instanceof ArrayBuffer;i.byteOffset=a?0:e.data.byteOffset,i.byteLength=e.data.byteLength;var s=[a?e.data:e.data.buffer];t.postMessage(i,s)}else t.postMessage(i)},fl=-101,hl=-102,pl=function(e){e.forEach((function(e){e.abort()}))},gl=function(e,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:fl,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:hl,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:2,xhr:t}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:2,xhr:t}:null},ml=function(e,t,n){return function(r,i){var a=i.response,s=gl(r,i);if(s)return n(s,e);if(16!==a.byteLength)return n({status:i.status,message:"Invalid HLS key at URL: "+i.uri,code:2,xhr:i},e);for(var o=new DataView(a),l=new Uint32Array([o.getUint32(0),o.getUint32(4),o.getUint32(8),o.getUint32(12)]),u=0;u<t.length;u++)t[u].bytes=l;return n(null,e)}},yl=function(e,t){var n=pt(e.map.bytes);if("mp4"!==n){var r=e.map.resolvedUri||e.map.uri;return t({internal:!0,message:"Found unsupported "+(n||"unknown")+" container for initialization segment at URL: "+r,code:2})}dl({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:function(n){var r=n.tracks,i=n.data;return e.map.bytes=i,r.forEach((function(t){e.map.tracks=e.map.tracks||{},e.map.tracks[t.type]||(e.map.tracks[t.type]=t,"number"==typeof t.id&&t.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[t.id]=t.timescale))})),t(null)}})},vl=function(e){var t=e.segment,n=e.bytes,r=e.trackInfoFn,i=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,l=e.captionsFn,u=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,f=e.doneFn,h=e.onTransmuxerLog,p=t.map&&t.map.tracks||{},g=Boolean(p.audio&&p.video),m=i.bind(null,t,"audio","start"),y=i.bind(null,t,"audio","end"),v=i.bind(null,t,"video","start"),_=i.bind(null,t,"video","end");dl({action:"probeTs",transmuxer:t.transmuxer,data:n,baseStartTime:t.baseStartTime,callback:function(e){t.bytes=n=e.data;var i=e.result;i&&(r(t,{hasAudio:i.hasAudio,hasVideo:i.hasVideo,isMuxed:g}),r=null,i.hasAudio&&!g&&m(i.audioStart),i.hasVideo&&v(i.videoStart),m=null,v=null),function(e){if(!e.transmuxer.currentTransmux)return e.transmuxer.currentTransmux=e,void ol(e);e.transmuxer.transmuxQueue.push(e)}({bytes:n,transmuxer:t.transmuxer,audioAppendStart:t.audioAppendStart,gopsToAlignWith:t.gopsToAlignWith,remux:g,onData:function(e){e.type="combined"===e.type?"video":e.type,d(t,e)},onTrackInfo:function(e){r&&(g&&(e.isMuxed=!0),r(t,e))},onAudioTimingInfo:function(e){m&&void 0!==e.start&&(m(e.start),m=null),y&&void 0!==e.end&&y(e.end)},onVideoTimingInfo:function(e){v&&void 0!==e.start&&(v(e.start),v=null),_&&void 0!==e.end&&_(e.end)},onVideoSegmentTimingInfo:function(e){a(e)},onAudioSegmentTimingInfo:function(e){s(e)},onId3:function(e,n){o(t,e,n)},onCaptions:function(e){l(t,[e])},isEndOfTimeline:u,onEndedTimeline:function(){c()},onTransmuxerLog:h,onDone:function(e){f&&(e.type="combined"===e.type?"video":e.type,f(null,t,e))}})}})},_l=function(e){var t=e.segment,n=e.bytes,r=e.trackInfoFn,i=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,l=e.captionsFn,u=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,f=e.doneFn,h=e.onTransmuxerLog,p=new Uint8Array(n);if(function(e){return Qe(e,["moof"]).length>0}(p)){t.isFmp4=!0;var g=t.map.tracks,m={isFmp4:!0,hasVideo:!!g.video,hasAudio:!!g.audio};g.audio&&g.audio.codec&&"enca"!==g.audio.codec&&(m.audioCodec=g.audio.codec),g.video&&g.video.codec&&"encv"!==g.video.codec&&(m.videoCodec=g.video.codec),g.video&&g.audio&&(m.isMuxed=!0),r(t,m);var y=function(e){d(t,{data:p,type:m.hasAudio&&!m.isMuxed?"audio":"video"}),e&&e.length&&l(t,e),f(null,t,{})};dl({action:"probeMp4StartTime",timescales:t.map.timescales,data:p,transmuxer:t.transmuxer,callback:function(e){var r=e.data,a=e.startTime;n=r.buffer,t.bytes=p=r,m.hasAudio&&!m.isMuxed&&i(t,"audio","start",a),m.hasVideo&&i(t,"video","start",a),g.video&&r.byteLength&&t.transmuxer?dl({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:t.transmuxer,data:p,timescales:t.map.timescales,trackIds:[g.video.id],callback:function(e){n=e.data.buffer,t.bytes=p=e.data,e.logs.forEach((function(e){h(ks.mergeOptions(e,{stream:"mp4CaptionParser"}))})),y(e.captions)}}):y()}})}else if(t.transmuxer){if(void 0===t.container&&(t.container=pt(p)),"ts"!==t.container&&"aac"!==t.container)return r(t,{hasAudio:!1,hasVideo:!1}),void f(null,t,{});vl({segment:t,bytes:n,trackInfoFn:r,timingInfoFn:i,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:l,isEndOfTimeline:u,endedTimelineFn:c,dataFn:d,doneFn:f,onTransmuxerLog:h})}else f(null,t,{})},Tl=function(e,t){var n,r=e.id,i=e.key,a=e.encryptedBytes,s=e.decryptionWorker;s.addEventListener("message",(function e(n){if(n.data.source===r){s.removeEventListener("message",e);var i=n.data.decrypted;t(new Uint8Array(i.bytes,i.byteOffset,i.byteLength))}})),n=i.bytes.slice?i.bytes.slice():new Uint32Array(Array.prototype.slice.call(i.bytes)),s.postMessage(jo({source:r,encrypted:a,key:n,iv:i.iv}),[a.buffer,n.buffer])},El=function(e){var t=e.xhr,n=e.xhrOptions,r=e.decryptionWorker,i=e.segment,a=e.abortFn,s=e.progressFn,o=e.trackInfoFn,l=e.timingInfoFn,u=e.videoSegmentTimingInfoFn,c=e.audioSegmentTimingInfoFn,d=e.id3Fn,f=e.captionsFn,h=e.isEndOfTimeline,p=e.endedTimelineFn,g=e.dataFn,m=e.doneFn,y=e.onTransmuxerLog,v=[],_=function(e){var t=e.activeXhrs,n=e.decryptionWorker,r=e.trackInfoFn,i=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,l=e.captionsFn,u=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,f=e.doneFn,h=e.onTransmuxerLog,p=0,g=!1;return function(e,m){if(!g){if(e)return g=!0,pl(t),f(e,m);if((p+=1)===t.length){var y=function(){if(m.encryptedBytes)return function(e){var t=e.decryptionWorker,n=e.segment,r=e.trackInfoFn,i=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,l=e.captionsFn,u=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,f=e.doneFn,h=e.onTransmuxerLog;Tl({id:n.requestId,key:n.key,encryptedBytes:n.encryptedBytes,decryptionWorker:t},(function(e){n.bytes=e,_l({segment:n,bytes:n.bytes,trackInfoFn:r,timingInfoFn:i,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:l,isEndOfTimeline:u,endedTimelineFn:c,dataFn:d,doneFn:f,onTransmuxerLog:h})}))}({decryptionWorker:n,segment:m,trackInfoFn:r,timingInfoFn:i,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:l,isEndOfTimeline:u,endedTimelineFn:c,dataFn:d,doneFn:f,onTransmuxerLog:h});_l({segment:m,bytes:m.bytes,trackInfoFn:r,timingInfoFn:i,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:l,isEndOfTimeline:u,endedTimelineFn:c,dataFn:d,doneFn:f,onTransmuxerLog:h})};if(m.endOfAllRequests=Date.now(),m.map&&m.map.encryptedBytes&&!m.map.bytes)return Tl({decryptionWorker:n,id:m.requestId+"-init",encryptedBytes:m.map.encryptedBytes,key:m.map.key},(function(e){m.map.bytes=e,yl(m,(function(e){if(e)return pl(t),f(e,m);y()}))}));y()}}}}({activeXhrs:v,decryptionWorker:r,trackInfoFn:o,timingInfoFn:l,videoSegmentTimingInfoFn:u,audioSegmentTimingInfoFn:c,id3Fn:d,captionsFn:f,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:m,onTransmuxerLog:y});if(i.key&&!i.key.bytes){var T=[i.key];i.map&&!i.map.bytes&&i.map.key&&i.map.key.resolvedUri===i.key.resolvedUri&&T.push(i.map.key);var E=t(ks.mergeOptions(n,{uri:i.key.resolvedUri,responseType:"arraybuffer"}),ml(i,T,_));v.push(E)}if(i.map&&!i.map.bytes){if(i.map.key&&(!i.key||i.key.resolvedUri!==i.map.key.resolvedUri)){var b=t(ks.mergeOptions(n,{uri:i.map.key.resolvedUri,responseType:"arraybuffer"}),ml(i,[i.map.key],_));v.push(b)}var S=ks.mergeOptions(n,{uri:i.map.resolvedUri,responseType:"arraybuffer",headers:ko(i.map)}),A=function(e){var t=e.segment,n=e.finishProcessingFn;return function(e,r){var i=gl(e,r);if(i)return n(i,t);var a=new Uint8Array(r.response);if(t.map.key)return t.map.encryptedBytes=a,n(null,t);t.map.bytes=a,yl(t,(function(e){if(e)return e.xhr=r,e.status=r.status,n(e,t);n(null,t)}))}}({segment:i,finishProcessingFn:_}),w=t(S,A);v.push(w)}var I=ks.mergeOptions(n,{uri:i.part&&i.part.resolvedUri||i.resolvedUri,responseType:"arraybuffer",headers:ko(i)}),C=t(I,function(e){var t=e.segment,n=e.finishProcessingFn,r=e.responseType;return function(e,i){var a=gl(e,i);if(a)return n(a,t);var s="arraybuffer"!==r&&i.responseText?function(e){for(var t=new Uint8Array(new ArrayBuffer(e.length)),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t.buffer}(i.responseText.substring(t.lastReachedChar||0)):i.response;return t.stats=function(e){return{bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}}(i),t.key?t.encryptedBytes=new Uint8Array(s):t.bytes=new Uint8Array(s),n(null,t)}}({segment:i,finishProcessingFn:_,responseType:I.responseType}));C.addEventListener("progress",function(e){var t=e.segment,n=e.progressFn;return e.trackInfoFn,e.timingInfoFn,e.videoSegmentTimingInfoFn,e.audioSegmentTimingInfoFn,e.id3Fn,e.captionsFn,e.isEndOfTimeline,e.endedTimelineFn,e.dataFn,function(e){if(!e.target.aborted)return t.stats=ks.mergeOptions(t.stats,(i=(r=e).target,(a={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-i.requestTime||0}).bytesReceived=r.loaded,a.bandwidth=Math.floor(a.bytesReceived/a.roundTripTime*8*1e3),a)),!t.stats.firstBytesReceivedAt&&t.stats.bytesReceived&&(t.stats.firstBytesReceivedAt=Date.now()),n(e,t);var r,i,a}}({segment:i,progressFn:s,trackInfoFn:o,timingInfoFn:l,videoSegmentTimingInfoFn:u,audioSegmentTimingInfoFn:c,id3Fn:d,captionsFn:f,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g})),v.push(C);var R={};return v.forEach((function(e){e.addEventListener("loadend",function(e){var t=e.loadendState,n=e.abortFn;return function(e){e.target.aborted&&n&&!t.calledAbortFn&&(n(),t.calledAbortFn=!0)}}({loadendState:R,abortFn:a}))})),function(){return pl(v)}},bl=qs("CodecUtils"),Sl=function(e,t){var n=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&n.AUDIO&&e.mediaGroups.AUDIO[n.AUDIO]},Al=function(e){var t={};return e.forEach((function(e){var n=e.mediaType,r=e.type,i=e.details;t[n]=t[n]||[],t[n].push(B(""+r+i))})),Object.keys(t).forEach((function(e){if(t[e].length>1)return bl("multiple "+e+" codecs found as attributes: "+t[e].join(", ")+". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs."),void(t[e]=null);t[e]=t[e][0]})),t},wl=function(e){var t=0;return e.audio&&t++,e.video&&t++,t},Il=function(e,t){var n=t.attributes||{},r=Al(function(e){var t=e.attributes||{};if(t.CODECS)return j(t.CODECS)}(t)||[]);if(Sl(e,t)&&!r.audio&&!function(e,t){if(!Sl(e,t))return!0;var n=t.attributes||{},r=e.mediaGroups.AUDIO[n.AUDIO];for(var i in r)if(!r[i].uri&&!r[i].playlists)return!0;return!1}(e,t)){var i=Al(function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var n=e.mediaGroups.AUDIO[t];if(!n)return null;for(var r in n){var i=n[r];if(i.default&&i.playlists)return j(i.playlists[0].attributes.CODECS)}return null}(e,n.AUDIO)||[]);i.audio&&(r.audio=i.audio)}return r},Cl=qs("PlaylistSelector"),Rl=function(e){if(e&&e.playlist){var t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})}},Dl=function(e,t){if(!e)return"";var n=i().getComputedStyle(e);return n?n[t]:""},Nl=function(e,t){var n=e.slice();e.sort((function(e,r){var i=t(e,r);return 0===i?n.indexOf(e)-n.indexOf(r):i}))},Ol=function(e,t){var n,r;return e.attributes.BANDWIDTH&&(n=e.attributes.BANDWIDTH),n=n||i().Number.MAX_VALUE,t.attributes.BANDWIDTH&&(r=t.attributes.BANDWIDTH),n-(r||i().Number.MAX_VALUE)},Pl=function(e,t,n,r,a,s){if(e){var o={bandwidth:t,width:n,height:r,limitRenditionByPlayerDimensions:a},l=e.playlists;mo.isAudioOnly(e)&&(l=s.getAudioTrackPlaylists_(),o.audioOnly=!0);var u=l.map((function(e){var t=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,n=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return{bandwidth:e.attributes&&e.attributes.BANDWIDTH||i().Number.MAX_VALUE,width:t,height:n,playlist:e}}));Nl(u,(function(e,t){return e.bandwidth-t.bandwidth}));var c=(u=u.filter((function(e){return!mo.isIncompatible(e.playlist)}))).filter((function(e){return mo.isEnabled(e.playlist)}));c.length||(c=u.filter((function(e){return!mo.isDisabled(e.playlist)})));var d=c.filter((function(e){return e.bandwidth*el.BANDWIDTH_VARIANCE<t})),f=d[d.length-1],h=d.filter((function(e){return e.bandwidth===f.bandwidth}))[0];if(!1===a){var p=h||c[0]||u[0];if(p&&p.playlist){var g="sortedPlaylistReps";return h&&(g="bandwidthBestRep"),c[0]&&(g="enabledPlaylistReps"),Cl("choosing "+Rl(p)+" using "+g+" with options",o),p.playlist}return Cl("could not choose a playlist with options",o),null}var m=d.filter((function(e){return e.width&&e.height}));Nl(m,(function(e,t){return e.width-t.width}));var y=m.filter((function(e){return e.width===n&&e.height===r}));f=y[y.length-1];var v,_,T,E,b=y.filter((function(e){return e.bandwidth===f.bandwidth}))[0];if(b||(_=(v=m.filter((function(e){return e.width>n||e.height>r}))).filter((function(e){return e.width===v[0].width&&e.height===v[0].height})),f=_[_.length-1],T=_.filter((function(e){return e.bandwidth===f.bandwidth}))[0]),s.experimentalLeastPixelDiffSelector){var S=m.map((function(e){return e.pixelDiff=Math.abs(e.width-n)+Math.abs(e.height-r),e}));Nl(S,(function(e,t){return e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff})),E=S[0]}var A=E||T||b||h||c[0]||u[0];if(A&&A.playlist){var w="sortedPlaylistReps";return E?w="leastPixelDiffRep":T?w="resolutionPlusOneRep":b?w="resolutionBestRep":h?w="bandwidthBestRep":c[0]&&(w="enabledPlaylistReps"),Cl("choosing "+Rl(A)+" using "+w+" with options",o),A.playlist}return Cl("could not choose a playlist with options",o),null}},Ml=function(){var e=this.useDevicePixelRatio&&i().devicePixelRatio||1;return Pl(this.playlists.master,this.systemBandwidth,parseInt(Dl(this.tech_.el(),"width"),10)*e,parseInt(Dl(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},xl=function(e,t,n){var r,i;if(n&&n.cues)for(r=n.cues.length;r--;)(i=n.cues[r]).startTime>=e&&i.endTime<=t&&n.removeCue(i)},Ll=function(e){return"number"==typeof e&&isFinite(e)},kl=1/60,Fl=function(e){var t=e.startOfSegment,n=e.duration,r=e.segment,i=e.part,a=e.playlist,s=a.mediaSequence,o=a.id,l=a.segments,u=void 0===l?[]:l,c=e.mediaIndex,d=e.partIndex,f=e.timeline,h=u.length-1,p="mediaIndex/partIndex increment";e.getMediaInfoForTime?p="getMediaInfoForTime ("+e.getMediaInfoForTime+")":e.isSyncRequest&&(p="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(p+=" with independent "+e.independent);var g="number"==typeof d,m=e.segment.uri?"segment":"pre-segment",y=g?to({preloadSegment:r})-1:0;return m+" ["+(s+c)+"/"+(s+h)+"]"+(g?" part ["+d+"/"+y+"]":"")+" segment start/end ["+r.start+" => "+r.end+"]"+(g?" part start/end ["+i.start+" => "+i.end+"]":"")+" startOfSegment ["+t+"] duration ["+n+"] timeline ["+f+"] selected by ["+p+"] playlist ["+o+"]"},Ul=function(e){return e+"TimingInfo"},Bl=function(e){var t=e.timelineChangeController,n=e.currentTimeline,r=e.segmentTimeline,i=e.loaderType,a=e.audioDisabled;if(n===r)return!1;if("audio"===i){var s=t.lastTimelineChange({type:"main"});return!s||s.to!==r}if("main"===i&&a){var o=t.pendingTimelineChange({type:"audio"});return!o||o.to!==r}return!1},jl=function(e){var t=e.segmentDuration,n=e.maxDuration;return!!t&&Math.round(t)>n+Hs},ql=function(e){function t(t,n){var r;if(r=e.call(this)||this,!t)throw new TypeError("Initialization settings are required");if("function"!=typeof t.currentTime)throw new TypeError("No currentTime getter specified");if(!t.mediaSource)throw new TypeError("No MediaSource specified");return r.bandwidth=t.bandwidth,r.throughput={rate:0,count:0},r.roundTrip=NaN,r.resetStats_(),r.mediaIndex=null,r.partIndex=null,r.hasPlayed_=t.hasPlayed,r.currentTime_=t.currentTime,r.seekable_=t.seekable,r.seeking_=t.seeking,r.duration_=t.duration,r.mediaSource_=t.mediaSource,r.vhs_=t.vhs,r.loaderType_=t.loaderType,r.currentMediaInfo_=void 0,r.startingMediaInfo_=void 0,r.segmentMetadataTrack_=t.segmentMetadataTrack,r.goalBufferLength_=t.goalBufferLength,r.sourceType_=t.sourceType,r.sourceUpdater_=t.sourceUpdater,r.inbandTextTracks_=t.inbandTextTracks,r.state_="INIT",r.timelineChangeController_=t.timelineChangeController,r.shouldSaveSegmentTimingInfo_=!0,r.parse708captions_=t.parse708captions,r.useDtsForTimestampOffset_=t.useDtsForTimestampOffset,r.captionServices_=t.captionServices,r.experimentalExactManifestTimings=t.experimentalExactManifestTimings,r.checkBufferTimeout_=null,r.error_=void 0,r.currentTimeline_=-1,r.pendingSegment_=null,r.xhrOptions_=null,r.pendingSegments_=[],r.audioDisabled_=!1,r.isPendingTimestampOffset_=!1,r.gopBuffer_=[],r.timeMapping_=0,r.safeAppend_=ks.browser.IE_VERSION>=11,r.appendInitSegment_={audio:!0,video:!0},r.playlistOfLastInitSegment_={audio:null,video:null},r.callQueue_=[],r.loadQueue_=[],r.metadataQueue_={id3:[],caption:[]},r.waitingOnRemove_=!1,r.quotaExceededErrorRetryTimeout_=null,r.activeInitSegmentId_=null,r.initSegments_={},r.cacheEncryptionKeys_=t.cacheEncryptionKeys,r.keyCache_={},r.decrypter_=t.decrypter,r.syncController_=t.syncController,r.syncPoint_={segmentIndex:0,time:0},r.transmuxer_=r.createTransmuxer_(),r.triggerSyncInfoUpdate_=function(){return r.trigger("syncinfoupdate")},r.syncController_.on("syncinfoupdate",r.triggerSyncInfoUpdate_),r.mediaSource_.addEventListener("sourceopen",(function(){r.isEndOfStream_()||(r.ended_=!1)})),r.fetchAtBuffer_=!1,r.logger_=qs("SegmentLoader["+r.loaderType_+"]"),Object.defineProperty(f(r),"state",{get:function(){return this.state_},set:function(e){e!==this.state_&&(this.logger_(this.state_+" -> "+e),this.state_=e,this.trigger("statechange"))}}),r.sourceUpdater_.on("ready",(function(){r.hasEnoughInfoToAppend_()&&r.processCallQueue_()})),"main"===r.loaderType_&&r.timelineChangeController_.on("pendingtimelinechange",(function(){r.hasEnoughInfoToAppend_()&&r.processCallQueue_()})),"audio"===r.loaderType_&&r.timelineChangeController_.on("timelinechange",(function(){r.hasEnoughInfoToLoad_()&&r.processLoadQueue_(),r.hasEnoughInfoToAppend_()&&r.processCallQueue_()})),r}p(t,e);var n=t.prototype;return n.createTransmuxer_=function(){return function(e){var t=new sl;t.currentTransmux=null,t.transmuxQueue=[];var n=t.terminate;return t.terminate=function(){return t.currentTransmux=null,t.transmuxQueue.length=0,n.call(t)},t.postMessage({action:"init",options:e}),t}({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})},n.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0},n.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&i().clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},n.setAudio=function(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},n.abort=function(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)},n.abort_=function(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,i().clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},n.checkForAbort_=function(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)},n.error=function(e){return void 0!==e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_},n.endOfStream=function(){this.ended_=!0,this.transmuxer_&&cl(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},n.buffered_=function(){var e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return ks.createTimeRanges();if("main"===this.loaderType_){var t=e.hasAudio,n=e.hasVideo,r=e.isMuxed;if(n&&t&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(n)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},n.initSegmentForMap=function(e,t){if(void 0===t&&(t=!1),!e)return null;var n=qo(e),r=this.initSegments_[n];return t&&!r&&e.bytes&&(this.initSegments_[n]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),r||e},n.segmentKey=function(e,t){if(void 0===t&&(t=!1),!e)return null;var n=Ho(e),r=this.keyCache_[n];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[n]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});var i={resolvedUri:(r||e).resolvedUri};return r&&(i.bytes=r.bytes),i},n.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},n.load=function(){if(this.monitorBuffer_(),this.playlist_)return"INIT"===this.state&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY"))},n.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},n.playlist=function(e,t){if(void 0===t&&(t={}),e){var n=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));var i=null;if(n&&(n.id?i=n.id:n.uri&&(i=n.uri)),this.logger_("playlist update ["+i+" => "+(e.id||e.uri)+"]"),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!n||n.uri!==e.uri)return null!==this.mediaIndex&&(e.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");var a=e.mediaSequence-n.mediaSequence;if(this.logger_("live window shift ["+a+"]"),null!==this.mediaIndex)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var s=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!s.parts||!s.parts.length||!s.parts[this.partIndex])){var o=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=o}}r&&(r.mediaIndex-=a,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex]),r.partIndex>=0&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(n,e)}},n.pause=function(){this.checkBufferTimeout_&&(i().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},n.paused=function(){return null===this.checkBufferTimeout_},n.resetEverything=function(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))},n.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},n.resyncLoader=function(){this.transmuxer_&&cl(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})},n.remove=function(e,t,n,r){if(void 0===n&&(n=function(){}),void 0===r&&(r=!1),t===1/0&&(t=this.duration_()),t<=e)this.logger_("skipping remove because end ${end} is <= start ${start}");else if(this.sourceUpdater_&&this.getMediaInfo_()){var i=1,a=function(){0==--i&&n()};for(var s in!r&&this.audioDisabled_||(i++,this.sourceUpdater_.removeAudio(e,t,a)),(r||"main"===this.loaderType_)&&(this.gopBuffer_=function(e,t,n,r){for(var i=Math.ceil((t-r)*gt.ONE_SECOND_IN_TS),a=Math.ceil((n-r)*gt.ONE_SECOND_IN_TS),s=e.slice(),o=e.length;o--&&!(e[o].pts<=a););if(-1===o)return s;for(var l=o+1;l--&&!(e[l].pts<=i););return l=Math.max(l,0),s.splice(l,o-l+1),s}(this.gopBuffer_,e,t,this.timeMapping_),i++,this.sourceUpdater_.removeVideo(e,t,a)),this.inbandTextTracks_)xl(e,t,this.inbandTextTracks_[s]);xl(e,t,this.segmentMetadataTrack_),a()}else this.logger_("skipping remove because no source updater or starting media info")},n.monitorBuffer_=function(){this.checkBufferTimeout_&&i().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=i().setTimeout(this.monitorBufferTick_.bind(this),1)},n.monitorBufferTick_=function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&i().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=i().setTimeout(this.monitorBufferTick_.bind(this),500)},n.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var e=this.chooseNextRequest_();e&&("number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}},n.isEndOfStream_=function(e,t,n){if(void 0===e&&(e=this.mediaIndex),void 0===t&&(t=this.playlist_),void 0===n&&(n=this.partIndex),!t||!this.mediaSource_)return!1;var r="number"==typeof e&&t.segments[e],i=e+1===t.segments.length,a=!r||!r.parts||n+1===r.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&i&&a},n.chooseNextRequest_=function(){var e=this.buffered_(),t=Ws(e)||0,n=Xs(e,this.currentTime_()),r=!this.hasPlayed_()&&n>=1,i=n>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||r||i)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var s={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(s.isSyncRequest)s.mediaIndex=function(e,t,n){t=t||[];for(var r=[],i=0,a=0;a<t.length;a++){var s=t[a];if(e===s.timeline&&(r.push(a),(i+=s.duration)>n))return a}return 0===r.length?0:r[r.length-1]}(this.currentTimeline_,a,t);else if(null!==this.mediaIndex){var o=a[this.mediaIndex],l="number"==typeof this.partIndex?this.partIndex:-1;s.startOfSegment=o.end?o.end:t,o.parts&&o.parts[l+1]?(s.mediaIndex=this.mediaIndex,s.partIndex=l+1):s.mediaIndex=this.mediaIndex+1}else{var u=mo.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?t:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),c=u.segmentIndex,d=u.startTime,f=u.partIndex;s.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+t:"currentTime "+this.currentTime_(),s.mediaIndex=c,s.startOfSegment=d,s.partIndex=f}var h=a[s.mediaIndex],p=h&&"number"==typeof s.partIndex&&h.parts&&h.parts[s.partIndex];if(!h||"number"==typeof s.partIndex&&!p)return null;if("number"!=typeof s.partIndex&&h.parts&&(s.partIndex=0,p=h.parts[0]),!n&&p&&!p.independent)if(0===s.partIndex){var g=a[s.mediaIndex-1],m=g.parts&&g.parts.length&&g.parts[g.parts.length-1];m&&m.independent&&(s.mediaIndex-=1,s.partIndex=g.parts.length-1,s.independent="previous segment")}else h.parts[s.partIndex-1].independent&&(s.partIndex-=1,s.independent="previous part");var y=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return s.mediaIndex>=a.length-1&&y&&!this.seeking_()?null:this.generateSegmentInfo_(s)},n.generateSegmentInfo_=function(e){var t=e.independent,n=e.playlist,r=e.mediaIndex,i=e.startOfSegment,a=e.isSyncRequest,s=e.partIndex,o=e.forceTimestampOffset,l=e.getMediaInfoForTime,u=n.segments[r],c="number"==typeof s&&u.parts[s],d={requestId:"segment-loader-"+Math.random(),uri:c&&c.resolvedUri||u.resolvedUri,mediaIndex:r,partIndex:c?s:null,isSyncRequest:a,startOfSegment:i,playlist:n,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:u.timeline,duration:c&&c.duration||u.duration,segment:u,part:c,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:l,independent:t},f=void 0!==o?o:this.isPendingTimestampOffset_;d.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:u.timeline,currentTimeline:this.currentTimeline_,startOfSegment:i,buffered:this.buffered_(),overrideCheck:f});var h=Ws(this.sourceUpdater_.audioBuffered());return"number"==typeof h&&(d.audioAppendStart=h-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(d.gopsToAlignWith=function(e,t,n){if(null==t||!e.length)return[];var r,i=Math.ceil((t-n+3)*gt.ONE_SECOND_IN_TS);for(r=0;r<e.length&&!(e[r].pts>i);r++);return e.slice(r)}(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),d},n.timestampOffsetForSegment_=function(e){return n=(t=e).segmentTimeline,r=t.currentTimeline,i=t.startOfSegment,a=t.buffered,t.overrideCheck||n!==r?n<r?i:a.length?a.end(a.length-1):i:null;var t,n,r,i,a},n.earlyAbortWhenNeeded_=function(e){if(!this.vhs_.tech_.paused()&&this.xhrOptions_.timeout&&this.playlist_.attributes.BANDWIDTH&&!(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)){var t=this.currentTime_(),n=e.bandwidth,r=this.pendingSegment_.duration,i=mo.estimateSegmentRequestTime(r,n,this.playlist_,e.bytesReceived),a=function(e,t,n){return void 0===n&&(n=1),((e.length?e.end(e.length-1):0)-t)/n}(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(!(i<=a)){var s=function(e){var t=e.currentTime,n=e.bandwidth,r=e.duration,i=e.segmentDuration,a=e.timeUntilRebuffer,s=e.currentTimeline,o=e.syncController,l=e.master.playlists.filter((function(e){return!mo.isIncompatible(e)})),u=l.filter(mo.isEnabled);u.length||(u=l.filter((function(e){return!mo.isDisabled(e)})));var c=u.filter(mo.hasAttribute.bind(null,"BANDWIDTH")).map((function(e){var l=o.getSyncPoint(e,r,s,t)?1:2;return{playlist:e,rebufferingImpact:mo.estimateSegmentRequestTime(i,n,e)*l-a}})),d=c.filter((function(e){return e.rebufferingImpact<=0}));return Nl(d,(function(e,t){return Ol(t.playlist,e.playlist)})),d.length?d[0]:(Nl(c,(function(e,t){return e.rebufferingImpact-t.rebufferingImpact})),c[0]||null)}({master:this.vhs_.playlists.master,currentTime:t,bandwidth:n,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(s){var o=i-a-s.rebufferingImpact,l=.5;a<=Hs&&(l=1),!s.playlist||s.playlist.uri===this.playlist_.uri||o<l||(this.bandwidth=s.playlist.attributes.BANDWIDTH*el.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}}}},n.handleAbort_=function(e){this.logger_("Aborting "+Fl(e)),this.mediaRequestsAborted+=1},n.handleProgress_=function(e,t){this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId)||this.trigger("progress")},n.handleTrackInfo_=function(e,t){this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||this.checkForIllegalMediaSwitch(t)||(t=t||{},function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;var n=Object.keys(e).sort(),r=Object.keys(t).sort();if(n.length!==r.length)return!1;for(var i=0;i<n.length;i++){var a=n[i];if(a!==r[i])return!1;if(e[a]!==t[a])return!1}return!0}(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),this.checkForAbort_(e.requestId)||(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()&&this.processCallQueue_()))},n.handleTimingInfo_=function(e,t,n,r){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){var i=this.pendingSegment_,a=Ul(t);i[a]=i[a]||{},i[a][n]=r,this.logger_("timinginfo: "+t+" - "+n+" - "+r),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}},n.handleCaptions_=function(e,t){var n=this;if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId))if(0!==t.length)if(this.pendingSegment_.hasAppendedData_){var r=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),a={};t.forEach((function(e){a[e.stream]=a[e.stream]||{startTime:1/0,captions:[],endTime:0};var t=a[e.stream];t.startTime=Math.min(t.startTime,e.startTime+r),t.endTime=Math.max(t.endTime,e.endTime+r),t.captions.push(e)})),Object.keys(a).forEach((function(e){var t=a[e],s=t.startTime,o=t.endTime,l=t.captions,u=n.inbandTextTracks_;n.logger_("adding cues from "+s+" -> "+o+" for "+e),function(e,t,n){if(!e[n]){t.trigger({type:"usage",name:"vhs-608"}),t.trigger({type:"usage",name:"hls-608"});var r=n;/^cc708_/.test(n)&&(r="SERVICE"+n.split("_")[1]);var i=t.textTracks().getTrackById(r);if(i)e[n]=i;else{var a=n,s=n,o=!1,l=(t.options_.vhs&&t.options_.vhs.captionServices||{})[r];l&&(a=l.label,s=l.language,o=l.default),e[n]=t.addRemoteTextTrack({kind:"captions",id:r,default:o,label:a,language:s},!1).track}}}(u,n.vhs_.tech_,e),xl(s,o,u[e]),function(e){var t=e.inbandTextTracks,n=e.captionArray,r=e.timestampOffset;if(n){var a=i().WebKitDataCue||i().VTTCue;n.forEach((function(e){var n=e.stream;t[n].addCue(new a(e.startTime+r,e.endTime+r,e.text))}))}}({captionArray:l,inbandTextTracks:u,timestampOffset:r})})),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}else this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));else this.logger_("SegmentLoader received no captions from a caption event")},n.handleId3_=function(e,t,n){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId))if(this.pendingSegment_.hasAppendedData_){var r=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();!function(e,t,n){e.metadataTrack_||(e.metadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,e.metadataTrack_.inBandMetadataTrackDispatchType=t)}(this.inbandTextTracks_,n,this.vhs_.tech_),function(e){var t=e.inbandTextTracks,n=e.metadataArray,r=e.timestampOffset,a=e.videoDuration;if(n){var s=i().WebKitDataCue||i().VTTCue,o=t.metadataTrack_;if(o&&(n.forEach((function(e){var t=e.cueTime+r;!("number"!=typeof t||i().isNaN(t)||t<0)&&t<1/0&&e.frames.forEach((function(e){var n=new s(t,t,e.value||e.url||e.data||"");n.frame=e,n.value=e,function(e){Object.defineProperties(e.frame,{id:{get:function(){return ks.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get:function(){return ks.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get:function(){return ks.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})}(n),o.addCue(n)}))})),o.cues&&o.cues.length)){for(var l=o.cues,u=[],c=0;c<l.length;c++)l[c]&&u.push(l[c]);var d=u.reduce((function(e,t){var n=e[t.startTime]||[];return n.push(t),e[t.startTime]=n,e}),{}),f=Object.keys(d).sort((function(e,t){return Number(e)-Number(t)}));f.forEach((function(e,t){var n=d[e],r=Number(f[t+1])||a;n.forEach((function(e){e.endTime=r}))}))}}}({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:this.duration_()})}else this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,n))},n.processMetadataQueue_=function(){this.metadataQueue_.id3.forEach((function(e){return e()})),this.metadataQueue_.caption.forEach((function(e){return e()})),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]},n.processCallQueue_=function(){var e=this.callQueue_;this.callQueue_=[],e.forEach((function(e){return e()}))},n.processLoadQueue_=function(){var e=this.loadQueue_;this.loadQueue_=[],e.forEach((function(e){return e()}))},n.hasEnoughInfoToLoad_=function(){if("audio"!==this.loaderType_)return!0;var e=this.pendingSegment_;return!(!e||this.getCurrentMediaInfo_()&&Bl({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},n.getCurrentMediaInfo_=function(e){return void 0===e&&(e=this.pendingSegment_),e&&e.trackInfo||this.currentMediaInfo_},n.getMediaInfo_=function(e){return void 0===e&&(e=this.pendingSegment_),this.getCurrentMediaInfo_(e)||this.startingMediaInfo_},n.getPendingSegmentPlaylist=function(){return this.pendingSegment_?this.pendingSegment_.playlist:null},n.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready())return!1;if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;var n=t.hasAudio,r=t.hasVideo,i=t.isMuxed;return!(r&&!e.videoTimingInfo||n&&!this.audioDisabled_&&!i&&!e.audioTimingInfo||Bl({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},n.handleData_=function(e,t){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId))if(!this.callQueue_.length&&this.hasEnoughInfoToAppend_()){var n=this.pendingSegment_;if(this.setTimeMapping_(n.timeline),this.updateMediaSecondsLoaded_(n.part||n.segment),"closed"!==this.mediaSource_.readyState){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),n.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),n.isFmp4=e.isFmp4,n.timingInfo=n.timingInfo||{},n.isFmp4)this.trigger("fmp4"),n.timingInfo.start=n[Ul(t.type)].start;else{var r,i=this.getCurrentMediaInfo_(),a="main"===this.loaderType_&&i&&i.hasVideo;a&&(r=n.videoTimingInfo.start),n.timingInfo.start=this.trueSegmentStart_({currentStart:n.timingInfo.start,playlist:n.playlist,mediaIndex:n.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:a,firstVideoFrameTimeForData:r,videoTimingInfo:n.videoTimingInfo,audioTimingInfo:n.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(n,t.type),this.updateSourceBufferTimestampOffset_(n),n.isSyncRequest){this.updateTimingInfoEnd_(n),this.syncController_.saveSegmentTimingInfo({segmentInfo:n,shouldSaveTimelineMapping:"main"===this.loaderType_});var s=this.chooseNextRequest_();if(s.mediaIndex!==n.mediaIndex||s.partIndex!==n.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}n.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(n,t)}}else this.callQueue_.push(this.handleData_.bind(this,e,t))},n.updateAppendInitSegmentStatus=function(e,t){"main"!==this.loaderType_||"number"!=typeof e.timestampOffset||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)},n.getInitSegmentAndUpdateState_=function(e){var t=e.type,n=e.initSegment,r=e.map,i=e.playlist;if(r){var a=qo(r);if(this.activeInitSegmentId_===a)return null;n=this.initSegmentForMap(r,!0).bytes,this.activeInitSegmentId_=a}return n&&this.appendInitSegment_[t]?(this.playlistOfLastInitSegment_[t]=i,this.appendInitSegment_[t]=!1,this.activeInitSegmentId_=null,n):null},n.handleQuotaExceededError_=function(e,t){var n=this,r=e.segmentInfo,a=e.type,s=e.bytes,o=this.sourceUpdater_.audioBuffered(),l=this.sourceUpdater_.videoBuffered();o.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+zs(o).join(", ")),l.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+zs(l).join(", "));var u=o.length?o.start(0):0,c=o.length?o.end(o.length-1):0,d=l.length?l.start(0):0,f=l.length?l.end(l.length-1):0;if(c-u<=1&&f-d<=1)return this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: "+s.byteLength+", audio buffer: "+zs(o).join(", ")+", video buffer: "+zs(l).join(", ")+", "),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:r,type:a,bytes:s}));var h=this.currentTime_()-1;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+h),this.remove(0,h,(function(){n.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),n.waitingOnRemove_=!1,n.quotaExceededErrorRetryTimeout_=i().setTimeout((function(){n.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),n.quotaExceededErrorRetryTimeout_=null,n.processCallQueue_()}),1e3)}),!0)},n.handleAppendError_=function(e,t){var n=e.segmentInfo,r=e.type,i=e.bytes;t&&(22!==t.code?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",t),this.error(r+" append of "+i.length+"b failed for segment #"+n.mediaIndex+" in playlist "+n.playlist.id),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:n,type:r,bytes:i}))},n.appendToSourceBuffer_=function(e){var t,n,r,i=e.segmentInfo,a=e.type,s=e.initSegment,o=e.data,l=e.bytes;if(!l){var u=[o],c=o.byteLength;s&&(u.unshift(s),c+=s.byteLength),r=0,(t={bytes:c,segments:u}).bytes&&(n=new Uint8Array(t.bytes),t.segments.forEach((function(e){n.set(e,r),r+=e.byteLength}))),l=n}this.sourceUpdater_.appendBuffer({segmentInfo:i,type:a,bytes:l},this.handleAppendError_.bind(this,{segmentInfo:i,type:a,bytes:l}))},n.handleSegmentTimingInfo_=function(e,t,n){if(this.pendingSegment_&&t===this.pendingSegment_.requestId){var r=this.pendingSegment_.segment,i=e+"TimingInfo";r[i]||(r[i]={}),r[i].transmuxerPrependedSeconds=n.prependedContentDuration||0,r[i].transmuxedPresentationStart=n.start.presentation,r[i].transmuxedDecodeStart=n.start.decode,r[i].transmuxedPresentationEnd=n.end.presentation,r[i].transmuxedDecodeEnd=n.end.decode,r[i].baseMediaDecodeTime=n.baseMediaDecodeTime}},n.appendData_=function(e,t){var n=t.type,r=t.data;if(r&&r.byteLength&&("audio"!==n||!this.audioDisabled_)){var i=this.getInitSegmentAndUpdateState_({type:n,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:n,initSegment:i,data:r})}},n.loadSegment_=function(e){var t=this;this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(e):this.loadQueue_.push((function(){var n=(0,u.Z)({},e,{forceTimestampOffset:!0});(0,u.Z)(e,t.generateSegmentInfo_(n)),t.isPendingTimestampOffset_=!1,t.updateTransmuxerAndRequestSegment_(e)}))},n.updateTransmuxerAndRequestSegment_=function(e){var t=this;this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));var n=this.createSimplifiedSegmentObj_(e),r=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),i=null!==this.mediaIndex,a=e.timeline!==this.currentTimeline_&&e.timeline>0,s=r||i&&a;this.logger_("Requesting "+Fl(e)),n.map&&!n.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=El({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:n,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:s,endedTimelineFn:function(){t.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function(n){var r=n.message,i=n.level,a=n.stream;t.logger_(Fl(e)+" logged from transmuxer stream "+a+" as a "+i+": "+r)}})},n.trimBackBuffer_=function(e){var t=function(e,t,n){var r=t-el.BACK_BUFFER_LENGTH;e.length&&(r=Math.max(r,e.start(0)));var i=t-n;return Math.min(i,r)}(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)},n.createSimplifiedSegmentObj_=function(e){var t=e.segment,n=e.part,r={resolvedUri:n?n.resolvedUri:t.resolvedUri,byterange:n?n.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},i=e.playlist.segments[e.mediaIndex-1];if(i&&i.timeline===t.timeline&&(i.videoTimingInfo?r.baseStartTime=i.videoTimingInfo.transmuxedDecodeEnd:i.audioTimingInfo&&(r.baseStartTime=i.audioTimingInfo.transmuxedDecodeEnd)),t.key){var a=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);r.key=this.segmentKey(t.key),r.key.iv=a}return t.map&&(r.map=this.initSegmentForMap(t.map)),r},n.saveTransferStats_=function(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)},n.saveBandwidthRelatedStats_=function(e,t){this.pendingSegment_.byteLength=t.bytesReceived,e<kl?this.logger_("Ignoring segment's bandwidth because its duration of "+e+" is less than the min to record "+kl):(this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime)},n.handleTimeout_=function(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")},n.segmentRequestFinished_=function(e,t,n){if(this.callQueue_.length)this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,n));else if(this.saveTransferStats_(t.stats),this.pendingSegment_&&t.requestId===this.pendingSegment_.requestId){if(e){if(this.pendingSegment_=null,this.state="READY",e.code===hl)return;return this.pause(),e.code===fl?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error"))}var r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),r.endOfAllRequests=t.endOfAllRequests,n.gopInfo&&(this.gopBuffer_=function(e,t,n){if(!t.length)return e;if(n)return t.slice();for(var r=t[0].pts,i=0;i<e.length&&!(e[i].pts>=r);i++);return e.slice(0,i).concat(t)}(this.gopBuffer_,n.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(r)}},n.setTimeMapping_=function(e){var t=this.syncController_.mappingForTimeline(e);null!==t&&(this.timeMapping_=t)},n.updateMediaSecondsLoaded_=function(e){"number"==typeof e.start&&"number"==typeof e.end?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration},n.shouldUpdateTransmuxerTimestampOffset_=function(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())},n.trueSegmentStart_=function(e){var t=e.currentStart,n=e.playlist,r=e.mediaIndex,i=e.firstVideoFrameTimeForData,a=e.currentVideoTimestampOffset,s=e.useVideoTimingInfo,o=e.videoTimingInfo,l=e.audioTimingInfo;if(void 0!==t)return t;if(!s)return l.start;var u=n.segments[r-1];return 0!==r&&u&&void 0!==u.start&&u.end===i+a?o.start:i},n.waitForAppendsToComplete_=function(e){var t=this.getCurrentMediaInfo_(e);if(!t)return this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),void this.trigger("error");var n=t.hasAudio,r=t.hasVideo,i=t.isMuxed,a="main"===this.loaderType_&&r,s=!this.audioDisabled_&&n&&!i;if(e.waitingOnAppends=0,!e.hasAppendedData_)return e.timingInfo||"number"!=typeof e.timestampOffset||(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),void this.checkAppendsDone_(e);a&&e.waitingOnAppends++,s&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),s&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))},n.checkAppendsDone_=function(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_())},n.checkForIllegalMediaSwitch=function(e){var t=function(e,t,n){return"main"===e&&t&&n?n.hasAudio||n.hasVideo?t.hasVideo&&!n.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!t.hasVideo&&n.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null}(this.loaderType_,this.getCurrentMediaInfo_(),e);return!!t&&(this.error({message:t,blacklistDuration:1/0}),this.trigger("error"),!0)},n.updateSourceBufferTimestampOffset_=function(e){if(null!==e.timestampOffset&&"number"==typeof e.timingInfo.start&&!e.changedTimestampOffset&&"main"===this.loaderType_){var t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}},n.getSegmentStartTimeForTimestampOffsetCalculation_=function(e){var t=e.videoTimingInfo,n=e.audioTimingInfo,r=e.timingInfo;return this.useDtsForTimestampOffset_?t&&"number"==typeof t.transmuxedDecodeStart?t.transmuxedDecodeStart:n&&"number"==typeof n.transmuxedDecodeStart?n.transmuxedDecodeStart:r.start:r.start},n.updateTimingInfoEnd_=function(e){e.timingInfo=e.timingInfo||{};var t=this.getMediaInfo_(),n="main"===this.loaderType_&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;n&&(e.timingInfo.end="number"==typeof n.end?n.end:n.start+e.duration)},n.handleAppendsDone_=function(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var e=this.pendingSegment_;this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});var t=function(e,t){if("hls"!==t)return null;var n,r,a=(n={audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo},r=0,["video","audio"].forEach((function(e){var t=n[e+"TimingInfo"];if(t){var a,s=t.start,o=t.end;"bigint"==typeof s||"bigint"==typeof o?a=i().BigInt(o)-i().BigInt(s):"number"==typeof s&&"number"==typeof o&&(a=o-s),void 0!==a&&a>r&&(r=a)}})),"bigint"==typeof r&&r<Number.MAX_SAFE_INTEGER&&(r=Number(r)),r);if(!a)return null;var s=e.playlist.targetDuration,o=jl({segmentDuration:a,maxDuration:2*s}),l=jl({segmentDuration:a,maxDuration:s}),u="Segment with index "+e.mediaIndex+" from playlist "+e.playlist.id+" has a duration of "+a+" when the reported duration is "+e.duration+" and the target duration is "+s+". For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1";return o||l?{severity:o?"warn":"info",message:u}:null}(e,this.sourceType_);if(t&&("warn"===t.severity?ks.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",!e.isSyncRequest||(this.trigger("syncinfoupdate"),e.hasAppendedData_)){this.logger_("Appended "+Fl(e)),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),"main"!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");var n=e.segment,r=e.part,a=n.end&&this.currentTime_()-n.end>3*e.playlist.targetDuration,s=r&&r.end&&this.currentTime_()-r.end>3*e.playlist.partTargetDuration;if(a||s)return this.logger_("bad "+(a?"segment":"part")+" "+Fl(e)),void this.resetEverything();null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}else this.logger_("Throwing away un-appended sync request "+Fl(e))},n.recordThroughput_=function(e){if(e.duration<kl)this.logger_("Ignoring segment's throughput because its duration of "+e.duration+" is less than the min to record "+kl);else{var t=this.throughput.rate,n=Date.now()-e.endOfAllRequests+1,r=Math.floor(e.byteLength/n*8*1e3);this.throughput.rate+=(r-t)/++this.throughput.count}},n.addSegmentMetadataCue_=function(e){if(this.segmentMetadataTrack_){var t=e.segment,n=t.start,r=t.end;if(Ll(n)&&Ll(r)){xl(n,r,this.segmentMetadataTrack_);var a=i().WebKitDataCue||i().VTTCue,s={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:n,end:r},o=new a(n,r,JSON.stringify(s));o.value=s,this.segmentMetadataTrack_.addCue(o)}}},t}(ks.EventTarget);function Hl(){}var Gl,Vl=function(e){return"string"!=typeof e?e:e.replace(/./,(function(e){return e.toUpperCase()}))},Yl=["video","audio"],Zl=function(e,t){var n=t[e+"Buffer"];return n&&n.updating||t.queuePending[e]},Kl=function e(t,n){if(0!==n.queue.length){var r=0,i=n.queue[r];if("mediaSource"!==i.type){if("mediaSource"!==t&&n.ready()&&"closed"!==n.mediaSource.readyState&&!Zl(t,n)){if(i.type!==t){if(r=function(e,t){for(var n=0;n<t.length;n++){var r=t[n];if("mediaSource"===r.type)return null;if(r.type===e)return n}return null}(t,n.queue),null===r)return;i=n.queue[r]}return n.queue.splice(r,1),n.queuePending[t]=i,i.action(t,n),i.doneFn?void 0:(n.queuePending[t]=null,void e(t,n))}}else n.updating()||"closed"===n.mediaSource.readyState||(n.queue.shift(),i.action(n),i.doneFn&&i.doneFn(),e("audio",n),e("video",n))}},zl=function(e,t){var n=t[e+"Buffer"],r=Vl(e);n&&(n.removeEventListener("updateend",t["on"+r+"UpdateEnd_"]),n.removeEventListener("error",t["on"+r+"Error_"]),t.codecs[e]=null,t[e+"Buffer"]=null)},Wl=function(e,t){return e&&t&&-1!==Array.prototype.indexOf.call(e.sourceBuffers,t)},Xl=function(e,t,n){return function(r,i){var a=i[r+"Buffer"];if(Wl(i.mediaSource,a)){i.logger_("Appending segment "+t.mediaIndex+"'s "+e.length+" bytes to "+r+"Buffer");try{a.appendBuffer(e)}catch(e){i.logger_("Error with code "+e.code+" "+(22===e.code?"(QUOTA_EXCEEDED_ERR) ":"")+"when appending segment "+t.mediaIndex+" to "+r+"Buffer"),i.queuePending[r]=null,n(e)}}}},$l=function(e,t){return function(n,r){var i=r[n+"Buffer"];if(Wl(r.mediaSource,i)){r.logger_("Removing "+e+" to "+t+" from "+n+"Buffer");try{i.remove(e,t)}catch(i){r.logger_("Remove "+e+" to "+t+" from "+n+"Buffer failed")}}}},Ql=function(e){return function(t,n){var r=n[t+"Buffer"];Wl(n.mediaSource,r)&&(n.logger_("Setting "+t+"timestampOffset to "+e),r.timestampOffset=e)}},Jl=function(e){return function(t,n){e()}},eu=function(e){return function(t){if("open"===t.mediaSource.readyState){t.logger_("Calling mediaSource endOfStream("+(e||"")+")");try{t.mediaSource.endOfStream(e)}catch(e){ks.log.warn("Failed to call media source endOfStream",e)}}}},tu=function(e,t){return function(n){var r=Vl(e),i=H(t);n.logger_("Adding "+e+"Buffer with codec "+t+" to mediaSource");var a=n.mediaSource.addSourceBuffer(i);a.addEventListener("updateend",n["on"+r+"UpdateEnd_"]),a.addEventListener("error",n["on"+r+"Error_"]),n.codecs[e]=t,n[e+"Buffer"]=a}},nu=function(e){return function(t){var n=t[e+"Buffer"];if(zl(e,t),Wl(t.mediaSource,n)){t.logger_("Removing "+e+"Buffer with codec "+t.codecs[e]+" from mediaSource");try{t.mediaSource.removeSourceBuffer(n)}catch(t){ks.log.warn("Failed to removeSourceBuffer "+e+"Buffer",t)}}}},ru=function(e){return function(t,n){var r=n[t+"Buffer"],i=H(e);Wl(n.mediaSource,r)&&n.codecs[t]!==e&&(n.logger_("changing "+t+"Buffer codec from "+n.codecs[t]+" to "+e),r.changeType(i),n.codecs[t]=e)}},iu=function(e){var t=e.type,n=e.sourceUpdater,r=e.action,i=e.doneFn,a=e.name;n.queue.push({type:t,action:r,doneFn:i,name:a}),Kl(t,n)},au=function(e,t){return function(n){if(t.queuePending[e]){var r=t.queuePending[e].doneFn;t.queuePending[e]=null,r&&r(t[e+"Error_"])}Kl(e,t)}},su=function(e){function t(t){var n;return(n=e.call(this)||this).mediaSource=t,n.sourceopenListener_=function(){return Kl("mediaSource",f(n))},n.mediaSource.addEventListener("sourceopen",n.sourceopenListener_),n.logger_=qs("SourceUpdater"),n.audioTimestampOffset_=0,n.videoTimestampOffset_=0,n.queue=[],n.queuePending={audio:null,video:null},n.delayedAudioAppendQueue_=[],n.videoAppendQueued_=!1,n.codecs={},n.onVideoUpdateEnd_=au("video",f(n)),n.onAudioUpdateEnd_=au("audio",f(n)),n.onVideoError_=function(e){n.videoError_=e},n.onAudioError_=function(e){n.audioError_=e},n.createdSourceBuffers_=!1,n.initializedEme_=!1,n.triggeredReady_=!1,n}p(t,e);var n=t.prototype;return n.initializedEme=function(){this.initializedEme_=!0,this.triggerReady()},n.hasCreatedSourceBuffers=function(){return this.createdSourceBuffers_},n.hasInitializedAnyEme=function(){return this.initializedEme_},n.ready=function(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()},n.createSourceBuffers=function(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())},n.triggerReady=function(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))},n.addSourceBuffer=function(e,t){iu({type:"mediaSource",sourceUpdater:this,action:tu(e,t),name:"addSourceBuffer"})},n.abort=function(e){iu({type:e,sourceUpdater:this,action:function(e,t){if("open"===t.mediaSource.readyState){var n=t[e+"Buffer"];if(Wl(t.mediaSource,n)){t.logger_("calling abort on "+e+"Buffer");try{n.abort()}catch(t){ks.log.warn("Failed to abort on "+e+"Buffer",t)}}}},name:"abort"})},n.removeSourceBuffer=function(e){this.canRemoveSourceBuffer()?iu({type:"mediaSource",sourceUpdater:this,action:nu(e),name:"removeSourceBuffer"}):ks.log.error("removeSourceBuffer is not supported!")},n.canRemoveSourceBuffer=function(){return!ks.browser.IE_VERSION&&!ks.browser.IS_FIREFOX&&i().MediaSource&&i().MediaSource.prototype&&"function"==typeof i().MediaSource.prototype.removeSourceBuffer},t.canChangeType=function(){return i().SourceBuffer&&i().SourceBuffer.prototype&&"function"==typeof i().SourceBuffer.prototype.changeType},n.canChangeType=function(){return this.constructor.canChangeType()},n.changeType=function(e,t){this.canChangeType()?iu({type:e,sourceUpdater:this,action:ru(t),name:"changeType"}):ks.log.error("changeType is not supported!")},n.addOrChangeSourceBuffers=function(e){var t=this;if(!e||"object"!=typeof e||0===Object.keys(e).length)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach((function(n){var r=e[n];if(!t.hasCreatedSourceBuffers())return t.addSourceBuffer(n,r);t.canChangeType()&&t.changeType(n,r)}))},n.appendBuffer=function(e,t){var n=this,r=e.segmentInfo,i=e.type,a=e.bytes;if(this.processedAppend_=!0,"audio"===i&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([e,t]),void this.logger_("delayed audio append of "+a.length+" until video append");if(iu({type:i,sourceUpdater:this,action:Xl(a,r||{mediaIndex:-1},t),doneFn:t,name:"appendBuffer"}),"video"===i){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;var s=this.delayedAudioAppendQueue_.slice();this.logger_("queuing delayed audio "+s.length+" appendBuffers"),this.delayedAudioAppendQueue_.length=0,s.forEach((function(e){n.appendBuffer.apply(n,e)}))}},n.audioBuffered=function(){return Wl(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:ks.createTimeRange()},n.videoBuffered=function(){return Wl(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:ks.createTimeRange()},n.buffered=function(){var e=Wl(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=Wl(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():function(e,t){var n=null,r=null,i=0,a=[],s=[];if(!(e&&e.length&&t&&t.length))return ks.createTimeRange();for(var o=e.length;o--;)a.push({time:e.start(o),type:"start"}),a.push({time:e.end(o),type:"end"});for(o=t.length;o--;)a.push({time:t.start(o),type:"start"}),a.push({time:t.end(o),type:"end"});for(a.sort((function(e,t){return e.time-t.time})),o=0;o<a.length;o++)"start"===a[o].type?2==++i&&(n=a[o].time):"end"===a[o].type&&1==--i&&(r=a[o].time),null!==n&&null!==r&&(s.push([n,r]),n=null,r=null);return ks.createTimeRanges(s)}(this.audioBuffered(),this.videoBuffered())},n.setDuration=function(e,t){var n;void 0===t&&(t=Hl),iu({type:"mediaSource",sourceUpdater:this,action:(n=e,function(e){e.logger_("Setting mediaSource duration to "+n);try{e.mediaSource.duration=n}catch(e){ks.log.warn("Failed to set media source duration",e)}}),name:"duration",doneFn:t})},n.endOfStream=function(e,t){void 0===e&&(e=null),void 0===t&&(t=Hl),"string"!=typeof e&&(e=void 0),iu({type:"mediaSource",sourceUpdater:this,action:eu(e),name:"endOfStream",doneFn:t})},n.removeAudio=function(e,t,n){void 0===n&&(n=Hl),this.audioBuffered().length&&0!==this.audioBuffered().end(0)?iu({type:"audio",sourceUpdater:this,action:$l(e,t),doneFn:n,name:"remove"}):n()},n.removeVideo=function(e,t,n){void 0===n&&(n=Hl),this.videoBuffered().length&&0!==this.videoBuffered().end(0)?iu({type:"video",sourceUpdater:this,action:$l(e,t),doneFn:n,name:"remove"}):n()},n.updating=function(){return!(!Zl("audio",this)&&!Zl("video",this))},n.audioTimestampOffset=function(e){return void 0!==e&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(iu({type:"audio",sourceUpdater:this,action:Ql(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_},n.videoTimestampOffset=function(e){return void 0!==e&&this.videoBuffer&&this.videoTimestampOffset!==e&&(iu({type:"video",sourceUpdater:this,action:Ql(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_},n.audioQueueCallback=function(e){this.audioBuffer&&iu({type:"audio",sourceUpdater:this,action:Jl(e),name:"callback"})},n.videoQueueCallback=function(e){this.videoBuffer&&iu({type:"video",sourceUpdater:this,action:Jl(e),name:"callback"})},n.dispose=function(){var e=this;this.trigger("dispose"),Yl.forEach((function(t){e.abort(t),e.canRemoveSourceBuffer()?e.removeSourceBuffer(t):e[t+"QueueCallback"]((function(){return zl(t,e)}))})),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()},t}(ks.EventTarget),ou=function(e){return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))},lu=new Uint8Array("\n\n".split("").map((function(e){return e.charCodeAt(0)}))),uu=function(e){function t(){return e.call(this,"Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")||this}return p(t,e),t}(yt(Error)),cu=function(e){function t(t,n){var r;return void 0===n&&(n={}),(r=e.call(this,t,n)||this).mediaSource_=null,r.subtitlesTrack_=null,r.loaderType_="subtitle",r.featuresNativeTextTracks_=t.featuresNativeTextTracks,r.loadVttJs=t.loadVttJs,r.shouldSaveSegmentTimingInfo_=!1,r}p(t,e);var n=t.prototype;return n.createTransmuxer_=function(){return null},n.buffered_=function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return ks.createTimeRanges();var e=this.subtitlesTrack_.cues,t=e[0].startTime,n=e[e.length-1].startTime;return ks.createTimeRanges([[t,n]])},n.initSegmentForMap=function(e,t){if(void 0===t&&(t=!1),!e)return null;var n=qo(e),r=this.initSegments_[n];if(t&&!r&&e.bytes){var i=lu.byteLength+e.bytes.byteLength,a=new Uint8Array(i);a.set(e.bytes),a.set(lu,e.bytes.byteLength),this.initSegments_[n]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return r||e},n.couldBeginLoading_=function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()},n.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},n.track=function(e){return void 0===e||(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_},n.remove=function(e,t){xl(e,t,this.subtitlesTrack_)},n.fillBuffer_=function(){var e=this,t=this.chooseNextRequest_();if(t){if(null===this.syncController_.timestampOffsetForTimeline(t.timeline))return this.syncController_.one("timestampoffset",(function(){e.state="READY",e.paused()||e.monitorBuffer_()})),void(this.state="WAITING_ON_TIMELINE");this.loadSegment_(t)}},n.timestampOffsetForSegment_=function(){return null},n.chooseNextRequest_=function(){return this.skipEmptySegments_(e.prototype.chooseNextRequest_.call(this))},n.skipEmptySegments_=function(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e},n.stopForError=function(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")},n.segmentRequestFinished_=function(e,t,n){var r=this;if(this.subtitlesTrack_){if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===fl&&this.handleTimeout_(),e.code===hl?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);var a=this.pendingSegment_;this.saveBandwidthRelatedStats_(a.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");var s=a.segment;if(s.map&&(s.map.bytes=t.map.bytes),a.bytes=t.bytes,"function"!=typeof i().WebVTT&&"function"==typeof this.loadVttJs)return this.state="WAITING_ON_VTTJS",void this.loadVttJs().then((function(){return r.segmentRequestFinished_(e,t,n)}),(function(){return r.stopForError({message:"Error loading vtt.js"})}));s.requested=!0;try{this.parseVTTCues_(a)}catch(e){return void this.stopForError({message:e.message})}if(this.updateTimeMapping_(a,this.syncController_.timelines[a.timeline],this.playlist_),a.cues.length?a.timingInfo={start:a.cues[0].startTime,end:a.cues[a.cues.length-1].endTime}:a.timingInfo={start:a.startOfSegment,end:a.startOfSegment+a.duration},a.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");a.byteLength=a.bytes.byteLength,this.mediaSecondsLoaded+=s.duration,a.cues.forEach((function(e){r.subtitlesTrack_.addCue(r.featuresNativeTextTracks_?new(i().VTTCue)(e.startTime,e.endTime,e.text):e)})),function(e){var t=e.cues;if(t)for(var n=0;n<t.length;n++){for(var r=[],i=0,a=0;a<t.length;a++)t[n].startTime===t[a].startTime&&t[n].endTime===t[a].endTime&&t[n].text===t[a].text&&++i>1&&r.push(t[a]);r.length&&r.forEach((function(t){return e.removeCue(t)}))}}(this.subtitlesTrack_),this.handleAppendsDone_()}else this.state="READY"},n.handleData_=function(){},n.updateTimingInfoEnd_=function(){},n.parseVTTCues_=function(e){var t,n=!1;if("function"!=typeof i().WebVTT)throw new uu;"function"==typeof i().TextDecoder?t=new(i().TextDecoder)("utf8"):(t=i().WebVTT.StringDecoder(),n=!0);var r=new(i().WebVTT.Parser)(i(),i().vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=function(t){e.timestampmap=t},r.onparsingerror=function(e){ks.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){var a=e.segment.map.bytes;n&&(a=ou(a)),r.parse(a)}var s=e.bytes;n&&(s=ou(s)),r.parse(s),r.flush()},n.updateTimeMapping_=function(e,t,n){var r=e.segment;if(t)if(e.cues.length){var i=e.timestampmap,a=i.MPEGTS/gt.ONE_SECOND_IN_TS-i.LOCAL+t.mapping;if(e.cues.forEach((function(e){e.startTime+=a,e.endTime+=a})),!n.syncInfo){var s=e.cues[0].startTime,o=e.cues[e.cues.length-1].startTime;n.syncInfo={mediaSequence:n.mediaSequence+e.mediaIndex,time:Math.min(s,o-r.duration)}}}else r.empty=!0},t}(ql),du=function(e,t){for(var n=e.cues,r=0;r<n.length;r++){var i=n[r];if(t>=i.adStartTime&&t<=i.adEndTime)return i}return null},fu=[{name:"VOD",run:function(e,t,n,r,i){return n!==1/0?{time:0,segmentIndex:0,partIndex:null}:null}},{name:"ProgramDateTime",run:function(e,t,n,r,i){if(!Object.keys(e.timelineToDatetimeMappings).length)return null;var a=null,s=null,o=Js(t);i=i||0;for(var l=0;l<o.length;l++){var u=o[t.endList||0===i?l:o.length-(l+1)],c=u.segment,d=e.timelineToDatetimeMappings[c.timeline];if(d&&c.dateTimeObject){var f=c.dateTimeObject.getTime()/1e3+d;if(c.parts&&"number"==typeof u.partIndex)for(var h=0;h<u.partIndex;h++)f+=c.parts[h].duration;var p=Math.abs(i-f);if(null!==s&&(0===p||s<p))break;s=p,a={time:f,segmentIndex:u.segmentIndex,partIndex:u.partIndex}}}return a}},{name:"Segment",run:function(e,t,n,r,i){var a=null,s=null;i=i||0;for(var o=Js(t),l=0;l<o.length;l++){var u=o[t.endList||0===i?l:o.length-(l+1)],c=u.segment,d=u.part&&u.part.start||c&&c.start;if(c.timeline===r&&void 0!==d){var f=Math.abs(i-d);if(null!==s&&s<f)break;(!a||null===s||s>=f)&&(s=f,a={time:d,segmentIndex:u.segmentIndex,partIndex:u.partIndex})}}return a}},{name:"Discontinuity",run:function(e,t,n,r,i){var a=null;if(i=i||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var s=null,o=0;o<t.discontinuityStarts.length;o++){var l=t.discontinuityStarts[o],u=t.discontinuitySequence+o+1,c=e.discontinuities[u];if(c){var d=Math.abs(i-c.time);if(null!==s&&s<d)break;(!a||null===s||s>=d)&&(s=d,a={time:c.time,segmentIndex:l,partIndex:null})}}return a}},{name:"Playlist",run:function(e,t,n,r,i){return t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}}],hu=function(e){function t(t){var n;return(n=e.call(this)||this).timelines=[],n.discontinuities=[],n.timelineToDatetimeMappings={},n.logger_=qs("SyncController"),n}p(t,e);var n=t.prototype;return n.getSyncPoint=function(e,t,n,r){var i=this.runStrategies_(e,t,n,r);return i.length?this.selectSyncPoint_(i,{key:"time",value:r}):null},n.getExpiredTime=function(e,t){if(!e||!e.segments)return null;var n=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!n.length)return null;var r=this.selectSyncPoint_(n,{key:"segmentIndex",value:0});return r.segmentIndex>0&&(r.time*=-1),Math.abs(r.time+ao({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))},n.runStrategies_=function(e,t,n,r){for(var i=[],a=0;a<fu.length;a++){var s=fu[a],o=s.run(this,e,t,n,r);o&&(o.strategy=s.name,i.push({strategy:s.name,syncPoint:o}))}return i},n.selectSyncPoint_=function(e,t){for(var n=e[0].syncPoint,r=Math.abs(e[0].syncPoint[t.key]-t.value),i=e[0].strategy,a=1;a<e.length;a++){var s=Math.abs(e[a].syncPoint[t.key]-t.value);s<r&&(r=s,n=e[a].syncPoint,i=e[a].strategy)}return this.logger_("syncPoint for ["+t.key+": "+t.value+"] chosen with strategy ["+i+"]: [time:"+n.time+", segmentIndex:"+n.segmentIndex+("number"==typeof n.partIndex?",partIndex:"+n.partIndex:"")+"]"),n},n.saveExpiredSegmentInfo=function(e,t){var n=t.mediaSequence-e.mediaSequence;if(n>86400)ks.log.warn("Not saving expired segment info. Media sequence gap "+n+" is too large.");else for(var r=n-1;r>=0;r--){var i=e.segments[r];if(i&&void 0!==i.start){t.syncInfo={mediaSequence:e.mediaSequence+r,time:i.start},this.logger_("playlist refresh sync: [time:"+t.syncInfo.time+", mediaSequence: "+t.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}},n.setDateTimeMappingForStart=function(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){var t=e.segments[0],n=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-n}},n.saveSegmentTimingInfo=function(e){var t=e.segmentInfo,n=e.shouldSaveTimelineMapping,r=this.calculateSegmentTimeMapping_(t,t.timingInfo,n),i=t.segment;r&&(this.saveDiscontinuitySyncInfo_(t),t.playlist.syncInfo||(t.playlist.syncInfo={mediaSequence:t.playlist.mediaSequence+t.mediaIndex,time:i.start}));var a=i.dateTimeObject;i.discontinuity&&n&&a&&(this.timelineToDatetimeMappings[i.timeline]=-a.getTime()/1e3)},n.timestampOffsetForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].time},n.mappingForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping},n.calculateSegmentTimeMapping_=function(e,t,n){var r,i,a=e.segment,s=e.part,o=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)o={time:e.startOfSegment,mapping:e.startOfSegment-t.start},n&&(this.timelines[e.timeline]=o,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": [time: "+o.time+"] [mapping: "+o.mapping+"]")),r=e.startOfSegment,i=t.end+o.mapping;else{if(!o)return!1;r=t.start+o.mapping,i=t.end+o.mapping}return s&&(s.start=r,s.end=i),(!a.start||r<a.start)&&(a.start=r),a.end=i,!0},n.saveDiscontinuitySyncInfo_=function(e){var t=e.playlist,n=e.segment;if(n.discontinuity)this.discontinuities[n.timeline]={time:n.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(var r=0;r<t.discontinuityStarts.length;r++){var i=t.discontinuityStarts[r],a=t.discontinuitySequence+r+1,s=i-e.mediaIndex,o=Math.abs(s);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>o){var l;l=s<0?n.start-ao({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:i}):n.end+ao({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:i}),this.discontinuities[a]={time:l,accuracy:o}}}},n.dispose=function(){this.trigger("dispose"),this.off()},t}(ks.EventTarget),pu=function(e){function t(){var t;return(t=e.call(this)||this).pendingTimelineChanges_={},t.lastTimelineChanges_={},t}p(t,e);var n=t.prototype;return n.clearPendingTimelineChange=function(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")},n.pendingTimelineChange=function(e){var t=e.type,n=e.from,r=e.to;return"number"==typeof n&&"number"==typeof r&&(this.pendingTimelineChanges_[t]={type:t,from:n,to:r},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[t]},n.lastTimelineChange=function(e){var t=e.type,n=e.from,r=e.to;return"number"==typeof n&&"number"==typeof r&&(this.lastTimelineChanges_[t]={type:t,from:n,to:r},delete this.pendingTimelineChanges_[t],this.trigger("timelinechange")),this.lastTimelineChanges_[t]},n.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},t}(ks.EventTarget),gu=rl(il((function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{};function t(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}var r=t((function(e){function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e},e.exports.default=e.exports,e.exports.__esModule=!0})),i=t((function(e){function t(n,r){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,t(n,r)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0})),a=t((function(e){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,i(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0})),s=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var n=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(n,1),n>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var n=t.length,r=0;r<n;++r)t[r].call(this,arguments[1]);else for(var i=Array.prototype.slice.call(arguments,1),a=t.length,s=0;s<a;++s)t[s].apply(this,i)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}(),o=null,l=function(){function e(e){var t,n,r;o||(o=function(){var e,t,n,r,i,a,s,o,l=[[[],[],[],[],[]],[[],[],[],[],[]]],u=l[0],c=l[1],d=u[4],f=c[4],h=[],p=[];for(e=0;e<256;e++)p[(h[e]=e<<1^283*(e>>7))^e]=e;for(t=n=0;!d[t];t^=r||1,n=p[n]||1)for(a=(a=n^n<<1^n<<2^n<<3^n<<4)>>8^255&a^99,d[t]=a,f[a]=t,o=16843009*h[i=h[r=h[t]]]^65537*i^257*r^16843008*t,s=257*h[a]^16843008*a,e=0;e<4;e++)u[e][t]=s=s<<24^s>>>8,c[e][a]=o=o<<24^o>>>8;for(e=0;e<5;e++)u[e]=u[e].slice(0),c[e]=c[e].slice(0);return l}()),this._tables=[[o[0][0].slice(),o[0][1].slice(),o[0][2].slice(),o[0][3].slice(),o[0][4].slice()],[o[1][0].slice(),o[1][1].slice(),o[1][2].slice(),o[1][3].slice(),o[1][4].slice()]];var i=this._tables[0][4],a=this._tables[1],s=e.length,l=1;if(4!==s&&6!==s&&8!==s)throw new Error("Invalid aes key size");var u=e.slice(0),c=[];for(this._key=[u,c],t=s;t<4*s+28;t++)r=u[t-1],(t%s==0||8===s&&t%s==4)&&(r=i[r>>>24]<<24^i[r>>16&255]<<16^i[r>>8&255]<<8^i[255&r],t%s==0&&(r=r<<8^r>>>24^l<<24,l=l<<1^283*(l>>7))),u[t]=u[t-s]^r;for(n=0;t;n++,t--)r=u[3&n?t:t-4],c[n]=t<=4||n<4?r:a[0][i[r>>>24]]^a[1][i[r>>16&255]]^a[2][i[r>>8&255]]^a[3][i[255&r]]}return e.prototype.decrypt=function(e,t,n,r,i,a){var s,o,l,u,c=this._key[1],d=e^c[0],f=r^c[1],h=n^c[2],p=t^c[3],g=c.length/4-2,m=4,y=this._tables[1],v=y[0],_=y[1],T=y[2],E=y[3],b=y[4];for(u=0;u<g;u++)s=v[d>>>24]^_[f>>16&255]^T[h>>8&255]^E[255&p]^c[m],o=v[f>>>24]^_[h>>16&255]^T[p>>8&255]^E[255&d]^c[m+1],l=v[h>>>24]^_[p>>16&255]^T[d>>8&255]^E[255&f]^c[m+2],p=v[p>>>24]^_[d>>16&255]^T[f>>8&255]^E[255&h]^c[m+3],m+=4,d=s,f=o,h=l;for(u=0;u<4;u++)i[(3&-u)+a]=b[d>>>24]<<24^b[f>>16&255]<<16^b[h>>8&255]<<8^b[255&p]^c[m++],s=d,d=f,f=h,h=p,p=s},e}(),u=function(e){function t(){var t;return(t=e.call(this,s)||this).jobs=[],t.delay=1,t.timeout_=null,t}a(t,e);var n=t.prototype;return n.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},n.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},t}(s),c=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},d=function(){function e(t,n,r,i){var a=e.STEP,s=new Int32Array(t.buffer),o=new Uint8Array(t.byteLength),l=0;for(this.asyncStream_=new u,this.asyncStream_.push(this.decryptChunk_(s.subarray(l,l+a),n,r,o)),l=a;l<s.length;l+=a)r=new Uint32Array([c(s[l-4]),c(s[l-3]),c(s[l-2]),c(s[l-1])]),this.asyncStream_.push(this.decryptChunk_(s.subarray(l,l+a),n,r,o));this.asyncStream_.push((function(){var e;i(null,(e=o).subarray(0,e.byteLength-e[e.byteLength-1]))}))}return e.prototype.decryptChunk_=function(e,t,n,r){return function(){var i=function(e,t,n){var r,i,a,s,o,u,d,f,h,p=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),g=new l(Array.prototype.slice.call(t)),m=new Uint8Array(e.byteLength),y=new Int32Array(m.buffer);for(r=n[0],i=n[1],a=n[2],s=n[3],h=0;h<p.length;h+=4)o=c(p[h]),u=c(p[h+1]),d=c(p[h+2]),f=c(p[h+3]),g.decrypt(o,u,d,f,y,h),y[h]=c(y[h]^r),y[h+1]=c(y[h+1]^i),y[h+2]=c(y[h+2]^a),y[h+3]=c(y[h+3]^s),r=o,i=u,a=d,s=f;return m}(e,t,n);r.set(i,e.byteOffset)}},r(e,null,[{key:"STEP",get:function(){return 32e3}}]),e}(),f=("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{}).BigInt||Number;f("0x1"),f("0x100"),f("0x10000"),f("0x1000000"),f("0x100000000"),f("0x10000000000"),f("0x1000000000000"),f("0x100000000000000"),f("0x10000000000000000");self.onmessage=function(e){var t=e.data,n=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),r=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),i=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new d(n,r,i,(function(e,n){var r,i;self.postMessage((r={source:t.source,decrypted:n},i={},Object.keys(r).forEach((function(e){var t,n=r[e];t=n,("function"===ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer)?i[e]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:i[e]=n})),i),[n.buffer])}))}}))),mu=nl(gu),yu=function(e){var t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},vu=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},_u=function(e,t){t.activePlaylistLoader=e,e.load()},Tu={AUDIO:function(e,t){return function(){var n=t.segmentLoaders[e],r=t.mediaTypes[e],i=t.blacklistCurrentPlaylist;vu(n,r);var a=r.activeTrack(),s=r.activeGroup(),o=(s.filter((function(e){return e.default}))[0]||s[0]).id,l=r.tracks[o];if(a!==l){for(var u in ks.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),r.tracks)r.tracks[u].enabled=r.tracks[u]===l;r.onTrackChanged()}else i({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(e,t){return function(){var n=t.segmentLoaders[e],r=t.mediaTypes[e];ks.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),vu(n,r);var i=r.activeTrack();i&&(i.mode="disabled"),r.onTrackChanged()}}},Eu={AUDIO:function(e,t,n){if(t){var r=n.tech,i=n.requestOptions,a=n.segmentLoaders[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,i),(!r.paused()||e.endList&&"none"!==r.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),i),r.paused()||a.load()})),t.on("error",Tu[e](e,n))}},SUBTITLES:function(e,t,n){var r=n.tech,i=n.requestOptions,a=n.segmentLoaders[e],s=n.mediaTypes[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,i),a.track(s.activeTrack()),(!r.paused()||e.endList&&"none"!==r.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),i),r.paused()||a.load()})),t.on("error",Tu[e](e,n))}},bu={AUDIO:function(e,t){var n=t.vhs,r=t.sourceType,i=t.segmentLoaders[e],a=t.requestOptions,s=t.master.mediaGroups,o=t.mediaTypes[e],l=o.groups,u=o.tracks,c=o.logger_,d=t.masterPlaylistLoader,f=go(d.master);for(var h in s[e]&&0!==Object.keys(s[e]).length||(s[e]={main:{default:{default:!0}}},f&&(s[e].main.default.playlists=d.master.playlists)),s[e])for(var p in l[h]||(l[h]=[]),s[e][h]){var g=s[e][h][p],m=void 0;if(f?(c("AUDIO group '"+h+"' label '"+p+"' is a master playlist"),g.isMasterPlaylist=!0,m=null):m="vhs-json"===r&&g.playlists?new Oo(g.playlists[0],n,a):g.resolvedUri?new Oo(g.resolvedUri,n,a):g.playlists&&"dash"===r?new Jo(g.playlists[0],n,a,d):null,g=ks.mergeOptions({id:p,playlistLoader:m},g),Eu[e](e,g.playlistLoader,t),l[h].push(g),void 0===u[p]){var y=new ks.AudioTrack({id:p,kind:yu(g),enabled:!1,language:g.language,default:g.default,label:p});u[p]=y}}i.on("error",Tu[e](e,t))},SUBTITLES:function(e,t){var n=t.tech,r=t.vhs,i=t.sourceType,a=t.segmentLoaders[e],s=t.requestOptions,o=t.master.mediaGroups,l=t.mediaTypes[e],u=l.groups,c=l.tracks,d=t.masterPlaylistLoader;for(var f in o[e])for(var h in u[f]||(u[f]=[]),o[e][f])if(!o[e][f][h].forced){var p=o[e][f][h],g=void 0;if("hls"===i)g=new Oo(p.resolvedUri,r,s);else if("dash"===i){if(!p.playlists.filter((function(e){return e.excludeUntil!==1/0})).length)return;g=new Jo(p.playlists[0],r,s,d)}else"vhs-json"===i&&(g=new Oo(p.playlists?p.playlists[0]:p.resolvedUri,r,s));if(p=ks.mergeOptions({id:h,playlistLoader:g},p),Eu[e](e,p.playlistLoader,t),u[f].push(p),void 0===c[h]){var m=n.addRemoteTextTrack({id:h,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:h},!1).track;c[h]=m}}a.on("error",Tu[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var n=t.tech,r=t.master.mediaGroups,i=t.mediaTypes[e],a=i.groups,s=i.tracks;for(var o in r[e])for(var l in a[o]||(a[o]=[]),r[e][o]){var u=r[e][o][l];if(/^(?:CC|SERVICE)/.test(u.instreamId)){var c=n.options_.vhs&&n.options_.vhs.captionServices||{},d={label:l,language:u.language,instreamId:u.instreamId,default:u.default&&u.autoselect};if(c[d.instreamId]&&(d=ks.mergeOptions(d,c[d.instreamId])),void 0===d.default&&delete d.default,a[o].push(ks.mergeOptions({id:l},u)),void 0===s[l]){var f=n.addRemoteTextTrack({id:d.instreamId,kind:"captions",default:d.default,language:d.language,label:d.label},!1).track;s[l]=f}}}}},Su=function e(t,n){for(var r=0;r<t.length;r++){if(ho(n,t[r]))return!0;if(t[r].playlists&&e(t[r].playlists,n))return!0}return!1},Au={AUDIO:function(e,t){return function(){var n=t.mediaTypes[e].tracks;for(var r in n)if(n[r].enabled)return n[r];return null}},SUBTITLES:function(e,t){return function(){var n=t.mediaTypes[e].tracks;for(var r in n)if("showing"===n[r].mode||"hidden"===n[r].mode)return n[r];return null}}},wu=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],Iu=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},Cu=function(e){function t(t){var n;n=e.call(this)||this;var r=t.src,a=t.handleManifestRedirects,s=t.withCredentials,o=t.tech,l=t.bandwidth,u=t.externVhs,c=t.useCueTags,d=t.blacklistDuration,h=t.enableLowInitialPlaylist,p=t.sourceType,g=t.cacheEncryptionKeys,m=t.experimentalBufferBasedABR,y=t.experimentalLeastPixelDiffSelector,v=t.captionServices;if(!r)throw new Error("A non-empty playlist URL or JSON manifest string is required");var _=t.maxPlaylistRetries;null==_&&(_=1/0),Gl=u,n.experimentalBufferBasedABR=Boolean(m),n.experimentalLeastPixelDiffSelector=Boolean(y),n.withCredentials=s,n.tech_=o,n.vhs_=o.vhs,n.sourceType_=p,n.useCueTags_=c,n.blacklistDuration=d,n.maxPlaylistRetries=_,n.enableLowInitialPlaylist=h,n.useCueTags_&&(n.cueTagsTrack_=n.tech_.addTextTrack("metadata","ad-cues"),n.cueTagsTrack_.inBandMetadataTrackDispatchType=""),n.requestOptions_={withCredentials:s,handleManifestRedirects:a,maxPlaylistRetries:_,timeout:null},n.on("error",n.pauseLoading),n.mediaTypes_=function(){var e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((function(t){e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Hl,activeTrack:Hl,getActiveGroup:Hl,onGroupChanged:Hl,onTrackChanged:Hl,lastTrack_:null,logger_:qs("MediaGroups["+t+"]")}})),e}(),n.mediaSource=new(i().MediaSource),n.handleDurationChange_=n.handleDurationChange_.bind(f(n)),n.handleSourceOpen_=n.handleSourceOpen_.bind(f(n)),n.handleSourceEnded_=n.handleSourceEnded_.bind(f(n)),n.mediaSource.addEventListener("durationchange",n.handleDurationChange_),n.mediaSource.addEventListener("sourceopen",n.handleSourceOpen_),n.mediaSource.addEventListener("sourceended",n.handleSourceEnded_),n.seekable_=ks.createTimeRanges(),n.hasPlayed_=!1,n.syncController_=new hu(t),n.segmentMetadataTrack_=o.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,n.decrypter_=new mu,n.sourceUpdater_=new su(n.mediaSource),n.inbandTextTracks_={},n.timelineChangeController_=new pu;var T={vhs:n.vhs_,parse708captions:t.parse708captions,useDtsForTimestampOffset:t.useDtsForTimestampOffset,captionServices:v,mediaSource:n.mediaSource,currentTime:n.tech_.currentTime.bind(n.tech_),seekable:function(){return n.seekable()},seeking:function(){return n.tech_.seeking()},duration:function(){return n.duration()},hasPlayed:function(){return n.hasPlayed_},goalBufferLength:function(){return n.goalBufferLength()},bandwidth:l,syncController:n.syncController_,decrypter:n.decrypter_,sourceType:n.sourceType_,inbandTextTracks:n.inbandTextTracks_,cacheEncryptionKeys:g,sourceUpdater:n.sourceUpdater_,timelineChangeController:n.timelineChangeController_,experimentalExactManifestTimings:t.experimentalExactManifestTimings};n.masterPlaylistLoader_="dash"===n.sourceType_?new Jo(r,n.vhs_,n.requestOptions_):new Oo(r,n.vhs_,n.requestOptions_),n.setupMasterPlaylistLoaderListeners_(),n.mainSegmentLoader_=new ql(ks.mergeOptions(T,{segmentMetadataTrack:n.segmentMetadataTrack_,loaderType:"main"}),t),n.audioSegmentLoader_=new ql(ks.mergeOptions(T,{loaderType:"audio"}),t),n.subtitleSegmentLoader_=new cu(ks.mergeOptions(T,{loaderType:"vtt",featuresNativeTextTracks:n.tech_.featuresNativeTextTracks,loadVttJs:function(){return new Promise((function(e,t){function n(){o.off("vttjserror",r),e()}function r(){o.off("vttjsloaded",n),t()}o.one("vttjsloaded",n),o.one("vttjserror",r),o.addWebVttScript_()}))}}),t),n.setupSegmentLoaderListeners_(),n.experimentalBufferBasedABR&&(n.masterPlaylistLoader_.one("loadedplaylist",(function(){return n.startABRTimer_()})),n.tech_.on("pause",(function(){return n.stopABRTimer_()})),n.tech_.on("play",(function(){return n.startABRTimer_()}))),wu.forEach((function(e){n[e+"_"]=Iu.bind(f(n),e)})),n.logger_=qs("MPC"),n.triggeredFmp4Usage=!1,"none"===n.tech_.preload()?(n.loadOnPlay_=function(){n.loadOnPlay_=null,n.masterPlaylistLoader_.load()},n.tech_.one("play",n.loadOnPlay_)):n.masterPlaylistLoader_.load(),n.timeToLoadedData__=-1,n.mainAppendsToLoadedData__=-1,n.audioAppendsToLoadedData__=-1;var E="none"===n.tech_.preload()?"play":"loadstart";return n.tech_.one(E,(function(){var e=Date.now();n.tech_.one("loadeddata",(function(){n.timeToLoadedData__=Date.now()-e,n.mainAppendsToLoadedData__=n.mainSegmentLoader_.mediaAppends,n.audioAppendsToLoadedData__=n.audioSegmentLoader_.mediaAppends}))})),n}p(t,e);var n=t.prototype;return n.mainAppendsToLoadedData_=function(){return this.mainAppendsToLoadedData__},n.audioAppendsToLoadedData_=function(){return this.audioAppendsToLoadedData__},n.appendsToLoadedData_=function(){var e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return-1===e||-1===t?-1:e+t},n.timeToLoadedData_=function(){return this.timeToLoadedData__},n.checkABR_=function(e){void 0===e&&(e="abr");var t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)},n.switchMedia_=function(e,t,n){var r=this.media(),i=r&&(r.id||r.uri),a=e.id||e.uri;i&&i!==a&&(this.logger_("switch media "+i+" -> "+a+" from "+t),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+t})),this.masterPlaylistLoader_.media(e,n)},n.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=i().setInterval((function(){return e.checkABR_()}),250)},n.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(i().clearInterval(this.abrTimer_),this.abrTimer_=null)},n.getAudioTrackPlaylists_=function(){var e=this.master(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;var n,r=e.mediaGroups.AUDIO,i=Object.keys(r);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else{var a=r.main||i.length&&r[i[0]];for(var s in a)if(a[s].default){n={label:s};break}}if(!n)return t;var o=[];for(var l in r)if(r[l][n.label]){var u=r[l][n.label];if(u.playlists&&u.playlists.length)o.push.apply(o,u.playlists);else if(u.uri)o.push(u);else if(e.playlists.length)for(var c=0;c<e.playlists.length;c++){var d=e.playlists[c];d.attributes&&d.attributes.AUDIO&&d.attributes.AUDIO===l&&o.push(d)}}return o.length?o:t},n.setupMasterPlaylistLoaderListeners_=function(){var e=this;this.masterPlaylistLoader_.on("loadedmetadata",(function(){var t=e.masterPlaylistLoader_.media(),n=1.5*t.targetDuration*1e3;fo(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=n,t.endList&&"none"!==e.tech_.preload()&&(e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.mainSegmentLoader_.load()),function(e){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((function(t){bu[t](t,e)}));var t=e.mediaTypes,n=e.masterPlaylistLoader,r=e.tech,i=e.vhs,a=e.segmentLoaders,s=a.AUDIO,o=a.main;["AUDIO","SUBTITLES"].forEach((function(n){t[n].activeGroup=function(e,t){return function(n){var r=t.masterPlaylistLoader,i=t.mediaTypes[e].groups,a=r.media();if(!a)return null;var s=null;a.attributes[e]&&(s=i[a.attributes[e]]);var o=Object.keys(i);if(!s)if("AUDIO"===e&&o.length>1&&go(t.master))for(var l=0;l<o.length;l++){var u=i[o[l]];if(Su(u,a)){s=u;break}}else i.main?s=i.main:1===o.length&&(s=i[o[0]]);return void 0===n?s:null!==n&&s&&s.filter((function(e){return e.id===n.id}))[0]||null}}(n,e),t[n].activeTrack=Au[n](n,e),t[n].onGroupChanged=function(e,t){return function(){var n=t.segmentLoaders,r=n[e],i=n.main,a=t.mediaTypes[e],s=a.activeTrack(),o=a.getActiveGroup(),l=a.activePlaylistLoader,u=a.lastGroup_;o&&u&&o.id===u.id||(a.lastGroup_=o,a.lastTrack_=s,vu(r,a),o&&!o.isMasterPlaylist&&(o.playlistLoader?(r.resyncLoader(),_u(o.playlistLoader,a)):l&&i.resetEverything()))}}(n,e),t[n].onGroupChanging=function(e,t){return function(){var n=t.segmentLoaders[e];t.mediaTypes[e].lastGroup_=null,n.abort(),n.pause()}}(n,e),t[n].onTrackChanged=function(e,t){return function(){var n=t.masterPlaylistLoader,r=t.segmentLoaders,i=r[e],a=r.main,s=t.mediaTypes[e],o=s.activeTrack(),l=s.getActiveGroup(),u=s.activePlaylistLoader,c=s.lastTrack_;if((!c||!o||c.id!==o.id)&&(s.lastGroup_=l,s.lastTrack_=o,vu(i,s),l)){if(l.isMasterPlaylist){if(!o||!c||o.id===c.id)return;var d=t.vhs.masterPlaylistController_,f=d.selectPlaylist();if(d.media()===f)return;return s.logger_("track change. Switching master audio from "+c.id+" to "+o.id),n.pause(),a.resetEverything(),void d.fastQualityChange_(f)}if("AUDIO"===e){if(!l.playlistLoader)return a.setAudio(!0),void a.resetEverything();i.setAudio(!0),a.setAudio(!1)}u!==l.playlistLoader?(i.track&&i.track(o),i.resetEverything(),_u(l.playlistLoader,s)):_u(l.playlistLoader,s)}}}(n,e),t[n].getActiveGroup=function(e,t){var n=t.mediaTypes;return function(){var t=n[e].activeTrack();return t?n[e].activeGroup(t):null}}(n,e)}));var l=t.AUDIO.activeGroup();if(l){var u=(l.filter((function(e){return e.default}))[0]||l[0]).id;t.AUDIO.tracks[u].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged(),t.AUDIO.getActiveGroup().playlistLoader?(o.setAudio(!1),s.setAudio(!0)):o.setAudio(!0)}n.on("mediachange",(function(){["AUDIO","SUBTITLES"].forEach((function(e){return t[e].onGroupChanged()}))})),n.on("mediachanging",(function(){["AUDIO","SUBTITLES"].forEach((function(e){return t[e].onGroupChanging()}))}));var c=function(){t.AUDIO.onTrackChanged(),r.trigger({type:"usage",name:"vhs-audio-change"}),r.trigger({type:"usage",name:"hls-audio-change"})};for(var d in r.audioTracks().addEventListener("change",c),r.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),i.on("dispose",(function(){r.audioTracks().removeEventListener("change",c),r.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)})),r.clearTracks("audio"),t.AUDIO.tracks)r.audioTracks().addTrack(t.AUDIO.tracks[d])}({sourceType:e.sourceType_,segmentLoaders:{AUDIO:e.audioSegmentLoader_,SUBTITLES:e.subtitleSegmentLoader_,main:e.mainSegmentLoader_},tech:e.tech_,requestOptions:e.requestOptions_,masterPlaylistLoader:e.masterPlaylistLoader_,vhs:e.vhs_,master:e.master(),mediaTypes:e.mediaTypes_,blacklistCurrentPlaylist:e.blacklistCurrentPlaylist.bind(e)}),e.triggerPresenceUsage_(e.master(),t),e.setupFirstPlay(),!e.mediaTypes_.AUDIO.activePlaylistLoader||e.mediaTypes_.AUDIO.activePlaylistLoader.media()?e.trigger("selectedinitialmedia"):e.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",(function(){e.trigger("selectedinitialmedia")}))})),this.masterPlaylistLoader_.on("loadedplaylist",(function(){e.loadOnPlay_&&e.tech_.off("play",e.loadOnPlay_);var t=e.masterPlaylistLoader_.media();if(!t){var n;if(e.excludeUnsupportedVariants_(),e.enableLowInitialPlaylist&&(n=e.selectInitialPlaylist()),n||(n=e.selectPlaylist()),!n||!e.shouldSwitchToMedia_(n))return;if(e.initialMedia_=n,e.switchMedia_(e.initialMedia_,"initial"),"vhs-json"!==e.sourceType_||!e.initialMedia_.segments)return;t=e.initialMedia_}e.handleUpdatedMediaPlaylist(t)})),this.masterPlaylistLoader_.on("error",(function(){e.blacklistCurrentPlaylist(e.masterPlaylistLoader_.error)})),this.masterPlaylistLoader_.on("mediachanging",(function(){e.mainSegmentLoader_.abort(),e.mainSegmentLoader_.pause()})),this.masterPlaylistLoader_.on("mediachange",(function(){var t=e.masterPlaylistLoader_.media(),n=1.5*t.targetDuration*1e3;fo(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=n,e.masterPlaylistLoader_.load(),e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.mainSegmentLoader_.load(),e.tech_.trigger({type:"mediachange",bubbles:!0})})),this.masterPlaylistLoader_.on("playlistunchanged",(function(){var t=e.masterPlaylistLoader_.media();"playlist-unchanged"!==t.lastExcludeReason_&&e.stuckAtPlaylistEnd_(t)&&(e.blacklistCurrentPlaylist({message:"Playlist no longer updating.",reason:"playlist-unchanged"}),e.tech_.trigger("playliststuck"))})),this.masterPlaylistLoader_.on("renditiondisabled",(function(){e.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"}),e.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})})),this.masterPlaylistLoader_.on("renditionenabled",(function(){e.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"}),e.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})}))},n.handleUpdatedMediaPlaylist=function(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())},n.triggerPresenceUsage_=function(e,t){var n=e.mediaGroups||{},r=!0,i=Object.keys(n.AUDIO);for(var a in n.AUDIO)for(var s in n.AUDIO[a])n.AUDIO[a][s].uri||(r=!1);r&&(this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),this.tech_.trigger({type:"usage",name:"hls-demuxed"})),Object.keys(n.SUBTITLES).length&&(this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),this.tech_.trigger({type:"usage",name:"hls-webvtt"})),Gl.Playlist.isAes(t)&&(this.tech_.trigger({type:"usage",name:"vhs-aes"}),this.tech_.trigger({type:"usage",name:"hls-aes"})),i.length&&Object.keys(n.AUDIO[i[0]]).length>1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},n.shouldSwitchToMedia_=function(e){var t=this.masterPlaylistLoader_.media()||this.masterPlaylistLoader_.pendingMedia_,n=this.tech_.currentTime(),r=this.bufferLowWaterLine(),i=this.bufferHighWaterLine();return function(e){var t=e.currentPlaylist,n=e.buffered,r=e.currentTime,i=e.nextPlaylist,a=e.bufferLowWaterLine,s=e.bufferHighWaterLine,o=e.duration,l=e.experimentalBufferBasedABR,u=e.log;if(!i)return ks.log.warn("We received no playlist to switch to. Please check your stream."),!1;var c="allowing switch "+(t&&t.id||"null")+" -> "+i.id;if(!t)return u(c+" as current playlist is not set"),!0;if(i.id===t.id)return!1;var d=Boolean(Ys(n,r).length);if(!t.endList)return d||"number"!=typeof t.partTargetDuration?(u(c+" as current playlist is live"),!0):(u("not "+c+" as current playlist is live llhls, but currentTime isn't in buffered."),!1);var f=Xs(n,r),h=l?el.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:el.MAX_BUFFER_LOW_WATER_LINE;if(o<h)return u(c+" as duration < max low water line ("+o+" < "+h+")"),!0;var p=i.attributes.BANDWIDTH,g=t.attributes.BANDWIDTH;if(p<g&&(!l||f<s)){var m=c+" as next bandwidth < current bandwidth ("+p+" < "+g+")";return l&&(m+=" and forwardBuffer < bufferHighWaterLine ("+f+" < "+s+")"),u(m),!0}if((!l||p>g)&&f>=a){var y=c+" as forwardBuffer >= bufferLowWaterLine ("+f+" >= "+a+")";return l&&(y+=" and next bandwidth > current bandwidth ("+p+" > "+g+")"),u(y),!0}return u("not "+c+" as no switching criteria met"),!1}({buffered:this.tech_.buffered(),currentTime:n,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:i,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},n.setupSegmentLoaderListeners_=function(){var e=this;this.mainSegmentLoader_.on("bandwidthupdate",(function(){e.checkABR_("bandwidthupdate"),e.tech_.trigger("bandwidthupdate")})),this.mainSegmentLoader_.on("timeout",(function(){e.experimentalBufferBasedABR&&e.mainSegmentLoader_.load()})),this.experimentalBufferBasedABR||this.mainSegmentLoader_.on("progress",(function(){e.trigger("progress")})),this.mainSegmentLoader_.on("error",(function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())})),this.mainSegmentLoader_.on("appenderror",(function(){e.error=e.mainSegmentLoader_.error_,e.trigger("error")})),this.mainSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("timestampoffset",(function(){e.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})})),this.audioSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.audioSegmentLoader_.on("appenderror",(function(){e.error=e.audioSegmentLoader_.error_,e.trigger("error")})),this.mainSegmentLoader_.on("ended",(function(){e.logger_("main segment loader ended"),e.onEndOfStream()})),this.mainSegmentLoader_.on("earlyabort",(function(t){e.experimentalBufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120))}));var t=function(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var t=e.getCodecsOrExclude_();t&&e.sourceUpdater_.addOrChangeSourceBuffers(t)};this.mainSegmentLoader_.on("trackinfo",t),this.audioSegmentLoader_.on("trackinfo",t),this.mainSegmentLoader_.on("fmp4",(function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("fmp4",(function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("ended",(function(){e.logger_("audioSegmentLoader ended"),e.onEndOfStream()}))},n.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},n.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},n.smoothQualityChange_=function(e){void 0===e&&(e=this.selectPlaylist()),this.fastQualityChange_(e)},n.fastQualityChange_=function(e){var t=this;void 0===e&&(e=this.selectPlaylist()),e!==this.masterPlaylistLoader_.media()?(this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything((function(){ks.browser.IE_VERSION||ks.browser.IS_EDGE?t.tech_.setCurrentTime(t.tech_.currentTime()+.04):t.tech_.setCurrentTime(t.tech_.currentTime())}))):this.logger_("skipping fastQualityChange because new media is same as old")},n.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0)?this.tech_.setCurrentTime(e.end(e.length-1)):void 0}},n.setupFirstPlay=function(){var e=this,t=this.masterPlaylistLoader_.media();if(!t||this.tech_.paused()||this.hasPlayed_)return!1;if(!t.endList){var n=this.seekable();if(!n.length)return!1;if(ks.browser.IE_VERSION&&0===this.tech_.readyState())return this.tech_.one("loadedmetadata",(function(){e.trigger("firstplay"),e.tech_.setCurrentTime(n.end(0)),e.hasPlayed_=!0})),!1;this.trigger("firstplay"),this.tech_.setCurrentTime(n.end(0))}return this.hasPlayed_=!0,this.load(),!0},n.handleSourceOpen_=function(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){var e=this.tech_.play();void 0!==e&&"function"==typeof e.then&&e.then(null,(function(e){}))}this.trigger("sourceopen")},n.handleSourceEnded_=function(){if(this.inbandTextTracks_.metadataTrack_){var e=this.inbandTextTracks_.metadataTrack_.cues;if(e&&e.length){var t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}}},n.handleDurationChange_=function(){this.tech_.trigger("durationchange")},n.onEndOfStream=function(){var e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){var t=this.mainSegmentLoader_.getCurrentMediaInfo_();e=!t||t.hasVideo?e&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())},n.stuckAtPlaylistEnd_=function(e){if(!this.seekable().length)return!1;var t=this.syncController_.getExpiredTime(e,this.duration());if(null===t)return!1;var n=Gl.Playlist.playlistEnd(e,t),r=this.tech_.currentTime(),i=this.tech_.buffered();if(!i.length)return n-r<=Gs;var a=i.end(i.length-1);return a-r<=Gs&&n-a<=Gs},n.blacklistCurrentPlaylist=function(e,t){void 0===e&&(e={});var n=e.playlist||this.masterPlaylistLoader_.media();if(t=t||e.blacklistDuration||this.blacklistDuration,!n)return this.error=e,void("open"!==this.mediaSource.readyState?this.trigger("error"):this.sourceUpdater_.endOfStream("network"));n.playlistErrors_++;var r,i=this.masterPlaylistLoader_.master.playlists,a=i.filter(uo),s=1===a.length&&a[0]===n;if(1===i.length&&t!==1/0)return ks.log.warn("Problem encountered with playlist "+n.id+". Trying again since it is the only playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(s);if(s){var o=!1;i.forEach((function(e){if(e!==n){var t=e.excludeUntil;void 0!==t&&t!==1/0&&(o=!0,delete e.excludeUntil)}})),o&&(ks.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}r=n.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*t,n.excludeUntil=r,e.reason&&(n.lastExcludeReason_=e.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var l=this.selectPlaylist();if(!l)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");var u=e.internal?this.logger_:ks.log.warn,c=e.message?" "+e.message:"";u((e.internal?"Internal problem":"Problem")+" encountered with playlist "+n.id+"."+c+" Switching to playlist "+l.id+"."),l.attributes.AUDIO!==n.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),l.attributes.SUBTITLES!==n.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var d=l.targetDuration/2*1e3||5e3,f="number"==typeof l.lastRequest&&Date.now()-l.lastRequest<=d;return this.switchMedia_(l,"exclude",s||f)},n.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},n.delegateLoaders_=function(e,t){var n=this,r=[],i="all"===e;(i||"main"===e)&&r.push(this.masterPlaylistLoader_);var a=[];(i||"audio"===e)&&a.push("AUDIO"),(i||"subtitle"===e)&&(a.push("CLOSED-CAPTIONS"),a.push("SUBTITLES")),a.forEach((function(e){var t=n.mediaTypes_[e]&&n.mediaTypes_[e].activePlaylistLoader;t&&r.push(t)})),["main","audio","subtitle"].forEach((function(t){var i=n[t+"SegmentLoader_"];!i||e!==t&&"all"!==e||r.push(i)})),r.forEach((function(e){return t.forEach((function(t){"function"==typeof e[t]&&e[t]()}))}))},n.setCurrentTime=function(e){var t=Ys(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0},n.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Gl.Playlist.duration(e):1/0:0},n.seekable=function(){return this.seekable_},n.onSyncInfoUpdate_=function(){var e;if(this.masterPlaylistLoader_){var t=this.masterPlaylistLoader_.media();if(t){var n=this.syncController_.getExpiredTime(t,this.duration());if(null!==n){var r=this.masterPlaylistLoader_.master,i=Gl.Playlist.seekable(t,n,Gl.Playlist.liveEdgeDelay(r,t));if(0!==i.length){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(n=this.syncController_.getExpiredTime(t,this.duration())))return;if(0===(e=Gl.Playlist.seekable(t,n,Gl.Playlist.liveEdgeDelay(r,t))).length)return}var a,s;this.seekable_&&this.seekable_.length&&(a=this.seekable_.end(0),s=this.seekable_.start(0)),e?e.start(0)>i.end(0)||i.start(0)>e.end(0)?this.seekable_=i:this.seekable_=ks.createTimeRanges([[e.start(0)>i.start(0)?e.start(0):i.start(0),e.end(0)<i.end(0)?e.end(0):i.end(0)]]):this.seekable_=i,this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===a&&this.seekable_.start(0)===s||(this.logger_("seekable updated ["+Ks(this.seekable_)+"]"),this.tech_.trigger("seekablechanged"))}}}}},n.updateDuration=function(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),"open"!==this.mediaSource.readyState)return this.updateDuration_=this.updateDuration.bind(this,e),void this.mediaSource.addEventListener("sourceopen",this.updateDuration_);if(e){var t=this.seekable();if(!t.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<t.end(t.length-1))&&this.sourceUpdater_.setDuration(t.end(t.length-1))}else{var n=this.tech_.buffered(),r=Gl.Playlist.duration(this.masterPlaylistLoader_.media());n.length>0&&(r=Math.max(r,n.end(n.length-1))),this.mediaSource.duration!==r&&this.sourceUpdater_.setDuration(r)}},n.dispose=function(){var e=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach((function(t){var n=e.mediaTypes_[t].groups;for(var r in n)n[r].forEach((function(e){e.playlistLoader&&e.playlistLoader.dispose()}))})),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()},n.master=function(){return this.masterPlaylistLoader_.master},n.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},n.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),n=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!n)},n.getCodecsOrExclude_=function(){var e=this,t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},n=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();t.video=t.main;var r=Il(this.master(),n),i={},a=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(i.video=r.video||t.main.videoCodec||"avc1.4d400d"),t.main.isMuxed&&(i.video+=","+(r.audio||t.main.audioCodec||Y)),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||a)&&(i.audio=r.audio||t.main.audioCodec||t.audio.audioCodec||Y,t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4),i.audio||i.video){var s,o={};if(["video","audio"].forEach((function(e){if(i.hasOwnProperty(e)&&(r=t[e].isFmp4,a=i[e],!(r?G(a):V(a)))){var n=t[e].isFmp4?"browser":"muxer";o[n]=o[n]||[],o[n].push(i[e]),"audio"===e&&(s=n)}var r,a})),a&&s&&n.attributes.AUDIO){var l=n.attributes.AUDIO;this.master().playlists.forEach((function(e){(e.attributes&&e.attributes.AUDIO)===l&&e!==n&&(e.excludeUntil=1/0)})),this.logger_("excluding audio group "+l+" as "+s+' does not support codec(s): "'+i.audio+'"')}if(!Object.keys(o).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var u=[];if(["video","audio"].forEach((function(t){var n=(j(e.sourceUpdater_.codecs[t]||"")[0]||{}).type,r=(j(i[t]||"")[0]||{}).type;n&&r&&n.toLowerCase()!==r.toLowerCase()&&u.push('"'+e.sourceUpdater_.codecs[t]+'" -> "'+i[t]+'"')})),u.length)return void this.blacklistCurrentPlaylist({playlist:n,message:"Codec switching not supported: "+u.join(", ")+".",blacklistDuration:1/0,internal:!0})}return i}var c=Object.keys(o).reduce((function(e,t){return e&&(e+=", "),e+(t+' does not support codec(s): "')+o[t].join(",")+'"'}),"")+".";this.blacklistCurrentPlaylist({playlist:n,internal:!0,message:c,blacklistDuration:1/0})}else this.blacklistCurrentPlaylist({playlist:n,message:"Could not determine codecs for playlist.",blacklistDuration:1/0})},n.tryToCreateSourceBuffers_=function(){if("open"===this.mediaSource.readyState&&!this.sourceUpdater_.hasCreatedSourceBuffers()&&this.areMediaTypesKnown_()){var e=this.getCodecsOrExclude_();if(e){this.sourceUpdater_.createSourceBuffers(e);var t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}}},n.excludeUnsupportedVariants_=function(){var e=this,t=this.master().playlists,n=[];Object.keys(t).forEach((function(r){var i=t[r];if(-1===n.indexOf(i.id)){n.push(i.id);var a=Il(e.master,i),s=[];!a.audio||V(a.audio)||G(a.audio)||s.push("audio codec "+a.audio),!a.video||V(a.video)||G(a.video)||s.push("video codec "+a.video),a.text&&"stpp.ttml.im1t"===a.text&&s.push("text codec "+a.text),s.length&&(i.excludeUntil=1/0,e.logger_("excluding "+i.id+" for unsupported: "+s.join(", ")))}}))},n.excludeIncompatibleVariants_=function(e){var t=this,n=[],r=this.master().playlists,i=Al(j(e)),a=wl(i),s=i.video&&j(i.video)[0]||null,o=i.audio&&j(i.audio)[0]||null;Object.keys(r).forEach((function(e){var i=r[e];if(-1===n.indexOf(i.id)&&i.excludeUntil!==1/0){n.push(i.id);var l=[],u=Il(t.masterPlaylistLoader_.master,i),c=wl(u);if(u.audio||u.video){if(c!==a&&l.push('codec count "'+c+'" !== "'+a+'"'),!t.sourceUpdater_.canChangeType()){var d=u.video&&j(u.video)[0]||null,f=u.audio&&j(u.audio)[0]||null;d&&s&&d.type.toLowerCase()!==s.type.toLowerCase()&&l.push('video codec "'+d.type+'" !== "'+s.type+'"'),f&&o&&f.type.toLowerCase()!==o.type.toLowerCase()&&l.push('audio codec "'+f.type+'" !== "'+o.type+'"')}l.length&&(i.excludeUntil=1/0,t.logger_("blacklisting "+i.id+": "+l.join(" && ")))}}}))},n.updateAdCues_=function(e){var t=0,n=this.seekable();n.length&&(t=n.start(0)),function(e,t,n){if(void 0===n&&(n=0),e.segments)for(var r,a=n,s=0;s<e.segments.length;s++){var o=e.segments[s];if(r||(r=du(t,a+o.duration/2)),r){if("cueIn"in o){r.endTime=a,r.adEndTime=a,a+=o.duration,r=null;continue}if(a<r.endTime){a+=o.duration;continue}r.endTime+=o.duration}else if("cueOut"in o&&((r=new(i().VTTCue)(a,a+o.duration,o.cueOut)).adStartTime=a,r.adEndTime=a+parseFloat(o.cueOut),t.addCue(r)),"cueOutCont"in o){var l=o.cueOutCont.split("/").map(parseFloat),u=l[0],c=l[1];(r=new(i().VTTCue)(a,a+o.duration,"")).adStartTime=a-u,r.adEndTime=r.adStartTime+c,t.addCue(r)}a+=o.duration}}(e,this.cueTagsTrack_,t)},n.goalBufferLength=function(){var e=this.tech_.currentTime(),t=el.GOAL_BUFFER_LENGTH,n=el.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,el.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*n,r)},n.bufferLowWaterLine=function(){var e=this.tech_.currentTime(),t=el.BUFFER_LOW_WATER_LINE,n=el.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,el.MAX_BUFFER_LOW_WATER_LINE),i=Math.max(t,el.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*n,this.experimentalBufferBasedABR?i:r)},n.bufferHighWaterLine=function(){return el.BUFFER_HIGH_WATER_LINE},t}(ks.EventTarget),Ru=function(e,t,n){var r,i,a,s=e.masterPlaylistController_,o=s[(e.options_.smoothQualityChange?"smooth":"fast")+"QualityChange_"].bind(s);if(t.attributes){var l=t.attributes.RESOLUTION;this.width=l&&l.width,this.height=l&&l.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=Il(s.master(),t),this.playlist=t,this.id=n,this.enabled=(r=e.playlists,i=t.id,a=o,function(e){var t=r.master.playlists[i],n=lo(t),s=uo(t);return void 0===e?s:(e?delete t.disabled:t.disabled=!0,e===s||n||(a(),e?r.trigger("renditionenabled"):r.trigger("renditiondisabled")),e)})},Du=["seeking","seeked","pause","playing","error"],Nu=function(){function e(e){var t=this;this.masterPlaylistController_=e.masterPlaylistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=qs("PlaybackWatcher"),this.logger_("initialize");var n=function(){return t.monitorCurrentTime_()},r=function(){return t.monitorCurrentTime_()},a=function(){return t.techWaiting_()},s=function(){return t.cancelTimer_()},o=this.masterPlaylistController_,l=["main","subtitle","audio"],u={};l.forEach((function(e){u[e]={reset:function(){return t.resetSegmentDownloads_(e)},updateend:function(){return t.checkSegmentDownloads_(e)}},o[e+"SegmentLoader_"].on("appendsdone",u[e].updateend),o[e+"SegmentLoader_"].on("playlistupdate",u[e].reset),t.tech_.on(["seeked","seeking"],u[e].reset)}));var c=function(e){["main","audio"].forEach((function(n){o[n+"SegmentLoader_"][e]("appended",t.seekingAppendCheck_)}))};this.seekingAppendCheck_=function(){t.fixesBadSeeks_()&&(t.consecutiveUpdates=0,t.lastRecordedTime=t.tech_.currentTime(),c("off"))},this.clearSeekingAppendCheck_=function(){return c("off")},this.watchForBadSeeking_=function(){t.clearSeekingAppendCheck_(),c("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",a),this.tech_.on(Du,s),this.tech_.on("canplay",r),this.tech_.one("play",n),this.dispose=function(){t.clearSeekingAppendCheck_(),t.logger_("dispose"),t.tech_.off("waiting",a),t.tech_.off(Du,s),t.tech_.off("canplay",r),t.tech_.off("play",n),t.tech_.off("seeking",t.watchForBadSeeking_),t.tech_.off("seeked",t.clearSeekingAppendCheck_),l.forEach((function(e){o[e+"SegmentLoader_"].off("appendsdone",u[e].updateend),o[e+"SegmentLoader_"].off("playlistupdate",u[e].reset),t.tech_.off(["seeked","seeking"],u[e].reset)})),t.checkCurrentTimeTimeout_&&i().clearTimeout(t.checkCurrentTimeTimeout_),t.cancelTimer_()}}var t=e.prototype;return t.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&i().clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=i().setTimeout(this.monitorCurrentTime_.bind(this),250)},t.resetSegmentDownloads_=function(e){var t=this.masterPlaylistController_[e+"SegmentLoader_"];this[e+"StalledDownloads_"]>0&&this.logger_("resetting possible stalled download count for "+e+" loader"),this[e+"StalledDownloads_"]=0,this[e+"Buffered_"]=t.buffered_()},t.checkSegmentDownloads_=function(e){var t=this.masterPlaylistController_,n=t[e+"SegmentLoader_"],r=n.buffered_(),i=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e)return!0;if(e.length!==t.length)return!0;for(var n=0;n<e.length;n++)if(e.start(n)!==t.start(n)||e.end(n)!==t.end(n))return!0;return!1}(this[e+"Buffered_"],r);this[e+"Buffered_"]=r,i?this.resetSegmentDownloads_(e):(this[e+"StalledDownloads_"]++,this.logger_("found #"+this[e+"StalledDownloads_"]+" "+e+" appends that did not increase buffer (possible stalled download)",{playlistId:n.playlist_&&n.playlist_.id,buffered:zs(r)}),this[e+"StalledDownloads_"]<10||(this.logger_(e+" loader stalled download exclusion"),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:"vhs-"+e+"-download-exclusion"}),"subtitle"!==e&&t.blacklistCurrentPlaylist({message:"Excessive "+e+" segment downloading detected."},1/0)))},t.checkCurrentTime_=function(){if(!this.tech_.paused()&&!this.tech_.seeking()){var e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Gs>=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}},t.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},t.fixesBadSeeks_=function(){if(!this.tech_.seeking())return!1;var e,t=this.seekable(),n=this.tech_.currentTime();if(this.afterSeekableWindow_(t,n,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(e=t.end(t.length-1)),this.beforeSeekableWindow_(t,n)){var r=t.start(0);e=r+(r===t.end(0)?0:Gs)}if(void 0!==e)return this.logger_("Trying to seek outside of seekable at time "+n+" with seekable range "+Ks(t)+". Seeking to "+e+"."),this.tech_.setCurrentTime(e),!0;for(var i=this.masterPlaylistController_.sourceUpdater_,a=this.tech_.buffered(),s=i.audioBuffer?i.audioBuffered():null,o=i.videoBuffer?i.videoBuffered():null,l=this.media(),u=l.partTargetDuration?l.partTargetDuration:2*(l.targetDuration-Hs),c=[s,o],d=0;d<c.length;d++)if(c[d]&&Xs(c[d],n)<u)return!1;var f=Zs(a,n);return 0!==f.length&&(e=f.start(0)+Gs,this.logger_("Buffered region starts ("+f.start(0)+")  just beyond seek point ("+n+"). Seeking to "+e+"."),this.tech_.setCurrentTime(e),!0)},t.waiting_=function(){if(!this.techWaiting_()){var e=this.tech_.currentTime(),t=this.tech_.buffered(),n=Ys(t,e);return n.length&&e+3<=n.end(0)?(this.cancelTimer_(),this.tech_.setCurrentTime(e),this.logger_("Stopped at "+e+" while inside a buffered region ["+n.start(0)+" -> "+n.end(0)+"]. Attempting to resume playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})):void 0}},t.techWaiting_=function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(e,t)){var n=e.end(e.length-1);return this.logger_("Fell out of live window at time "+t+". Seeking to live point (seekable end) "+n),this.cancelTimer_(),this.tech_.setCurrentTime(n),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var r=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,i=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:r.audioBuffered(),videoBuffered:r.videoBuffered(),currentTime:t}))return this.cancelTimer_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var a=Zs(i,t);if(a.length>0){var s=a.start(0)-t;return this.logger_("Stopped at "+t+", setting timer for "+s+", seeking to "+a.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*s,t),!0}return!1},t.afterSeekableWindow_=function(e,t,n,r){if(void 0===r&&(r=!1),!e.length)return!1;var i=e.end(e.length-1)+Gs;return!n.endList&&r&&(i=e.end(e.length-1)+3*n.targetDuration),t>i},t.beforeSeekableWindow_=function(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)},t.videoUnderflow_=function(e){var t=e.videoBuffered,n=e.audioBuffered,r=e.currentTime;if(t){var i;if(t.length&&n.length){var a=Ys(t,r-3),s=Ys(t,r),o=Ys(n,r);o.length&&!s.length&&a.length&&(i={start:a.end(0),end:o.end(0)})}else Zs(t,r).length||(i=this.gapFromVideoUnderflow_(t,r));return!!i&&(this.logger_("Encountered a gap in video from "+i.start+" to "+i.end+". Seeking to current time "+r),!0)}},t.skipTheGap_=function(e){var t=this.tech_.buffered(),n=this.tech_.currentTime(),r=Zs(t,n);this.cancelTimer_(),0!==r.length&&n===e&&(this.logger_("skipTheGap_:","currentTime:",n,"scheduled currentTime:",e,"nextRange start:",r.start(0)),this.tech_.setCurrentTime(r.start(0)+Hs),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))},t.gapFromVideoUnderflow_=function(e,t){for(var n=function(e){if(e.length<2)return ks.createTimeRanges();for(var t=[],n=1;n<e.length;n++){var r=e.end(n-1),i=e.start(n);t.push([r,i])}return ks.createTimeRanges(t)}(e),r=0;r<n.length;r++){var i=n.start(r),a=n.end(r);if(t-i<4&&t-i>2)return{start:i,end:a}}return null},e}(),Ou={errorInterval:30,getSource:function(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},Pu=function e(t,n){var r=0,i=0,a=ks.mergeOptions(Ou,n);t.ready((function(){t.trigger({type:"usage",name:"vhs-error-reload-initialized"}),t.trigger({type:"usage",name:"hls-error-reload-initialized"})}));var s=function(){i&&t.currentTime(i)},o=function(e){null!=e&&(i=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",s),t.src(e),t.trigger({type:"usage",name:"vhs-error-reload"}),t.trigger({type:"usage",name:"hls-error-reload"}),t.play())},l=function(){return Date.now()-r<1e3*a.errorInterval?(t.trigger({type:"usage",name:"vhs-error-reload-canceled"}),void t.trigger({type:"usage",name:"hls-error-reload-canceled"})):a.getSource&&"function"==typeof a.getSource?(r=Date.now(),a.getSource.call(t,o)):void ks.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")},u=function e(){t.off("loadedmetadata",s),t.off("error",l),t.off("dispose",e)};t.on("error",l),t.on("dispose",u),t.reloadSourceOnError=function(n){u(),e(t,n)}},Mu="2.16.2",xu={PlaylistLoader:Oo,Playlist:mo,utils:Vo,STANDARD_PLAYLIST_SELECTOR:Ml,INITIAL_PLAYLIST_SELECTOR:function(){var e=this,t=this.playlists.master.playlists.filter(mo.isEnabled);return Nl(t,(function(e,t){return Ol(e,t)})),t.filter((function(t){return!!Il(e.playlists.master,t).video}))[0]||null},lastBandwidthSelector:Ml,movingAverageBandwidthSelector:function(e){var t=-1,n=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var r=this.useDevicePixelRatio&&i().devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,n=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==n&&(t=e*this.systemBandwidth+(1-e)*t,n=this.systemBandwidth),Pl(this.playlists.master,t,parseInt(Dl(this.tech_.el(),"width"),10)*r,parseInt(Dl(this.tech_.el(),"height"),10)*r,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},comparePlaylistBandwidth:Ol,comparePlaylistResolution:function(e,t){var n,r;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(n=e.attributes.RESOLUTION.width),n=n||i().Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(r=t.attributes.RESOLUTION.width),n===(r=r||i().Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:n-r},xhr:Lo()};Object.keys(el).forEach((function(e){Object.defineProperty(xu,e,{get:function(){return ks.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),el[e]},set:function(t){ks.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),"number"!=typeof t||t<0?ks.log.warn("value of Vhs."+e+" must be greater than or equal to 0"):el[e]=t}})}));var Lu="videojs-vhs",ku=function(e,t){for(var n=t.media(),r=-1,i=0;i<e.length;i++)if(e[i].id===n.id){r=i;break}e.selectedIndex_=r,e.trigger({selectedIndex:r,type:"change"})};xu.canPlaySource=function(){return ks.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var Fu=function(){if(!i().localStorage)return null;var e=i().localStorage.getItem(Lu);if(!e)return null;try{return JSON.parse(e)}catch(e){return null}};xu.supportsNativeHls=function(){if(!l()||!l().createElement)return!1;var e=l().createElement("video");return!!ks.getTech("Html5").isSupported()&&["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some((function(t){return/maybe|probably/i.test(e.canPlayType(t))}))}(),xu.supportsNativeDash=!!(l()&&l().createElement&&ks.getTech("Html5").isSupported())&&/maybe|probably/i.test(l().createElement("video").canPlayType("application/dash+xml")),xu.supportsTypeNatively=function(e){return"hls"===e?xu.supportsNativeHls:"dash"===e&&xu.supportsNativeDash},xu.isSupported=function(){return ks.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var Uu=function(e){function t(t,n,r){var i;if(i=e.call(this,n,ks.mergeOptions(r.hls,r.vhs))||this,r.hls&&Object.keys(r.hls).length&&ks.log.warn("Using hls options is deprecated. Please rename `hls` to `vhs` in your options object."),"number"==typeof r.initialBandwidth&&(i.options_.bandwidth=r.initialBandwidth),i.logger_=qs("VhsHandler"),n.options_&&n.options_.playerId){var a=ks(n.options_.playerId);a.hasOwnProperty("hls")||Object.defineProperty(a,"hls",{get:function(){return ks.log.warn("player.hls is deprecated. Use player.tech().vhs instead."),n.trigger({type:"usage",name:"hls-player-access"}),f(i)},configurable:!0}),a.hasOwnProperty("vhs")||Object.defineProperty(a,"vhs",{get:function(){return ks.log.warn("player.vhs is deprecated. Use player.tech().vhs instead."),n.trigger({type:"usage",name:"vhs-player-access"}),f(i)},configurable:!0}),a.hasOwnProperty("dash")||Object.defineProperty(a,"dash",{get:function(){return ks.log.warn("player.dash is deprecated. Use player.tech().vhs instead."),f(i)},configurable:!0}),i.player_=a}if(i.tech_=n,i.source_=t,i.stats={},i.ignoreNextSeekingEvent_=!1,i.setOptions_(),i.options_.overrideNative&&n.overrideNativeAudioTracks&&n.overrideNativeVideoTracks)n.overrideNativeAudioTracks(!0),n.overrideNativeVideoTracks(!0);else if(i.options_.overrideNative&&(n.featuresNativeVideoTracks||n.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");return i.on(l(),["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],(function(e){var t=l().fullscreenElement||l().webkitFullscreenElement||l().mozFullScreenElement||l().msFullscreenElement;t&&t.contains(i.tech_.el())?i.masterPlaylistController_.fastQualityChange_():i.masterPlaylistController_.checkABR_()})),i.on(i.tech_,"seeking",(function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())})),i.on(i.tech_,"error",(function(){this.tech_.error()&&this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()})),i.on(i.tech_,"play",i.play),i}p(t,e);var n=t.prototype;return n.setOptions_=function(){var e=this;if(this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.handleManifestRedirects=!1!==this.options_.handleManifestRedirects,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.smoothQualityChange=this.options_.smoothQualityChange||!1,this.options_.useBandwidthFromLocalStorage=void 0!==this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,"number"!=typeof this.options_.blacklistDuration&&(this.options_.blacklistDuration=300),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){var t=Fu();t&&t.bandwidth&&(this.options_.bandwidth=t.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-bandwidth-from-local-storage"})),t&&t.throughput&&(this.options_.throughput=t.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-throughput-from-local-storage"}))}"number"!=typeof this.options_.bandwidth&&(this.options_.bandwidth=el.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===el.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","smoothQualityChange","customTagParsers","customTagMappers","handleManifestRedirects","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","experimentalBufferBasedABR","liveRangeSafeTimeDelta","experimentalLLHLS","useNetworkInformationApi","useDtsForTimestampOffset","experimentalExactManifestTimings","experimentalLeastPixelDiffSelector"].forEach((function(t){void 0!==e.source_[t]&&(e.options_[t]=e.source_[t])})),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio},n.src=function(e,t){var n=this;if(e){var r;this.setOptions_(),this.options_.src=0===(r=this.source_.src).toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")?JSON.parse(r.substring(r.indexOf(",")+1)):r,this.options_.tech=this.tech_,this.options_.externVhs=xu,this.options_.sourceType=z(t),this.options_.seekTo=function(e){n.tech_.setCurrentTime(e)},this.options_.smoothQualityChange&&ks.log.warn("smoothQualityChange is deprecated and will be removed in the next major version"),this.masterPlaylistController_=new Cu(this.options_);var a=ks.mergeOptions({liveRangeSafeTimeDelta:Gs},this.options_,{seekable:function(){return n.seekable()},media:function(){return n.masterPlaylistController_.media()},masterPlaylistController:this.masterPlaylistController_});this.playbackWatcher_=new Nu(a),this.masterPlaylistController_.on("error",(function(){var e=ks.players[n.tech_.options_.playerId],t=n.masterPlaylistController_.error;"object"!=typeof t||t.code?"string"==typeof t&&(t={message:t,code:3}):t.code=3,e.error(t)}));var s=this.options_.experimentalBufferBasedABR?xu.movingAverageBandwidthSelector(.55):xu.STANDARD_PLAYLIST_SELECTOR;this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):s.bind(this),this.masterPlaylistController_.selectInitialPlaylist=xu.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.masterPlaylistController_.masterPlaylistLoader_,this.mediaSource=this.masterPlaylistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get:function(){return this.masterPlaylistController_.selectPlaylist},set:function(e){this.masterPlaylistController_.selectPlaylist=e.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=e,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){var e=this.masterPlaylistController_.mainSegmentLoader_.bandwidth,t=i().navigator.connection||i().navigator.mozConnection||i().navigator.webkitConnection,n=1e7;if(this.options_.useNetworkInformationApi&&t){var r=1e3*t.downlink*1e3;e=r>=n&&e>=n?Math.max(e,r):r}return e},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=e,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var e,t=1/(this.bandwidth||1);return e=this.throughput>0?1/this.throughput:0,Math.floor(1/(t+e))},set:function(){ks.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return n.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return n.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return n.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return n.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return n.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return n.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return n.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return n.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return n.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return n.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return n.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return n.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return n.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return zs(n.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return n.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return n.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return n.tech_.name_},enumerable:!0},duration:{get:function(){return n.tech_.duration()},enumerable:!0},master:{get:function(){return n.playlists.master},enumerable:!0},playerDimensions:{get:function(){return n.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return zs(n.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return n.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",(function(){n.options_.useBandwidthFromLocalStorage&&function(e){if(!i().localStorage)return!1;var t=Fu();t=t?ks.mergeOptions(t,e):e;try{i().localStorage.setItem(Lu,JSON.stringify(t))}catch(e){return!1}}({bandwidth:n.bandwidth,throughput:Math.round(n.throughput)})})),this.masterPlaylistController_.on("selectedinitialmedia",(function(){var e;(e=n).representations=function(){var t=e.masterPlaylistController_.master(),n=go(t)?e.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return n?n.filter((function(e){return!lo(e)})).map((function(t,n){return new Ru(e,t,t.id)})):[]}})),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",(function(){n.setupEme_()})),this.on(this.masterPlaylistController_,"progress",(function(){this.tech_.trigger("progress")})),this.on(this.masterPlaylistController_,"firstplay",(function(){this.ignoreNextSeekingEvent_=!0})),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=i().URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},n.createKeySessions_=function(){var e=this,t=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),function(e){var t=e.player,n=e.sourceKeySystems,r=e.audioMedia,i=e.mainPlaylists;if(!t.eme.initializeMediaKeys)return Promise.resolve();var a,s,o=(a=r?i.concat([r]):i,s=Object.keys(n),a.reduce((function(e,t){if(!t.contentProtection)return e;var n=s.reduce((function(e,n){var r=t.contentProtection[n];return r&&r.pssh&&(e[n]={pssh:r.pssh}),e}),{});return Object.keys(n).length&&e.push(n),e}),[])),l=[],u=[];return o.forEach((function(e){u.push(new Promise((function(e,n){t.tech_.one("keysessioncreated",e)}))),l.push(new Promise((function(n,r){t.eme.initializeMediaKeys({keySystems:e},(function(e){e?r(e):n()}))})))})),Promise.race([Promise.all(l),Promise.race(u)])}({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:t&&t.media(),mainPlaylists:this.playlists.master.playlists}).then((function(){e.logger_("created EME key session"),e.masterPlaylistController_.sourceUpdater_.initializedEme()})).catch((function(t){e.logger_("error while creating EME key session",t),e.player_.error({message:"Failed to initialize media keys for EME",code:3})}))},n.handleWaitingForKey_=function(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()},n.setupEme_=function(){var e,t,n,r=this,i=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,a=(e={player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:i&&i.media()},t=e.player,!(!(n=function(e,t,n){if(!e)return e;var r={};t&&t.attributes&&t.attributes.CODECS&&(r=Al(j(t.attributes.CODECS))),n&&n.attributes&&n.attributes.CODECS&&(r.audio=n.attributes.CODECS);var i=H(r.video),a=H(r.audio),s={};for(var o in e)s[o]={},a&&(s[o].audioContentType=a),i&&(s[o].videoContentType=i),t.contentProtection&&t.contentProtection[o]&&t.contentProtection[o].pssh&&(s[o].pssh=t.contentProtection[o].pssh),"string"==typeof e[o]&&(s[o].url=e[o]);return ks.mergeOptions(e,s)}(e.sourceKeySystems,e.media,e.audioMedia))||(t.currentSource().keySystems=n,n&&!t.eme&&(ks.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),1))));this.player_.tech_.on("keystatuschange",(function(e){if("output-restricted"===e.status){var t=r.masterPlaylistController_.master();if(t&&t.playlists){var n,i=[];t.playlists.forEach((function(e){e&&e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height>=720&&(!e.excludeUntil||e.excludeUntil<1/0)&&(e.excludeUntil=1/0,i.push(e))})),i.length&&((n=ks.log).warn.apply(n,['DRM keystatus changed to "output-restricted." Removing the following HD playlists that will most likely fail to play and clearing the buffer. This may be due to HDCP restrictions on the stream and the capabilities of the current device.'].concat(i)),r.masterPlaylistController_.fastQualityChange_())}}})),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),11!==ks.browser.IE_VERSION&&a?this.createKeySessions_():this.masterPlaylistController_.sourceUpdater_.initializedEme()},n.setupQualityLevels_=function(){var e=this,t=ks.players[this.tech_.options_.playerId];t&&t.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=t.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",(function(){var t,n;t=e.qualityLevels_,(n=e).representations().forEach((function(e){t.addQualityLevel(e)})),ku(t,n.playlists)})),this.playlists.on("mediachange",(function(){ku(e.qualityLevels_,e.playlists)})))},t.version=function(){return{"@videojs/http-streaming":Mu,"mux.js":"6.0.1","mpd-parser":"0.22.1","m3u8-parser":"4.8.0","aes-decrypter":"3.1.3"}},n.version=function(){return this.constructor.version()},n.canChangeType=function(){return su.canChangeType()},n.play=function(){this.masterPlaylistController_.play()},n.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e)},n.duration=function(){return this.masterPlaylistController_.duration()},n.seekable=function(){return this.masterPlaylistController_.seekable()},n.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&i().URL.revokeObjectURL&&(i().URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),e.prototype.dispose.call(this)},n.convertToProgramTime=function(e,t){return function(e){var t=e.playlist,n=e.time,r=void 0===n?void 0:n,i=e.callback;if(!i)throw new Error("getProgramTime: callback must be provided");if(!t||void 0===r)return i({message:"getProgramTime: playlist and time must be provided"});var a=function(e,t){if(!t||!t.segments||0===t.segments.length)return null;for(var n,r=0,i=0;i<t.segments.length&&!(e<=(r=(n=t.segments[i]).videoTimingInfo?n.videoTimingInfo.transmuxedPresentationEnd:r+n.duration));i++);var a=t.segments[t.segments.length-1];if(a.videoTimingInfo&&a.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>r){if(e>r+.25*a.duration)return null;n=a}return{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:r-n.duration,type:n.videoTimingInfo?"accurate":"estimate"}}(r,t);if(!a)return i({message:"valid programTime was not found"});if("estimate"===a.type)return i({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:a.estimatedStart});var s={mediaSeconds:r},o=function(e,t){if(!t.dateTimeObject)return null;var n=t.videoTimingInfo.transmuxerPrependedSeconds,r=e-(t.videoTimingInfo.transmuxedPresentationStart+n);return new Date(t.dateTimeObject.getTime()+1e3*r)}(r,a.segment);return o&&(s.programDateTime=o.toISOString()),i(null,s)}({playlist:this.masterPlaylistController_.media(),time:e,callback:t})},n.seekToProgramTime=function(e,t,n,r){return void 0===n&&(n=!0),void 0===r&&(r=2),Yo({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:r,pauseAfterSeek:n,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})},t}(ks.getComponent("Component")),Bu={name:"videojs-http-streaming",VERSION:Mu,canHandleSource:function(e,t){void 0===t&&(t={});var n=ks.mergeOptions(ks.options,t);return Bu.canPlayType(e.type,n)},handleSource:function(e,t,n){void 0===n&&(n={});var r=ks.mergeOptions(ks.options,n);return t.vhs=new Uu(e,t,r),ks.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return ks.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=Lo(),t.vhs.src(e.src,e.type),t.vhs},canPlayType:function(e,t){var n=z(e);if(!n)return"";var r=Bu.getOverrideNative(t);return!xu.supportsTypeNatively(n)||r?"maybe":""},getOverrideNative:function(e){void 0===e&&(e={});var t=e,n=t.vhs,r=void 0===n?{}:n,i=t.hls,a=void 0===i?{}:i,s=!(ks.browser.IS_ANY_SAFARI||ks.browser.IS_IOS),o=r.overrideNative,l=void 0===o?s:o,u=a.overrideNative;return void 0!==u&&u||l}};G("avc1.4d400d,mp4a.40.2")&&ks.getTech("Html5").registerSourceHandler(Bu,0),ks.VhsHandler=Uu,Object.defineProperty(ks,"HlsHandler",{get:function(){return ks.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),Uu},configurable:!0}),ks.VhsSourceHandler=Bu,Object.defineProperty(ks,"HlsSourceHandler",{get:function(){return ks.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),Bu},configurable:!0}),ks.Vhs=xu,Object.defineProperty(ks,"Hls",{get:function(){return ks.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),xu},configurable:!0}),ks.use||(ks.registerComponent("Hls",xu),ks.registerComponent("Vhs",xu)),ks.options.vhs=ks.options.vhs||{},ks.options.hls=ks.options.hls||{},ks.getPlugin&&ks.getPlugin("reloadSourceOnError")||(ks.registerPlugin||ks.plugin)("reloadSourceOnError",(function(e){Pu(this,e)}));const ju=ks;var qu,Hu,Gu,Vu=(qu=function(e,t){window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s="./index.js")}({"./externals/base64.js":function(e,t,n){var r,i,o,l,u,c={encode:function(e){for(var t=[],n=0;n<e.length;++n){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?(t.push(192|r>>6),t.push(128|63&r)):r<65536?(t.push(224|r>>12),t.push(128|63&r>>6),t.push(128|63&r)):(t.push(240|r>>18),t.push(128|63&r>>12),t.push(128|63&r>>6),t.push(128|63&r))}return t},decode:function(e){for(var t=[],n=0;n<e.length;){var r=e[n++];r<128||(r<224?(r=(31&r)<<6,r|=63&e[n++]):r<240?(r=(15&r)<<12,r|=(63&e[n++])<<6,r|=63&e[n++]):(r=(7&r)<<18,r|=(63&e[n++])<<12,r|=(63&e[n++])<<6,r|=63&e[n++])),t.push(String.fromCharCode(r))}return t.join("")}},d={};r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=function(e){for(var t=0,n=[],i=0|e.length/3;0<i--;){var a=(e[t]<<16)+(e[t+1]<<8)+e[t+2];t+=3,n.push(r.charAt(63&a>>18)),n.push(r.charAt(63&a>>12)),n.push(r.charAt(63&a>>6)),n.push(r.charAt(63&a))}return 2==e.length-t?(a=(e[t]<<16)+(e[t+1]<<8),n.push(r.charAt(63&a>>18)),n.push(r.charAt(63&a>>12)),n.push(r.charAt(63&a>>6)),n.push("=")):1==e.length-t&&(a=e[t]<<16,n.push(r.charAt(63&a>>18)),n.push(r.charAt(63&a>>12)),n.push("==")),n.join("")},o=function(){for(var e=[],t=0;t<64;++t)e[r.charCodeAt(t)]=t;return e["=".charCodeAt(0)]=0,e}(),l=function(e){for(var t=0,n=[],r=0|e.length/4;0<r--;){var i=(o[e.charCodeAt(t)]<<18)+(o[e.charCodeAt(t+1)]<<12)+(o[e.charCodeAt(t+2)]<<6)+o[e.charCodeAt(t+3)];n.push(255&i>>16),n.push(255&i>>8),n.push(255&i),t+=4}return n&&("="==e.charAt(t-2)?(n.pop(),n.pop()):"="==e.charAt(t-1)&&n.pop()),n},u={encode:function(e){for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t},decode:function(e){for(var t=0;t<s.length;++t)a[t]=String.fromCharCode(a[t]);return a.join("")}},d.decodeArray=function(e){var t=l(e);return new Uint8Array(t)},d.encodeASCII=function(e){var t=u.encode(e);return i(t)},d.decodeASCII=function(e){var t=l(e);return u.decode(t)},d.encode=function(e){var t=c.encode(e);return i(t)},d.decode=function(e){var t=l(e);return c.decode(t)},t.decode=d.decode,t.decodeArray=d.decodeArray,t.encode=d.encode,t.encodeASCII=d.encodeASCII},"./externals/cea608-parser.js":function(e,t,n){!function(e){var t={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},n=function(e){var n=e;return t.hasOwnProperty(e)&&(n=t[e]),String.fromCharCode(n)},r=15,i=32,a={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},s={17:2,18:4,21:6,22:8,23:10,19:13,20:15},o={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},l={25:2,26:4,29:6,30:8,31:10,27:13,28:15},u=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],c={verboseFilter:{DATA:3,DEBUG:3,INFO:2,WARNING:2,TEXT:1,ERROR:0},time:null,verboseLevel:0,setTime:function(e){this.time=e},log:function(e,t){var n=this.verboseFilter[e];this.verboseLevel>=n&&console.log(this.time+" ["+e+"] "+t)}},d=function(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n].toString(16));return t},f=function(e,t,n,r,i){this.foreground=e||"white",this.underline=t||!1,this.italics=n||!1,this.background=r||"black",this.flash=i||!1};f.prototype={reset:function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},setStyles:function(e){for(var t=["foreground","underline","italics","background","flash"],n=0;n<t.length;n++){var r=t[n];e.hasOwnProperty(r)&&(this[r]=e[r])}},isDefault:function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash},equals:function(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash},copy:function(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash},toString:function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}};var h=function(e,t,n,r,i,a){this.uchar=e||" ",this.penState=new f(t,n,r,i,a)};h.prototype={reset:function(){this.uchar=" ",this.penState.reset()},setChar:function(e,t){this.uchar=e,this.penState.copy(t)},setPenState:function(e){this.penState.copy(e)},equals:function(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)},copy:function(e){this.uchar=e.uchar,this.penState.copy(e.penState)},isEmpty:function(){return" "===this.uchar&&this.penState.isDefault()}};var p=function(){this.chars=[];for(var e=0;e<i;e++)this.chars.push(new h);this.pos=0,this.currPenState=new f};p.prototype={equals:function(e){for(var t=!0,n=0;n<i;n++)if(!this.chars[n].equals(e.chars[n])){t=!1;break}return t},copy:function(e){for(var t=0;t<i;t++)this.chars[t].copy(e.chars[t])},isEmpty:function(){for(var e=!0,t=0;t<i;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e},setCursor:function(e){this.pos!==e&&(this.pos=e),this.pos<0?(c.log("ERROR","Negative cursor position "+this.pos),this.pos=0):this.pos>i&&(c.log("ERROR","Too large cursor position "+this.pos),this.pos=i)},moveCursor:function(e){var t=this.pos+e;if(e>1)for(var n=this.pos+1;n<t+1;n++)this.chars[n].setPenState(this.currPenState);this.setCursor(t)},backSpace:function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},insertChar:function(e){e>=144&&this.backSpace();var t=n(e);this.pos>=i?c.log("ERROR","Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))},clearFromPos:function(e){var t;for(t=e;t<i;t++)this.chars[t].reset()},clear:function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},clearToEndOfRow:function(){this.clearFromPos(this.pos)},getTextString:function(){for(var e=[],t=!0,n=0;n<i;n++){var r=this.chars[n].uchar;" "!==r&&(t=!1),e.push(r)}return t?"":e.join("")},setPenStyles:function(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}};var g=function(){this.rows=[];for(var e=0;e<r;e++)this.rows.push(new p);this.currRow=14,this.nrRollUpRows=null,this.reset()};g.prototype={reset:function(){for(var e=0;e<r;e++)this.rows[e].clear();this.currRow=14},equals:function(e){for(var t=!0,n=0;n<r;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t},copy:function(e){for(var t=0;t<r;t++)this.rows[t].copy(e.rows[t])},isEmpty:function(){for(var e=!0,t=0;t<r;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e},backSpace:function(){this.rows[this.currRow].backSpace()},clearToEndOfRow:function(){this.rows[this.currRow].clearToEndOfRow()},insertChar:function(e){this.rows[this.currRow].insertChar(e)},setPen:function(e){this.rows[this.currRow].setPenStyles(e)},moveCursor:function(e){this.rows[this.currRow].moveCursor(e)},setCursor:function(e){c.log("INFO","setCursor: "+e),this.rows[this.currRow].setCursor(e)},setPAC:function(e){c.log("INFO","pacData = "+JSON.stringify(e));var t=e.row-1;this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.currRow=t;var n=this.rows[this.currRow];if(null!==e.indent){var r=e.indent,i=Math.max(r-1,0);n.setCursor(e.indent),e.color=n.chars[i].penState.foreground}var a={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(a)},setBkgData:function(e){c.log("INFO","bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)},setRollUpRows:function(e){this.nrRollUpRows=e},rollUp:function(){if(null!==this.nrRollUpRows){c.log("TEXT",this.getDisplayText());var e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),c.log("INFO","Rolling up")}else c.log("DEBUG","roll_up but nrRollUpRows not set yet")},getDisplayText:function(e){e=e||!1;for(var t=[],n="",i=-1,a=0;a<r;a++){var s=this.rows[a].getTextString();s&&(i=a+1,e?t.push("Row "+i+': "'+s+'"'):t.push(s.trim()))}return t.length>0&&(n=e?"["+t.join(" | ")+"]":t.join("\n")),n},getTextAndFormat:function(){return this.rows}};var m=function(e,t){this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new g,this.nonDisplayedMemory=new g,this.lastOutputScreen=new g,this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null};m.prototype={modes:["MODE_ROLL-UP","MODE_POP-ON","MODE_PAINT-ON","MODE_TEXT"],reset:function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null},getHandler:function(){return this.outputFilter},setHandler:function(e){this.outputFilter=e},setPAC:function(e){this.writeScreen.setPAC(e)},setBkgData:function(e){this.writeScreen.setBkgData(e)},setMode:function(e){e!==this.mode&&(this.mode=e,c.log("INFO","MODE="+e),"MODE_POP-ON"==this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)},insertChars:function(e){for(var t=0;t<e.length;t++)this.writeScreen.insertChar(e[t]);var n=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";c.log("INFO",n+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(c.log("TEXT","DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},cc_RCL:function(){c.log("INFO","RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},cc_BS:function(){c.log("INFO","BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},cc_AOF:function(){},cc_AON:function(){},cc_DER:function(){c.log("INFO","DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},cc_RU:function(e){c.log("INFO","RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)},cc_FON:function(){c.log("INFO","FON - Flash On"),this.writeScreen.setPen({flash:!0})},cc_RDC:function(){c.log("INFO","RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},cc_TR:function(){c.log("INFO","TR"),this.setMode("MODE_TEXT")},cc_RTD:function(){c.log("INFO","RTD"),this.setMode("MODE_TEXT")},cc_EDM:function(){c.log("INFO","EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate()},cc_CR:function(){c.log("CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate()},cc_ENM:function(){c.log("INFO","ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},cc_EOC:function(){if(c.log("INFO","EOC - End Of Caption"),"MODE_POP-ON"===this.mode){var e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,c.log("TEXT","DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate()},cc_TO:function(e){c.log("INFO","TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)},cc_MIDROW:function(e){var t={flash:!1};if(t.underline=e%2==1,t.italics=e>=46,t.italics)t.foreground="white";else{var n=Math.floor(e/2)-16;t.foreground=["white","green","blue","cyan","red","yellow","magenta"][n]}c.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},outputDataUpdate:function(){var e=c.time;null!==e&&this.outputFilter&&(this.outputFilter.updateData&&this.outputFilter.updateData(e,this.displayedMemory),null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))},cueSplitAtTime:function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}};var y=function(e,t,n){this.field=e||1,this.outputs=[t,n],this.channels=[new m(1,t),new m(2,n)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.bufferedData=[],this.startTime=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}};y.prototype={getHandler:function(e){return this.channels[e].getHandler()},setHandler:function(e,t){this.channels[e].setHandler(t)},addData:function(e,t){var n,r,i,a=!1;this.lastTime=e,c.setTime(e);for(var s=0;s<t.length;s+=2)r=127&t[s],i=127&t[s+1],r>=16&&r<=31&&r===this.lastCmdA&&i===this.lastCmdB?(this.lastCmdA=null,this.lastCmdB=null,c.log("DEBUG","Repeated command ("+d([r,i])+") is dropped")):0!==r||0!==i?(c.log("DATA","["+d([t[s],t[s+1]])+"] -> ("+d([r,i])+")"),(n=this.parseCmd(r,i))||(n=this.parseMidrow(r,i)),n||(n=this.parsePAC(r,i)),n||(n=this.parseBackgroundAttributes(r,i)),n||(a=this.parseChars(r,i))&&(this.currChNr&&this.currChNr>=0?this.channels[this.currChNr-1].insertChars(a):c.log("WARNING","No channel found yet. TEXT-MODE?")),n?this.dataCounters.cmd+=2:a?this.dataCounters.char+=2:(this.dataCounters.other+=2,c.log("WARNING","Couldn't parse cleaned data "+d([r,i])+" orig: "+d([t[s],t[s+1]])))):this.dataCounters.padding+=2},parseCmd:function(e,t){var n=null;if(!((20===e||21===e||28===e||29===e)&&32<=t&&t<=47||(23===e||31===e)&&33<=t&&t<=35))return!1;n=20===e||21===e||23===e?1:2;var r=this.channels[n-1];return 20===e||21===e||28===e||29===e?32===t?r.cc_RCL():33===t?r.cc_BS():34===t?r.cc_AOF():35===t?r.cc_AON():36===t?r.cc_DER():37===t?r.cc_RU(2):38===t?r.cc_RU(3):39===t?r.cc_RU(4):40===t?r.cc_FON():41===t?r.cc_RDC():42===t?r.cc_TR():43===t?r.cc_RTD():44===t?r.cc_EDM():45===t?r.cc_CR():46===t?r.cc_ENM():47===t&&r.cc_EOC():r.cc_TO(t-32),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=n,!0},parseMidrow:function(e,t){var n=null;if((17===e||25===e)&&32<=t&&t<=47){if((n=17===e?1:2)!==this.currChNr)return c.log("ERROR","Mismatch channel in midrow parsing"),!1;var r=this.channels[n-1];return r.insertChars([32]),r.cc_MIDROW(t),c.log("DEBUG","MIDROW ("+d([e,t])+")"),this.lastCmdA=e,this.lastCmdB=t,!0}return!1},parsePAC:function(e,t){var n,r=null;if(!((17<=e&&e<=23||25<=e&&e<=31)&&64<=t&&t<=127||(16===e||24===e)&&64<=t&&t<=95))return!1;n=e<=23?1:2,r=64<=t&&t<=95?1===n?a[e]:o[e]:1===n?s[e]:l[e];var i=this.interpretPAC(r,t);return this.channels[n-1].setPAC(i),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=n,!0},interpretPAC:function(e,t){var n=t,r={color:null,italics:!1,indent:null,underline:!1,row:e};return n=t>95?t-96:t-64,r.underline=1==(1&n),n<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(r.italics=!0,r.color="white"):r.indent=4*Math.floor((n-16)/2),r},parseChars:function(e,t){var r=null,i=null,a=null;if(e>=25?(r=2,a=e-8):(r=1,a=e),17<=a&&a<=19){var s=t;s=17===a?t+80:18===a?t+112:t+144,c.log("INFO","Special char '"+n(s)+"' in channel "+r),i=[s],this.lastCmdA=e,this.lastCmdB=t}else 32<=e&&e<=127&&(i=0===t?[e]:[e,t],this.lastCmdA=null,this.lastCmdB=null);if(i){var o=d(i);c.log("DEBUG","Char codes =  "+o.join(","))}return i},parseBackgroundAttributes:function(e,t){var n,r,i;return((16===e||24===e)&&32<=t&&t<=47||(23===e||31===e)&&45<=t&&t<=47)&&(n={},16===e||24===e?(r=Math.floor((t-32)/2),n.background=u[r],t%2==1&&(n.background=n.background+"_semi")):45===t?n.background="transparent":(n.foreground="black",47===t&&(n.underline=!0)),i=e<24?1:2,this.channels[i-1].setBkgData(n),this.lastCmdA=e,this.lastCmdB=t,!0)},reset:function(){for(var e=0;e<this.channels.length;e++)this.channels[e]&&this.channels[e].reset();this.lastCmdA=null,this.lastCmdB=null},cueSplitAtTime:function(e){for(var t=0;t<this.channels.length;t++)this.channels[t]&&this.channels[t].cueSplitAtTime(e)}},e.logger=c,e.PenState=f,e.CaptionScreen=g,e.Cea608Parser=y,e.findCea608Nalus=function(e,t,n){for(var r=0,i=t,a=[],s=function(e,t,n,r){if(4!==e||t<8)return null;var i=n.getUint8(r),a=n.getUint16(r+1),s=n.getUint32(r+3),o=n.getUint8(r+7);return 181==i&&49==a&&1195456820==s&&3==o};i<t+n;){if(r=e.getUint32(i),6==(31&e.getUint8(i+4)))for(var o=i+5,l=-1;o<i+4+r-1;){l=0;for(var u=255;255===u;)l+=u=e.getUint8(o),o++;var c=0;for(u=255;255===u;)c+=u=e.getUint8(o),o++;s(l,c,e,o)&&a.push([o,c]),o+=c}i+=r+4}return a},e.extractCea608DataFromRange=function(e,t){var n=t[0],r=[[],[]];n+=8;var i=31&e.getUint8(n);n+=2;for(var a=0;a<i;a++){var s=e.getUint8(n),o=4&s,l=3&s;n++;var u=e.getUint8(n);n++;var c=e.getUint8(n);n++,o&&(127&u)+(127&c)!=0&&(0===l?(r[0].push(u),r[0].push(c)):1===l&&(r[1].push(u),r[1].push(c)))}return r}}(t)},"./externals/xml2json.js":function(e,t,n){n.r(t),t.default=function(e){void 0===(e=e||{}).escapeMode&&(e.escapeMode=!0),void 0===e.attributePrefix&&(e.attributePrefix="_"),e.arrayAccessForm=e.arrayAccessForm||"none",e.emptyNodeForm=e.emptyNodeForm||"text",void 0===e.enableToStringFunc&&(e.enableToStringFunc=!0),e.arrayAccessFormPaths=e.arrayAccessFormPaths||[],void 0===e.skipEmptyTextNodesForObj&&(e.skipEmptyTextNodesForObj=!0),void 0===e.stripWhitespaces&&(e.stripWhitespaces=!0),e.datetimeAccessFormPaths=e.datetimeAccessFormPaths||[],void 0===e.useDoubleQuotes&&(e.useDoubleQuotes=!1),e.xmlElementsFilter=e.xmlElementsFilter||[],e.jsonPropertiesFilter=e.jsonPropertiesFilter||[],void 0===e.keepCData&&(e.keepCData=!1),void 0===e.ignoreRoot&&(e.ignoreRoot=!1);var t={ELEMENT_NODE:1,TEXT_NODE:3,CDATA_SECTION_NODE:4,COMMENT_NODE:8,DOCUMENT_NODE:9};function n(e){var t=e.localName;return null==t&&(t=e.baseName),null!=t&&""!=t||(t=e.nodeName),t}function r(e){return"string"==typeof e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;"):e}function i(e,t,n,r){for(var i=0;i<e.length;i++){var a=e[i];if("string"==typeof a){if(a==r)break}else if(a instanceof RegExp){if(a.test(r))break}else if("function"==typeof a&&a(t,n,r))break}return i!=e.length}function a(t,n,r){"property"===e.arrayAccessForm&&(t[n]instanceof Array?t[n+"_asArray"]=t[n]:t[n+"_asArray"]=[t[n]]),!(t[n]instanceof Array)&&e.arrayAccessFormPaths.length>0&&i(e.arrayAccessFormPaths,t,n,r)&&(t[n]=[t[n]])}function s(e){var t=e.split(/[-T:+Z]/g),n=new Date(t[0],t[1]-1,t[2]),r=t[5].split(".");if(n.setHours(t[3],t[4],r[0]),r.length>1&&n.setMilliseconds(r[1]),t[6]&&t[7]){var i=60*t[6]+Number(t[7]);i=0+("-"==(/\d\d-\d\d:\d\d$/.test(e)?"-":"+")?-1*i:i),n.setMinutes(n.getMinutes()-i-n.getTimezoneOffset())}else-1!==e.indexOf("Z",e.length-1)&&(n=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())));return n}function o(n,r,a,s){return!(r==t.ELEMENT_NODE&&e.xmlElementsFilter.length>0)||i(e.xmlElementsFilter,n,a,s)}function l(r,u){if(r.nodeType==t.DOCUMENT_NODE){for(var c=new Object,d=r.childNodes,f=0;f<d.length;f++)(p=d[f]).nodeType==t.ELEMENT_NODE&&(e.ignoreRoot?c=l(p):(c={})[g=n(p)]=l(p));return c}if(r.nodeType==t.ELEMENT_NODE){(c=new Object).__cnt=0;var h=[];for(d=r.childNodes,f=0;f<d.length;f++){var p,g=n(p=d[f]);if(p.nodeType!=t.COMMENT_NODE){var m=u+"."+g;if(o(c,p.nodeType,g,m))if(c.__cnt++,null==c[g]){var y=l(p,m);("#text"!=g||/[^\s]/.test(y))&&((v={})[g]=y,h.push(v)),c[g]=y,a(c,g,m)}else{var v;null!=c[g]&&(c[g]instanceof Array||(c[g]=[c[g]],a(c,g,m))),y=l(p,m),("#text"!=g||/[^\s]/.test(y))&&((v={})[g]=y,h.push(v)),c[g][c[g].length]=y}}}c.__children=h;for(var _=n(r),T=0;T<r.attributes.length;T++){var E=r.attributes[T];c.__cnt++;for(var b=E.value,S=0,A=e.matchers.length;S<A;S++){var w=e.matchers[S];w.test(E,_)&&(b=w.converter(E.value))}c[e.attributePrefix+E.name]=b}var I=function(e){return e.prefix}(r);return null!=I&&""!=I&&(c.__cnt++,c.__prefix=I),null!=c["#text"]&&(c.__text=c["#text"],c.__text instanceof Array&&(c.__text=c.__text.join("\n")),e.stripWhitespaces&&(c.__text=c.__text.trim()),delete c["#text"],"property"==e.arrayAccessForm&&delete c["#text_asArray"],c.__text=function(t,n,r){if(e.datetimeAccessFormPaths.length>0){var a=r.split(".#")[0];return i(e.datetimeAccessFormPaths,t,n,a)?s(t):t}return t}(c.__text,g,u+"."+g)),null!=c["#cdata-section"]&&(c.__cdata=c["#cdata-section"],delete c["#cdata-section"],"property"==e.arrayAccessForm&&delete c["#cdata-section_asArray"]),0==c.__cnt&&"text"==e.emptyNodeForm?c="":1==c.__cnt&&null!=c.__text?c=c.__text:1!=c.__cnt||null==c.__cdata||e.keepCData?c.__cnt>1&&null!=c.__text&&e.skipEmptyTextNodesForObj&&(e.stripWhitespaces&&""==c.__text||""==c.__text.trim())&&delete c.__text:c=c.__cdata,delete c.__cnt,!e.enableToStringFunc||null==c.__text&&null==c.__cdata||(c.toString=function(){return(null!=this.__text?this.__text:"")+(null!=this.__cdata?this.__cdata:"")}),c}if(r.nodeType==t.TEXT_NODE||r.nodeType==t.CDATA_SECTION_NODE)return r.nodeValue}function u(t,n,i,a){var s="<"+(null!=t&&null!=t.__prefix?t.__prefix+":":"")+n;if(null!=i)for(var o=0;o<i.length;o++){var l=i[o],u=t[l];e.escapeMode&&(u=r(u)),s+=" "+l.substr(e.attributePrefix.length)+"=",e.useDoubleQuotes?s+='"'+u+'"':s+="'"+u+"'"}return s+(a?"/>":">")}function c(e,t){return"</"+(null!=e.__prefix?e.__prefix+":":"")+t+">"}function d(t,n){return"property"==e.arrayAccessForm&&(i="_asArray",-1!==(r=n.toString()).indexOf(i,r.length-i.length))||0==n.toString().indexOf(e.attributePrefix)||0==n.toString().indexOf("__")||t[n]instanceof Function;var r,i}function f(e){var t=0;if(e instanceof Object)for(var n in e)d(e,n)||t++;return t}function h(t,n,r){return 0==e.jsonPropertiesFilter.length||""==r||i(e.jsonPropertiesFilter,t,n,r)}function p(t){var n=[];if(t instanceof Object)for(var r in t)-1==r.toString().indexOf("__")&&0==r.toString().indexOf(e.attributePrefix)&&n.push(r);return n}function g(t){var n="";return t instanceof Object?n+=function(t){var n="";return null!=t.__cdata&&(n+="<![CDATA["+t.__cdata+"]]>"),null!=t.__text&&(e.escapeMode?n+=r(t.__text):n+=t.__text),n}(t):null!=t&&(e.escapeMode?n+=r(t):n+=t),n}function m(e,t){return""===e?t:e+"."+t}function y(e,t,n,r){var i="";if(0==e.length)i+=u(e,t,n,!0);else for(var a=0;a<e.length;a++)i+=u(e[a],t,p(e[a]),!1),i+=v(e[a],m(r,t)),i+=c(e[a],t);return i}function v(e,t){var n="";if(f(e)>0)for(var r in e)if(!d(e,r)&&(""==t||h(e,r,m(t,r)))){var i=e[r],a=p(i);null==i||null==i?n+=u(i,r,a,!0):i instanceof Object?i instanceof Array?n+=y(i,r,a,t):i instanceof Date?(n+=u(i,r,a,!1),n+=i.toISOString(),n+=c(i,r)):f(i)>0||null!=i.__text||null!=i.__cdata?(n+=u(i,r,a,!1),n+=v(i,m(t,r)),n+=c(i,r)):n+=u(i,r,a,!0):(n+=u(i,r,a,!1),n+=g(i),n+=c(i,r))}return n+g(e)}this.parseXmlString=function(e){var t;if(window.ActiveXObject||window,void 0===e)return null;if(window.DOMParser){var n=new window.DOMParser;try{(t=n.parseFromString(e,"text/xml")).getElementsByTagNameNS("*","parsererror").length>0&&(t=null)}catch(e){t=null}}else 0==e.indexOf("<?")&&(e=e.substr(e.indexOf("?>")+2)),(t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e);return t},this.asArray=function(e){return void 0===e||null==e?[]:e instanceof Array?e:[e]},this.toXmlDateTime=function(e){return e instanceof Date?e.toISOString():"number"==typeof e?new Date(e).toISOString():null},this.asDateTime=function(e){return"string"==typeof e?s(e):e},this.xml2json=function(e){return l(e)},this.xml_str2json=function(e){var t=this.parseXmlString(e);return null!=t?this.xml2json(t):null},this.json2xml_str=function(e){return v(e,"")},this.json2xml=function(e){var t=this.json2xml_str(e);return this.parseXmlString(t)},this.getVersion=function(){return"1.2.0"}}},"./index.js":function(e,t,n){n.r(t);var r=n("./index_mediaplayerOnly.js");n.d(t,"MediaPlayer",(function(){return r.MediaPlayer}));var i=n("./src/streaming/utils/Capabilities.js");n.d(t,"supportsMediaSource",(function(){return i.supportsMediaSource}));var a=n("./src/streaming/metrics/MetricsReporting.js");n.d(t,"MetricsReporting",(function(){return a.default}));var s=n("./src/streaming/protection/Protection.js");n.d(t,"Protection",(function(){return s.default}));var o=n("./src/streaming/MediaPlayerFactory.js");n.d(t,"MediaPlayerFactory",(function(){return o.default}));var l=n("./src/core/Debug.js");n.d(t,"Debug",(function(){return l.default})),dashjs.Protection=s.default,dashjs.MetricsReporting=a.default,dashjs.MediaPlayerFactory=o.default,dashjs.Debug=l.default,dashjs.supportsMediaSource=i.supportsMediaSource,t.default=dashjs},"./index_mediaplayerOnly.js":function(e,t,n){n.r(t),function(e){var r=n("./src/streaming/MediaPlayer.js");n.d(t,"MediaPlayer",(function(){return r.default}));var i=n("./src/core/FactoryMaker.js");n.d(t,"FactoryMaker",(function(){return i.default}));var a=n("./src/core/Debug.js");n.d(t,"Debug",(function(){return a.default}));var s=n("./src/core/Version.js"),o=(n("./node_modules/es6-promise/auto.js"),"undefined"!=typeof window&&window||e),l=o.dashjs;l||(l=o.dashjs={}),l.MediaPlayer=r.default,l.FactoryMaker=i.default,l.Debug=a.default,l.Version=Object(s.getVersionString)(),t.default=l}.call(this,n("./node_modules/webpack/buildin/global.js"))},"./node_modules/base64-js/index.js":function(e,t,n){t.byteLength=function(e){var t=l(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){for(var t,n=l(e),r=n[0],s=n[1],o=new a(function(e,t,n){return 3*(t+n)/4-n}(0,r,s)),u=0,c=s>0?r-4:r,d=0;d<c;d+=4)t=i[e.charCodeAt(d)]<<18|i[e.charCodeAt(d+1)]<<12|i[e.charCodeAt(d+2)]<<6|i[e.charCodeAt(d+3)],o[u++]=t>>16&255,o[u++]=t>>8&255,o[u++]=255&t;return 2===s&&(t=i[e.charCodeAt(d)]<<2|i[e.charCodeAt(d+1)]>>4,o[u++]=255&t),1===s&&(t=i[e.charCodeAt(d)]<<10|i[e.charCodeAt(d+1)]<<4|i[e.charCodeAt(d+2)]>>2,o[u++]=t>>8&255,o[u++]=255&t),o},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],s=16383,o=0,l=n-i;o<l;o+=s)a.push(u(e,o,o+s>l?l:o+s));return 1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),a.join("")};for(var r=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=s[o],i[s.charCodeAt(o)]=o;function l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e,t,n){for(var i,a,s=[],o=t;o<n;o+=3)i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),s.push(r[(a=i)>>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},"./node_modules/codem-isoboxer/dist/iso_boxer.js":function(e,t,n){var r={parseBuffer:function(e){return new i(e).parse()},addBoxProcessor:function(e,t){"string"==typeof e&&"function"==typeof t&&(a.prototype._boxProcessors[e]=t)},createFile:function(){return new i},createBox:function(e,t,n){var r=a.create(e);return t&&t.append(r,n),r},createFullBox:function(e,t,n){var i=r.createBox(e,t,n);return i.version=0,i.flags=0,i},Utils:{}};r.Utils.dataViewToString=function(e,t){var n=t||"utf-8";if("undefined"!=typeof TextDecoder)return new TextDecoder(n).decode(e);var r=[],i=0;if("utf-8"===n)for(;i<e.byteLength;){var a=e.getUint8(i++);a<128||(a<224?(a=(31&a)<<6,a|=63&e.getUint8(i++)):a<240?(a=(15&a)<<12,a|=(63&e.getUint8(i++))<<6,a|=63&e.getUint8(i++)):(a=(7&a)<<18,a|=(63&e.getUint8(i++))<<12,a|=(63&e.getUint8(i++))<<6,a|=63&e.getUint8(i++))),r.push(String.fromCharCode(a))}else for(;i<e.byteLength;)r.push(String.fromCharCode(e.getUint8(i++)));return r.join("")},r.Utils.utf8ToByteArray=function(e){var t,n;if("undefined"!=typeof TextEncoder)t=(new TextEncoder).encode(e);else for(t=[],n=0;n<e.length;++n){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?(t.push(192|r>>6),t.push(128|63&r)):r<65536?(t.push(224|r>>12),t.push(128|63&r>>6),t.push(128|63&r)):(t.push(240|r>>18),t.push(128|63&r>>12),t.push(128|63&r>>6),t.push(128|63&r))}return t},r.Utils.appendBox=function(e,t,n){if(t._offset=e._cursor.offset,t._root=e._root?e._root:e,t._raw=e._raw,t._parent=e,-1!==n)if(null!=n){var r,i=-1;if("number"==typeof n)i=n;else{if("string"==typeof n)r=n;else{if("object"!=typeof n||!n.type)return void e.boxes.push(t);r=n.type}for(var a=0;a<e.boxes.length;a++)if(r===e.boxes[a].type){i=a+1;break}}e.boxes.splice(i,0,t)}else e.boxes.push(t)},t.parseBuffer=r.parseBuffer,t.addBoxProcessor=r.addBoxProcessor,t.createFile=r.createFile,t.createBox=r.createBox,t.createFullBox=r.createFullBox,t.Utils=r.Utils,r.Cursor=function(e){this.offset=void 0===e?0:e};var i=function(e){this._cursor=new r.Cursor,this.boxes=[],e&&(this._raw=new DataView(e))};i.prototype.fetch=function(e){var t=this.fetchAll(e,!0);return t.length?t[0]:null},i.prototype.fetchAll=function(e,t){var n=[];return i._sweep.call(this,e,n,t),n},i.prototype.parse=function(){for(this._cursor.offset=0,this.boxes=[];this._cursor.offset<this._raw.byteLength;){var e=a.parse(this);if(void 0===e.type)break;this.boxes.push(e)}return this},i._sweep=function(e,t,n){for(var r in this.type&&this.type==e&&t.push(this),this.boxes){if(t.length&&n)return;i._sweep.call(this.boxes[r],e,t,n)}},i.prototype.write=function(){var e,t=0;for(e=0;e<this.boxes.length;e++)t+=this.boxes[e].getLength(!1);var n=new Uint8Array(t);for(this._rawo=new DataView(n.buffer),this.bytes=n,this._cursor.offset=0,e=0;e<this.boxes.length;e++)this.boxes[e].write();return n.buffer},i.prototype.append=function(e,t){r.Utils.appendBox(this,e,t)};var a=function(){this._cursor=new r.Cursor};a.parse=function(e){var t=new a;return t._offset=e._cursor.offset,t._root=e._root?e._root:e,t._raw=e._raw,t._parent=e,t._parseBox(),e._cursor.offset=t._raw.byteOffset+t._raw.byteLength,t},a.create=function(e){var t=new a;return t.type=e,t.boxes=[],t},a.prototype._boxContainers=["dinf","edts","mdia","meco","mfra","minf","moof","moov","mvex","stbl","strk","traf","trak","tref","udta","vttc","sinf","schi","encv","enca"],a.prototype._boxProcessors={},a.prototype._procField=function(e,t,n){this._parsing?this[e]=this._readField(t,n):this._writeField(t,n,this[e])},a.prototype._procFieldArray=function(e,t,n,r){var i;if(this._parsing)for(this[e]=[],i=0;i<t;i++)this[e][i]=this._readField(n,r);else for(i=0;i<this[e].length;i++)this._writeField(n,r,this[e][i])},a.prototype._procFullBox=function(){this._procField("version","uint",8),this._procField("flags","uint",24)},a.prototype._procEntries=function(e,t,n){var r;if(this._parsing)for(this[e]=[],r=0;r<t;r++)this[e].push({}),n.call(this,this[e][r]);else for(r=0;r<t;r++)n.call(this,this[e][r])},a.prototype._procSubEntries=function(e,t,n,r){var i;if(this._parsing)for(e[t]=[],i=0;i<n;i++)e[t].push({}),r.call(this,e[t][i]);else for(i=0;i<n;i++)r.call(this,e[t][i])},a.prototype._procEntryField=function(e,t,n,r){this._parsing?e[t]=this._readField(n,r):this._writeField(n,r,e[t])},a.prototype._procSubBoxes=function(e,t){var n;if(this._parsing)for(this[e]=[],n=0;n<t;n++)this[e].push(a.parse(this));else for(n=0;n<t;n++)this._rawo?this[e][n].write():this.size+=this[e][n].getLength()},a.prototype._readField=function(e,t){switch(e){case"uint":return this._readUint(t);case"int":return this._readInt(t);case"template":return this._readTemplate(t);case"string":return-1===t?this._readTerminatedString():this._readString(t);case"data":return this._readData(t);case"utf8":return this._readUTF8String();default:return-1}},a.prototype._readInt=function(e){var t=null,n=this._cursor.offset-this._raw.byteOffset;switch(e){case 8:t=this._raw.getInt8(n);break;case 16:t=this._raw.getInt16(n);break;case 32:t=this._raw.getInt32(n);break;case 64:var r=this._raw.getInt32(n),i=this._raw.getInt32(n+4);t=r*Math.pow(2,32)+i}return this._cursor.offset+=e>>3,t},a.prototype._readUint=function(e){var t,n,r=null,i=this._cursor.offset-this._raw.byteOffset;switch(e){case 8:r=this._raw.getUint8(i);break;case 16:r=this._raw.getUint16(i);break;case 24:r=((t=this._raw.getUint16(i))<<8)+(n=this._raw.getUint8(i+2));break;case 32:r=this._raw.getUint32(i);break;case 64:t=this._raw.getUint32(i),n=this._raw.getUint32(i+4),r=t*Math.pow(2,32)+n}return this._cursor.offset+=e>>3,r},a.prototype._readString=function(e){for(var t="",n=0;n<e;n++){var r=this._readUint(8);t+=String.fromCharCode(r)}return t},a.prototype._readTemplate=function(e){return this._readUint(e/2)+this._readUint(e/2)/Math.pow(2,e/2)},a.prototype._readTerminatedString=function(){for(var e="";this._cursor.offset-this._offset<this._raw.byteLength;){var t=this._readUint(8);if(0===t)break;e+=String.fromCharCode(t)}return e},a.prototype._readData=function(e){var t=e>0?e:this._raw.byteLength-(this._cursor.offset-this._offset);if(t>0){var n=new Uint8Array(this._raw.buffer,this._cursor.offset,t);return this._cursor.offset+=t,n}return null},a.prototype._readUTF8String=function(){var e=this._raw.byteLength-(this._cursor.offset-this._offset),t=null;return e>0&&(t=new DataView(this._raw.buffer,this._cursor.offset,e),this._cursor.offset+=e),t?r.Utils.dataViewToString(t):t},a.prototype._parseBox=function(){if(this._parsing=!0,this._cursor.offset=this._offset,this._offset+8>this._raw.buffer.byteLength)this._root._incomplete=!0;else{switch(this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this.size){case 0:this._raw=new DataView(this._raw.buffer,this._offset,this._raw.byteLength-this._cursor.offset+8);break;case 1:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.largesize);break;default:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.size)}this._incomplete||(this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type)?this._parseContainerBox():this._data=this._readData())}},a.prototype._parseFullBox=function(){this.version=this._readUint(8),this.flags=this._readUint(24)},a.prototype._parseContainerBox=function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.boxes.push(a.parse(this))},a.prototype.append=function(e,t){r.Utils.appendBox(this,e,t)},a.prototype.getLength=function(){if(this._parsing=!1,this._rawo=null,this.size=0,this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type))for(var e=0;e<this.boxes.length;e++)this.size+=this.boxes[e].getLength();return this._data&&this._writeData(this._data),this.size},a.prototype.write=function(){switch(this._parsing=!1,this._cursor.offset=this._parent._cursor.offset,this.size){case 0:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.parent._rawo.byteLength-this._cursor.offset);break;case 1:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.largesize);break;default:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.size)}if(this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type))for(var e=0;e<this.boxes.length;e++)this.boxes[e].write();return this._data&&this._writeData(this._data),this._parent._cursor.offset+=this.size,this.size},a.prototype._writeInt=function(e,t){if(this._rawo){var n=this._cursor.offset-this._rawo.byteOffset;switch(e){case 8:this._rawo.setInt8(n,t);break;case 16:this._rawo.setInt16(n,t);break;case 32:this._rawo.setInt32(n,t);break;case 64:var r=Math.floor(t/Math.pow(2,32)),i=t-r*Math.pow(2,32);this._rawo.setUint32(n,r),this._rawo.setUint32(n+4,i)}this._cursor.offset+=e>>3}else this.size+=e>>3},a.prototype._writeUint=function(e,t){if(this._rawo){var n,r,i=this._cursor.offset-this._rawo.byteOffset;switch(e){case 8:this._rawo.setUint8(i,t);break;case 16:this._rawo.setUint16(i,t);break;case 24:n=(16776960&t)>>8,r=255&t,this._rawo.setUint16(i,n),this._rawo.setUint8(i+2,r);break;case 32:this._rawo.setUint32(i,t);break;case 64:r=t-(n=Math.floor(t/Math.pow(2,32)))*Math.pow(2,32),this._rawo.setUint32(i,n),this._rawo.setUint32(i+4,r)}this._cursor.offset+=e>>3}else this.size+=e>>3},a.prototype._writeString=function(e,t){for(var n=0;n<e;n++)this._writeUint(8,t.charCodeAt(n))},a.prototype._writeTerminatedString=function(e){if(0!==e.length){for(var t=0;t<e.length;t++)this._writeUint(8,e.charCodeAt(t));this._writeUint(8,0)}},a.prototype._writeTemplate=function(e,t){var n=Math.floor(t),r=(t-n)*Math.pow(2,e/2);this._writeUint(e/2,n),this._writeUint(e/2,r)},a.prototype._writeData=function(e){if(e)if(this._rawo){if(e instanceof Array){for(var t=this._cursor.offset-this._rawo.byteOffset,n=0;n<e.length;n++)this._rawo.setInt8(t+n,e[n]);this._cursor.offset+=e.length}e instanceof Uint8Array&&(this._root.bytes.set(e,this._cursor.offset),this._cursor.offset+=e.length)}else this.size+=e.length},a.prototype._writeUTF8String=function(e){var t=r.Utils.utf8ToByteArray(e);if(this._rawo)for(var n=new DataView(this._rawo.buffer,this._cursor.offset,t.length),i=0;i<t.length;i++)n.setUint8(i,t[i]);else this.size+=t.length},a.prototype._writeField=function(e,t,n){switch(e){case"uint":this._writeUint(t,n);break;case"int":this._writeInt(t,n);break;case"template":this._writeTemplate(t,n);break;case"string":-1==t?this._writeTerminatedString(n):this._writeString(t,n);break;case"data":this._writeData(n);break;case"utf8":this._writeUTF8String(n)}},a.prototype._boxProcessors.avc1=a.prototype._boxProcessors.encv=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procField("pre_defined1","uint",16),this._procField("reserved2","uint",16),this._procFieldArray("pre_defined2",3,"uint",32),this._procField("width","uint",16),this._procField("height","uint",16),this._procField("horizresolution","template",32),this._procField("vertresolution","template",32),this._procField("reserved3","uint",32),this._procField("frame_count","uint",16),this._procFieldArray("compressorname",32,"uint",8),this._procField("depth","uint",16),this._procField("pre_defined3","int",16),this._procField("config","data",-1)},a.prototype._boxProcessors.dref=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},a.prototype._boxProcessors.elst=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(e){this._procEntryField(e,"segment_duration","uint",1===this.version?64:32),this._procEntryField(e,"media_time","int",1===this.version?64:32),this._procEntryField(e,"media_rate_integer","int",16),this._procEntryField(e,"media_rate_fraction","int",16)}))},a.prototype._boxProcessors.emsg=function(){this._procFullBox(),1==this.version?(this._procField("timescale","uint",32),this._procField("presentation_time","uint",64),this._procField("event_duration","uint",32),this._procField("id","uint",32),this._procField("scheme_id_uri","string",-1),this._procField("value","string",-1)):(this._procField("scheme_id_uri","string",-1),this._procField("value","string",-1),this._procField("timescale","uint",32),this._procField("presentation_time_delta","uint",32),this._procField("event_duration","uint",32),this._procField("id","uint",32)),this._procField("message_data","data",-1)},a.prototype._boxProcessors.free=a.prototype._boxProcessors.skip=function(){this._procField("data","data",-1)},a.prototype._boxProcessors.frma=function(){this._procField("data_format","uint",32)},a.prototype._boxProcessors.ftyp=a.prototype._boxProcessors.styp=function(){this._procField("major_brand","string",4),this._procField("minor_version","uint",32);var e=-1;this._parsing&&(e=(this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset))/4),this._procFieldArray("compatible_brands",e,"string",4)},a.prototype._boxProcessors.hdlr=function(){this._procFullBox(),this._procField("pre_defined","uint",32),this._procField("handler_type","string",4),this._procFieldArray("reserved",3,"uint",32),this._procField("name","string",-1)},a.prototype._boxProcessors.mdat=function(){this._procField("data","data",-1)},a.prototype._boxProcessors.mdhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",1==this.version?64:32),this._parsing||"string"!=typeof this.language||(this.language=this.language.charCodeAt(0)-96<<10|this.language.charCodeAt(1)-96<<5|this.language.charCodeAt(2)-96),this._procField("language","uint",16),this._parsing&&(this.language=String.fromCharCode(96+(this.language>>10&31),96+(this.language>>5&31),96+(31&this.language))),this._procField("pre_defined","uint",16)},a.prototype._boxProcessors.mehd=function(){this._procFullBox(),this._procField("fragment_duration","uint",1==this.version?64:32)},a.prototype._boxProcessors.mfhd=function(){this._procFullBox(),this._procField("sequence_number","uint",32)},a.prototype._boxProcessors.mfro=function(){this._procFullBox(),this._procField("mfra_size","uint",32)},a.prototype._boxProcessors.mp4a=a.prototype._boxProcessors.enca=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procField("channelcount","uint",16),this._procField("samplesize","uint",16),this._procField("pre_defined","uint",16),this._procField("reserved3","uint",16),this._procField("samplerate","template",32),this._procField("esds","data",-1)},a.prototype._boxProcessors.mvhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procField("rate","template",32),this._procField("volume","template",16),this._procField("reserved1","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procFieldArray("matrix",9,"template",32),this._procFieldArray("pre_defined",6,"uint",32),this._procField("next_track_ID","uint",32)},a.prototype._boxProcessors.payl=function(){this._procField("cue_text","utf8")},a.prototype._boxProcessors.pssh=function(){this._procFullBox(),this._procFieldArray("SystemID",16,"uint",8),this._procField("DataSize","uint",32),this._procFieldArray("Data",this.DataSize,"uint",8)},a.prototype._boxProcessors.schm=function(){this._procFullBox(),this._procField("scheme_type","uint",32),this._procField("scheme_version","uint",32),1&this.flags&&this._procField("scheme_uri","string",-1)},a.prototype._boxProcessors.sdtp=function(){this._procFullBox();var e=-1;this._parsing&&(e=this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset)),this._procFieldArray("sample_dependency_table",e,"uint",8)},a.prototype._boxProcessors.sidx=function(){this._procFullBox(),this._procField("reference_ID","uint",32),this._procField("timescale","uint",32),this._procField("earliest_presentation_time","uint",1==this.version?64:32),this._procField("first_offset","uint",1==this.version?64:32),this._procField("reserved","uint",16),this._procField("reference_count","uint",16),this._procEntries("references",this.reference_count,(function(e){this._parsing||(e.reference=(1&e.reference_type)<<31,e.reference|=2147483647&e.referenced_size,e.sap=(1&e.starts_with_SAP)<<31,e.sap|=(3&e.SAP_type)<<28,e.sap|=268435455&e.SAP_delta_time),this._procEntryField(e,"reference","uint",32),this._procEntryField(e,"subsegment_duration","uint",32),this._procEntryField(e,"sap","uint",32),this._parsing&&(e.reference_type=e.reference>>31&1,e.referenced_size=2147483647&e.reference,e.starts_with_SAP=e.sap>>31&1,e.SAP_type=e.sap>>28&7,e.SAP_delta_time=268435455&e.sap)}))},a.prototype._boxProcessors.smhd=function(){this._procFullBox(),this._procField("balance","uint",16),this._procField("reserved","uint",16)},a.prototype._boxProcessors.ssix=function(){this._procFullBox(),this._procField("subsegment_count","uint",32),this._procEntries("subsegments",this.subsegment_count,(function(e){this._procEntryField(e,"ranges_count","uint",32),this._procSubEntries(e,"ranges",e.ranges_count,(function(e){this._procEntryField(e,"level","uint",8),this._procEntryField(e,"range_size","uint",24)}))}))},a.prototype._boxProcessors.stsd=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},a.prototype._boxProcessors.subs=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(e){this._procEntryField(e,"sample_delta","uint",32),this._procEntryField(e,"subsample_count","uint",16),this._procSubEntries(e,"subsamples",e.subsample_count,(function(e){this._procEntryField(e,"subsample_size","uint",1===this.version?32:16),this._procEntryField(e,"subsample_priority","uint",8),this._procEntryField(e,"discardable","uint",8),this._procEntryField(e,"codec_specific_parameters","uint",32)}))}))},a.prototype._boxProcessors.tenc=function(){this._procFullBox(),this._procField("default_IsEncrypted","uint",24),this._procField("default_IV_size","uint",8),this._procFieldArray("default_KID",16,"uint",8)},a.prototype._boxProcessors.tfdt=function(){this._procFullBox(),this._procField("baseMediaDecodeTime","uint",1==this.version?64:32)},a.prototype._boxProcessors.tfhd=function(){this._procFullBox(),this._procField("track_ID","uint",32),1&this.flags&&this._procField("base_data_offset","uint",64),2&this.flags&&this._procField("sample_description_offset","uint",32),8&this.flags&&this._procField("default_sample_duration","uint",32),16&this.flags&&this._procField("default_sample_size","uint",32),32&this.flags&&this._procField("default_sample_flags","uint",32)},a.prototype._boxProcessors.tfra=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._parsing||(this.reserved=0,this.reserved|=(48&this.length_size_of_traf_num)<<4,this.reserved|=(12&this.length_size_of_trun_num)<<2,this.reserved|=3&this.length_size_of_sample_num),this._procField("reserved","uint",32),this._parsing&&(this.length_size_of_traf_num=(48&this.reserved)>>4,this.length_size_of_trun_num=(12&this.reserved)>>2,this.length_size_of_sample_num=3&this.reserved),this._procField("number_of_entry","uint",32),this._procEntries("entries",this.number_of_entry,(function(e){this._procEntryField(e,"time","uint",1===this.version?64:32),this._procEntryField(e,"moof_offset","uint",1===this.version?64:32),this._procEntryField(e,"traf_number","uint",8*(this.length_size_of_traf_num+1)),this._procEntryField(e,"trun_number","uint",8*(this.length_size_of_trun_num+1)),this._procEntryField(e,"sample_number","uint",8*(this.length_size_of_sample_num+1))}))},a.prototype._boxProcessors.tkhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("track_ID","uint",32),this._procField("reserved1","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procFieldArray("reserved2",2,"uint",32),this._procField("layer","uint",16),this._procField("alternate_group","uint",16),this._procField("volume","template",16),this._procField("reserved3","uint",16),this._procFieldArray("matrix",9,"template",32),this._procField("width","template",32),this._procField("height","template",32)},a.prototype._boxProcessors.trex=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._procField("default_sample_description_index","uint",32),this._procField("default_sample_duration","uint",32),this._procField("default_sample_size","uint",32),this._procField("default_sample_flags","uint",32)},a.prototype._boxProcessors.trun=function(){this._procFullBox(),this._procField("sample_count","uint",32),1&this.flags&&this._procField("data_offset","int",32),4&this.flags&&this._procField("first_sample_flags","uint",32),this._procEntries("samples",this.sample_count,(function(e){256&this.flags&&this._procEntryField(e,"sample_duration","uint",32),512&this.flags&&this._procEntryField(e,"sample_size","uint",32),1024&this.flags&&this._procEntryField(e,"sample_flags","uint",32),2048&this.flags&&this._procEntryField(e,"sample_composition_time_offset",1===this.version?"int":"uint",32)}))},a.prototype._boxProcessors["url "]=a.prototype._boxProcessors["urn "]=function(){this._procFullBox(),"urn "===this.type&&this._procField("name","string",-1),this._procField("location","string",-1)},a.prototype._boxProcessors.vlab=function(){this._procField("source_label","utf8")},a.prototype._boxProcessors.vmhd=function(){this._procFullBox(),this._procField("graphicsmode","uint",16),this._procFieldArray("opcolor",3,"uint",16)},a.prototype._boxProcessors.vttC=function(){this._procField("config","utf8")},a.prototype._boxProcessors.vtte=function(){}},"./node_modules/core-util-is/lib/util.js":function(e,t,n){(function(e){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,n("./node_modules/node-libs-browser/node_modules/buffer/index.js").Buffer)},"./node_modules/es6-promise/auto.js":function(e,t,n){e.exports=n("./node_modules/es6-promise/dist/es6-promise.js").polyfill()},"./node_modules/es6-promise/dist/es6-promise.js":function(e,t,n){(function(t,n){!function(t,n){e.exports=n()}(0,(function(){function e(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,a=void 0,s=void 0,o=function(e,t){p[i]=e,p[i+1]=t,2===(i+=2)&&(s?s(g):T())},l="undefined"!=typeof window?window:void 0,u=l||{},c=u.MutationObserver||u.WebKitMutationObserver,d="undefined"==typeof self&&void 0!==t&&"[object process]"==={}.toString.call(t),f="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){var e=setTimeout;return function(){return e(g,1)}}var p=new Array(1e3);function g(){for(var e=0;e<i;e+=2)(0,p[e])(p[e+1]),p[e]=void 0,p[e+1]=void 0;i=0}var m,y,v,_,T=void 0;function E(e,t){var n=this,r=new this.constructor(A);void 0===r[S]&&F(r);var i=n._state;if(i){var a=arguments[i-1];o((function(){return L(i,r,a,n._result)}))}else M(n,r,e,t);return r}function b(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(A);return D(t,e),t}d?T=function(){return t.nextTick(g)}:c?(y=0,v=new c(g),_=document.createTextNode(""),v.observe(_,{characterData:!0}),T=function(){_.data=y=++y%2}):f?((m=new MessageChannel).port1.onmessage=g,T=function(){return m.port2.postMessage(0)}):T=void 0===l?function(){try{var e=Function("return this")().require("vertx");return void 0!==(a=e.runOnLoop||e.runOnContext)?function(){a(g)}:h()}catch(e){return h()}}():h();var S=Math.random().toString(36).substring(2);function A(){}var w=void 0,I=1,C=2;function R(t,n,r){n.constructor===t.constructor&&r===E&&n.constructor.resolve===b?function(e,t){t._state===I?O(e,t._result):t._state===C?P(e,t._result):M(t,void 0,(function(t){return D(e,t)}),(function(t){return P(e,t)}))}(t,n):void 0===r?O(t,n):e(r)?function(e,t,n){o((function(e){var r=!1,i=function(e,t,n,r){try{e.call(t,n,r)}catch(e){return e}}(n,t,(function(n){r||(r=!0,t!==n?D(e,n):O(e,n))}),(function(t){r||(r=!0,P(e,t))}),e._label);!r&&i&&(r=!0,P(e,i))}),e)}(t,n,r):O(t,n)}function D(e,t){if(e===t)P(e,new TypeError("You cannot resolve a promise with itself"));else if(i=typeof(r=t),null===r||"object"!==i&&"function"!==i)O(e,t);else{var n=void 0;try{n=t.then}catch(t){return void P(e,t)}R(e,t,n)}var r,i}function N(e){e._onerror&&e._onerror(e._result),x(e)}function O(e,t){e._state===w&&(e._result=t,e._state=I,0!==e._subscribers.length&&o(x,e))}function P(e,t){e._state===w&&(e._state=C,e._result=t,o(N,e))}function M(e,t,n,r){var i=e._subscribers,a=i.length;e._onerror=null,i[a]=t,i[a+I]=n,i[a+C]=r,0===a&&e._state&&o(x,e)}function x(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r=void 0,i=void 0,a=e._result,s=0;s<t.length;s+=3)r=t[s],i=t[s+n],r?L(n,r,i,a):i(a);e._subscribers.length=0}}function L(t,n,r,i){var a=e(r),s=void 0,o=void 0,l=!0;if(a){try{s=r(i)}catch(e){l=!1,o=e}if(n===s)return void P(n,new TypeError("A promises callback cannot return that same promise."))}else s=i;n._state!==w||(a&&l?D(n,s):!1===l?P(n,o):t===I?O(n,s):t===C&&P(n,s))}var k=0;function F(e){e[S]=k++,e._state=void 0,e._result=void 0,e._subscribers=[]}var U=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(A),this.promise[S]||F(this.promise),r(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?O(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&O(this.promise,this._result))):P(this.promise,new Error("Array Methods must be provided an Array"))}return e.prototype._enumerate=function(e){for(var t=0;this._state===w&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var n=this._instanceConstructor,r=n.resolve;if(r===b){var i=void 0,a=void 0,s=!1;try{i=e.then}catch(e){s=!0,a=e}if(i===E&&e._state!==w)this._settledAt(e._state,t,e._result);else if("function"!=typeof i)this._remaining--,this._result[t]=e;else if(n===B){var o=new n(A);s?P(o,a):R(o,e,i),this._willSettleAt(o,t)}else this._willSettleAt(new n((function(t){return t(e)})),t)}else this._willSettleAt(r(e),t)},e.prototype._settledAt=function(e,t,n){var r=this.promise;r._state===w&&(this._remaining--,e===C?P(r,n):this._result[t]=n),0===this._remaining&&O(r,this._result)},e.prototype._willSettleAt=function(e,t){var n=this;M(e,void 0,(function(e){return n._settledAt(I,t,e)}),(function(e){return n._settledAt(C,t,e)}))},e}(),B=function(){function t(e){this[S]=k++,this._result=this._state=void 0,this._subscribers=[],A!==e&&("function"!=typeof e&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof t?function(e,t){try{t((function(t){D(e,t)}),(function(t){P(e,t)}))}catch(t){P(e,t)}}(this,e):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return t.prototype.catch=function(e){return this.then(null,e)},t.prototype.finally=function(t){var n=this,r=n.constructor;return e(t)?n.then((function(e){return r.resolve(t()).then((function(){return e}))}),(function(e){return r.resolve(t()).then((function(){throw e}))})):n.then(t,t)},t}();return B.prototype.then=E,B.all=function(e){return new U(this,e).promise},B.race=function(e){var t=this;return r(e)?new t((function(n,r){for(var i=e.length,a=0;a<i;a++)t.resolve(e[a]).then(n,r)})):new t((function(e,t){return t(new TypeError("You must pass an array to race."))}))},B.resolve=b,B.reject=function(e){var t=new this(A);return P(t,e),t},B._setScheduler=function(e){s=e},B._setAsap=function(e){o=e},B._asap=o,B.polyfill=function(){var e=void 0;if(void 0!==n)e=n;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var r=null;try{r=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===r&&!t.cast)return}e.Promise=B},B.Promise=B,B}))}).call(this,n("./node_modules/process/browser.js"),n("./node_modules/webpack/buildin/global.js"))},"./node_modules/fast-deep-equal/index.js":function(e,t,n){var r=Array.isArray,i=Object.keys,a=Object.prototype.hasOwnProperty;e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){var s,o,l,u=r(t),c=r(n);if(u&&c){if((o=t.length)!=n.length)return!1;for(s=o;0!=s--;)if(!e(t[s],n[s]))return!1;return!0}if(u!=c)return!1;var d=t instanceof Date,f=n instanceof Date;if(d!=f)return!1;if(d&&f)return t.getTime()==n.getTime();var h=t instanceof RegExp,p=n instanceof RegExp;if(h!=p)return!1;if(h&&p)return t.toString()==n.toString();var g=i(t);if((o=g.length)!==i(n).length)return!1;for(s=o;0!=s--;)if(!a.call(n,g[s]))return!1;for(s=o;0!=s--;)if(!e(t[l=g[s]],n[l]))return!1;return!0}return t!=t&&n!=n}},"./node_modules/ieee754/index.js":function(e,t){t.read=function(e,t,n,r,i){var a,s,o=8*i-r-1,l=(1<<o)-1,u=l>>1,c=-7,d=n?i-1:0,f=n?-1:1,h=e[t+d];for(d+=f,a=h&(1<<-c)-1,h>>=-c,c+=o;c>0;a=256*a+e[t+d],d+=f,c-=8);for(s=a&(1<<-c)-1,a>>=-c,c+=r;c>0;s=256*s+e[t+d],d+=f,c-=8);if(0===a)a=1-u;else{if(a===l)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,r),a-=u}return(h?-1:1)*s*Math.pow(2,a-r)},t.write=function(e,t,n,r,i,a){var s,o,l,u=8*a-i-1,c=(1<<u)-1,d=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:a-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+d>=1?f/l:f*Math.pow(2,1-d))*l>=2&&(s++,l/=2),s+d>=c?(o=0,s=c):s+d>=1?(o=(t*l-1)*Math.pow(2,i),s+=d):(o=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[n+h]=255&o,h+=p,o/=256,i-=8);for(s=s<<i|o,u+=i;u>0;e[n+h]=255&s,h+=p,s/=256,u-=8);e[n+h-p]|=128*g}},"./node_modules/imsc/src/main/js/doc.js":function(e,t,n){!function(e,t,n,r,i){function a(e,t,n,r){var i=r&&"seq"===r.timeContainer,s=0;r&&(s=i&&n?n.end:r.begin),t.begin=t.explicit_begin?t.explicit_begin+s:s;var o=t.begin,l=null;for(var u in t.sets)a(e,t.sets[u],l,t),o="seq"===t.timeContainer?t.sets[u].end:Math.max(o,t.sets[u].end),l=t.sets[u];if("contents"in t)for(var c in t.contents)a(e,t.contents[c],l,t),o="seq"===t.timeContainer?t.contents[c].end:Math.max(o,t.contents[c].end),l=t.contents[c];else o=i?t.begin:Number.POSITIVE_INFINITY;null!==t.explicit_end&&null!==t.explicit_dur?t.end=Math.min(t.begin+t.explicit_dur,s+t.explicit_end):null===t.explicit_end&&null!==t.explicit_dur?t.end=t.begin+t.explicit_dur:null!==t.explicit_end&&null===t.explicit_dur?t.end=s+t.explicit_end:t.end=o,delete t.explicit_begin,delete t.explicit_dur,delete t.explicit_end,e._registerEvent(t)}function s(e){this.node=e}function o(){this.events=[],this.head=null,this.body=null}function l(){this.styling=null,this.layout=null}function u(){this.styles={}}function c(){this.id=null,this.styleAttrs=null,this.styleRefs=null}function d(){this.regions={}}function f(e){this.kind=e}function h(e){this.id=e}function p(e){this.regionID=e}function g(e){this.styleAttrs=e}function m(e){this.sets=e}function y(e){this.contents=e}function v(e,t,n){this.explicit_begin=e,this.explicit_end=t,this.explicit_dur=n}function _(){f.call(this,"body")}function T(){f.call(this,"div")}function E(){f.call(this,"p")}function b(){f.call(this,"span")}function S(){f.call(this,"span")}function A(){f.call(this,"br")}function w(){}function I(){}function C(e){return e&&"xml:id"in e.attributes&&e.attributes["xml:id"].value||null}function R(e){return e&&"style"in e.attributes?e.attributes.style.value.split(" "):[]}function D(e,t){var n={};if(null!==e)for(var i in e.attributes){var a=e.attributes[i].uri+" "+e.attributes[i].local,s=r.byQName[a];if(void 0!==s){var o=s.parse(e.attributes[i].value);null!==o?(n[a]=o,s===r.byName.zIndex&&L(t,"zIndex attribute present but not used by IMSC1 since regions do not overlap")):k(t,"Cannot parse styling attribute "+a+" --\x3e "+e.attributes[i].value)}}return n}function N(e,t,n){for(var r in e.attributes)if(e.attributes[r].uri===t&&e.attributes[r].local===n)return e.attributes[r].value;return null}function O(e,t,n){var r,i=null;return null!==(r=/^(\d+(?:\.\d+)?)f$/.exec(n))?null!==t&&(i=parseFloat(r[1])/t):null!==(r=/^(\d+(?:\.\d+)?)t$/.exec(n))?null!==e&&(i=parseFloat(r[1])/e):null!==(r=/^(\d+(?:\.\d+)?)ms$/.exec(n))?i=parseFloat(r[1])/1e3:null!==(r=/^(\d+(?:\.\d+)?)s$/.exec(n))?i=parseFloat(r[1]):null!==(r=/^(\d+(?:\.\d+)?)h$/.exec(n))?i=3600*parseFloat(r[1]):null!==(r=/^(\d+(?:\.\d+)?)m$/.exec(n))?i=60*parseFloat(r[1]):null!==(r=/^(\d{2,}):(\d\d):(\d\d(?:\.\d+)?)$/.exec(n))?i=3600*parseInt(r[1])+60*parseInt(r[2])+parseFloat(r[3]):null!==(r=/^(\d{2,}):(\d\d):(\d\d)\:(\d{2,})$/.exec(n))&&null!==t&&(i=3600*parseInt(r[1])+60*parseInt(r[2])+parseInt(r[3])+(null===r[4]?0:parseInt(r[4])/t)),i}function P(e,t,n){for(;t.styleRefs.length>0;){var r=t.styleRefs.pop();r in e.styles?(P(e,e.styles[r],n),x(e.styles[r].styleAttrs,t.styleAttrs)):k(n,"Non-existant style id referenced")}}function M(e,t,n,r){for(var i=t.length-1;i>=0;i--){var a=t[i];a in e.styles?x(e.styles[a].styleAttrs,n):k(r,"Non-existant style id referenced")}}function x(e,t){for(var n in e)n in t||(t[n]=e[n])}function L(e,t){if(e&&e.warn&&e.warn(t))throw t}function k(e,t){if(e&&e.error&&e.error(t))throw t}function F(e,t){throw e&&e.fatal&&e.fatal(t),t}function U(e,t){for(var n,r=0,i=e.length-1;r<=i;){var a=e[n=Math.floor((r+i)/2)];if(a<t)r=n+1;else{if(!(a>t))return{found:!0,index:n};i=n-1}}return{found:!1,index:r}}e.fromXML=function(e,r,i){var f=t.parser(!0,{xmlns:!0}),h=[],p=[],g=[],m=0,y=null;f.onclosetag=function(e){if(h[0]instanceof u)for(var t in h[0].styles)P(h[0],h[0].styles[t],r);else if(h[0]instanceof E||h[0]instanceof b){if(h[0].contents.length>1){var a,o=[h[0].contents[0]];for(a=1;a<h[0].contents.length;a++)h[0].contents[a]instanceof S&&o[o.length-1]instanceof S?o[o.length-1].text+=h[0].contents[a].text:o.push(h[0].contents[a]);h[0].contents=o}h[0]instanceof b&&1===h[0].contents.length&&h[0].contents[0]instanceof S&&(h[0].text=h[0].contents[0].text,delete h[0].contents)}else h[0]instanceof s&&(h[0].node.uri===n.ns_tt&&"metadata"===h[0].node.local?m--:m>0&&i&&"onCloseTag"in i&&i.onCloseTag());g.shift(),p.shift(),h.shift()},f.ontext=function(e){if(void 0===h[0]);else if(h[0]instanceof b||h[0]instanceof E){var t=new S;t.initFromText(y,h[0],e,g[0],r),h[0].contents.push(t)}else h[0]instanceof s&&m>0&&i&&"onText"in i&&i.onText(e)},f.onopentag=function(e){var t=e.attributes["xml:space"];t?g.unshift(t.value):0===g.length?g.unshift("default"):g.unshift(g[0]);var a=e.attributes["xml:lang"];if(a?p.unshift(a.value):0===p.length?p.unshift(""):p.unshift(p[0]),e.uri===n.ns_tt)if("tt"===e.local)null!==y&&F(r,"Two <tt> elements at ("+this.line+","+this.column+")"),(y=new o).initFromNode(e,r),h.unshift(y);else if("head"===e.local)h[0]instanceof o||F(r,"Parent of <head> element is not <tt> at ("+this.line+","+this.column+")"),null!==y.head&&F("Second <head> element at ("+this.line+","+this.column+")"),y.head=new l,h.unshift(y.head);else if("styling"===e.local)h[0]instanceof l||F(r,"Parent of <styling> element is not <head> at ("+this.line+","+this.column+")"),null!==y.head.styling&&F("Second <styling> element at ("+this.line+","+this.column+")"),y.head.styling=new u,h.unshift(y.head.styling);else if("style"===e.local){var f;h[0]instanceof u?((f=new c).initFromNode(e,r),f.id?y.head.styling.styles[f.id]=f:k(r,"<style> element missing @id attribute"),h.unshift(f)):h[0]instanceof w?((f=new c).initFromNode(e,r),x(f.styleAttrs,h[0].styleAttrs),h.unshift(f)):F(r,"Parent of <style> element is not <styling> or <region> at ("+this.line+","+this.column+")")}else if("layout"===e.local)h[0]instanceof l||F(r,"Parent of <layout> element is not <head> at "+this.line+","+this.column+")"),null!==y.head.layout&&F(r,"Second <layout> element at "+this.line+","+this.column+")"),y.head.layout=new d,h.unshift(y.head.layout);else if("region"===e.local){h[0]instanceof d||F(r,"Parent of <region> element is not <layout> at "+this.line+","+this.column+")");var v=new w;v.initFromNode(y,e,r),!v.id||v.id in y.head.layout.regions?k(r,"Ignoring <region> with duplicate or missing @id at "+this.line+","+this.column+")"):y.head.layout.regions[v.id]=v,h.unshift(v)}else if("body"===e.local){h[0]instanceof o||F(r,"Parent of <body> element is not <tt> at "+this.line+","+this.column+")"),null!==y.body&&F(r,"Second <body> element at "+this.line+","+this.column+")");var S=new _;S.initFromNode(y,e,r),y.body=S,h.unshift(S)}else if("div"===e.local){h[0]instanceof T||h[0]instanceof _||F(r,"Parent of <div> element is not <body> or <div> at "+this.line+","+this.column+")");var C=new T;C.initFromNode(y,h[0],e,r),h[0].contents.push(C),h.unshift(C)}else if("p"===e.local){h[0]instanceof T||F(r,"Parent of <p> element is not <div> at "+this.line+","+this.column+")");var R=new E;R.initFromNode(y,h[0],e,r),h[0].contents.push(R),h.unshift(R)}else if("span"===e.local){h[0]instanceof b||h[0]instanceof E||F(r,"Parent of <span> element is not <span> or <p> at "+this.line+","+this.column+")");var D=new b;D.initFromNode(y,h[0],e,g[0],r),h[0].contents.push(D),h.unshift(D)}else if("br"===e.local){h[0]instanceof b||h[0]instanceof E||F(r,"Parent of <br> element is not <span> or <p> at "+this.line+","+this.column+")");var N=new A;N.initFromNode(y,h[0],e,r),h[0].contents.push(N),h.unshift(N)}else if("set"===e.local){h[0]instanceof b||h[0]instanceof E||h[0]instanceof T||h[0]instanceof _||h[0]instanceof w||h[0]instanceof A||F(r,"Parent of <set> element is not a content element or a region at "+this.line+","+this.column+")");var O=new I;O.initFromNode(y,h[0],e,r),h[0].sets.push(O),h.unshift(O)}else h.unshift(new s(e));else h.unshift(new s(e));if(h[0]instanceof s)if(e.uri===n.ns_tt&&"metadata"===e.local)m++;else if(m>0&&i&&"onOpenTag"in i){var P=[];for(var M in e.attributes)P[e.attributes[M].uri+" "+e.attributes[M].local]={uri:e.attributes[M].uri,local:e.attributes[M].local,value:e.attributes[M].value};i.onOpenTag(e.uri,e.local,P)}},f.write(e).close(),null!==y.head?delete y.head.styling:y.head=new l,null===y.head.layout&&(y.head.layout=new d);var v=!1;for(var C in y.head.layout.regions){v=!0;break}if(!v){var R=w.prototype.createDefaultRegion();y.head.layout.regions[R.id]=R}for(var D in y.head.layout.regions)a(y,y.head.layout.regions[D],null,null);return y.body&&a(y,y.body,null,null),y},o.prototype.initFromNode=function(e,t){this.cellResolution=function(e,t){var r=N(e,n.ns_ttp,"cellResolution"),i=15,a=32;if(null!==r){var s=/(\d+) (\d+)/.exec(r);null!==s?(a=parseInt(s[1]),i=parseInt(s[2])):L(t,"Malformed cellResolution value (using initial value instead)")}return{w:a,h:i}}(e,t);var r=function(e,t){var r,i=N(e,n.ns_ttp,"frameRate"),a=30;null!==i&&(null!==(r=/(\d+)/.exec(i))?a=parseInt(r[1]):L(t,"Malformed frame rate attribute (using initial value instead)"));var s=N(e,n.ns_ttp,"frameRateMultiplier"),o=1;null!==s&&(null!==(r=/(\d+) (\d+)/.exec(s))?o=parseInt(r[1])/parseInt(r[2]):L(t,"Malformed frame rate multiplier attribute (using initial value instead)"));var l=o*a,u=1,c=N(e,n.ns_ttp,"tickRate");return null===c?null!==i&&(u=l):null!==(r=/(\d+)/.exec(c))?u=parseInt(r[1]):L(t,"Malformed tick rate attribute (using initial value instead)"),{effectiveFrameRate:l,tickRate:u}}(e,t);this.effectiveFrameRate=r.effectiveFrameRate,this.tickRate=r.tickRate,this.aspectRatio=function(e,t){var r=N(e,n.ns_ittp,"aspectRatio"),i=null;if(null!==r){var a=/(\d+) (\d+)/.exec(r);if(null!==a){var s=parseInt(a[1]),o=parseInt(a[2]);0!==s&&0!==o?i=s/o:k(t,"Illegal aspectRatio values (ignoring)")}else k(t,"Malformed aspectRatio attribute (ignoring)")}return i}(e,t);var a=N(e,n.ns_ttp,"timeBase");null!==a&&"media"!==a&&F(t,"Unsupported time base");var s=function(e,t){var r=N(e,n.ns_tts,"extent");if(null===r)return null;var a=r.split(" ");if(2!==a.length)return L(t,"Malformed extent (ignoring)"),null;var s=i.parseLength(a[0]),o=i.parseLength(a[1]);return o&&s?{h:o,w:s}:(L(t,"Malformed extent values (ignoring)"),null)}(e,t);null===s?this.pxDimensions={h:480,w:640}:("px"===s.h.unit&&"px"===s.w.unit||F(t,"Extent on TT must be in px or absent"),this.pxDimensions={h:s.h.value,w:s.w.value})},o.prototype._registerEvent=function(e){if(!(e.end<=e.begin)){var t=U(this.events,e.begin);if(t.found||this.events.splice(t.index,0,e.begin),e.end!==Number.POSITIVE_INFINITY){var n=U(this.events,e.end);n.found||this.events.splice(n.index,0,e.end)}}},o.prototype.getMediaTimeRange=function(){return[this.events[0],this.events[this.events.length-1]]},o.prototype.getMediaTimeEvents=function(){return this.events},c.prototype.initFromNode=function(e,t){this.id=C(e),this.styleAttrs=D(e,t),this.styleRefs=R(e)},h.prototype.initFromNode=function(e,t,n,r){this.id=C(n)},p.prototype.initFromNode=function(e,t,n,r){this.regionID=function(e){return e&&"region"in e.attributes?e.attributes.region.value:""}(n)},g.prototype.initFromNode=function(e,t,n,r){this.styleAttrs=D(n,r),null!==e.head&&null!==e.head.styling&&M(e.head.styling,R(n),this.styleAttrs,r)},m.prototype.initFromNode=function(e,t,n,r){this.sets=[]},y.prototype.initFromNode=function(e,t,n,r){this.contents=[]},v.prototype.initFromNode=function(e,t,n,r){var i=function(e,t,n,r){var i=null;n&&"begin"in n.attributes&&null===(i=O(e.tickRate,e.effectiveFrameRate,n.attributes.begin.value))&&L(r,"Malformed begin value "+n.attributes.begin.value+" (using 0)");var a=null;n&&"dur"in n.attributes&&null===(a=O(e.tickRate,e.effectiveFrameRate,n.attributes.dur.value))&&L(r,"Malformed dur value "+n.attributes.dur.value+" (ignoring)");var s=null;return n&&"end"in n.attributes&&null===(s=O(e.tickRate,e.effectiveFrameRate,n.attributes.end.value))&&L(r,"Malformed end value (ignoring)"),{explicit_begin:i,explicit_end:s,explicit_dur:a}}(e,0,n,r);this.explicit_begin=i.explicit_begin,this.explicit_end=i.explicit_end,this.explicit_dur=i.explicit_dur,this.timeContainer=function(e,t){var n=e&&"timeContainer"in e.attributes?e.attributes.timeContainer.value:null;return n&&"par"!==n?"seq"===n?"seq":(k(t,"Illegal value of timeContainer (assuming 'par')"),"par"):"par"}(n,r)},_.prototype.initFromNode=function(e,t,n){g.prototype.initFromNode.call(this,e,null,t,n),v.prototype.initFromNode.call(this,e,null,t,n),m.prototype.initFromNode.call(this,e,null,t,n),p.prototype.initFromNode.call(this,e,null,t,n),y.prototype.initFromNode.call(this,e,null,t,n)},T.prototype.initFromNode=function(e,t,n,r){g.prototype.initFromNode.call(this,e,t,n,r),v.prototype.initFromNode.call(this,e,t,n,r),m.prototype.initFromNode.call(this,e,t,n,r),p.prototype.initFromNode.call(this,e,t,n,r),y.prototype.initFromNode.call(this,e,t,n,r)},E.prototype.initFromNode=function(e,t,n,r){g.prototype.initFromNode.call(this,e,t,n,r),v.prototype.initFromNode.call(this,e,t,n,r),m.prototype.initFromNode.call(this,e,t,n,r),p.prototype.initFromNode.call(this,e,t,n,r),y.prototype.initFromNode.call(this,e,t,n,r)},b.prototype.initFromNode=function(e,t,n,r,i){g.prototype.initFromNode.call(this,e,t,n,i),v.prototype.initFromNode.call(this,e,t,n,i),m.prototype.initFromNode.call(this,e,t,n,i),p.prototype.initFromNode.call(this,e,t,n,i),y.prototype.initFromNode.call(this,e,t,n,i),this.space=r},S.prototype.initFromText=function(e,t,n,r,i){v.prototype.initFromNode.call(this,e,t,null,i),this.text=n,this.space=r},A.prototype.initFromNode=function(e,t,n,r){p.prototype.initFromNode.call(this,e,t,n,r),v.prototype.initFromNode.call(this,e,t,n,r)},w.prototype.createDefaultRegion=function(){var e=new w;return h.call(e,""),g.call(e,{}),m.call(e,[]),v.call(e,0,Number.POSITIVE_INFINITY,null),e},w.prototype.initFromNode=function(e,t,n){h.prototype.initFromNode.call(this,e,null,t,n),g.prototype.initFromNode.call(this,e,null,t,n),v.prototype.initFromNode.call(this,e,null,t,n),m.prototype.initFromNode.call(this,e,null,t,n),null!==e.head&&null!==e.head.styling&&M(e.head.styling,R(t),this.styleAttrs,n)},I.prototype.initFromNode=function(e,t,n,r){v.prototype.initFromNode.call(this,e,t,n,r);var i=D(n,r);for(var a in this.qname=null,this.value=null,i){if(this.qname){k(r,"More than one style specified on set");break}this.qname=a,this.value=i[a]}}}(t,"undefined"==typeof sax?n("./node_modules/sax/lib/sax.js"):sax,"undefined"==typeof imscNames?n("./node_modules/imsc/src/main/js/names.js"):imscNames,"undefined"==typeof imscStyles?n("./node_modules/imsc/src/main/js/styles.js"):imscStyles,"undefined"==typeof imscUtils?n("./node_modules/imsc/src/main/js/utils.js"):imscUtils)},"./node_modules/imsc/src/main/js/html.js":function(e,t,n){!function(e,t,n){function r(e,t,o){var u;if("region"===o.kind?(u=document.createElement("div")).style.position="absolute":"body"===o.kind||"div"===o.kind?u=document.createElement("div"):"p"===o.kind?u=document.createElement("p"):"span"===o.kind?u=document.createElement("span"):"br"===o.kind&&(u=document.createElement("br")),u){for(var c in u.style.margin="0",l){var d=l[c],f=o.styleAttrs[d.qname];void 0!==f&&null!==d.map&&d.map(e,u,o,f)}var h=u;if("region"===o.kind){var p=o.styleAttrs[n.byName.writingMode.qname];"lrtb"===p||"lr"===p?(e.ipd="lr",e.bpd="tb"):"rltb"===p||"rl"===p?(e.ipd="rl",e.bpd="tb"):"tblr"===p?(e.ipd="tb",e.bpd="lr"):"tbrl"!==p&&"tb"!==p||(e.ipd="tb",e.bpd="rl")}var g=o.styleAttrs[n.byName.linePadding.qname];if(g&&g>0){var m=Math.ceil(g*e.h)+"px";"tb"===e.bpd?(h.style.paddingLeft=m,h.style.paddingRight=m):(h.style.paddingTop=m,h.style.paddingBottom=m),e.lp=g}var y=o.styleAttrs[n.byName.multiRowAlign.qname];if(y&&"auto"!==y){var v=document.createElement("span");v.style.display="inline-block",v.style.textAlign=y,u.appendChild(v),h=v,e.mra=y}if(o.styleAttrs[n.byName.fillLineGap.qname]&&(e.flg=!0),"span"===o.kind&&o.text)if(e.lp||e.mra||e.flg)for(var _="",T=0;T<o.text.length;T++){_+=o.text.charAt(T);var E=o.text.charCodeAt(T);if(E<55296||E>56319||T===o.text.length){var b=document.createElement("span");b.textContent=_,u.appendChild(b),_=""}}else u.textContent=o.text;for(var S in t.appendChild(u),o.contents)r(e,h,o.contents[S]);var A=[];if((e.lp||e.mra||e.flg)&&"p"===o.kind&&(s(e,h,A,null),e.mra&&(function(e){for(var t=0;t<e.length-1;t++){var n=e[t].elements.length;if(0!==n&&!1===e[t].br){var r=document.createElement("br"),i=e[t].elements[n-1].node;i.parentElement.insertBefore(r,i.nextSibling)}}}(A),e.mra=null),e.lp&&(function(e,t,n){for(var r in e){var i=e[r].elements.length,a=e[r].elements[e[r].start_elem],s=e[r].elements[e[r].end_elem],o=Math.ceil(t)+"px",l="-"+Math.ceil(t)+"px";0!==i&&("lr"===n.ipd?(a.node.style.borderLeftColor=a.bgcolor||"#00000000",a.node.style.borderLeftStyle="solid",a.node.style.borderLeftWidth=o,a.node.style.marginLeft=l):"rl"===n.ipd?(a.node.style.borderRightColor=a.bgcolor||"#00000000",a.node.style.borderRightStyle="solid",a.node.style.borderRightWidth=o,a.node.style.marginRight=l):"tb"===n.ipd&&(a.node.style.borderTopColor=a.bgcolor||"#00000000",a.node.style.borderTopStyle="solid",a.node.style.borderTopWidth=o,a.node.style.marginTop=l),"lr"===n.ipd?(s.node.style.borderRightColor=s.bgcolor||"#00000000",s.node.style.borderRightStyle="solid",s.node.style.borderRightWidth=o,s.node.style.marginRight=l):"rl"===n.ipd?(s.node.style.borderLeftColor=s.bgcolor||"#00000000",s.node.style.borderLeftStyle="solid",s.node.style.borderLeftWidth=o,s.node.style.marginLeft=l):"tb"===n.ipd&&(s.node.style.borderBottomColor=s.bgcolor||"#00000000",s.node.style.borderBottomStyle="solid",s.node.style.borderBottomWidth=o,s.node.style.marginBottom=l))}}(A,e.lp*e.h,e),e.lp=null),e.flg)){var w=a(h.getBoundingClientRect(),e);!function(e,t,n,r){for(var i=Math.sign(n-t),a=0;a<=e.length;a++){var s,o,l;if(s=0===a?t:a===e.length?n:(e[a].before+e[a-1].after)/2,a>0)for(var u=0;u<e[a-1].elements.length;u++)null!==e[a-1].elements[u].bgcolor&&i*((l=e[a-1].elements[u]).after-s)<0&&(o=Math.ceil(Math.abs(s-l.after))+"px",l.node.style.backgroundColor=l.bgcolor,"lr"===r.bpd?l.node.style.paddingRight=o:"rl"===r.bpd?l.node.style.paddingLeft=o:"tb"===r.bpd&&(l.node.style.paddingBottom=o));if(a<e.length)for(var c=0;c<e[a].elements.length;c++)null!==(l=e[a].elements[c]).bgcolor&&i*(l.before-s)>0&&(o=Math.ceil(Math.abs(l.before-s))+"px",l.node.style.backgroundColor=l.bgcolor,"lr"===r.bpd?l.node.style.paddingLeft=o:"rl"===r.bpd?l.node.style.paddingRight=o:"tb"===r.bpd&&(l.node.style.paddingTop=o))}}(A,w.before,w.after,e),e.flg=null}if("region"===o.kind&&(s(e,h,A),"tb"===e.bpd&&e.enableRollUp&&o.contents.length>0&&"after"===o.styleAttrs[n.byName.displayAlign.qname])){var I=new i(""===o.id?"_":o.id,A);if(e.currentISDState[I.id]=I,e.previousISDState&&I.id in e.previousISDState&&e.previousISDState[I.id].plist.length>0&&I.plist.length>1&&I.plist[I.plist.length-2].text===e.previousISDState[I.id].plist[e.previousISDState[I.id].plist.length-1].text){var C=u.firstElementChild,R=I.plist[I.plist.length-1].after-I.plist[I.plist.length-1].before;C.style.bottom="-"+R+"px",C.style.transition="transform 0.4s",C.style.position="relative",C.style.transform="translateY(-"+R+"px)"}}}else!function(e,t){if(e&&e.error&&e.error(t))throw t}(e.errorHandler,"Error processing ISD element kind: "+o.kind)}function i(e,t){this.id=e,this.plist=t}function a(e,t){var n={before:null,after:null,start:null,end:null};return"tb"===t.bpd?(n.before=e.top,n.after=e.bottom,"lr"===t.ipd?(n.start=e.left,n.end=e.right):(n.start=e.right,n.end=e.left)):"lr"===t.bpd?(n.before=e.left,n.after=e.right,n.start=e.top,n.end=e.bottom):"rl"===t.bpd&&(n.before=e.right,n.after=e.left,n.start=e.top,n.end=e.bottom),n}function s(e,t,n,r){var i,o,l,u,c=t.style.backgroundColor||r;if(0===t.childElementCount)if("span"===t.localName){var d=t.getBoundingClientRect();if(0===d.height||0===d.width)return;var f=a(d,e);if(0!==n.length&&(i=f.before,o=f.after,l=n[n.length-1].before,o<(u=n[n.length-1].after)&&i>l||u<=o&&l>=i)){var h=Math.sign(f.after-f.before),p=Math.sign(f.end-f.start);h*(f.before-n[n.length-1].before)<0&&(n[n.length-1].before=f.before),h*(f.after-n[n.length-1].after)>0&&(n[n.length-1].after=f.after),p*(f.start-n[n.length-1].start)<0&&(n[n.length-1].start=f.start,n[n.length-1].start_elem=n[n.length-1].elements.length),p*(f.end-n[n.length-1].end)>0&&(n[n.length-1].end=f.end,n[n.length-1].end_elem=n[n.length-1].elements.length)}else n.push({before:f.before,after:f.after,start:f.start,end:f.end,start_elem:0,end_elem:0,elements:[],text:"",br:!1});n[n.length-1].text+=t.textContent,n[n.length-1].elements.push({node:t,bgcolor:c,before:f.before,after:f.after})}else"br"===t.localName&&0!==n.length&&(n[n.length-1].br=!0);else for(var g=t.firstChild;g;)g.nodeType===Node.ELEMENT_NODE&&s(e,g,n,c),g=g.nextSibling}function o(e,t){this.qname=e,this.map=t}e.render=function(e,t,n,i,a,s,o,l,u){var c=i||t.clientHeight,d=a||t.clientWidth;if(null!==e.aspectRatio){var f=c*e.aspectRatio;f>d?c=Math.round(d/e.aspectRatio):d=f}var h=document.createElement("div");h.style.position="relative",h.style.width=d+"px",h.style.height=c+"px",h.style.margin="auto",h.style.top=0,h.style.bottom=0,h.style.left=0,h.style.right=0,h.style.zIndex=0;var p={h:c,w:d,regionH:null,regionW:null,imgResolver:n,displayForcedOnlyMode:s||!1,isd:e,errorHandler:o,previousISDState:l,enableRollUp:u||!1,currentISDState:{},flg:null,lp:null,mra:null,ipd:null,bpd:null};for(var g in t.appendChild(h),e.contents)r(p,h,e.contents[g]);return p.currentISDState};var l=[new o("http://www.w3.org/ns/ttml#styling backgroundColor",(function(e,t,n,r){0!==r[3]&&(t.style.backgroundColor="rgba("+r[0].toString()+","+r[1].toString()+","+r[2].toString()+","+(r[3]/255).toString()+")")})),new o("http://www.w3.org/ns/ttml#styling color",(function(e,t,n,r){t.style.color="rgba("+r[0].toString()+","+r[1].toString()+","+r[2].toString()+","+(r[3]/255).toString()+")"})),new o("http://www.w3.org/ns/ttml#styling direction",(function(e,t,n,r){t.style.direction=r})),new o("http://www.w3.org/ns/ttml#styling display",(function(e,t,n,r){})),new o("http://www.w3.org/ns/ttml#styling displayAlign",(function(e,t,n,r){t.style.display="flex",t.style.flexDirection="column","before"===r?t.style.justifyContent="flex-start":"center"===r?t.style.justifyContent="center":"after"===r&&(t.style.justifyContent="flex-end")})),new o("http://www.w3.org/ns/ttml#styling extent",(function(e,t,n,r){e.regionH=r.h*e.h,e.regionW=r.w*e.w;var i=0,a=0,s=n.styleAttrs["http://www.w3.org/ns/ttml#styling padding"];s&&(i=(s[0]+s[2])*e.h,a=(s[1]+s[3])*e.w),t.style.height=e.regionH-i+"px",t.style.width=e.regionW-a+"px"})),new o("http://www.w3.org/ns/ttml#styling fontFamily",(function(e,t,n,r){var i=[];for(var a in r)"monospaceSerif"===r[a]?(i.push("Courier New"),i.push('"Liberation Mono"'),i.push("Courier"),i.push("monospace")):"proportionalSansSerif"===r[a]?(i.push("Arial"),i.push("Helvetica"),i.push('"Liberation Sans"'),i.push("sans-serif")):"monospace"===r[a]?i.push("monospace"):"sansSerif"===r[a]?i.push("sans-serif"):"serif"===r[a]?i.push("serif"):"monospaceSansSerif"===r[a]?(i.push("Consolas"),i.push("monospace")):"proportionalSerif"===r[a]?i.push("serif"):i.push(r[a]);t.style.fontFamily=i.join(",")})),new o("http://www.w3.org/ns/ttml#styling fontSize",(function(e,t,n,r){t.style.fontSize=r*e.h+"px"})),new o("http://www.w3.org/ns/ttml#styling fontStyle",(function(e,t,n,r){t.style.fontStyle=r})),new o("http://www.w3.org/ns/ttml#styling fontWeight",(function(e,t,n,r){t.style.fontWeight=r})),new o("http://www.w3.org/ns/ttml#styling lineHeight",(function(e,t,n,r){t.style.lineHeight="normal"===r?"normal":r*e.h+"px"})),new o("http://www.w3.org/ns/ttml#styling opacity",(function(e,t,n,r){t.style.opacity=r})),new o("http://www.w3.org/ns/ttml#styling origin",(function(e,t,n,r){t.style.top=r.h*e.h+"px",t.style.left=r.w*e.w+"px"})),new o("http://www.w3.org/ns/ttml#styling overflow",(function(e,t,n,r){t.style.overflow=r})),new o("http://www.w3.org/ns/ttml#styling padding",(function(e,t,n,r){var i=[];i[0]=r[0]*e.h+"px",i[1]=r[3]*e.w+"px",i[2]=r[2]*e.h+"px",i[3]=r[1]*e.w+"px",t.style.padding=i.join(" ")})),new o("http://www.w3.org/ns/ttml#styling showBackground",null),new o("http://www.w3.org/ns/ttml#styling textAlign",(function(e,t,r,i){var a,s=r.styleAttrs[n.byName.direction.qname];a="start"===i?"rtl"===s?"right":"left":"end"===i?"rtl"===s?"left":"right":i,t.style.textAlign=a})),new o("http://www.w3.org/ns/ttml#styling textDecoration",(function(e,t,n,r){t.style.textDecoration=r.join(" ").replace("lineThrough","line-through")})),new o("http://www.w3.org/ns/ttml#styling textOutline",(function(e,t,n,r){t.style.textShadow="none"===r?"":"rgba("+r.color[0].toString()+","+r.color[1].toString()+","+r.color[2].toString()+","+(r.color[3]/255).toString()+") 0px 0px "+r.thickness*e.h+"px"})),new o("http://www.w3.org/ns/ttml#styling unicodeBidi",(function(e,t,n,r){var i;i="bidiOverride"===r?"bidi-override":r,t.style.unicodeBidi=i})),new o("http://www.w3.org/ns/ttml#styling visibility",(function(e,t,n,r){t.style.visibility=r})),new o("http://www.w3.org/ns/ttml#styling wrapOption",(function(e,t,n,r){"wrap"===r?"preserve"===n.space?t.style.whiteSpace="pre-wrap":t.style.whiteSpace="normal":"preserve"===n.space?t.style.whiteSpace="pre":t.style.whiteSpace="noWrap"})),new o("http://www.w3.org/ns/ttml#styling writingMode",(function(e,t,n,r){"lrtb"===r||"lr"===r||"rltb"===r||"rl"===r?t.style.writingMode="horizontal-tb":"tblr"===r?t.style.writingMode="vertical-lr":"tbrl"!==r&&"tb"!==r||(t.style.writingMode="vertical-rl")})),new o("http://www.w3.org/ns/ttml#styling zIndex",(function(e,t,n,r){t.style.zIndex=r})),new o("http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt backgroundImage",(function(e,t,n,r){if(null!==e.imgResolver&&null!==r){var i=document.createElement("img"),a=e.imgResolver(r,i);a&&(i.src=a),i.height=e.regionH,i.width=e.regionW,t.appendChild(i)}})),new o("http://www.w3.org/ns/ttml/profile/imsc1#styling forcedDisplay",(function(e,t,n,r){e.displayForcedOnlyMode&&!1===r&&(t.style.visibility="hidden")}))],u={};for(var c in l)u[l[c].qname]=l[c]}(t,"undefined"==typeof imscNames?n("./node_modules/imsc/src/main/js/names.js"):imscNames,"undefined"==typeof imscStyles?n("./node_modules/imsc/src/main/js/styles.js"):imscStyles)},"./node_modules/imsc/src/main/js/isd.js":function(e,t,n){!function(e,t,n){function r(e,t,s,u,c,d,f,h,p){if(t<f.begin||t>=f.end)return null;var g="regionID"in f&&""!==f.regionID?f.regionID:d;if(null!==c&&g!==s.id&&(!("contents"in f)||"contents"in f&&0===f.contents.length||""!==g))return null;var m=new o(f);for(var y in f.sets)t<f.sets[y].begin||t>=f.sets[y].end||(m.styleAttrs[f.sets[y].qname]=f.sets[y].value);var v,_={};for(var T in m.styleAttrs)if(_[T]=!0,T===n.byName.writingMode.qname&&!(n.byName.direction.qname in m.styleAttrs)){var E=m.styleAttrs[T];"lrtb"===E||"lr"===E?m.styleAttrs[n.byName.direction.qname]="ltr":"rltb"!==E&&"rl"!==E||(m.styleAttrs[n.byName.direction.qname]="rtl")}if(null!==c)for(var b in n.all){var S=n.all[b];if(S.qname===n.byName.textDecoration.qname){var A=c.styleAttrs[S.qname],w=m.styleAttrs[S.qname],I=[];void 0===w?I=A:-1===w.indexOf("none")?((-1===w.indexOf("noUnderline")&&-1!==A.indexOf("underline")||-1!==w.indexOf("underline"))&&I.push("underline"),(-1===w.indexOf("noLineThrough")&&-1!==A.indexOf("lineThrough")||-1!==w.indexOf("lineThrough"))&&I.push("lineThrough"),(-1===w.indexOf("noOverline")&&-1!==A.indexOf("overline")||-1!==w.indexOf("overline"))&&I.push("overline")):I.push("none"),m.styleAttrs[S.qname]=I}else S.inherit&&S.qname in c.styleAttrs&&!(S.qname in m.styleAttrs)&&(m.styleAttrs[S.qname]=c.styleAttrs[S.qname])}for(var C in n.all){var R=n.all[C];R.qname in m.styleAttrs||("region"===m.kind||!1===R.inherit&&null!==R.initial)&&(m.styleAttrs[R.qname]=R.parse(R.initial),_[R.qname]=!0)}for(var D in n.all){var N=n.all[D];if(N.qname in _&&null!==N.compute){var O=N.compute(e,c,m,m.styleAttrs[N.qname],p);null!==O?m.styleAttrs[N.qname]=O:l(h,"Style '"+N.qname+"' on element '"+m.kind+"' cannot be computed")}}if("none"===m.styleAttrs[n.byName.display.qname])return null;for(var P in null===c?v=null===u?[]:[u]:"contents"in f&&(v=f.contents),v){var M=r(e,t,s,u,m,g,v[P],h,p);null!==M&&m.contents.push(M.element)}for(var x in m.styleAttrs)-1===n.byQName[x].applies.indexOf(m.kind)&&delete m.styleAttrs[x];if("span"===m.kind&&m.text&&"default"===m.space){var L=m.text.replace(/\s+/g," ");m.text=L}if("p"===m.kind){var k=[];i(m,k);for(var F=0,U="after_br",B=0;;)if("after_br"===U)F>=k.length||"br"===k[F].kind?(U="before_br",B=F,F--):("preserve"!==k[F].space&&(k[F].text=k[F].text.replace(/^\s+/g,"")),k[F].text.length>0?(U="looking_br",F++):k.splice(F,1));else if("before_br"===U)if(F<0||"br"===k[F].kind){if(U="after_br",(F=B+1)>=k.length)break}else if("preserve"!==k[F].space&&(k[F].text=k[F].text.replace(/\s+$/g,"")),k[F].text.length>0){if(U="after_br",(F=B+1)>=k.length)break}else k.splice(F,1),F--;else F>=k.length||"br"===k[F].kind?(U="before_br",B=F,F--):F++;a(m)}return"div"===m.kind&&n.byName.backgroundImage.qname in m.styleAttrs||"br"===m.kind||"contents"in m&&m.contents.length>0||"span"===m.kind&&null!==m.text||"region"===m.kind&&"always"===m.styleAttrs[n.byName.showBackground.qname]?{region_id:g,element:m}:null}function i(e,t){if("contents"in e)for(var n in e.contents)i(e.contents[n],t);else t.push(e)}function a(e){if("br"===e.kind)return!1;if("text"in e)return 0===e.text.length;if("contents"in e){for(var t=e.contents.length;t--;)a(e.contents[t])&&e.contents.splice(t,1);return 0===e.contents.length}}function s(e){this.contents=[],this.aspectRatio=e.aspectRatio}function o(e){for(var t in this.kind=e.kind||"region",e.id&&(this.id=e.id),this.styleAttrs={},e.styleAttrs)this.styleAttrs[t]=e.styleAttrs[t];"text"in e?this.text=e.text:"br"!==e.kind&&(this.contents=[]),"space"in e&&(this.space=e.space)}function l(e,t){if(e&&e.error&&e.error(t))throw t}e.generateISD=function(e,t,n){var i=new s(e),a={};for(var o in e.head.layout.regions){var l=r(e,t,e.head.layout.regions[o],e.body,null,"",e.head.layout.regions[o],n,a);null!==l&&i.contents.push(l.element)}return i}}(t,"undefined"==typeof imscNames?n("./node_modules/imsc/src/main/js/names.js"):imscNames,"undefined"==typeof imscStyles?n("./node_modules/imsc/src/main/js/styles.js"):imscStyles)},"./node_modules/imsc/src/main/js/main.js":function(e,t,n){t.generateISD=n("./node_modules/imsc/src/main/js/isd.js").generateISD,t.fromXML=n("./node_modules/imsc/src/main/js/doc.js").fromXML,t.renderHTML=n("./node_modules/imsc/src/main/js/html.js").render},"./node_modules/imsc/src/main/js/names.js":function(e,t,n){!function(e){e.ns_tt="http://www.w3.org/ns/ttml",e.ns_tts="http://www.w3.org/ns/ttml#styling",e.ns_ttp="http://www.w3.org/ns/ttml#parameter",e.ns_xml="http://www.w3.org/XML/1998/namespace",e.ns_itts="http://www.w3.org/ns/ttml/profile/imsc1#styling",e.ns_ittp="http://www.w3.org/ns/ttml/profile/imsc1#parameter",e.ns_smpte="http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt",e.ns_ebutts="urn:ebu:tt:style"}(t)},"./node_modules/imsc/src/main/js/styles.js":function(e,t,n){!function(e,t,n){function r(e,t,n,r,i,a,s,o){this.name=t,this.ns=e,this.qname=e+" "+t,this.inherit=i,this.animatable=a,this.initial=n,this.applies=r,this.parse=s,this.compute=o}for(var i in e.all=[new r(t.ns_tts,"backgroundColor","transparent",["body","div","p","region","span"],!1,!0,n.parseColor,null),new r(t.ns_tts,"color","white",["span"],!0,!0,n.parseColor,null),new r(t.ns_tts,"direction","ltr",["p","span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"display","auto",["body","div","p","region","span"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"displayAlign","before",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"extent","auto",["tt","region"],!1,!0,(function(e){if("auto"===e)return e;var t=e.split(" ");if(2!==t.length)return null;var r=n.parseLength(t[0]),i=n.parseLength(t[1]);return i&&r?{h:i,w:r}:null}),(function(e,t,n,r,i){var a,s;if("auto"===r)a=1;else if("%"===r.h.unit)a=r.h.value/100;else{if("px"!==r.h.unit)return null;a=r.h.value/e.pxDimensions.h}if("auto"===r)s=1;else if("%"===r.w.unit)s=r.w.value/100;else{if("px"!==r.w.unit)return null;s=r.w.value/e.pxDimensions.w}return{h:a,w:s}})),new r(t.ns_tts,"fontFamily","default",["span"],!0,!0,(function(e){var t=e.split(","),n=[];for(var r in t)"'"!==t[r].charAt(0)&&'"'!==t[r].charAt(0)&&"default"===t[r]?n.push("monospaceSerif"):n.push(t[r]);return n}),null),new r(t.ns_tts,"fontSize","1c",["span"],!0,!0,n.parseLength,(function(t,n,r,i,a){var s;if("%"===i.unit)s=null!==n?n.styleAttrs[e.byName.fontSize.qname]*i.value/100:i.value/100/t.cellResolution.h;else if("em"===i.unit)s=null!==n?n.styleAttrs[e.byName.fontSize.qname]*i.value:i.value/t.cellResolution.h;else if("c"===i.unit)s=i.value/t.cellResolution.h;else{if("px"!==i.unit)return null;s=i.value/t.pxDimensions.h}return s})),new r(t.ns_tts,"fontStyle","normal",["span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"fontWeight","normal",["span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"lineHeight","normal",["p"],!0,!0,(function(e){return"normal"===e?e:n.parseLength(e)}),(function(t,n,r,i,a){var s;if("normal"===i)s=i;else if("%"===i.unit)s=r.styleAttrs[e.byName.fontSize.qname]*i.value/100;else if("em"===i.unit)s=r.styleAttrs[e.byName.fontSize.qname]*i.value;else if("c"===i.unit)s=i.value/t.cellResolution.h;else{if("px"!==i.unit)return null;s=i.value/t.pxDimensions.h}return s})),new r(t.ns_tts,"opacity",1,["region"],!1,!0,parseFloat,null),new r(t.ns_tts,"origin","auto",["region"],!1,!0,(function(e){if("auto"===e)return e;var t=e.split(" ");if(2!==t.length)return null;var r=n.parseLength(t[0]),i=n.parseLength(t[1]);return i&&r?{h:i,w:r}:null}),(function(e,t,n,r,i){var a,s;if("auto"===r)a=0;else if("%"===r.h.unit)a=r.h.value/100;else{if("px"!==r.h.unit)return null;a=r.h.value/e.pxDimensions.h}if("auto"===r)s=0;else if("%"===r.w.unit)s=r.w.value/100;else{if("px"!==r.w.unit)return null;s=r.w.value/e.pxDimensions.w}return{h:a,w:s}})),new r(t.ns_tts,"overflow","hidden",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"padding","0px",["region"],!1,!0,(function(e){var t=e.split(" ");if(t.length>4)return null;var r=[];for(var i in t){var a=n.parseLength(t[i]);if(!a)return null;r.push(a)}return r}),(function(t,n,r,i,a){var s;if(1===i.length)s=[i[0],i[0],i[0],i[0]];else if(2===i.length)s=[i[0],i[1],i[0],i[1]];else if(3===i.length)s=[i[0],i[1],i[2],i[1]];else{if(4!==i.length)return null;s=[i[0],i[1],i[2],i[3]]}var o=r.styleAttrs[e.byName.writingMode.qname];if("lrtb"===o||"lr"===o)s=[s[0],s[3],s[2],s[1]];else if("rltb"===o||"rl"===o)s=[s[0],s[1],s[2],s[3]];else if("tblr"===o)s=[s[3],s[0],s[1],s[2]];else{if("tbrl"!==o&&"tb"!==o)return null;s=[s[3],s[2],s[1],s[0]]}var l=[];for(var u in s)if(0===s[u].value)l[u]=0;else if("%"===s[u].unit)l[u]="0"===u||"2"===u?r.styleAttrs[e.byName.extent.qname].h*s[u].value/100:r.styleAttrs[e.byName.extent.qname].w*s[u].value/100;else if("em"===s[u].unit)l[u]=r.styleAttrs[e.byName.fontSize.qname]*s[u].value;else if("c"===s[u].unit)l[u]=s[u].value/t.cellResolution.h;else{if("px"!==s[u].unit)return null;l[u]="0"===u||"2"===u?s[u].value/t.pxDimensions.h:s[u].value/t.pxDimensions.w}return l})),new r(t.ns_tts,"showBackground","always",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"textAlign","start",["p"],!0,!0,(function(e){return e}),(function(e,t,n,r,i){return"left"===r?"start":"right"===r?"end":r})),new r(t.ns_tts,"textDecoration","none",["span"],!0,!0,(function(e){return e.split(" ")}),null),new r(t.ns_tts,"textOutline","none",["span"],!0,!0,(function(e){if("none"===e)return e;var t={},r=e.split(" ");if(0===r.length||r.length>2)return null;var i=n.parseColor(r[0]);if(t.color=i,null!==i&&r.shift(),1!==r.length)return null;var a=n.parseLength(r[0]);return a?(t.thickness=a,t):null}),(function(t,n,r,i,a){if("none"===i)return i;var s={};if(null===i.color?s.color=r.styleAttrs[e.byName.color.qname]:s.color=i.color,"%"===i.thickness.unit)s.thickness=r.styleAttrs[e.byName.fontSize.qname]*i.thickness.value/100;else if("em"===i.thickness.unit)s.thickness=r.styleAttrs[e.byName.fontSize.qname]*i.thickness.value;else if("c"===i.thickness.unit)s.thickness=i.thickness.value/t.cellResolution.h;else{if("px"!==i.thickness.unit)return null;s.thickness=i.thickness.value/t.pxDimensions.h}return s})),new r(t.ns_tts,"unicodeBidi","normal",["span","p"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"visibility","visible",["body","div","p","region","span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"wrapOption","wrap",["span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"writingMode","lrtb",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"zIndex","auto",["region"],!1,!0,(function(e){var t;return"auto"===e?t=e:(t=parseInt(e),isNaN(t)&&(t=null)),t}),null),new r(t.ns_ebutts,"linePadding","0c",["p"],!0,!1,n.parseLength,(function(e,t,n,r,i){return"c"===r.unit?r.value/e.cellResolution.h:null})),new r(t.ns_ebutts,"multiRowAlign","auto",["p"],!0,!1,(function(e){return e}),null),new r(t.ns_smpte,"backgroundImage",null,["div"],!1,!1,(function(e){return e}),null),new r(t.ns_itts,"forcedDisplay","false",["body","div","p","region","span"],!0,!0,(function(e){return"true"===e}),null),new r(t.ns_itts,"fillLineGap","false",["p"],!0,!0,(function(e){return"true"===e}),null)],e.byQName={},e.all)e.byQName[e.all[i].qname]=e.all[i];for(var a in e.byName={},e.all)e.byName[e.all[a].name]=e.all[a]}(t,"undefined"==typeof imscNames?n("./node_modules/imsc/src/main/js/names.js"):imscNames,"undefined"==typeof imscUtils?n("./node_modules/imsc/src/main/js/utils.js"):imscUtils)},"./node_modules/imsc/src/main/js/utils.js":function(e,t,n){!function(e){var t=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?/,n=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,r=/rgba\(\s*(\d+),\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,i={transparent:[0,0,0,0],black:[0,0,0,255],silver:[192,192,192,255],gray:[128,128,128,255],white:[255,255,255,255],maroon:[128,0,0,255],red:[255,0,0,255],purple:[128,0,128,255],fuchsia:[255,0,255,255],magenta:[255,0,255,255],green:[0,128,0,255],lime:[0,255,0,255],olive:[128,128,0,255],yellow:[255,255,0,255],navy:[0,0,128,255],blue:[0,0,255,255],teal:[0,128,128,255],aqua:[0,255,255,255],cyan:[0,255,255,255]};e.parseColor=function(e){var a,s=null,o=i[e.toLowerCase()];return void 0!==o?s=o:null!==(a=t.exec(e))?s=[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16),void 0!==a[4]?parseInt(a[4],16):255]:null!==(a=n.exec(e))?s=[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),255]:null!==(a=r.exec(e))&&(s=[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),parseInt(a[4])]),s};var a=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%)$/;e.parseLength=function(e){var t,n=null;return null!==(t=a.exec(e))&&(n={value:parseFloat(t[1]),unit:t[2]}),n}}(t)},"./node_modules/inherits/inherits_browser.js":function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},"./node_modules/isarray/index.js":function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},"./node_modules/node-libs-browser/node_modules/buffer/index.js":function(e,t,n){(function(e){var r=n("./node_modules/base64-js/index.js"),i=n("./node_modules/ieee754/index.js"),a=n("./node_modules/isarray/index.js");function s(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(e,t){if(s()<t)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=l.prototype:(null===e&&(e=new l(t)),e.length=t),e}function l(e,t,n){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return d(this,e)}return u(this,e,t,n)}function u(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r),l.TYPED_ARRAY_SUPPORT?(e=t).__proto__=l.prototype:e=f(e,t),e}(e,t,n,r):"string"==typeof t?function(e,t,n){if("string"==typeof n&&""!==n||(n="utf8"),!l.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|p(t,n),i=(e=o(e,r)).write(t,n);return i!==r&&(e=e.slice(0,i)),e}(e,t,n):function(e,t){if(l.isBuffer(t)){var n=0|h(t.length);return 0===(e=o(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?o(e,0):f(e,t);if("Buffer"===t.type&&a(t.data))return f(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function d(e,t){if(c(t),e=o(e,t<0?0:0|h(t)),!l.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function f(e,t){var n=t.length<0?0:0|h(t.length);e=o(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function h(e){if(e>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function p(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return j(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return q(e).length;default:if(r)return j(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return N(this,t,n);case"utf8":case"utf-8":return I(this,t,n);case"ascii":return R(this,t,n);case"latin1":case"binary":return D(this,t,n);case"base64":return w(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,i);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,i){var a,s=1,o=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,o/=2,l/=2,n/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var c=-1;for(a=n;a<o;a++)if(u(e,a)===u(t,-1===c?0:a-c)){if(-1===c&&(c=a),a-c+1===l)return c*s}else-1!==c&&(a-=a-c),c=-1}else for(n+l>o&&(n=o-l),a=n;a>=0;a--){for(var d=!0,f=0;f<l;f++)if(u(e,a+f)!==u(t,f)){d=!1;break}if(d)return a}return-1}function _(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var s=0;s<r;++s){var o=parseInt(t.substr(2*s,2),16);if(isNaN(o))return s;e[n+s]=o}return s}function T(e,t,n,r){return H(j(t,e.length-n),e,n,r)}function E(e,t,n,r){return H(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function b(e,t,n,r){return E(e,t,n,r)}function S(e,t,n,r){return H(q(t),e,n,r)}function A(e,t,n,r){return H(function(e,t){for(var n,r,i,a=[],s=0;s<e.length&&!((t-=2)<0);++s)r=(n=e.charCodeAt(s))>>8,i=n%256,a.push(i),a.push(r);return a}(t,e.length-n),e,n,r)}function w(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function I(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var a,s,o,l,u=e[i],c=null,d=u>239?4:u>223?3:u>191?2:1;if(i+d<=n)switch(d){case 1:u<128&&(c=u);break;case 2:128==(192&(a=e[i+1]))&&(l=(31&u)<<6|63&a)>127&&(c=l);break;case 3:a=e[i+1],s=e[i+2],128==(192&a)&&128==(192&s)&&(l=(15&u)<<12|(63&a)<<6|63&s)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:a=e[i+1],s=e[i+2],o=e[i+3],128==(192&a)&&128==(192&s)&&128==(192&o)&&(l=(15&u)<<18|(63&a)<<12|(63&s)<<6|63&o)>65535&&l<1114112&&(c=l)}null===c?(c=65533,d=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=d}return function(e){var t=e.length;if(t<=C)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=C));return n}(r)}t.Buffer=l,t.SlowBuffer=function(e){return+e!=e&&(e=0),l.alloc(+e)},t.INSPECT_MAX_BYTES=50,l.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=s(),l.poolSize=8192,l._augment=function(e){return e.__proto__=l.prototype,e},l.from=function(e,t,n){return u(null,e,t,n)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(e,t,n){return function(e,t,n,r){return c(t),t<=0?o(e,t):void 0!==n?"string"==typeof r?o(e,t).fill(n,r):o(e,t).fill(n):o(e,t)}(null,e,t,n)},l.allocUnsafe=function(e){return d(null,e)},l.allocUnsafeSlow=function(e){return d(null,e)},l.isBuffer=function(e){return!(null==e||!e._isBuffer)},l.compare=function(e,t){if(!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!a(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=l.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var s=e[n];if(!l.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,i),i+=s.length}return r},l.byteLength=p,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},l.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?I(this,0,e):g.apply(this,arguments)},l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},l.prototype.compare=function(e,t,n,r,i){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),o=Math.min(a,s),u=this.slice(r,i),c=e.slice(t,n),d=0;d<o;++d)if(u[d]!==c[d]){a=u[d],s=c[d];break}return a<s?-1:s<a?1:0},l.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},l.prototype.indexOf=function(e,t,n){return y(this,e,t,n,!0)},l.prototype.lastIndexOf=function(e,t,n){return y(this,e,t,n,!1)},l.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return _(this,e,t,n);case"utf8":case"utf-8":return T(this,e,t,n);case"ascii":return E(this,e,t,n);case"latin1":case"binary":return b(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function R(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function D(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function N(e,t,n){var r,i=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>i)&&(n=i);for(var a="",s=t;s<n;++s)a+=(r=e[s])<16?"0"+r.toString(16):r.toString(16);return a}function O(e,t,n){for(var r=e.slice(t,n),i="",a=0;a<r.length;a+=2)i+=String.fromCharCode(r[a]+256*r[a+1]);return i}function P(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,n,r,i,a){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function x(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-n,2);i<a;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function L(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-n,4);i<a;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function k(e,t,n,r,i,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function F(e,t,n,r,a){return a||k(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function U(e,t,n,r,a){return a||k(e,0,n,8),i.write(e,t,n,r,52,8),n+8}l.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),l.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=l.prototype;else{var i=t-e;n=new l(i,void 0);for(var a=0;a<i;++a)n[a]=this[a+e]}return n},l.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r},l.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},l.prototype.readUInt8=function(e,t){return t||P(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||P(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||P(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},l.prototype.readInt8=function(e,t){return t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||P(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){t||P(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||P(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||P(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||P(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||P(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,n,r){e=+e,t|=0,n|=0,r||M(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,a=0;for(this[t]=255&e;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},l.prototype.writeUIntBE=function(e,t,n,r){e=+e,t|=0,n|=0,r||M(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},l.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):x(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):x(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):L(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):L(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var a=0,s=1,o=0;for(this[t]=255&e;++a<n&&(s*=256);)e<0&&0===o&&0!==this[t+a-1]&&(o=1),this[t+a]=(e/s>>0)-o&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var a=n-1,s=1,o=0;for(this[t+a]=255&e;--a>=0&&(s*=256);)e<0&&0===o&&0!==this[t+a+1]&&(o=1),this[t+a]=(e/s>>0)-o&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):x(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):x(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):L(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):L(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,n){return F(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return F(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return U(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return U(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,a=r-n;if(this===e&&n<t&&t<r)for(i=a-1;i>=0;--i)e[i+t]=this[i+n];else if(a<1e3||!l.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+a),t);return a},l.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!l.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var a;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a<n;++a)this[a]=e;else{var s=l.isBuffer(e)?e:j(new l(e,r).toString()),o=s.length;for(a=0;a<n-t;++a)this[a+t]=s[a%o]}return this};var B=/[^+\/0-9A-Za-z-_]/g;function j(e,t){var n;t=t||1/0;for(var r=e.length,i=null,a=[],s=0;s<r;++s){if((n=e.charCodeAt(s))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function q(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(B,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function H(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n("./node_modules/webpack/buildin/global.js"))},"./node_modules/node-libs-browser/node_modules/events/events.js":function(e,t,n){var r,i="object"==typeof Reflect?Reflect:null,a=i&&"function"==typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}y(e,t,a,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&y(e,"error",t,n)}(e,i,{once:!0})}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var l=10;function u(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function d(e,t,n,r){var i,a,s,o;if(u(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),s=a[t]),void 0===s)s=a[t]=n,++e._eventsCount;else if("function"==typeof s?s=a[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(i=c(e))>0&&s.length>i&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=s.length,o=l,console&&console.warn&&console.warn(o)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}function p(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):m(i,i.length)}function g(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function m(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function y(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(a){r.once&&e.removeEventListener(t,i),n(a)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");l=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var l=i[e];if(void 0===l)return!1;if("function"==typeof l)a(l,this,t);else{var u=l.length,c=m(l,u);for(n=0;n<u;++n)a(c[n],this,t)}return!0},o.prototype.addListener=function(e,t){return d(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return d(this,e,t,!0)},o.prototype.once=function(e,t){return u(t),this.on(e,h(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return u(t),this.prependListener(e,h(this,e,t)),this},o.prototype.removeListener=function(e,t){var n,r,i,a,s;if(u(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){s=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,a=Object.keys(n);for(r=0;r<a.length;++r)"removeListener"!==(i=a[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return p(this,e,!0)},o.prototype.rawListeners=function(e){return p(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},o.prototype.listenerCount=g,o.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},"./node_modules/node-libs-browser/node_modules/timers-browserify/main.js":function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function a(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new a(i.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new a(i.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n("./node_modules/setimmediate/setImmediate.js"),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n("./node_modules/webpack/buildin/global.js"))},"./node_modules/path-browserify/index.js":function(e,t,n){(function(e){function n(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}t.resolve=function(){for(var t="",i=!1,a=arguments.length-1;a>=-1&&!i;a--){var s=a>=0?arguments[a]:e.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(t=s+"/"+t,i="/"===s.charAt(0))}return(i?"/":"")+(t=n(r(t.split("/"),(function(e){return!!e})),!i).join("/"))||"."},t.normalize=function(e){var a=t.isAbsolute(e),s="/"===i(e,-1);return(e=n(r(e.split("/"),(function(e){return!!e})),!a).join("/"))||a||(e="."),e&&s&&(e+="/"),(a?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(r(e,(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},t.relative=function(e,n){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var i=r(e.split("/")),a=r(n.split("/")),s=Math.min(i.length,a.length),o=s,l=0;l<s;l++)if(i[l]!==a[l]){o=l;break}var u=[];for(l=o;l<i.length;l++)u.push("..");return(u=u.concat(a.slice(o))).join("/")},t.sep="/",t.delimiter=":",t.dirname=function(e){if("string"!=typeof e&&(e+=""),0===e.length)return".";for(var t=e.charCodeAt(0),n=47===t,r=-1,i=!0,a=e.length-1;a>=1;--a)if(47===(t=e.charCodeAt(a))){if(!i){r=a;break}}else i=!1;return-1===r?n?"/":".":n&&1===r?"/":e.slice(0,r)},t.basename=function(e,t){var n=function(e){"string"!=typeof e&&(e+="");var t,n=0,r=-1,i=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!i){n=t+1;break}}else-1===r&&(i=!1,r=t+1);return-1===r?"":e.slice(n,r)}(e);return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},t.extname=function(e){"string"!=typeof e&&(e+="");for(var t=-1,n=0,r=-1,i=!0,a=0,s=e.length-1;s>=0;--s){var o=e.charCodeAt(s);if(47!==o)-1===r&&(i=!1,r=s+1),46===o?-1===t?t=s:1!==a&&(a=1):-1!==t&&(a=-1);else if(!i){n=s+1;break}}return-1===t||-1===r||0===a||1===a&&t===r-1&&t===n+1?"":e.slice(t,r)};var i=function(e,t,n){return e.substr(t,n)}}).call(this,n("./node_modules/process/browser.js"))},"./node_modules/process-nextick-args/index.js":function(e,t,n){(function(t){!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,n,r,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var a,s,o=arguments.length;switch(o){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,n)}));case 3:return t.nextTick((function(){e.call(null,n,r)}));case 4:return t.nextTick((function(){e.call(null,n,r,i)}));default:for(a=new Array(o-1),s=0;s<a.length;)a[s++]=arguments[s];return t.nextTick((function(){e.apply(null,a)}))}}}:e.exports=t}).call(this,n("./node_modules/process/browser.js"))},"./node_modules/process/browser.js":function(e,t){var n,r,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var l,u=[],c=!1,d=-1;function f(){c&&l&&(c=!1,l.length?u=l.concat(u):d=-1,u.length&&h())}function h(){if(!c){var e=o(f);c=!0;for(var t=u.length;t;){for(l=u,u=[];++d<t;)l&&l[d].run();d=-1,t=u.length}l=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function g(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new p(e,t)),1!==u.length||c||o(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},"./node_modules/readable-stream/duplex-browser.js":function(e,t,n){e.exports=n("./node_modules/readable-stream/lib/_stream_duplex.js")},"./node_modules/readable-stream/lib/_stream_duplex.js":function(e,t,n){var r=n("./node_modules/process-nextick-args/index.js"),i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=d;var a=n("./node_modules/core-util-is/lib/util.js");a.inherits=n("./node_modules/inherits/inherits_browser.js");var s=n("./node_modules/readable-stream/lib/_stream_readable.js"),o=n("./node_modules/readable-stream/lib/_stream_writable.js");a.inherits(d,s);for(var l=i(o.prototype),u=0;u<l.length;u++){var c=l[u];d.prototype[c]||(d.prototype[c]=o.prototype[c])}function d(e){if(!(this instanceof d))return new d(e);s.call(this,e),o.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",f)}function f(){this.allowHalfOpen||this._writableState.ended||r.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(d.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(d.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),d.prototype._destroy=function(e,t){this.push(null),this.end(),r.nextTick(t,e)}},"./node_modules/readable-stream/lib/_stream_passthrough.js":function(e,t,n){e.exports=a;var r=n("./node_modules/readable-stream/lib/_stream_transform.js"),i=n("./node_modules/core-util-is/lib/util.js");function a(e){if(!(this instanceof a))return new a(e);r.call(this,e)}i.inherits=n("./node_modules/inherits/inherits_browser.js"),i.inherits(a,r),a.prototype._transform=function(e,t,n){n(null,e)}},"./node_modules/readable-stream/lib/_stream_readable.js":function(e,t,n){(function(t,r){var i=n("./node_modules/process-nextick-args/index.js");e.exports=_;var a,s=n("./node_modules/isarray/index.js");_.ReadableState=v,n("./node_modules/node-libs-browser/node_modules/events/events.js").EventEmitter;var o=function(e,t){return e.listeners(t).length},l=n("./node_modules/readable-stream/lib/internal/streams/stream-browser.js"),u=n("./node_modules/safe-buffer/index.js").Buffer,c=t.Uint8Array||function(){},d=n("./node_modules/core-util-is/lib/util.js");d.inherits=n("./node_modules/inherits/inherits_browser.js");var f=n(0),h=void 0;h=f&&f.debuglog?f.debuglog("stream"):function(){};var p,g=n("./node_modules/readable-stream/lib/internal/streams/BufferList.js"),m=n("./node_modules/readable-stream/lib/internal/streams/destroy.js");d.inherits(_,l);var y=["error","close","destroy","pause","resume"];function v(e,t){e=e||{};var r=t instanceof(a=a||n("./node_modules/readable-stream/lib/_stream_duplex.js"));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,s=e.readableHighWaterMark,o=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(s||0===s)?s:o,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new g,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=n("./node_modules/string_decoder/lib/string_decoder.js").StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function _(e){if(a=a||n("./node_modules/readable-stream/lib/_stream_duplex.js"),!(this instanceof _))return new _(e);this._readableState=new v(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),l.call(this)}function T(e,t,n,r,i){var a,s=e._readableState;return null===t?(s.reading=!1,function(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,A(e)}}(e,s)):(i||(a=function(e,t){var n,r;return r=t,u.isBuffer(r)||r instanceof c||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}(s,t)),a?e.emit("error",a):s.objectMode||t&&t.length>0?("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),r?s.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):E(e,s,t,!0):s.ended?e.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!n?(t=s.decoder.write(t),s.objectMode||0!==t.length?E(e,s,t,!1):I(e,s)):E(e,s,t,!1))):r||(s.reading=!1)),function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(s)}function E(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&A(e)),I(e,t)}Object.defineProperty(_.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),_.prototype.destroy=m.destroy,_.prototype._undestroy=m.undestroy,_.prototype._destroy=function(e,t){this.push(null),t(e)},_.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=u.from(e,t),t=""),n=!0),T(this,e,t,!1,n)},_.prototype.unshift=function(e){return T(this,e,null,!0,!1)},_.prototype.isPaused=function(){return!1===this._readableState.flowing},_.prototype.setEncoding=function(e){return p||(p=n("./node_modules/string_decoder/lib/string_decoder.js").StringDecoder),this._readableState.decoder=new p(e),this._readableState.encoding=e,this};var b=8388608;function S(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=b?e=b:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function A(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(w,e):w(e))}function w(e){h("emit readable"),e.emit("readable"),N(e)}function I(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(C,e,t))}function C(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(h("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function R(e){h("readable nexttick read 0"),e.read(0)}function D(e,t){t.reading||(h("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),N(e),t.flowing&&!t.reading&&e.read(0)}function N(e){var t=e._readableState;for(h("flow",t.flowing);t.flowing&&null!==e.read(););}function O(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;return e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?function(e,t){var n=t.head,r=1,i=n.data;for(e-=i.length;n=n.next;){var a=n.data,s=e>a.length?a.length:e;if(s===a.length?i+=a:i+=a.slice(0,e),0==(e-=s)){s===a.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(s));break}++r}return t.length-=r,i}(e,t):function(e,t){var n=u.allocUnsafe(e),r=t.head,i=1;for(r.data.copy(n),e-=r.data.length;r=r.next;){var a=r.data,s=e>a.length?a.length:e;if(a.copy(n,n.length-e,0,s),0==(e-=s)){s===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(s));break}++i}return t.length-=i,n}(e,t),r}(e,t.buffer,t.decoder),n);var n}function P(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(M,t,e))}function M(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function x(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}_.prototype.read=function(e){h("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?P(this):A(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&P(this),null;var r,i=t.needReadable;return h("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&h("length less than watermark",i=!0),t.ended||t.reading?h("reading or ended",i=!1):i&&(h("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=S(n,t))),null===(r=e>0?O(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&P(this)),null!==r&&this.emit("data",r),r},_.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},_.prototype.pipe=function(e,t){var n=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,h("pipe count=%d opts=%j",a.pipesCount,t);var l=t&&!1===t.end||e===r.stdout||e===r.stderr?_:c;function u(t,r){h("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,h("cleanup"),e.removeListener("close",y),e.removeListener("finish",v),e.removeListener("drain",d),e.removeListener("error",m),e.removeListener("unpipe",u),n.removeListener("end",c),n.removeListener("end",_),n.removeListener("data",g),f=!0,!a.awaitDrain||e._writableState&&!e._writableState.needDrain||d())}function c(){h("onend"),e.end()}a.endEmitted?i.nextTick(l):n.once("end",l),e.on("unpipe",u);var d=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,N(e))}}(n);e.on("drain",d);var f=!1,p=!1;function g(t){h("ondata"),p=!1,!1!==e.write(t)||p||((1===a.pipesCount&&a.pipes===e||a.pipesCount>1&&-1!==x(a.pipes,e))&&!f&&(h("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,p=!0),n.pause())}function m(t){h("onerror",t),_(),e.removeListener("error",m),0===o(e,"error")&&e.emit("error",t)}function y(){e.removeListener("finish",v),_()}function v(){h("onfinish"),e.removeListener("close",y),_()}function _(){h("unpipe"),n.unpipe(e)}return n.on("data",g),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?s(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",m),e.once("close",y),e.once("finish",v),e.emit("pipe",n),a.flowing||(h("pipe resume"),n.resume()),e},_.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)r[a].emit("unpipe",this,n);return this}var s=x(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},_.prototype.on=function(e,t){var n=l.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&A(this):i.nextTick(R,this))}return n},_.prototype.addListener=_.prototype.on,_.prototype.resume=function(){var e=this._readableState;return e.flowing||(h("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(D,e,t))}(this,e)),this},_.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this},_.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",(function(){if(h("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){h("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i||(n.objectMode||i&&i.length)&&(t.push(i)||(r=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var a=0;a<y.length;a++)e.on(y[a],this.emit.bind(this,y[a]));return this._read=function(t){h("wrapped _read",t),r&&(r=!1,e.resume())},this},Object.defineProperty(_.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),_._fromList=O}).call(this,n("./node_modules/webpack/buildin/global.js"),n("./node_modules/process/browser.js"))},"./node_modules/readable-stream/lib/_stream_transform.js":function(e,t,n){e.exports=s;var r=n("./node_modules/readable-stream/lib/_stream_duplex.js"),i=n("./node_modules/core-util-is/lib/util.js");function a(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function s(e){if(!(this instanceof s))return new s(e);r.call(this,e),this._transformState={afterTransform:a.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",o)}function o(){var e=this;"function"==typeof this._flush?this._flush((function(t,n){l(e,t,n)})):l(this,null,null)}function l(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}i.inherits=n("./node_modules/inherits/inherits_browser.js"),i.inherits(s,r),s.prototype.push=function(e,t){return this._transformState.needTransform=!1,r.prototype.push.call(this,e,t)},s.prototype._transform=function(e,t,n){throw new Error("_transform() is not implemented")},s.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},s.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},s.prototype._destroy=function(e,t){var n=this;r.prototype._destroy.call(this,e,(function(e){t(e),n.emit("close")}))}},"./node_modules/readable-stream/lib/_stream_writable.js":function(e,t,n){(function(t,r,i){var a=n("./node_modules/process-nextick-args/index.js");function s(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;for(e.entry=null;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=v;var o,l=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:a.nextTick;v.WritableState=y;var u=n("./node_modules/core-util-is/lib/util.js");u.inherits=n("./node_modules/inherits/inherits_browser.js");var c,d={deprecate:n("./node_modules/util-deprecate/browser.js")},f=n("./node_modules/readable-stream/lib/internal/streams/stream-browser.js"),h=n("./node_modules/safe-buffer/index.js").Buffer,p=i.Uint8Array||function(){},g=n("./node_modules/readable-stream/lib/internal/streams/destroy.js");function m(){}function y(e,t){o=o||n("./node_modules/readable-stream/lib/_stream_duplex.js"),e=e||{};var r=t instanceof o;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,u=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(u||0===u)?u:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var d=!1===e.decodeStrings;this.decodeStrings=!d,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(a.nextTick(i,r),a.nextTick(A,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(i(r),e._writableState.errorEmitted=!0,e.emit("error",r),A(e,t))}(e,n,r,t,i);else{var s=b(n);s||n.corked||n.bufferProcessing||!n.bufferedRequest||E(e,n),r?l(T,e,n,s,i):T(e,n,s,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function v(e){if(o=o||n("./node_modules/readable-stream/lib/_stream_duplex.js"),!(c.call(v,this)||this instanceof o))return new v(e);this._writableState=new y(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),f.call(this)}function _(e,t,n,r,i,a,s){t.writelen=r,t.writecb=s,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function T(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),A(e,t)}function E(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),a=t.corkedRequestsFree;a.entry=n;for(var o=0,l=!0;n;)i[o]=n,n.isBuf||(l=!1),n=n.next,o+=1;i.allBuffers=l,_(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new s(t),t.bufferedRequestCount=0}else{for(;n;){var u=n.chunk,c=n.encoding,d=n.callback;if(_(e,t,!1,t.objectMode?1:u.length,u,c,d),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function b(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function S(e,t){e._final((function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),A(e,t)}))}function A(e,t){var n=b(t);return n&&(function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,a.nextTick(S,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}u.inherits(v,f),y.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(y.prototype,"buffer",{get:d.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(c=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(e){return!!c.call(this,e)||this===v&&e&&e._writableState instanceof y}})):c=function(e){return e instanceof this},v.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},v.prototype.write=function(e,t,n){var r,i=this._writableState,s=!1,o=!i.objectMode&&(r=e,h.isBuffer(r)||r instanceof p);return o&&!h.isBuffer(e)&&(e=function(e){return h.from(e)}(e)),"function"==typeof t&&(n=t,t=null),o?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=m),i.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),a.nextTick(t,n)}(this,n):(o||function(e,t,n,r){var i=!0,s=!1;return null===n?s=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(e.emit("error",s),a.nextTick(r,s),i=!1),i}(this,i,e,n))&&(i.pendingcb++,s=function(e,t,n,r,i,a){if(!n){var s=function(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=h.from(t,n)),t}(t,r,i);r!==s&&(n=!0,i="buffer",r=s)}var o=t.objectMode?1:r.length;t.length+=o;var l=t.length<t.highWaterMark;if(l||(t.needDrain=!0),t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:a,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else _(e,t,!1,o,r,i,a);return l}(this,i,o,e,t,n)),s},v.prototype.cork=function(){this._writableState.corked++},v.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||E(this,e))},v.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),v.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},v.prototype._writev=null,v.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,A(e,t),n&&(t.finished?a.nextTick(n):e.once("finish",n)),t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),v.prototype.destroy=g.destroy,v.prototype._undestroy=g.undestroy,v.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n("./node_modules/process/browser.js"),n("./node_modules/node-libs-browser/node_modules/timers-browserify/main.js").setImmediate,n("./node_modules/webpack/buildin/global.js"))},"./node_modules/readable-stream/lib/internal/streams/BufferList.js":function(e,t,n){var r=n("./node_modules/safe-buffer/index.js").Buffer,i=n(1);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t,n,i=r.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=i,n=s,a.data.copy(t,n),s+=a.data.length,a=a.next;return i},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},"./node_modules/readable-stream/lib/internal/streams/destroy.js":function(e,t,n){var r=n("./node_modules/process-nextick-args/index.js");function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var n=this,a=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return a||s?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||r.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(r.nextTick(i,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},"./node_modules/readable-stream/lib/internal/streams/stream-browser.js":function(e,t,n){e.exports=n("./node_modules/node-libs-browser/node_modules/events/events.js").EventEmitter},"./node_modules/readable-stream/passthrough.js":function(e,t,n){e.exports=n("./node_modules/readable-stream/readable-browser.js").PassThrough},"./node_modules/readable-stream/readable-browser.js":function(e,t,n){(t=e.exports=n("./node_modules/readable-stream/lib/_stream_readable.js")).Stream=t,t.Readable=t,t.Writable=n("./node_modules/readable-stream/lib/_stream_writable.js"),t.Duplex=n("./node_modules/readable-stream/lib/_stream_duplex.js"),t.Transform=n("./node_modules/readable-stream/lib/_stream_transform.js"),t.PassThrough=n("./node_modules/readable-stream/lib/_stream_passthrough.js")},"./node_modules/readable-stream/transform.js":function(e,t,n){e.exports=n("./node_modules/readable-stream/readable-browser.js").Transform},"./node_modules/readable-stream/writable-browser.js":function(e,t,n){e.exports=n("./node_modules/readable-stream/lib/_stream_writable.js")},"./node_modules/safe-buffer/index.js":function(e,t,n){var r=n("./node_modules/node-libs-browser/node_modules/buffer/index.js"),i=r.Buffer;function a(e,t){for(var n in e)t[n]=e[n]}function s(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(a(r,t),t.Buffer=s),a(i,s),s.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},s.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},"./node_modules/sax/lib/sax.js":function(e,t,n){(function(e){!function(t){t.parser=function(e,t){return new a(e,t)},t.SAXParser=a,t.SAXStream=o,t.createStream=function(e,t){return new o(e,t)},t.MAX_BUFFER_LENGTH=65536;var r,i=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function a(e,n){if(!(this instanceof a))return new a(e,n);var r=this;!function(e){for(var t=0,n=i.length;t<n;t++)e[i[t]]=""}(r),r.q=r.c="",r.bufferCheckPosition=t.MAX_BUFFER_LENGTH,r.opt=n||{},r.opt.lowercase=r.opt.lowercase||r.opt.lowercasetags,r.looseCase=r.opt.lowercase?"toLowerCase":"toUpperCase",r.tags=[],r.closed=r.closedRoot=r.sawRoot=!1,r.tag=r.error=null,r.strict=!!e,r.noscript=!(!e&&!r.opt.noscript),r.state=R.BEGIN,r.strictEntities=r.opt.strictEntities,r.ENTITIES=r.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),r.attribList=[],r.opt.xmlns&&(r.ns=Object.create(y)),r.trackPosition=!1!==r.opt.position,r.trackPosition&&(r.position=r.line=r.column=0),N(r,"onready")}t.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Object.create||(Object.create=function(e){function t(){}return t.prototype=e,new t}),Object.keys||(Object.keys=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}),a.prototype={end:function(){L(this)},write:function(e){var n=this;if(this.error)throw this.error;if(n.closed)return x(n,"Cannot write after close. Assign an onready handler.");if(null===e)return L(n);"object"==typeof e&&(e=e.toString());for(var r=0,a="";a=V(e,r++),n.c=a,a;)switch(n.trackPosition&&(n.position++,"\n"===a?(n.line++,n.column=0):n.column++),n.state){case R.BEGIN:if(n.state=R.BEGIN_WHITESPACE,"\ufeff"===a)continue;G(n,a);continue;case R.BEGIN_WHITESPACE:G(n,a);continue;case R.TEXT:if(n.sawRoot&&!n.closedRoot){for(var s=r-1;a&&"<"!==a&&"&"!==a;)(a=V(e,r++))&&n.trackPosition&&(n.position++,"\n"===a?(n.line++,n.column=0):n.column++);n.textNode+=e.substring(s,r-1)}"<"!==a||n.sawRoot&&n.closedRoot&&!n.strict?(!A(l,a)||n.sawRoot&&!n.closedRoot||k(n,"Text data outside of root node."),"&"===a?n.state=R.TEXT_ENTITY:n.textNode+=a):(n.state=R.OPEN_WAKA,n.startTagPosition=n.position);continue;case R.SCRIPT:"<"===a?n.state=R.SCRIPT_ENDING:n.script+=a;continue;case R.SCRIPT_ENDING:"/"===a?n.state=R.CLOSE_TAG:(n.script+="<"+a,n.state=R.SCRIPT);continue;case R.OPEN_WAKA:if("!"===a)n.state=R.SGML_DECL,n.sgmlDecl="";else if(S(l,a));else if(S(v,a))n.state=R.OPEN_TAG,n.tagName=a;else if("/"===a)n.state=R.CLOSE_TAG,n.tagName="";else if("?"===a)n.state=R.PROC_INST,n.procInstName=n.procInstBody="";else{if(k(n,"Unencoded <"),n.startTagPosition+1<n.position){var o=n.position-n.startTagPosition;a=new Array(o).join(" ")+a}n.textNode+="<"+a,n.state=R.TEXT}continue;case R.SGML_DECL:(n.sgmlDecl+a).toUpperCase()===h?(O(n,"onopencdata"),n.state=R.CDATA,n.sgmlDecl="",n.cdata=""):n.sgmlDecl+a==="--"?(n.state=R.COMMENT,n.comment="",n.sgmlDecl=""):(n.sgmlDecl+a).toUpperCase()===p?(n.state=R.DOCTYPE,(n.doctype||n.sawRoot)&&k(n,"Inappropriately located doctype declaration"),n.doctype="",n.sgmlDecl=""):">"===a?(O(n,"onsgmldeclaration",n.sgmlDecl),n.sgmlDecl="",n.state=R.TEXT):S(d,a)?(n.state=R.SGML_DECL_QUOTED,n.sgmlDecl+=a):n.sgmlDecl+=a;continue;case R.SGML_DECL_QUOTED:a===n.q&&(n.state=R.SGML_DECL,n.q=""),n.sgmlDecl+=a;continue;case R.DOCTYPE:">"===a?(n.state=R.TEXT,O(n,"ondoctype",n.doctype),n.doctype=!0):(n.doctype+=a,"["===a?n.state=R.DOCTYPE_DTD:S(d,a)&&(n.state=R.DOCTYPE_QUOTED,n.q=a));continue;case R.DOCTYPE_QUOTED:n.doctype+=a,a===n.q&&(n.q="",n.state=R.DOCTYPE);continue;case R.DOCTYPE_DTD:n.doctype+=a,"]"===a?n.state=R.DOCTYPE:S(d,a)&&(n.state=R.DOCTYPE_DTD_QUOTED,n.q=a);continue;case R.DOCTYPE_DTD_QUOTED:n.doctype+=a,a===n.q&&(n.state=R.DOCTYPE_DTD,n.q="");continue;case R.COMMENT:"-"===a?n.state=R.COMMENT_ENDING:n.comment+=a;continue;case R.COMMENT_ENDING:"-"===a?(n.state=R.COMMENT_ENDED,n.comment=M(n.opt,n.comment),n.comment&&O(n,"oncomment",n.comment),n.comment=""):(n.comment+="-"+a,n.state=R.COMMENT);continue;case R.COMMENT_ENDED:">"!==a?(k(n,"Malformed comment"),n.comment+="--"+a,n.state=R.COMMENT):n.state=R.TEXT;continue;case R.CDATA:"]"===a?n.state=R.CDATA_ENDING:n.cdata+=a;continue;case R.CDATA_ENDING:"]"===a?n.state=R.CDATA_ENDING_2:(n.cdata+="]"+a,n.state=R.CDATA);continue;case R.CDATA_ENDING_2:">"===a?(n.cdata&&O(n,"oncdata",n.cdata),O(n,"onclosecdata"),n.cdata="",n.state=R.TEXT):"]"===a?n.cdata+="]":(n.cdata+="]]"+a,n.state=R.CDATA);continue;case R.PROC_INST:"?"===a?n.state=R.PROC_INST_ENDING:S(l,a)?n.state=R.PROC_INST_BODY:n.procInstName+=a;continue;case R.PROC_INST_BODY:if(!n.procInstBody&&S(l,a))continue;"?"===a?n.state=R.PROC_INST_ENDING:n.procInstBody+=a;continue;case R.PROC_INST_ENDING:">"===a?(O(n,"onprocessinginstruction",{name:n.procInstName,body:n.procInstBody}),n.procInstName=n.procInstBody="",n.state=R.TEXT):(n.procInstBody+="?"+a,n.state=R.PROC_INST_BODY);continue;case R.OPEN_TAG:S(_,a)?n.tagName+=a:(F(n),">"===a?j(n):"/"===a?n.state=R.OPEN_TAG_SLASH:(A(l,a)&&k(n,"Invalid character in tag name"),n.state=R.ATTRIB));continue;case R.OPEN_TAG_SLASH:">"===a?(j(n,!0),q(n)):(k(n,"Forward-slash in opening tag not followed by >"),n.state=R.ATTRIB);continue;case R.ATTRIB:if(S(l,a))continue;">"===a?j(n):"/"===a?n.state=R.OPEN_TAG_SLASH:S(v,a)?(n.attribName=a,n.attribValue="",n.state=R.ATTRIB_NAME):k(n,"Invalid attribute name");continue;case R.ATTRIB_NAME:"="===a?n.state=R.ATTRIB_VALUE:">"===a?(k(n,"Attribute without value"),n.attribValue=n.attribName,B(n),j(n)):S(l,a)?n.state=R.ATTRIB_NAME_SAW_WHITE:S(_,a)?n.attribName+=a:k(n,"Invalid attribute name");continue;case R.ATTRIB_NAME_SAW_WHITE:if("="===a)n.state=R.ATTRIB_VALUE;else{if(S(l,a))continue;k(n,"Attribute without value"),n.tag.attributes[n.attribName]="",n.attribValue="",O(n,"onattribute",{name:n.attribName,value:""}),n.attribName="",">"===a?j(n):S(v,a)?(n.attribName=a,n.state=R.ATTRIB_NAME):(k(n,"Invalid attribute name"),n.state=R.ATTRIB)}continue;case R.ATTRIB_VALUE:if(S(l,a))continue;S(d,a)?(n.q=a,n.state=R.ATTRIB_VALUE_QUOTED):(k(n,"Unquoted attribute value"),n.state=R.ATTRIB_VALUE_UNQUOTED,n.attribValue=a);continue;case R.ATTRIB_VALUE_QUOTED:if(a!==n.q){"&"===a?n.state=R.ATTRIB_VALUE_ENTITY_Q:n.attribValue+=a;continue}B(n),n.q="",n.state=R.ATTRIB_VALUE_CLOSED;continue;case R.ATTRIB_VALUE_CLOSED:S(l,a)?n.state=R.ATTRIB:">"===a?j(n):"/"===a?n.state=R.OPEN_TAG_SLASH:S(v,a)?(k(n,"No whitespace between attributes"),n.attribName=a,n.attribValue="",n.state=R.ATTRIB_NAME):k(n,"Invalid attribute name");continue;case R.ATTRIB_VALUE_UNQUOTED:if(A(f,a)){"&"===a?n.state=R.ATTRIB_VALUE_ENTITY_U:n.attribValue+=a;continue}B(n),">"===a?j(n):n.state=R.ATTRIB;continue;case R.CLOSE_TAG:if(n.tagName)">"===a?q(n):S(_,a)?n.tagName+=a:n.script?(n.script+="</"+n.tagName,n.tagName="",n.state=R.SCRIPT):(A(l,a)&&k(n,"Invalid tagname in closing tag"),n.state=R.CLOSE_TAG_SAW_WHITE);else{if(S(l,a))continue;A(v,a)?n.script?(n.script+="</"+a,n.state=R.SCRIPT):k(n,"Invalid tagname in closing tag."):n.tagName=a}continue;case R.CLOSE_TAG_SAW_WHITE:if(S(l,a))continue;">"===a?q(n):k(n,"Invalid characters in closing tag");continue;case R.TEXT_ENTITY:case R.ATTRIB_VALUE_ENTITY_Q:case R.ATTRIB_VALUE_ENTITY_U:var u,c;switch(n.state){case R.TEXT_ENTITY:u=R.TEXT,c="textNode";break;case R.ATTRIB_VALUE_ENTITY_Q:u=R.ATTRIB_VALUE_QUOTED,c="attribValue";break;case R.ATTRIB_VALUE_ENTITY_U:u=R.ATTRIB_VALUE_UNQUOTED,c="attribValue"}";"===a?(n[c]+=H(n),n.entity="",n.state=u):S(n.entity.length?E:T,a)?n.entity+=a:(k(n,"Invalid character in entity name"),n[c]+="&"+n.entity+a,n.entity="",n.state=u);continue;default:throw new Error(n,"Unknown state: "+n.state)}return n.position>=n.bufferCheckPosition&&function(e){for(var n=Math.max(t.MAX_BUFFER_LENGTH,10),r=0,a=0,s=i.length;a<s;a++){var o=e[i[a]].length;if(o>n)switch(i[a]){case"textNode":P(e);break;case"cdata":O(e,"oncdata",e.cdata),e.cdata="";break;case"script":O(e,"onscript",e.script),e.script="";break;default:x(e,"Max buffer length exceeded: "+i[a])}r=Math.max(r,o)}var l=t.MAX_BUFFER_LENGTH-r;e.bufferCheckPosition=l+e.position}(n),n},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var e;P(e=this),""!==e.cdata&&(O(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(O(e,"onscript",e.script),e.script="")}};try{r=n("./node_modules/stream-browserify/index.js").Stream}catch(e){r=function(){}}var s=t.EVENTS.filter((function(e){return"error"!==e&&"end"!==e}));function o(e,t){if(!(this instanceof o))return new o(e,t);r.apply(this),this._parser=new a(e,t),this.writable=!0,this.readable=!0;var n=this;this._parser.onend=function(){n.emit("end")},this._parser.onerror=function(e){n.emit("error",e),n._parser.error=null},this._decoder=null,s.forEach((function(e){Object.defineProperty(n,"on"+e,{get:function(){return n._parser["on"+e]},set:function(t){if(!t)return n.removeAllListeners(e),n._parser["on"+e]=t,t;n.on(e,t)},enumerable:!0,configurable:!1})}))}o.prototype=Object.create(r.prototype,{constructor:{value:o}}),o.prototype.write=function(t){if("function"==typeof e&&"function"==typeof e.isBuffer&&e.isBuffer(t)){if(!this._decoder){var r=n("./node_modules/string_decoder/lib/string_decoder.js").StringDecoder;this._decoder=new r("utf8")}t=this._decoder.write(t)}return this._parser.write(t.toString()),this.emit("data",t),!0},o.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},o.prototype.on=function(e,t){var n=this;return n._parser["on"+e]||-1===s.indexOf(e)||(n._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),n.emit.apply(n,t)}),r.prototype.on.call(n,e,t)};var l="\r\n\t ",u="0124356789",c="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",d="'\"",f=l+">",h="[CDATA[",p="DOCTYPE",g="http://www.w3.org/XML/1998/namespace",m="http://www.w3.org/2000/xmlns/",y={xml:g,xmlns:m};l=b(l),u=b(u),c=b(c);var v=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,_=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/,T=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,E=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;function b(e){return e.split("").reduce((function(e,t){return e[t]=!0,e}),{})}function S(e,t){return function(e){return"[object RegExp]"===Object.prototype.toString.call(e)}(e)?!!t.match(e):e[t]}function A(e,t){return!S(e,t)}d=b(d),f=b(f);var w,I,C,R=0;for(var D in t.STATE={BEGIN:R++,BEGIN_WHITESPACE:R++,TEXT:R++,TEXT_ENTITY:R++,OPEN_WAKA:R++,SGML_DECL:R++,SGML_DECL_QUOTED:R++,DOCTYPE:R++,DOCTYPE_QUOTED:R++,DOCTYPE_DTD:R++,DOCTYPE_DTD_QUOTED:R++,COMMENT_STARTING:R++,COMMENT:R++,COMMENT_ENDING:R++,COMMENT_ENDED:R++,CDATA:R++,CDATA_ENDING:R++,CDATA_ENDING_2:R++,PROC_INST:R++,PROC_INST_BODY:R++,PROC_INST_ENDING:R++,OPEN_TAG:R++,OPEN_TAG_SLASH:R++,ATTRIB:R++,ATTRIB_NAME:R++,ATTRIB_NAME_SAW_WHITE:R++,ATTRIB_VALUE:R++,ATTRIB_VALUE_QUOTED:R++,ATTRIB_VALUE_CLOSED:R++,ATTRIB_VALUE_UNQUOTED:R++,ATTRIB_VALUE_ENTITY_Q:R++,ATTRIB_VALUE_ENTITY_U:R++,CLOSE_TAG:R++,CLOSE_TAG_SAW_WHITE:R++,SCRIPT:R++,SCRIPT_ENDING:R++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach((function(e){var n=t.ENTITIES[e],r="number"==typeof n?String.fromCharCode(n):n;t.ENTITIES[e]=r})),t.STATE)t.STATE[t.STATE[D]]=D;function N(e,t,n){e[t]&&e[t](n)}function O(e,t,n){e.textNode&&P(e),N(e,t,n)}function P(e){e.textNode=M(e.opt,e.textNode),e.textNode&&N(e,"ontext",e.textNode),e.textNode=""}function M(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function x(e,t){return P(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,N(e,"onerror",t),e}function L(e){return e.sawRoot&&!e.closedRoot&&k(e,"Unclosed root tag"),e.state!==R.BEGIN&&e.state!==R.BEGIN_WHITESPACE&&e.state!==R.TEXT&&x(e,"Unexpected end"),P(e),e.c="",e.closed=!0,N(e,"onend"),a.call(e,e.strict,e.opt),e}function k(e,t){if("object"!=typeof e||!(e instanceof a))throw new Error("bad call to strictFail");e.strict&&x(e,t)}function F(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,n=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(n.ns=t.ns),e.attribList.length=0,O(e,"onopentagstart",n)}function U(e,t){var n=e.indexOf(":")<0?["",e]:e.split(":"),r=n[0],i=n[1];return t&&"xmlns"===e&&(r="xmlns",i=""),{prefix:r,local:i}}function B(e){if(e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName))e.attribName=e.attribValue="";else{if(e.opt.xmlns){var t=U(e.attribName,!0),n=t.prefix,r=t.local;if("xmlns"===n)if("xml"===r&&e.attribValue!==g)k(e,"xml: prefix must be bound to "+g+"\nActual: "+e.attribValue);else if("xmlns"===r&&e.attribValue!==m)k(e,"xmlns: prefix must be bound to "+m+"\nActual: "+e.attribValue);else{var i=e.tag,a=e.tags[e.tags.length-1]||e;i.ns===a.ns&&(i.ns=Object.create(a.ns)),i.ns[r]=e.attribValue}e.attribList.push([e.attribName,e.attribValue])}else e.tag.attributes[e.attribName]=e.attribValue,O(e,"onattribute",{name:e.attribName,value:e.attribValue});e.attribName=e.attribValue=""}}function j(e,t){if(e.opt.xmlns){var n=e.tag,r=U(e.tagName);n.prefix=r.prefix,n.local=r.local,n.uri=n.ns[r.prefix]||"",n.prefix&&!n.uri&&(k(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),n.uri=r.prefix);var i=e.tags[e.tags.length-1]||e;n.ns&&i.ns!==n.ns&&Object.keys(n.ns).forEach((function(t){O(e,"onopennamespace",{prefix:t,uri:n.ns[t]})}));for(var a=0,s=e.attribList.length;a<s;a++){var o=e.attribList[a],l=o[0],u=o[1],c=U(l,!0),d=c.prefix,f=c.local,h=""===d?"":n.ns[d]||"",p={name:l,value:u,prefix:d,local:f,uri:h};d&&"xmlns"!==d&&!h&&(k(e,"Unbound namespace prefix: "+JSON.stringify(d)),p.uri=d),e.tag.attributes[l]=p,O(e,"onattribute",p)}e.attribList.length=0}e.tag.isSelfClosing=!!t,e.sawRoot=!0,e.tags.push(e.tag),O(e,"onopentag",e.tag),t||(e.noscript||"script"!==e.tagName.toLowerCase()?e.state=R.TEXT:e.state=R.SCRIPT,e.tag=null,e.tagName=""),e.attribName=e.attribValue="",e.attribList.length=0}function q(e){if(!e.tagName)return k(e,"Weird empty close tag."),e.textNode+="</>",void(e.state=R.TEXT);if(e.script){if("script"!==e.tagName)return e.script+="</"+e.tagName+">",e.tagName="",void(e.state=R.SCRIPT);O(e,"onscript",e.script),e.script=""}var t=e.tags.length,n=e.tagName;e.strict||(n=n[e.looseCase]());for(var r=n;t--&&e.tags[t].name!==r;)k(e,"Unexpected close tag");if(t<0)return k(e,"Unmatched closing tag: "+e.tagName),e.textNode+="</"+e.tagName+">",void(e.state=R.TEXT);e.tagName=n;for(var i=e.tags.length;i-- >t;){var a=e.tag=e.tags.pop();e.tagName=e.tag.name,O(e,"onclosetag",e.tagName);var s={};for(var o in a.ns)s[o]=a.ns[o];var l=e.tags[e.tags.length-1]||e;e.opt.xmlns&&a.ns!==l.ns&&Object.keys(a.ns).forEach((function(t){var n=a.ns[t];O(e,"onclosenamespace",{prefix:t,uri:n})}))}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=R.TEXT}function H(e){var t,n=e.entity,r=n.toLowerCase(),i="";return e.ENTITIES[n]?e.ENTITIES[n]:e.ENTITIES[r]?e.ENTITIES[r]:("#"===(n=r).charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),i=(t=parseInt(n,16)).toString(16)):(n=n.slice(1),i=(t=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,""),i.toLowerCase()!==n?(k(e,"Invalid character entity"),"&"+e.entity+";"):String.fromCodePoint(t))}function G(e,t){"<"===t?(e.state=R.OPEN_WAKA,e.startTagPosition=e.position):A(l,t)&&(k(e,"Non-whitespace before first tag."),e.textNode=t,e.state=R.TEXT)}function V(e,t){var n="";return t<e.length&&(n=e.charAt(t)),n}R=t.STATE,String.fromCodePoint||(w=String.fromCharCode,I=Math.floor,C=function(){var e,t,n=[],r=-1,i=arguments.length;if(!i)return"";for(var a="";++r<i;){var s=Number(arguments[r]);if(!isFinite(s)||s<0||s>1114111||I(s)!==s)throw RangeError("Invalid code point: "+s);s<=65535?n.push(s):(e=55296+((s-=65536)>>10),t=s%1024+56320,n.push(e,t)),(r+1===i||n.length>16384)&&(a+=w.apply(null,n),n.length=0)}return a},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:C,configurable:!0,writable:!0}):String.fromCodePoint=C)}(t)}).call(this,n("./node_modules/node-libs-browser/node_modules/buffer/index.js").Buffer)},"./node_modules/setimmediate/setImmediate.js":function(e,t,n){(function(e,t){!function(e,n){if(!e.setImmediate){var r,i,a,s,o,l=1,u={},c=!1,d=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){p(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(s="setImmediate$"+Math.random()+"$",o=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&p(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",o,!1):e.attachEvent("onmessage",o),r=function(t){e.postMessage(s+t,"*")}):e.MessageChannel?((a=new MessageChannel).port1.onmessage=function(e){p(e.data)},r=function(e){a.port2.postMessage(e)}):d&&"onreadystatechange"in d.createElement("script")?(i=d.documentElement,r=function(e){var t=d.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(p,0,e)},f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var i={callback:e,args:t};return u[l]=i,r(l),l++},f.clearImmediate=h}function h(e){delete u[e]}function p(e){if(c)setTimeout(p,0,e);else{var t=u[e];if(t){c=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(n,r)}}(t)}finally{h(e),c=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n("./node_modules/webpack/buildin/global.js"),n("./node_modules/process/browser.js"))},"./node_modules/stream-browserify/index.js":function(e,t,n){e.exports=i;var r=n("./node_modules/node-libs-browser/node_modules/events/events.js").EventEmitter;function i(){r.call(this)}n("./node_modules/inherits/inherits_browser.js")(i,r),i.Readable=n("./node_modules/readable-stream/readable-browser.js"),i.Writable=n("./node_modules/readable-stream/writable-browser.js"),i.Duplex=n("./node_modules/readable-stream/duplex-browser.js"),i.Transform=n("./node_modules/readable-stream/transform.js"),i.PassThrough=n("./node_modules/readable-stream/passthrough.js"),i.Stream=i,i.prototype.pipe=function(e,t){var n=this;function i(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function a(){n.readable&&n.resume&&n.resume()}n.on("data",i),e.on("drain",a),e._isStdio||t&&!1===t.end||(n.on("end",o),n.on("close",l));var s=!1;function o(){s||(s=!0,e.end())}function l(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(c(),0===r.listenerCount(this,"error"))throw e}function c(){n.removeListener("data",i),e.removeListener("drain",a),n.removeListener("end",o),n.removeListener("close",l),n.removeListener("error",u),e.removeListener("error",u),n.removeListener("end",c),n.removeListener("close",c),e.removeListener("close",c)}return n.on("error",u),e.on("error",u),n.on("end",c),n.on("close",c),e.on("close",c),e.emit("pipe",n),e}},"./node_modules/string_decoder/lib/string_decoder.js":function(e,t,n){var r=n("./node_modules/safe-buffer/index.js").Buffer,i=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=u,t=4;break;case"utf8":this.fillLast=o,t=4;break;case"base64":this.text=c,this.end=d,t=3;break;default:return this.write=f,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function o(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function c(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},a.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},a.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=s(t[r]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--r<n||-2===i?0:(i=s(t[r]))>=0?(i>0&&(e.lastNeed=i-2),i):--r<n||-2===i?0:(i=s(t[r]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},"./node_modules/util-deprecate/browser.js":function(e,t,n){(function(t){function n(e){try{if(!t.localStorage)return!1}catch(e){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,n("./node_modules/webpack/buildin/global.js"))},"./node_modules/webpack/buildin/global.js":function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},"./src/core/Debug.js":function(e,t,n){n.r(t);var r=n("./src/core/EventBus.js"),i=n("./src/core/events/Events.js"),a=n("./src/core/FactoryMaker.js"),s=1,o=2,l=3,u=4,c=5;function d(e){e=e||{};var t,n,a,d,f=this.context,h=Object(r.default)(f).getInstance(),p=e.settings,g=[];function m(e){return e&&e.bind?e.bind(window.console):window.console.log.bind(window.console)}function y(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[s,this].concat(t))}function v(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[o,this].concat(t))}function _(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[l,this].concat(t))}function T(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[u,this].concat(t))}function E(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];b.apply(void 0,[c,this].concat(t))}function b(e,t){var r="",s=null;n&&(s=(new Date).getTime(),r+="["+(s-d)+"]"),a&&t&&t.getClassName&&(r+="["+t.getClassName()+"]",t.getType&&(r+="["+t.getType()+"]")),r.length>0&&(r+=" ");for(var o=arguments.length,l=new Array(o>2?o-2:0),u=2;u<o;u++)l[u-2]=arguments[u];Array.apply(null,l).forEach((function(e){r+=e+" "})),g[e]&&p.get().debug.logLevel>=e&&g[e](r),p&&p.get().debug.dispatchEvent&&h.trigger(i.default.LOG,{message:r,level:e})}return t={getLogger:function(e){return{fatal:y.bind(e),error:v.bind(e),warn:_.bind(e),info:T.bind(e),debug:E.bind(e)}},setLogTimestampVisible:function(e){n=e},setCalleeNameVisible:function(e){a=e}},n=!0,a=!0,d=(new Date).getTime(),"undefined"!=typeof window&&window.console&&(g[s]=m(window.console.error),g[o]=m(window.console.error),g[l]=m(window.console.warn),g[u]=m(window.console.info),g[c]=m(window.console.debug)),t}d.__dashjs_factory_name="Debug";var f=a.default.getSingletonFactory(d);f.LOG_LEVEL_NONE=0,f.LOG_LEVEL_FATAL=s,f.LOG_LEVEL_ERROR=o,f.LOG_LEVEL_WARNING=l,f.LOG_LEVEL_INFO=u,f.LOG_LEVEL_DEBUG=c,a.default.updateSingletonFactory(d.__dashjs_factory_name,f),t.default=f},"./src/core/EventBus.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/streaming/MediaPlayerEvents.js");function a(){var e={};function t(t,n,r){var i=-1;return e[t]?(e[t].some((function(e,t){if(e&&e.callback===n&&(!r||r===e.scope))return i=t,!0})),i):i}var n={on:function(n,r,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!n)throw new Error("event type cannot be null or undefined");if(!r||"function"!=typeof r)throw new Error("listener must be a function: "+r);var s=a.priority||0;if(!(t(n,r,i)>=0)){e[n]=e[n]||[];var o={callback:r,scope:i,priority:s};i&&i.getStreamId&&(o.streamId=i.getStreamId()),i&&i.getType&&(o.mediaType=i.getType()),a&&a.mode&&(o.mode=a.mode),e[n].some((function(t,r){if(t&&s>t.priority)return e[n].splice(r,0,o),!0}))||e[n].push(o)}},off:function(n,r,i){if(n&&r&&e[n]){var a=t(n,r,i);a<0||(e[n][a]=null)}},trigger:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t&&e[t]){if((n=n||{}).hasOwnProperty("type"))throw new Error("'type' is a reserved word for event dispatching");n.type=t,r.streamId&&(n.streamId=r.streamId),r.mediaType&&(n.mediaType=r.mediaType),e[t].filter((function(e){return!(!e||r.streamId&&e.streamId&&e.streamId!==r.streamId||r.mediaType&&e.mediaType&&e.mediaType!==r.mediaType||r.mode&&e.mode&&e.mode!==r.mode||!e.mode&&r.mode&&r.mode===i.default.EVENT_MODE_ON_RECEIVE)})).forEach((function(e){return e&&e.callback.call(e.scope,n)}))}},reset:function(){e={}}};return n}a.__dashjs_factory_name="EventBus";var s=r.default.getSingletonFactory(a);s.EVENT_PRIORITY_LOW=0,s.EVENT_PRIORITY_HIGH=5e3,r.default.updateSingletonFactory(a.__dashjs_factory_name,s),t.default=s},"./src/core/FactoryMaker.js":function(e,t,n){n.r(t);var r=function(){var e,t=[],n={},r={};function i(e,n){for(var r in t){var i=t[r];if(i.context===e&&i.name===n)return i.instance}return null}function a(e,t){return t[e]}function s(e,t,n){e in n&&(n[e]=t)}function o(t,n,r){var i,a=t.__dashjs_factory_name,s=n[a];if(s){var o=s.instance;if(!s.override)return o.apply({context:n,factory:e},r);for(var l in i=t.apply({context:n},r),o=o.apply({context:n,factory:e,parent:i},r))i.hasOwnProperty(l)&&(i[l]=o[l])}else i=t.apply({context:n},r);return i.getClassName=function(){return a},i}return e={extend:function(e,t,n,r){!r[e]&&t&&(r[e]={instance:t,override:n})},getSingletonInstance:i,setSingletonInstance:function(e,n,r){for(var i in t){var a=t[i];if(a.context===e&&a.name===n)return void(t[i].instance=r)}t.push({name:n,context:e,instance:r})},deleteSingletonInstances:function(e){t=t.filter((function(t){return t.context!==e}))},getSingletonFactory:function(e){var r=a(e.__dashjs_factory_name,n);return r||(r=function(n){var r;return void 0===n&&(n={}),{getInstance:function(){return r||(r=i(n,e.__dashjs_factory_name)),r||(r=o(e,n,arguments),t.push({name:e.__dashjs_factory_name,context:n,instance:r})),r}}},n[e.__dashjs_factory_name]=r),r},getSingletonFactoryByName:function(e){return a(e,n)},updateSingletonFactory:function(e,t){s(e,t,n)},getClassFactory:function(e){var t=a(e.__dashjs_factory_name,r);return t||(t=function(t){return void 0===t&&(t={}),{create:function(){return o(e,t,arguments)}}},r[e.__dashjs_factory_name]=t),t},getClassFactoryByName:function(e){return a(e,r)},updateClassFactory:function(e,t){s(e,t,r)}},e}();t.default=r},"./src/core/Settings.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/core/Utils.js"),a=n("./src/core/Debug.js"),s=n("./src/streaming/constants/Constants.js"),o=n("./src/streaming/vo/metrics/HTTPRequest.js");function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(){var e,t,n={debug:{logLevel:a.default.LOG_LEVEL_WARNING,dispatchEvent:!1},streaming:{abandonLoadTimeout:1e4,wallclockTimeUpdateInterval:100,lowLatencyEnabled:!1,lowLatencyEnabledByManifest:!0,manifestUpdateRetryInterval:100,cacheInitSegments:!1,eventControllerRefreshDelay:150,capabilities:{filterUnsupportedEssentialProperties:!0,useMediaCapabilitiesApi:!1},timeShiftBuffer:{calcFromSegmentTimeline:!1,fallbackToSegmentTimeline:!0},metrics:{maxListDepth:100},delay:{liveDelayFragmentCount:NaN,liveDelay:NaN,useSuggestedPresentationDelay:!0,applyServiceDescription:!0},protection:{keepProtectionMediaKeys:!1,ignoreEmeEncryptedEvent:!1},buffer:{enableSeekDecorrelationFix:!1,fastSwitchEnabled:!0,flushBufferAtTrackSwitch:!1,reuseExistingSourceBuffers:!0,bufferPruningInterval:10,bufferToKeep:20,bufferTimeAtTopQuality:30,bufferTimeAtTopQualityLongForm:60,initialBufferLevel:NaN,stableBufferTime:12,longFormContentDurationThreshold:600,stallThreshold:.3,useAppendWindow:!0,setStallState:!0},gaps:{jumpGaps:!0,jumpLargeGaps:!0,smallGapLimit:1.5,threshold:.3,enableSeekFix:!1},utcSynchronization:{enabled:!0,useManifestDateHeaderTimeSource:!0,backgroundAttempts:2,timeBetweenSyncAttempts:30,maximumTimeBetweenSyncAttempts:600,minimumTimeBetweenSyncAttempts:2,timeBetweenSyncAttemptsAdjustmentFactor:2,maximumAllowedDrift:100,enableBackgroundSyncAfterSegmentDownloadError:!0,defaultTimingSource:{scheme:"urn:mpeg:dash:utc:http-xsdate:2014",value:"https://time.akamai.com/?iso&ms"}},scheduling:{defaultTimeout:500,lowLatencyTimeout:0,scheduleWhilePaused:!0},text:{defaultEnabled:!0},liveCatchup:{minDrift:.02,maxDrift:12,playbackRate:.5,latencyThreshold:60,playbackBufferMin:.5,enabled:!1,mode:s.default.LIVE_CATCHUP_MODE_DEFAULT},lastBitrateCachingInfo:{enabled:!0,ttl:36e4},lastMediaSettingsCachingInfo:{enabled:!0,ttl:36e4},cacheLoadThresholds:{video:50,audio:5},trackSwitchMode:{audio:s.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE,video:s.default.TRACK_SWITCH_MODE_NEVER_REPLACE},selectionModeForInitialTrack:s.default.TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY,fragmentRequestTimeout:0,retryIntervals:(e={},u(e,o.HTTPRequest.MPD_TYPE,500),u(e,o.HTTPRequest.XLINK_EXPANSION_TYPE,500),u(e,o.HTTPRequest.MEDIA_SEGMENT_TYPE,1e3),u(e,o.HTTPRequest.INIT_SEGMENT_TYPE,1e3),u(e,o.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE,1e3),u(e,o.HTTPRequest.INDEX_SEGMENT_TYPE,1e3),u(e,o.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE,1e3),u(e,o.HTTPRequest.LICENSE,1e3),u(e,o.HTTPRequest.OTHER_TYPE,1e3),u(e,"lowLatencyReductionFactor",10),e),retryAttempts:(t={},u(t,o.HTTPRequest.MPD_TYPE,3),u(t,o.HTTPRequest.XLINK_EXPANSION_TYPE,1),u(t,o.HTTPRequest.MEDIA_SEGMENT_TYPE,3),u(t,o.HTTPRequest.INIT_SEGMENT_TYPE,3),u(t,o.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE,3),u(t,o.HTTPRequest.INDEX_SEGMENT_TYPE,3),u(t,o.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE,3),u(t,o.HTTPRequest.LICENSE,3),u(t,o.HTTPRequest.OTHER_TYPE,3),u(t,"lowLatencyMultiplyFactor",5),t),abr:{movingAverageMethod:s.default.MOVING_AVERAGE_SLIDING_WINDOW,ABRStrategy:s.default.ABR_STRATEGY_DYNAMIC,additionalAbrRules:{insufficientBufferRule:!0,switchHistoryRule:!0,droppedFramesRule:!0,abandonRequestsRule:!1},bandwidthSafetyFactor:.9,useDefaultABRRules:!0,useDeadTimeLatency:!0,limitBitrateByPortal:!1,usePixelRatioInLimitBitrateByPortal:!1,maxBitrate:{audio:-1,video:-1},minBitrate:{audio:-1,video:-1},maxRepresentationRatio:{audio:1,video:1},initialBitrate:{audio:-1,video:-1},initialRepresentationRatio:{audio:-1,video:-1},autoSwitchBitrate:{audio:!0,video:!0},fetchThroughputCalculationMode:s.default.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING},cmcd:{enabled:!1,sid:null,cid:null,rtp:null,rtpSafetyFactor:5,mode:s.default.CMCD_MODE_QUERY}},errors:{recoverAttempts:{mediaErrorDecode:5}}},r=i.default.clone(n);function c(e,t,n){for(var r in e)e.hasOwnProperty(r)&&t.hasOwnProperty(r)&&("object"===l(e[r])&&null!==e[r]?c(e[r],t[r],n.slice()+r+"."):t[r]=i.default.clone(e[r]))}return{get:function(){return r},update:function(e){"object"===l(e)&&c(e,r,"")},reset:function(){r=i.default.clone(n)}}}c.__dashjs_factory_name="Settings";var d=r.default.getSingletonFactory(c);t.default=d},"./src/core/Utils.js":function(e,t,n){n.r(t);var r=n("./node_modules/path-browserify/index.js"),i=n.n(r);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,r;return t=e,r=[{key:"mixin",value:function(t,n,r){var i,s={};if(t)for(var o in n)n.hasOwnProperty(o)&&(i=n[o],o in t&&(t[o]===i||o in s&&s[o]===i)||("object"===a(t[o])&&null!==t[o]?t[o]=e.mixin(t[o],i,r):t[o]=r(i)));return t}},{key:"clone",value:function(t){if(!t||"object"!==a(t))return t;var n;if(t instanceof Array){n=[];for(var r=0,i=t.length;r<i;++r)r in t&&n.push(e.clone(t[r]))}else n={};return e.mixin(n,t,e.clone)}},{key:"addAditionalQueryParameterToUrl",value:function(e,t){try{if(!t||0===t.length)return e;var n=new URL(e);return t.forEach((function(e){e.key&&e.value&&n.searchParams.set(e.key,e.value)})),n.href}catch(t){return e}}},{key:"parseHttpHeaders",value:function(e){var t={};if(!e)return t;for(var n=e.trim().split("\r\n"),r=0,i=n.length;r<i;r++){var a=n[r],s=a.indexOf(": ");s>0&&(t[a.substring(0,s)]=a.substring(s+2))}return t}},{key:"generateUuid",value:function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?n:3&n|8).toString(16)}))}},{key:"generateHashCode",value:function(e){var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t}},{key:"getRelativeUrl",value:function(e,t){try{var n=new URL(e),r=new URL(t);if(n.protocol=r.protocol,n.origin!==r.origin)return t;var a=i.a.relative(n.pathname.substr(0,n.pathname.lastIndexOf("/")),r.pathname.substr(0,r.pathname.lastIndexOf("/"))),s=0===a.length?1:0;return a+=r.pathname.substr(r.pathname.lastIndexOf("/")+s,r.pathname.length-1),r.pathname.length<a.length?r.pathname:a}catch(e){return t}}}],(n=null)&&s(t.prototype,n),r&&s(t,r),e}();t.default=o},"./src/core/Version.js":function(e,t,n){n.r(t),n.d(t,"getVersionString",(function(){return i}));var r="4.2.0";function i(){return r}},"./src/core/errors/Errors.js":function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=s(e);if(t){var a=s(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}n.r(t);var o=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(n,e);var t=a(n);function n(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(e=t.call(this)).MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE=10,e.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE=11,e.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE=12,e.SEGMENT_BASE_LOADER_ERROR_CODE=15,e.TIME_SYNC_FAILED_ERROR_CODE=16,e.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE=17,e.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE=18,e.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE=19,e.APPEND_ERROR_CODE=20,e.REMOVE_ERROR_CODE=21,e.DATA_UPDATE_FAILED_ERROR_CODE=22,e.CAPABILITY_MEDIASOURCE_ERROR_CODE=23,e.CAPABILITY_MEDIAKEYS_ERROR_CODE=24,e.DOWNLOAD_ERROR_ID_MANIFEST_CODE=25,e.DOWNLOAD_ERROR_ID_SIDX_CODE=26,e.DOWNLOAD_ERROR_ID_CONTENT_CODE=27,e.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE=28,e.DOWNLOAD_ERROR_ID_XLINK_CODE=29,e.MANIFEST_ERROR_ID_PARSE_CODE=31,e.MANIFEST_ERROR_ID_NOSTREAMS_CODE=32,e.TIMED_TEXT_ERROR_ID_PARSE_CODE=33,e.MANIFEST_ERROR_ID_MULTIPLEXED_CODE=34,e.MEDIASOURCE_TYPE_UNSUPPORTED_CODE=35,e.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE="parsing failed for ",e.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE="Failed loading manifest: ",e.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE="Failed loading Xlink element: ",e.SEGMENTS_UPDATE_FAILED_ERROR_MESSAGE="Segments update failed",e.SEGMENTS_UNAVAILABLE_ERROR_MESSAGE="no segments are available yet",e.SEGMENT_BASE_LOADER_ERROR_MESSAGE="error loading segment ranges from sidx",e.TIME_SYNC_FAILED_ERROR_MESSAGE="Failed to synchronize client and server time",e.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE="request is null",e.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE="Failed to resolve a valid URL",e.APPEND_ERROR_MESSAGE="chunk is not defined",e.REMOVE_ERROR_MESSAGE="Removing data from the SourceBuffer",e.DATA_UPDATE_FAILED_ERROR_MESSAGE="Data update failed",e.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE="mediasource is not supported",e.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE="mediakeys is not supported",e.TIMED_TEXT_ERROR_MESSAGE_PARSE="parsing error :",e.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE="Error creating source buffer of type : ",e}return n}(n("./src/core/errors/ErrorsBase.js").default));t.default=o},"./src/core/errors/ErrorsBase.js":function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(t);var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,(n=[{key:"extend",value:function(e,t){if(e){var n=!!t&&t.override,r=!!t&&t.publicOnly;for(var i in e)!e.hasOwnProperty(i)||this[i]&&!n||r&&-1===e[i].indexOf("public_")||(this[i]=e[i])}}}])&&r(t.prototype,n),i&&r(t,i),e}();t.default=i},"./src/core/events/CoreEvents.js":function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=s(e);if(t){var a=s(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}n.r(t);var o=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(n,e);var t=a(n);function n(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(e=t.call(this)).ATTEMPT_BACKGROUND_SYNC="attemptBackgroundSync",e.BUFFERING_COMPLETED="bufferingCompleted",e.BUFFER_CLEARED="bufferCleared",e.BYTES_APPENDED_END_FRAGMENT="bytesAppendedEndFragment",e.BUFFER_REPLACEMENT_STARTED="bufferReplacementStarted",e.CHECK_FOR_EXISTENCE_COMPLETED="checkForExistenceCompleted",e.CURRENT_TRACK_CHANGED="currentTrackChanged",e.DATA_UPDATE_COMPLETED="dataUpdateCompleted",e.INBAND_EVENTS="inbandEvents",e.INITIAL_STREAM_SWITCH="initialStreamSwitch",e.INIT_FRAGMENT_LOADED="initFragmentLoaded",e.INIT_FRAGMENT_NEEDED="initFragmentNeeded",e.INTERNAL_MANIFEST_LOADED="internalManifestLoaded",e.ORIGINAL_MANIFEST_LOADED="originalManifestLoaded",e.LOADING_COMPLETED="loadingCompleted",e.LOADING_PROGRESS="loadingProgress",e.LOADING_DATA_PROGRESS="loadingDataProgress",e.LOADING_ABANDONED="loadingAborted",e.MANIFEST_UPDATED="manifestUpdated",e.MEDIA_FRAGMENT_LOADED="mediaFragmentLoaded",e.MEDIA_FRAGMENT_NEEDED="mediaFragmentNeeded",e.QUOTA_EXCEEDED="quotaExceeded",e.SEGMENT_LOCATION_BLACKLIST_ADD="segmentLocationBlacklistAdd",e.SEGMENT_LOCATION_BLACKLIST_CHANGED="segmentLocationBlacklistChanged",e.SERVICE_LOCATION_BLACKLIST_ADD="serviceLocationBlacklistAdd",e.SERVICE_LOCATION_BLACKLIST_CHANGED="serviceLocationBlacklistChanged",e.SET_FRAGMENTED_TEXT_AFTER_DISABLED="setFragmentedTextAfterDisabled",e.SET_NON_FRAGMENTED_TEXT="setNonFragmentedText",e.SOURCE_BUFFER_ERROR="sourceBufferError",e.STREAMS_COMPOSED="streamsComposed",e.STREAM_BUFFERING_COMPLETED="streamBufferingCompleted",e.STREAM_REQUESTING_COMPLETED="streamRequestingCompleted",e.TEXT_TRACKS_QUEUE_INITIALIZED="textTracksQueueInitialized",e.TIME_SYNCHRONIZATION_COMPLETED="timeSynchronizationComplete",e.UPDATE_TIME_SYNC_OFFSET="updateTimeSyncOffset",e.URL_RESOLUTION_FAILED="urlResolutionFailed",e.VIDEO_CHUNK_RECEIVED="videoChunkReceived",e.WALLCLOCK_TIME_UPDATED="wallclockTimeUpdated",e.XLINK_ELEMENT_LOADED="xlinkElementLoaded",e.XLINK_READY="xlinkReady",e.SEEK_TARGET="seekTarget",e}return n}(n("./src/core/events/EventsBase.js").default);t.default=o},"./src/core/events/Events.js":function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=s(e);if(t){var a=s(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}n.r(t);var o=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(n,e);var t=a(n);function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),t.apply(this,arguments)}return n}(n("./src/core/events/CoreEvents.js").default),l=new o;t.default=l},"./src/core/events/EventsBase.js":function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(t);var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,(n=[{key:"extend",value:function(e,t){if(e){var n=!!t&&t.override,r=!!t&&t.publicOnly;for(var i in e)!e.hasOwnProperty(i)||this[i]&&!n||r&&-1===e[i].indexOf("public_")||(this[i]=e[i])}}}])&&r(t.prototype,n),i&&r(t,i),e}();t.default=i},"./src/dash/DashAdapter.js":function(e,t,n){n.r(t);var r=n("./src/dash/constants/DashConstants.js"),i=n("./src/dash/vo/RepresentationInfo.js"),a=n("./src/dash/vo/MediaInfo.js"),s=n("./src/dash/vo/StreamInfo.js"),o=n("./src/dash/vo/ManifestInfo.js"),l=n("./src/dash/vo/Event.js"),u=n("./src/core/FactoryMaker.js"),c=n("./src/dash/models/DashManifestModel.js"),d=n("./src/dash/models/PatchManifestModel.js");function f(){var e,t,n,u,f,h,p,g=this.context;function m(e,n,i){var a,s=t.getAdaptationsForType(u[0].mpd.manifest,e,n);if(!s||0===s.length)return null;if(s.length>1&&i){var o=_(i,n);if(f[i.id]&&f[i.id][n])for(var l=0,c=s.length;l<c;l++)if(y(f[i.id][n],o[l]))return s[l];for(var d=0,h=s.length;d<h;d++)if(a=s[d],t.getRolesForAdaptation(a).filter((function(e){return e.value===r.default.MAIN}))[0])return s[d]}return s[0]}function y(e,t){if(!e||!t)return!1;var n=e.id===t.id,r=e.codec===t.codec,i=e.viewpoint===t.viewpoint,a=e.lang===t.lang,s=e.roles.toString()===t.roles.toString(),o=e.accessibility.toString()===t.accessibility.toString(),l=e.audioChannelConfiguration.toString()===t.audioChannelConfiguration.toString();return n&&r&&i&&a&&s&&o&&l}function v(e,n,r,i,a,s){var o,l,u,c,d,f,p=[];if(!i||0===i.length)return[];var g=t.getAdaptationsForPeriod(n);for(c=0,f=i.length;c<f;c++)if(o=i[c],l=I(g[u=t.getIndexForAdaptation(o,e,r.index)]),s){var m=l.accessibility.length;for(d=0;d<m;d++)if(l){var y=l.accessibility[d];if(0===y.indexOf("cea-608:")){var v=y.substring(8).split(";");if("CC"===v[0].substring(0,2))for(d=0;d<v.length;d++)l||(l=I.call(this,g[u])),C(l,v[d].substring(0,3),v[d].substring(4)),p.push(l),l=null;else for(d=0;d<v.length;d++)l||(l=I.call(this,g[u])),C(l,"CC"+(d+1),v[d]),p.push(l),l=null}else 0===y.indexOf("cea-608")&&(C(l,h.CC1,"eng"),p.push(l),l=null)}}else a===h.IMAGE?(l.type=h.IMAGE,p.push(l),l=null):l&&p.push(l);return p}function _(e,n,r){var i=u,a=r,s=[];if(a)D(),i=T(a);else{if(!(u.length>0))return s;a=u[0].mpd.manifest}var o=w(e,i),l=t.getAdaptationsForType(a,e?e.index:null,n);return s=v(a,o,e,l,n),n===h.TEXT&&(l=t.getAdaptationsForType(a,e?e.index:null,h.VIDEO),s=s.concat(v(a,o,e,l,n,!0))),s}function T(e){var n=E(e);return t.getRegularPeriods(n)}function E(e){var n=S(e);return t.getMpd(n)}function b(){u=[],f={}}function S(e){return e||(u.length>0?u[0].mpd.manifest:null)}function A(e){try{var n=w(e.streamInfo,u),r=t.getAdaptationsForPeriod(n);return e&&e.streamInfo&&void 0!==e.streamInfo.id&&r?r[e.index]:null}catch(e){return null}}function w(e,t){for(var n=t.length,r=0;r<n;r++){var i=t[r];if(e&&e.id===i.id)return i}return null}function I(e){if(!e)return null;var n,r=new a.default,i=e.period.mpd.manifest.Period_asArray[e.period.index].AdaptationSet_asArray[e.index];if(r.id=e.id,r.index=e.index,r.type=e.type,r.streamInfo=R(e.period),r.representationCount=t.getRepresentationCount(i),r.labels=t.getLabelsForAdaptation(i),r.lang=t.getLanguageForAdaptation(i),n=t.getViewpointForAdaptation(i),r.viewpoint=n?n.value:void 0,r.accessibility=t.getAccessibilityForAdaptation(i).map((function(e){var t=e.value,n=t;return e.schemeIdUri&&e.schemeIdUri.search("cea-608")>=0&&void 0!==p&&(n=t?"cea-608:"+t:"cea-608",r.embeddedCaptions=!0),n})),r.audioChannelConfiguration=t.getAudioChannelConfigurationForAdaptation(i).map((function(e){return e.value})),0===r.audioChannelConfiguration.length&&Array.isArray(i.Representation_asArray)&&i.Representation_asArray.length>0&&(r.audioChannelConfiguration=t.getAudioChannelConfigurationForRepresentation(i.Representation_asArray[0]).map((function(e){return e.value}))),r.roles=t.getRolesForAdaptation(i).map((function(e){return e.value})),r.codec=t.getCodec(i),r.mimeType=t.getMimeType(i),r.contentProtection=t.getContentProtectionData(i),r.bitrateList=t.getBitrateListForAdaptation(i),r.selectionPriority=t.getSelectionPriority(i),r.contentProtection){var s=r.contentProtection.map((function(e){return t.getKID(e)})).filter((function(e){return null!==e}));if(s.length){var o=s[0];r.contentProtection.forEach((function(e){e.keyId=o}))}}return r.isText=t.getIsText(i),r.supplementalProperties=t.getSupplementalProperties(i),r.isFragmented=t.getIsFragmented(i),r.isEmbedded=!1,r}function C(e,t,n){e.id=t,e.index=100+parseInt(t.substring(2,3)),e.type=h.TEXT,e.codec="cea-608-in-SEI",e.isEmbedded=!0,e.isFragmented=!1,e.lang=n,e.roles=["caption"]}function R(e){var n,r,i=new s.default;return i.id=e.id,i.index=e.index,i.start=e.start,i.duration=e.duration,i.manifestInfo=(n=e.mpd,(r=new o.default).dvrWindowSize=n.timeShiftBufferDepth,r.loadedTime=n.manifest.loadedTime,r.availableFrom=n.availabilityStartTime,r.minBufferTime=n.manifest.minBufferTime,r.maxFragmentDuration=n.maxSegmentDuration,r.duration=t.getDuration(n.manifest),r.isDynamic=t.getIsDynamic(n.manifest),r.serviceDescriptions=t.getServiceDescriptions(n.manifest),r.protocol=n.manifest.protocol,r),i.isLast=1===e.mpd.manifest.Period_asArray.length||Math.abs(i.start+i.duration-i.manifestInfo.duration)<1,i}function D(){if(!h)throw new Error("setConfig function has to be called previously")}function N(e){return u.length>0?u[0].mpd.manifest.Period_asArray[e]:null}function O(e,t,n){var r,i,a,s,o;if(e)for(r=e.AdaptationSet_asArray,s=0;s<r.length;s+=1)for(a=r[s].Representation_asArray,o=0;o<a.length;o+=1)if(t===(i=a[o]).id)return n?o:i;return null}return e={getBandwidthForRepresentation:function(e,t){var n;return(n=O(N(t),e))?n.bandwidth:null},getIndexForRepresentation:function(e,t){return function(e,t){var n=O(e,t,!0);return null!==n?n:-1}(N(t),e)},getMaxIndexForBufferType:function(e,n){return function(e,n){var r,i,a,s;if(!e||!n)return-1;for(i=e.AdaptationSet_asArray,s=0;s<i.length;s+=1)if(a=(r=i[s]).Representation_asArray,t.getIsTypeOf(r,n))return a.length;return-1}(N(n),e)},convertRepresentationToRepresentationInfo:function(e){if(e){var n=new i.default,r=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index],a=t.getRepresentationFor(e.index,r);return n.id=e.id,n.quality=e.index,n.bandwidth=t.getBandwidth(a),n.fragmentDuration=e.segmentDuration||(e.segments&&e.segments.length>0?e.segments[0].duration:NaN),n.MSETimeOffset=e.MSETimeOffset,n.mediaInfo=I(e.adaptation),n}return null},getStreamsInfo:function(e,t){var n=[],r=u;if(e&&(D(),r=T(e)),r.length>0){(!t||t>r.length)&&(t=r.length);for(var i=0;i<t;i++)n.push(R(r[i]))}return n},getMediaInfoForType:function(e,n){if(0===u.length||!e)return null;var r=w(e,u);if(!r)return null;var i=t.getAdaptationsForPeriod(r),a=m(e.index,n,e);return a?I(i[t.getIndexForAdaptation(a,u[0].mpd.manifest,e.index)]):null},getAllMediaInfoForType:_,getAdaptationForType:m,getRealAdaptation:function(e,n){var r,i,a=w(e,u);return r=n?n.id:null,u.length>0&&a&&(i=r?t.getAdaptationForId(r,u[0].mpd.manifest,a.index):t.getAdaptationForIndex(n?n.index:null,u[0].mpd.manifest,a.index)),i},getRealPeriodByIndex:function(e){return t.getRealPeriodForIndex(e,u[0].mpd.manifest)},getEssentialPropertiesForRepresentation:function(e){try{return t.getEssentialPropertiesForRepresentation(e)}catch(e){return[]}},getVoRepresentations:function(e){var n=A(e);return t.getRepresentationsForAdaptation(n)},getEventsFor:function(e,n){var r=[];if(u.length>0){var o=u[0].mpd.manifest;e instanceof s.default?r=t.getEventsForPeriod(w(e,u)):e instanceof a.default?r=t.getEventStreamForAdaptationSet(o,A(e)):e instanceof i.default&&(r=t.getEventStreamForRepresentation(o,n))}return r},getEvent:function(e,t,n,r){try{if(!e||!t||isNaN(n)||!r)return null;var i=e.scheme_id_uri,a=e.value;if(!t[i+"/"+a])return null;var s,o=new l.default,u=e.timescale||1,c=r.adaptation.period.start,d=t[i+"/"+a],f=isNaN(r.presentationTimeOffset)?isNaN(d.presentationTimeOffset)?0:d.presentationTimeOffset:r.presentationTimeOffset,h=e.presentation_time_delta/u;s=0===e.version?c+n-f+h:c-f+h;var p=e.event_duration,g=e.id,m=e.message_data;return o.eventStream=d,o.eventStream.value=a,o.eventStream.timescale=u,o.duration=p,o.id=g,o.calculatedPresentationTime=s,o.messageData=m,o.presentationTimeDelta=h,o}catch(e){return null}},getMpd:E,setConfig:function(e){e&&(e.constants&&(h=e.constants),e.cea608parser&&(p=e.cea608parser),e.errHandler&&t.setConfig({errHandler:e.errHandler}),e.BASE64&&t.setConfig({BASE64:e.BASE64}))},updatePeriods:function(e){if(!e)return null;D(),u=T(e)},getIsTextTrack:function(e){return t.getIsText(e)},getUTCTimingSources:function(){var e=S();return t.getUTCTimingSources(e)},getSuggestedPresentationDelay:function(){var e=u.length>0?u[0].mpd:null;return t.getSuggestedPresentationDelay(e)},getAvailabilityStartTime:function(e){var n=E(e);return t.getAvailabilityStartTime(n)},getIsTypeOf:function(e,n){return t.getIsTypeOf(e,n)},getIsDynamic:function(e){var n=S(e);return t.getIsDynamic(n)},getDuration:function(e){var n=S(e);return t.getDuration(n)},getRegularPeriods:T,getLocation:function(e){return t.getLocation(e)},getPatchLocation:function(e){var n=t.getPatchLocation(e),r=t.getPublishTime(e);if(!n||!r)return null;if(n.hasOwnProperty("ttl")&&r){var i=1e3*parseFloat(n.ttl);if(r.getTime()+i<=(new Date).getTime())return null}return n.__text},getManifestUpdatePeriod:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.getManifestUpdatePeriod(e,n)},getPublishTime:function(e){return t.getPublishTime(e)},getIsDVB:function(e){return t.hasProfile(e,"urn:dvb:dash:profile:dvb-dash:2014")},getIsPatch:function(e){return n.getIsPatch(e)},getBaseURLsFromElement:function(e){return t.getBaseURLsFromElement(e)},getRepresentationSortFunction:function(){return t.getRepresentationSortFunction()},getCodec:function(e,n,r){return t.getCodec(e,n,r)},getPeriodById:function(e){if(!e||0===u.length)return null;var t=u.filter((function(t){return t.id===e}));return t&&t.length>0?t[0]:null},setCurrentMediaInfo:function(e,t,n){f[e]=f[e]||{},f[e][t]=f[e][t]||{},f[e][t]=n},isPatchValid:function(e,r){var i=t.getId(e),a=n.getMpdId(r),s=t.getPublishTime(e),o=n.getPublishTime(r),l=n.getOriginalPublishTime(r);return!!(i&&a&&i==a&&s&&l&&s.getTime()==l.getTime()&&o&&s.getTime()<o.getTime())},applyPatchToManifest:function(e,t){n.getPatchOperations(t).forEach((function(t){var n=t.getMpdTarget(e);if(null!==n){var r=n.name,i=n.target,a=n.leaf;if(t.xpath.findsAttribute())switch(t.action){case"add":case"replace":i[r]=t.value;break;case"remove":delete i[r]}else{var s=(i[r+"_asArray"]||[]).indexOf(a),o="prepend"===t.position||"before"===t.position;if(("remove"===t.action||"replace"===t.action)&&(delete i[r],-1!=s)){var l=i[r+"_asArray"];l.splice(s,1),l.length>1?i[r]=l:1==l.length?i[r]=l[0]:delete i[r+"_asArray"]}"add"!==t.action&&"replace"!==t.action||Object.keys(t.value).forEach((function(e){var n=t.value[e],a=i[e+"_asArray"]||[];if(0===a.length&&i[e]&&a.push(i[e]),0===a.length)a=n;else{var l=a.length;l=e==r&&-1!=s?s+(o?0:1)+("replace"==t.action?-1:0):o?0:a.length,a.splice.apply(a,[l,0].concat(n))}i[e+"_asArray"]=a,i[e]=1==a.length?a[0]:a}))}}}))},areMediaInfosEqual:y,reset:b},t=Object(c.default)(g).getInstance(),n=Object(d.default)(g).getInstance(),b(),e}f.__dashjs_factory_name="DashAdapter",t.default=u.default.getSingletonFactory(f)},"./src/dash/DashHandler.js":function(e,t,n){n.r(t);var r=n("./src/streaming/vo/FragmentRequest.js"),i=n("./src/streaming/vo/metrics/HTTPRequest.js"),a=n("./src/core/FactoryMaker.js"),s=n("./src/streaming/MediaPlayerEvents.js"),o=n("./src/dash/utils/SegmentsUtils.js"),l=n("./src/dash/constants/DashConstants.js");function u(e){var t,n,a,u,c,d=(e=e||{}).eventBus,f=e.debug,h=e.urlUtils,p=e.type,g=e.streamInfo,m=e.segmentsController,y=e.timelineConverter,v=e.baseURLController;function _(){return p}function T(){a=null}function E(e,t,n){var r,i,a=v.resolve(n.path);return a&&t!==a.url&&h.isRelative(t)?(r=a.url,i=a.serviceLocation,t&&(r=h.resolve(t,r))):r=t,!h.isRelative(r)&&(e.url=r,e.serviceLocation=i,!0)}function b(e,t){if(null==t)return null;var n=new r.default,a=t.representation,s=a.adaptation.period.mpd.manifest.Period_asArray[a.adaptation.period.index].AdaptationSet_asArray[a.adaptation.index].Representation_asArray[a.index].bandwidth,l=t.media;return l=Object(o.replaceTokenForTemplate)(l,"Number",t.replacementNumber),l=Object(o.replaceTokenForTemplate)(l,"Time",t.replacementTime),l=Object(o.replaceTokenForTemplate)(l,"Bandwidth",s),l=Object(o.replaceIDForTemplate)(l,a.id),l=Object(o.unescapeDollarsInTemplate)(l),n.mediaType=_(),n.type=i.HTTPRequest.MEDIA_SEGMENT_TYPE,n.range=t.mediaRange,n.startTime=t.presentationStartTime,n.mediaStartTime=t.mediaStartTime,n.duration=t.duration,n.timescale=a.timescale,n.availabilityStartTime=t.availabilityStartTime,n.availabilityEndTime=t.availabilityEndTime,n.wallStartTime=t.wallStartTime,n.quality=a.index,n.index=t.index,n.mediaInfo=e,n.adaptationIndex=a.adaptation.index,n.representationId=a.id,E(n,l,a)?n:void 0}function S(e,t,r){var i=null;if(!t||!t.segmentInfoType)return i;var s=m.getSegmentByTime(t,r);return s&&(a=s,n.debug("Index for time "+r+" is "+s.index),i=b(e,s)),i}function A(){n.debug("Dynamic stream complete"),c=!0}return t={initialize:function(e){u=e,c=!1,m.initialize(e)},getStreamId:function(){return g.id},getType:_,getStreamInfo:function(){return g},getInitRequest:function(e,t){return t?function(e,t,n){var a=new r.default,s=t.adaptation.period,l=s.start;if(a.mediaType=n,a.type=i.HTTPRequest.INIT_SEGMENT_TYPE,a.range=t.range,a.availabilityStartTime=y.calcAvailabilityStartTimeFromPresentationTime(l,t,u),a.availabilityEndTime=y.calcAvailabilityEndTimeFromPresentationTime(l+s.duration,t,u),a.quality=t.index,a.mediaInfo=e,a.representationId=t.id,E(a,t.initialization,t))return a.url=Object(o.replaceTokenForTemplate)(a.url,"Bandwidth",t.bandwidth),a}(e,t,_()):null},getSegmentRequestForTime:S,getCurrentIndex:function(){return a?a.index:-1},getNextSegmentRequest:function(e,t){var r=null;if(!t||!t.segmentInfoType)return null;var i=a?a.index+1:0,s=m.getSegmentByIndex(t,i,a?a.mediaStartTime:-1);if(s)r=b(e,s),a=s;else{if(u&&!c)return n.debug(_()+" No segment found at index: "+i+". Wait for next loop"),null;c=!0}return r},isLastSegmentRequested:function(e,t){if(!e||!a)return!1;if(c)return!0;if(!isFinite(e.adaptation.period.duration))return!1;if(a.presentationStartTime+a.duration>t)return!1;if(e.mediaFinishedInformation&&!isNaN(e.mediaFinishedInformation.numberOfSegments)&&!isNaN(a.index)&&a.index>=e.mediaFinishedInformation.numberOfSegments-1){if(!u||e.segmentInfoType===l.default.SEGMENT_TEMPLATE)return!0;if(u&&e.segmentInfoType===l.default.SEGMENT_LIST&&e.adaptation.period.nextPeriodId)return!0}return!!(u&&e.adaptation.period.nextPeriodId&&e.segmentInfoType===l.default.SEGMENT_TIMELINE&&e.mediaFinishedInformation&&!isNaN(e.mediaFinishedInformation.mediaTimeOfLastSignaledSegment)&&a&&!isNaN(a.mediaStartTime)&&!isNaN(a.duration)&&a.mediaStartTime+a.duration>=e.mediaFinishedInformation.mediaTimeOfLastSignaledSegment-.05)},reset:function(){T(),d.off(s.default.DYNAMIC_TO_STATIC,A,t)},getNextSegmentRequestIdempotent:function(e,t){var n=a?a.index+1:0,r=m.getSegmentByIndex(t,n,a?a.mediaStartTime:-1);return r?b(e,r):null},getValidSeekTimeCloseToTargetTime:function(e,t,n,r){try{if(isNaN(e)||!t||!n)return NaN;if(e<0&&(e=0),isNaN(r)&&(r=.5),S(t,n,e))return e;for(var i=n.adaptation.period.start,a=n.adaptation.period.start+n.adaptation.period.duration,s=Math.min(e+r,a),o=Math.max(e-r,i),l=NaN,u=null;s<=a||o>=i;){var c=null,d=null;if(s<=a&&(c=S(t,n,s)),o>=i&&(d=S(t,n,o)),d){l=o,u=d;break}if(c){l=s,u=c;break}s+=r,o-=r}if(u){var f=u.startTime+u.duration;return e>=u.startTime&&f-e>r?e:e<u.startTime?u.startTime:Math.min(f-r,l)}return l}catch(e){return NaN}}},n=f.getLogger(t),T(),d.on(s.default.DYNAMIC_TO_STATIC,A,t),t}u.__dashjs_factory_name="DashHandler",t.default=a.default.getClassFactory(u)},"./src/dash/DashMetrics.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/streaming/vo/metrics/HTTPRequest.js"),a=n("./src/core/FactoryMaker.js"),s=n("./src/streaming/constants/MetricsConstants.js"),o=n("./src/dash/utils/Round10.js"),l=n("./src/streaming/models/MetricsModel.js"),u=n("./src/core/Utils.js"),c=n("./src/streaming/vo/metrics/PlayList.js");function d(e){e=e||{};var t,n,a,d,f=this.context,h=e.metricsModel;function p(e){var t=h.getMetricsFor(e,!0);if(!t)return null;var n,r=t.HttpList,i=null;if(!r||r.length<=0)return null;for(n=r.length-1;n>=0;){if(r[n].responsecode){i=r[n];break}n--}return i}function g(e){var t=h.getMetricsFor(e,!0);return t&&t.HttpList?t.HttpList:[]}function m(e,t){if(!e)return null;var n=e[t];return n&&0!==n.length?n[n.length-1]:null}return t={getCurrentRepresentationSwitch:function(e){return m(h.getMetricsFor(e,!0),s.default.TRACK_SWITCH)},getCurrentBufferState:function(e){return m(h.getMetricsFor(e,!0),s.default.BUFFER_STATE)},getCurrentBufferLevel:function(e){var t=m(h.getMetricsFor(e,!0),s.default.BUFFER_LEVEL);return t?o.default.round10(t.level/1e3,-3):0},getCurrentHttpRequest:p,getHttpRequests:g,getCurrentDroppedFrames:function(){return m(h.getMetricsFor(r.default.VIDEO,!0),s.default.DROPPED_FRAMES)},getCurrentSchedulingInfo:function(e){return m(h.getMetricsFor(e,!0),s.default.SCHEDULING_INFO)},getCurrentDVRInfo:function(e){return m(e?h.getMetricsFor(e,!0):h.getMetricsFor(r.default.VIDEO,!0)||h.getMetricsFor(r.default.AUDIO,!0),s.default.DVR_INFO)},getCurrentManifestUpdate:function(){return m(h.getMetricsFor(r.default.STREAM),s.default.MANIFEST_UPDATE)},getLatestFragmentRequestHeaderValueByID:function(e,t){if(!t)return null;var n={},r=p(e);r&&(n=u.default.parseHttpHeaders(r._responseHeaders));var i=n[t.toLowerCase()];return void 0===i?null:i},getLatestMPDRequestHeaderValueByID:function(e){if(!e)return null;var t,n,a,s={};for(a=(t=g(r.default.STREAM)).length-1;a>=0;a--)if((n=t[a]).type===i.HTTPRequest.MPD_TYPE){s=u.default.parseHttpHeaders(n._responseHeaders);break}var o=s[e.toLowerCase()];return void 0===o?null:o},addRepresentationSwitch:function(e,t,n,r,i){h.addRepresentationSwitch(e,t,n,r,i)},addDVRInfo:function(e,t,n,r){h.addDVRInfo(e,t,n,r)},updateManifestUpdateInfo:function(e){var t=this.getCurrentManifestUpdate();h.updateManifestUpdateInfo(t,e)},addManifestUpdateStreamInfo:function(e){if(e){var t=this.getCurrentManifestUpdate();h.addManifestUpdateStreamInfo(t,e.id,e.index,e.start,e.duration)}},addManifestUpdateRepresentationInfo:function(e,t){if(e){var n=this.getCurrentManifestUpdate();h.addManifestUpdateRepresentationInfo(n,e.id,e.index,e.streamIndex,t,e.presentationTimeOffset,e.startNumber,e.fragmentInfoType)}},addManifestUpdate:function(e){h.addManifestUpdate(r.default.STREAM,e.type,e.requestStartDate,e.requestEndDate)},addHttpRequest:function(e,t,n,r,i){h.addHttpRequest(e.mediaType,null,e.type,e.url,e.quality,t,e.serviceLocation||null,e.range||null,e.requestStartDate,e.firstByteDate,e.requestEndDate,n,e.duration,r,i)},addSchedulingInfo:function(e,t){h.addSchedulingInfo(e.mediaType,new Date,e.type,e.startTime,e.availabilityStartTime,e.duration,e.quality,e.range,t)},addRequestsQueue:function(e,t,n){h.addRequestsQueue(e,t,n)},addBufferLevel:function(e,t,n){h.addBufferLevel(e,t,n)},addBufferState:function(e,t,n){h.addBufferState(e,t,n)},addDroppedFrames:function(e){h.addDroppedFrames(r.default.VIDEO,e)},addPlayList:function(){d&&(h.addPlayList(d),d=null)},addDVBErrors:function(e){h.addDVBErrors(e)},createPlaylistMetrics:function(e,t){(d=new c.PlayList).start=new Date,d.mstart=e,d.starttype=t},createPlaylistTraceMetrics:function(e,t,r){!0===n&&(n=!1,(a=new c.PlayListTrace).representationid=e,a.start=new Date,a.mstart=t,a.playbackspeed=null!==r?r.toString():null)},updatePlayListTraceMetrics:function(e){if(a)for(var t in a)a[t]=e[t]},pushPlayListTraceMetrics:function(e,t){if(!1===n&&d&&a&&a.start){var r=a.start,i=e.getTime()-r.getTime();a.duration=i,a.stopreason=t,d.trace.push(a),n=!0}},clearAllCurrentMetrics:function(){h.clearAllCurrentMetrics()}},h=h||Object(l.default)(f).getInstance({settings:e.settings}),n=!0,a=null,d=null,t}d.__dashjs_factory_name="DashMetrics",t.default=a.default.getSingletonFactory(d)},"./src/dash/SegmentBaseLoader.js":function(e,t,n){n.r(t);var r=n("./src/dash/vo/Segment.js"),i=n("./src/streaming/vo/DashJSError.js"),a=n("./src/core/FactoryMaker.js"),s=n("./src/streaming/vo/FragmentRequest.js"),o=n("./src/streaming/net/URLLoader.js");function l(){var e,t,n,a,l,u,c,d,f,h,p,g,m,y=this.context;function v(e,n,r,i){var s=null,o=e?m.resolve(e.path):null,l=i||{init:!0,url:o?o.url:void 0,range:{start:0,end:1500},searching:!1,bytesLoaded:0,bytesToLoad:1500,mediaType:n};t.debug("Start searching for initialization.");var u=E(l);d.load({request:u,success:function(t){if(l.bytesLoaded=l.range.end,!(s=a.findInitRange(t)))return l.range.end=l.bytesLoaded+l.bytesToLoad,v(e,n,r,l);e.range=s,r(e)},error:function(){r(e)}}),t.debug("Perform init search: "+l.url)}function _(e,n,i,s,o,l){if(i&&(void 0===i.start||void 0===i.end)){var u=i?i.toString().split("-"):null;i=u?{start:parseFloat(u[0]),end:parseFloat(u[1])}:null}o=o||T;var c=null,f=null,h=!!i,p=e?m.resolve(e.path):null,g={init:!1,url:p?p.url:void 0,range:h?i:{start:0,end:1500},searching:!h,bytesLoaded:l?l.bytesLoaded:0,bytesToLoad:1500,mediaType:n},y=E(g);d.load({request:y,success:function(i){var l=g.bytesToLoad,u=i.byteLength;if(g.bytesLoaded=g.range.end-g.range.start,c=a.parse(i),(f=c.getBox("sidx"))&&f.isComplete){var d,h,p=f.references;if(null!=p&&p.length>0&&(d=1===p[0].reference_type),d){var m,y,v,T;t.debug("Initiate multiple SIDX load."),g.range.end=g.range.start+f.size;var E=[],b=0,S=(f.offset||g.range.start)+f.size,A=function(t){t?(E=E.concat(t),++b>=y&&(E.sort((function(e,t){return e.startTime-t.startTime<0?-1:0})),o(E,e,s))):o(null,e,s)};for(m=0,y=p.length;m<y;m++)v=S,T=S+p[m].referenced_size-1,S+=p[m].referenced_size,_(e,n,{start:v,end:T},s,A,g)}else t.debug("Parsing segments from SIDX. representation "+n+" - id: "+e.id+" for range : "+g.range.start+" - "+g.range.end),h=function(e,t){for(var n,i,a,s,o=e.references,l=o.length,u=e.timescale,c=e.earliest_presentation_time,d=t.range.start+e.offset+e.first_offset+e.size,f=[],h=0;h<l;h++)a=o[h].subsegment_duration,s=o[h].referenced_size,(n=new r.default).duration=a,n.startTime=c,n.timescale=u,i=d+s-1,n.mediaRange=d+"-"+i,f.push(n),c+=a,d+=s;return f}(f,g),o(h,e,s)}else{if(f)g.range.start=f.offset||g.range.start,g.range.end=g.range.start+(f.size||l);else{if(u<g.bytesLoaded)return void o(null,e,s);var w=c.getLastBox();w&&w.size?(g.range.start=w.offset+w.size,g.range.end=g.range.start+l):g.range.end+=l}_(e,n,g.range,s,null,g)}},error:function(){o(null,e,s)}}),t.debug("Perform SIDX load for type ".concat(n," : ").concat(g.url," with range ").concat(g.range.start," - ").concat(g.range.end))}function T(e,t,n){n({segments:e,representation:t,error:e?void 0:new i.default(f.SEGMENT_BASE_LOADER_ERROR_CODE,f.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}function E(e){if(e.url){var t=new s.default;return t.setInfo(e),t}}return e={setConfig:function(r){r.baseURLController&&(m=r.baseURLController),r.dashMetrics&&(u=r.dashMetrics),r.mediaPlayerModel&&(c=r.mediaPlayerModel),r.errHandler&&(n=r.errHandler),r.boxParser&&(a=r.boxParser),r.debug&&(t=r.debug.getLogger(e)),r.requestModifier&&(l=r.requestModifier),r.errors&&(f=r.errors),r.urlUtils&&(g=r.urlUtils),r.constants&&(h=r.constants),r.dashConstants&&(p=r.dashConstants)},initialize:function(){d=Object(o.default)(y).create({errHandler:n,dashMetrics:u,mediaPlayerModel:c,requestModifier:l,boxParser:a,errors:f,urlUtils:g,constants:h,dashConstants:p})},loadInitialization:function(e,t){return new Promise((function(n){v(e,t,n)}))},loadSegments:function(e,t,n){return new Promise((function(r){_(e,t,n,r)}))},reset:function(){d&&(d.abort(),d=null)}}}l.__dashjs_factory_name="SegmentBaseLoader",t.default=a.default.getSingletonFactory(l)},"./src/dash/WebmSegmentBaseLoader.js":function(e,t,n){n.r(t);var r=n("./src/streaming/utils/EBMLParser.js"),i=n("./src/streaming/constants/Constants.js"),a=n("./src/core/FactoryMaker.js"),s=n("./src/dash/vo/Segment.js"),o=n("./src/streaming/vo/FragmentRequest.js"),l=n("./src/streaming/net/URLLoader.js"),u=n("./src/streaming/vo/DashJSError.js");function c(){var e,t,n,a,c,d,f,h,p,g,m=this.context;function y(e,i,a,o){var l,u,c,d,f,h,p,g;for(c=[],f=0,h=(u=function(e){var t,i,a=[],s=Object(r.default)(m).create({data:e});for(s.consumeTagAndSize(n.Segment.Cues);s.moreData()&&s.consumeTagAndSize(n.Segment.Cues.CuePoint,!0);){for((t={}).CueTime=s.parseTag(n.Segment.Cues.CuePoint.CueTime),t.CueTracks=[];s.moreData()&&s.consumeTag(n.Segment.Cues.CuePoint.CueTrackPositions,!0);){var o=s.getMatroskaCodedNum(),l=s.getPos();if((i={}).Track=s.parseTag(n.Segment.Cues.CuePoint.CueTrackPositions.CueTrack),0===i.Track)throw new Error("Cue track cannot be 0");i.ClusterPosition=s.parseTag(n.Segment.Cues.CuePoint.CueTrackPositions.CueClusterPosition),t.CueTracks.push(i),s.setPos(l+o)}if(0===t.CueTracks.length)throw new Error("Mandatory cuetrack not found");a.push(t)}if(0===a.length)throw new Error("mandatory cuepoint not found");return a}(e)).length;f<h;f+=1)d=new s.default,l=0,l=f<u.length-1?u[f+1].CueTime-u[f].CueTime:o-u[f].CueTime,d.duration=l,d.startTime=u[f].CueTime,d.timescale=1e3,p=u[f].CueTracks[0].ClusterPosition+i,g=f<u.length-1?u[f+1].CueTracks[0].ClusterPosition+i-1:a-1,d.mediaRange=p+"-"+g,c.push(d);return t.debug("Parsed cues: "+c.length+" cues."),c}function v(e){var t=new o.default;return t.setInfo(e),t}return e={setConfig:function(n){if(!(n.baseURLController&&n.dashMetrics&&n.mediaPlayerModel&&n.errHandler))throw new Error(i.default.MISSING_CONFIG_ERROR);g=n.baseURLController,d=n.dashMetrics,f=n.mediaPlayerModel,a=n.errHandler,p=n.errors,t=n.debug.getLogger(e),c=n.requestModifier},initialize:function(){h=Object(l.default)(m).create({errHandler:a,dashMetrics:d,mediaPlayerModel:f,requestModifier:c,errors:p})},loadInitialization:function(e,n){return new Promise((function(r){var i=null,a=e?g.resolve(e.path):null,s=e?e.range.split("-"):null,o={range:{start:s?parseFloat(s[0]):null,end:s?parseFloat(s[1]):null},request:i,url:a?a.url:void 0,init:!0,mediaType:n};t.info("Start loading initialization."),i=v(o),h.load({request:i,success:function(){r(e)},error:function(){r(e)}}),t.debug("Perform init load: "+o.url)}))},loadSegments:function(e,i,a){return new Promise((function(s){var o=null,l=e?g.resolve(e.path):null,c=l?l.url:void 0;o=v({bytesLoaded:0,bytesToLoad:8192,range:{start:0,end:8192},request:o,url:c,init:!1,mediaType:i}),t.debug("Parsing ebml header"),h.load({request:o,success:function(i){!function(e,i,a,s){if(e&&0!==e.byteLength){var o,l,u,c,d=Object(r.default)(m).create({data:e}),f=a?a.split("-"):null,p=null,g={url:i,range:{start:f?parseFloat(f[0]):null,end:f?parseFloat(f[1]):null},request:p};for(t.debug("Parse EBML header: "+g.url),d.skipOverElement(n.EBML),d.consumeTag(n.Segment),u=d.getMatroskaCodedNum(),u+=d.getPos(),c=d.getPos();d.moreData()&&!d.consumeTagAndSize(n.Segment.Info,!0);)if(!(d.skipOverElement(n.Segment.SeekHead,!0)||d.skipOverElement(n.Segment.Tracks,!0)||d.skipOverElement(n.Segment.Cues,!0)||d.skipOverElement(n.Void,!0)))throw new Error("no valid top level element found");for(;void 0===o;){var _=d.getMatroskaCodedNum(!0),T=d.getMatroskaCodedNum();_===n.Segment.Info.Duration.tag?o=d[n.Segment.Info.Duration.parse](T):d.setPos(d.getPos()+T)}p=v(g),h.load({request:p,success:function(e){l=y(e,c,u,o),s(l)},error:function(){t.error("Download Error: Cues "+g.url),s(null)}}),t.debug("Perform cues load: "+g.url+" bytes="+g.range.start+"-"+g.range.end)}else s(null)}(i,c,a,(function(t){s({segments:t,representation:e,error:t?void 0:new u.default(p.SEGMENT_BASE_LOADER_ERROR_CODE,p.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}))},error:function(){s({representation:e,error:new u.default(p.SEGMENT_BASE_LOADER_ERROR_CODE,p.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}})}))},reset:function(){h&&(h.abort(),h=null)}},n={EBML:{tag:440786851,required:!0},Segment:{tag:408125543,required:!0,SeekHead:{tag:290298740,required:!0},Info:{tag:357149030,required:!0,TimecodeScale:{tag:2807729,required:!0,parse:"getMatroskaUint"},Duration:{tag:17545,required:!0,parse:"getMatroskaFloat"}},Tracks:{tag:374648427,required:!0},Cues:{tag:475249515,required:!0,CuePoint:{tag:187,required:!0,CueTime:{tag:179,required:!0,parse:"getMatroskaUint"},CueTrackPositions:{tag:183,required:!0,CueTrack:{tag:247,required:!0,parse:"getMatroskaUint"},CueClusterPosition:{tag:241,required:!0,parse:"getMatroskaUint"}}}}},Void:{tag:236,required:!0}},e}c.__dashjs_factory_name="WebmSegmentBaseLoader",t.default=a.default.getSingletonFactory(c)},"./src/dash/constants/DashConstants.js":function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(t);var i=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t,n,i;return t=e,(n=[{key:"init",value:function(){this.BASE_URL="BaseURL",this.SEGMENT_BASE="SegmentBase",this.SEGMENT_TEMPLATE="SegmentTemplate",this.SEGMENT_LIST="SegmentList",this.SEGMENT_URL="SegmentURL",this.SEGMENT_TIMELINE="SegmentTimeline",this.SEGMENT_PROFILES="segmentProfiles",this.ADAPTATION_SET="AdaptationSet",this.REPRESENTATION="Representation",this.REPRESENTATION_INDEX="RepresentationIndex",this.SUB_REPRESENTATION="SubRepresentation",this.INITIALIZATION="Initialization",this.INITIALIZATION_MINUS="initialization",this.MPD="MPD",this.PERIOD="Period",this.ASSET_IDENTIFIER="AssetIdentifier",this.EVENT_STREAM="EventStream",this.ID="id",this.PROFILES="profiles",this.SERVICE_LOCATION="serviceLocation",this.RANGE="range",this.INDEX="index",this.MEDIA="media",this.BYTE_RANGE="byteRange",this.INDEX_RANGE="indexRange",this.MEDIA_RANGE="mediaRange",this.VALUE="value",this.CONTENT_TYPE="contentType",this.MIME_TYPE="mimeType",this.BITSTREAM_SWITCHING="BitstreamSwitching",this.BITSTREAM_SWITCHING_MINUS="bitstreamSwitching",this.CODECS="codecs",this.DEPENDENCY_ID="dependencyId",this.MEDIA_STREAM_STRUCTURE_ID="mediaStreamStructureId",this.METRICS="Metrics",this.METRICS_MINUS="metrics",this.REPORTING="Reporting",this.WIDTH="width",this.HEIGHT="height",this.SAR="sar",this.FRAMERATE="frameRate",this.AUDIO_SAMPLING_RATE="audioSamplingRate",this.MAXIMUM_SAP_PERIOD="maximumSAPPeriod",this.START_WITH_SAP="startWithSAP",this.MAX_PLAYOUT_RATE="maxPlayoutRate",this.CODING_DEPENDENCY="codingDependency",this.SCAN_TYPE="scanType",this.FRAME_PACKING="FramePacking",this.AUDIO_CHANNEL_CONFIGURATION="AudioChannelConfiguration",this.CONTENT_PROTECTION="ContentProtection",this.ESSENTIAL_PROPERTY="EssentialProperty",this.SUPPLEMENTAL_PROPERTY="SupplementalProperty",this.INBAND_EVENT_STREAM="InbandEventStream",this.ACCESSIBILITY="Accessibility",this.ROLE="Role",this.RATING="Rating",this.CONTENT_COMPONENT="ContentComponent",this.SUBSET="Subset",this.LANG="lang",this.VIEWPOINT="Viewpoint",this.ROLE_ASARRAY="Role_asArray",this.ACCESSIBILITY_ASARRAY="Accessibility_asArray",this.AUDIOCHANNELCONFIGURATION_ASARRAY="AudioChannelConfiguration_asArray",this.CONTENTPROTECTION_ASARRAY="ContentProtection_asArray",this.MAIN="main",this.DYNAMIC="dynamic",this.STATIC="static",this.MEDIA_PRESENTATION_DURATION="mediaPresentationDuration",this.MINIMUM_UPDATE_PERIOD="minimumUpdatePeriod",this.CODEC_PRIVATE_DATA="codecPrivateData",this.BANDWITH="bandwidth",this.SOURCE_URL="sourceURL",this.TIMESCALE="timescale",this.DURATION="duration",this.START_NUMBER="startNumber",this.PRESENTATION_TIME_OFFSET="presentationTimeOffset",this.AVAILABILITY_START_TIME="availabilityStartTime",this.AVAILABILITY_END_TIME="availabilityEndTime",this.TIMESHIFT_BUFFER_DEPTH="timeShiftBufferDepth",this.MAX_SEGMENT_DURATION="maxSegmentDuration",this.PRESENTATION_TIME="presentationTime",this.MIN_BUFFER_TIME="minBufferTime",this.MAX_SUBSEGMENT_DURATION="maxSubsegmentDuration",this.START="start",this.AVAILABILITY_TIME_OFFSET="availabilityTimeOffset",this.AVAILABILITY_TIME_COMPLETE="availabilityTimeComplete",this.CENC_DEFAULT_KID="cenc:default_KID",this.DVB_PRIORITY="dvb:priority",this.DVB_WEIGHT="dvb:weight",this.SUGGESTED_PRESENTATION_DELAY="suggestedPresentationDelay",this.SERVICE_DESCRIPTION="ServiceDescription",this.SERVICE_DESCRIPTION_SCOPE="Scope",this.SERVICE_DESCRIPTION_LATENCY="Latency",this.SERVICE_DESCRIPTION_PLAYBACK_RATE="PlaybackRate",this.PATCH_LOCATION="PatchLocation",this.PUBLISH_TIME="publishTime",this.ORIGINAL_PUBLISH_TIME="originalPublishTime",this.ORIGINAL_MPD_ID="mpdId"}}])&&r(t.prototype,n),i&&r(t,i),e}());t.default=i},"./src/dash/controllers/RepresentationController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/core/FactoryMaker.js"),a=n("./src/streaming/MediaPlayerEvents.js"),s=n("./src/dash/utils/SegmentsUtils.js");function o(e){var t,n,i,o,l,u=(e=e||{}).eventBus,c=e.events,d=e.abrController,f=e.dashMetrics,h=e.playbackController,p=e.timelineConverter,g=e.type,m=e.streamInfo,y=e.dashConstants,v=e.segmentsController,_=e.isDynamic;function T(){return g}function E(){if(!(d&&f&&h&&p))throw new Error(r.default.MISSING_CONFIG_ERROR)}function b(){return i}function S(){return l}function A(){n=null,i=!0,o=[]}function w(e){return new Promise((function(t,n){var r=e.hasInitialization(),i=e.hasSegments(),a=[];a.push(v.updateInitData(e,r)),a.push(v.updateSegmentData(e,i)),Promise.all(a).then((function(n){var r;n[0]&&!n[0].error&&(e=function(e,t){return t&&!t.error&&t.representation?t.representation:e}(e,n[0])),n[1]&&!n[1].error&&(e=function(e,t){if(t&&!t.error){var n,r,i,a,o=t.segments,l=[],u=0;for(n=0,r=o?o.length:0;n<r;n++)i=o[n],(a=Object(s.getTimeBasedSegment)(p,_,e,i.startTime,i.duration,i.timescale,i.media,i.mediaRange,u))&&(l.push(a),a=null,u++);return l.length>0&&(e.segments=l),e}}(e,n[1])),(r=e).mediaFinishedInformation=v.getMediaFinishedInformation(r),function(e){if(b()){var t,n,r=f.getCurrentManifestUpdate(),i=!1;if(r){for(var a=0;a<r.representationInfo.length;a++)if((t=r.representationInfo[a]).index===e.index&&t.mediaType===T()){i=!0;break}i||f.addManifestUpdateRepresentationInfo(e,T())}if(function(){for(var e=0,t=o.length;e<t;e++){var n=o[e].segmentInfoType;if(!o[e].hasInitialization()||(n===y.SEGMENT_BASE||n===y.BASE_URL)&&!o[e].segments)return!1}return!0}()){d.setPlaybackQuality(g,m,(n=l,o.indexOf(n)));var s=f.getCurrentDVRInfo(g);s&&f.updateManifestUpdateInfo({latency:s.range.end-h.getTime()}),f.getCurrentRepresentationSwitch(S().adaptation.type)||I(),R()}}}(e),t()})).catch((function(e){n(e)}))}))}function I(){E();var e=new Date,t=S(),n=1e3*h.getTime();t&&f.addRepresentationSwitch(t.adaptation.type,e,n,t.id),u.trigger(a.default.REPRESENTATION_SWITCH,{mediaType:g,streamId:m.id,currentRepresentation:t,numberOfRepresentations:o.length},{streamId:m.id,mediaType:g})}function C(e){return null==e||e>=o.length?null:o[e]}function R(e){i=!1,u.trigger(c.DATA_UPDATE_COMPLETED,{data:n,currentRepresentation:l,error:e},{streamId:m.id,mediaType:g})}function D(e){l=e}function N(e){if(e.newDuration){var t=S();t&&t.adaptation.period&&(t.adaptation.period.duration=e.newDuration)}}return t={getStreamId:function(){return m.id},getType:T,getData:function(){return n},isUpdating:b,updateData:function(e,t,a,s,l){if(E(),i=!0,o=t,D(C(l)),n=e,a!==r.default.VIDEO&&a!==r.default.AUDIO&&(a!==r.default.TEXT||!s))return R(),Promise.resolve();for(var u=[],c=0,d=o.length;c<d;c++){var f=o[c];u.push(w(f))}return Promise.all(u)},getCurrentRepresentation:S,getRepresentationForQuality:C,prepareQualityChange:function(e){D(C(e)),I()},reset:function(){u.off(a.default.MANIFEST_VALIDITY_CHANGED,N,t),A()}},A(),u.on(a.default.MANIFEST_VALIDITY_CHANGED,N,t),t}o.__dashjs_factory_name="RepresentationController",t.default=i.default.getClassFactory(o)},"./src/dash/controllers/SegmentBaseController.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/dash/SegmentBaseLoader.js"),a=n("./src/dash/WebmSegmentBaseLoader.js");function s(e){e=e||{};var t,n,r,s=this.context,o=e.eventBus,l=e.events,u=e.dashMetrics,c=e.mediaPlayerModel,d=e.errHandler,f=e.baseURLController,h=e.debug,p=e.boxParser,g=e.requestModifier,m=e.errors;function y(e){return"webm"===(e?e.split("/")[1]:"").toLowerCase()}return t={initialize:function(){n.initialize(),r.initialize()},getSegmentBaseInitSegment:function(e){return y(e.representation.mimeType)?r.loadInitialization(e.representation,e.mediaType):n.loadInitialization(e.representation,e.mediaType)},getSegmentList:function(e){return y(e.mimeType)?r.loadSegments(e.representation,e.mediaType,e.representation?e.representation.indexRange:null):n.loadSegments(e.representation,e.mediaType,e.representation?e.representation.indexRange:null)},reset:function(){n.reset(),r.reset()}},n=Object(i.default)(s).getInstance(),r=Object(a.default)(s).getInstance(),n.setConfig({baseURLController:f,dashMetrics:u,mediaPlayerModel:c,errHandler:d,eventBus:o,events:l,errors:m,debug:h,boxParser:p,requestModifier:g}),r.setConfig({baseURLController:f,dashMetrics:u,mediaPlayerModel:c,errHandler:d,eventBus:o,events:l,errors:m,debug:h,requestModifier:g}),t}s.__dashjs_factory_name="SegmentBaseController";var o=r.default.getSingletonFactory(s);t.default=o},"./src/dash/controllers/SegmentsController.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/dash/utils/TimelineSegmentsGetter.js"),a=n("./src/dash/utils/TemplateSegmentsGetter.js"),s=n("./src/dash/utils/ListSegmentsGetter.js"),o=n("./src/dash/utils/SegmentBaseGetter.js");function l(e){e=e||{};var t,n,r=this.context,l=e.dashConstants,u=e.type,c=e.segmentBaseController;function d(e){return e?e.segments?n[l.SEGMENT_BASE]:n[e.segmentInfoType]:null}return t={initialize:function(t){n[l.SEGMENT_TIMELINE]=Object(i.default)(r).create(e,t),n[l.SEGMENT_TEMPLATE]=Object(a.default)(r).create(e,t),n[l.SEGMENT_LIST]=Object(s.default)(r).create(e,t),n[l.SEGMENT_BASE]=Object(o.default)(r).create(e,t)},updateInitData:function(e,t){return t?Promise.resolve():c.getSegmentBaseInitSegment({representation:e,mediaType:u})},updateSegmentData:function(e,t){return t?Promise.resolve():c.getSegmentList({mimeType:e.mimeType,representation:e,mediaType:u})},getSegmentByIndex:function(e,t,n){var r=d(e);return r?r.getSegmentByIndex(e,t,n):null},getSegmentByTime:function(e,t){var n=d(e);return n?n.getSegmentByTime(e,t):null},getMediaFinishedInformation:function(e){var t=d(e);return t?t.getMediaFinishedInformation(e):{numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN}}},n={},t}l.__dashjs_factory_name="SegmentsController";var u=r.default.getClassFactory(l);t.default=u},"./src/dash/models/DashManifestModel.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/dash/constants/DashConstants.js"),a=n("./src/dash/vo/Representation.js"),s=n("./src/dash/vo/AdaptationSet.js"),o=n("./src/dash/vo/Period.js"),l=n("./src/dash/vo/Mpd.js"),u=n("./src/dash/vo/UTCTiming.js"),c=n("./src/dash/vo/Event.js"),d=n("./src/dash/vo/BaseURL.js"),f=n("./src/dash/vo/EventStream.js"),h=n("./src/streaming/utils/ObjectUtils.js"),p=n("./src/streaming/utils/URLUtils.js"),g=n("./src/core/FactoryMaker.js"),m=n("./src/core/Debug.js"),y=n("./src/streaming/vo/DashJSError.js"),v=n("./src/core/errors/Errors.js"),_=n("./src/streaming/thumbnail/ThumbnailTracks.js");function T(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?E(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function b(){var e,t,n,g,E=this.context,b=Object(p.default)(E).getInstance(),S=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function A(e,t){if(!e)throw new Error("adaptation is not defined");if(!t)throw new Error("type is not defined");if(e.Representation_asArray&&e.Representation_asArray.length){var n=L(e.Representation_asArray[0]);if(n&&n.length>0&&_.THUMBNAILS_SCHEME_ID_URIS.indexOf(n[0].schemeIdUri)>=0)return t===r.default.IMAGE}if(e.ContentComponent_asArray&&e.ContentComponent_asArray.length>0){if(e.ContentComponent_asArray.length>1)return t===r.default.MUXED;if(e.ContentComponent_asArray[0].contentType===t)return!0}var a=t===r.default.TEXT?new RegExp("(ttml|vtt|wvtt|stpp)"):new RegExp(t);if(e.Representation_asArray&&e.Representation_asArray.length){var s=e.Representation_asArray[0].codecs;if(a.test(s))return!0}if(e.hasOwnProperty(i.default.MIME_TYPE))return a.test(e.mimeType);if(e.Representation_asArray)for(var o,l=0;l<e.Representation_asArray.length;l++)if((o=e.Representation_asArray[l]).hasOwnProperty(i.default.MIME_TYPE))return a.test(o.mimeType);return!1}function w(e){if(!e)throw new Error("adaptation is not defined");if(e.hasOwnProperty(i.default.SEGMENT_TEMPLATE)||e.hasOwnProperty(i.default.SEGMENT_TIMELINE)||e.hasOwnProperty(i.default.SEGMENT_LIST)||e.hasOwnProperty(i.default.SEGMENT_BASE))return!0;if(e.Representation_asArray&&e.Representation_asArray.length>0){var t=e.Representation_asArray[0];if(t.hasOwnProperty(i.default.SEGMENT_TEMPLATE)||t.hasOwnProperty(i.default.SEGMENT_TIMELINE)||t.hasOwnProperty(i.default.SEGMENT_LIST)||t.hasOwnProperty(i.default.SEGMENT_BASE))return!0}return!1}function I(e){return A(e,r.default.AUDIO)}function C(e){return A(e,r.default.VIDEO)}function R(e){return A(e,r.default.TEXT)}function D(e){return A(e,r.default.IMAGE)}function N(){return function(e,t){return e.bandwidth-t.bandwidth}}function O(e){return e&&Array.isArray(e.Representation_asArray)&&e.Representation_asArray.sort((function(e,t){return e.bandwidth-t.bandwidth})),e}function P(e,t){return e&&e.Period_asArray&&S(t)&&e.Period_asArray[t]?e.Period_asArray[t].AdaptationSet_asArray:[]}function M(e){return e&&e.Period_asArray?e.Period_asArray:[]}function x(e){var t=!1;return e&&e.hasOwnProperty("type")&&(t=e.type===i.default.DYNAMIC),t}function L(e){return e&&e.EssentialProperty_asArray&&e.EssentialProperty_asArray.length?e.EssentialProperty_asArray.map((function(e){return{schemeIdUri:e.schemeIdUri,value:e.value}})):null}function k(e){if(!e||!e.S_asArray)return NaN;var t=e.S_asArray[0],n=e.S_asArray[1];return t.hasOwnProperty("d")?t.d:n.t-t.t}function F(e,t){if(!e)throw new Error("Period cannot be null or undefined");var n=o.default.DEFAULT_ID+"_"+t;return e.hasOwnProperty(i.default.ID)&&e.id.length>0&&"__proto__"!==e.id&&(n=e.id),n}function U(e,t){var n,a=[];if(!e)return a;for(n=0;n<e.length;n++){var s=new f.default;if(s.timescale=1,s.representation=t,!e[n].hasOwnProperty(r.default.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");s.schemeIdUri=e[n].schemeIdUri,e[n].hasOwnProperty(i.default.TIMESCALE)&&(s.timescale=e[n].timescale),e[n].hasOwnProperty(i.default.VALUE)&&(s.value=e[n].value),a.push(s)}return a}function B(e){var t=[],n=e.BaseURL_asArray||[e.baseUri],r=!1;return n.some((function(n){if(n){var a=new d.default,s=n.__text||n;return b.isRelative(s)&&(r=!0,e.baseUri&&(s=b.resolve(s,e.baseUri))),a.url=s,n.hasOwnProperty(i.default.SERVICE_LOCATION)&&n.serviceLocation.length?a.serviceLocation=n.serviceLocation:a.serviceLocation=s,n.hasOwnProperty(i.default.DVB_PRIORITY)&&(a.dvb_priority=n[i.default.DVB_PRIORITY]),n.hasOwnProperty(i.default.DVB_WEIGHT)&&(a.dvb_weight=n[i.default.DVB_WEIGHT]),n.hasOwnProperty(i.default.AVAILABILITY_TIME_OFFSET)&&(a.availabilityTimeOffset=n[i.default.AVAILABILITY_TIME_OFFSET]),n.hasOwnProperty(i.default.AVAILABILITY_TIME_COMPLETE)&&(a.availabilityTimeComplete="false"!==n[i.default.AVAILABILITY_TIME_COMPLETE]),t.push(a),r}})),t}return e={getIsTypeOf:A,getIsText:R,getIsFragmented:w,getLanguageForAdaptation:function(e){var t="";return e&&e.hasOwnProperty(i.default.LANG)&&(t=e.lang.replace(/[^A-Za-z0-9-]/g,"")),t},getViewpointForAdaptation:function(e){return e&&e.hasOwnProperty(i.default.VIEWPOINT)?e.Viewpoint:null},getRolesForAdaptation:function(e){return e&&e.hasOwnProperty(i.default.ROLE_ASARRAY)?e.Role_asArray:[]},getAccessibilityForAdaptation:function(e){return e&&e.hasOwnProperty(i.default.ACCESSIBILITY_ASARRAY)?e.Accessibility_asArray:[]},getAudioChannelConfigurationForAdaptation:function(e){return e&&e.hasOwnProperty(i.default.AUDIOCHANNELCONFIGURATION_ASARRAY)?e.AudioChannelConfiguration_asArray:[]},getAudioChannelConfigurationForRepresentation:function(e){return e&&e.hasOwnProperty(i.default.AUDIOCHANNELCONFIGURATION_ASARRAY)?e.AudioChannelConfiguration_asArray:[]},getAdaptationForIndex:function(e,t,n){var r=P(t,n);return r.length>0&&S(e)?r[e]:null},getIndexForAdaptation:function(e,t,n){if(!e)return-1;for(var r=P(t,n),i=0;i<r.length;i++)if(Object(h.default)(E).getInstance().areEqual(r[i],e))return i;return-1},getAdaptationForId:function(e,t,n){var r,a,s=P(t,n);for(r=0,a=s.length;r<a;r++)if(s[r].hasOwnProperty(i.default.ID)&&s[r].id===e)return s[r];return null},getAdaptationsForType:function(e,t,n){var r,i,a=P(e,t),s=[];for(r=0,i=a.length;r<i;r++)A(a[r],n)&&s.push(O(a[r]));return s},getRealPeriods:M,getRealPeriodForIndex:function(e,t){var n=M(t);return n.length>0&&S(e)?n[e]:null},getCodec:function(e,t,n){var r=null;if(e&&e.Representation_asArray&&e.Representation_asArray.length>0){var i=S(t)&&t>=0&&t<e.Representation_asArray.length?e.Representation_asArray[t]:e.Representation_asArray[0];i&&(r=i.mimeType+';codecs="'+i.codecs+'"',n&&void 0!==i.width&&(r+=';width="'+i.width+'";height="'+i.height+'"'))}return r&&(r=r.replace(/\sprofiles=[^;]*/g,"")),r},getSelectionPriority:function(e){try{var t=e&&void 0!==e.selectionPriority?parseInt(e.selectionPriority):1;return isNaN(t)?1:t}catch(e){return 1}},getMimeType:function(e){return e&&e.Representation_asArray&&e.Representation_asArray.length>0?e.Representation_asArray[0].mimeType:null},getKID:function(e){return e&&e.hasOwnProperty(i.default.CENC_DEFAULT_KID)?e[i.default.CENC_DEFAULT_KID]:null},getLabelsForAdaptation:function(e){if(!e||!Array.isArray(e.Label_asArray))return[];for(var t=[],n=0;n<e.Label_asArray.length;n++)t.push({lang:e.Label_asArray[n].lang,text:e.Label_asArray[n].__text||e.Label_asArray[n]});return t},getContentProtectionData:function(e){return e&&e.hasOwnProperty(i.default.CONTENTPROTECTION_ASARRAY)&&0!==e.ContentProtection_asArray.length?e.ContentProtection_asArray:null},getIsDynamic:x,getId:function(e){return e&&e[i.default.ID]||null},hasProfile:function(e,t){var n=!1;return e&&e.profiles&&e.profiles.length>0&&(n=-1!==e.profiles.indexOf(t)),n},getDuration:function(e){return e&&e.hasOwnProperty(i.default.MEDIA_PRESENTATION_DURATION)?e.mediaPresentationDuration:e&&"dynamic"==e.type?Number.POSITIVE_INFINITY:Number.MAX_SAFE_INTEGER||Number.MAX_VALUE},getBandwidth:function(e){return e&&e.bandwidth?e.bandwidth:NaN},getManifestUpdatePeriod:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=NaN;return e&&e.hasOwnProperty(i.default.MINIMUM_UPDATE_PERIOD)&&(n=e.minimumUpdatePeriod),isNaN(n)?n:Math.max(n-t,1)},getPublishTime:function(e){return e&&e.hasOwnProperty(i.default.PUBLISH_TIME)?new Date(e[i.default.PUBLISH_TIME]):null},getRepresentationCount:function(e){return e&&Array.isArray(e.Representation_asArray)?e.Representation_asArray.length:0},getBitrateListForAdaptation:function(e){var t=O(e);return(t&&Array.isArray(t.Representation_asArray)?t.Representation_asArray:[]).map((function(e){return{bandwidth:e.bandwidth,width:e.width||0,height:e.height||0,scanType:e.scanType||null,id:e.id||null}}))},getRepresentationFor:function(e,t){return t&&t.Representation_asArray&&t.Representation_asArray.length>0&&S(e)?t.Representation_asArray[e]:null},getRepresentationsForAdaptation:function(e){var t,n,r,s,o=[],l=function(e){if(e&&e.period&&S(e.period.index)){var t=e.period.mpd.manifest.Period_asArray[e.period.index];if(t&&t.AdaptationSet_asArray&&S(e.index))return O(t.AdaptationSet_asArray[e.index])}}(e);if(l&&l.Representation_asArray){if(e&&e.period&&S(e.period.index)){var u=B(e.period.mpd.manifest);u&&(n=u[0])}for(var c=0,d=l.Representation_asArray.length;c<d;++c){var f=l.Representation_asArray[c],h=new a.default;if(h.index=c,h.adaptation=e,f.hasOwnProperty(i.default.ID)&&(h.id=f.id),f.hasOwnProperty(i.default.CODECS)&&(h.codecs=f.codecs),f.hasOwnProperty(i.default.MIME_TYPE)&&(h.mimeType=f[i.default.MIME_TYPE]),f.hasOwnProperty(i.default.CODEC_PRIVATE_DATA)&&(h.codecPrivateData=f.codecPrivateData),f.hasOwnProperty(i.default.BANDWITH)&&(h.bandwidth=f.bandwidth),f.hasOwnProperty(i.default.WIDTH)&&(h.width=f.width),f.hasOwnProperty(i.default.HEIGHT)&&(h.height=f.height),f.hasOwnProperty(i.default.SCAN_TYPE)&&(h.scanType=f.scanType),f.hasOwnProperty(i.default.MAX_PLAYOUT_RATE)&&(h.maxPlayoutRate=f.maxPlayoutRate),f.hasOwnProperty(i.default.SEGMENT_BASE)?(t=f.SegmentBase,h.segmentInfoType=i.default.SEGMENT_BASE):f.hasOwnProperty(i.default.SEGMENT_LIST)?(t=f.SegmentList).hasOwnProperty(i.default.SEGMENT_TIMELINE)?h.segmentInfoType=i.default.SEGMENT_TIMELINE:h.segmentInfoType=i.default.SEGMENT_LIST:f.hasOwnProperty(i.default.SEGMENT_TEMPLATE)?((t=f.SegmentTemplate).hasOwnProperty(i.default.SEGMENT_TIMELINE)?h.segmentInfoType=i.default.SEGMENT_TIMELINE:h.segmentInfoType=i.default.SEGMENT_TEMPLATE,t.hasOwnProperty(i.default.INITIALIZATION_MINUS)&&(h.initialization=t.initialization.split("$Bandwidth$").join(f.bandwidth).split("$RepresentationID$").join(f.id))):h.segmentInfoType=i.default.BASE_URL,h.essentialProperties=L(f),t){if(t.hasOwnProperty(i.default.INITIALIZATION)){var p=t.Initialization;p.hasOwnProperty(i.default.SOURCE_URL)&&(h.initialization=p.sourceURL),p.hasOwnProperty(i.default.RANGE)&&(h.range=p.range)}else R(l)&&w(l)&&l.mimeType&&-1===l.mimeType.indexOf("application/mp4")&&(h.range=0);t.hasOwnProperty(i.default.TIMESCALE)&&(h.timescale=t.timescale),t.hasOwnProperty(i.default.DURATION)?h.segmentDuration=t.duration/h.timescale:f.hasOwnProperty(i.default.SEGMENT_TEMPLATE)&&(t=f.SegmentTemplate).hasOwnProperty(i.default.SEGMENT_TIMELINE)&&(h.segmentDuration=k(t.SegmentTimeline)/h.timescale),t.hasOwnProperty(i.default.MEDIA)&&(h.media=t.media),t.hasOwnProperty(i.default.START_NUMBER)&&(h.startNumber=t.startNumber),t.hasOwnProperty(i.default.INDEX_RANGE)&&(h.indexRange=t.indexRange),t.hasOwnProperty(i.default.PRESENTATION_TIME_OFFSET)&&(h.presentationTimeOffset=t.presentationTimeOffset/h.timescale),t.hasOwnProperty(i.default.AVAILABILITY_TIME_OFFSET)?h.availabilityTimeOffset=t.availabilityTimeOffset:n&&void 0!==n.availabilityTimeOffset&&(h.availabilityTimeOffset=n.availabilityTimeOffset),t.hasOwnProperty(i.default.AVAILABILITY_TIME_COMPLETE)?h.availabilityTimeComplete="false"!==t.availabilityTimeComplete:n&&void 0!==n.availabilityTimeComplete&&(h.availabilityTimeComplete=n.availabilityTimeComplete)}h.MSETimeOffset=(s=void 0,s=(r=h).presentationTimeOffset,r.adaptation.period.start-s),h.path=[e.period.index,e.index,c],o.push(h)}}return o},getAdaptationsForPeriod:function(e){var n,a,o,l=e&&S(e.index)?e.mpd.manifest.Period_asArray[e.index]:null,u=[];if(l&&l.AdaptationSet_asArray)for(o=0;o<l.AdaptationSet_asArray.length;o++)a=l.AdaptationSet_asArray[o],n=new s.default,a.hasOwnProperty(i.default.ID)&&(n.id=a.id),n.index=o,n.period=e,A(a,r.default.MUXED)?n.type=r.default.MUXED:I(a)?n.type=r.default.AUDIO:C(a)?n.type=r.default.VIDEO:R(a)?n.type=r.default.TEXT:D(a)?n.type=r.default.IMAGE:t.warn("Unknown Adaptation stream type"),u.push(n);return u},getRegularPeriods:function(e){var a,s,l=!!e&&x(e.manifest),u=[],c=null,d=null,f=null,h=null;for(s=0,a=e&&e.manifest&&e.manifest.Period_asArray?e.manifest.Period_asArray.length:0;s<a;s++)(d=e.manifest.Period_asArray[s]).hasOwnProperty(i.default.START)?(h=new o.default).start=d.start:null!==c&&c.hasOwnProperty(i.default.DURATION)&&null!==f?(h=new o.default).start=parseFloat((f.start+f.duration).toFixed(5)):0!==s||l||((h=new o.default).start=0),null!==f&&isNaN(f.duration)&&(null!==h?f.duration=parseFloat((h.start-f.start).toFixed(5)):t.warn("First period duration could not be calculated because lack of start and duration period properties. This will cause timing issues during playback")),null!==h&&(h.id=F(d,s),h.index=s,h.mpd=e,d.hasOwnProperty(i.default.DURATION)&&(h.duration=d.duration),f&&(f.nextPeriodId=h.id),u.push(h),c=d,f=h),d=null,h=null;return 0===u.length||null!==f&&isNaN(f.duration)&&(f.duration=parseFloat((function(e){!function(){if(!n||!n.hasOwnProperty("error"))throw new Error(r.default.MISSING_CONFIG_ERROR)}();var t,i=x(e.mpd.manifest);return e.mpd.manifest.mediaPresentationDuration?t=e.mpd.manifest.mediaPresentationDuration:e.duration?t=e.duration:i?t=Number.POSITIVE_INFINITY:n.error(new y.default(v.default.MANIFEST_ERROR_ID_PARSE_CODE,"Must have @mediaPresentationDuration on MPD or an explicit @duration on the last period.",e)),t}(f)-f.start).toFixed(5))),u},getMpd:function(e){var t=new l.default;return e&&(t.manifest=e,e.hasOwnProperty(i.default.AVAILABILITY_START_TIME)?t.availabilityStartTime=new Date(e.availabilityStartTime.getTime()):e.loadedTime&&(t.availabilityStartTime=new Date(e.loadedTime.getTime())),e.hasOwnProperty(i.default.AVAILABILITY_END_TIME)&&(t.availabilityEndTime=new Date(e.availabilityEndTime.getTime())),e.hasOwnProperty(i.default.MINIMUM_UPDATE_PERIOD)&&(t.minimumUpdatePeriod=e.minimumUpdatePeriod),e.hasOwnProperty(i.default.MEDIA_PRESENTATION_DURATION)&&(t.mediaPresentationDuration=e.mediaPresentationDuration),e.hasOwnProperty(i.default.SUGGESTED_PRESENTATION_DELAY)&&(t.suggestedPresentationDelay=e.suggestedPresentationDelay),e.hasOwnProperty(i.default.TIMESHIFT_BUFFER_DEPTH)&&(t.timeShiftBufferDepth=e.timeShiftBufferDepth),e.hasOwnProperty(i.default.MAX_SEGMENT_DURATION)&&(t.maxSegmentDuration=e.maxSegmentDuration),e.hasOwnProperty(i.default.PUBLISH_TIME)&&(t.publishTime=new Date(e.publishTime))),t},getEventsForPeriod:function(e){var t,n,a=e&&e.mpd&&e.mpd.manifest?e.mpd.manifest:null,s=a?a.Period_asArray:null,o=s&&e&&S(e.index)?s[e.index].EventStream_asArray:null,l=[];if(o)for(t=0;t<o.length;t++){var u=new f.default;if(u.period=e,u.timescale=1,!o[t].hasOwnProperty(r.default.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");for(u.schemeIdUri=o[t][r.default.SCHEME_ID_URI],o[t].hasOwnProperty(i.default.TIMESCALE)&&(u.timescale=o[t][i.default.TIMESCALE]),o[t].hasOwnProperty(i.default.VALUE)&&(u.value=o[t][i.default.VALUE]),o[t].hasOwnProperty(i.default.PRESENTATION_TIME_OFFSET)&&(u.presentationTimeOffset=o[t][i.default.PRESENTATION_TIME_OFFSET]),n=0;o[t].Event_asArray&&n<o[t].Event_asArray.length;n++){var d=o[t].Event_asArray[n],h=new c.default;if(h.presentationTime=0,h.eventStream=u,d.hasOwnProperty(i.default.PRESENTATION_TIME)){h.presentationTime=d.presentationTime;var p=u.presentationTimeOffset?u.presentationTimeOffset/u.timescale:0;h.calculatedPresentationTime=h.presentationTime/u.timescale+e.start-p}d.hasOwnProperty(i.default.DURATION)&&(h.duration=d.duration/u.timescale),d.hasOwnProperty(i.default.ID)&&(h.id=d.id),d.Signal&&d.Signal.Binary?h.messageData=g.decodeArray(d.Signal.Binary.toString()):h.messageData=d.messageData||d.__text,l.push(h)}}return l},getEssentialPropertiesForRepresentation:L,getEventStreamForAdaptationSet:function(e,t){var n,r,i;return e&&e.Period_asArray&&t&&t.period&&S(t.period.index)&&(r=e.Period_asArray[t.period.index])&&r.AdaptationSet_asArray&&S(t.index)&&(i=r.AdaptationSet_asArray[t.index])&&(n=i.InbandEventStream_asArray),U(n,null)},getEventStreamForRepresentation:function(e,t){var n,r,i,a;return e&&e.Period_asArray&&t&&t.adaptation&&t.adaptation.period&&S(t.adaptation.period.index)&&(r=e.Period_asArray[t.adaptation.period.index])&&r.AdaptationSet_asArray&&S(t.adaptation.index)&&(i=r.AdaptationSet_asArray[t.adaptation.index])&&i.Representation_asArray&&S(t.index)&&(a=i.Representation_asArray[t.index])&&(n=a.InbandEventStream_asArray),U(n,t)},getUTCTimingSources:function(e){var t=x(e),n=!!e&&e.hasOwnProperty(i.default.AVAILABILITY_START_TIME),a=e?e.UTCTiming_asArray:null,s=[];return(t||n)&&a&&a.forEach((function(e){var t=new u.default;e.hasOwnProperty(r.default.SCHEME_ID_URI)&&(t.schemeIdUri=e.schemeIdUri,e.hasOwnProperty(i.default.VALUE)&&(t.value=e.value.toString(),s.push(t)))})),s},getBaseURLsFromElement:B,getRepresentationSortFunction:N,getLocation:function(e){if(e&&e.hasOwnProperty(r.default.LOCATION))return e.Location=e.Location_asArray[0],e.Location},getPatchLocation:function(e){if(e&&e.hasOwnProperty(i.default.PATCH_LOCATION))return e.PatchLocation=e.PatchLocation_asArray[0],e.PatchLocation},getSuggestedPresentationDelay:function(e){return e&&e.hasOwnProperty(i.default.SUGGESTED_PRESENTATION_DELAY)?e.suggestedPresentationDelay:null},getAvailabilityStartTime:function(e){return e&&e.hasOwnProperty(i.default.AVAILABILITY_START_TIME)&&null!==e.availabilityStartTime?e.availabilityStartTime.getTime():null},getServiceDescriptions:function(e){var t=[];if(e&&e.hasOwnProperty(i.default.SERVICE_DESCRIPTION)){var n,a=T(e.ServiceDescription_asArray);try{for(a.s();!(n=a.n()).done;){var s=n.value,o=void 0,l=void 0,u=void 0,c=void 0;for(var d in s)s.hasOwnProperty(d)&&(d===i.default.ID?o=s[d]:d===i.default.SERVICE_DESCRIPTION_SCOPE?l=s[d].schemeIdUri:d===i.default.SERVICE_DESCRIPTION_LATENCY?u={target:s[d].target,max:s[d].max,min:s[d].min}:d===i.default.SERVICE_DESCRIPTION_PLAYBACK_RATE&&(c={max:s[d].max,min:s[d].min}));l===r.default.SERVICE_DESCRIPTION_LL_SCHEME&&(u||c)&&t.push({id:o,schemeIdUri:l,latency:u,playbackRate:c})}}catch(e){a.e(e)}finally{a.f()}}return t},getSupplementalProperties:function(e){var t={};if(e&&e.hasOwnProperty(i.default.SUPPLEMENTAL_PROPERTY)){var n,a=T(e.SupplementalProperty_asArray);try{for(a.s();!(n=a.n()).done;){var s=n.value;s.hasOwnProperty(r.default.SCHEME_ID_URI)&&s.hasOwnProperty(i.default.VALUE)&&(t[s[r.default.SCHEME_ID_URI]]=s[i.default.VALUE])}}catch(e){a.e(e)}finally{a.f()}}return t},setConfig:function(e){e&&(e.errHandler&&(n=e.errHandler),e.BASE64&&(g=e.BASE64))}},t=Object(m.default)(E).getInstance().getLogger(e),e}b.__dashjs_factory_name="DashManifestModel",t.default=g.default.getSingletonFactory(b)},"./src/dash/models/PatchManifestModel.js":function(e,t,n){n.r(t);var r=n("./src/dash/constants/DashConstants.js"),i=n("./src/core/FactoryMaker.js"),a=n("./src/core/Debug.js"),s=n("./src/dash/vo/SimpleXPath.js"),o=n("./src/dash/vo/PatchOperation.js");function l(){var e,t,n=this.context;return e={getIsPatch:function(e){return e&&e.hasOwnProperty(r.default.ORIGINAL_MPD_ID)||!1},getPublishTime:function(e){return e&&e.hasOwnProperty(r.default.PUBLISH_TIME)?new Date(e[r.default.PUBLISH_TIME]):null},getOriginalPublishTime:function(e){return e&&e.hasOwnProperty(r.default.ORIGINAL_PUBLISH_TIME)?new Date(e[r.default.ORIGINAL_PUBLISH_TIME]):null},getMpdId:function(e){return e&&e[r.default.ORIGINAL_MPD_ID]||null},getPatchOperations:function(e){return e?(e.__children||[]).map((function(e){var n=Object.keys(e)[0];if("add"!==n&&"remove"!==n&&"replace"!==n)return t.warn("Ignoring node of invalid action: ".concat(n)),null;var r=e[n],i=r.sel;if("add"===n&&r.type){if(!r.type.startsWith("@"))return t.warn("Ignoring add action for prefixed namespace declaration: ".concat(r.type,"=").concat(r.__text)),null;i="".concat(i,"/").concat(r.type)}var a=new s.default(i);if(!a.isValid())return t.warn("Ignoring action with invalid selector: ".concat(n," - ").concat(i)),null;var l=null;a.findsAttribute()?l=r.__text||"":"remove"!==n&&(l=r.__children.reduce((function(e,t){var n=Object.keys(t)[0];return"#text"!==n&&(e[n]=e[n]||[],e[n].push(t[n])),e}),{}));var u=new o.default(n,a,l);return"add"===n&&(u.position=r.pos),u})).filter((function(e){return!!e})):[]}},t=Object(a.default)(n).getInstance().getLogger(e),e}l.__dashjs_factory_name="PatchManifestModel",t.default=i.default.getSingletonFactory(l)},"./src/dash/parser/DashParser.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/dash/parser/objectiron.js"),a=n("./externals/xml2json.js"),s=n("./src/dash/parser/matchers/StringMatcher.js"),o=n("./src/dash/parser/matchers/DurationMatcher.js"),l=n("./src/dash/parser/matchers/DateTimeMatcher.js"),u=n("./src/dash/parser/matchers/NumericMatcher.js"),c=n("./src/dash/parser/maps/RepresentationBaseValuesMap.js"),d=n("./src/dash/parser/maps/SegmentValuesMap.js");function f(e){e=e||{};var t,n,r,f,h,p=this.context,g=e.debug;return t={parse:function(e){var t,r=window.performance.now();if(!(t=f.xml_str2json(e)))throw new Error("parsing the manifest failed");var i=window.performance.now();t.Patch?((t=t.Patch).add_asArray&&t.add_asArray.forEach((function(e){return h.run(e)})),t.replace_asArray&&t.replace_asArray.forEach((function(e){return h.run(e)}))):(t=t.MPD,h.run(t));var a=window.performance.now();return n.info("Parsing complete: ( xml2json: "+(i-r).toPrecision(3)+"ms, objectiron: "+(a-i).toPrecision(3)+"ms, total: "+((a-r)/1e3).toPrecision(3)+"s)"),t.protocol="DASH",t},getMatchers:function(){return r},getIron:function(){return h}},n=g.getLogger(t),r=[new o.default,new l.default,new u.default,new s.default],f=new a.default({escapeMode:!1,attributePrefix:"",arrayAccessForm:"property",emptyNodeForm:"object",stripWhitespaces:!1,enableToStringFunc:!0,ignoreRoot:!1,matchers:r}),h=Object(i.default)(p).create({adaptationset:new c.default,period:new d.default}),t}f.__dashjs_factory_name="DashParser",t.default=r.default.getClassFactory(f)},"./src/dash/parser/maps/CommonProperty.js":function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(t);var i=function(){function e(t){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._name=t,this._merge=(n=t)&&n.length&&n.charAt(0)===n.charAt(0).toUpperCase()}var t,n,i;return t=e,(n=[{key:"name",get:function(){return this._name}},{key:"merge",get:function(){return this._merge}}])&&r(t.prototype,n),i&&r(t,i),e}();t.default=i},"./src/dash/parser/maps/MapNode.js":function(e,t,n){n.r(t);var r=n("./src/dash/parser/maps/CommonProperty.js");function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var a=function(){function e(t,n,i){var a=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._name=t||"",this._properties=[],this._children=i||[],Array.isArray(n)&&n.forEach((function(e){a._properties.push(new r.default(e))}))}var t,n,a;return t=e,(n=[{key:"name",get:function(){return this._name}},{key:"children",get:function(){return this._children}},{key:"properties",get:function(){return this._properties}}])&&i(t.prototype,n),a&&i(t,a),e}();t.default=a},"./src/dash/parser/maps/RepresentationBaseValuesMap.js":function(e,t,n){n.r(t);var r=n("./src/dash/parser/maps/MapNode.js"),i=n("./src/dash/constants/DashConstants.js");function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(e,t)}function o(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=l(e);if(t){var i=l(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}var u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(n,e);var t=o(n);function n(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var e=[i.default.PROFILES,i.default.WIDTH,i.default.HEIGHT,i.default.SAR,i.default.FRAMERATE,i.default.AUDIO_SAMPLING_RATE,i.default.MIME_TYPE,i.default.SEGMENT_PROFILES,i.default.CODECS,i.default.MAXIMUM_SAP_PERIOD,i.default.START_WITH_SAP,i.default.MAX_PLAYOUT_RATE,i.default.CODING_DEPENDENCY,i.default.SCAN_TYPE,i.default.FRAME_PACKING,i.default.AUDIO_CHANNEL_CONFIGURATION,i.default.CONTENT_PROTECTION,i.default.ESSENTIAL_PROPERTY,i.default.SUPPLEMENTAL_PROPERTY,i.default.INBAND_EVENT_STREAM];return t.call(this,i.default.ADAPTATION_SET,e,[new r.default(i.default.REPRESENTATION,e,[new r.default(i.default.SUB_REPRESENTATION,e)])])}return n}(r.default);t.default=u},"./src/dash/parser/maps/SegmentValuesMap.js":function(e,t,n){n.r(t);var r=n("./src/dash/parser/maps/MapNode.js"),i=n("./src/dash/constants/DashConstants.js");function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(e,t)}function o(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=l(e);if(t){var i=l(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}var u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(n,e);var t=o(n);function n(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var e=[i.default.SEGMENT_BASE,i.default.SEGMENT_TEMPLATE,i.default.SEGMENT_LIST];return t.call(this,i.default.PERIOD,e,[new r.default(i.default.ADAPTATION_SET,e,[new r.default(i.default.REPRESENTATION,e)])])}return n}(r.default);t.default=u},"./src/dash/parser/matchers/BaseMatcher.js":function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(t);var i=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._test=t,this._converter=n}var t,n,i;return t=e,(n=[{key:"test",get:function(){return this._test}},{key:"converter",get:function(){return this._converter}}])&&r(t.prototype,n),i&&r(t,i),e}();t.default=i},"./src/dash/parser/matchers/DateTimeMatcher.js":function(e,t,n){n.r(t);var r=n("./src/dash/parser/matchers/BaseMatcher.js");function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}function s(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=o(e);if(t){var a=o(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}var l=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+-])([0-9]{2})(?::?)([0-9]{2}))?/,u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(n,e);var t=s(n);function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),t.call(this,(function(e){return l.test(e.value)}),(function(e){var t,n=l.exec(e);if(t=Date.UTC(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10),parseInt(n[4],10),parseInt(n[5],10),n[6]&&parseInt(n[6],10)||0,n[7]&&1e3*parseFloat(n[7])||0),n[9]&&n[10]){var r=60*parseInt(n[9],10)+parseInt(n[10],10);t+=("+"===n[8]?-1:1)*r*60*1e3}return new Date(t)}))}return n}(r.default);t.default=u},"./src/dash/parser/matchers/DurationMatcher.js":function(e,t,n){n.r(t);var r=n("./src/dash/parser/matchers/BaseMatcher.js"),i=n("./src/streaming/constants/Constants.js"),a=n("./src/dash/constants/DashConstants.js");function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function o(e,t){return o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=u(e);if(t){var i=u(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}var c=/^([-])?P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,d=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(n,e);var t=l(n);function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),t.call(this,(function(e){for(var t=[a.default.MIN_BUFFER_TIME,a.default.MEDIA_PRESENTATION_DURATION,a.default.MINIMUM_UPDATE_PERIOD,a.default.TIMESHIFT_BUFFER_DEPTH,a.default.MAX_SEGMENT_DURATION,a.default.MAX_SUBSEGMENT_DURATION,a.default.SUGGESTED_PRESENTATION_DELAY,a.default.START,i.default.START_TIME,a.default.DURATION],n=t.length,r=0;r<n;r++)if(e.nodeName===t[r])return c.test(e.value);return!1}),(function(e){var t=c.exec(e),n=31536e3*parseFloat(t[3]||0)+2592e3*parseFloat(t[5]||0)+86400*parseFloat(t[7]||0)+3600*parseFloat(t[9]||0)+60*parseFloat(t[11]||0)+parseFloat(t[13]||0);return void 0!==t[1]&&(n=-n),n}))}return n}(r.default);t.default=d},"./src/dash/parser/matchers/NumericMatcher.js":function(e,t,n){n.r(t);var r=n("./src/dash/parser/matchers/BaseMatcher.js");function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}function s(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=o(e);if(t){var a=o(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}var l=/^[-+]?[0-9]+[.]?[0-9]*([eE][-+]?[0-9]+)?$/,u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(n,e);var t=s(n);function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),t.call(this,(function(e){return l.test(e.value)}),(function(e){return parseFloat(e)}))}return n}(r.default);t.default=u},"./src/dash/parser/matchers/StringMatcher.js":function(e,t,n){n.r(t);var r=n("./src/dash/parser/matchers/BaseMatcher.js"),i=n("./src/dash/constants/DashConstants.js");function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){return o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=u(e);if(t){var i=u(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}var c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(n,e);var t=l(n);function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),t.call(this,(function(e,t){var n,r=(s(n={},i.default.MPD,[i.default.ID,i.default.PROFILES]),s(n,i.default.PERIOD,[i.default.ID]),s(n,i.default.BASE_URL,[i.default.SERVICE_LOCATION,i.default.BYTE_RANGE]),s(n,i.default.SEGMENT_BASE,[i.default.INDEX_RANGE]),s(n,i.default.INITIALIZATION,[i.default.RANGE]),s(n,i.default.REPRESENTATION_INDEX,[i.default.RANGE]),s(n,i.default.SEGMENT_LIST,[i.default.INDEX_RANGE]),s(n,i.default.BITSTREAM_SWITCHING,[i.default.RANGE]),s(n,i.default.SEGMENT_URL,[i.default.MEDIA_RANGE,i.default.INDEX_RANGE]),s(n,i.default.SEGMENT_TEMPLATE,[i.default.INDEX_RANGE,i.default.MEDIA,i.default.INDEX,i.default.INITIALIZATION_MINUS,i.default.BITSTREAM_SWITCHING_MINUS]),s(n,i.default.ASSET_IDENTIFIER,[i.default.VALUE,i.default.ID]),s(n,i.default.EVENT_STREAM,[i.default.VALUE]),s(n,i.default.ADAPTATION_SET,[i.default.PROFILES,i.default.MIME_TYPE,i.default.SEGMENT_PROFILES,i.default.CODECS,i.default.CONTENT_TYPE]),s(n,i.default.FRAME_PACKING,[i.default.VALUE,i.default.ID]),s(n,i.default.AUDIO_CHANNEL_CONFIGURATION,[i.default.VALUE,i.default.ID]),s(n,i.default.CONTENT_PROTECTION,[i.default.VALUE,i.default.ID]),s(n,i.default.ESSENTIAL_PROPERTY,[i.default.VALUE,i.default.ID]),s(n,i.default.SUPPLEMENTAL_PROPERTY,[i.default.VALUE,i.default.ID]),s(n,i.default.INBAND_EVENT_STREAM,[i.default.VALUE,i.default.ID]),s(n,i.default.ACCESSIBILITY,[i.default.VALUE,i.default.ID]),s(n,i.default.ROLE,[i.default.VALUE,i.default.ID]),s(n,i.default.RATING,[i.default.VALUE,i.default.ID]),s(n,i.default.VIEWPOINT,[i.default.VALUE,i.default.ID]),s(n,i.default.CONTENT_COMPONENT,[i.default.CONTENT_TYPE]),s(n,i.default.REPRESENTATION,[i.default.ID,i.default.DEPENDENCY_ID,i.default.MEDIA_STREAM_STRUCTURE_ID]),s(n,i.default.SUBSET,[i.default.ID]),s(n,i.default.METRICS,[i.default.METRICS_MINUS]),s(n,i.default.REPORTING,[i.default.VALUE,i.default.ID]),n);if(r.hasOwnProperty(t)){var a=r[t];return void 0!==a&&a.indexOf(e.name)>=0}return!1}),(function(e){return String(e)}))}return n}(r.default);t.default=c},"./src/dash/parser/objectiron.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js");function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e){function t(e,t){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}function n(e,n,r){for(var a=0,s=e.length;a<s;++a){var o=e[a];if(n[o.name])if(r[o.name]){if(o.merge){var l=n[o.name],u=r[o.name];"object"===i(l)&&"object"===i(u)?t(l,u):r[o.name]=l+u}}else r[o.name]=n[o.name]}}function r(e,t){for(var i=0,a=e.children.length;i<a;++i){var s=e.children[i],o=t[s.name+"_asArray"];if(o)for(var l=0,u=o.length;l<u;++l){var c=o[l];n(e.properties,t,c),r(s,c)}}}return{run:function(t){if(null===t||"object"!==i(t))return t;if(t.Period_asArray&&"period"in e)for(var n=e.period,a=t.Period_asArray,s=0,o=a.length;s<o;++s){var l=a[s];if(r(n,l),"adaptationset"in e){var u=l.AdaptationSet_asArray;if(u)for(var c=e.adaptationset,d=0,f=u.length;d<f;++d)r(c,u[d])}}return t}}}a.__dashjs_factory_name="ObjectIron";var s=r.default.getClassFactory(a);t.default=s},"./src/dash/utils/ListSegmentsGetter.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/streaming/constants/Constants.js"),a=n("./src/dash/utils/SegmentsUtils.js");function s(e,t){var n,r=(e=e||{}).timelineConverter;function s(){if(!r||!r.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(i.default.MISSING_CONFIG_ERROR)}function o(e,n){if(s(),!e)return null;var i=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,o=i.SegmentURL_asArray.length,l=e&&!isNaN(e.startNumber)?e.startNumber:1,u=Math.max(l-1,0),c=Math.max(n-u,0),d=null;if(c<o){var f=i.SegmentURL_asArray[c];(d=Object(a.getIndexBasedSegment)(r,t,e,n))&&(d.replacementTime=(l+n-1)*e.segmentDuration,d.media=f.media?f.media:"",d.mediaRange=f.mediaRange,d.indexRange=f.indexRange)}return d}return n={getSegmentByIndex:o,getSegmentByTime:function(e,t){if(s(),!e)return null;var n=e.segmentDuration;if(isNaN(n))return null;var i=r.calcPeriodRelativeTimeFromMpdRelativeTime(e,t);return o(e,Math.floor(i/n))},getMediaFinishedInformation:function(e){var t={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};if(!e)return t;var n=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,r=e&&!isNaN(e.startNumber)?e.startNumber:1,i=Math.max(r-1,0);return t.numberOfSegments=i+n.SegmentURL_asArray.length,t}},n}s.__dashjs_factory_name="ListSegmentsGetter";var o=r.default.getClassFactory(s);t.default=o},"./src/dash/utils/Round10.js":function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(t),n.d(t,"default",(function(){return i}));var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,i=[{key:"round10",value:function(e,t){return function(e,t,n){return void 0===n||0==+n?Math[e](t):(n=+n,null===(t=+t)||isNaN(t)||"number"!=typeof n||n%1!=0?NaN:(t=t.toString().split("e"),+((t=(t=Math[e](+(t[0]+"e"+(t[1]?+t[1]-n:-n)))).toString().split("e"))[0]+"e"+(t[1]?+t[1]+n:n))))}("round",e,t)}}],(n=null)&&r(t.prototype,n),i&&r(t,i),e}()},"./src/dash/utils/SegmentBaseGetter.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/streaming/constants/Constants.js");function a(e){var t,n=(e=e||{}).timelineConverter;function r(){if(!n||!n.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(i.default.MISSING_CONFIG_ERROR)}function a(e,t){if(r(),!e)return null;var n,i=e.segments?e.segments.length:-1;if(t<i&&(n=e.segments[t])&&n.index===t)return n;for(var a=0;a<i;a++)if((n=e.segments[a])&&n.index===t)return n;return null}return t={getSegmentByIndex:a,getSegmentByTime:function(e,t){r();var n=function(e,t){if(!e)return-1;var n,r,i,a,s,o=e.segments,l=o?o.length:null,u=-1;if(o&&l>0)for(s=0;s<l;s++)if(i=(r=o[s]).presentationStartTime,t+(n=(a=r.duration)/2)>=i&&t-n<i+a){u=r.index;break}return u}(e,t);return a(e,n)},getMediaFinishedInformation:function(e){var t={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};return e&&e.segments?(t.numberOfSegments=e.segments.length,t):t}},t}a.__dashjs_factory_name="SegmentBaseGetter";var s=r.default.getClassFactory(a);t.default=s},"./src/dash/utils/SegmentsUtils.js":function(e,t,n){n.r(t),n.d(t,"unescapeDollarsInTemplate",(function(){return a})),n.d(t,"replaceIDForTemplate",(function(){return s})),n.d(t,"replaceTokenForTemplate",(function(){return o})),n.d(t,"getIndexBasedSegment",(function(){return c})),n.d(t,"getTimeBasedSegment",(function(){return d}));var r=n("./src/dash/vo/Segment.js");function i(e,t){for(;e.length<t;)e="0"+e;return e}function a(e){return e?e.split("$$").join("$"):e}function s(e,t){if(!t||!e||-1===e.indexOf("$RepresentationID$"))return e;var n=t.toString();return e.split("$RepresentationID$").join(n)}function o(e,t,n){var r,a,s,o,l,u,c=t.length;if(!e)return e;for(;;){if((r=e.indexOf("$"+t))<0)return e;if((a=e.indexOf("$",r+c))<0)return e;if((s=e.indexOf("%0",r+c))>r&&s<a)switch(o=e.charAt(a-1),l=parseInt(e.substring(s+2,a-1),10),o){case"d":case"i":case"u":u=i(n.toString(),l);break;case"x":u=i(n.toString(16),l);break;case"X":u=i(n.toString(16),l).toUpperCase();break;case"o":u=i(n.toString(8),l);break;default:return e}else u=n;e=e.substring(0,r)+u+e.substring(a+1)}}function l(e,t,n,i,a,s,o,l){var u,c=new r.default;return c.representation=e,c.duration=t,c.presentationStartTime=n,c.mediaStartTime=i,c.availabilityStartTime=a.calcAvailabilityStartTimeFromPresentationTime(s,e,o),c.availabilityEndTime=a.calcAvailabilityEndTimeFromPresentationTime(s+t,e,o),c.wallStartTime=a.calcWallTimeForSegment(c,o),c.replacementNumber=(u=l,c.representation.startNumber+u),c.index=l,c}function u(e,t,n,r){var i=t.adaptation.period;if(isFinite(i.duration)&&i.start+i.duration<=n.presentationStartTime)return!1;if(r){if("INF"===t.availabilityTimeOffset)return!0;var a=e.getClientReferenceTime();return n.availabilityStartTime.getTime()<=a&&(!isFinite(n.availabilityEndTime)||n.availabilityEndTime.getTime()>=a)}return!0}function c(e,t,n,r){var i,a,s;i=n.segmentDuration,isNaN(i)&&(i=n.adaptation.period.duration),a=parseFloat((n.adaptation.period.start+r*i).toFixed(5)),s=parseFloat((a+i).toFixed(5));var o=l(n,i,a,e.calcMediaTimeFromPresentationTime(a,n),e,s,t,r);return u(e,n,o,t)?o:null}function d(e,t,n,r,i,a,s,c,d,f){var h,p,g=r/a,m=i/a;return h=e.calcPresentationTimeFromMediaTime(g,n),u(e,n,p=l(n,m,h,g,e,h+m,t,d),t)?(p.replacementTime=f||r,s=o(s,"Number",p.replacementNumber),s=o(s,"Time",p.replacementTime),p.media=s,p.mediaRange=c,p):null}},"./src/dash/utils/TemplateSegmentsGetter.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/streaming/constants/Constants.js"),a=n("./src/dash/utils/SegmentsUtils.js");function s(e,t){var n,r=(e=e||{}).timelineConverter;function s(){if(!r||!r.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(i.default.MISSING_CONFIG_ERROR)}function o(e,n){if(s(),!e)return null;var i=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate;n=Math.max(n,0);var o=Object(a.getIndexBasedSegment)(r,t,e,n);if(o){o.replacementTime=Math.round((n-1)*e.segmentDuration*e.timescale,10);var l=i.media;l=Object(a.replaceTokenForTemplate)(l,"Number",o.replacementNumber),l=Object(a.replaceTokenForTemplate)(l,"Time",o.replacementTime),o.media=l}return o}return n={getSegmentByIndex:o,getSegmentByTime:function(e,t){if(s(),!e)return null;var n=e.segmentDuration;if(isNaN(n))return null;var i=r.calcPeriodRelativeTimeFromMpdRelativeTime(e,t);return o(e,Math.floor(i/n))},getMediaFinishedInformation:function(e){var t={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN};if(!e)return t;var n=e.segmentDuration;return isNaN(n)?t.numberOfSegments=1:t.numberOfSegments=Math.ceil(e.adaptation.period.duration/n),t}},n}s.__dashjs_factory_name="TemplateSegmentsGetter";var o=r.default.getClassFactory(s);t.default=o},"./src/dash/utils/TimelineConverter.js":function(e,t,n){n.r(t);var r=n("./src/core/EventBus.js"),i=n("./src/core/events/Events.js"),a=n("./src/core/FactoryMaker.js"),s=n("./src/dash/constants/DashConstants.js"),o=n("./src/dash/models/DashManifestModel.js"),l=n("./src/core/Settings.js"),u=n("./src/streaming/constants/Constants.js"),c=n("./src/streaming/MediaPlayerEvents.js"),d=n("./src/streaming/constants/ConformanceViolationConstants.js");function f(){var e,t,n,a,f=this.context,h=Object(r.default)(f).getInstance(),p=Object(l.default)(f).getInstance();function g(e){a=e}function m(e,t,n,r){var i,a=t.adaptation.period.mpd,s=a.availabilityStartTime;if(r)i=n&&a.timeShiftBufferDepth!==Number.POSITIVE_INFINITY?new Date(s.getTime()+1e3*(e+a.timeShiftBufferDepth)):a.availabilityEndTime;else if(n){var o=t.availabilityTimeOffset;i=new Date(s.getTime()+1e3*(e-o))}else i=s;return i}function y(e,t){return(e.getTime()-t.mpd.availabilityStartTime.getTime()+1e3*a)/1e3}function v(e,t){return e+(t.adaptation.period.start-t.presentationTimeOffset)}function _(e){var n={start:NaN,end:NaN},r=e[0].getAdapter().getRegularPeriods()[0],i=y(new Date,r);if(!e||0===e.length)return{range:n,now:i};e.forEach((function(e){var r=e.getAdapter(),a=r.getMediaInfoForType(e.getStreamInfo(),u.default.VIDEO)||r.getMediaInfoForType(e.getStreamInfo(),u.default.AUDIO),o=r.getVoRepresentations(a)[0],l={start:NaN,end:NaN};if(o)if(o.segmentInfoType===s.default.SEGMENT_TIMELINE)l=function(e){var n,r,i,a,s=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index],o=t.getRepresentationFor(e.index,s),l=o.SegmentTemplate.SegmentTimeline,u=o.SegmentTemplate.timescale,c=l.S_asArray,d={start:0,end:0},f=0;for(d.start=v(c[0].t/u,e),i=0,a=c.length;i<a;i++)r=0,(n=c[i]).hasOwnProperty("r")&&(r=n.r),f+=n.d/u*(1+r);return d.end=d.start+f,d}(o);else{var c=o.adaptation.period;l.start=c.start,l.end=Math.max(i,c.start+c.duration)}!isNaN(l.start)&&(isNaN(n.start)||n.start>l.start)&&(n.start=l.start),!isNaN(l.end)&&(isNaN(n.end)||n.end<l.end)&&(n.end=l.end)})),n.end=Math.min(i,n.end);var a=E(e,n.end,!0);return n.end=isNaN(a)?n.end:a,n.start=r&&r.mpd&&r.mpd.timeShiftBufferDepth&&!isNaN(r.mpd.timeShiftBufferDepth)&&!isNaN(n.end)?Math.max(n.end-r.mpd.timeShiftBufferDepth,n.start):n.start,n.start=E(e,n.start),{range:n,now:i}}function T(e,t){n=e-t.end}function E(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{for(var r=0,i=!1,a=NaN;!i&&r<e.length;){var s=e[r].getStreamInfo();s.start<=t&&(!isFinite(s.duration)||s.start+s.duration>=t)?(a=t,i=!0):!n&&s.start>t&&(isNaN(a)||s.start<a)?a=s.start:n&&s.start+s.duration<t&&(isNaN(a)||s.start+s.duration>a)&&(a=s.start+s.duration),r+=1}return a}catch(e){return t}}function b(e){void 0===e.offset||isNaN(e.offset)||g(e.offset/1e3)}function S(){a=0,n=0}function A(){h.off(i.default.UPDATE_TIME_SYNC_OFFSET,b,this),S()}return e={initialize:function(){S(),h.on(i.default.UPDATE_TIME_SYNC_OFFSET,b,this)},getClientTimeOffset:function(){return a},setClientTimeOffset:g,getClientReferenceTime:function(){return Date.now()-1e3*n+1e3*a},calcAvailabilityStartTimeFromPresentationTime:function(e,t,n){return m(e,t,n)},calcAvailabilityEndTimeFromPresentationTime:function(e,t,n){return m(e,t,n,!0)},calcPresentationTimeFromWallTime:y,calcPresentationTimeFromMediaTime:v,calcPeriodRelativeTimeFromMpdRelativeTime:function(e,t){return t-e.adaptation.period.start},calcMediaTimeFromPresentationTime:function(e,t){return e-t.adaptation.period.start+t.presentationTimeOffset},calcWallTimeForSegment:function(e,t){var n,r,i;return t&&(n=e.representation.adaptation.period.mpd.suggestedPresentationDelay,r=e.presentationStartTime+n,i=new Date(e.availabilityStartTime.getTime()+1e3*r)),i},calcTimeShiftBufferWindow:function(e,t){if(!t)return function(e){var t={start:NaN,end:NaN},n=0,r=NaN;return e.forEach((function(e){var t=e.getStreamInfo();n+=t.duration,(isNaN(r)||t.start<r)&&(r=t.start)})),t.start=r,t.end=r+n,t}(e);if(p.get().streaming.timeShiftBuffer.calcFromSegmentTimeline){var n=_(e);return T(n.now,n.range),n.range}return function(e){var t={start:NaN,end:NaN};if(!e||0===e.length)return t;var n=e[0].getAdapter().getRegularPeriods()[0],r=y(new Date,n),i=n.mpd.timeShiftBufferDepth,a=isNaN(i)?0:r-i;if(t.start=E(e,a),t.end=!isNaN(t.start)&&r<t.start?r:E(e,r,!0),!isNaN(i)&&t.end<r-i&&(t.end=NaN),p.get().streaming.timeShiftBuffer.fallbackToSegmentTimeline){var s=_(e);if(s.range.end<t.start)return h.trigger(c.default.CONFORMANCE_VIOLATION,{level:d.default.LEVELS.WARNING,event:d.default.EVENTS.INVALID_DVR_WINDOW}),T(s.now,s.range),s.range}return t}(e)},reset:A},t=Object(o.default)(f).getInstance(),A(),e}f.__dashjs_factory_name="TimelineConverter",t.default=a.default.getSingletonFactory(f)},"./src/dash/utils/TimelineSegmentsGetter.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/streaming/constants/Constants.js"),a=n("./src/dash/utils/SegmentsUtils.js");function s(e,t){var n,r=(e=e||{}).timelineConverter,s=e.dashMetrics;function o(){if(!r)throw new Error(i.default.MISSING_CONFIG_ERROR)}function l(e,t){var n,r,i,a,s,o,l,c=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate||e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,d=c.SegmentTimeline,f=c.SegmentURL_asArray,h=0,p=0,g=-1;l=e.timescale;var m=!1;for(i=0,a=(n=d.S_asArray).length;i<a&&!m;i++)for(o=0,(r=n[i]).hasOwnProperty("r")&&(o=r.r),r.hasOwnProperty("t")&&(p=(h=r.t)/l),o<0&&(o=u(e,n[i+1],r,l,p)),s=0;s<=o&&!m;s++)(m=t(h,p,c,f,r,l,++g,i))&&(e.segmentDuration=r.d/l),p=(h+=r.d)/l}function u(e,t,n,i,a){var o;if(t&&t.hasOwnProperty("t"))o=t.t/i;else try{var l=0;if(isNaN(e.adaptation.period.start)||isNaN(e.adaptation.period.duration)||!isFinite(e.adaptation.period.duration)){var u=s.getCurrentDVRInfo();l=isNaN(u.end)?0:u.end}else l=e.adaptation.period.start+e.adaptation.period.duration;o=r.calcMediaTimeFromPresentationTime(l,e),e.segmentDuration=n.d/i}catch(e){o=0}return Math.max(Math.ceil((o-a)/(n.d/i))-1,0)}return n={getSegmentByIndex:function(e,n,i){if(o(),!e)return null;var s=null,u=!1;return l(e,(function(n,o,l,c,d,f,h,p){if(u||i<0){var g=l.media,m=d.mediaRange;return c&&(g=c[p].media||"",m=c[p].mediaRange),s=Object(a.getTimeBasedSegment)(r,t,e,n,d.d,f,g,m,h,d.tManifest),!0}return o>=i-.5*d.d/f&&(u=!0),!1})),s},getSegmentByTime:function(e,n){if(o(),!e)return null;void 0===n&&(n=null);var i=null,s=r.calcMediaTimeFromPresentationTime(n,e);return l(e,(function(n,o,l,u,c,d,f,h){if(s<o+c.d/d){var p=l.media,g=c.mediaRange;return u&&(p=u[h].media||"",g=u[h].mediaRange),i=Object(a.getTimeBasedSegment)(r,t,e,n,c.d,d,p,g,f,c.tManifest),!0}return!1})),i},getMediaFinishedInformation:function(e){if(!e)return 0;var t,n,r,i,a,s,o,l=(e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate||e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList).SegmentTimeline,c=0,d=0,f=0;for(o=e.timescale,i=(t=l.S_asArray).length,r=0;r<i;r++)for(s=0,(n=t[r]).hasOwnProperty("r")&&(s=n.r),n.hasOwnProperty("t")&&(d=(c=n.t)/o),s<0&&(s=u(e,t[r+1],n,o,d)),a=0;a<=s;a++)f++,d=(c+=n.d)/o;return{numberOfSegments:f,mediaTimeOfLastSignaledSegment:d}}},n}s.__dashjs_factory_name="TimelineSegmentsGetter";var o=r.default.getClassFactory(s);t.default=o},"./src/dash/vo/AdaptationSet.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.period=null,this.index=-1,this.type=null}},"./src/dash/vo/BaseURL.js":function(e,t,n){n.r(t);var r=function e(t,n,r,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t||"",this.serviceLocation=n||t||"",this.dvb_priority=r||1,this.dvb_weight=i||1,this.availabilityTimeOffset=0,this.availabilityTimeComplete=!0};r.DEFAULT_DVB_PRIORITY=1,r.DEFAULT_DVB_WEIGHT=1,t.default=r},"./src/dash/vo/Event.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.duration=NaN,this.presentationTime=NaN,this.id=NaN,this.messageData="",this.eventStream=null,this.presentationTimeDelta=NaN}},"./src/dash/vo/EventStream.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.adaptionSet=null,this.representation=null,this.period=null,this.timescale=1,this.value="",this.schemeIdUri="",this.presentationTimeOffset=0}},"./src/dash/vo/ManifestInfo.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.dvrWindowSize=NaN,this.loadedTime=null,this.availableFrom=null,this.minBufferTime=NaN,this.duration=NaN,this.isDynamic=!1,this.maxFragmentDuration=null}},"./src/dash/vo/MediaInfo.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=null,this.type=null,this.streamInfo=null,this.representationCount=0,this.labels=null,this.lang=null,this.viewpoint=null,this.accessibility=null,this.audioChannelConfiguration=null,this.roles=null,this.codec=null,this.mimeType=null,this.contentProtection=null,this.KID=null,this.bitrateList=null,this.isFragmented=null,this.isEmbedded=null,this.selectionPriority=1}},"./src/dash/vo/Mpd.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.manifest=null,this.suggestedPresentationDelay=0,this.availabilityStartTime=null,this.availabilityEndTime=Number.POSITIVE_INFINITY,this.timeShiftBufferDepth=Number.POSITIVE_INFINITY,this.maxSegmentDuration=Number.POSITIVE_INFINITY,this.publishTime=null,this.minimumUpdatePeriod=NaN,this.mediaPresentationDuration=NaN}},"./src/dash/vo/PatchOperation.js":function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(t);var i=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.action=t,this.xpath=n,this.value=r,this.position=null}var t,n,i;return t=e,(n=[{key:"getMpdTarget",value:function(e){var t="remove"===this.action||"replace"===this.action||"before"===this.position||"after"===this.position;return this.xpath.getMpdTarget(e,t)}}])&&r(t.prototype,n),i&&r(t,i),e}();t.default=i},"./src/dash/vo/Period.js":function(e,t,n){n.r(t);var r=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=-1,this.duration=NaN,this.start=NaN,this.mpd=null,this.nextPeriodId=null};r.DEFAULT_ID="defaultId",t.default=r},"./src/dash/vo/Representation.js":function(e,t,n){n.r(t);var r=n("./src/dash/constants/DashConstants.js");function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=-1,this.adaptation=null,this.segmentInfoType=null,this.initialization=null,this.codecs=null,this.mimeType=null,this.codecPrivateData=null,this.segmentDuration=NaN,this.timescale=1,this.startNumber=1,this.indexRange=null,this.range=null,this.presentationTimeOffset=0,this.MSETimeOffset=NaN,this.mediaFinishedInformation={numberOfSegments:0,mediaTimeOfLastSignaledSegment:NaN},this.bandwidth=NaN,this.width=NaN,this.height=NaN,this.scanType=null,this.maxPlayoutRate=NaN,this.availabilityTimeOffset=0,this.availabilityTimeComplete=!0}var t,n,a;return t=e,(n=[{key:"hasInitialization",value:function(){return null!==this.initialization||null!==this.range}},{key:"hasSegments",value:function(){return this.segmentInfoType!==r.default.BASE_URL&&this.segmentInfoType!==r.default.SEGMENT_BASE&&!this.indexRange}}])&&i(t.prototype,n),a&&i(t,a),e}();t.default=a},"./src/dash/vo/RepresentationInfo.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.quality=null,this.fragmentDuration=null,this.mediaInfo=null,this.MSETimeOffset=null}},"./src/dash/vo/Segment.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.indexRange=null,this.index=null,this.mediaRange=null,this.media=null,this.duration=NaN,this.replacementTime=null,this.replacementNumber=NaN,this.mediaStartTime=NaN,this.presentationStartTime=NaN,this.availabilityStartTime=NaN,this.availabilityEndTime=NaN,this.wallStartTime=NaN,this.representation=null}},"./src/dash/vo/SimpleXPath.js":function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(t);var i=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.valid="/"==t[0],this.path=t.split("/").filter((function(e){return 0!==e.length})).map((function(e){var t={name:e},r=e.indexOf("[");if(-1!=r){t.name=e.substring(0,r);var i=e.substring(r+1,e.length-1);n.valid=n.valid&&-1==i.indexOf("[");var a=i.indexOf("=");-1!=a?(t.attribute={name:i.substring(1,a),value:i.substring(a+1)},-1!=["'",'"'].indexOf(t.attribute.value[0])&&(t.attribute.value=t.attribute.value.substring(1,t.attribute.value.length-1))):t.position=parseInt(i,10)-1}return t}))}var t,n,i;return t=e,(n=[{key:"isValid",value:function(){return this.valid}},{key:"findsElement",value:function(){return!this.findsAttribute()}},{key:"findsAttribute",value:function(){return this.path[this.path.length-1].name.startsWith("@")}},{key:"getMpdTarget",value:function(e,t){for(var n=null,r=e,i=1,a="MPD";i<this.path.length&&null!==r;){n=r;var s=this.path[i];if(a=s.name,i!==this.path.length-1||!a.startsWith("@")){var o=n[a+"_asArray"]||[];0===o.length&&n[a]&&o.push(n[a]),s.position?r=o[s.position]||null:s.attribute?function(){var e=s.attribute;r=o.filter((function(t){return t[e.name]==e.value}))[0]||null}():r=o[0]||null}i++}return null===r?null:a.startsWith("@")?{name:a.substring(1),leaf:r,target:r}:{name:a,leaf:r,target:t?n:r}}}])&&r(t.prototype,n),i&&r(t,i),e}();t.default=i},"./src/dash/vo/StreamInfo.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=null,this.start=NaN,this.duration=NaN,this.manifestInfo=null,this.isLast=!0}},"./src/dash/vo/UTCTiming.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.schemeIdUri="",this.value=""}},"./src/streaming/FragmentLoader.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/streaming/net/URLLoader.js"),a=n("./src/streaming/vo/HeadRequest.js"),s=n("./src/streaming/vo/DashJSError.js"),o=n("./src/core/FactoryMaker.js");function l(e){e=e||{};var t,n,o=this.context,l=e.eventBus,u=e.events,c=e.urlUtils,d=e.errors,f=e.streamId;return t={checkForExistence:function(e){var t=function(t){l.trigger(u.CHECK_FOR_EXISTENCE_COMPLETED,{request:e,exists:t})};if(e){var r=new a.default(e.url);n.load({request:r,success:function(){t(!0)},error:function(){t(!1)}})}else t(!1)},load:function(e){var r=function(n,r){l.trigger(u.LOADING_COMPLETED,{request:e,response:n||null,error:r||null,sender:t})};e?n.load({request:e,progress:function(n){l.trigger(u.LOADING_PROGRESS,{request:e,stream:n.stream,streamId:f}),n.data&&l.trigger(u.LOADING_DATA_PROGRESS,{request:e,response:n.data||null,error:null,sender:t})},success:function(e){r(e)},error:function(e,t,n){r(void 0,new s.default(d.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE,n,t))},abort:function(e){e&&l.trigger(u.LOADING_ABANDONED,{mediaType:e.mediaType,request:e,sender:t})}}):r(void 0,new s.default(d.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE,d.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE))},abort:function(){n&&n.abort()},reset:function(){n&&(n.abort(),n=null)}},n=Object(i.default)(o).create({errHandler:e.errHandler,errors:d,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,urlUtils:c,constants:r.default,boxParser:e.boxParser,dashConstants:e.dashConstants,requestTimeout:e.settings.get().streaming.fragmentRequestTimeout}),t}l.__dashjs_factory_name="FragmentLoader",t.default=o.default.getClassFactory(l)},"./src/streaming/ManifestLoader.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/dash/constants/DashConstants.js"),a=n("./src/streaming/controllers/XlinkController.js"),s=n("./src/streaming/net/URLLoader.js"),o=n("./src/streaming/utils/URLUtils.js"),l=n("./src/streaming/vo/TextRequest.js"),u=n("./src/streaming/vo/DashJSError.js"),c=n("./src/streaming/vo/metrics/HTTPRequest.js"),d=n("./src/core/EventBus.js"),f=n("./src/core/events/Events.js"),h=n("./src/core/errors/Errors.js"),p=n("./src/core/FactoryMaker.js"),g=n("./src/dash/parser/DashParser.js");function m(e){e=e||{};var t,n,p,m,y,v=this.context,_=e.debug,T=Object(d.default)(v).getInstance(),E=Object(o.default)(v).getInstance(),b=e.mssHandler,S=e.errHandler;function A(e){T.trigger(f.default.INTERNAL_MANIFEST_LOADED,{manifest:e.manifest})}return t={load:function(e){var t=new l.default(e,c.HTTPRequest.MPD_TYPE);p.load({request:t,success:function(t,i,a){var s,o,l;if(m)if(a&&a!==e?(o=E.parseBaseUrl(a),s=a):(E.isRelative(e)&&(e=E.resolve(e,window.location.href)),o=E.parseBaseUrl(e)),"No Content"!=i)if(null===y&&(y=function(e){var t=null;return e.indexOf("SmoothStreamingMedia")>-1?(b&&(t=b.createMssParser(),b.registerEvents()),t):e.indexOf("MPD")>-1||e.indexOf("Patch")>-1?Object(g.default)(v).create({debug:_}):t}(t)),null!==y){m.setMatchers(y.getMatchers()),m.setIron(y.getIron());try{l=y.parse(t)}catch(t){return void T.trigger(f.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new u.default(h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+"".concat(e))})}l?(l.url=s||e,l.originalUrl||(l.originalUrl=l.url),l.hasOwnProperty(r.default.LOCATION)&&(o=E.parseBaseUrl(l.Location_asArray[0]),n.debug("BaseURI set by Location to: "+o)),l.baseUri=o,l.loadedTime=new Date,m.resolveManifestOnLoad(l),T.trigger(f.default.ORIGINAL_MANIFEST_LOADED,{originalManifest:t})):T.trigger(f.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new u.default(h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+"".concat(e))})}else T.trigger(f.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new u.default(h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,h.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+"".concat(e))});else T.trigger(f.default.INTERNAL_MANIFEST_LOADED,{manifest:null})},error:function(t,n,r){T.trigger(f.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new u.default(h.default.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE,h.default.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE+"".concat(e,", ").concat(r))})}})},reset:function(){T.off(f.default.XLINK_READY,A,t),b&&b.reset(),m&&(m.reset(),m=null),p&&(p.abort(),p=null)}},n=_.getLogger(t),T.on(f.default.XLINK_READY,A,t),p=Object(s.default)(v).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,urlUtils:E,constants:r.default,dashConstants:i.default,errors:h.default}),m=Object(a.default)(v).create({errHandler:S,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,settings:e.settings}),y=null,t}m.__dashjs_factory_name="ManifestLoader";var y=p.default.getClassFactory(m);t.default=y},"./src/streaming/ManifestUpdater.js":function(e,t,n){n.r(t);var r=n("./src/core/EventBus.js"),i=n("./src/core/events/Events.js"),a=n("./src/streaming/MediaPlayerEvents.js"),s=n("./src/core/FactoryMaker.js"),o=n("./src/core/Debug.js"),l=n("./src/core/errors/Errors.js"),u=n("./src/dash/constants/DashConstants.js"),c=n("./src/streaming/utils/URLUtils.js");function d(){var e,t,n,s,d,f,h,p,g,m,y,v,_=this.context,T=Object(r.default)(_).getInstance(),E=Object(c.default)(_).getInstance();function b(){n=NaN,h=!1,d=!0,f=!1,S()}function S(){null!==s&&(clearTimeout(s),s=null)}function A(e){S(),f||(isNaN(e)&&!isNaN(n)&&(e=1e3*n),isNaN(e)||(t.debug("Refresh manifest in "+e+" milliseconds."),s=setTimeout(C,e)))}function w(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];h=!0;var t=g.getValue(),n=t.url,r=m.getPatchLocation(t),i=m.getLocation(t);r&&!e?n=r:i&&(n=i),E.isRelative(n)&&(n=E.resolve(n,t.url)),p.load(n)}function I(e){if(e){if(m.getIsPatch(e)){var r=e;e=g.getValue();var a=m.isPatchValid(e,r),s=a;if(a){var o=m.getPublishTime(e);s=m.applyPatchToManifest(e,r);var l=m.getPublishTime(e);s=o.getTime()!=l.getTime()}if(!s)return t.debug("Patch provided is invalid, performing full manifest refresh"),void w(!0);e.loadedTime=new Date}}else(e=g.getValue()).loadedTime=new Date;if(g.getValue()&&g.getValue().type===u.default.DYNAMIC&&e.type===u.default.STATIC)return T.trigger(i.default.DYNAMIC_TO_STATIC),h=!1,void(f=!0);g.setValue(e);var c=new Date,p=(c.getTime()-e.loadedTime.getTime())/1e3;1e3*(n=m.getManifestUpdatePeriod(e,p))>2147483647&&(n=2147483.647),T.trigger(i.default.MANIFEST_UPDATED,{manifest:e}),t.info("Manifest has been refreshed at "+c+"["+c.getTime()/1e3+"] "),d||A()}function C(){d||(h?A(v.get().streaming.manifestUpdateRetryInterval):w())}function R(e){e.error?e.error.code===l.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE&&y.error(e.error):I(e.manifest)}function D(){d=!1,A()}function N(){(d=!v.get().streaming.scheduling.scheduleWhilePaused)&&S()}function O(){h=!1}return e={initialize:function(){b(),T.on(i.default.STREAMS_COMPOSED,O,this),T.on(a.default.PLAYBACK_STARTED,D,this),T.on(a.default.PLAYBACK_PAUSED,N,this),T.on(i.default.INTERNAL_MANIFEST_LOADED,R,this)},setManifest:function(e){I(e)},refreshManifest:w,getIsUpdating:function(){return h},setConfig:function(e){e&&(e.manifestModel&&(g=e.manifestModel),e.adapter&&(m=e.adapter),e.manifestLoader&&(p=e.manifestLoader),e.errHandler&&(y=e.errHandler),e.settings&&(v=e.settings))},reset:function(){T.off(a.default.PLAYBACK_STARTED,D,this),T.off(a.default.PLAYBACK_PAUSED,N,this),T.off(i.default.STREAMS_COMPOSED,O,this),T.off(i.default.INTERNAL_MANIFEST_LOADED,R,this),b()}},t=Object(o.default)(_).getInstance().getLogger(e),e}d.__dashjs_factory_name="ManifestUpdater",t.default=s.default.getClassFactory(d)},"./src/streaming/MediaPlayer.js":function(e,t,n){n.r(t);var r=n("./externals/cea608-parser.js"),i=n.n(r),a=n("./src/streaming/constants/Constants.js"),s=n("./src/dash/constants/DashConstants.js"),o=n("./src/streaming/constants/MetricsConstants.js"),l=n("./src/streaming/controllers/PlaybackController.js"),u=n("./src/streaming/controllers/StreamController.js"),c=n("./src/streaming/controllers/GapController.js"),d=n("./src/streaming/controllers/MediaController.js"),f=n("./src/streaming/controllers/BaseURLController.js"),h=n("./src/streaming/ManifestLoader.js"),p=n("./src/streaming/utils/ErrorHandler.js"),g=n("./src/streaming/utils/Capabilities.js"),m=n("./src/streaming/utils/CapabilitiesFilter.js"),y=n("./src/streaming/utils/RequestModifier.js"),v=n("./src/streaming/models/URIFragmentModel.js"),_=n("./src/streaming/models/ManifestModel.js"),T=n("./src/streaming/models/MediaPlayerModel.js"),E=n("./src/streaming/controllers/AbrController.js"),b=n("./src/streaming/net/SchemeLoaderFactory.js"),S=n("./src/streaming/models/VideoModel.js"),A=n("./src/streaming/models/CmcdModel.js"),w=n("./src/streaming/utils/DOMStorage.js"),I=n("./src/core/Debug.js"),C=n("./src/core/errors/Errors.js"),R=n("./src/core/EventBus.js"),D=n("./src/core/events/Events.js"),N=n("./src/streaming/MediaPlayerEvents.js"),O=n("./src/core/FactoryMaker.js"),P=n("./src/core/Settings.js"),M=n("./src/core/Version.js"),x=n("./src/dash/controllers/SegmentBaseController.js"),L=n("./src/dash/DashAdapter.js"),k=n("./src/dash/DashMetrics.js"),F=n("./src/dash/utils/TimelineConverter.js"),U=n("./src/streaming/vo/metrics/HTTPRequest.js"),B=n("./externals/base64.js"),j=n.n(B),q=n("./node_modules/codem-isoboxer/dist/iso_boxer.js"),H=n.n(q),G=n("./src/streaming/vo/DashJSError.js"),V=n("./src/streaming/utils/SupervisorTools.js"),Y=n("./src/streaming/ManifestUpdater.js"),Z=n("./src/streaming/utils/URLUtils.js"),K=n("./src/streaming/utils/BoxParser.js"),z=n("./src/streaming/text/TextController.js");function W(){var e,t,n,r,B,q,W,X,$,Q,J,ee,te,ne,re,ie,ae,se,oe,le,ue,ce,de,fe,he,pe,ge,me,ye,ve,_e,Te,Ee,be,Se,Ae,we="You must first call initialize() and set a source before calling this method",Ie="You must first call initialize() and set a valid source and view before calling this method",Ce="You must first call attachView() to set the video element before calling this method",Re="MediaPlayer not initialized!",De=this.context,Ne=Object(R.default)(De).getInstance(),Oe=Object(P.default)(De).getInstance(),Pe=Object(I.default)(De).getInstance({settings:Oe});function Me(){Ke(null),Ve(null),r=null,te&&(te.reset(),te=null),ne&&(ne.reset(),ne=null),Oe.reset(),ie&&(ie.reset(),ie=null)}function xe(){return!!n&&!!ve.getElement()}function Le(){return Object(M.getVersionString)()}function ke(){if(!W)throw Ie;return pe.isPaused()}function Fe(e){var t=de&&de.hasVideoTrack()?a.default.VIDEO:a.default.AUDIO,n=ge.getCurrentDVRInfo(t);if(!n)return 0;var r=pe.getLiveDelay(),i=n.range.start+e;return i>n.range.end-r&&(i=n.range.end-r),i}function Ue(e){if(!W)throw Ie;var t=Ge().currentTime;if(void 0!==e)t=de.getTimeRelativeToStreamId(t,e);else if(pe.getIsDynamic()){var n=de&&de.hasVideoTrack()?a.default.VIDEO:a.default.AUDIO,r=ge.getCurrentDVRInfo(n);t=null===r||0===t?0:Math.max(0,t-r.range.start)}return t}function Be(){if(!W)throw Ie;var e=Ge().duration;if(pe.getIsDynamic()){var t=de&&de.hasVideoTrack()?a.default.VIDEO:a.default.AUDIO,n=ge.getCurrentDVRInfo(t);e=n?n.range.end-n.range.start:0}return e}function je(e){Object(V.checkParameterType)(e,"boolean"),X=e}function qe(){se.restoreDefaultUTCTimingSources()}function He(){return ge}function Ge(){if(!ve.getElement())throw Ce;return ve.getElement()}function Ve(e){if(!B)throw Re;ve.setElement(e),e&&($e(),function(){if(!ne){var e=dashjs.MetricsReporting;if("function"==typeof e){var t=e(De).create();ne=t.createMetricsReporting({debug:Pe,eventBus:Ne,mediaElement:Ge(),adapter:ae,dashMetrics:ge,events:D.default,constants:a.default,metricsConstants:o.default})}}}(),function(){if(!re){var e=dashjs.MssHandler;"function"==typeof e&&(C.default.extend(e.errors),re=e(De).create({eventBus:Ne,mediaPlayerModel:se,dashMetrics:ge,manifestModel:me,playbackController:pe,streamController:de,protectionController:te,baseURLController:le,errHandler:oe,events:D.default,constants:a.default,debug:Pe,initSegmentType:U.HTTPRequest.INIT_SEGMENT_TYPE,BASE64:j.a,ISOBoxer:H.a,settings:Oe}))}}(),de&&de.switchToVideoElement()),W&&We(),et()}function Ye(e){if(!q)throw we;var t=de.getActiveStreamInfo();return t?ee.getTracksFor(e,t.id):[]}function Ze(e,t){var n=-1;e.some((function(e,r){if(e===t)return n=r,!0})),n<0||e.splice(n,1)}function Ke(e){if(!B)throw Re;"string"==typeof e&&_e.initialize(e),n=e,(q||W)&&We(),xe()&&et()}function ze(){if(!q)throw we;var e=de.getActiveStreamInfo();return e?de.getStreamById(e.id):null}function We(){W=!1,q=!1,ae.reset(),de.reset(),he.reset(),pe.reset(),$.reset(),ee.reset(),Ee.reset(),te&&(Oe.get().streaming.protection.keepProtectionMediaKeys?te.stop():(te.reset(),te=null,$e())),fe.reset(),ye.reset()}function Xe(){return Object(h.default)(De).create({debug:Pe,errHandler:oe,dashMetrics:ge,mediaPlayerModel:se,requestModifier:Object(y.default)(De).getInstance(),mssHandler:re,settings:Oe})}function $e(){if(te)return te;var e=dashjs.Protection;if("function"==typeof e){var t=e(De).create();return D.default.extend(e.events),N.default.extend(e.events,{publicOnly:!0}),C.default.extend(e.errors),ue||(ue=Object(g.default)(De).getInstance()),(te=t.createProtectionSystem({debug:Pe,errHandler:oe,videoModel:ve,capabilities:ue,eventBus:Ne,events:D.default,BASE64:j.a,constants:a.default,cmcdModel:ye,settings:Oe}))&&(te.setLicenseRequestFilters(be),te.setLicenseResponseFilters(Se)),te}return null}function Qe(){if(!B)throw Re;if(ie)return ie;var e=dashjs.OfflineController;if("function"==typeof e){D.default.extend(e.events),N.default.extend(e.events,{publicOnly:!0}),C.default.extend(e.errors);var t=Xe(),n=Object(Y.default)(De).create();return n.setConfig({manifestModel:me,adapter:ae,manifestLoader:t,errHandler:oe}),ie=e(De).create({debug:Pe,manifestUpdater:n,baseURLController:le,manifestLoader:t,manifestModel:me,mediaPlayerModel:se,abrController:$,playbackController:pe,adapter:ae,errHandler:oe,dashMetrics:ge,timelineConverter:J,segmentBaseController:Ee,schemeLoaderFactory:Q,eventBus:Ne,events:D.default,errors:C.default,constants:a.default,settings:Oe,dashConstants:s.default,urlUtils:Object(Z.default)(De).getInstance()})}return null}function Je(e){var t=de&&de.hasVideoTrack()?a.default.VIDEO:a.default.AUDIO,n=ge.getCurrentDVRInfo(t);return n?e+(n.manifestInfo.availableFrom.getTime()/1e3+n.range.start):0}function et(){var e;ie&&ie.resetRecords(),!q&&n&&(q=!0,t.info("Streaming Initialized"),e=Xe(),de||(de=Object(u.default)(De).getInstance()),fe||(fe=Object(z.default)(De).create({errHandler:oe,manifestModel:me,adapter:ae,mediaController:ee,videoModel:ve,settings:Oe})),ce.setConfig({capabilities:ue,adapter:ae,settings:Oe,manifestModel:me,errHandler:oe}),ce.setCustomCapabilitiesFilters(Ae),de.setConfig({capabilities:ue,capabilitiesFilter:ce,manifestLoader:e,manifestModel:me,mediaPlayerModel:se,protectionController:te,textController:fe,adapter:ae,dashMetrics:ge,errHandler:oe,timelineConverter:J,videoModel:ve,playbackController:pe,abrController:$,mediaController:ee,settings:Oe,baseURLController:le,uriFragmentModel:_e,segmentBaseController:Ee}),he.setConfig({settings:Oe,playbackController:pe,streamController:de,videoModel:ve,timelineConverter:J,adapter:ae}),pe.setConfig({streamController:de,dashMetrics:ge,mediaPlayerModel:se,adapter:ae,videoModel:ve,timelineConverter:J,settings:Oe}),$.setConfig({streamController:de,domStorage:Te,mediaPlayerModel:se,dashMetrics:ge,adapter:ae,videoModel:ve,settings:Oe}),ye.setConfig({abrController:$,dashMetrics:ge,playbackController:pe}),$.initialize(),de.initialize(X,r),fe.initialize(),he.initialize(),ye.initialize(),Ee.initialize(),"string"==typeof n?de.load(n):de.loadWithManifest(n)),!W&&xe()&&(W=!0,t.info("Playback Initialized"))}return e={initialize:function(e,n,r){ue||(ue=Object(g.default)(De).getInstance()).setConfig({settings:Oe}),oe||(oe=Object(p.default)(De).getInstance()),ue.supportsMediaSource()?(B||(B=!0,J=Object(F.default)(De).getInstance(),$||($=Object(E.default)(De).getInstance()).setConfig({settings:Oe}),Q||(Q=Object(b.default)(De).getInstance()),pe||(pe=Object(l.default)(De).getInstance()),ee||(ee=Object(d.default)(De).getInstance()),de||(de=Object(u.default)(De).getInstance()),he||(he=Object(c.default)(De).getInstance()),ce||(ce=Object(m.default)(De).getInstance()),ae=Object(L.default)(De).getInstance(),me=Object(_.default)(De).getInstance(),ye=Object(A.default)(De).getInstance(),ge=Object(k.default)(De).getInstance({settings:Oe}),Te=Object(w.default)(De).getInstance({settings:Oe}),ae.setConfig({constants:a.default,cea608parser:i.a,errHandler:oe,BASE64:j.a}),le||(le=Object(f.default)(De).create()),le.setConfig({adapter:ae}),Ee||(Ee=Object(x.default)(De).getInstance({dashMetrics:ge,mediaPlayerModel:se,errHandler:oe,baseURLController:le,events:D.default,eventBus:Ne,debug:Pe,boxParser:Object(K.default)(De).getInstance(),requestModifier:Object(y.default)(De).getInstance(),errors:C.default})),ee.setConfig({domStorage:Te,settings:Oe}),qe(),je(void 0===r||r),Qe()),e&&Ve(e),n&&Ke(n),t.info("[dash.js "+Le()+"] MediaPlayer has been initialized")):oe.error(new G.default(C.default.CAPABILITY_MEDIASOURCE_ERROR_CODE,C.default.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE))},setConfig:function(e){e&&(e.capabilities&&(ue=e.capabilities),e.capabilitiesFilter&&(ce=e.capabilitiesFilter),e.streamController&&(de=e.streamController),e.textController&&(fe=e.textController),e.gapController&&(he=e.gapController),e.playbackController&&(pe=e.playbackController),e.mediaPlayerModel&&(se=e.mediaPlayerModel),e.abrController&&($=e.abrController),e.schemeLoaderFactory&&(Q=e.schemeLoaderFactory),e.mediaController&&(ee=e.mediaController),e.settings&&(Oe=e.settings))},on:function(e,t,n,r){Ne.on(e,t,n,r)},off:function(e,t,n){Ne.off(e,t,n)},extend:function(e,t,n){O.default.extend(e,t,n,De)},attachView:Ve,attachSource:Ke,isReady:xe,play:function(){if(!W)throw Ie;(!X||ke()&&W)&&pe.play()},isPaused:ke,pause:function(){if(!W)throw Ie;pe.pause()},isSeeking:function(){if(!W)throw Ie;return pe.isSeeking()},isDynamic:function(){if(!W)throw Ie;return pe.getIsDynamic()},seek:function(e){if(!W)throw Ie;if(Object(V.checkParameterType)(e,"number"),isNaN(e))throw a.default.BAD_ARGUMENT_ERROR;var t=pe.getIsDynamic()?Fe(e):e;pe.seek(t)},setPlaybackRate:function(e){Ge().playbackRate=e},getPlaybackRate:function(){return Ge().playbackRate},setMute:function(e){Object(V.checkParameterType)(e,"boolean"),Ge().muted=e},isMuted:function(){return Ge().muted},setVolume:function(e){if("number"!=typeof e||isNaN(e)||e<0||e>1)throw a.default.BAD_ARGUMENT_ERROR;Ge().volume=e},getVolume:function(){return Ge().volume},time:Ue,duration:Be,timeAsUTC:function(){if(!W)throw Ie;return Ue()<0?NaN:Je(Ue())},durationAsUTC:function(){if(!W)throw Ie;return Je(Be())},getActiveStream:ze,getDVRWindowSize:function(){var e=de&&de.hasVideoTrack()?a.default.VIDEO:a.default.AUDIO,t=ge.getCurrentDVRInfo(e);return t?t.manifestInfo.dvrWindowSize:0},getDVRSeekOffset:Fe,convertToTimeCode:function(e){e=Math.max(e,0);var t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%3600%60);return(0===t?"":t<10?"0"+t.toString()+":":t.toString()+":")+(n<10?"0"+n.toString():n.toString())+":"+(r<10?"0"+r.toString():r.toString())},formatUTC:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=new Date(1e3*e),a=i.toLocaleDateString(t),s=i.toLocaleTimeString(t,{hour12:n});return r?s+" "+a:s},getVersion:Le,getDebug:function(){return Pe},getBufferLength:function(e){var n=[a.default.VIDEO,a.default.AUDIO,a.default.TEXT];if(e)return-1!==n.indexOf(e)?He().getCurrentBufferLevel(e)||NaN:(t.warn("getBufferLength requested for invalid type"),NaN);var r=n.map((function(e){return Ye(e).length>0?He().getCurrentBufferLevel(e):Number.MAX_VALUE})).reduce((function(e,t){return Math.min(e,t)}));return r===Number.MAX_VALUE?NaN:r},getTTMLRenderingDiv:function(){return ve?ve.getTTMLRenderingDiv():null},getVideoElement:Ge,getSource:function(){if(!n)throw"You must first call attachSource() with a valid source before calling this method";return n},getCurrentLiveLatency:function(){if(!B)throw Re;return W?pe.getCurrentLiveLatency():NaN},getTopBitrateInfoFor:function(e){if(!q)throw we;return $.getTopBitrateInfoFor(e)},setAutoPlay:je,getAutoPlay:function(){return X},getDashMetrics:He,getQualityFor:function(e){if(!q)throw we;if(e===a.default.IMAGE){var t=ze();if(!t)return-1;var n=t.getThumbnailController();return n?n.getCurrentTrackIndex():-1}return $.getQualityFor(e)},setQualityFor:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!q)throw we;if(e===a.default.IMAGE){var r=ze();if(!r)return;var i=r.getThumbnailController();i&&i.setTrackByIndex(t)}$.setPlaybackQuality(e,de.getActiveStreamInfo(),t,{forceReplace:n})},updatePortalSize:function(){$.setElementSize(),$.setWindowResizeEventCalled(!0)},enableText:function(e){var t=de.getActiveStreamInfo();return!(!t||!fe)&&fe.enableText(t.id,e)},enableForcedTextStreaming:function(e){return!(!de.getActiveStreamInfo()||!fe)&&fe.enableForcedTextStreaming(e)},isTextEnabled:function(){var e=de.getActiveStreamInfo();return!(!e||!fe)&&fe.isTextEnabled(e)},setTextTrack:function(e){if(!W)throw Ie;var t=de.getActiveStreamInfo();t&&fe&&fe.setTextTrack(t.id,e)},getBitrateInfoListFor:function(e){if(!q)throw we;var t=ze();return t?t.getBitrateListFor(e):[]},getStreamsFromManifest:function(e){if(!q)throw we;return ae.getStreamsInfo(e)},getTracksFor:Ye,getTracksForTypeFromManifest:function(e,t,n){if(!q)throw we;return(n=n||ae.getStreamsInfo(t,1)[0])?ae.getAllMediaInfoForType(n,e,t):[]},getCurrentTrackFor:function(e){if(!q)throw we;var t=de.getActiveStreamInfo();return ee.getCurrentTrackFor(e,t.id)},setInitialMediaSettingsFor:function(e,t){if(!B)throw Re;ee.setInitialSettings(e,t)},getInitialMediaSettingsFor:function(e){if(!B)throw Re;return ee.getInitialSettings(e)},setCurrentTrack:function(e){if(!q)throw we;ee.setTrack(e)},addABRCustomRule:function(e,t,n){se.addABRCustomRule(e,t,n)},removeABRCustomRule:function(e){se.removeABRCustomRule(e)},removeAllABRCustomRule:function(){se.removeABRCustomRule()},getAverageThroughput:function(e){var t=$.getThroughputHistory(),n=pe.getIsDynamic();return t?t.getAverageThroughput(e,n):0},retrieveManifest:function(e,t){var n=Xe(),r=this;Ne.on(D.default.INTERNAL_MANIFEST_LOADED,(function e(i){i.error?t(null,i.error):t(i.manifest),Ne.off(D.default.INTERNAL_MANIFEST_LOADED,e,r),n.reset()}),r),_e.initialize(e),n.load(e)},addUTCTimingSource:function(e,t){se.addUTCTimingSource(e,t)},removeUTCTimingSource:function(e,t){se.removeUTCTimingSource(e,t)},clearDefaultUTCTimingSources:function(){se.clearDefaultUTCTimingSources()},restoreDefaultUTCTimingSources:qe,setXHRWithCredentialsForType:function(e,t){se.setXHRWithCredentialsForType(e,t)},getXHRWithCredentialsForType:function(e){return se.getXHRWithCredentialsForType(e)},getProtectionController:function(){return $e()},attachProtectionController:function(e){te=e},setProtectionData:function(e){r=e,de&&de.setProtectionData(r)},registerLicenseRequestFilter:function(e){be.push(e),te&&te.setLicenseRequestFilters(be)},registerLicenseResponseFilter:function(e){Se.push(e),te&&te.setLicenseResponseFilters(Se)},unregisterLicenseRequestFilter:function(e){Ze(be,e),te&&te.setLicenseRequestFilters(be)},unregisterLicenseResponseFilter:function(e){Ze(Se,e),te&&te.setLicenseResponseFilters(Se)},registerCustomCapabilitiesFilter:function(e){Ae.push(e),ce&&ce.setCustomCapabilitiesFilters(Ae)},unregisterCustomCapabilitiesFilter:function(e){Ze(Ae,e),ce&&ce.setCustomCapabilitiesFilters(Ae)},setCustomInitialTrackSelectionFunction:function(e){ee&&ee.setCustomInitialTrackSelectionFunction(e)},resetCustomInitialTrackSelectionFunction:function(){ee&&ee.setCustomInitialTrackSelectionFunction(null)},attachTTMLRenderingDiv:function(e){if(!ve.getElement())throw Ce;ve.setTTMLRenderingDiv(e)},getCurrentTextTrackIndex:function(){var e=de.getActiveStreamInfo();if(e&&fe)return fe.getCurrentTrackIdx(e.id)},provideThumbnail:function(e,t){if("function"==typeof t)if(e<0)t(null);else{var n=pe.getIsDynamic()?Fe(e):e,r=de.getStreamForTime(n);if(null!==r){var i=r.getThumbnailController();if(i){var a=de.getTimeRelativeToStreamId(n,r.getId());return i.provide(a,t)}t(null)}else t(null)}},getDashAdapter:function(){return ae},getOfflineController:function(){return Qe()},getSettings:function(){return Oe.get()},updateSettings:function(e){Oe.update(e)},resetSettings:function(){Oe.reset()},reset:Me,destroy:function(){Me(),be=[],Se=[],Ae=[],O.default.deleteSingletonInstances(De)}},t=Pe.getLogger(e),B=!1,W=!1,q=!1,X=!0,te=null,ie=null,r=null,ae=null,Ee=null,D.default.extend(N.default),se=Object(T.default)(De).getInstance(),ve=Object(S.default)(De).getInstance(),_e=Object(v.default)(De).getInstance(),be=[],Se=[],Ae=[],e}W.__dashjs_factory_name="MediaPlayer";var X=O.default.getClassFactory(W);X.events=N.default,X.errors=C.default,O.default.updateClassFactory(W.__dashjs_factory_name,X),t.default=X},"./src/streaming/MediaPlayerEvents.js":function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=s(e);if(t){var a=s(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}n.r(t);var o=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(n,e);var t=a(n);function n(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(e=t.call(this)).AST_IN_FUTURE="astInFuture",e.BUFFER_EMPTY="bufferStalled",e.BUFFER_LOADED="bufferLoaded",e.BUFFER_LEVEL_STATE_CHANGED="bufferStateChanged",e.BUFFER_LEVEL_UPDATED="bufferLevelUpdated",e.DYNAMIC_TO_STATIC="dynamicToStatic",e.ERROR="error",e.FRAGMENT_LOADING_COMPLETED="fragmentLoadingCompleted",e.FRAGMENT_LOADING_PROGRESS="fragmentLoadingProgress",e.FRAGMENT_LOADING_STARTED="fragmentLoadingStarted",e.FRAGMENT_LOADING_ABANDONED="fragmentLoadingAbandoned",e.LOG="log",e.MANIFEST_LOADED="manifestLoaded",e.METRICS_CHANGED="metricsChanged",e.METRIC_CHANGED="metricChanged",e.METRIC_ADDED="metricAdded",e.METRIC_UPDATED="metricUpdated",e.PERIOD_SWITCH_STARTED="periodSwitchStarted",e.PERIOD_SWITCH_COMPLETED="periodSwitchCompleted",e.QUALITY_CHANGE_REQUESTED="qualityChangeRequested",e.QUALITY_CHANGE_RENDERED="qualityChangeRendered",e.TRACK_CHANGE_RENDERED="trackChangeRendered",e.STREAM_INITIALIZING="streamInitializing",e.STREAM_UPDATED="streamUpdated",e.STREAM_ACTIVATED="streamActivated",e.STREAM_DEACTIVATED="streamDeactivated",e.STREAM_INITIALIZED="streamInitialized",e.STREAM_TEARDOWN_COMPLETE="streamTeardownComplete",e.TEXT_TRACKS_ADDED="allTextTracksAdded",e.TEXT_TRACK_ADDED="textTrackAdded",e.TTML_PARSED="ttmlParsed",e.TTML_TO_PARSE="ttmlToParse",e.CAPTION_RENDERED="captionRendered",e.CAPTION_CONTAINER_RESIZE="captionContainerResize",e.CAN_PLAY="canPlay",e.CAN_PLAY_THROUGH="canPlayThrough",e.PLAYBACK_ENDED="playbackEnded",e.PLAYBACK_ERROR="playbackError",e.PLAYBACK_NOT_ALLOWED="playbackNotAllowed",e.PLAYBACK_METADATA_LOADED="playbackMetaDataLoaded",e.PLAYBACK_LOADED_DATA="playbackLoadedData",e.PLAYBACK_PAUSED="playbackPaused",e.PLAYBACK_PLAYING="playbackPlaying",e.PLAYBACK_PROGRESS="playbackProgress",e.PLAYBACK_RATE_CHANGED="playbackRateChanged",e.PLAYBACK_SEEKED="playbackSeeked",e.PLAYBACK_SEEKING="playbackSeeking",e.PLAYBACK_SEEK_ASKED="playbackSeekAsked",e.PLAYBACK_STALLED="playbackStalled",e.PLAYBACK_STARTED="playbackStarted",e.PLAYBACK_TIME_UPDATED="playbackTimeUpdated",e.PLAYBACK_WAITING="playbackWaiting",e.MANIFEST_VALIDITY_CHANGED="manifestValidityChanged",e.EVENT_MODE_ON_START="eventModeOnStart",e.EVENT_MODE_ON_RECEIVE="eventModeOnReceive",e.CONFORMANCE_VIOLATION="conformanceViolation",e.REPRESENTATION_SWITCH="representationSwitch",e}return n}(n("./src/core/events/EventsBase.js").default));t.default=o},"./src/streaming/MediaPlayerFactory.js":function(e,t,n){n.r(t);var r,i=n("./src/streaming/MediaPlayer.js"),a=function(){var e,t="application/dash+xml";function n(n,r,a){if(!n||!/^VIDEO$/i.test(n.nodeName))return null;if(n._dashjs_player)return n._dashjs_player;var s,o=n.id||n.name||"video element";if(!(r=r||[].slice.call(n.querySelectorAll("source")).filter((function(e){return e.type==t}))[0])&&n.src)(r=document.createElement("source")).src=n.src;else if(!r&&!n.src)return null;return a=a||{},(s=Object(i.default)(a).create()).initialize(n,r.src,n.autoplay),e||(e=s.getDebug().getLogger()),e.debug("Converted "+o+" to dash.js player and added content: "+r.src),n._dashjs_player=s,s}function r(e){return/^VIDEO$/i.test(e.nodeName)?e:r(e.parentNode)}return{create:n,createAll:function(e,i){var a=[];e=e||"[data-dashjs-player]";for(var s=(i=i||document).querySelectorAll(e),o=0;o<s.length;o++){var l=n(s[o],null);a.push(l)}for(var u=i.querySelectorAll('source[type="'+t+'"]'),c=0;c<u.length;c++){var d=n(r(u[c]),null);a.push(d)}return a}}}();!("undefined"!=typeof window&&window&&window.dashjs&&window.dashjs.skipAutoCreate)&&"undefined"!=typeof window&&window&&window.addEventListener&&("complete"===window.document.readyState?window.dashjs?a.createAll():r=window.setInterval((function(){window.dashjs&&(window.clearInterval(r),a.createAll())}),500):window.addEventListener("load",(function e(){window.removeEventListener("load",e),a.createAll()}))),t.default=a},"./src/streaming/SourceBufferSink.js":function(e,t,n){n.r(t);var r=n("./src/core/Debug.js"),i=n("./src/streaming/vo/DashJSError.js"),a=n("./src/core/FactoryMaker.js"),s=n("./src/core/errors/Errors.js"),o=n("./src/core/Settings.js"),l=n("./src/streaming/constants/Constants.js"),u=n("./src/streaming/vo/metrics/HTTPRequest.js"),c=n("./src/core/events/Events.js");function d(e){var t,n,a,d,f,h,p=this.context,g=Object(o.default)(p).getInstance(),m=e.textController,y=e.eventBus,v=[],_=[],T=!1,E=e.mediaSource,b=null;function S(e){return new Promise((function(t){M((function(){d.changeType&&d.changeType(e),t()}))}))}function A(e){return d=m.getTextSourceBuffer(e),Promise.resolve()}function w(){if("function"==typeof d.addEventListener)try{d.addEventListener("updateend",O,!1),d.addEventListener("error",P,!1),d.addEventListener("abort",P,!1)}catch(e){h=setInterval(O,50)}else h=setInterval(O,50)}function I(e){return new Promise((function(t){d&&g.get().streaming.buffer.useAppendWindow?M((function(){try{if(!d)return void t();var n=E.duration,r=0;e&&!isNaN(e.start)&&!isNaN(e.duration)&&isFinite(e.duration)&&(n=e.start+e.duration),e&&!isNaN(e.start)&&(r=e.start),d.appendWindowEnd===n&&d.appendWindowStart===r||(d.appendWindowStart=0,d.appendWindowEnd=n+.01,d.appendWindowStart=Math.max(r-.1,0),a.debug("Updated append window for ".concat(f.type,". Set start to ").concat(d.appendWindowStart," and end to ").concat(d.appendWindowEnd))),t()}catch(e){a.warn("Failed to set append window"),t()}})):t()}))}function C(e){return new Promise((function(t){d?M((function(){try{d.timestampOffset===e||isNaN(e)||(d.timestampOffset=e,a.debug("Set MSE timestamp offset to ".concat(e))),t()}catch(e){t()}})):t()}))}function R(){return new Promise((function(e){M((function(){var t=d.appendWindowStart,n=d.appendWindowEnd;d&&(d.abort(),d.appendWindowStart=t,d.appendWindowEnd=n),e()}))}))}function D(){if(!T&&_.length>0){T=!0;var e=_[0];_.splice(0,1);var t=function(){T=!1,_.length>0&&D.call(this),e&&e.data&&e.data.segmentType&&e.data.segmentType!==u.HTTPRequest.INIT_SEGMENT_TYPE&&delete e.data.bytes,e.promise.resolve({chunk:e.data})};try{b=e.request,0===e.data.bytes.byteLength?t.call(this):(d.appendBuffer?d.appendBuffer(e.data.bytes):d.append(e.data.bytes,e.data),M(t.bind(this)))}catch(t){a.fatal('SourceBuffer append failed "'+t+'"'),_.length>0?D():T=!1,delete e.data.bytes,e.promise.reject({chunk:e.data,error:new i.default(t.code,t.message)})}}}function N(){v.length>0&&(d.updating||(v.shift()(),N()))}function O(){d.updating||N()}function P(e){var t,r,i=e.target||{};t=c.default.SOURCE_BUFFER_ERROR,r={error:i,lastRequestAppended:b}||{},y.trigger(t,r,{streamId:f.streamInfo.id,mediaType:n})}function M(e){v.push(e),d.updating||N()}return t={getType:function(){return n},getAllBufferRanges:function(){try{return d.buffered}catch(e){return a.error("getAllBufferRanges exception: "+e.message),null}},getBuffer:function(){return d},append:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new Promise((function(r,a){e?(_.push({data:e,promise:{resolve:r,reject:a},request:n}),M(D.bind(t))):a({chunk:e,error:new i.default(s.default.APPEND_ERROR_CODE,s.default.APPEND_ERROR_MESSAGE)})}))},remove:function(e){return new Promise((function(t,n){var r=e.start,a=e.end;r>=0&&a>r?M((function(){try{d.remove(r,a),M((function(){t({from:r,to:a,unintended:!1}),e.resolve&&e.resolve()}))}catch(t){n({from:r,to:a,unintended:!1,error:new i.default(s.default.REMOVE_ERROR_CODE,s.default.REMOVE_ERROR_MESSAGE)}),e.reject&&e.reject(t)}})):t()}))},abort:function(){return new Promise((function(e){try{_=[],"open"===E.readyState?M((function(){try{d&&d.abort(),e()}catch(t){e()}})):d&&d.setTextTrack&&"ended"===E.readyState?(d.abort(),e()):e()}catch(t){e()}}))},reset:function(){if(d){try{v=[],function(){try{"function"==typeof d.removeEventListener&&(d.removeEventListener("updateend",O,!1),d.removeEventListener("error",P,!1),d.removeEventListener("abort",P,!1)),clearInterval(h)}catch(e){a.error(e)}}(),T=!1,_=[],d.getClassName&&"TextSourceBuffer"===d.getClassName()||(a.debug("Removing sourcebuffer from media source"),E.removeSourceBuffer(d))}catch(e){}d=null}b=null},updateTimestampOffset:C,initializeForStreamSwitch:function(e,t,r){n=(f=e).type;var i=f.codec;!function(e){d=e.getBuffer()}(r),w();var a=[];return a.push(R),a.push(I(f.streamInfo)),a.push(S(i)),t&&void 0!==t.MSETimeOffset&&a.push(C(t.MSETimeOffset)),Promise.all(a)},initializeForFirstUse:function(e,t,r){n=(f=t).type;var i=f.codec;try{if(i.match(/application\/mp4;\s*codecs="(stpp|wvtt).*"/i))return A(e);d=E.addSourceBuffer(i),w();var a=[];return a.push(I(f.streamInfo)),r&&void 0!==r.MSETimeOffset&&a.push(C(r.MSETimeOffset)),Promise.all(a)}catch(t){return f.type==l.default.TEXT&&!f.isFragmented||-1!==i.indexOf('codecs="stpp')||-1!==i.indexOf('codecs="vtt')?A(e):Promise.reject(t)}},updateAppendWindow:I,changeType:S},a=Object(r.default)(p).getInstance().getLogger(t),t}d.__dashjs_factory_name="SourceBufferSink";var f=a.default.getClassFactory(d);t.default=f},"./src/streaming/Stream.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/dash/constants/DashConstants.js"),a=n("./src/streaming/StreamProcessor.js"),s=n("./src/streaming/controllers/FragmentController.js"),o=n("./src/streaming/thumbnail/ThumbnailController.js"),l=n("./src/core/EventBus.js"),u=n("./src/core/events/Events.js"),c=n("./src/core/Debug.js"),d=n("./src/core/errors/Errors.js"),f=n("./src/core/FactoryMaker.js"),h=n("./src/streaming/vo/DashJSError.js"),p=n("./src/streaming/utils/BoxParser.js"),g=n("./src/streaming/utils/URLUtils.js"),m=n("./src/streaming/controllers/BlacklistController.js"),y=[r.default.VIDEO,r.default.AUDIO,r.default.TEXT,r.default.MUXED,r.default.IMAGE];function v(e){e=e||{};var t,n,f,v,_,T,E,b,S,A,w,I,C,R,D,N,O,P,M=this.context,x=Object(l.default)(M).getInstance(),L=Object(g.default)(M).getInstance(),k=e.manifestModel,F=e.mediaPlayerModel,U=e.dashMetrics,B=e.manifestUpdater,j=e.adapter,q=e.timelineConverter,H=e.capabilities,G=e.errHandler,V=e.abrController,Y=e.playbackController,Z=e.eventController,K=e.mediaController,z=e.protectionController,W=e.textController,X=e.videoModel,$=e.streamInfo,Q=e.settings;function J(t,s){return new Promise((function(l,c){oe(),A=!0,ue();var p,g=X.getElement();y.forEach((function(s){(s!==r.default.VIDEO||!g||g&&/^VIDEO$/i.test(g.nodeName))&&function(t,s){var l,c=j.getAllMediaInfoForType($,t),d=[],h=null;if(c&&0!==c.length){t===r.default.VIDEO&&(E=!0),t===r.default.AUDIO&&(b=!0);for(var p=0,g=c.length;p<g;p++)h=c[p],t===r.default.TEXT&&h.isEmbedded&&(W.addEmbeddedTrack($,h),d.push(h)),ee(h)&&K.addTrack(h);if(d.length>0&&(K.setInitialMediaSettingsForType(t,$),W.setInitialSettings(K.getInitialSettings(t)),W.addMediaInfosToBuffer($,t,d)),0!==(c=c.filter((function(e){return!e.isEmbedded}))).length)if(t!==r.default.IMAGE){x.trigger(u.default.STREAM_INITIALIZING,{streamInfo:$,mediaInfo:h}),K.setInitialMediaSettingsForType(t,$);var m=function(t,n){var i=t&&t.length>0?t[0]:null,s=w.getModel(i?i.type:null),o=i?i.type:null,l=i?i.mimeType:null,u=i?i.isFragmented:null,c=Object(a.default)(M).create({streamInfo:$,type:o,mimeType:l,timelineConverter:q,adapter:j,manifestModel:k,mediaPlayerModel:F,fragmentModel:s,dashMetrics:e.dashMetrics,baseURLController:e.baseURLController,segmentBaseController:e.segmentBaseController,abrController:V,playbackController:Y,mediaController:K,textController:W,errHandler:G,settings:Q,boxParser:D,segmentBlacklistController:C});c.initialize(n,E,u),f.push(c);for(var d=0;d<t.length;d++)c.addMediaInfo(t[d]);return o===r.default.TEXT&&W.addMediaInfosToBuffer($,o,t,s),c}(c,s);(l=K.getCurrentTrackFor(t,$.id))&&(V.updateTopQualityIndex(l),m.selectMediaInfo(t===r.default.TEXT&&l.isEmbedded?c[0]:l))}else(I=Object(o.default)(M).create({streamInfo:$,adapter:j,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:N,eventBus:x,events:u.default,dashConstants:i.default,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController})).initialize()}else n.info("No "+t+" data.")}(s,t)})),(p=s,new Promise((function(e){var t={},n=f.map((function(e){return e.createBufferSinks(p)}));Promise.all(n).then((function(n){n.forEach((function(e){e&&(t[e.getType()]=e)})),e(t)})).catch((function(){e(t)}))}))).then((function(e){if(A=!1,0===f.length){var t="No streams to play.";G.error(new h.default(d.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,t,k.getValue())),n.fatal(t)}else ce();W.createTracks($),l(e)})).catch((function(e){c(e)}))}))}function ee(e){var t,i=e?e.type:null;return i===r.default.MUXED?(t="Multiplexed representations are intentionally not supported, as they are not compliant with the DASH-AVC/264 guidelines",n.fatal(t),G.error(new h.default(d.default.MANIFEST_ERROR_ID_MULTIPLEXED_CODE,t,k.getValue())),!1):!(i!==r.default.TEXT&&i!==r.default.IMAGE&&e.contentProtection&&!H.supportsEncryptedMedia()&&(G.error(new h.default(d.default.CAPABILITY_MEDIAKEYS_ERROR_CODE,d.default.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE)),1))}function te(e){for(var t=f?f.length:0,n=0;n<t;n++){var r=f[n].getFragmentModel();r.abortRequests(),r.resetInitialSettings(),f[n].reset(!1,e)}W&&W.deactivateStream($),f=[],_=!1,T=!1,Te(!1),re(!1),x.trigger(u.default.STREAM_DEACTIVATED,{streamInfo:$})}function ne(e){te(e),v=!1,E=!1,b=!1,S={},A=!1,O=!1,P=[]}function re(e){O=e}function ie(){return $?$.start:NaN}function ae(){return $?$.id:null}function se(){return $}function oe(){if(!X||!V)throw new Error(r.default.MISSING_CONFIG_ERROR)}function le(e){e.error&&(G.error(e.error),n.fatal(e.error.message))}function ue(){if(Z){var e=j.getEventsFor($);Z.addInlineEvents(e)}}function ce(){for(var e=f.length,t=S.audio||S.video?new h.default(d.default.DATA_UPDATE_FAILED_ERROR_CODE,d.default.DATA_UPDATE_FAILED_ERROR_MESSAGE):null,n=0;n<e;n++)if(f[n].isUpdating()||A)return;if(z){z.clearMediaInfoArray();for(var i=0;i<e&&f[i];i++){var a=f[i].getType(),s=f[i].getMediaInfo();if(a===r.default.AUDIO||a===r.default.VIDEO||a===r.default.TEXT&&s.isFragmented){var o=f[i].getMediaInfo();o&&z.initializeForMedia(o)}}}t?G.error(t):v||(v=!0,x.trigger(u.default.STREAM_INITIALIZED,{streamInfo:$}))}function de(){var e=me(),t=e.length;if(0!==t){for(var i=0;i<t;i++)if(!e[i].isBufferingCompleted()&&(e[i].getType()===r.default.AUDIO||e[i].getType()===r.default.VIDEO))return void n.debug("onBufferingCompleted - One streamProcessor has finished but",e[i].getType(),"one is not buffering completed");n.debug("onBufferingCompleted - trigger STREAM_BUFFERING_COMPLETED"),T=!0,x.trigger(u.default.STREAM_BUFFERING_COMPLETED,{streamInfo:$},{streamInfo:$})}else n.warn("onBufferingCompleted - can't trigger STREAM_BUFFERING_COMPLETED because no streamProcessor is defined")}function fe(e){S[e.mediaType]=e.error,ce()}function he(e){Z&&Z.addInbandEvents(e.events)}function pe(e){return e&&e.type?ge(e.type):null}function ge(e){return e?me().filter((function(t){return t.getType()===e}))[0]:null}function me(){for(var e,t,n=[],i=0;i<f.length;i++)(e=(t=f[i]).getType())!==r.default.AUDIO&&e!==r.default.VIDEO&&e!==r.default.TEXT||n.push(t);return n}function ye(e,t){var n=se(),r=t.getStreamInfo();if(!r||!n)return!0;var i=j.getAdaptationForType(r.index,e,r),a=j.getAdaptationForType(n.index,e,n);return i&&a?!(!ve(a)&&ve(i)):!i&&!a}function ve(e){return!!e&&!!(e.ContentProtection||e.Representation&&e.Representation.length>0&&e.Representation[0].ContentProtection)}function _e(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e||!e.hasOwnProperty("getStreamInfo"))return!1;var r=e.getStreamInfo(),i=n?n.getStreamInfo():se();if(!r||!i)return!1;var a=j.getAdaptationForType(r.index,t,r),s=j.getAdaptationForType(i.index,t,i);if(!a||!s)return!a&&!s;var o=a&&s&&a.mimeType===s.mimeType,l=s.Representation_asArray.map((function(e){return e.codecs})),u=a.Representation_asArray.map((function(e){return e.codecs})),c=u.some((function(e){return l.indexOf(e)>-1})),d=u.some((function(e){return l.some((function(t){return H.codecRootCompatibleWithCodec(t,e)}))}));return c||d&&o}function Te(e){R=e}function Ee(){return R}return t={initialize:function(){x.on(u.default.BUFFERING_COMPLETED,de,t),x.on(u.default.DATA_UPDATE_COMPLETED,fe,t),x.on(u.default.INBAND_EVENTS,he,t),z&&(x.on(u.default.KEY_ERROR,le,t),x.on(u.default.SERVER_CERTIFICATE_UPDATED,le,t),x.on(u.default.LICENSE_REQUEST_COMPLETE,le,t),x.on(u.default.KEY_SYSTEM_SELECTED,le,t),x.on(u.default.KEY_SESSION_CREATED,le,t),x.on(u.default.KEY_STATUSES_CHANGED,le,t)),W.initializeForStream($),x.trigger(u.default.STREAM_UPDATED,{streamInfo:$})},getStreamId:function(){return $?$.id:null},activate:function(e,t){return new Promise((function(n,r){if(!_)return Ee()?(_=!0,x.trigger(u.default.STREAM_ACTIVATED,{streamInfo:$}),void n(t)):void function(e,t){return J(e,t)}(e,t).then((function(e){_=!0,x.trigger(u.default.STREAM_ACTIVATED,{streamInfo:$}),n(e)})).catch((function(e){r(e)}));n(t)}))},deactivate:te,getIsActive:function(){return _},getDuration:function(){return $?$.duration:NaN},getStartTime:ie,getId:ae,getStreamInfo:se,getHasAudioTrack:function(){return b},getHasVideoTrack:function(){return E},startPreloading:function(e,t){return new Promise((function(r,i){Ee()?i():(n.info("[startPreloading] Preloading next stream with id ".concat(ae())),Te(!0),J(e,t).then((function(){for(var e=0;e<f.length&&f[e];e++)f[e].setExplicitBufferingTime(ie()),f[e].getScheduleController().startScheduleTimer();r()})).catch((function(){Te(!1),i()})))}))},getThumbnailController:function(){return I},getBitrateListFor:function(e){if(oe(),e===r.default.IMAGE)return I?I.getBitrateList():[];var t=function(e){for(var t=null,n=0;n<f.length;n++)if((t=f[n]).getType()===e)return t.getMediaInfo();return null}(e);return V.getBitrateList(t)},updateData:function(e){return new Promise((function(t){A=!0,$=e,Z&&ue();for(var n=[],r=0,i=f.length;r<i;r++){var a=f[r],s=a.getMediaInfo();n.push(a.updateStreamInfo($));var o=j.getAllMediaInfoForType($,a.getType());if(o){a.clearMediaInfoArray();for(var l=0;l<o.length;l++){var c=o[l];a.addMediaInfo(o[l]),j.areMediaInfosEqual(s,c)&&(V.updateTopQualityIndex(c),n.push(a.selectMediaInfo(c)))}}}Promise.all(n).then((function(){for(n=[];P.length>0;){var e=P.pop(),t=e.newMediaInfo,r=pe(e.oldMediaInfo);if(!r)return;n.push(r.prepareTrackSwitch()),r.selectMediaInfo(t)}return Promise.all(n)})).then((function(){A=!1,ce(),x.trigger(u.default.STREAM_UPDATED,{streamInfo:$}),t()}))}))},reset:function(e){w&&(w.reset(),w=null),V&&$&&V.clearDataForStream($.id),C&&(C.reset(),C=null),ne(e),$=null,x.off(u.default.DATA_UPDATE_COMPLETED,fe,t),x.off(u.default.BUFFERING_COMPLETED,de,t),x.off(u.default.INBAND_EVENTS,he,t),z&&(x.off(u.default.KEY_ERROR,le,t),x.off(u.default.SERVER_CERTIFICATE_UPDATED,le,t),x.off(u.default.LICENSE_REQUEST_COMPLETE,le,t),x.off(u.default.KEY_SYSTEM_SELECTED,le,t),x.off(u.default.KEY_SESSION_CREATED,le,t),x.off(u.default.KEY_STATUSES_CHANGED,le,t))},getProcessors:me,setMediaSource:function(e){for(var t=0;t<f.length;)ee(f[t].getMediaInfo())?(f[t].setMediaSource(e),t++):(f[t].reset(),f.splice(t,1));if(0===f.length){var r="No streams to play.";G.error(new h.default(d.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,r+"nostreams",k.getValue())),n.fatal(r)}},isMediaCodecCompatible:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return _e(e,r.default.VIDEO,t)&&_e(e,r.default.AUDIO,t)},isProtectionCompatible:function(e){return!e||ye(r.default.VIDEO,e)&&ye(r.default.AUDIO,e)},getPreloaded:Ee,getIsEndedEventSignaled:function(){return O},setIsEndedEventSignaled:re,getAdapter:function(){return j},getHasFinishedBuffering:function(){return T},setPreloaded:Te,startScheduleControllers:function(){for(var e=f.length,t=0;t<e&&f[t];t++)f[t].getScheduleController().startScheduleTimer()},prepareTrackChange:function(e){if(_&&$){T=!1;var t=e.newMediaInfo,i=k.getValue();j.setCurrentMediaInfo($.id,t.type,t);var a=pe(t);if(a){var s=Y.getTime();n.info("Stream -  Process track changed at current time "+s),i.refreshManifestOnSwitchTrack?(P.push(e),B.getIsUpdating()||(n.debug("Stream -  Refreshing manifest for switch track"),B.refreshManifest())):a.selectMediaInfo(t).then((function(){t.type!==r.default.VIDEO&&t.type!==r.default.AUDIO||V.updateTopQualityIndex(t),a.prepareTrackSwitch()}))}}},prepareQualityChange:function(e){var t=ge(e.mediaType);t&&t.prepareQualityChange(e)}},function(){try{N=Object(c.default)(M).getInstance(),n=N.getLogger(t),ne(),D=Object(p.default)(M).getInstance(),C=Object(m.default)(M).create({updateEventName:u.default.SEGMENT_LOCATION_BLACKLIST_CHANGED,addBlacklistEventName:u.default.SEGMENT_LOCATION_BLACKLIST_ADD}),w=Object(s.default)(M).create({streamInfo:$,mediaPlayerModel:F,dashMetrics:U,errHandler:G,settings:Q,boxParser:D,dashConstants:i.default,urlUtils:L})}catch(e){throw e}}(),t}v.__dashjs_factory_name="Stream",t.default=f.default.getClassFactory(v)},"./src/streaming/StreamProcessor.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/dash/constants/DashConstants.js"),a=n("./src/streaming/constants/MetricsConstants.js"),s=n("./src/streaming/models/FragmentModel.js"),o=n("./src/streaming/controllers/BufferController.js"),l=n("./src/streaming/text/NotFragmentedTextBufferController.js"),u=n("./src/streaming/controllers/ScheduleController.js"),c=n("./src/dash/controllers/RepresentationController.js"),d=n("./src/core/FactoryMaker.js"),f=n("./src/streaming/utils/SupervisorTools.js"),h=n("./src/core/EventBus.js"),p=n("./src/core/events/Events.js"),g=n("./src/dash/DashHandler.js"),m=n("./src/core/errors/Errors.js"),y=n("./src/streaming/vo/DashJSError.js"),v=n("./src/core/Debug.js"),_=n("./src/streaming/utils/RequestModifier.js"),T=n("./src/streaming/utils/URLUtils.js"),E=n("./src/streaming/utils/BoxParser.js"),b=n("./src/streaming/vo/metrics/PlayList.js"),S=n("./src/dash/controllers/SegmentsController.js"),A=n("./src/streaming/vo/metrics/HTTPRequest.js");function w(e){e=e||{};var t,n,d,w,I,C,R,D,N,O,P,M,x,L=this.context,k=Object(h.default)(L).getInstance(),F=e.streamInfo,U=e.type,B=e.errHandler,j=e.mimeType,q=e.timelineConverter,H=e.adapter,G=e.manifestModel,V=e.mediaPlayerModel,Y=e.fragmentModel,Z=e.abrController,K=e.playbackController,z=e.mediaController,W=e.textController,X=e.dashMetrics,$=e.settings,Q=e.boxParser,J=e.segmentBlacklistController;function ee(){return F.id}function te(){return U}function ne(){return H.getIsTextTrack(D.getData())}function re(){I=[],w=null,x=0,N=!1,O=!1}function ie(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e.sender)if(K.getIsManifestUpdateInProgress())se();else if((!ne()||W.isTextEnabled())&&C&&e.representationId&&!C.appendInitSegmentFromCache(e.representationId)){var n=D.getCurrentRepresentation();if(0===n.range)return void ae();var r=P?P.getInitRequest(w,n):null;r?Y.executeRequest(r):t&&(R.setInitSegmentRequired(!0),se())}}function ae(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(K.getIsManifestUpdateInProgress()||C.getIsPruningInProgress())se();else{var i=function(){var e,t=Te();if(isNaN(x)||te()===r.default.TEXT&&!W.isTextEnabled())return null;var n=N;if(P){var i=D&&t?D.getRepresentationForQuality(t.quality):null;e=n?P.getSegmentRequestForTime(w,i,x):P.getNextSegmentRequest(w,i)}return e}();i?(N=!1,function(e){isNaN(e.startTime+e.duration)||(x=e.startTime+e.duration),e.delayLoadingTime=(new Date).getTime()+R.getTimeToLoadDelay(),R.setTimeToLoadDelay(0),function(e){var t=e.url;return e.range&&(t=t.concat("_",e.range)),J.contains(t)}(e)?(n.warn("Fragment request url ".concat(e.url," for stream id ").concat(F.id," and media type ").concat(U," is on the ignore list and will be skipped")),se()):(n.debug("Next fragment request url for stream id ".concat(F.id," and media type ").concat(U," is ").concat(e.url)),Y.executeRequest(e))}(i)):function(e){var t=D.getCurrentRepresentation();if($.get().streaming.gaps.enableSeekFix&&!d&&N&&K.isSeeking()){var r=P.getValidSeekTimeCloseToTargetTime(x,w,t,$.get().streaming.gaps.threshold);if(!isNaN(r))return void K.seek(r,!1,!1)}if(P.isLastSegmentRequested(t,x)){var i=P.getCurrentIndex();return n.debug("Segment requesting for stream ".concat(F.id," has finished")),k.trigger(p.default.STREAM_REQUESTING_COMPLETED,{segmentIndex:i},{streamId:F.id,mediaType:U}),C.segmentRequestingCompleted(i),void R.clearScheduleTimer()}e&&se()}(t)}}function se(){R.startScheduleTimer($.get().streaming.lowLatencyEnabled?$.get().streaming.scheduling.lowLatencyTimeout:$.get().streaming.scheduling.defaultTimeout)}function oe(e){e.error||(R.setCurrentRepresentation(H.convertRepresentationToRepresentationInfo(e.currentRepresentation)),C.getIsBufferingCompleted()||C.updateBufferTimestampOffset(e.currentRepresentation))}function le(e){X.addBufferState(U,e.state,R.getBufferTarget()),e.state!==a.default.BUFFER_EMPTY||K.isSeeking()||(n.info("Buffer is empty! Stalling!"),X.pushPlayListTraceMetrics(new Date,b.PlayListTrace.REBUFFERING_REASON))}function ue(e){Y.syncExecutedRequestsWithBufferedRange(C.getBuffer().getAllBufferRanges(),F.duration),e.quotaExceeded&&e.from>K.getTime()&&Ie(e.from),e.hasEnoughSpaceToAppend&&e.quotaExceeded&&R.startScheduleTimer()}function ce(e){if(e&&e.lastRequestAppended&&e.lastRequestAppended.url){var t=e.lastRequestAppended.url;e.lastRequestAppended.range&&(t=t.concat("_",e.lastRequestAppended.range)),n.warn("Blacklisting segment with url ".concat(t)),J.add(t)}}function de(){Ae(),O=!1}function fe(e){n.info("onFragmentLoadingAbandoned request: "+e.request.url+" has been aborted"),K.isSeeking()||R.getSwitchStrack()||O||(n.info("onFragmentLoadingAbandoned request: "+e.request.url+" has to be downloaded again, origin is not seeking process or switch track call"),e.request&&e.request.isInitializationRequest()?R.setInitSegmentRequired(!0):Ie(e.request.startTime+e.request.duration/2),R.startScheduleTimer(0))}function he(e){n.info("OnFragmentLoadingCompleted for stream id "+F.id+" and media type "+U+" - Url:",e.request?e.request.url:"undefined",e.request.range?", Range:"+e.request.range:""),ne()&&R.startScheduleTimer(0),e.error&&e.request.serviceLocation&&function(e){n.info("Fragment loading completed with an error"),e&&e.request&&e.request.type&&(e.request.type===A.HTTPRequest.INIT_SEGMENT_TYPE?ie({representationId:e.request.representationId,sender:{}},!1):e.request.type===A.HTTPRequest.MEDIA_SEGMENT_TYPE&&(Ie(e.request.startTime+e.request.duration/2),ae({},!1)))}(e)}function pe(){Ie(K.getTime()),_e().startScheduleTimer()}function ge(e){var t=e.currentTrackInfo;if(t){var n=I.find((function(e){return e.index===t.index&&e.lang===t.lang}));n&&ve(n).then((function(){C.setIsBufferingCompleted(!1),Ie(K.getTime()),R.setInitSegmentRequired(!0),R.startScheduleTimer()}))}}function me(e){Ie(e.quotaExceededTime),R.clearScheduleTimer()}function ye(){return C?C.getBuffer():null}function ve(e){e===w||e&&w&&e.type!==w.type||(w=e);var t=H.getRealAdaptation(F,w),n=H.getVoRepresentations(w);if(D){var i,a=D.getData(),s=Z.getMaxAllowedIndexFor(U,F.id),o=Z.getMinAllowedIndexFor(U,F.id),l=null;return null!==a&&a.id===t.id||U===r.default.TEXT?i=Z.getQualityFor(U,F.id):(l=Z.getThroughputHistory().getAverageThroughput(U,d)||Z.getInitialBitrateFor(U,F.id),i=Z.getQualityForBitrate(w,l,F.id)),void 0!==o&&i<o&&(i=o),i>s&&(i=s),D.updateData(t,n,U,w.isFragmented,i)}return Promise.resolve()}function _e(){return R}function Te(e){var t;return void 0!==e?(Object(f.checkInteger)(e),t=D?D.getRepresentationForQuality(e):null):t=D?D.getCurrentRepresentation():null,H.convertRepresentationToRepresentationInfo(t)}function Ee(){return!!C&&C.getIsBufferingCompleted()}function be(e){var t=e.chunk,n=t.bytes,r=t.quality,i=Te(r),a=D&&i?D.getRepresentationForQuality(i.quality):null;if(i&&a){var o=H.getEventsFor(i.mediaInfo),l=H.getEventsFor(i,a);if(o&&o.length>0||l&&l.length>0){var u=function(e,t,n,r){try{for(var i={},a=[],s=n.concat(r),o=0,l=s.length;o<l;o++)i[s[o].schemeIdUri+"/"+s[o].value]=s[o];var u=Object(E.default)(L).getInstance().parse(e),c=u.getBoxes("emsg");if(!c||0===c.length)return a;for(var d=u.getBox("sidx"),f=!d||isNaN(d.earliest_presentation_time)||isNaN(d.timescale)?t&&!isNaN(t.mediaStartTime)?t.mediaStartTime:0:d.earliest_presentation_time/d.timescale,h=Math.max(f,0),p=D.getCurrentRepresentation(),g=0,m=c.length;g<m;g++){var y=H.getEvent(c[g],i,h,p);y&&a.push(y)}return a}catch(e){return[]}}(n,Y.getRequests({state:s.default.FRAGMENT_MODEL_EXECUTED,quality:r,index:t.index})[0],o,l);k.trigger(p.default.INBAND_EVENTS,{events:u},{streamId:F.id})}}}function Se(){var e=K.getTime();$.get().streaming.buffer.flushBufferAtTrackSwitch&&K.seek(e+.001,!1,!0),Ie(e),C.setSeekTarget(e),R.startScheduleTimer()}function Ae(){var e=K.getTime();Ie(C.getContinuousBufferTimeForTargetTime(e)),R.startScheduleTimer()}function we(e){e&&!isNaN(e.time)&&(Ie(e.time),C.setSeekTarget(e.time))}function Ie(e){x=e,N=!0}return t={initialize:function(n,a,s){M=Object(S.default)(L).create({events:p.default,eventBus:k,streamInfo:F,timelineConverter:q,dashConstants:i.default,segmentBaseController:e.segmentBaseController,type:U}),P=Object(g.default)(L).create({streamInfo:F,type:U,timelineConverter:q,dashMetrics:X,mediaPlayerModel:V,baseURLController:e.baseURLController,errHandler:B,segmentsController:M,settings:$,boxParser:Q,events:p.default,eventBus:k,errors:m.default,debug:Object(v.default)(L).getInstance(),requestModifier:Object(_.default)(L).getInstance(),dashConstants:i.default,constants:r.default,urlUtils:Object(T.default)(L).getInstance()}),d=F.manifestInfo.isDynamic,P.initialize(d),Z.registerStreamType(U,t),D=Object(c.default)(L).create({streamInfo:F,type:U,abrController:Z,dashMetrics:X,playbackController:K,timelineConverter:q,dashConstants:i.default,events:p.default,eventBus:k,errors:m.default,isDynamic:d,segmentsController:M}),C=function(e,t){return e?e!==r.default.TEXT||t?Object(o.default)(L).create({streamInfo:F,type:e,mediaPlayerModel:V,manifestModel:G,fragmentModel:Y,errHandler:B,mediaController:z,representationController:D,adapter:H,textController:W,abrController:Z,playbackController:K,settings:$}):Object(l.default)(L).create({streamInfo:F,type:e,mimeType:j,fragmentModel:Y,textController:W,errHandler:B,settings:$}):(B.error(new y.default(m.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,m.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+"not properly defined")),null)}(U,s),C&&C.initialize(n),(R=Object(u.default)(L).create({streamInfo:F,type:U,mimeType:j,adapter:H,dashMetrics:X,mediaPlayerModel:V,fragmentModel:Y,abrController:Z,playbackController:K,textController:W,mediaController:z,bufferController:C,settings:$})).initialize(a),x=0,N=!1},getStreamId:ee,getType:te,isUpdating:function(){return!!D&&D.isUpdating()},getBufferController:function(){return C},getFragmentModel:function(){return Y},getScheduleController:_e,getRepresentationController:function(){return D},getRepresentationInfo:Te,getBufferLevel:function(){return C?C.getBufferLevel():0},isBufferingCompleted:Ee,createBufferSinks:function(e){var t=ye();return t?Promise.resolve(t):C?C.createBufferSink(w,e):Promise.resolve(null)},updateStreamInfo:function(e){return F=e,Ee()?Promise.resolve():C.updateAppendWindow()},getStreamInfo:function(){return F},selectMediaInfo:ve,clearMediaInfoArray:function(){I=[]},addMediaInfo:function(e){-1===I.indexOf(e)&&I.push(e)},prepareTrackSwitch:function(){return new Promise((function(e){n.debug("Preparing track switch for type ".concat(U));var t=U===r.default.TEXT||$.get().streaming.trackSwitchMode[U]===r.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE&&K.getTimeToStreamEnd(F)>$.get().streaming.buffer.stallThreshold;if(C.getIsBufferingCompleted()&&!t)return C.prepareForNonReplacementTrackSwitch(w.codec).then((function(){k.trigger(p.default.BUFFERING_COMPLETED,{},{streamId:F.id,mediaType:U})})).catch((function(){k.trigger(p.default.BUFFERING_COMPLETED,{},{streamId:F.id,mediaType:U})})),void e();R.clearScheduleTimer(),R.setSwitchTrack(!0),t?(k.trigger(p.default.BUFFER_REPLACEMENT_STARTED,{mediaType:U,streamId:F.id},{mediaType:U,streamId:F.id}),Y.abortRequests(),C.prepareForReplacementTrackSwitch(w.codec).then((function(){var e=Te();return C.updateBufferTimestampOffset(e)})).then((function(){Se(),e()})).catch((function(){Se(),e()}))):C.prepareForNonReplacementTrackSwitch(w.codec).then((function(){Ae(),e()})).catch((function(){Ae(),e()}))}))},prepareQualityChange:function(e){n.debug("Preparing quality switch for type ".concat(U));var t=e.newQuality;O=!0,R.clearScheduleTimer();var r=Te(t);R.setCurrentRepresentation(r),D.prepareQualityChange(t),Y.abortRequests(),C.updateBufferTimestampOffset(r).then((function(){e.reason&&e.reason.forceReplace?(k.trigger(p.default.BUFFER_REPLACEMENT_STARTED,{mediaType:U,streamId:F.id},{mediaType:U,streamId:F.id}),C.prepareForReplacementQualitySwitch().then((function(){Se(),O=!1})).catch((function(){Se(),O=!1}))):$.get().streaming.buffer.fastSwitchEnabled?function(e){var t=K.getTime(),n=1.5,r=Y.getRequests({state:s.default.FRAGMENT_MODEL_EXECUTED,time:t+n,threshold:0})[0];if(r&&!ne()){var i=C.getBufferLevel(),o=Z.getAbandonmentStateFor(F.id,U);r.quality<e.quality&&i>=n&&o!==a.default.ABANDON_LOAD?(Ie(t+n),R.setCheckPlaybackQuality(!1),R.startScheduleTimer()):de()}else R.startScheduleTimer();O=!1}(r):de(),X.pushPlayListTraceMetrics(new Date,b.PlayListTrace.REPRESENTATION_SWITCH_STOP_REASON),X.createPlaylistTraceMetrics(r.id,1e3*K.getTime(),K.getPlaybackRate())}))},getMediaInfo:function(){return w},getMediaSource:function(){return C.getMediaSource()},setMediaSource:function(e){C.setMediaSource(e)},getBuffer:ye,setExplicitBufferingTime:Ie,finalisePlayList:function(e,t){X.pushPlayListTraceMetrics(e,t)},probeNextRequest:function(){var e=Te(),t=D&&e?D.getRepresentationForQuality(e.quality):null;return P.getNextSegmentRequestIdempotent(w,t)},prepareInnerPeriodPlaybackSeeking:function(e){return new Promise((function(t){R.clearScheduleTimer(),Y.abortRequests(),C.prepareForPlaybackSeek().then((function(){var t=C.getAllRangesWithSafetyFactor(e.seekTime);return C.clearBuffers(t)})).then((function(){var n=C.getContinuousBufferTimeForTargetTime(e.seekTime);if(!isNaN(F.duration)&&isFinite(F.duration)&&n>=F.start+F.duration)C.setIsBufferingCompleted(!0),t();else{Ie(n),C.setSeekTarget(n);var r=[];r.push(C.updateAppendWindow());var i=Te();r.push(C.updateBufferTimestampOffset(i)),Promise.all(r).then((function(){R.setInitSegmentRequired(!0),R.setCheckPlaybackQuality(!1),R.startScheduleTimer(),t()}))}})).catch((function(e){n.error(e)}))}))},prepareOuterPeriodPlaybackSeeking:function(){return new Promise((function(e,t){try{R.clearScheduleTimer(),Y.abortRequests(),C.prepareForPlaybackSeek().then((function(){return C.pruneAllSafely()})).then((function(){e()}))}catch(e){t(e)}}))},reset:function(e,n){P&&P.reset(),C&&(C.reset(e,n),C=null),R&&(R.reset(),R=null),D&&(D.reset(),D=null),M&&(M=null),Z&&Z.unRegisterStreamType(ee(),U),k.off(p.default.DATA_UPDATE_COMPLETED,oe,t),k.off(p.default.INIT_FRAGMENT_NEEDED,ie,t),k.off(p.default.MEDIA_FRAGMENT_NEEDED,ae,t),k.off(p.default.MEDIA_FRAGMENT_LOADED,be,t),k.off(p.default.BUFFER_LEVEL_STATE_CHANGED,le,t),k.off(p.default.BUFFER_CLEARED,ue,t),k.off(p.default.SEEK_TARGET,we,t),k.off(p.default.FRAGMENT_LOADING_ABANDONED,fe,t),k.off(p.default.FRAGMENT_LOADING_COMPLETED,he,t),k.off(p.default.SET_FRAGMENTED_TEXT_AFTER_DISABLED,pe,t),k.off(p.default.SET_NON_FRAGMENTED_TEXT,ge,t),k.off(p.default.QUOTA_EXCEEDED,me,t),k.off(p.default.SOURCE_BUFFER_ERROR,ce,t),re(),U=null,F=null}},n=Object(v.default)(L).getInstance().getLogger(t),re(),k.on(p.default.DATA_UPDATE_COMPLETED,oe,t,{priority:h.default.EVENT_PRIORITY_HIGH}),k.on(p.default.INIT_FRAGMENT_NEEDED,ie,t),k.on(p.default.MEDIA_FRAGMENT_NEEDED,ae,t),k.on(p.default.MEDIA_FRAGMENT_LOADED,be,t),k.on(p.default.BUFFER_LEVEL_STATE_CHANGED,le,t),k.on(p.default.BUFFER_CLEARED,ue,t),k.on(p.default.SEEK_TARGET,we,t),k.on(p.default.FRAGMENT_LOADING_ABANDONED,fe,t),k.on(p.default.FRAGMENT_LOADING_COMPLETED,he,t),k.on(p.default.QUOTA_EXCEEDED,me,t),k.on(p.default.SET_FRAGMENTED_TEXT_AFTER_DISABLED,pe,t),k.on(p.default.SET_NON_FRAGMENTED_TEXT,ge,t),k.on(p.default.SOURCE_BUFFER_ERROR,ce,t),t}w.__dashjs_factory_name="StreamProcessor",t.default=d.default.getClassFactory(w)},"./src/streaming/XlinkLoader.js":function(e,t,n){n.r(t);var r=n("./src/streaming/vo/DashJSError.js"),i=n("./src/streaming/net/URLLoader.js"),a=n("./src/streaming/vo/metrics/HTTPRequest.js"),s=n("./src/streaming/vo/TextRequest.js"),o=n("./src/core/EventBus.js"),l=n("./src/core/events/Events.js"),u=n("./src/core/FactoryMaker.js"),c=n("./src/core/errors/Errors.js");function d(e){e=e||{};var t=this.context,n=Object(o.default)(t).getInstance(),u=Object(i.default)(t).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,errors:c.default});return{load:function(e,t,i){var o=function(a,s){t.resolved=!0,t.resolvedContent=a||null,n.trigger(l.default.XLINK_ELEMENT_LOADED,{element:t,resolveObject:i,error:a||s?null:new r.default(c.default.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE,c.default.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE+e)})};if("urn:mpeg:dash:resolve-to-zero:2013"===e)o(null,!0);else{var d=new s.default(e,a.HTTPRequest.XLINK_EXPANSION_TYPE);u.load({request:d,success:function(e){o(e)},error:function(){o(null)}})}},reset:function(){u&&(u.abort(),u=null)}}}d.__dashjs_factory_name="XlinkLoader",t.default=u.default.getClassFactory(d)},"./src/streaming/constants/ConformanceViolationConstants.js":function(e,t,n){n.r(t),t.default={LEVELS:{SUGGESTION:"Suggestion",WARNING:"Warning",ERROR:"Error"},EVENTS:{NO_UTC_TIMING_ELEMENT:{key:"NO_UTC_TIMING_ELEMENT",message:"No UTCTiming element is present in the manifest. You may experience playback failures. For a detailed validation use https://conformance.dashif.org/"},NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE:{key:"NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE",message:'SMPTE 2052-1:2013 defines the attribute name as "imageType" and does not define "imagetype"'},INVALID_DVR_WINDOW:{key:"INVALID_DVR_WINDOW",message:"No valid segment found when applying a specification compliant DVR window calculation. Using SegmentTimeline entries as a fallback."}}}},"./src/streaming/constants/Constants.js":function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(t);var i=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t,n,i;return t=e,(n=[{key:"init",value:function(){this.STREAM="stream",this.VIDEO="video",this.AUDIO="audio",this.TEXT="text",this.MUXED="muxed",this.IMAGE="image",this.STPP="stpp",this.TTML="ttml",this.VTT="vtt",this.WVTT="wvtt",this.ABR_STRATEGY_DYNAMIC="abrDynamic",this.ABR_STRATEGY_BOLA="abrBola",this.ABR_STRATEGY_L2A="abrL2A",this.ABR_STRATEGY_LoLP="abrLoLP",this.ABR_STRATEGY_THROUGHPUT="abrThroughput",this.ABR_FETCH_THROUGHPUT_CALCULATION_DOWNLOADED_DATA="abrFetchThroughputCalculationDownloadedData",this.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING="abrFetchThroughputCalculationMoofParsing",this.ABR_FETCH_THROUGHPUT_CALCULATION_AAST="abrFetchThroughputCalculationAAST",this.LIVE_CATCHUP_MODE_DEFAULT="liveCatchupModeDefault",this.LIVE_CATCHUP_MODE_LOLP="liveCatchupModeLoLP",this.MOVING_AVERAGE_SLIDING_WINDOW="slidingWindow",this.MOVING_AVERAGE_EWMA="ewma",this.BAD_ARGUMENT_ERROR="Invalid Arguments",this.MISSING_CONFIG_ERROR="Missing config parameter(s)",this.TRACK_SWITCH_MODE_ALWAYS_REPLACE="alwaysReplace",this.TRACK_SWITCH_MODE_NEVER_REPLACE="neverReplace",this.TRACK_SELECTION_MODE_FIRST_TRACK="firstTrack",this.TRACK_SELECTION_MODE_HIGHEST_BITRATE="highestBitrate",this.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY="highestEfficiency",this.TRACK_SELECTION_MODE_WIDEST_RANGE="widestRange",this.TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY="highestSelectionPriority",this.CMCD_MODE_QUERY="query",this.CMCD_MODE_HEADER="header",this.LOCATION="Location",this.INITIALIZE="initialize",this.TEXT_SHOWING="showing",this.TEXT_HIDDEN="hidden",this.CC1="CC1",this.CC3="CC3",this.UTF8="utf-8",this.SCHEME_ID_URI="schemeIdUri",this.START_TIME="starttime",this.SERVICE_DESCRIPTION_LL_SCHEME="urn:dvb:dash:lowlatency:scope:2019",this.SUPPLEMENTAL_PROPERTY_LL_SCHEME="urn:dvb:dash:lowlatency:critical:2019",this.XML="XML",this.ARRAY_BUFFER="ArrayBuffer",this.DVB_REPORTING_URL="dvb:reportingUrl",this.DVB_PROBABILITY="dvb:probability",this.VIDEO_ELEMENT_READY_STATES={HAVE_NOTHING:0,HAVE_METADATA:1,HAVE_CURRENT_DATA:2,HAVE_FUTURE_DATA:3,HAVE_ENOUGH_DATA:4}}}])&&r(t.prototype,n),i&&r(t,i),e}());t.default=i},"./src/streaming/constants/MetricsConstants.js":function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(t);var i=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t,n,i;return t=e,(n=[{key:"init",value:function(){this.TCP_CONNECTION="TcpList",this.HTTP_REQUEST="HttpList",this.TRACK_SWITCH="RepSwitchList",this.BUFFER_LEVEL="BufferLevel",this.BUFFER_LOADED="bufferLoaded",this.ABANDON_LOAD="abandonload",this.ALLOW_LOAD="allowload",this.BUFFER_EMPTY="bufferStalled",this.BUFFER_STATE="BufferState",this.DVR_INFO="DVRInfo",this.DROPPED_FRAMES="DroppedFrames",this.SCHEDULING_INFO="SchedulingInfo",this.REQUESTS_QUEUE="RequestsQueue",this.MANIFEST_UPDATE="ManifestUpdate",this.MANIFEST_UPDATE_STREAM_INFO="ManifestUpdatePeriodInfo",this.MANIFEST_UPDATE_TRACK_INFO="ManifestUpdateRepresentationInfo",this.PLAY_LIST="PlayList",this.DVB_ERRORS="DVBErrors"}}])&&r(t.prototype,n),i&&r(t,i),e}());t.default=i},"./src/streaming/constants/ProtectionConstants.js":function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(t);var i=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t,n,i;return t=e,(n=[{key:"init",value:function(){this.CLEARKEY_KEYSTEM_STRING="org.w3.clearkey",this.WIDEVINE_KEYSTEM_STRING="com.widevine.alpha",this.PLAYREADY_KEYSTEM_STRING="com.microsoft.playready",this.INITIALIZATION_DATA_TYPE_CENC="cenc",this.INITIALIZATION_DATA_TYPE_KEYIDS="keyids",this.INITIALIZATION_DATA_TYPE_WEBM="webm"}}])&&r(t.prototype,n),i&&r(t,i),e}());t.default=i},"./src/streaming/controllers/AbrController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/rules/abr/ABRRulesCollection.js"),i=n("./src/streaming/constants/Constants.js"),a=n("./src/streaming/constants/MetricsConstants.js"),s=n("./src/streaming/vo/BitrateInfo.js"),o=n("./src/streaming/models/FragmentModel.js"),l=n("./src/core/EventBus.js"),u=n("./src/core/events/Events.js"),c=n("./src/core/FactoryMaker.js"),d=n("./src/streaming/rules/RulesContext.js"),f=n("./src/streaming/rules/SwitchRequest.js"),h=n("./src/streaming/rules/SwitchRequestHistory.js"),p=n("./src/streaming/rules/DroppedFramesHistory.js"),g=n("./src/streaming/rules/ThroughputHistory.js"),m=n("./src/core/Debug.js"),y=n("./src/streaming/vo/metrics/HTTPRequest.js"),v=n("./src/streaming/utils/SupervisorTools.js"),_=n("./src/streaming/MediaPlayerEvents.js");function T(){var e,t,n,c,T,E,b,S,A,w,I,C,R,D,N,O,P,M,x,L,k,F,U,B,j,q=this.context,H=Object(m.default)(q).getInstance(),G=Object(l.default)(q).getInstance();function V(){T={},E={},S={},b={},M={},k={},F={},U={},void 0===w&&(w=!1),x&&x.reset(),P=void 0,x=void 0,L=void 0,clearTimeout(A),A=null}function Y(t){var r=t.request.mediaType,i=t.streamId;if(r&&i&&b[i]&&j.get().streaming.abr.autoSwitchBitrate[r]){var s=b[i][r];if(s){var l=Object(d.default)(q).create({abrController:e,streamProcessor:s,currentRequest:t.request,useBufferOccupancyABR:k[r],useL2AABR:F[r],useLoLPABR:U[r],videoModel:D}),u=n.shouldAbandonFragment(l,i);if(u.quality>f.default.NO_CHANGE){var h=s.getFragmentModel();h.getRequests({state:o.default.FRAGMENT_MODEL_LOADING,index:t.request.index})[0]&&(h.abortRequests(),S[i][r].state=a.default.ABANDON_LOAD,M[i][r].reset(),M[i][r].push({oldValue:X(r,i),newValue:u.quality,confidence:1,reason:u.reason}),$(r,c.getActiveStreamInfo(),u.quality,u.reason),clearTimeout(A),A=setTimeout((function(){S[i][r].state=a.default.ALLOW_LOAD,A=null}),j.get().streaming.abandonLoadTimeout))}}}}function Z(e){e.mediaType===i.default.VIDEO&&(void 0!==P&&x.push(e.streamId,P,D.getPlaybackQuality()),P=e.newQuality)}function K(e){var n,r;e.metric!==a.default.HTTP_REQUEST||!e.value||e.value.type!==y.HTTPRequest.MEDIA_SEGMENT_TYPE||e.mediaType!==i.default.AUDIO&&e.mediaType!==i.default.VIDEO||L.push(e.mediaType,e.value,j.get().streaming.abr.useDeadTimeLatency),e.metric!==a.default.BUFFER_LEVEL||e.mediaType!==i.default.AUDIO&&e.mediaType!==i.default.VIDEO||(n=e.mediaType,r=.001*e.value.level,j.get().streaming.abr.ABRStrategy===i.default.ABR_STRATEGY_DYNAMIC&&function(e,n){var r=N.getStableBufferTime(),i=r,a=.5*r,s=k[e],o=n>(s?a:i);k[e]=o,o!==s&&(o?t.info("["+e+"] switching from throughput to buffer occupancy ABR rule (buffer: "+n.toFixed(3)+")."):t.info("["+e+"] switching from buffer occupancy to throughput ABR rule (buffer: "+n.toFixed(3)+")."))}(n,r))}function z(e,t){try{var n;return T[t]=T[t]||{},T[t].hasOwnProperty(e)||(T[t][e]=0),n=function(e,t){var n=T[t][e],r=n;if(!b[t]||!b[t][e])return r;var i=W(e,t);void 0!==i&&(r=Math.max(n,i));var a=function(e,t){try{var n=j.get().streaming.abr.maxBitrate[e];return n>-1?J(b[t][e].getMediaInfo(),n,t):void 0}catch(e){return}}(e,t);return void 0!==a&&(r=Math.min(r,a)),r}(e,t),n=function(e,t,n){var r=T[n][t],i=j.get().streaming.abr.maxRepresentationRatio[t];return isNaN(i)||i>=1||i<0?e:Math.min(e,Math.round(r*i))}(n,e,t),n=function(e,t,n){if(t!==i.default.VIDEO||!j.get().streaming.abr.limitBitrateByPortal||!b[n]||!b[n][t])return e;w||te();var r=b[n][t].getStreamInfo(),a=R.getAdaptationForType(r.index,t,r).Representation,s=e;if(I>0&&C>0){for(;s>0&&a[s]&&I<a[s].width&&I-a[s-1].width<a[s].width-I;)s-=1;for(;s<a.length-1&&a[s].width===a[s+1].width;)s+=1}return s}(n,e,t),n}catch(e){return}}function W(e,t){try{return function(e,t){try{var n=j.get().streaming.abr.minBitrate[e];if(n>-1){var r=b[t][e].getMediaInfo(),i=ee(r),a=J(r,n,t);return i[a]&&a<i.length-1&&i[a].bitrate<1e3*n&&a++,a}return}catch(e){return}}(e,t)}catch(e){return}}function X(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;try{return t||(t=c.getActiveStreamInfo().id),e&&b[t]&&b[t][e]&&t?(E[t]=E[t]||{},E[t].hasOwnProperty(e)||(E[t][e]=0),E[t][e]):0}catch(e){return 0}}function $(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(t&&t.id&&e){var i=t.id,a=X(e,i);Object(v.checkInteger)(n);var s=z(e,i);n!==a&&n>=0&&n<=s&&Q(e,a,n,s,r,i)}}function Q(e,n,r,i,a,s){if(e&&b[s]&&b[s][e]){var o=b[s][e].getStreamInfo(),l=o&&o.manifestInfo&&o.manifestInfo.isDynamic,c=B.getCurrentBufferLevel(e);t.info("Stream ID: "+s+" ["+e+"] switch from "+n+" to "+r+"/"+i+" (buffer: "+c+") "+(a?JSON.stringify(a):".")),E[s]=E[s]||{},E[s][e]=r;var d=function(e,t,n){if(t&&b&&b[e]&&b[e][t]){var r=ee(b[e][t].getMediaInfo());return r[n]?r[n]:null}return null}(s,e,r);G.trigger(u.default.QUALITY_CHANGE_REQUESTED,{oldQuality:n,newQuality:r,reason:a,streamInfo:o,bitrateInfo:d,maxIdx:i,mediaType:e},{streamId:o.id,mediaType:e});var f=L.getAverageThroughput(e,l);isNaN(f)||O.setSavedBitrateSettings(e,f)}}function J(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=e&&e.type?b[n][e.type].getRepresentationInfo():null;if(j.get().streaming.abr.useDeadTimeLatency&&r&&i&&i.fragmentDuration){r/=1e3;var a=i.fragmentDuration;if(r>a)return 0;t*=1-r/a}for(var s=ee(e),o=s.length-1;o>=0;o--)if(1e3*t>=s[o].bitrate)return o;return 0}function ee(e){var t=[];if(!e||!e.bitrateList)return t;for(var n,r=e.bitrateList,i=e.type,a=0,o=r.length;a<o;a++)(n=new s.default).mediaType=i,n.qualityIndex=a,n.bitrate=r[a].bandwidth,n.width=r[a].width,n.height=r[a].height,n.scanType=r[a].scanType,t.push(n);return t}function te(){if(D){var e=j.get().streaming.abr.usePixelRatioInLimitBitrateByPortal&&window.hasOwnProperty("devicePixelRatio")?window.devicePixelRatio:1;I=D.getClientWidth()*e,C=D.getClientHeight()*e}}return e={initialize:function(){x=Object(p.default)(q).create(),L=Object(g.default)(q).create({settings:j}),(n=Object(r.default)(q).create({dashMetrics:B,mediaPlayerModel:N,settings:j})).initialize(),G.on(_.default.QUALITY_CHANGE_RENDERED,Z,e),G.on(_.default.METRIC_ADDED,K,e),G.on(u.default.LOADING_PROGRESS,Y,e)},isPlayingAtTopQuality:function(e){var t=e?e.id:null,n=X(i.default.AUDIO,t),r=X(i.default.VIDEO,t);return n===z(i.default.AUDIO,t)&&r===z(i.default.VIDEO,t)},updateTopQualityIndex:function(e){var t=e.type,n=e.streamInfo.id,r=e.representationCount-1;return T[n]=T[n]||{},T[n][t]=r,r},clearDataForStream:function(e){x&&x.clearForStream(e),b[e]&&delete b[e],M[e]&&delete M[e],S[e]&&delete S[e]},getThroughputHistory:function(){return L},getBitrateList:ee,getQualityForBitrate:J,getTopBitrateInfoFor:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t||(t=c.getActiveStreamInfo().id),e&&b&&b[t]&&b[t][e]){var n=z(e,t),r=ee(b[t][e].getMediaInfo());return r[n]?r[n]:null}return null},getMinAllowedIndexFor:W,getMaxAllowedIndexFor:z,getInitialBitrateFor:function(e,t){if(function(){if(!O||!O.hasOwnProperty("getSavedBitrateSettings"))throw new Error(i.default.MISSING_CONFIG_ERROR)}(),e===i.default.TEXT)return NaN;var n=O.getSavedBitrateSettings(e),r=j.get().streaming.abr.initialBitrate[e],a=j.get().streaming.abr.initialRepresentationRatio[e];if(-1===r)if(a>-1){var s=b[t][e].getStreamInfo(),o=R.getAdaptationForType(s.index,e,s).Representation;r=Array.isArray(o)?o[Math.max(Math.round(o.length*a)-1,0)].bandwidth/1e3:0}else r=isNaN(n)?e===i.default.VIDEO?1e3:100:n;return r},getQualityFor:X,getAbandonmentStateFor:function(e,t){return S[e]&&S[e][t]?S[e][t].state:null},setPlaybackQuality:$,checkPlaybackQuality:function(t,r){try{if(!(t&&b&&b[r]&&b[r][t]))return!1;if(x){var i=D.getPlaybackQuality();i&&x.push(r,P,i)}if(!j.get().streaming.abr.autoSwitchBitrate[t])return!1;var s=X(t,r),o=Object(d.default)(q).create({abrController:e,switchHistory:M[r][t],droppedFramesHistory:x,streamProcessor:b[r][t],currentValue:s,useBufferOccupancyABR:k[t],useL2AABR:F[t],useLoLPABR:U[t],videoModel:D}),l=W(t,r),u=z(t,r),c=n.getMaxQuality(o),h=c.quality;return void 0!==l&&(h>f.default.NO_CHANGE?h:s)<l&&(h=l),h>u&&(h=u),M[r][t].push({oldValue:s,newValue:h}),h>f.default.NO_CHANGE&&h!==s&&(S[r][t].state===a.default.ALLOW_LOAD||h>s)&&(Q(t,s,h,u,c.reason,r),!0)}catch(e){return!1}},setElementSize:te,setWindowResizeEventCalled:function(e){w=e},registerStreamType:function(e,t){var n=t.getStreamInfo().id;b[n]||(b[n]={}),M[n]||(M[n]={}),S[n]||(S[n]={}),M[n][e]=Object(h.default)(q).create(),b[n][e]=t,S[n][e]={},S[n][e].state=a.default.ALLOW_LOAD,function(e){var t=j.get().streaming.abr.ABRStrategy;t===i.default.ABR_STRATEGY_L2A?(k[e]=!1,U[e]=!1,F[e]=!0):t===i.default.ABR_STRATEGY_LoLP?(k[e]=!1,U[e]=!0,F[e]=!1):t===i.default.ABR_STRATEGY_BOLA?(k[e]=!0,U[e]=!1,F[e]=!1):t===i.default.ABR_STRATEGY_THROUGHPUT?(k[e]=!1,U[e]=!1,F[e]=!1):t===i.default.ABR_STRATEGY_DYNAMIC&&(k[e]=!(!k||!k[e])&&k[e],U[e]=!1,F[e]=!1)}(e),e===i.default.VIDEO&&te()},unRegisterStreamType:function(e,t){try{b[e]&&b[e][t]&&delete b[e][t],M[e]&&M[e][t]&&delete M[e][t],S[e]&&S[e][t]&&delete S[e][t]}catch(e){}},setConfig:function(e){e&&(e.streamController&&(c=e.streamController),e.domStorage&&(O=e.domStorage),e.mediaPlayerModel&&(N=e.mediaPlayerModel),e.dashMetrics&&(B=e.dashMetrics),e.adapter&&(R=e.adapter),e.videoModel&&(D=e.videoModel),e.settings&&(j=e.settings))},reset:function(){V(),G.off(u.default.LOADING_PROGRESS,Y,e),G.off(_.default.QUALITY_CHANGE_RENDERED,Z,e),G.off(_.default.METRIC_ADDED,K,e),n&&n.reset()}},t=H.getLogger(e),V(),e}T.__dashjs_factory_name="AbrController";var E=c.default.getSingletonFactory(T);E.QUALITY_DEFAULT=0,c.default.updateSingletonFactory(T.__dashjs_factory_name,E),t.default=E},"./src/streaming/controllers/BaseURLController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/models/BaseURLTreeModel.js"),i=n("./src/streaming/utils/BaseURLSelector.js"),a=n("./src/streaming/utils/URLUtils.js"),s=n("./src/dash/vo/BaseURL.js"),o=n("./src/core/FactoryMaker.js"),l=n("./src/core/EventBus.js"),u=n("./src/core/events/Events.js");function c(){var e,t,n,o,c=this.context,d=Object(l.default)(c).getInstance(),f=Object(a.default)(c).getInstance();function h(e){n.invalidateSelectedIndexes(e.entry)}return e={reset:function(){n.reset(),o.reset()},initialize:function(e){var r;n.setConfig({adapter:t}),r=e,n.update(r),o.chooseSelector(t.getIsDVB(r))},resolve:function(e){var t=n.getForPath(e).reduce((function(e,t){var n=o.select(t);return n?(f.isRelative(n.url)?e.url=f.resolve(n.url,e.url):(e.url=n.url,e.serviceLocation=n.serviceLocation),e.availabilityTimeOffset=n.availabilityTimeOffset,e.availabilityTimeComplete=n.availabilityTimeComplete,e):new s.default}),new s.default);if(!f.isRelative(t.url))return t},setConfig:function(e){e.baseURLTreeModel&&(n=e.baseURLTreeModel),e.baseURLSelector&&(o=e.baseURLSelector),e.adapter&&(t=e.adapter)}},n=Object(r.default)(c).create(),o=Object(i.default)(c).create(),d.on(u.default.SERVICE_LOCATION_BLACKLIST_CHANGED,h,e),e}c.__dashjs_factory_name="BaseURLController",t.default=o.default.getClassFactory(c)},"./src/streaming/controllers/BlacklistController.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/core/EventBus.js");function a(e){var t;e=e||{};var n=[],r=Object(i.default)(this.context).getInstance(),a=e.updateEventName,s=e.addBlacklistEventName;function o(e){-1===n.indexOf(e)&&(n.push(e),r.trigger(a,{entry:e}))}function l(e){o(e.entry)}return t={add:o,contains:function(e){return!!(n.length&&e&&e.length)&&-1!==n.indexOf(e)},reset:function(){n=[]}},s&&r.on(s,l,t),t}a.__dashjs_factory_name="BlackListController",t.default=r.default.getClassFactory(a)},"./src/streaming/controllers/BufferController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/streaming/constants/MetricsConstants.js"),a=n("./src/streaming/models/FragmentModel.js"),s=n("./src/streaming/SourceBufferSink.js"),o=n("./src/core/EventBus.js"),l=n("./src/core/events/Events.js"),u=n("./src/core/FactoryMaker.js"),c=n("./src/core/Debug.js"),d=n("./src/streaming/utils/InitCache.js"),f=n("./src/streaming/vo/DashJSError.js"),h=n("./src/core/errors/Errors.js"),p=n("./src/streaming/vo/metrics/HTTPRequest.js"),g=n("./src/streaming/MediaPlayerEvents.js"),m=.01,y="BufferController";function v(e){e=e||{};var t,n,u,v,_,T,E,b,S,A,w,I,C,R,D,N,O,P,M=this.context,x=Object(o.default)(M).getInstance(),L=e.errHandler,k=e.fragmentModel,F=e.representationController,U=e.adapter,B=e.textController,j=e.abrController,q=e.playbackController,H=e.streamInfo,G=e.type,V=e.settings;function Y(e){T=e}function Z(e){return U.convertRepresentationToRepresentationInfo(F.getRepresentationForQuality(e))}function K(e){V.get().streaming.cacheInitSegments&&(n.info("Init fragment finished loading saving to",G+"'s init cache"),D.save(e.chunk)),n.debug("Append Init fragment",G," with representationId:",e.chunk.representationId," and quality:",e.chunk.quality,", data size:",e.chunk.bytes.byteLength),W(e.chunk)}function z(e){W(e.chunk,e.request)}function W(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;S.append(e,t).then((function(e){$(e)})).catch((function(e){$(e)})),e.mediaInfo.type===r.default.VIDEO&&_e(l.default.VIDEO_CHUNK_RECEIVED,{chunk:e})}function X(e){if(e&&e.length>0)for(var t=0,r=e.length;t<r;t++)n.debug("Buffered range: "+e.start(t)+" - "+e.end(t)+", currentTime = ",q.getTime())}function $(e){if(e.error)return 22===e.error.code&&function(){if(R=!0,_=.8*ye(),n.warn("Quota exceeded, Critical Buffer: "+_),_>0){var e=Math.max(.2*_,1),t=_-e,r=Math.min(V.get().streaming.buffer.bufferTimeAtTopQuality,.9*t),i=Math.min(V.get().streaming.buffer.bufferTimeAtTopQualityLongForm,.9*t),a={streaming:{buffer:{bufferToKeep:parseFloat(e.toFixed(5)),bufferTimeAtTopQuality:parseFloat(r.toFixed(5)),bufferTimeAtTopQualityLongForm:parseFloat(i.toFixed(5))}}};V.update(a)}}(),void(22!==e.error.code&&ve()||(n.warn("Clearing playback buffer to overcome quota exceed situation"),_e(l.default.QUOTA_EXCEEDED,{criticalBufferLevel:_,quotaExceededTime:e.chunk.start}),ue(le())));if(S&&(ie(),R=!1,(w=e.chunk)&&w.endFragment)){w&&!isNaN(w.index)&&(E=Math.max(w.index,E),ae());var t=S.getAllBufferRanges();w.segmentType===p.HTTPRequest.MEDIA_SEGMENT_TYPE&&(X(t),ee(),function(){if(!isNaN(P))if(G===r.default.AUDIO||G===r.default.VIDEO){var e=q.getTime(),t=re(P,0);if(e===P&&t)P=NaN;else{var n=F.getCurrentRepresentation().segmentDuration;(t=re(P,n))&&(V.get().streaming.buffer.enableSeekDecorrelationFix&&Math.abs(e-P)>n?P<=t.end&&(q.seek(Math.max(P,t.start),!1,!0),P=NaN):e<t.start&&(q.seek(t.start,!1,!0),P=NaN))}}else P=NaN}()),w&&_e(l.default.BYTES_APPENDED_END_FRAGMENT,{quality:w.quality,startTime:w.start,index:w.index,bufferedRanges:t,segmentType:w.segmentType,mediaType:G})}}function Q(){return new Promise((function(e,t){var n=J();if(!n||0===n.length)return ee(),void e();ue(n).then((function(){e()})).catch((function(e){t(e)}))}))}function J(e){var t=[],n=S.getAllBufferRanges();if(!n||0===n.length)return t;if(!e&&0!==e||isNaN(e))t.push({start:n.start(0),end:n.end(n.length-1)+.5});else{var r=function(e,t){var n=V.get().streaming.buffer.bufferToKeep,r=t.start(0);if(e-r>n){var i=Math.max(0,e-n),s=k.getRequests({state:a.default.FRAGMENT_MODEL_EXECUTED,time:e,threshold:m})[0];if(s&&(i=Math.min(s.startTime,i)),i>0)return{start:r,end:i}}return null}(e,n),i=function(e,t){var n=t.end(t.length-1)+.5,r=H.manifestInfo.duration>=V.get().streaming.buffer.longFormContentDurationThreshold?V.get().streaming.buffer.bufferTimeAtTopQualityLongForm:V.get().streaming.buffer.bufferTimeAtTopQuality;if(n-e>r){var i=e+r,s=k.getRequests({state:a.default.FRAGMENT_MODEL_EXECUTED,time:e,threshold:m})[0];if(s&&(i=Math.max(s.startTime+s.duration,i)),i<n)return{start:i,end:n}}return null}(e,n);r&&t.push(r),i&&t.push(i)}return t}function ee(){(!O||G===r.default.TEXT&&B.isTextEnabled())&&ie()}function te(){se()}function ne(){se(),P=NaN}function re(e,t){var n,r,i=S.getAllBufferRanges(),a=0,s=0,o=null,l=null,u=0,c=isNaN(t)?.15:t;if(null!=i){for(r=0,n=i.length;r<n;r++)if(a=i.start(r),s=i.end(r),null===o)u=Math.abs(a-e),(e>=a&&e<s||u<=c)&&(o=a,l=s);else{if(!((u=a-l)<=c))break;l=s}if(null!==o)return{start:o,end:l}}return null}function ie(){if(q){var e=V.get().streaming.gaps.jumpGaps&&!isNaN(V.get().streaming.gaps.smallGapLimit)?V.get().streaming.gaps.smallGapLimit:NaN;v=Math.max(function(e,t){var n;return V.get().streaming.gaps.jumpGaps&&(t=V.get().streaming.gaps.smallGapLimit),null===(n=re(e,t))?0:n.end-e}(q.getTime()||0,e),0),_e(l.default.BUFFER_LEVEL_UPDATED,{mediaType:G,bufferLevel:v}),se()}}function ae(){var e=E>=b-1,t=q.getTimeToStreamEnd(H)-v<=0;!e&&!t||u||(me(!0),n.debug("checkIfBufferingCompleted trigger BUFFERING_COMPLETED for stream id ".concat(H.id," and type ").concat(G)))}function se(){G!==r.default.AUDIO&&G!==r.default.VIDEO||((!V.get().streaming.lowLatencyEnabled&&v<V.get().streaming.buffer.stallThreshold||0===v)&&!u?oe(i.default.BUFFER_EMPTY):(u||v>=V.get().streaming.buffer.stallThreshold||V.get().streaming.lowLatencyEnabled&&v>0)&&oe(i.default.BUFFER_LOADED))}function oe(e){A===e||e===i.default.BUFFER_EMPTY&&0===q.getTime()||G===r.default.TEXT&&!B.isTextEnabled()||(A=e,_e(l.default.BUFFER_LEVEL_STATE_CHANGED,{state:e}),_e(e===i.default.BUFFER_LOADED?l.default.BUFFER_LOADED:l.default.BUFFER_EMPTY),n.debug(e===i.default.BUFFER_LOADED?"Got enough buffer to start":"Waiting for more buffer before starting playback"))}function le(){var e=[],t=S.getAllBufferRanges();if(!t||0===t.length)return e;var n=q.getTime(),r=Math.max(0,n-V.get().streaming.buffer.bufferToKeep),i=k.getRequests({state:a.default.FRAGMENT_MODEL_EXECUTED,time:n,threshold:m})[0];if(i)r=Math.min(i.startTime,r);else if(0===n&&q.getIsDynamic())return[];if(t.start(0)<=r){for(var s={start:0,end:r},o=0;o<t.length&&t.end(o)<=r;o++)s.end=t.end(o);s.start<s.end&&e.push(s)}return e}function ue(e){return new Promise((function(t,n){if(e&&S&&0!==e.length){var r=[];e.forEach((function(e){r.push(function(e){return new Promise((function(t,n){e.resolve=t,e.reject=n,N.push(e)}))}(e))})),C||ce(),Promise.all(r).then((function(){t()})).catch((function(e){n(e)}))}else t()}))}function ce(){try{if(0===N.length||!S)return n.debug("Nothing to prune, halt pruning"),N=[],void(C=!1);var e=S.getBuffer();if(!e||!e.buffered||0===e.buffered.length)return n.debug("SourceBuffer is empty (or does not exist), halt pruning"),N=[],void(C=!1);var t=N.shift();n.debug("".concat(G,": Removing buffer from: ").concat(t.start," to ").concat(t.end)),C=!0,q.getTime()<t.end&&me(!1),S.remove(t).then((function(e){de(e)})).catch((function(e){de(e)}))}catch(e){C=!1}}function de(e){n.debug("onRemoved buffer from:",e.from,"to",e.to),X(S.getAllBufferRanges()),0===N.length&&(C=!1,ie()),e.unintended&&(n.warn("Detected unintended removal from:",e.from,"to",e.to,"setting streamprocessor time to",e.from),_e(l.default.SEEK_TARGET,{time:e.from})),C?ce():(O?O=!1:ie(),_e(l.default.BUFFER_CLEARED,{from:e.from,to:e.to,unintended:e.unintended,hasEnoughSpaceToAppend:ve(),quotaExceeded:R}))}function fe(e){return new Promise((function(t){e&&void 0!==e.MSETimeOffset&&S&&S.updateTimestampOffset?S.updateTimestampOffset(e.MSETimeOffset).then((function(){t()})).catch((function(){t()})):t()}))}function he(){return S&&!u?S.updateAppendWindow(H):Promise.resolve()}function pe(){++I*(V.get().streaming.wallclockTimeUpdateInterval/1e3)>=V.get().streaming.buffer.bufferPruningInterval&&(I=0,S&&G!==r.default.TEXT&&(u||ue(le())))}function ge(){se()}function me(e){u!==e&&((u=e)?_e(l.default.BUFFERING_COMPLETED):b=Number.POSITIVE_INFINITY)}function ye(){try{var e,t,n=S.getAllBufferRanges(),r=0;if(!n)return r;for(t=0,e=n.length;t<e;t++)r+=n.end(t)-n.start(t);return r}catch(e){return 0}}function ve(){var e=ye();return isNaN(e)||e<_}function _e(e,t){var n=t||{};x.trigger(e,n,{streamId:H.id,mediaType:G})}function Te(e,t){_=Number.POSITIVE_INFINITY,A=void 0,b=Number.POSITIVE_INFINITY,E=0,w=null,u=!1,C=!1,R=!1,v=0,I=0,N=[],P=NaN,S&&(e||t?S=null:S.abort().then((function(){S.reset(t),S=null}))),O=!1}return t={initialize:function(e){Y(e),x.on(l.default.INIT_FRAGMENT_LOADED,K,t),x.on(l.default.MEDIA_FRAGMENT_LOADED,z,t),x.on(l.default.WALLCLOCK_TIME_UPDATED,pe,t),x.on(g.default.PLAYBACK_PLAYING,ne,t),x.on(g.default.PLAYBACK_PROGRESS,ee,t),x.on(g.default.PLAYBACK_TIME_UPDATED,ee,t),x.on(g.default.PLAYBACK_RATE_CHANGED,ge,t),x.on(g.default.PLAYBACK_STALLED,te,t)},getStreamId:function(){return H.id},getType:function(){return G},getBufferControllerType:function(){return y},createBufferSink:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return new Promise((function(i,a){if(D&&e&&T){var o=j.getQualityFor(G,H.id);S=Object(s.default)(M).create({mediaSource:T,textController:B,eventBus:x}),function(e,t,n){var i=Z(n);return t&&t[G]&&(G===r.default.VIDEO||G===r.default.AUDIO)?S.initializeForStreamSwitch(e,i,t[G]):S.initializeForFirstUse(H,e,i)}(e,t,o).then((function(){return fe(Z(o))})).then((function(){i(S)})).catch((function(e){n.fatal("Caught error on create SourceBuffer: "+e),L.error(new f.default(h.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,h.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+G)),a(e)}))}else i(null)}))},getBuffer:function(){return S},getBufferLevel:function(){return v},getRangeAt:re,setMediaSource:Y,getMediaSource:function(){return T},appendInitSegmentFromCache:function(e){var t=D.extract(H.id,e);return!!t&&(n.info("Append Init fragment",G," with representationId:",t.representationId," and quality:",t.quality,", data size:",t.bytes.byteLength),W(t),!0)},getIsBufferingCompleted:function(){return u},setIsBufferingCompleted:me,getIsPruningInProgress:function(){return C},reset:function(e,t){x.off(l.default.INIT_FRAGMENT_LOADED,K,this),x.off(l.default.MEDIA_FRAGMENT_LOADED,z,this),x.off(l.default.WALLCLOCK_TIME_UPDATED,pe,this),x.off(g.default.PLAYBACK_PLAYING,ne,this),x.off(g.default.PLAYBACK_PROGRESS,ee,this),x.off(g.default.PLAYBACK_TIME_UPDATED,ee,this),x.off(g.default.PLAYBACK_RATE_CHANGED,ge,this),x.off(g.default.PLAYBACK_STALLED,te,this),Te(e,t)},prepareForPlaybackSeek:function(){return u&&me(!1),S.abort()},prepareForReplacementTrackSwitch:function(e){return new Promise((function(t,n){S.abort().then((function(){return he()})).then((function(){return S.changeType(e)})).then((function(){return Q()})).then((function(){me(!1),t()})).catch((function(e){n(e)}))}))},prepareForNonReplacementTrackSwitch:function(e){return new Promise((function(t,n){he().then((function(){return S.changeType(e)})).then((function(){t()})).catch((function(e){n(e)}))}))},prepareForReplacementQualitySwitch:function(){return new Promise((function(e,t){S.abort().then((function(){return he()})).then((function(){return Q()})).then((function(){me(!1),e()})).catch((function(e){t(e)}))}))},updateAppendWindow:he,getAllRangesWithSafetyFactor:J,getContinuousBufferTimeForTargetTime:function(e){try{var t=e,n=S.getAllBufferRanges();if(!n||0===n.length)return e;for(var r=0;t===e&&r<n.length;){var i=n.start(r),a=n.end(r);t>=i&&t<=a&&(t=a),r+=1}return t}catch(e){}},clearBuffers:ue,pruneAllSafely:Q,updateBufferTimestampOffset:fe,setSeekTarget:function(e){P=e},segmentRequestingCompleted:function(e){isNaN(e)||(b=e,ae())}},n=Object(c.default)(M).getInstance().getLogger(t),D=Object(d.default)(M).getInstance(),Te(),t}v.__dashjs_factory_name=y,t.default=u.default.getClassFactory(v)},"./src/streaming/controllers/EventController.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/core/Debug.js"),a=n("./src/core/EventBus.js"),s=n("./src/streaming/MediaPlayerEvents.js"),o=n("./src/streaming/net/XHRLoader.js");function l(){var e,t,n,r,l,u,c,d,f,h,p,g="urn:mpeg:dash:event:2012",m=1,y="urn:mpeg:dash:event:callback:2015",v=1,_=300,T={DISCARDED:"discarded",UPDATED:"updated",ADDED:"added"},E=this.context,b=Object(a.default)(E).getInstance();function S(){if(!c||!d)throw new Error("setConfig function has to be called previously")}function A(){p=!1,n={},r={},l=null,h=!1,u=Date.now()/1e3}function w(){try{null!==l&&p&&(clearInterval(l),l=null,p=!1,function(){try{N(r),N(n)}catch(e){}}())}catch(e){throw e}}function I(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e.eventStream.schemeIdUri,i=e.eventStream.value,a=e.id,s=T.DISCARDED;t[r]||(t[r]=[]);var o=t[r].findIndex((function(e){return(!i||e.eventStream.value&&e.eventStream.value===i)&&e.id===a}));return-1===o?(t[r].push(e),s=T.ADDED):n&&(t[r][o]=e,s=T.UPDATED),s}function C(e){try{if(e.eventStream.value==m){var t,n=e.calculatedPresentationTime;t=4294967295==e.calculatedPresentationTime?NaN:e.calculatedPresentationTime+e.duration,b.trigger(s.default.MANIFEST_VALIDITY_CHANGED,{id:e.id,validUntil:n,newDuration:t,newManifestValidAfter:NaN},{mode:s.default.EVENT_MODE_ON_START})}}catch(e){}}function R(){try{if(!h){h=!0;var e=d.getTime(),t=e-u;t=u>0?Math.max(0,t):0,D(r,t,e),D(n,t,e),u=e,h=!1}}catch(e){h=!1}}function D(e,n,r){try{O(e,(function(i){if(void 0!==i){var a=isNaN(i.duration)?0:i.duration;i.calculatedPresentationTime<=r&&i.calculatedPresentationTime+n+a>=r?P(i,e,s.default.EVENT_MODE_ON_START):(function(e,t,n){try{return e-t>n}catch(e){return!1}}(r,a+n,i.calculatedPresentationTime)||function(e){try{var t=e.eventStream.period.start+e.eventStream.period.duration;return e.calculatedPresentationTime>t}catch(e){return!1}}(i))&&(t.debug("Deleting event ".concat(i.id," as it is expired or invalid")),M(e,i))}}))}catch(e){}}function N(e){try{var t=d.getTime();O(e,(function(n){var r=n.eventStream&&n.eventStream.period&&!isNaN(n.eventStream.period.duration)?n.eventStream.period.duration:NaN,i=n.eventStream&&n.eventStream.period&&!isNaN(n.eventStream.period.start)?n.eventStream.period.start:NaN;if(!isNaN(r)&&!isNaN(i)){var a=n.calculatedPresentationTime;Math.abs(a-t)<_&&P(n,e,s.default.EVENT_MODE_ON_START)}}))}catch(e){}}function O(e,t){try{if(e)for(var n=Object.keys(e),r=0;r<n.length;r++)e[n[r]].forEach((function(e){void 0!==e&&t(e)}))}catch(e){}}function P(e,n,r){try{var i=d.getTime(),a=e.id;if(r===s.default.EVENT_MODE_ON_RECEIVE)return t.debug("Received event ".concat(a)),void b.trigger(e.eventStream.schemeIdUri,{event:e},{mode:r});e.eventStream.schemeIdUri===g&&e.eventStream.value==m?0===e.duration&&0===e.presentationTimeDelta||(t.debug("Starting manifest refresh event ".concat(a," at ").concat(i)),M(n,e),function(){try{S(),c.refreshManifest()}catch(e){}}()):e.eventStream.schemeIdUri===y&&e.eventStream.value==v?(t.debug("Starting callback event ".concat(a," at ").concat(i)),M(n,e),function(e){try{Object(o.default)(E).create({}).load({method:"get",url:e,request:{responseType:"arraybuffer"}})}catch(e){throw e}}(e.messageData)):(t.debug("Starting event ".concat(a," at ").concat(i)),M(n,e),b.trigger(e.eventStream.schemeIdUri,{event:e},{mode:r}))}catch(e){}}function M(e,t){var n=t.eventStream.schemeIdUri,r=t.eventStream.value,i=t.id;e[n]=e[n].filter((function(e){return r&&e.eventStream.value&&e.eventStream.value!==r||e.id!==i})),0===e[n].length&&delete e[n]}return e={addInlineEvents:function(e){try{if(S(),e)for(var r=0;r<e.length;r++){var i=e[r],a=I(i,n,!0);a===T.ADDED?(t.debug("Added inline event with id ".concat(i.id)),P(i,e,s.default.EVENT_MODE_ON_RECEIVE)):a===T.UPDATED&&t.debug("Updated inline event with id ".concat(i.id))}}catch(e){throw e}},addInbandEvents:function(e){try{S();for(var n=0;n<e.length;n++){var i=e[n];I(i,r,!1)===T.ADDED?(i.eventStream.schemeIdUri===g&&void 0===r[i.id]&&C(i),t.debug("Added inband event with id "+i.id),P(i,e,s.default.EVENT_MODE_ON_RECEIVE)):t.debug("Inband event with scheme_id_uri ".concat(i.eventStream.schemeIdUri,", value ").concat(i.eventStream.value," and id ").concat(i.id," was ignored because it has been added before."))}R()}catch(e){throw e}},getInbandEvents:function(){return r},getInlineEvents:function(){return n},start:function(){try{S(),t.debug("Start Event Controller");var e=f.get().streaming.eventControllerRefreshDelay;p||isNaN(e)||(p=!0,l=setInterval(R,e))}catch(e){throw e}},setConfig:function(e){try{if(!e)return;e.manifestUpdater&&(c=e.manifestUpdater),e.playbackController&&(d=e.playbackController),e.settings&&(f=e.settings)}catch(e){throw e}},reset:function(){w(),A()}},t=Object(i.default)(E).getInstance().getLogger(e),A(),e}l.__dashjs_factory_name="EventController",t.default=r.default.getSingletonFactory(l)},"./src/streaming/controllers/FragmentController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/streaming/vo/DataChunk.js"),a=n("./src/streaming/models/FragmentModel.js"),s=n("./src/streaming/FragmentLoader.js"),o=n("./src/streaming/utils/RequestModifier.js"),l=n("./src/core/EventBus.js"),u=n("./src/core/events/Events.js"),c=n("./src/streaming/MediaPlayerEvents.js"),d=n("./src/core/errors/Errors.js"),f=n("./src/core/FactoryMaker.js"),h=n("./src/core/Debug.js");function p(e){e=e||{};var t,n,f,p=this.context,g=Object(l.default)(p).getInstance(),m=e.errHandler,y=e.mediaPlayerModel,v=e.dashMetrics,_=Object(h.default)(p).getInstance(),T=e.streamInfo;function E(){return T.id}function b(){for(var e in f)f[e].reset();f={}}function S(e){if(e.sender){var t=e.request,a=e.response,s=t.isInitializationRequest(),o=t.mediaInfo.streamInfo;if(e.error&&(t.mediaType===r.default.AUDIO||t.mediaType===r.default.VIDEO||t.mediaType===r.default.TEXT&&t.mediaInfo.isFragmented)&&g.trigger(u.default.SERVICE_LOCATION_BLACKLIST_ADD,{entry:e.request.serviceLocation}),a&&o){var l=function(e,t,n,r){var a=new i.default;return a.streamId=n,a.mediaInfo=t.mediaInfo,a.segmentType=t.type,a.start=t.startTime,a.duration=t.duration,a.end=a.start+a.duration,a.bytes=e,a.index=t.index,a.quality=t.quality,a.representationId=t.representationId,a.endFragment=r,a}(a,t,T.id,e.type!==u.default.FRAGMENT_LOADING_PROGRESS);g.trigger(s?u.default.INIT_FRAGMENT_LOADED:u.default.MEDIA_FRAGMENT_LOADED,{chunk:l,request:t},{streamId:o.id,mediaType:t.mediaType})}else n.warn("No "+t.mediaType+" bytes to push or stream is inactive.")}}return t={getStreamId:E,getModel:function(t){var n=f[t];return n||(n=Object(a.default)(p).create({streamInfo:T,type:t,dashMetrics:v,fragmentLoader:Object(s.default)(p).create({dashMetrics:v,mediaPlayerModel:y,errHandler:m,requestModifier:Object(o.default)(p).getInstance(),settings:e.settings,boxParser:e.boxParser,eventBus:g,events:u.default,errors:d.default,dashConstants:e.dashConstants,urlUtils:e.urlUtils,streamId:E()}),debug:_,eventBus:g,events:u.default}),f[t]=n),n},reset:function(){g.off(c.default.FRAGMENT_LOADING_COMPLETED,S,this),g.off(c.default.FRAGMENT_LOADING_PROGRESS,S,this),b()}},n=_.getLogger(t),b(),g.on(c.default.FRAGMENT_LOADING_COMPLETED,S,t),g.on(c.default.FRAGMENT_LOADING_PROGRESS,S,t),t}p.__dashjs_factory_name="FragmentController",t.default=f.default.getClassFactory(p)},"./src/streaming/controllers/GapController.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/core/Debug.js"),a=n("./src/core/events/Events.js"),s=n("./src/core/EventBus.js");function o(){var e,t,n,r,o,l,u,c,d,f,h,p,g=this.context,m=Object(s.default)(g).getInstance();function y(){p.debug("Stopping the gap controller"),o&&(clearInterval(o),o=null),function(){m.off(a.default.WALLCLOCK_TIME_UPDATED,b,this),m.off(a.default.INITIAL_STREAM_SWITCH,E,this),m.off(a.default.PLAYBACK_SEEKING,v,this),m.off(a.default.BUFFER_REPLACEMENT_STARTED,_,e),m.off(a.default.TRACK_CHANGE_RENDERED,T,e)}(),o=null,l=NaN,r=0,f=null,h={}}function v(){f&&(clearTimeout(f),f=null)}function _(e){try{if(e.streamId!==c.getActiveStreamInfo().id||!e.mediaType)return;e.streamId===c.getActiveStreamInfo().id&&(h[e.mediaType]=!0)}catch(e){p.error(e)}}function T(e){e&&e.mediaType&&(h[e.mediaType]=!1)}function E(){o||function(){try{o||(p.debug("Starting the gap controller"),o=setInterval((function(){S()&&A(u.getTime())}),100))}catch(e){}}()}function b(){if(S(n.get().streaming.gaps.enableSeekFix)&&++r>=10){var e=u.getTime();t===e?A(e,!0):(t=e,l=NaN),r=0}}function S(){var e,t,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=Object.keys(h).some((function(e){return h[e]})),a=!!r&&(e=c.getActiveStream(),t=parseFloat((e.getStartTime()+e.getDuration()).toFixed(5)),u.getTime()+n.get().streaming.gaps.threshold>=t);return!i&&n.get().streaming.gaps.jumpGaps&&c.getActiveStreamProcessors().length>0&&(!u.isSeeking()||a)&&!u.isPaused()&&!c.getIsStreamSwitchInProgress()&&!c.getHasMediaOrInitialisationError()}function A(e){var t,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=n.get().streaming.gaps.smallGapLimit,a=n.get().streaming.gaps.jumpLargeGaps,s=d.getBufferRange(),o=NaN,h=!1;if(t=function(e,t){try{if(!e||e.length<=1&&t>0)return NaN;for(var r=NaN,i=0;isNaN(r)&&i<e.length;){var a=i>0?e.end(i-1):0;t<e.start(i)&&a-t<n.get().streaming.gaps.threshold&&(r=i),i+=1}return r}catch(e){return null}}(s,e),!isNaN(t)){var g=s.start(t),m=g-e;m>0&&(m<=i||a)&&(o=g)}var y=u.getTimeToStreamEnd();if(isNaN(o)&&r&&isFinite(y)&&!isNaN(y)&&y<i&&(o=parseFloat(u.getStreamEndTime().toFixed(5)),h=!0),o>0&&l!==o&&o>e&&!f){var v=o-e;if(h){var _=c.getStreamForTime(o),T=_&&!!_.getPreloaded();p.warn("Jumping to end of stream because of gap from ".concat(e," to ").concat(o,". Gap duration: ").concat(v)),u.seek(o,!0,T)}else{var E=u.getIsDynamic(),b=t>0?s.end(t-1):e,S=E?1e3*Math.max(0,v-.1):0;f=window.setTimeout((function(){u.seek(o,!0,!0),p.warn("Jumping gap occuring in period ".concat(c.getActiveStream().getStreamId()," starting at ").concat(b," and ending at ").concat(o,". Jumping by: ").concat(v-S/1e3)),f=null}),S)}l=o}}return e={reset:y,setConfig:function(e){e&&(e.settings&&(n=e.settings),e.playbackController&&(u=e.playbackController),e.streamController&&(c=e.streamController),e.videoModel&&(d=e.videoModel))},initialize:function(){!function(){m.on(a.default.WALLCLOCK_TIME_UPDATED,b,this),m.on(a.default.INITIAL_STREAM_SWITCH,E,this),m.on(a.default.PLAYBACK_SEEKING,v,this),m.on(a.default.BUFFER_REPLACEMENT_STARTED,_,e),m.on(a.default.TRACK_CHANGE_RENDERED,T,e)}()}},p=Object(i.default)(g).getInstance().getLogger(e),y(),e}o.__dashjs_factory_name="GapController",t.default=r.default.getSingletonFactory(o)},"./src/streaming/controllers/MediaController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/core/events/Events.js"),a=n("./src/core/EventBus.js"),s=n("./src/core/FactoryMaker.js"),o=n("./src/core/Debug.js");function l(){var e,t,n,s,l,u,c,d,f=this.context,h=Object(a.default)(f).getInstance();function p(e,t){return e&&n[t]&&n[t][e]?n[t][e].list:[]}function g(e,t){return e&&n[t]&&n[t][e]?n[t][e].current:null}function m(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e&&e.streamInfo){var a=e.type,o=e.streamInfo.id,l=g(a,o);if(n[o]&&n[o][a]&&!_(e,l)&&(n[o][a].current=e,n[o][a].current&&(a!==r.default.TEXT||a===r.default.TEXT&&e.isFragmented)&&h.trigger(i.default.CURRENT_TRACK_CHANGED,{oldMediaInfo:l,newMediaInfo:e,switchMode:s.get().streaming.trackSwitchMode[a]},{streamId:o}),!t)){var d=function(e){var t={lang:e.lang,viewpoint:e.viewpoint,roles:e.roles,accessibility:e.accessibility,audioChannelConfiguration:e.audioChannelConfiguration};return t.lang||t.viewpoint||t.role&&t.role.length>0||t.accessibility&&t.accessibility.length>0||t.audioChannelConfiguration&&t.audioChannelConfiguration.length>0?t:null}(e);if(!d||!n[o][a].storeLastSettings)return;d.roles&&(d.role=d.roles[0],delete d.roles),d.accessibility&&(d.accessibility=d.accessibility[0]),d.audioChannelConfiguration&&(d.audioChannelConfiguration=d.audioChannelConfiguration[0]),u[a]=d,c.setSavedMediaSettings(a,d)}}}function y(e,t){e&&t&&(l[e]=t)}function v(e){return e?l[e]:null}function _(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;var n=e.id===t.id,r=e.viewpoint===t.viewpoint,i=e.lang===t.lang,a=e.codec===t.codec,s=e.roles.toString()===t.roles.toString(),o=e.accessibility.toString()===t.accessibility.toString(),l=e.audioChannelConfiguration.toString()===t.audioChannelConfiguration.toString();return n&&a&&r&&i&&s&&o&&l}function T(){n={},u={},d=null,l={audio:null,video:null,text:null}}function E(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=!e.lang||t.lang.match(e.lang),a=void 0===e.index||null===e.index||t.index===e.index,s=!e.viewpoint||e.viewpoint===t.viewpoint,o=!e.role||!!t.roles.filter((function(t){return t===e.role}))[0],l=!e.accessibility||!!t.accessibility.filter((function(t){return t===e.accessibility}))[0],u=!e.audioChannelConfiguration||!!t.audioChannelConfiguration.filter((function(t){return t===e.audioChannelConfiguration}))[0];return i&&a&&s&&(o||t.type===r.default.AUDIO&&n)&&l&&u}function b(e){var t,n=0,r=[];return e.forEach((function(e){(t=Math.max.apply(Math,e.bitrateList.map((function(e){return e.bandwidth}))))>n?(n=t,r=[e]):t===n&&r.push(e)})),r}function S(e){var t,n=1/0,r=[];return e.forEach((function(e){var i=e.bitrateList.reduce((function(e,t){var n=Math.max(1,t.width*t.height);return e+t.bandwidth/n}),0);(t=i/e.bitrateList.length)<n?(n=t,r=[e]):t===n&&r.push(e)})),r}function A(e){var t,n=0,r=[];return e.forEach((function(e){(t=e.representationCount)>n?(n=t,r=[e]):t===n&&r.push(e)})),r}function w(e,n){if(e===r.default.TEXT)return n[0];var i,a=s.get().streaming.selectionModeForInitialTrack;if(d&&"function"==typeof d)i=d(n);else switch(a){case r.default.TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY:i=function(e){var t,n,r=(t=0,n=[],e.forEach((function(e){isNaN(e.selectionPriority)||(e.selectionPriority>t?(t=e.selectionPriority,n=[e]):e.selectionPriority===t&&n.push(e))})),n);return r.length>1&&(r=b(r)),r.length>1&&(r=A(r)),r}(n);break;case r.default.TRACK_SELECTION_MODE_HIGHEST_BITRATE:i=function(e){var t=b(e);return t.length>1&&(t=A(t)),t}(n);break;case r.default.TRACK_SELECTION_MODE_FIRST_TRACK:i=I(n);break;case r.default.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY:i=function(e){var t=S(e);return t.length>1&&(t=b(t)),t}(n);break;case r.default.TRACK_SELECTION_MODE_WIDEST_RANGE:i=function(e){var t=A(e);return t.length>1&&(t=b(e)),t}(n);break;default:t.warn("Track selection mode ".concat(a," is not supported. Falling back to TRACK_SELECTION_MODE_FIRST_TRACK")),i=I(n)}return i.length>0?i[0]:n[0]}function I(e){return e[0]}return e={setInitialMediaSettingsForType:function(e,t){var n=u[e]||v(e),r=p(e,t.id),i=[];n||(n=c.getSavedMediaSettings(e),y(e,n)),r&&0!==r.length&&(n&&r.forEach((function(t){E(n,t,!!u[e])&&i.push(t)})),0===i.length?m(w(e,r),!0):i.length>1?m(w(e,i,u[e])):m(i[0]))},addTrack:function(e){if(e){var t=e.type;if((i=t)===r.default.AUDIO||i===r.default.VIDEO||i===r.default.TEXT||i===r.default.IMAGE){var i,a=e.streamInfo.id;n[a]||(n[a]={audio:{list:[],storeLastSettings:!0,current:null},video:{list:[],storeLastSettings:!0,current:null},text:{list:[],storeLastSettings:!0,current:null},image:{list:[],storeLastSettings:!0,current:null}});for(var s=n[a][t].list,o=0,l=s.length;o<l;++o)if(_(s[o],e))return;s.push(e)}}},getTracksFor:p,getCurrentTrackFor:g,isCurrentTrack:function(e){if(!e)return!1;var t=e.type,r=e.streamInfo.id;return n[r]&&n[r][t]&&_(n[r][t].current,e)},setTrack:m,selectInitialTrack:w,setCustomInitialTrackSelectionFunction:function(e){d=e},setInitialSettings:y,getInitialSettings:v,getTracksWithHighestBitrate:b,getTracksWithHighestEfficiency:S,getTracksWithWidestRange:A,isTracksEqual:_,matchSettings:E,saveTextSettingsDisabled:function(){c.setSavedMediaSettings(r.default.TEXT,null)},setConfig:function(e){e&&(e.domStorage&&(c=e.domStorage),e.settings&&(s=e.settings))},reset:T},t=Object(o.default)(f).getInstance().getLogger(e),T(),e}l.__dashjs_factory_name="MediaController";var u=s.default.getSingletonFactory(l);s.default.updateSingletonFactory(l.__dashjs_factory_name,u),t.default=u},"./src/streaming/controllers/MediaSourceController.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/core/Debug.js");function a(){var e,t,n,r=this.context;return e={createMediaSource:function(){var e="WebKitMediaSource"in window;return"MediaSource"in window?t=new MediaSource:e&&(t=new WebKitMediaSource),t},attachMediaSource:function(e){var n=window.URL.createObjectURL(t);return e.setSource(n),n},detachMediaSource:function(e){e.setSource(null)},setDuration:function e(r){t&&"open"===t.readyState&&(null===r&&isNaN(r)||t.duration!==r&&(function(e){for(var t=e.sourceBuffers,n=0;n<t.length;n++)if(t[n].updating)return!0;return!1}(t)?setTimeout(e.bind(null,r),50):(n.info("Set MediaSource duration:"+r),t.duration=r)))},setSeekable:function(e,n){t&&"function"==typeof t.setLiveSeekableRange&&"function"==typeof t.clearLiveSeekableRange&&"open"===t.readyState&&e>=0&&e<n&&(t.clearLiveSeekableRange(),t.setLiveSeekableRange(e,n))},signalEndOfStream:function(e){if(e&&"open"===e.readyState){for(var t=e.sourceBuffers,r=0;r<t.length;r++){if(t[r].updating)return;if(0===t[r].buffered.length)return}n.info("call to mediaSource endOfStream"),e.endOfStream()}}},n=Object(i.default)(r).getInstance().getLogger(e),e}a.__dashjs_factory_name="MediaSourceController",t.default=r.default.getSingletonFactory(a)},"./src/streaming/controllers/PlaybackController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/streaming/constants/MetricsConstants.js"),a=n("./src/core/EventBus.js"),s=n("./src/core/events/Events.js"),o=n("./src/core/FactoryMaker.js"),l=n("./src/core/Debug.js"),u=n("./src/streaming/MediaPlayerEvents.js");function c(){var e,t,n,o,c,d,f,h,p,g,m,y,v,_,T,E,b,S,A,w,I,C,R=this.context,D=Object(a.default)(R).getInstance();function N(){return parseFloat((O(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)-F()).toFixed(5))}function O(e){var t=e||g;return t.start+t.duration}function P(){g&&d&&d.getElement()?d.play():v=!0}function M(){return g&&d?d.isPaused():null}function x(){g&&d&&d.pause()}function L(){return g&&d?d.isSeeking():null}function k(e,n,r){g&&d&&e!==(isNaN(E)?d.getTime():E)&&((b=!0===r)||(E=e,D.trigger(s.default.PLAYBACK_SEEK_ASKED)),t.info("Requesting seek to time: "+e+(b?" (internal)":"")),d.setCurrentTime(e,n))}function F(){return g&&d?d.getTime():null}function U(){var e=F();if(m&&!isNaN(T)){var t=T/1e3;e>t&&(e-=t)}return e}function B(){return g&&d?d.getPlaybackRate():null}function j(){return g&&d?d.getEnded():null}function q(){return m}function H(){if(!m||isNaN(T))return NaN;var e=U();if(isNaN(e)||0===e)return 0;var t=(new Date).getTime()+1e3*f.getClientTimeOffset();return Math.max(((t-T-1e3*e)/1e3).toFixed(3),0)}function G(){x(),v=!1,p=0,T=0,I=!1,E=NaN,d&&(D.off(s.default.DATA_UPDATE_COMPLETED,K,e),D.off(s.default.LOADING_PROGRESS,ge,e),D.off(s.default.MANIFEST_UPDATED,Te,e),D.off(s.default.STREAMS_COMPOSED,Ee,e),D.off(u.default.BUFFER_LEVEL_STATE_CHANGED,me,e),D.off(u.default.PLAYBACK_PROGRESS,ce,e),D.off(u.default.PLAYBACK_TIME_UPDATED,ce,e),D.off(u.default.PLAYBACK_ENDED,le,e),D.off(u.default.STREAM_INITIALIZING,ve,e),D.off(u.default.REPRESENTATION_SWITCH,_e,e),d.setPlaybackRate(1,!0),Y(),d.removeEventListener("canplay",z),d.removeEventListener("canplaythrough",W),d.removeEventListener("play",X),d.removeEventListener("waiting",$),d.removeEventListener("playing",Q),d.removeEventListener("pause",J),d.removeEventListener("error",ue),d.removeEventListener("seeking",ee),d.removeEventListener("seeked",te),d.removeEventListener("timeupdate",ne),d.removeEventListener("progress",re),d.removeEventListener("ratechange",ie),d.removeEventListener("loadedmetadata",ae),d.removeEventListener("loadeddata",se),d.removeEventListener("stalled",ye),d.removeEventListener("ended",oe)),h=null,d=null,g=null,m=null}function V(){null===h&&(h=setInterval((function(){var e;D.trigger(s.default.WALLCLOCK_TIME_UPDATED,{isDynamic:m,time:new Date}),q()&&(n.addDVRMetric(),M()?(e=Date.now(),(!_||e>_+500)&&(_=e,ne())):Z())}),C.get().streaming.wallclockTimeUpdateInterval))}function Y(){clearInterval(h),h=null}function Z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!M()&&m&&0!==d.getReadyState()&&!L()&&!I){e||(e=n.hasVideoTrack()?r.default.VIDEO:r.default.AUDIO);var i=U(),a=function(e,t){var n=o.getCurrentDVRInfo(t),r=n?n.range:null;return r?e>r.end?Math.max(r.end-p,r.start):e>0&&e+.25<r.start&&Math.abs(e-r.start)<31536e4?C.get().streaming.lowLatencyEnabled?Math.max(r.end-p,r.start):r.start:e:NaN}(i,e);!isNaN(a)&&a!==i&&!L()&&(g&&d&&d.isStalled()||A||1===d.getReadyState())&&(t.debug("UpdateCurrentTime: Seek to actual time: ".concat(a," from currentTime: ").concat(i)),k(a))}}function K(e){var t=c.convertRepresentationToRepresentationInfo(e.currentRepresentation),n=t?t.mediaInfo.streamInfo:null;null!==n&&g.id===n.id&&(g=n)}function z(){D.trigger(s.default.CAN_PLAY)}function W(){D.trigger(s.default.CAN_PLAY_THROUGH)}function X(){t.info("Native video element event: play"),Z(),V(),D.trigger(s.default.PLAYBACK_STARTED,{startTime:F()})}function $(){t.info("Native video element event: waiting"),D.trigger(s.default.PLAYBACK_WAITING,{playingTime:F()})}function Q(){t.info("Native video element event: playing"),D.trigger(s.default.PLAYBACK_PLAYING,{playingTime:F()})}function J(){t.info("Native video element event: pause"),D.trigger(s.default.PLAYBACK_PAUSED,{ended:j()})}function ee(){if(b)b=!1;else{var e=F();isNaN(E)||E===e||(e=E),E=NaN,t.info("Seeking to: "+e),V(),D.trigger(s.default.PLAYBACK_SEEKING,{seekTime:e,streamId:g.id})}}function te(){t.info("Native video element event: seeked"),D.trigger(s.default.PLAYBACK_SEEKED)}function ne(){g&&D.trigger(s.default.PLAYBACK_TIME_UPDATED,{timeToEnd:N(),time:F(),streamId:g.id})}function re(){D.trigger(s.default.PLAYBACK_PROGRESS,{streamId:g.id})}function ie(){var e=B();t.info("Native video element event: ratechange: ",e),D.trigger(s.default.PLAYBACK_RATE_CHANGED,{playbackRate:e})}function ae(){t.info("Native video element event: loadedmetadata"),D.trigger(s.default.PLAYBACK_METADATA_LOADED),V()}function se(){t.info("Native video element event: loadeddata"),D.trigger(s.default.PLAYBACK_LOADED_DATA)}function oe(){t.info("Native video element event: ended"),x(),Y();var e=n?n.getActiveStreamInfo():null;e&&D.trigger(s.default.PLAYBACK_ENDED,{isLast:e.isLast})}function le(e){if(h&&e.isLast){t.info("onPlaybackEnded -- PLAYBACK_ENDED but native video element didn't fire ended");var n=e.seekTime?e.seekTime:O();d.setCurrentTime(n),x(),Y()}}function ue(e){var t=e.target||e.srcElement;D.trigger(s.default.PLAYBACK_ERROR,{error:t.error})}function ce(){m&&de()&&C.get().streaming.liveCatchup.playbackRate>0&&!M()&&!L()&&(function(){try{if(de()&&C.get().streaming.liveCatchup.playbackRate>0&&F()>0){var e=he(),t=H(),n=y.getLiveDelay(),i=y.getLiveCatchupLatencyThreshold(),a=C.get().streaming.liveCatchup.minDrift;return e===r.default.LIVE_CATCHUP_MODE_LOLP?function(e,t,n,r,i,a){try{var s=Math.abs(e-t);return(isNaN(a)||e<=a)&&(s>n||r<i)}catch(e){return!1}}(t,n,a,fe(),C.get().streaming.liveCatchup.playbackBufferMin,i):function(e,t,n,r){try{return Math.abs(e-t)>r&&(isNaN(n)||e<=n)}catch(e){return!1}}(t,n,i,a)}}catch(e){return!1}}()?function(){if(d){var e,i=d.getPlaybackRate(),a=C.get().streaming.liveCatchup.playbackRate,s=H(),l=y.getLiveDelay(),u=fe();he()===r.default.LIVE_CATCHUP_MODE_LOLP?(C.get().streaming.liveCatchup.minDrift,e=function(e,n,r,i,a,s,o){var l,u=e;if(s<a){var c=5*(s-a);l=1-u+2*u/(1+Math.pow(Math.E,-c)),t.debug("[LoL+ playback control_buffer-based] bufferLevel: "+s+", newRate: "+l)}else{var d=.02;if(Math.abs(n-r)<=d*r)l=1;else{var f=5*(n-r);l=1-u+2*u/(1+Math.pow(Math.E,-f))}t.debug("[LoL+ playback control_latency-based] latency: "+n+", newRate: "+l)}return A&&s>r/2&&(A=!1),Math.abs(o-l)<=w&&(l=null),{newRate:l}}(a,s,l,0,C.get().streaming.liveCatchup.playbackBufferMin,u,i)):e=function(e,t,n,r,i){var a=t-n,s=5*a,o=1-e+2*e/(1+Math.pow(Math.E,-s));return A&&(r>n/2?A=!1:a>0&&(o=1)),Math.abs(i-o)<=w&&(o=null),{newRate:o}}(a,s,l,u,i);var c=e.newRate;c&&d.setPlaybackRate(c);var f=s-l;C.get().streaming.liveCatchup.maxDrift>0&&!S&&f>C.get().streaming.liveCatchup.maxDrift?(t.info("Low Latency catchup mechanism. Latency too high, doing a seek to live point"),S=!0,h=n&&n.hasVideoTrack()?r.default.VIDEO:r.default.AUDIO,(g=(p=o.getCurrentDVRInfo(h))?p.range:null)&&!isNaN(g.end)&&k(g.end-y.getLiveDelay(),!0,!1)):S=!1}var h,p,g}():pe())}function de(){return C.get().streaming.liveCatchup.enabled||C.get().streaming.lowLatencyEnabled}function fe(){var e=null;return n.getActiveStreamProcessors().forEach((function(t){var n=t.getBufferLevel();e=null===e?n:Math.min(e,n)})),e}function he(){var e=C.get().streaming.liveCatchup.playbackBufferMin;return C.get().streaming.liveCatchup.mode!==r.default.LIVE_CATCHUP_MODE_LOLP||null===e||isNaN(e)?r.default.LIVE_CATCHUP_MODE_DEFAULT:r.default.LIVE_CATCHUP_MODE_LOLP}function pe(){d&&d.setPlaybackRate(1)}function ge(e){if(!1===e.stream&&C.get().streaming.lowLatencyEnabled&&!isNaN(e.request.duration)){var n=1.2*e.request.duration;n>y.getLiveDelay()&&(t.warn("Browser does not support fetch API with StreamReader. Increasing live delay to be 20% higher than segment duration:",n.toFixed(2)),C.update({streaming:{delay:{liveDelay:n}}}))}}function me(e){e.streamId===g.id&&(de()?e.state!==i.default.BUFFER_EMPTY||L()||A||(A=!0,pe()):C.get().streaming.buffer.setStallState&&d.setStallState(e.mediaType,e.state===i.default.BUFFER_EMPTY))}function ye(e){D.trigger(s.default.PLAYBACK_STALLED,{e})}function ve(e){var n;(n=e.mediaInfo)&&n.supplementalProperties&&"true"===n.supplementalProperties[r.default.SUPPLEMENTAL_PROPERTY_LL_SCHEME]&&(t.debug("Low Latency critical SupplementalProperty set: Enabling low Latency"),C.update({streaming:{lowLatencyEnabled:!0}}))}function _e(e){var t=n.getActiveStreamInfo();if(C.get().streaming.lowLatencyEnabledByManifest&&e&&t&&e.currentRepresentation&&e.streamId&&e.streamId===t.id&&e.mediaType&&(e.mediaType===r.default.VIDEO||e.mediaType===r.default.AUDIO)){var i=!e.currentRepresentation.availabilityTimeComplete;i&&C.update({streaming:{lowLatencyEnabled:i}})}}function Te(){I=!0}function Ee(){I=!1}return e={initialize:function(t,n){g=t,!0!==n&&function(){d.addEventListener("canplay",z),d.addEventListener("canplaythrough",W),d.addEventListener("play",X),d.addEventListener("waiting",$),d.addEventListener("playing",Q),d.addEventListener("pause",J),d.addEventListener("error",ue),d.addEventListener("seeking",ee),d.addEventListener("seeked",te),d.addEventListener("timeupdate",ne),d.addEventListener("progress",re),d.addEventListener("ratechange",ie),d.addEventListener("loadedmetadata",ae),d.addEventListener("loadeddata",se),d.addEventListener("stalled",ye),d.addEventListener("ended",oe),m=g.manifestInfo.isDynamic,S=!1,A=!1,b=!1;var t="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",n=/safari/.test(t)&&!/chrome/.test(t);w=n?.25:.02,D.on(s.default.DATA_UPDATE_COMPLETED,K,e),D.on(s.default.LOADING_PROGRESS,ge,e),D.on(s.default.MANIFEST_UPDATED,Te,e),D.on(s.default.STREAMS_COMPOSED,Ee,e),D.on(u.default.BUFFER_LEVEL_STATE_CHANGED,me,e),D.on(u.default.PLAYBACK_PROGRESS,ce,e),D.on(u.default.PLAYBACK_TIME_UPDATED,ce,e),D.on(u.default.PLAYBACK_ENDED,le,e,{priority:a.default.EVENT_PRIORITY_HIGH}),D.on(u.default.STREAM_INITIALIZING,ve,e),D.on(u.default.REPRESENTATION_SWITCH,_e,e),v&&(v=!1,P())}()},setConfig:function(e){e&&(e.streamController&&(n=e.streamController),e.dashMetrics&&(o=e.dashMetrics),e.mediaPlayerModel&&(y=e.mediaPlayerModel),e.adapter&&(c=e.adapter),e.videoModel&&(d=e.videoModel),e.timelineConverter&&(f=e.timelineConverter),e.settings&&(C=e.settings))},getTimeToStreamEnd:N,getBufferLevel:fe,getTime:F,getNormalizedTime:U,getIsManifestUpdateInProgress:function(){return I},getPlaybackRate:B,getPlayedRanges:function(){return g&&d?d.getPlayedRanges():null},getEnded:j,getIsDynamic:q,getStreamController:function(){return n},computeAndSetLiveDelay:function(e,n){var i,a,s,o=!isNaN(e)&&isFinite(e)?e:NaN,l=c.getSuggestedPresentationDelay();if(C.get().streaming.delay.applyServiceDescription&&isNaN(C.get().streaming.delay.liveDelay)&&isNaN(C.get().streaming.delay.liveDelayFragmentCount)&&function(e){if(e&&e.serviceDescriptions){for(var n=null,i=0;i<e.serviceDescriptions.length;i++){var a=e.serviceDescriptions[i];if(a.schemeIdUri===r.default.SERVICE_DESCRIPTION_LL_SCHEME){n=a;break}}n&&(n.latency&&n.latency.target>0&&(t.debug("Apply LL properties coming from service description. Target Latency (ms):",n.latency.target),C.update({streaming:{delay:{liveDelay:n.latency.target/1e3},liveCatchup:{minDrift:(n.latency.target+500)/1e3,maxDrift:n.latency.max>n.latency.target?(n.latency.max-n.latency.target+500)/1e3:void 0}}})),n.playbackRate&&n.playbackRate.max>1&&(t.debug("Apply LL properties coming from service description. Max PlaybackRate:",n.playbackRate.max),C.update({streaming:{liveCatchup:{playbackRate:n.playbackRate.max-1}}})))}}(n),i=y.getLiveDelay()?y.getLiveDelay():null===C.get().streaming.delay.liveDelayFragmentCount||isNaN(C.get().streaming.delay.liveDelayFragmentCount)||isNaN(o)?!0===C.get().streaming.delay.useSuggestedPresentationDelay&&null!==l&&!isNaN(l)&&l>0?l:isNaN(o)?n&&!isNaN(n.minBufferTime)?4*n.minBufferTime:4*g.manifestInfo.minBufferTime:4*o:o*C.get().streaming.delay.liveDelayFragmentCount,null!==(s=c.getAvailabilityStartTime())&&(T=s),n&&n.dvrWindowSize>0){var u=Math.max(n.dvrWindowSize-10,n.dvrWindowSize/2);a=Math.min(i,u)}else a=i;return p=a,a},getLiveDelay:function(){return p},getCurrentLiveLatency:H,play:P,isPaused:M,pause:x,isSeeking:L,getStreamEndTime:O,seek:k,reset:G,updateCurrentTime:Z,getAvailabilityStartTime:function(){return T}},t=Object(l.default)(R).getInstance().getLogger(e),G(),e}c.__dashjs_factory_name="PlaybackController",t.default=o.default.getSingletonFactory(c)},"./src/streaming/controllers/ScheduleController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/streaming/models/FragmentModel.js"),a=n("./src/core/EventBus.js"),s=n("./src/core/events/Events.js"),o=n("./src/core/FactoryMaker.js"),l=n("./src/core/Debug.js"),u=n("./src/streaming/constants/MetricsConstants.js"),c=n("./src/streaming/MediaPlayerEvents.js");function d(e){e=e||{};var t,n,o,d,f,h,p,g,m,y,v,_,T,E=this.context,b=Object(a.default)(E).getInstance(),S=e.dashMetrics,A=e.mediaPlayerModel,w=e.fragmentModel,I=e.abrController,C=e.playbackController,R=e.textController,D=e.type,N=e.bufferController,O=e.settings;function P(e){if(!N.getIsBufferingCompleted()){M();var t=isNaN(e)?0:e;h=setTimeout(x,t)}}function M(){h&&(clearTimeout(h),h=null)}function x(){try{if(function(){try{return D===r.default.TEXT&&!R.isTextEnabled()||C.isPaused()&&(!C.getStreamController().getInitialPlayback()||!C.getStreamController().getAutoPlay())&&!O.get().streaming.scheduling.scheduleWhilePaused}catch(e){return!1}}())return void M();if(function(){try{return d&&(isNaN(y)||v||(e=n.id,t=I.getMaxAllowedIndexFor(D,e),!(!isNaN(m)&&m==t||(o.info("Top quality "+D+" index has changed from "+m+" to "+t),m=t,0)))||!D||!d||S.getCurrentBufferLevel(D)<L())}catch(e){return!1}var e,t}()){var e=!1;T&&(e=I.checkPlaybackQuality(D,n.id)),e||(_||d.quality!==y||v?(v?(o.debug("Switch track for "+D+", representation id = "+d.id),v=!1):o.debug("Quality has changed, get init request for representationid = "+d.id),b.trigger(s.default.INIT_FRAGMENT_NEEDED,{representationId:d.id,sender:t},{streamId:n.id,mediaType:D}),T=!1,_=!1):(o.debug("Media segment needed for ".concat(D," and stream id ").concat(n.id)),b.trigger(s.default.MEDIA_FRAGMENT_NEEDED,{},{streamId:n.id,mediaType:D}),T=!0))}else P(O.get().streaming.lowLatencyEnabled?O.get().streaming.scheduling.lowLatencyTimeout:O.get().streaming.scheduling.defaultTimeout)}catch(e){P(O.get().streaming.lowLatencyEnabled?O.get().streaming.scheduling.lowLatencyTimeout:O.get().streaming.scheduling.defaultTimeout)}}function L(){var e=NaN;return D&&d?e=D===r.default.TEXT?function(){try{if(R.isTextEnabled()){if(isNaN(d.fragmentDuration)){var e=S.getCurrentSchedulingInfo(u.default.SCHEDULING_INFO);return e?e.duration:0}return d.fragmentDuration}return 0}catch(e){return 0}}():D===r.default.AUDIO&&p?function(){try{var e=S.getCurrentBufferLevel(r.default.VIDEO);return isNaN(d.fragmentDuration)?e+1:Math.max(e+1,d.fragmentDuration)}catch(e){return 0}}():function(){try{var e=d.mediaInfo.streamInfo;return I.isPlayingAtTopQuality(e)?e.manifestInfo.duration>=O.get().streaming.buffer.longFormContentDurationThreshold?O.get().streaming.buffer.bufferTimeAtTopQualityLongForm:O.get().streaming.buffer.bufferTimeAtTopQuality:A.getStableBufferTime()}catch(e){return A.getStableBufferTime()}}():e}function k(){F(!0)}function F(e){if(C&&w){var t=w.getRequests({state:i.default.FRAGMENT_MODEL_EXECUTED,time:C.getTime(),threshold:0})[0];t&&C.getTime()>=t.startTime&&((!g.mediaInfo||t.mediaInfo.type===g.mediaInfo.type&&t.mediaInfo.id!==g.mediaInfo.id)&&e&&b.trigger(s.default.TRACK_CHANGE_RENDERED,{mediaType:D,oldMediaInfo:g.mediaInfo,newMediaInfo:t.mediaInfo,streamId:n.id}),t.quality===g.quality&&t.adaptationIndex===g.adaptationIndex||!e||(o.debug("Quality change rendered for streamId ".concat(n.id," and type ").concat(D)),b.trigger(s.default.QUALITY_CHANGE_RENDERED,{mediaType:D,oldQuality:g.quality,newQuality:t.quality,streamId:n.id})),g={mediaInfo:t.mediaInfo,quality:t.quality,adaptationIndex:t.adaptationIndex})}}function U(e){o.debug("Appended bytes for ".concat(e.mediaType," and stream id ").concat(n.id)),(isNaN(e.index)||isNaN(y))&&(y=e.quality,o.info("["+D+"] lastInitializedRepresentationInfo changed to "+e.quality)),P(0)}function B(){w.abortRequests(),M()}function j(){O.get().streaming.scheduling.scheduleWhilePaused||P()}function q(e){S.updatePlayListTraceMetrics({playbackspeed:e.playbackRate.toString()})}function H(){T=!0,f=0,y=NaN,g={mediaInfo:void 0,quality:NaN,adaptationIndex:NaN},m=NaN,v=!1,_=!1}return t={initialize:function(e){p=e,b.on(s.default.BYTES_APPENDED_END_FRAGMENT,U,t),b.on(s.default.URL_RESOLUTION_FAILED,B,t),b.on(c.default.PLAYBACK_STARTED,j,t),b.on(c.default.PLAYBACK_RATE_CHANGED,q,t),b.on(c.default.PLAYBACK_TIME_UPDATED,k,t)},getType:function(){return D},getStreamId:function(){return n.id},setCurrentRepresentation:function(e){d=e},setTimeToLoadDelay:function(e){f=e},getTimeToLoadDelay:function(){return f},setSwitchTrack:function(e){v=e},getSwitchStrack:function(){return v},startScheduleTimer:P,clearScheduleTimer:M,reset:function(){b.off(s.default.BYTES_APPENDED_END_FRAGMENT,U,t),b.off(s.default.URL_RESOLUTION_FAILED,B,t),b.off(c.default.PLAYBACK_STARTED,j,t),b.off(c.default.PLAYBACK_RATE_CHANGED,q,t),b.off(c.default.PLAYBACK_TIME_UPDATED,k,t),M(),F(!1),H(),n=null},getBufferTarget:L,getPlaybackController:function(){return C},setCheckPlaybackQuality:function(e){T=e},setInitSegmentRequired:function(e){_=e}},o=Object(l.default)(E).getInstance().getLogger(t),H(),n=e.streamInfo,t}d.__dashjs_factory_name="ScheduleController",t.default=o.default.getClassFactory(d)},"./src/streaming/controllers/StreamController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/streaming/constants/MetricsConstants.js"),a=n("./src/streaming/Stream.js"),s=n("./src/streaming/ManifestUpdater.js"),o=n("./src/core/EventBus.js"),l=n("./src/core/events/Events.js"),u=n("./src/core/FactoryMaker.js"),c=n("./src/streaming/vo/metrics/PlayList.js"),d=n("./src/core/Debug.js"),f=n("./src/streaming/utils/InitCache.js"),h=n("./src/streaming/utils/URLUtils.js"),p=n("./src/streaming/MediaPlayerEvents.js"),g=n("./src/streaming/controllers/TimeSyncController.js"),m=n("./src/streaming/controllers/MediaSourceController.js"),y=n("./src/streaming/vo/DashJSError.js"),v=n("./src/core/errors/Errors.js"),_=n("./src/streaming/controllers/EventController.js"),T=n("./src/streaming/constants/ConformanceViolationConstants.js");function E(e){return function(e){if(Array.isArray(e))return b(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function S(){var e,t,n,u,b,S,A,w,I,C,R,D,N,O,P,M,x,L,k,F,U,B,j,q,H,G,V,Y,Z,K,z,W,X,$,Q,J,ee,te,ne,re,ie,ae,se,oe,le=this.context,ue=Object(o.default)(le).getInstance();function ce(){!function(){try{var e=w.getStreamsInfo();if(!j&&0===e.length)throw new Error("There are no streams");j&&I.updateManifestUpdateInfo({currentTime:X.getTime(),buffered:W.getBufferRange(),presentationStartTime:e[0].start,clientTimeOffset:U.getClientTimeOffset()}),B.length>0&&function(e){B=B.filter((function(n){var r=e.filter((function(e){return e.id===n.getId()})).length>0||n.getId()===j.getId();return r||(t.debug("Removing stream ".concat(n.getId())),n.reset(!0)),r}))}(e);for(var n=[],r=0,i=e.length;r<i;r++){var a=e[r];n.push(fe(a)),I.addManifestUpdateStreamInfo(a)}Promise.all(n).then((function(){j||he(e),ue.trigger(l.default.STREAMS_COMPOSED),Oe()})).catch((function(e){throw e}))}catch(e){F.error(new y.default(v.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,e.message+"nostreamscomposed",A.getValue())),K=!0,ze()}}()}function de(){ae=!0}function fe(e){var t=Ve(e.id);return t?t.updateData(e):(t=Object(a.default)(le).create({manifestModel:A,mediaPlayerModel:$,dashMetrics:I,manifestUpdater:b,adapter:w,timelineConverter:U,capabilities:n,capabilitiesFilter:u,errHandler:F,baseURLController:D,segmentBaseController:N,textController:H,abrController:P,playbackController:X,eventController:x,mediaController:M,protectionController:q,videoModel:W,streamInfo:e,settings:ie}),B.push(t),t.initialize(),Promise.resolve())}function he(e){Ae();var n=I.getCurrentDVRInfo().range;if(n.end<n.start){se&&clearTimeout(se);var i=Math.min(1e3*(-1*(n.end-n.start)+2),2147483647);return t.debug("Waiting for ".concat(i," ms before playback can start")),ue.trigger(l.default.AST_IN_FUTURE,{delay:i}),void(se=setTimeout((function(){he(e)}),i))}if(w.getIsDynamic()&&B.length){var a=e[0].manifestInfo,s=function(e,t){try{var n=NaN;if(t&&!isNaN(t.maxFragmentDuration)&&isFinite(t.maxFragmentDuration))return t.maxFragmentDuration;if(e&&1===e.length){var i=e[0],a=[r.default.VIDEO,r.default.AUDIO,r.default.TEXT].reduce((function(e,t){var n=w.getMediaInfoForType(i,t);return n&&!1!==n.isFragmented&&e.push(n),e}),[]).reduce((function(e,t){var n=w.getVoRepresentations(t);return n&&n.length>0&&n.forEach((function(t){t&&e.push(t)})),e}),[]).reduce((function(e,t){var n=w.convertRepresentationToRepresentationInfo(t);return n&&n.fragmentDuration&&!isNaN(n.fragmentDuration)&&e.push(n.fragmentDuration),e}),[]);n=Math.max.apply(Math,E(a))}return isFinite(n)?n:NaN}catch(e){return NaN}}(e,a);X.computeAndSetLiveDelay(s,a)}var o=function(){var e;if(w.getIsDynamic()){var n=I.getCurrentDVRInfo();e=(n&&n.range?n.range.end:0)-X.getLiveDelay();var r=n?n.range:null;if(r){var i=ke(!0);isNaN(i)||(t.info("Start time from URI parameters: "+i),e=Math.max(Math.min(e,i),r.start))}}else{e=Xe()[0].getStreamInfo().start;var a=ke(!1);isNaN(a)||(t.info("Start time from URI parameters: "+a),e=Math.max(e,a))}return e}(),u=Se(o),c=null!==u?u:B[0];ue.trigger(l.default.INITIAL_STREAM_SWITCH,{startTime:o}),pe(c,null,o),ee||(ee=setInterval((function(){!Y&&X.getTimeToStreamEnd()<=0&&!X.isSeeking()&&ue.trigger(l.default.PLAYBACK_ENDED,{isLast:Ge().isLast})}),200))}function pe(e,n,r){try{if(Y||!e||n===e&&e.getIsActive())return;Y=!0,ue.trigger(l.default.PERIOD_SWITCH_STARTED,{fromStreamInfo:n?n.getStreamInfo():null,toStreamInfo:e.getStreamInfo()});var i=!1;j=e,n&&(i=Ee(e,n),n.deactivate(i)),r=isNaN(r)?!i&&n?e.getStreamInfo().start:NaN:r,t.info("Switch to stream ".concat(e.getId(),". Seektime is ").concat(r,", current playback time is ").concat(X.getTime(),". Seamless period switch is set to ").concat(i)),ne=ne.filter((function(e){return e.getId()!==j.getId()})),X.initialize(Ge(),!!n),W.getElement()&&ge(r,i)}catch(e){Y=!1}}function ge(e,n){var r;function i(){if(z&&"open"===z.readyState){t.debug("MediaSource is open!"),window.URL.revokeObjectURL(r),z.removeEventListener("sourceopen",i),z.removeEventListener("webkitsourceopen",i),Le();var a=I.getCurrentDVRInfo();C.setSeekable(a.range.start,a.range.end),me(e,n)}}function a(){z.addEventListener("sourceopen",i,!1),z.addEventListener("webkitsourceopen",i,!1),r=C.attachMediaSource(W),t.debug("MediaSource attached to element.  Waiting on open...")}z?n?me(e,n):(C.detachMediaSource(W),a()):(z=C.createMediaSource(),a())}function me(e,t){j.activate(z,t?te:void 0,e).then((function(t){if(t){var n=Object.keys(t);n.length>0&&t[n[0]].getBuffer().changeType&&(re=!0),te=t}isNaN(e)||(ue.trigger(l.default.SEEK_TARGET,{time:e},{streamId:j.getId()}),X.seek(e,!1,!0),j.startScheduleControllers()),Y=!1,ue.trigger(l.default.PERIOD_SWITCH_COMPLETED,{toStreamInfo:Ge()})}))}function ye(e){var t=X.getTime(),n=e.seekTime,r=Se(n);r&&r!==j?r&&r!==j&&(ve(t,n,r),function(e,t){var n=e&&!isNaN(e.seekTime)?e.seekTime:NaN,r=j.getProcessors().map((function(t){return t.prepareOuterPeriodPlaybackSeeking(e)}));Promise.all(r).then((function(){pe(t,j,n)})).catch((function(e){F.error(e)}))}(e,r)):(ve(t,n),function(e){j.getProcessors().forEach((function(t){return t.prepareInnerPeriodPlaybackSeeking(e)})),je(c.PlayListTrace.USER_REQUEST_STOP_REASON)}(e)),qe(c.PlayList.SEEK_START_REASON)}function ve(e,t){_e()}function _e(){ne&&ne.length>0&&(ne.forEach((function(e){e.deactivate(!0)})),ne=[])}function Te(e){e.newMediaInfo.streamInfo.id===j.getId()&&(_e(),j.prepareTrackChange(e))}function Ee(e,t){try{return ie.get().streaming.buffer.reuseExistingSourceBuffers&&(t.isProtectionCompatible(e)||ae)&&(re||t.isMediaCodecCompatible(e,t))}catch(e){return!1}}function be(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;z&&!e.getPreloaded()&&Ee(e,t)&&e.startPreloading(z,te).then((function(){ne.push(e)}))}function Se(e){if(isNaN(e))return null;for(var t=B.length,n=0;n<t;n++){var r=B[n];if(e<parseFloat((r.getStartTime()+r.getDuration()).toFixed(5)))return r}return null}function Ae(){try{var e=w.getIsDynamic(),t=w.getStreamsInfo()[0].manifestInfo,n=X.getTime(),i=U.calcTimeShiftBufferWindow(B,e),a=Me();if(void 0===i.start||void 0===i.end)return;a&&0!==a.length?a.forEach((function(e){I.addDVRInfo(e.getType(),n,t,i)})):I.addDVRInfo(r.default.VIDEO,n,t,i)}catch(e){}}function we(e){if(J&&V){var t=$.getInitialBufferLevel();(isNaN(t)||t<=X.getBufferLevel()||w.getIsDynamic()&&t>X.getLiveDelay())&&(J=!1,qe(c.PlayList.INITIAL_PLAYOUT_START_REASON),X.play())}e&&e.mediaType&&I.addBufferLevel(e.mediaType,new Date,1e3*e.bufferLevel)}function Ie(e){e.streamInfo.id===j.getId()&&e.reason&&e.reason.forceReplace&&_e(),Ve(e.streamInfo.id).prepareQualityChange(e)}function Ce(){if(Ue()){var e=W.getPlaybackQuality();e&&I.addDroppedFrames(e)}}function Re(){t.debug("[onPlaybackStarted]"),!J&&Q&&qe(c.PlayList.RESUME_FROM_PAUSE_START_REASON),J&&(J=!1),Q=!1}function De(e){t.debug("[onPlaybackPaused]"),e.ended||(Q=!0,je(c.PlayListTrace.USER_REQUEST_STOP_REASON))}function Ne(e){t.debug("Stream with id ".concat(e.streamInfo.id," finished buffering"));var n=e.streamInfo.isLast;z&&n?(t.info("[onStreamBufferingCompleted] calls signalEndOfStream of mediaSourceController."),C.signalEndOfStream(z)):Oe()}function Oe(){if(j&&j.getHasFinishedBuffering())for(var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;try{var t=e||j||null;if(t){var n=t.getStreamInfo();return B.filter((function(e){var t=e.getStreamInfo();return t.start>n.start&&n.id!==t.id}))}}catch(e){return[]}}(j),t=0;t<e.length;){var n=e[t],r=0===t?j:e[t-1];!n.getPreloaded()&&r.getHasFinishedBuffering()&&z&&be(n,r),t+=1}}function Pe(){ee&&(clearInterval(ee),ee=null)}function Me(){return j?j.getProcessors():[]}function xe(e){if(j&&!j.getIsEndedEventSignaled()){j.setIsEndedEventSignaled(!0);var n=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)||j||null;if(!e)return null;for(var t=e.getStreamInfo(),n=t.start,r=0,i=-1,a=NaN;r<B.length;){var s=B[r].getStreamInfo(),o=s.start-n;o>0&&(isNaN(a)||o<a)&&t.id!==s.id&&(a=o,i=r),r+=1}return i>=0?B[i]:null}();n?(t.debug("StreamController onEnded, found next stream with id ".concat(n.getStreamInfo().id,". Switching from ").concat(j.getStreamInfo().id," to ").concat(n.getStreamInfo().id)),pe(n,j,NaN)):(t.debug("StreamController no next stream found"),j.setIsEndedEventSignaled(!1)),je(n?c.PlayListTrace.END_OF_PERIOD_STOP_REASON:c.PlayListTrace.END_OF_CONTENT_STOP_REASON)}e&&e.isLast&&Pe()}function Le(e){var t=e||Ge().manifestInfo.duration;C.setDuration(t)}function ke(e){var t=O.getURIFragmentData();if(!t||!t.t)return NaN;var n=Xe()[0].getStreamInfo().start;t.t=t.t.split(",")[0];var r=-1!==t.t.indexOf("posix:")?"now"===t.t.substring(6)?Date.now()/1e3:parseInt(t.t.substring(6)):NaN;return e&&!isNaN(r)?r-X.getAvailabilityStartTime()/1e3:parseInt(t.t)+n}function Fe(e){if(e.error)K=!0,ze();else{t.info("Manifest updated... updating data system wide.");var n=e.manifest;w.updatePeriods(n);var r=w.getUTCTimingSources();!w.getIsDynamic()||r&&0!==r.length||ue.trigger(p.default.CONFORMANCE_VIOLATION,{level:T.default.LEVELS.WARNING,event:T.default.EVENTS.NO_UTC_TIMING_ELEMENT});var i=w.getIsDynamic()?r.concat($.getUTCTimingSources()):r,a=k.isHTTPS(e.manifest.url);i.forEach((function(e){e.value.replace(/.*?:\/\//g,"")===$.getDefaultUtcTimingSource().value.replace(/.*?:\/\//g,"")&&(e.value=e.value.replace(a?new RegExp(/^(http:)?\/\//i):new RegExp(/^(https:)?\/\//i),a?"https://":"http://"),t.debug("Matching default timing source protocol to manifest protocol: ",e.value))})),u.filterUnsupportedFeatures(n).then((function(){D.initialize(n),R.attemptSync(i,w.getIsDynamic())}))}}function Ue(){return!!j&&j.getHasVideoTrack()}function Be(){return!!j&&j.getHasAudioTrack()}function je(e,t){t=t||new Date,Me().forEach((function(n){n.finalisePlayList(t,e)})),I.addPlayList()}function qe(e){I.createPlaylistMetrics(1e3*X.getTime(),e)}function He(e){if(e.error){var n="";switch(e.error.code){case 1:n="MEDIA_ERR_ABORTED";break;case 2:n="MEDIA_ERR_NETWORK";break;case 3:n="MEDIA_ERR_DECODE",oe.counts.mediaErrorDecode+=1;break;case 4:n="MEDIA_ERR_SRC_NOT_SUPPORTED";break;case 5:n="MEDIA_ERR_ENCRYPTED";break;default:n="UNKNOWN"}"MEDIA_ERR_DECODE"===n&&ie.get().errors.recoverAttempts.mediaErrorDecode>=oe.counts.mediaErrorDecode?function(){t.warn("A MEDIA_ERR_DECODE occured: Resetting the MediaSource");var e=X.getTime();j.deactivate(!1),t.warn("MediaSource has been resetted. Resuming playback from time ".concat(e)),ge(e,!1)}():(Z=!0,e.error.message&&(n+=" ("+e.error.message+")"),e.error.msExtendedCode&&(n+=" (0x"+(e.error.msExtendedCode>>>0).toString(16).toUpperCase()+")"),t.fatal("Video Element Error: "+n),e.error&&t.fatal(e.error),F.error(new y.default(e.error.code,n)),ze())}}function Ge(){return j?j.getStreamInfo():null}function Ve(e){for(var t=0,n=B.length;t<n;t++)if(B[t].getId()===e)return B[t];return null}function Ye(){if(!(S&&S.hasOwnProperty("load")&&U&&U.hasOwnProperty("initialize")&&U.hasOwnProperty("reset")&&U.hasOwnProperty("getClientTimeOffset")&&A&&F&&I&&X))throw new Error(r.default.MISSING_CONFIG_ERROR)}function Ze(e){isNaN(e.newDuration)||Le(e.newDuration)}function Ke(){B=[],q=null,Y=!1,j=null,Z=!1,K=!1,J=!0,Q=!1,V=!0,ee=null,ae=!1,re=!1,ne=[],se=null,oe={counts:{mediaErrorDecode:0}}}function ze(){Ye(),R.reset(),je(Z||K?c.PlayListTrace.FAILURE_STOP_REASON:c.PlayListTrace.USER_REQUEST_STOP_REASON);for(var t=0,n=B?B.length:0;t<n;t++)B[t].reset(Z);ue.off(p.default.PLAYBACK_TIME_UPDATED,Ce,e),ue.off(p.default.PLAYBACK_SEEKING,ye,e),ue.off(p.default.PLAYBACK_ERROR,He,e),ue.off(p.default.PLAYBACK_STARTED,Re,e),ue.off(p.default.PLAYBACK_PAUSED,De,e),ue.off(p.default.PLAYBACK_ENDED,xe,e),ue.off(p.default.METRIC_ADDED,We,e),ue.off(p.default.MANIFEST_VALIDITY_CHANGED,Ze,e),ue.off(p.default.BUFFER_LEVEL_UPDATED,we,e),ue.off(p.default.QUALITY_CHANGE_REQUESTED,Ie,e),l.default.KEY_SESSION_UPDATED&&ue.off(l.default.KEY_SESSION_UPDATED,de,e),ue.off(l.default.MANIFEST_UPDATED,Fe,e),ue.off(l.default.STREAM_BUFFERING_COMPLETED,Ne,e),ue.off(l.default.TIME_SYNCHRONIZATION_COMPLETED,ce,e),ue.off(l.default.CURRENT_TRACK_CHANGED,Te,e),D.reset(),b.reset(),x.reset(),I.clearAllCurrentMetrics(),A.setValue(null),S.reset(),U.reset(),L.reset(),z&&(C.detachMediaSource(W),z=null),W=null,q&&(q=null,G=null,A.getValue()&&ue.trigger(l.default.PROTECTION_DESTROYED,{data:A.getValue().url})),Pe(),ue.trigger(l.default.STREAM_TEARDOWN_COMPLETE),Ke()}function We(e){if(e.metric===i.default.DVR_INFO){var t=Be()?r.default.AUDIO:r.default.VIDEO;e.mediaType===t&&C.setSeekable(e.value.range.start,e.value.range.end)}}function Xe(){return B}return e={initialize:function(t,n){Ye(),V=t,G=n,U.initialize(),(b=Object(s.default)(le).create()).setConfig({manifestModel:A,adapter:w,manifestLoader:S,errHandler:F,settings:ie}),b.initialize(),(x=Object(_.default)(le).getInstance()).setConfig({manifestUpdater:b,playbackController:X,settings:ie}),x.start(),R.setConfig({dashMetrics:I,baseURLController:D,errHandler:F,settings:ie}),R.initialize(),q&&(ue.trigger(l.default.PROTECTION_CREATED,{controller:q}),q.setMediaElement(W.getElement()),G&&q.setProtectionData(G)),ue.on(p.default.PLAYBACK_TIME_UPDATED,Ce,e),ue.on(p.default.PLAYBACK_SEEKING,ye,e),ue.on(p.default.PLAYBACK_ERROR,He,e),ue.on(p.default.PLAYBACK_STARTED,Re,e),ue.on(p.default.PLAYBACK_PAUSED,De,e),ue.on(p.default.PLAYBACK_ENDED,xe,e),ue.on(p.default.METRIC_ADDED,We,e),ue.on(p.default.MANIFEST_VALIDITY_CHANGED,Ze,e),ue.on(p.default.BUFFER_LEVEL_UPDATED,we,e),ue.on(p.default.QUALITY_CHANGE_REQUESTED,Ie,e),l.default.KEY_SESSION_UPDATED&&ue.on(l.default.KEY_SESSION_UPDATED,de,e),ue.on(l.default.MANIFEST_UPDATED,Fe,e),ue.on(l.default.STREAM_BUFFERING_COMPLETED,Ne,e),ue.on(l.default.TIME_SYNCHRONIZATION_COMPLETED,ce,e),ue.on(l.default.CURRENT_TRACK_CHANGED,Te,e)},getActiveStreamInfo:Ge,addDVRMetric:Ae,hasVideoTrack:Ue,hasAudioTrack:Be,getStreamById:Ve,getStreamForTime:Se,getTimeRelativeToStreamId:function(e,t){for(var n=null,r=0,i=0,a=null,s=0;s<B.length;s++){if(i=(n=B[s]).getStartTime(),a=n.getDuration(),Number.isFinite(i)&&(r=i),n.getId()===t)return e-r;Number.isFinite(a)&&(r+=a)}return null},load:function(e){Ye(),S.load(e)},loadWithManifest:function(e){!function(){if(!b||!b.hasOwnProperty("setManifest"))throw new Error("initialize function has to be called previously")}(),b.setManifest(e)},getActiveStreamProcessors:Me,setConfig:function(e){e&&(e.capabilities&&(n=e.capabilities),e.capabilitiesFilter&&(u=e.capabilitiesFilter),e.manifestLoader&&(S=e.manifestLoader),e.manifestModel&&(A=e.manifestModel),e.mediaPlayerModel&&($=e.mediaPlayerModel),e.protectionController&&(q=e.protectionController),e.adapter&&(w=e.adapter),e.dashMetrics&&(I=e.dashMetrics),e.errHandler&&(F=e.errHandler),e.timelineConverter&&(U=e.timelineConverter),e.videoModel&&(W=e.videoModel),e.playbackController&&(X=e.playbackController),e.textController&&(H=e.textController),e.abrController&&(P=e.abrController),e.mediaController&&(M=e.mediaController),e.settings&&(ie=e.settings),e.baseURLController&&(D=e.baseURLController),e.uriFragmentModel&&(O=e.uriFragmentModel),e.segmentBaseController&&(N=e.segmentBaseController))},setProtectionData:function(e){G=e,q&&q.setProtectionData(G)},getIsStreamSwitchInProgress:function(){return Y},switchToVideoElement:function(e){j&&(X.initialize(Ge()),ge(e,!1))},getHasMediaOrInitialisationError:function(){return Z||K},getStreams:Xe,getActiveStream:function(){return j},getInitialPlayback:function(){return J},getAutoPlay:function(){return V},reset:ze},t=Object(d.default)(le).getInstance().getLogger(e),R=Object(g.default)(le).getInstance(),C=Object(m.default)(le).getInstance(),L=Object(f.default)(le).getInstance(),k=Object(h.default)(le).getInstance(),Ke(),e}S.__dashjs_factory_name="StreamController",t.default=u.default.getSingletonFactory(S)},"./src/streaming/controllers/TimeSyncController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/vo/DashJSError.js"),i=n("./src/streaming/vo/metrics/HTTPRequest.js"),a=n("./src/core/EventBus.js"),s=n("./src/core/events/Events.js"),o=n("./src/core/errors/Errors.js"),l=n("./src/core/FactoryMaker.js"),u=n("./src/core/Debug.js"),c=n("./src/streaming/utils/URLUtils.js");function d(){var e,t,n,l,d,f,h,p,g,m,y,v,_,T,E,b,S=this.context,A=Object(a.default)(S).getInstance(),w=Object(c.default)(S).getInstance();function I(){p=[],g=[],m=null,y=null,_=null,v=NaN,n=!1,l=!1,T=d.get().streaming.utcSynchronization.timeBetweenSyncAttempts}function C(){d.get().streaming.utcSynchronization.enabled&&!n&&!l&&_&&_.value&&_.schemeIdUri&&!isNaN(v)&&!isNaN(d.get().streaming.utcSynchronization.backgroundAttempts)&&(y&&(Date.now()-y)/1e3<30||(p=[],l=!0,R(isNaN(d.get().streaming.utcSynchronization.backgroundAttempts)?2:d.get().streaming.utcSynchronization.backgroundAttempts)))}function R(e){try{if(e<=0)return void j();var t=Date.now();f[_.schemeIdUri](_.value,(function(n){var r=Date.now(),i=N(t,r,n);p.push(i),R(e-1)}),(function(){j()}))}catch(e){j()}}function D(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)||0;if(!g||0===g.length||e>=g.length)O();else{var t=g[e];if(t)if(f.hasOwnProperty(t.schemeIdUri)){var n=(new Date).getTime();f[t.schemeIdUri](t.value,(function(e){var r=(new Date).getTime(),i=N(n,r,e);_=t,O(i)}),(function(){D(e+1)}))}else D(e+1);else O()}}function N(e,t,n){return n-(t-(t-e)/2)}function O(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:NaN,r=isNaN(n);r&&d.get().streaming.utcSynchronization.useManifestDateHeaderTimeSource?(t=null!==(e=h.getLatestMPDRequestHeaderValueByID("Date"))?new Date(e).getTime():Number.NaN,isNaN(t)?B(!0):B(!1,t-Date.now())):B(r,n)}function P(e){var t=Date.parse(e);return isNaN(t)&&(t=function(e){var t,n,r=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+\-])([0-9]{2})([0-9]{2}))?/.exec(e);return t=Date.UTC(parseInt(r[1],10),parseInt(r[2],10)-1,parseInt(r[3],10),parseInt(r[4],10),parseInt(r[5],10),r[6]&&(parseInt(r[6],10)||0),r[7]&&1e3*parseFloat(r[7])||0),r[9]&&r[10]&&(n=60*parseInt(r[9],10)+parseInt(r[10],10),t+=("+"===r[8]?-1:1)*n*60*1e3),new Date(t).getTime()}(e)),t}function M(e){return Date.parse(e)}function x(e){return Date.parse(e)}function L(e,t,n){n()}function k(e,t,n){var r=P(e);isNaN(r)?n():t(r)}function F(e,t,n,r,a){var s,o,l=!1,u=new XMLHttpRequest,c=a?i.HTTPRequest.HEAD:i.HTTPRequest.GET,d=t.match(/\S+/g);if(t=d.shift(),s=function(){l||(l=!0,d.length?F(e,d.join(" "),n,r,a):r())},o=function(){var t,r;200===u.status&&(t=a?u.getResponseHeader("Date"):u.response,r=e(t),isNaN(r)||(n(r),l=!0))},w.isRelative(t)){var f=b.resolve();f&&(t=w.resolve(t,f.url))}u.open(c,t),u.timeout=5e3,u.onload=o,u.onloadend=s,u.send()}function U(e,t,n){F(x,e,t,n,!0)}function B(e,i){if(isNaN(v)||isNaN(i)||e||function(e){try{var n,r=q(e),i=isNaN(T)?30:T,a=isNaN(d.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor)?2:d.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor,s=isNaN(d.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts)?600:d.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts,o=isNaN(d.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts)?2:d.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts;r?(n=Math.min(i*a,s),t.debug("Increasing timeBetweenSyncAttempts to ".concat(n))):(n=Math.max(i/a,o),t.debug("Decreasing timeBetweenSyncAttempts to ".concat(n))),T=n}catch(e){}}(i),!e&&!isNaN(i)){m=Date.now(),n=!1;var a=isNaN(v);v=i,a&&C(),t.debug("Completed UTC sync. Setting client - server offset to ".concat(i))}e&&(_=null,n=!1,E.error(new r.default(o.default.TIME_SYNC_FAILED_ERROR_CODE,o.default.TIME_SYNC_FAILED_ERROR_MESSAGE))),A.trigger(s.default.UPDATE_TIME_SYNC_OFFSET,{offset:i}),A.trigger(s.default.TIME_SYNCHRONIZATION_COMPLETED)}function j(){if(p&&0!==p.length){var e=p.reduce((function(e,t){return e+t}),0)/p.length;q(e)?t.debug("Completed background UTC sync. Offset is within allowed threshold and is not adjusted."):(t.debug("Completed background UTC sync. Setting client - server offset to ".concat(e)),v=e,A.trigger(s.default.UPDATE_TIME_SYNC_OFFSET,{offset:v})),l=!1,y=Date.now()}}function q(e){try{if(isNaN(v))return!0;var t=d.get().streaming.utcSynchronization.maximumAllowedDrift&&!isNaN(d.get().streaming.utcSynchronization.maximumAllowedDrift)?d.get().streaming.utcSynchronization.maximumAllowedDrift:100;return e>=v-t&&e<=v+t}catch(e){return!0}}return e={initialize:function(){I(),f={"urn:mpeg:dash:utc:http-head:2014":U,"urn:mpeg:dash:utc:http-xsdate:2014":F.bind(null,P),"urn:mpeg:dash:utc:http-iso:2014":F.bind(null,M),"urn:mpeg:dash:utc:direct:2014":k,"urn:mpeg:dash:utc:http-head:2012":U,"urn:mpeg:dash:utc:http-xsdate:2012":F.bind(null,P),"urn:mpeg:dash:utc:http-iso:2012":F.bind(null,M),"urn:mpeg:dash:utc:direct:2012":k,"urn:mpeg:dash:utc:http-ntp:2014":L,"urn:mpeg:dash:utc:ntp:2014":L,"urn:mpeg:dash:utc:sntp:2014":L}},attemptSync:function(e,t){g=e,n||(function(e){try{if(!e||!d.get().streaming.utcSynchronization.enabled)return!1;var t=isNaN(T)?30:T;return!(m&&t&&!isNaN(t))||(Date.now()-m)/1e3>=t}catch(e){return!0}}(t)?(n=!0,D()):A.trigger(s.default.TIME_SYNCHRONIZATION_COMPLETED))},setConfig:function(e){e&&(e.dashMetrics&&(h=e.dashMetrics),e.baseURLController&&(b=e.baseURLController),e.errHandler&&(E=e.errHandler),e.settings&&(d=e.settings))},reset:function(){I(),A.off(s.default.ATTEMPT_BACKGROUND_SYNC,C,e)}},t=Object(u.default)(S).getInstance().getLogger(e),A.on(s.default.ATTEMPT_BACKGROUND_SYNC,C,e),e}d.__dashjs_factory_name="TimeSyncController";var f=l.default.getSingletonFactory(d);f.HTTP_TIMEOUT_MS=5e3,l.default.updateSingletonFactory(d.__dashjs_factory_name,f),t.default=f},"./src/streaming/controllers/XlinkController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/XlinkLoader.js"),i=n("./src/core/EventBus.js"),a=n("./src/core/events/Events.js"),s=n("./src/core/FactoryMaker.js"),o=n("./externals/xml2json.js"),l=n("./src/streaming/utils/URLUtils.js"),u=n("./src/dash/constants/DashConstants.js"),c="onLoad";function d(e){e=e||{};var t,n,s,d,f,h,p=this.context,g=Object(i.default)(p).getInstance(),m=Object(l.default)(p).getInstance();function y(e,t,n){var r,i,a={};a.elements=e,a.type=t,a.resolveType=n,0===a.elements.length&&_(a);for(var s=0;s<a.elements.length;s++)r=a.elements[s],i=m.isHTTPURL(r.url)?r.url:r.originalContent.BaseURL+r.url,h.load(i,r,a)}function v(e){var t,n,r="";if(t=e.element,n=e.resolveObject,t.resolvedContent){var i=0;0===t.resolvedContent.indexOf("<?xml")&&(i=t.resolvedContent.indexOf("?>")+2),r=t.resolvedContent.substr(0,i)+"<response>"+t.resolvedContent.substr(i)+"</response>",t.resolvedContent=f.xml_str2json(r)}(function(e){var t;for(t=0;t<e.elements.length;t++)if(!1===e.elements[t].resolved)return!1;return!0})(n)&&_(n)}function _(e){var t,n,r=[];if(function(e){var t,n,r,i,a,o,l=[];for(i=e.elements.length-1;i>=0;i--){if(n=(t=e.elements[i]).type+"_asArray",t.resolvedContent){if(t.resolvedContent)for(a=0;a<t.resolvedContent[n].length;a++)r=t.resolvedContent[n][a],l.push(r)}else delete t.originalContent["xlink:actuate"],delete t.originalContent["xlink:href"],l.push(t.originalContent);for(t.parentElement[n].splice(t.index,1),o=0;o<l.length;o++)t.parentElement[n].splice(t.index+o,0,l[o]);l=[]}e.elements.length>0&&s.run(d)}(e),"onActuate"===e.resolveType&&g.trigger(a.default.XLINK_READY,{manifest:d}),e.resolveType===c)switch(e.type){case u.default.PERIOD:for(t=0;t<d[u.default.PERIOD+"_asArray"].length;t++)(n=d[u.default.PERIOD+"_asArray"][t]).hasOwnProperty(u.default.ADAPTATION_SET+"_asArray")&&(r=r.concat(T(n[u.default.ADAPTATION_SET+"_asArray"],n,u.default.ADAPTATION_SET,c))),n.hasOwnProperty(u.default.EVENT_STREAM+"_asArray")&&(r=r.concat(T(n[u.default.EVENT_STREAM+"_asArray"],n,u.default.EVENT_STREAM,c)));y(r,u.default.ADAPTATION_SET,c);break;case u.default.ADAPTATION_SET:g.trigger(a.default.XLINK_READY,{manifest:d})}}function T(e,t,n,r){var i,a,s,o=[];for(a=e.length-1;a>=0;a--)(i=e[a]).hasOwnProperty("xlink:href")&&"urn:mpeg:dash:resolve-to-zero:2013"===i["xlink:href"]&&e.splice(a,1);for(a=0;a<e.length;a++)(i=e[a]).hasOwnProperty("xlink:href")&&i.hasOwnProperty("xlink:actuate")&&i["xlink:actuate"]===r&&(s=E(i["xlink:href"],t,n,a,r,i),o.push(s));return o}function E(e,t,n,r,i,a){return{url:e,parentElement:t,type:n,index:r,resolveType:i,originalContent:a,resolvedContent:null,resolved:!1}}return t={resolveManifestOnLoad:function(e){f=new o.default({escapeMode:!1,attributePrefix:"",arrayAccessForm:"property",emptyNodeForm:"object",stripWhitespaces:!1,enableToStringFunc:!1,ignoreRoot:!0,matchers:n}),(d=e).Period_asArray?y(T(d.Period_asArray,d,u.default.PERIOD,c),u.default.PERIOD,c):g.trigger(a.default.XLINK_READY,{manifest:d})},setMatchers:function(e){e&&(n=e)},setIron:function(e){e&&(s=e)},reset:function(){g.off(a.default.XLINK_ELEMENT_LOADED,v,t),h&&(h.reset(),h=null)}},g.on(a.default.XLINK_ELEMENT_LOADED,v,t),h=Object(r.default)(p).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,settings:e.settings}),t}d.__dashjs_factory_name="XlinkController",t.default=s.default.getClassFactory(d)},"./src/streaming/metrics/MetricsReporting.js":function(e,t,n){n.r(t);var r=n("./src/streaming/metrics/utils/DVBErrorsTranslator.js"),i=n("./src/streaming/metrics/MetricsReportingEvents.js"),a=n("./src/streaming/metrics/controllers/MetricsCollectionController.js"),s=n("./src/streaming/metrics/metrics/MetricsHandlerFactory.js"),o=n("./src/streaming/metrics/reporting/ReportingFactory.js");function l(){var e=this.context;return{createMetricsReporting:function(t){return Object(r.default)(e).getInstance({eventBus:t.eventBus,dashMetrics:t.dashMetrics,metricsConstants:t.metricsConstants,events:t.events}).initialise(),Object(a.default)(e).create(t)},getReportingFactory:function(){return Object(o.default)(e).getInstance()},getMetricsHandlerFactory:function(){return Object(s.default)(e).getInstance()}}}l.__dashjs_factory_name="MetricsReporting";var u=dashjs.FactoryMaker.getClassFactory(l);u.events=i.default,dashjs.FactoryMaker.updateClassFactory(l.__dashjs_factory_name,u),t.default=u},"./src/streaming/metrics/MetricsReportingEvents.js":function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=s(e);if(t){var a=s(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}n.r(t);var o=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(n,e);var t=a(n);function n(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(e=t.call(this)).METRICS_INITIALISATION_COMPLETE="internal_metricsReportingInitialized",e.BECAME_REPORTING_PLAYER="internal_becameReportingPlayer",e.CMCD_DATA_GENERATED="cmcdDataGenerated",e}return n}(n("./src/core/events/EventsBase.js").default));t.default=o},"./src/streaming/metrics/controllers/MetricsCollectionController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/metrics/controllers/MetricsController.js"),i=n("./src/streaming/metrics/utils/ManifestParsing.js"),a=n("./src/streaming/metrics/MetricsReportingEvents.js");function s(e){var t;e=e||{};var n={},s=this.context,o=e.eventBus,l=e.events;function u(t){if(!t.error){var l=Object.keys(n);Object(i.default)(s).getInstance({adapter:e.adapter,constants:e.constants}).getMetrics(t.manifest).forEach((function(t){var i=JSON.stringify(t);if(n.hasOwnProperty(i))l.splice(i,1);else try{var a=Object(r.default)(s).create(e);a.initialize(t),n[i]=a}catch(e){}})),l.forEach((function(e){n[e].reset(),delete n[e]})),o.trigger(a.default.METRICS_INITIALISATION_COMPLETE)}}function c(){Object.keys(n).forEach((function(e){n[e].reset()})),n={}}return t={reset:function(){o.off(l.MANIFEST_UPDATED,u,t),o.off(l.STREAM_TEARDOWN_COMPLETE,c,t)}},o.on(l.MANIFEST_UPDATED,u,t),o.on(l.STREAM_TEARDOWN_COMPLETE,c,t),t}s.__dashjs_factory_name="MetricsCollectionController",t.default=dashjs.FactoryMaker.getClassFactory(s)},"./src/streaming/metrics/controllers/MetricsController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/metrics/controllers/RangeController.js"),i=n("./src/streaming/metrics/controllers/ReportingController.js"),a=n("./src/streaming/metrics/controllers/MetricsHandlersController.js");function s(e){var t,n,s;e=e||{};var o=this.context;function l(){t&&t.reset(),n&&n.reset(),s&&s.reset()}return{initialize:function(u){try{(s=Object(r.default)(o).create({mediaElement:e.mediaElement})).initialize(u.Range),(n=Object(i.default)(o).create({debug:e.debug,metricsConstants:e.metricsConstants})).initialize(u.Reporting,s),(t=Object(a.default)(o).create({debug:e.debug,eventBus:e.eventBus,metricsConstants:e.metricsConstants,events:e.events})).initialize(u.metrics,n)}catch(e){throw l(),e}},reset:l}}s.__dashjs_factory_name="MetricsController",t.default=dashjs.FactoryMaker.getClassFactory(s)},"./src/streaming/metrics/controllers/MetricsHandlersController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/metrics/metrics/MetricsHandlerFactory.js");function i(e){e=e||{};var t,n=[],i=this.context,a=e.eventBus,s=e.events,o=Object(r.default)(i).getInstance({debug:e.debug,eventBus:e.eventBus,metricsConstants:e.metricsConstants});function l(e){n.forEach((function(t){t.handleNewMetric(e.metric,e.value,e.mediaType)}))}return t={initialize:function(e,r){e.split(",").forEach((function(e,t,i){var a;if(-1!==e.indexOf("(")&&-1===e.indexOf(")")){var s=i[t+1];s&&-1===s.indexOf("(")&&-1!==s.indexOf(")")&&(e+=","+s,delete i[t+1])}(a=o.create(e,r))&&n.push(a)})),a.on(s.METRIC_ADDED,l,t),a.on(s.METRIC_UPDATED,l,t)},reset:function(){a.off(s.METRIC_ADDED,l,t),a.off(s.METRIC_UPDATED,l,t),n.forEach((function(e){return e.reset()})),n=[]}}}i.__dashjs_factory_name="MetricsHandlersController",t.default=dashjs.FactoryMaker.getClassFactory(i)},"./src/streaming/metrics/controllers/RangeController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/utils/CustomTimeRanges.js");function i(e){e=e||{};var t,n,i=!1,a=this.context,s=e.mediaElement;return t={initialize:function(e){e&&e.length&&(e.forEach((function(e){var t=e.starttime,r=t+e.duration;n.add(t,r)})),i=!!e[0]._useWallClockTime)},reset:function(){n.clear()},isEnabled:function(){var e,t=n.length;if(!t)return!0;e=i?(new Date).getTime()/1e3:s.currentTime;for(var r=0;r<t;r+=1){var a=n.start(r),o=n.end(r);if(a<=e&&e<o)return!0}return!1}},n=Object(r.default)(a).create(),t}i.__dashjs_factory_name="RangeController",t.default=dashjs.FactoryMaker.getClassFactory(i)},"./src/streaming/metrics/controllers/ReportingController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/metrics/reporting/ReportingFactory.js");function i(e){var t=[],n=Object(r.default)(this.context).getInstance(e);return{initialize:function(e,r){e.some((function(e){var i=n.create(e,r);if(i)return t.push(i),!0}))},reset:function(){t.forEach((function(e){return e.reset()})),t=[]},report:function(e,n){t.forEach((function(t){return t.report(e,n)}))}}}i.__dashjs_factory_name="ReportingController",t.default=dashjs.FactoryMaker.getClassFactory(i)},"./src/streaming/metrics/metrics/MetricsHandlerFactory.js":function(e,t,n){n.r(t);var r=n("./src/streaming/metrics/metrics/handlers/BufferLevelHandler.js"),i=n("./src/streaming/metrics/metrics/handlers/DVBErrorsHandler.js"),a=n("./src/streaming/metrics/metrics/handlers/HttpListHandler.js"),s=n("./src/streaming/metrics/metrics/handlers/GenericMetricHandler.js");function o(e){var t,n=(e=e||{}).debug?e.debug.getLogger(t):{},o=/([a-zA-Z]*)(\(([0-9]*)(\,\s*([a-zA-Z]*))?\))?/,l=this.context,u={BufferLevel:r.default,DVBErrors:i.default,HttpList:a.default,PlayList:s.default,RepSwitchList:s.default,TcpList:s.default};return{create:function(t,r){var i,a=t.match(o);if(a){try{(i=u[a[1]](l).create({eventBus:e.eventBus,metricsConstants:e.metricsConstants})).initialize(a[1],r,a[3],a[5])}catch(e){i=null,n.error("MetricsHandlerFactory: Could not create handler for type ".concat(a[1]," with args ").concat(a[3],", ").concat(a[5]," (").concat(e.message,")"))}return i}},register:function(e,t){u[e]=t},unregister:function(e){delete u[e]}}}o.__dashjs_factory_name="MetricsHandlerFactory",t.default=dashjs.FactoryMaker.getSingletonFactory(o)},"./src/streaming/metrics/metrics/handlers/BufferLevelHandler.js":function(e,t,n){n.r(t);var r=n("./src/streaming/metrics/utils/HandlerHelpers.js");function i(e){var t,n,i,a,s;e=e||{};var o=this.context,l=Object(r.default)(o).getInstance(),u=[],c=e.metricsConstants;function d(){var e=function(){try{return Object.keys(u).map((function(e){return u[e]})).reduce((function(e,t){return e.level<t.level?e:t}))}catch(e){return}}();e&&s!==e.t&&(s=e.t,t.report(i,e))}return{initialize:function(e,r,s){r&&(n=l.validateN(s),t=r,i=l.reconstructFullMetricName(e,s),a=setInterval(d,n))},reset:function(){clearInterval(a),a=null,n=0,t=null,s=null},handleNewMetric:function(e,t,n){e===c.BUFFER_LEVEL&&(u[n]=t)}}}i.__dashjs_factory_name="BufferLevelHandler",t.default=dashjs.FactoryMaker.getClassFactory(i)},"./src/streaming/metrics/metrics/handlers/DVBErrorsHandler.js":function(e,t,n){n.r(t);var r=n("./src/streaming/metrics/MetricsReportingEvents.js");t.default=dashjs.FactoryMaker.getClassFactory((function(e){var t,n=(e=e||{}).eventBus,i=e.metricsConstants;function a(){n.off(r.default.METRICS_INITIALISATION_COMPLETE,a,this),n.trigger(r.default.BECAME_REPORTING_PLAYER)}return{initialize:function(e,i){i&&(t=i,n.on(r.default.METRICS_INITIALISATION_COMPLETE,a,this))},reset:function(){t=null},handleNewMetric:function(e,n){e===i.DVB_ERRORS&&t&&t.report(e,n)}}}))},"./src/streaming/metrics/metrics/handlers/GenericMetricHandler.js":function(e,t,n){function r(){var e,t;return{initialize:function(n,r){e=n,t=r},reset:function(){t=null,e=void 0},handleNewMetric:function(n,r){n===e&&t&&t.report(e,r)}}}n.r(t),r.__dashjs_factory_name="GenericMetricHandler",t.default=dashjs.FactoryMaker.getClassFactory(r)},"./src/streaming/metrics/metrics/handlers/HttpListHandler.js":function(e,t,n){n.r(t);var r=n("./src/streaming/metrics/utils/HandlerHelpers.js");function i(e){var t,n,i,a,s;e=e||{};var o=[],l=Object(r.default)(this.context).getInstance(),u=e.metricsConstants;function c(){var e=o;e.length&&t&&t.report(a,e),o=[]}return{initialize:function(e,r,o,u){r&&(n=l.validateN(o),t=r,u&&u.length&&(i=u),a=l.reconstructFullMetricName(e,o,u),s=setInterval(c,n))},reset:function(){clearInterval(s),s=null,n=null,i=null,o=[],t=null},handleNewMetric:function(e,t){e===u.HTTP_REQUEST&&(i&&i!==t.type||o.push(t))}}}i.__dashjs_factory_name="HttpListHandler",t.default=dashjs.FactoryMaker.getClassFactory(i)},"./src/streaming/metrics/reporting/ReportingFactory.js":function(e,t,n){n.r(t);var r=n("./src/streaming/metrics/reporting/reporters/DVBReporting.js");function i(e){e=e||{};var t,n={"urn:dvb:dash:reporting:2014":r.default},i=this.context,a=e.debug?e.debug.getLogger(t):{},s=e.metricsConstants;return{create:function(e,t){var r;try{(r=n[e.schemeIdUri](i).create({metricsConstants:s})).initialize(e,t)}catch(t){r=null,a.error("ReportingFactory: could not create Reporting with schemeIdUri ".concat(e.schemeIdUri," (").concat(t.message,")"))}return r},register:function(e,t){n[e]=t},unregister:function(e){delete n[e]}}}i.__dashjs_factory_name="ReportingFactory",t.default=dashjs.FactoryMaker.getSingletonFactory(i)},"./src/streaming/metrics/reporting/reporters/DVBReporting.js":function(e,t,n){n.r(t);var r=n("./src/streaming/metrics/utils/MetricSerialiser.js"),i=n("./src/streaming/metrics/utils/RNG.js");function a(e){var t;e=e||{};var n,a,s,o,l,u,c=this.context,d=[],f=e.metricsConstants;function h(){s=!1,o=!1,l=null,u=null}return t={report:function(e,t){Array.isArray(t)||(t=[t]),o&&u.isEnabled()&&t.forEach((function(t){var r=n.serialise(t);e!==f.DVB_ERRORS&&(r="metricname=".concat(e,"&").concat(r)),function(e,t,n){var r=new XMLHttpRequest,i=function(){var e=d.indexOf(r);-1!==e&&(d.splice(e,1),r.status>=200&&r.status<300?t&&t():n&&n())};d.push(r);try{r.open("GET",e),r.onloadend=i,r.onerror=i,r.send()}catch(e){r.onerror()}}(r="".concat(l,"?").concat(r),null,(function(){o=!1}))}))},initialize:function(e,t){var n;if(u=t,!(l=e.dvb_reportingUrl))throw new Error("required parameter missing (dvb:reportingUrl)");s||((n=e.dvb_probability)&&(1e3===n||n/1e3>=a.random())&&(o=!0),s=!0)},reset:function(){h()}},n=Object(r.default)(c).getInstance(),a=Object(i.default)(c).getInstance(),h(),t}a.__dashjs_factory_name="DVBReporting",t.default=dashjs.FactoryMaker.getClassFactory(a)},"./src/streaming/metrics/utils/DVBErrorsTranslator.js":function(e,t,n){n.r(t);var r=n("./src/streaming/metrics/vo/DVBErrors.js"),i=n("./src/streaming/metrics/MetricsReportingEvents.js");function a(e){var t,n,a=(e=e||{}).eventBus,s=e.dashMetrics,o=e.metricsConstants,l=e.events;function u(e){var t=new r.default;if(n){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);t.mpdurl||(t.mpdurl=n.originalUrl||n.url),t.terror||(t.terror=new Date),s.addDVBErrors(t)}}function c(e){e.error||(n=e.manifest)}function d(e){u({errorcode:r.default.BASE_URL_CHANGED,servicelocation:e.entry})}function f(){u({errorcode:r.default.BECAME_REPORTER})}function h(e){var t;e.metric===o.HTTP_REQUEST&&(0===(t=e.value).responsecode||null==t.responsecode||t.responsecode>=400||t.responsecode<100||t.responsecode>=600)&&u({errorcode:t.responsecode||r.default.CONNECTION_ERROR,url:t.url,terror:t.tresponse,servicelocation:t._serviceLocation})}function p(e){var t;switch(e.error?e.error.code:0){case MediaError.MEDIA_ERR_NETWORK:t=r.default.CONNECTION_ERROR;break;case MediaError.MEDIA_ERR_DECODE:t=r.default.CORRUPT_MEDIA_OTHER;break;default:return}u({errorcode:t})}return t={initialise:function(){a.on(l.MANIFEST_UPDATED,c,t),a.on(l.SERVICE_LOCATION_BLACKLIST_CHANGED,d,t),a.on(l.METRIC_ADDED,h,t),a.on(l.METRIC_UPDATED,h,t),a.on(l.PLAYBACK_ERROR,p,t),a.on(i.default.BECAME_REPORTING_PLAYER,f,t)},reset:function(){a.off(l.MANIFEST_UPDATED,c,t),a.off(l.SERVICE_LOCATION_BLACKLIST_CHANGED,d,t),a.off(l.METRIC_ADDED,h,t),a.off(l.METRIC_UPDATED,h,t),a.off(l.PLAYBACK_ERROR,p,t),a.off(i.default.BECAME_REPORTING_PLAYER,f,t)}}}a.__dashjs_factory_name="DVBErrorsTranslator",t.default=dashjs.FactoryMaker.getSingletonFactory(a)},"./src/streaming/metrics/utils/HandlerHelpers.js":function(e,t,n){function r(){return{reconstructFullMetricName:function(e,t,n){var r=e;return t&&(r+="("+t,n&&n.length&&(r+=","+n),r+=")"),r},validateN:function(e){if(!e)throw new Error("missing n");if(isNaN(e))throw new Error("n is NaN");if(e<0)throw new Error("n must be positive");return e}}}n.r(t),r.__dashjs_factory_name="HandlerHelpers",t.default=dashjs.FactoryMaker.getSingletonFactory(r)},"./src/streaming/metrics/utils/ManifestParsing.js":function(e,t,n){n.r(t);var r=n("./src/streaming/metrics/vo/Metrics.js"),i=n("./src/streaming/metrics/vo/Range.js"),a=n("./src/streaming/metrics/vo/Reporting.js");function s(e){var t=(e=e||{}).adapter,n=e.constants;return{getMetrics:function(e){var s=[];return e&&e.Metrics_asArray&&e.Metrics_asArray.forEach((function(o){var l=new r.default,u=t.getIsDynamic(e);o.hasOwnProperty("metrics")&&(l.metrics=o.metrics,o.Range_asArray&&o.Range_asArray.forEach((function(r){var a=new i.default;a.starttime=function(e,r,i){var a,s,o=0;return r?o=t.getAvailabilityStartTime(e)/1e3:(a=t.getRegularPeriods(e)).length&&(o=a[0].start),s=o,i&&i.hasOwnProperty(n.START_TIME)&&(s+=i.starttime),s}(e,u,r),r.hasOwnProperty("duration")?a.duration=r.duration:a.duration=t.getDuration(e),a._useWallClockTime=u,l.Range.push(a)})),o.Reporting_asArray&&(o.Reporting_asArray.forEach((function(e){var t=new a.default;e.hasOwnProperty(n.SCHEME_ID_URI)&&(t.schemeIdUri=e.schemeIdUri,e.hasOwnProperty("value")&&(t.value=e.value),e.hasOwnProperty(n.DVB_REPORTING_URL)&&(t.dvb_reportingUrl=e[n.DVB_REPORTING_URL]),e.hasOwnProperty(n.DVB_PROBABILITY)&&(t.dvb_probability=e[n.DVB_PROBABILITY]),l.Reporting.push(t))})),s.push(l)))})),s}}}s.__dashjs_factory_name="ManifestParsing",t.default=dashjs.FactoryMaker.getSingletonFactory(s)},"./src/streaming/metrics/utils/MetricSerialiser.js":function(e,t,n){function r(){return{serialise:function e(t){var n,r,i=[],a=[];for(n in t)if(t.hasOwnProperty(n)&&0!==n.indexOf("_")){if(null==(r=t[n])&&(r=""),Array.isArray(r)){if(!r.length)continue;a=[],r.forEach((function(t){var n="Object"!==Object.prototype.toString.call(t).slice(8,-1);a.push(n?t:e(t))})),r=a.map(encodeURIComponent).join(",")}else"string"==typeof r?r=encodeURIComponent(r):r instanceof Date?r=r.toISOString():"number"==typeof r&&(r=Math.round(r));i.push(n+"="+r)}return i.join("&")}}}n.r(t),r.__dashjs_factory_name="MetricSerialiser",t.default=dashjs.FactoryMaker.getSingletonFactory(r)},"./src/streaming/metrics/utils/RNG.js":function(e,t,n){function r(){var e,t,n,r=window.crypto||window.msCrypto,i=Uint32Array,a=Math.pow(2,8*i.BYTES_PER_ELEMENT)-1,s=10;function o(){r&&(e||(e=new i(s)),r.getRandomValues(e),t=0)}return n={random:function(n,i){var s;return n||(n=0),i||(i=1),r?(t===e.length&&o(),s=e[t]/a,t+=1):s=Math.random(),s*(i-n)+n}},o(),n}n.r(t),r.__dashjs_factory_name="RNG",t.default=dashjs.FactoryMaker.getSingletonFactory(r)},"./src/streaming/metrics/vo/DVBErrors.js":function(e,t,n){n.r(t);var r=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mpdurl=null,this.errorcode=null,this.terror=null,this.url=null,this.ipaddress=null,this.servicelocation=null};r.SSL_CONNECTION_FAILED_PREFIX="SSL",r.DNS_RESOLUTION_FAILED="C00",r.HOST_UNREACHABLE="C01",r.CONNECTION_REFUSED="C02",r.CONNECTION_ERROR="C03",r.CORRUPT_MEDIA_ISOBMFF="M00",r.CORRUPT_MEDIA_OTHER="M01",r.BASE_URL_CHANGED="F00",r.BECAME_REPORTER="S00",t.default=r},"./src/streaming/metrics/vo/Metrics.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.metrics="",this.Range=[],this.Reporting=[]}},"./src/streaming/metrics/vo/Range.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.starttime=0,this.duration=1/0,this._useWallClockTime=!1}},"./src/streaming/metrics/vo/Reporting.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.schemeIdUri="",this.value="",this.dvb_reportingUrl="",this.dvb_probability=1e3}},"./src/streaming/models/BaseURLTreeModel.js":function(e,t,n){n.r(t);var r=n("./src/streaming/utils/ObjectUtils.js"),i=n("./src/core/FactoryMaker.js"),a=NaN,s=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.data={baseUrls:t||null,selectedIdx:n||a},this.children=[]};function o(){var e,t,n,i=this.context,o=Object(r.default)(i).getInstance();function l(e,t,r){var i=n.getBaseURLsFromElement(r);e[t]?o.areEqual(i,e[t].data.baseUrls)||(e[t].data.baseUrls=i,e[t].data.selectedIdx=a):e[t]=new s(i)}function u(e){!function(){if(!n||!n.hasOwnProperty("getBaseURLsFromElement")||!n.hasOwnProperty("getRepresentationSortFunction"))throw new Error("setConfig function has to be called previously")}();var r=n.getBaseURLsFromElement(e);o.areEqual(r,t.data.baseUrls)||(t.data.baseUrls=r,t.data.selectedIdx=a),e&&e.Period_asArray&&e.Period_asArray.forEach((function(e,r){l(t.children,r,e),e.AdaptationSet_asArray&&e.AdaptationSet_asArray.forEach((function(e,i){l(t.children[r].children,i,e),e.Representation_asArray&&e.Representation_asArray.sort(n.getRepresentationSortFunction()).forEach((function(e,n){l(t.children[r].children[i].children,n,e)}))}))}))}function c(e,n){var r=n||t;e(r.data),r.children&&r.children.forEach((function(t){return c(e,t)}))}function d(){t=new s}return e={reset:d,update:function(e){u(e)},getForPath:function(e){var n=t,r=[n.data];return e&&e.forEach((function(e){(n=n.children[e])&&r.push(n.data)})),r.filter((function(e){return e.baseUrls.length}))},invalidateSelectedIndexes:function(e){c((function(t){isNaN(t.selectedIdx)||e===t.baseUrls[t.selectedIdx].serviceLocation&&(t.selectedIdx=a)}))},setConfig:function(e){e.adapter&&(n=e.adapter)}},d(),e}o.__dashjs_factory_name="BaseURLTreeModel",t.default=i.default.getClassFactory(o)},"./src/streaming/models/CmcdModel.js":function(e,t,n){n.r(t);var r=n("./src/core/EventBus.js"),i=n("./src/streaming/MediaPlayerEvents.js"),a=n("./src/streaming/metrics/MetricsReportingEvents.js"),s=n("./src/core/FactoryMaker.js"),o=n("./src/core/Settings.js"),l=n("./src/streaming/constants/Constants.js"),u=n("./src/streaming/vo/metrics/HTTPRequest.js"),c=n("./src/dash/models/DashManifestModel.js"),d=n("./src/core/Utils.js");function f(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,o=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw a}}}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var p="m",g="a",m="v",y="i",v="c",_="tt",T="k",E="o",b="d",S="s",A="v",w="l";function I(){var e,t,n,s,h,I,C,R,D,N,O=this.context,P=Object(r.default)(O).getInstance(),M=Object(o.default)(O).getInstance();function x(){n={pr:1,nor:null,st:null,sf:null,sid:"".concat(d.default.generateUuid()),cid:null},D={},R={},N={},k()}function L(){k()}function k(){if(I){var e=I.getStreamController();if(e&&"function"==typeof e.getActiveStream){var t=e.getActiveStream();t&&(C=t.getProcessors())}}}function F(e,t){var n,r={},i=f(t);try{for(i.s();!(n=i.n()).done;){var a=n.value;e[a]&&(r[a]=e[a])}}catch(e){i.e(e)}finally{i.f()}return r}function U(e){try{return e.type===u.HTTPRequest.MPD_TYPE?((r=B()).ot=p,r):e.type===u.HTTPRequest.MEDIA_SEGMENT_TYPE?(t=e.mediaType,N.hasOwnProperty(t)||(N[t]=!1),R.hasOwnProperty(t)||(R[t]=!1),D.hasOwnProperty(t)||(D[t]=!1),function(e){var t,r=B(),i=function(e){try{var t=e.quality,n=e.mediaInfo.bitrateList;return parseInt(n[t].bandwidth/1e3)}catch(e){return null}}(e),a=function(e){try{return isNaN(e.duration)?null:Math.round(1e3*e.duration)}catch(e){return null}}(e),o=function(e){try{return 100*parseInt(s.getThroughputHistory().getSafeAverageThroughput(e)/100)}catch(e){return null}}(e.mediaType),u=function(e){try{var t=n.pr,r=h.getCurrentBufferLevel(e);return isNaN(t)||isNaN(r)?null:100*parseInt(r/t*10)}catch(e){return null}}(e.mediaType),c=j(e.mediaType),p=function(e){try{var t=s.getTopBitrateInfoFor(e);return Math.round(t.bitrate/1e3)}catch(e){return null}}(e.mediaType),y=n.pr,T=function(e){if(C&&0!==C.length){var t,n=f(C);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r.getType()===e)return r.probeNextRequest()}}catch(e){n.e(e)}finally{n.f()}}}(e.mediaType);e.mediaType===l.default.VIDEO&&(t=m),e.mediaType===l.default.AUDIO&&(t=g),e.mediaType===l.default.TEXT&&(t="application/mp4"===e.mediaInfo.mimeType?_:v);var E=M.get().streaming.cmcd.rtp;return E||(E=function(e){var t=I.getPlaybackRate();t||(t=1);var n=e.quality,r=e.mediaType,i=e.mediaInfo,a=e.duration,s=j(r);0===s&&(s=500);var o=i.bitrateList[n].bandwidth*a/1e3/(s/t/1e3),l=M.get().streaming.cmcd.rtpSafetyFactor&&!isNaN(M.get().streaming.cmcd.rtpSafetyFactor)?M.get().streaming.cmcd.rtpSafetyFactor:5;return 100*(parseInt(o*l/100)+1)}(e)),r.rtp=E,T&&(e.url!==T.url?r.nor=encodeURIComponent(d.default.getRelativeUrl(e.url,T.url)):T.range&&(r.nrr=T.range)),i&&(r.br=i),t&&(r.ot=t),isNaN(a)||(r.d=a),isNaN(o)||(r.mtp=o),isNaN(u)||(r.dl=u),isNaN(c)||(r.bl=c),isNaN(p)||(r.tb=p),isNaN(y)||1===y||(r.pr=y),D[e.mediaType]&&(r.bs=!0,D[e.mediaType]=!1),!R[e.mediaType]&&N[e.mediaType]||(r.su=!0,R[e.mediaType]=!1,N[e.mediaType]=!0),r}(e)):e.type===u.HTTPRequest.INIT_SEGMENT_TYPE?function(){var e=B();return e.ot=y,e.su=!0,e}():e.type===u.HTTPRequest.OTHER_TYPE||e.type===u.HTTPRequest.XLINK_EXPANSION_TYPE?function(){var e=B();return e.ot=E,e}():e.type===u.HTTPRequest.LICENSE?function(e){var t=B();return t.ot=T,t}():null}catch(e){return null}var t,r}function B(){var e={},t=M.get().streaming.cmcd.cid?M.get().streaming.cmcd.cid:n.cid;return e.v=1,e.sid=M.get().streaming.cmcd.sid?M.get().streaming.cmcd.sid:n.sid,e.sid="".concat(e.sid),t&&(e.cid="".concat(t)),isNaN(n.pr)||1===n.pr||null===n.pr||(e.pr=n.pr),n.st&&(e.st=n.st),n.sf&&(e.sf=n.sf),e}function j(e){try{var t=h.getCurrentBufferLevel(e);return isNaN(t)?null:100*parseInt(10*t)}catch(e){return null}}function q(e){try{n.pr=e.playbackRate}catch(e){}}function H(t){try{var r=e.getIsDynamic(t.data)?w:A,i=t.protocol&&"MSS"===t.protocol?S:b;n.st="".concat(r),n.sf="".concat(i)}catch(e){}}function G(e){try{e.state&&e.mediaType&&e.state===i.default.BUFFER_EMPTY&&(D[e.mediaType]||(D[e.mediaType]=!0),R[e.mediaType]||(R[e.mediaType]=!0))}catch(e){}}function V(){for(var e in D)D.hasOwnProperty(e)&&(D[e]=!0);for(var t in R)R.hasOwnProperty(t)&&(R[t]=!0)}function Y(e){try{if(!e)return null;var t=Object.keys(e).sort((function(e,t){return e.localeCompare(t)})),n=t.length,r=t.reduce((function(t,r,i){if("v"===r&&1===e[r])return t;if("string"==typeof e[r]&&"ot"!==r&&"sf"!==r&&"st"!==r){var a=e[r].replace(/"/g,'"');t+="".concat(r,'="').concat(a,'"')}else t+="".concat(r,"=").concat(e[r]);return i<n-1&&(t+=","),t}),"");return(r=r.replace(/=true/g,"")).replace(/,\s*$/,"")}catch(e){return null}}return t={getQueryParameter:function(e){try{if(M.get().streaming.cmcd&&M.get().streaming.cmcd.enabled){var t=U(e),n=Y(t);return P.trigger(a.default.CMCD_DATA_GENERATED,{url:e.url,mediaType:e.mediaType,cmcdData:t,cmcdString:n}),{key:"CMCD",value:n}}return null}catch(e){return null}},getHeaderParameters:function(e){try{if(M.get().streaming.cmcd&&M.get().streaming.cmcd.enabled){var t=U(e),n=F(t,["br","d","ot","tb"]),r=F(t,["bl","dl","mtp","nor","nrr","su"]),i=F(t,["bs","rtp"]),s=F(t,["cid","pr","sf","sid","st","v"]),o={"CMCD-Object":Y(n),"CMCD-Request":Y(r),"CMCD-Status":Y(i),"CMCD-Session":Y(s)};return P.trigger(a.default.CMCD_DATA_GENERATED,{url:e.url,mediaType:e.mediaType,cmcdData:t,headers:o}),o}return null}catch(e){return null}},setConfig:function(e){e&&(e.abrController&&(s=e.abrController),e.dashMetrics&&(h=e.dashMetrics),e.playbackController&&(I=e.playbackController))},reset:function(){P.off(i.default.PLAYBACK_RATE_CHANGED,q,this),P.off(i.default.MANIFEST_LOADED,H,this),P.off(i.default.BUFFER_LEVEL_STATE_CHANGED,G,t),P.off(i.default.PLAYBACK_SEEKED,V,t),x()},initialize:function(){P.on(i.default.PLAYBACK_RATE_CHANGED,q,t),P.on(i.default.MANIFEST_LOADED,H,t),P.on(i.default.BUFFER_LEVEL_STATE_CHANGED,G,t),P.on(i.default.PLAYBACK_SEEKED,V,t),P.on(i.default.PERIOD_SWITCH_COMPLETED,L,t)}},e=Object(c.default)(O).getInstance(),x(),t}I.__dashjs_factory_name="CmcdModel",t.default=s.default.getSingletonFactory(I)},"./src/streaming/models/FragmentModel.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/streaming/vo/FragmentRequest.js"),a="loading",s="executed",o="failed";function l(e){var t,n,r,l,u=(e=e||{}).eventBus,c=e.events,d=e.dashMetrics,f=e.fragmentLoader,h=e.debug,p=e.streamInfo,g=e.type;function m(e){var t;return!!e&&(t=!1,r.some((function(n){if(r=e,a=n,!isNaN(r.index)&&r.startTime===a.startTime&&r.adaptationIndex===a.adaptationIndex&&r.type===a.type||function(e,t){return isNaN(e.index)&&isNaN(t.index)&&e.quality===t.quality}(e,n)||function(e,t){return e.action===i.default.ACTION_COMPLETE&&e.action===t.action}(e,n))return t=!0;var r,a})),t)}function y(e){return isNaN(e.duration)?.25:Math.min(e.duration/8,.5)}function v(e){r=r.filter((function(t){var n=y(t);return isNaN(t.startTime)||void 0!==e&&t.startTime>=e-n}))}function _(e,t){t<=e+.5||(r=r.filter((function(n){var r=y(n);return isNaN(n.startTime)||n.startTime>=t-r||isNaN(n.duration)||n.startTime+n.duration<=e+r})))}function T(e,t,n){for(var r=e.length-1;r>=0;r--){var i=e[r],a=i.startTime,s=a+i.duration;if(n=isNaN(n)?y(i):n,!isNaN(a)&&!isNaN(s)&&t+n>=a&&t-n<s||isNaN(a)&&isNaN(t))return i}return null}function E(e,t){d.addSchedulingInfo(e,t),d.addRequestsQueue(e.mediaType,l,r)}function b(e){e.sender===f&&(l.splice(l.indexOf(e.request),1),e.response&&!e.error&&r.push(e.request),E(e.request,e.error?o:s),u.trigger(c.FRAGMENT_LOADING_COMPLETED,{request:e.request,response:e.response,error:e.error,sender:this},{streamId:p.id,mediaType:g}))}function S(e){e.sender===f&&u.trigger(c.FRAGMENT_LOADING_PROGRESS,{request:e.request,response:e.response,error:e.error,sender:this},{streamId:p.id,mediaType:g})}function A(e){e.sender===f&&u.trigger(c.FRAGMENT_LOADING_ABANDONED,{request:e.request},{streamId:p.id,mediaType:g})}function w(){r=[],l=[]}return t={getStreamId:function(){return p.id},getType:function(){return g},getRequests:function(e){var t=e?e.state instanceof Array?e.state:[e.state]:[],n=[];return t.forEach((function(t){var i=function(e){var t;switch(e){case a:t=l;break;case s:t=r;break;default:t=[]}return t}(t);n=n.concat(function(e,t){return t.hasOwnProperty("time")?[T(e,t.time,t.threshold)]:e.filter((function(e){for(var n in t)if("state"!==n&&t.hasOwnProperty(n)&&e[n]!=t[n])return!1;return!0}))}(i,e))})),n},isFragmentLoaded:m,isFragmentLoadedOrPending:function(e){var t,n=!1,r=0;if(!(n=m(e)))for(r=0;r<l.length;r++)t=l[r],e.url===t.url&&e.startTime===t.startTime&&(n=!0);return n},removeExecutedRequestsBeforeTime:v,removeExecutedRequestsAfterTime:function(e){r=r.filter((function(t){return isNaN(t.startTime)||void 0!==e&&t.startTime<e}))},syncExecutedRequestsWithBufferedRange:function(e,t){if(e&&0!==e.length){for(var n=0,r=0,i=e.length;r<i;r++)_(n,e.start(r)),n=e.end(r);t>0&&_(n,t)}else v()},abortRequests:function(){n.debug("abort requests"),f.abort(),l=[]},executeRequest:function(e){e.action===i.default.ACTION_DOWNLOAD?(E(e,a),l.push(e),function(e){u.trigger(c.FRAGMENT_LOADING_STARTED,{request:e},{streamId:p.id,mediaType:g}),f.load(e)}(e)):n.warn("Unknown request action.")},reset:function(){u.off(c.LOADING_COMPLETED,b,this),u.off(c.LOADING_DATA_PROGRESS,S,this),u.off(c.LOADING_ABANDONED,A,this),f&&f.reset(),w()},resetInitialSettings:w,addExecutedRequest:function(e){r.push(e)}},n=h.getLogger(t),w(),u.on(c.LOADING_COMPLETED,b,t),u.on(c.LOADING_DATA_PROGRESS,S,t),u.on(c.LOADING_ABANDONED,A,t),t}l.__dashjs_factory_name="FragmentModel";var u=r.default.getClassFactory(l);u.FRAGMENT_MODEL_LOADING=a,u.FRAGMENT_MODEL_EXECUTED=s,u.FRAGMENT_MODEL_CANCELED="canceled",u.FRAGMENT_MODEL_FAILED=o,r.default.updateClassFactory(l.__dashjs_factory_name,u),t.default=u},"./src/streaming/models/LowLatencyThroughputModel.js":function(e,t,n){n.r(t);var r=n("./src/core/Debug.js"),i=n("./src/core/FactoryMaker.js");function a(){var e,t,n=this.context,i={};function a(){t=Object(r.default)(n).getInstance().getLogger(e)}function s(e){for(var t={},n=0,r=0,i=0,a=0,s=e.length,o=0;o<s;++o)n+=e[o].chunkDownloadTimeRelativeMS,r+=e[o].bufferLevel,i+=e[o].chunkDownloadTimeRelativeMS*e[o].bufferLevel,a+=e[o].chunkDownloadTimeRelativeMS*e[o].chunkDownloadTimeRelativeMS;return t.m=(i-n*r/s)/(a-n*n/s),t.b=r/s-t.m*n/s,function(e){return t.m*e+t.b}}function o(e){var t,n=!0,r=e.reduce((function(e,t){return e+t.bufferLevelAtSegmentEnd}),0)/e.length;return e.forEach((function(e){Math.abs(e.bufferLevelAtSegmentEnd/e.bufferLevelAtSegmentStart)<.95&&(n=!1),e.bufferLevelAtSegmentEnd/r<.8&&(n=!1),t?t>e.bitrate&&(n=!1):t=e.bitrate})),n}return e={setup:a,addMeasurement:function(e,t,n,r,a){e&&e.mediaType&&!i[e.mediaType]&&(i[e.mediaType]=[]);var o=e.mediaInfo.bitrateList.find((function(t){return t.id===e.representationId}));i[e.mediaType].push({index:e.index,repId:e.representationId,mediaType:e.mediaType,requestTimeMS:r,adjustedAvailabilityStartTimeMS:e.availabilityStartTime.getTime(),segDurationMS:1e3*e.duration,chunksDurationMS:n.reduce((function(e,t){return e+t.chunkDownloadDurationMS}),0),segmentBytes:n.reduce((function(e,t){return e+t.chunkBytes}),0),bitrate:o&&o.bandwidth,bitrateList:e.mediaInfo.bitrateList,chunkMeasurements:n,fetchDownloadDurationMS:t,throughputCapacityDelayMS:a,getEstimatedBufferLevel:s(n.slice(1))}),i[e.mediaType].length>10&&i[e.mediaType].shift()},getThroughputCapacityDelayMS:function(e,t){var n=i[e.mediaType]&&i[e.mediaType].slice(-3);return!n||n.length<3?0:o(n)?t/4>250?250:t/4:0},getEstimatedDownloadDurationMS:function(e){var n=i[e.mediaType].slice(-1).pop(),r=i[e.mediaType].slice(-3),a=n.chunkMeasurements.slice(-1).pop().chunkDownloadTimeRelativeMS;n.bufferLevelAtSegmentStart=n.getEstimatedBufferLevel(a/2),n.bufferLevelAtSegmentEnd=n.getEstimatedBufferLevel(a);var s=o(r),l=s?.6:.8;if(n.isBufferStable&&1.05*n.segDurationMS<n.fetchDownloadDurationMS)return n.fetchDownloadDurationMS;if(!s||n.segDurationMS<n.fetchDownloadDurationMS)return.8*n.fetchDownloadDurationMS;if(n.adjustedAvailabilityStartTimeMS<=n.requestTimeMS+n.throughputCapacityDelayMS-n.segDurationMS)return.8*n.fetchDownloadDurationMS;for(var u=n.requestTimeMS+n.throughputCapacityDelayMS-n.adjustedAvailabilityStartTimeMS,c=0,d=0,f=0,h=0;h<n.chunkMeasurements.length;h++){var p=n.chunkMeasurements[h];if(u<d+p.chunkDownloadDurationMS)break;d+=p.chunkDownloadDurationMS,c+=p.chunkBytes,f++}if(u<0&&t.warn("request time was before adjusted availibitly start time"),c&&d&&f>.2*n.chunkMeasurements.length){var g=c/d,m=n.segmentBytes/g;return n.fetchDownloadDurationMS<m?n.fetchDownloadDurationMS*l:m*l}var y=n.bitrate;return n.bitrateList.some((function(e){if(e.bandwidth>n.bitrate)return y=e.bandwidth,!0})),y===n.bitrate?n.fetchDownloadDurationMS*l:l*n.segmentBytes*8*1e3/y}},a(),e}a.__dashjs_factory_name="LowLatencyThroughputModel",t.default=i.default.getSingletonFactory(a)},"./src/streaming/models/ManifestModel.js":function(e,t,n){n.r(t);var r=n("./src/core/EventBus.js"),i=n("./src/core/events/Events.js"),a=n("./src/core/FactoryMaker.js");function s(){var e,t=this.context,n=Object(r.default)(t).getInstance();return{getValue:function(){return e},setValue:function(t){e=t,t&&n.trigger(i.default.MANIFEST_LOADED,{data:t})}}}s.__dashjs_factory_name="ManifestModel",t.default=a.default.getSingletonFactory(s)},"./src/streaming/models/MediaPlayerModel.js":function(e,t,n){n.r(t);var r=n("./src/dash/vo/UTCTiming.js"),i=n("./src/core/FactoryMaker.js"),a=n("./src/streaming/constants/Constants.js"),s=n("./src/streaming/rules/abr/ABRRulesCollection.js"),o=n("./src/core/Settings.js"),l=n("./src/streaming/utils/SupervisorTools.js");function u(){var e,t,n,i,u=this.context,c=Object(o.default)(u).getInstance();function d(e){var t;for(t=0;t<i.length;t++)if(i[t].rulename===e)return t;return-1}function f(){if(c.get().streaming.lowLatencyEnabled)return h();var e=c.get().streaming.buffer.stableBufferTime;return e>0?e:c.get().streaming.buffer.fastSwitchEnabled?20:12}function h(){return c.get().streaming.lowLatencyEnabled?c.get().streaming.delay.liveDelay||3:c.get().streaming.delay.liveDelay}function p(e,n){g(e,n);var i=new r.default;i.schemeIdUri=e,i.value=n,t.push(i)}function g(e,n){Object(l.checkParameterType)(e,"string"),Object(l.checkParameterType)(n,"string"),t.forEach((function(r,i){r.schemeIdUri===e&&r.value===n&&t.splice(i,1)}))}return e={getABRCustomRules:function(){return i},addABRCustomRule:function(e,t,n){if("string"!=typeof e||e!==s.default.ABANDON_FRAGMENT_RULES&&e!==s.default.QUALITY_SWITCH_RULES||"string"!=typeof t)throw a.default.BAD_ARGUMENT_ERROR;var r=d(t);-1===r?i.push({type:e,rulename:t,rule:n}):(i[r].type=e,i[r].rule=n)},removeABRCustomRule:function(e){if(e){var t=d(e);-1!==t&&i.splice(t,1)}else i=[]},getStableBufferTime:f,getInitialBufferLevel:function(){var e=c.get().streaming.buffer.initialBufferLevel;return isNaN(e)||e<0?0:Math.min(f(),e)},getRetryAttemptsForType:function(e){var t=isNaN(c.get().streaming.retryAttempts.lowLatencyMultiplyFactor)?5:c.get().streaming.retryAttempts.lowLatencyMultiplyFactor;return c.get().streaming.lowLatencyEnabled?c.get().streaming.retryAttempts[e]*t:c.get().streaming.retryAttempts[e]},getRetryIntervalsForType:function(e){var t=isNaN(c.get().streaming.retryIntervals.lowLatencyReductionFactor)?10:c.get().streaming.retryIntervals.lowLatencyReductionFactor;return c.get().streaming.lowLatencyEnabled?c.get().streaming.retryIntervals[e]/t:c.get().streaming.retryIntervals[e]},getLiveDelay:h,getLiveCatchupLatencyThreshold:function(){try{var e=c.get().streaming.liveCatchup.latencyThreshold,t=h();if(null!==e&&!isNaN(e))return Math.max(e,t);var n=c.get().streaming.liveCatchup.minDrift,r=!isNaN(t)&&t?isNaN(n)?h():c.get().streaming.liveCatchup.minDrift+h():NaN;return r&&!isNaN(r)?Math.max(4*r,5):NaN}catch(e){return NaN}},addUTCTimingSource:p,removeUTCTimingSource:g,getUTCTimingSources:function(){return t},clearDefaultUTCTimingSources:function(){t=[]},restoreDefaultUTCTimingSources:function(){var e=c.get().streaming.utcSynchronization.defaultTimingSource;p(e.scheme,e.value)},setXHRWithCredentialsForType:function e(t,r){t?n[t]=!!r:Object.keys(n).forEach((function(t){e(t,r)}))},getXHRWithCredentialsForType:function(e){var t=n[e];return void 0===t?n.default:t},getDefaultUtcTimingSource:function(){return c.get().streaming.utcSynchronization.defaultTimingSource},reset:function(){}},t=[],n={default:!1},i=[],e}u.__dashjs_factory_name="MediaPlayerModel",t.default=i.default.getSingletonFactory(u)},"./src/streaming/models/MetricsModel.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/streaming/constants/MetricsConstants.js"),a=n("./src/streaming/vo/MetricsList.js"),s=n("./src/streaming/vo/metrics/HTTPRequest.js"),o=n("./src/streaming/vo/metrics/RepresentationSwitch.js"),l=n("./src/streaming/vo/metrics/BufferLevel.js"),u=n("./src/streaming/vo/metrics/BufferState.js"),c=n("./src/streaming/vo/metrics/DVRInfo.js"),d=n("./src/streaming/vo/metrics/DroppedFrames.js"),f=n("./src/streaming/vo/metrics/ManifestUpdate.js"),h=n("./src/streaming/vo/metrics/SchedulingInfo.js"),p=n("./src/core/EventBus.js"),g=n("./src/streaming/vo/metrics/RequestsQueue.js"),m=n("./src/core/events/Events.js"),y=n("./src/core/FactoryMaker.js");function v(e){var t,n,y=(e=e||{}).settings,v=this.context,_=Object(p.default)(v).getInstance();function T(){_.trigger(m.default.METRICS_CHANGED)}function E(e){_.trigger(m.default.METRIC_CHANGED,{mediaType:e}),T()}function b(e,t,n){_.trigger(m.default.METRIC_UPDATED,{mediaType:e,metric:t,value:n}),E(e)}function S(e,t,n){_.trigger(m.default.METRIC_ADDED,{mediaType:e,metric:t,value:n}),E(e)}function A(e,t){var r=null;return e?(n.hasOwnProperty(e)?r=n[e]:t||(r=new a.default,n[e]=r),r):r}function w(e,t,n){var r=A(e);null!==r&&(r[t].push(n),r[t].length>y.get().streaming.metrics.maxListDepth&&r[t].shift())}function I(e,t,n){w(e,t,n),S(e,t,n)}return t={clearCurrentMetricsForType:function(e){delete n[e],E(e)},clearAllCurrentMetrics:function(){n={},T()},getMetricsFor:A,addHttpRequest:function e(t,n,r,a,o,l,u,c,d,f,h,p,g,m,y){var v=new s.HTTPRequest;l&&l!==a&&(e(t,null,r,a,o,null,null,c,d,null,null,null,g,null,null),v.actualurl=l),v.tcpid=n,v.type=r,v.url=a,v.range=c,v.trequest=d,v.tresponse=f,v.responsecode=p,v._tfinish=h,v._stream=t,v._mediaduration=g,v._quality=o,v._responseHeaders=m,v._serviceLocation=u,y?y.forEach((function(e){!function(e,t,n,r,i){var a=new s.HTTPRequestTrace;a.s=t,a.d=n,a.b=r,a.t=i,e.trace.push(a),e.interval||(e.interval=0),e.interval+=n}(v,e.s,e.d,e.b,e.t)})):(delete v.interval,delete v.trace),I(t,i.default.HTTP_REQUEST,v)},addRepresentationSwitch:function(e,t,n,r,a){var s=new o.default;s.t=t,s.mt=n,s.to=r,a?s.lto=a:delete s.lto,I(e,i.default.TRACK_SWITCH,s)},addBufferLevel:function(e,t,n){var r=new l.default;r.t=t,r.level=n,I(e,i.default.BUFFER_LEVEL,r)},addBufferState:function(e,t,n){var r=new u.default;r.target=n,r.state=t,I(e,i.default.BUFFER_STATE,r)},addDVRInfo:function(e,t,n,r){var a=new c.default;a.time=t,a.range=r,a.manifestInfo=n,I(e,i.default.DVR_INFO,a)},addDroppedFrames:function(e,t){var n=new d.default,r=A(e).DroppedFrames;t&&(n.time=t.creationTime,n.droppedFrames=t.droppedVideoFrames,r.length>0&&r[r.length-1]==n||I(e,i.default.DROPPED_FRAMES,n))},addSchedulingInfo:function(e,t,n,r,a,s,o,l,u){var c=new h.default;c.mediaType=e,c.t=t,c.type=n,c.startTime=r,c.availabilityStartTime=a,c.duration=s,c.quality=o,c.range=l,c.state=u,I(e,i.default.SCHEDULING_INFO,c)},addRequestsQueue:function(e,t,n){var r=new g.default;r.loadingRequests=t,r.executedRequests=n,A(e).RequestsQueue=r,S(e,i.default.REQUESTS_QUEUE,r)},addManifestUpdate:function(e,t,n,a,s,o,l,u,c,d){var h=new f.ManifestUpdate;h.mediaType=e,h.type=t,h.requestTime=n,h.fetchTime=a,h.availabilityStartTime=s,h.presentationStartTime=o,h.clientTimeOffset=l,h.currentTime=u,h.buffered=c,h.latency=d,w(r.default.STREAM,i.default.MANIFEST_UPDATE,h),S(e,i.default.MANIFEST_UPDATE,h)},updateManifestUpdateInfo:function(e,t){if(e){for(var n in t)e[n]=t[n];b(e.mediaType,i.default.MANIFEST_UPDATE,e)}},addManifestUpdateStreamInfo:function(e,t,n,r,a){if(e){var s=new f.ManifestUpdateStreamInfo;s.id=t,s.index=n,s.start=r,s.duration=a,e.streamInfo.push(s),b(e.mediaType,i.default.MANIFEST_UPDATE_STREAM_INFO,e)}},addManifestUpdateRepresentationInfo:function(e,t,n,r,a,s,o,l){if(e&&e.representationInfo){var u=new f.ManifestUpdateRepresentationInfo;u.id=t,u.index=n,u.streamIndex=r,u.mediaType=a,u.startNumber=o,u.fragmentInfoType=l,u.presentationTimeOffset=s,e.representationInfo.push(u),b(e.mediaType,i.default.MANIFEST_UPDATE_TRACK_INFO,e)}},addPlayList:function(e){e.trace&&Array.isArray(e.trace)?e.trace.forEach((function(e){e.hasOwnProperty("subreplevel")&&!e.subreplevel&&delete e.subreplevel})):delete e.trace,I(r.default.STREAM,i.default.PLAY_LIST,e)},addDVBErrors:function(e){I(r.default.STREAM,i.default.DVB_ERRORS,e)}},n={},t}v.__dashjs_factory_name="MetricsModel",t.default=y.default.getSingletonFactory(v)},"./src/streaming/models/URIFragmentModel.js":function(e,t,n){n.r(t);var r=n("./src/streaming/vo/URIFragmentData.js"),i=n("./src/core/FactoryMaker.js");function a(){var e,t;return e={initialize:function(e){if(t=new r.default,!e)return null;var n=e.indexOf("#");if(-1!==n)for(var i=e.substr(n+1).split("&"),a=0,s=i.length;a<s;++a){var o=i[a],l=o.indexOf("=");if(-1!==l){var u=o.substring(0,l);t.hasOwnProperty(u)&&(t[u]=o.substr(l+1))}}},getURIFragmentData:function(){return t}},e}a.__dashjs_factory_name="URIFragmentModel",t.default=i.default.getSingletonFactory(a)},"./src/streaming/models/VideoModel.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/core/EventBus.js"),a=n("./src/core/events/Events.js"),s=n("./src/core/Debug.js"),o=n("./src/streaming/constants/Constants.js"),l=new Map([[o.default.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,"loadedmetadata"],[o.default.VIDEO_ELEMENT_READY_STATES.HAVE_CURRENT_DATA,"loadeddata"],[o.default.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,"canplay"],[o.default.VIDEO_ELEMENT_READY_STATES.HAVE_ENOUGH_DATA,"canplaythrough"]]);function u(){var e,t,n,r,u=this.context,c=Object(i.default)(u).getInstance(),d=[];function f(){n&&(n.playbackRate=1,n.removeEventListener("canplay",f))}function h(){return d.length>0}function p(){if(n&&h()&&0===n.playbackRate){var e=document.createEvent("Event");e.initEvent("waiting",!0,!1),n.dispatchEvent(e)}}function g(e,t){n&&n.addEventListener(e,t)}function m(e,t){n&&n.removeEventListener(e,t)}function y(){return n?n.readyState:NaN}function v(){return n?n.buffered:null}function _(e,t,r,i,a){if(n)for(var s=0;s<n.textTracks.length;s++)if(n.textTracks[s].kind===e&&(!t||n.textTracks[s].label==t)&&n.textTracks[s].language===r&&n.textTracks[s].isTTML===i&&n.textTracks[s].isEmbedded===a)return n.textTracks[s];return null}return e={initialize:function(){c.on(a.default.PLAYBACK_PLAYING,p,this)},setCurrentTime:function(e,t){var r,i;i=function(){if(n){if(n.currentTime===e)return;try{e=t?function(e){var t=v(),n=e,r=9999999999;if(t)for(var i=0;i<t.length;i++){var a=t.start(i),s=t.end(i),o=Math.abs(a-e),l=Math.abs(s-e);if(e>=a&&e<=s)return e;o<r&&(r=o,n=a),l<r&&(r=l,n=s)}return n}(e):e,n.currentTime=e}catch(t){0===n.readyState&&t.code===t.INVALID_STATE_ERR&&setTimeout((function(){n.currentTime=e}),400)}}},(r=o.default.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA)===o.default.VIDEO_ELEMENT_READY_STATES.HAVE_NOTHING||y()>=r?i():function(e,t){g(e,(function n(){m(e,n),t(e)}))}(l.get(r),i)},play:function(){if(n){n.autoplay=!0;var e=n.play();e&&e.catch&&"undefined"!=typeof Promise&&e.catch((function(e){"NotAllowedError"===e.name&&c.trigger(a.default.PLAYBACK_NOT_ALLOWED),t.warn("Caught pending play exception - continuing (".concat(e,")"))}))}},isPaused:function(){return n?n.paused:null},pause:function(){n&&(n.pause(),n.autoplay=!1)},isStalled:h,isSeeking:function(){return n?n.seeking:null},getTime:function(){return n?n.currentTime:null},getPlaybackRate:function(){return n?n.playbackRate:null},setPlaybackRate:function(e){n&&(!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])&&n.readyState<=2&&e>0?n.addEventListener("canplay",f):n.playbackRate=e)},getPlayedRanges:function(){return n?n.played:null},getEnded:function(){return n?n.ended:null},setStallState:function(e,t){!function(e,t){t?function(e){null!==e&&n&&!n.seeking&&-1===d.indexOf(e)&&d.push(e)}(e):function(e){var t=d.indexOf(e);null!==e&&-1!==t&&d.splice(t,1)}(e)}(e,t)},getElement:function(){return n},setElement:function(e){if(!(null==e||e&&/^(VIDEO|AUDIO)$/i.test(e.nodeName)))throw"element is not video or audio DOM type!";(n=e)&&(n.preload="auto")},setSource:function(e){n&&(e?n.src=e:(n.removeAttribute("src"),n.load()))},getSource:function(){return n?n.src:null},getTTMLRenderingDiv:function(){return r},setTTMLRenderingDiv:function(e){(r=e).style.position="absolute",r.style.display="flex",r.style.overflow="hidden",r.style.pointerEvents="none",r.style.top=0,r.style.left=0},getPlaybackQuality:function(){if(!n)return null;var e="webkitDroppedFrameCount"in n&&"webkitDecodedFrameCount"in n,t=null;return"getVideoPlaybackQuality"in n?t=n.getVideoPlaybackQuality():e&&(t={droppedVideoFrames:n.webkitDroppedFrameCount,totalVideoFrames:n.webkitDroppedFrameCount+n.webkitDecodedFrameCount,creationTime:new Date}),t},addEventListener:g,removeEventListener:m,getReadyState:y,getBufferRange:v,getClientWidth:function(){return n?n.clientWidth:NaN},getClientHeight:function(){return n?n.clientHeight:NaN},getTextTracks:function(){return n?n.textTracks:[]},getTextTrack:_,addTextTrack:function(e,t,r,i,a){if(!n)return null;var s=_(e,t,r,i,a);return s||((s=n.addTextTrack(e,t,r)).isEmbedded=a,s.isTTML=i),s},appendChild:function(e){n&&(n.appendChild(e),void 0!==e.isTTML&&(n.textTracks[n.textTracks.length-1].isTTML=e.isTTML,n.textTracks[n.textTracks.length-1].isEmbedded=e.isEmbedded))},removeChild:function(e){n&&n.removeChild(e)},getVideoWidth:function(){return n?n.videoWidth:NaN},getVideoHeight:function(){return n?n.videoHeight:NaN},getVideoRelativeOffsetTop:function(){var e=n.parentNode.host||n.parentNode;return e?n.getBoundingClientRect().top-e.getBoundingClientRect().top:NaN},getVideoRelativeOffsetLeft:function(){var e=n.parentNode.host||n.parentNode;return e?n.getBoundingClientRect().left-e.getBoundingClientRect().left:NaN},reset:function(){c.off(a.default.PLAYBACK_PLAYING,p,this)}},t=Object(s.default)(u).getInstance().getLogger(e),e}u.__dashjs_factory_name="VideoModel",t.default=r.default.getSingletonFactory(u)},"./src/streaming/net/FetchLoader.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/core/Settings.js"),a=n("./src/streaming/constants/Constants.js");function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,a=void 0;try{for(var s,o=e[Symbol.iterator]();!(r=(s=o.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==o.return||o.return()}finally{if(i)throw a}}return n}}(e,t)||o(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function u(e){e=e||{};var t,n,r=this.context,l=e.requestModifier,u=e.lowLatencyThroughputModel,c=e.boxParser,d=Object(i.default)(r).getInstance();function f(e,t){e.reader.read().then(t).catch((function(t){e.onerror&&200===e.response.status&&e.onerror(t)}))}function h(e,t){try{if((e=e.filter((function(n){return n.bytes>t/4/e.length}))).length>1){var n=0,r=(e[e.length-1].ts-e[0].ts)/e.length;return e.forEach((function(t,i){var a=e[i+1];if(a){var s=a.ts-t.ts;n+=s<r?s:0}})),n}return null}catch(e){return null}}return t={load:function(e){var t,r=new Date,i=e.request,p=new Headers;if(i.range&&p.append("Range","bytes="+i.range),e.headers)for(var g in e.headers){var m=e.headers[g];m&&p.append(g,m)}i.requestStartDate||(i.requestStartDate=r),l&&l.modifyRequestHeader({setRequestHeader:function(e,t){p.append(e,t)}}),"function"==typeof window.AbortController&&(t=new AbortController,e.abortController=t,t.signal.onabort=e.onabort);var y={method:e.method,headers:p,credentials:e.withCredentials?"include":void 0,signal:t?t.signal:void 0},v=d.get().streaming.abr.fetchThroughputCalculationMode,_=Date.now(),T=0;new Promise((function(e){if(v===a.default.ABR_FETCH_THROUGHPUT_CALCULATION_AAST&&u&&(T=u.getThroughputCapacityDelayMS(i,1e3*n.getCurrentBufferLevel(i.mediaType))))return setTimeout(e,T);e()})).then((function(){var t=Date.now();fetch(e.url,y).then((function(r){e.response||(e.response={}),e.response.status=r.status,e.response.statusText=r.statusText,e.response.responseURL=r.url,r.ok||e.onerror();var l,d="",p=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=o(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw a}}}}(r.headers.keys());try{for(p.s();!(l=p.n()).done;){var g=l.value;d+=g+": "+r.headers.get(g)+"\r\n"}}catch(e){p.e(e)}finally{p.f()}if(e.response.responseHeaders=d,!r.body)return r.arrayBuffer().then((function(t){e.response.response=t;var n={loaded:t.byteLength,total:t.byteLength,stream:!1};e.progress(n),e.onload(),e.onend()}));var m,y,E=parseInt(r.headers.get("Content-Length"),10),b=0,S=!1,A=new Uint8Array,w=0;if(v===a.default.ABR_FETCH_THROUGHPUT_CALCULATION_AAST&&u){var I=t,C=0,R=s(r.body.tee(),2),D=R[0],N=R[1];m=D.getReader(),y=[],m.read().then((function r(a){var s=a.value,o=a.done;if(C=Date.now(),s&&s.length){var l=C-I,c=s.length;y.push({chunkDownloadTimeRelativeMS:C-t,chunkDownloadDurationMS:l,chunkBytes:c,kbps:Math.round(8*c/(l/1e3)),bufferLevel:n.getCurrentBufferLevel(i.mediaType)})}if(o){var f=C-t,h=y.reduce((function(e,t){return e+t.chunkBytes}),0);return u.addMeasurement(i,f,y,_,T,d),void e.progress({loaded:h,total:h,lengthComputable:!0,time:u.getEstimatedDownloadDurationMS(i),stream:!0})}return I=Date.now(),m.read().then(r)})),e.reader=N.getReader()}else e.reader=r.body.getReader();var O=[],P=[],M=[],x=!0;f(e,(function t(n){var r=n.value;if(n.done){if(A){if(v!==a.default.ABR_FETCH_THROUGHPUT_CALCULATION_AAST){var i=null;v===a.default.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING&&(i=function(e,t){try{var n,r;n=e.filter((function(t,n){return n<e.length-1})),r=t.filter((function(e,n){return n<t.length-1}));var i=[];if(n.length>1){for(var a=0,s=0,o=0;o<n.length;o++)if(n[o]&&r[o]){var l=r[o].ts-n[o].ts;if(l>1)i.push(8*r[o].bytes/l);else{0===s&&(s=n[o].ts);var u=r[o].ts-s;u>1?(i.push(8*a/u),a=0,s=0):a+=r[o].bytes}}if(i.length>0)return i.reduce((function(e,t){return e+t}),0)/i.length}return null}catch(e){return null}}(P,M)),e.progress({loaded:b,total:isNaN(E)?b:E,lengthComputable:!0,time:h(O,b),throughput:i,stream:!0})}e.response.response=A.buffer}return e.onload(),void e.onend()}if(r&&r.length>0){A=function(e,t){if(0===e.length)return t;var n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}(A,r),b+=r.length,O.push({ts:Date.now(),bytes:r.length}),v===a.default.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING&&x&&c.findLastTopIsoBoxCompleted(["moof"],A,w).found&&(x=!1,P.push({ts:performance.now(),bytes:r.length}));var s=c.findLastTopIsoBoxCompleted(["moov","mdat"],A,w);if(s.found){var o,l=s.lastCompletedOffset+s.size;v!==a.default.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING||x||(x=!0,M.push({ts:performance.now(),bytes:A.length})),l===A.length?(o=A,A=new Uint8Array):(o=new Uint8Array(A.subarray(0,l)),A=A.subarray(l)),e.progress({data:o.buffer,lengthComputable:!1,noTrace:!0}),w=0}else w=s.lastCompletedOffset,S||(e.progress({lengthComputable:!1,noTrace:!0}),S=!0)}f(e,t)}))})).catch((function(t){e.onerror&&e.onerror(t)}))}))},abort:function(e){if(e.abortController)e.abortController.abort();else if(e.reader)try{e.reader.cancel(),e.onabort()}catch(e){}},calculateDownloadedTime:h,setup:function(e){n=e.dashMetrics}},t}u.__dashjs_factory_name="FetchLoader";var c=r.default.getClassFactory(u);t.default=c},"./src/streaming/net/HTTPLoader.js":function(e,t,n){n.r(t);var r=n("./src/streaming/net/XHRLoader.js"),i=n("./src/streaming/net/FetchLoader.js"),a=n("./src/streaming/vo/metrics/HTTPRequest.js"),s=n("./src/core/FactoryMaker.js"),o=n("./src/streaming/vo/DashJSError.js"),l=n("./src/streaming/models/CmcdModel.js"),u=n("./src/core/Utils.js"),c=n("./src/core/Debug.js"),d=n("./src/core/EventBus.js"),f=n("./src/core/events/Events.js"),h=n("./src/core/Settings.js"),p=n("./src/streaming/constants/Constants.js"),g=n("./src/streaming/models/LowLatencyThroughputModel.js");function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e){e=e||{};var t,n,s,y,v,_,T,E,b,S=this.context,A=e.errHandler,w=e.dashMetrics,I=e.mediaPlayerModel,C=e.requestModifier,R=e.boxParser,D=e.errors,N=e.requestTimeout||0,O=Object(d.default)(S).getInstance(),P=Object(h.default)(S).getInstance();function M(e,t){var l,c=e.request,d=[],h=!0,g=!0,m=new Date,b=m,D=0;if(!C||!w||!A)throw new Error("config object is not correct or missing");var x,L=function(e){if(g=!1,c.requestStartDate=m,c.requestEndDate=new Date,c.firstByteDate=c.firstByteDate||m,!c.checkExistenceOnly){var t=l.response?l.response.responseURL:null,n=l.response?l.response.status:null,r=l.response&&l.response.getAllResponseHeaders?l.response.getAllResponseHeaders():l.response?l.response.responseHeaders:[];w.addHttpRequest(c,t,n,r,e?d:null),c.type===a.HTTPRequest.MPD_TYPE&&w.addManifestUpdate(c)}},k=function(){if(-1!==n.indexOf(l)&&(n.splice(n.indexOf(l),1),g))if(L(!1),t>0){try{P.get().streaming.utcSynchronization.enableBackgroundSyncAfterSegmentDownloadError&&c.type===a.HTTPRequest.MEDIA_SEGMENT_TYPE&&I.getRetryAttemptsForType(a.HTTPRequest.MEDIA_SEGMENT_TYPE)===t&&O.trigger(f.default.ATTEMPT_BACKGROUND_SYNC)}catch(e){}t--;var r={config:e};y.push(r),r.timeout=setTimeout((function(){-1!==y.indexOf(r)&&(y.splice(y.indexOf(r),1),M(e,t))}),I.getRetryIntervalsForType(c.type))}else{if(c.type===a.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE)return;A.error(new o.default(v[c.type],c.url+" is not available",{request:c,response:l.response})),e.error&&e.error(c,"error",l.response.statusText),e.complete&&e.complete(c,l.response.statusText)}};P.get().streaming.lowLatencyEnabled&&window.fetch&&"arraybuffer"===c.responseType&&c.type===a.HTTPRequest.MEDIA_SEGMENT_TYPE?(x=Object(i.default)(S).create({requestModifier:C,lowLatencyThroughputModel:T,boxParser:R})).setup({dashMetrics:w}):x=Object(r.default)(S).create({requestModifier:C});var F=null,U=C.modifyRequestURL(c.url);if(P.get().streaming.cmcd&&P.get().streaming.cmcd.enabled){var B=P.get().streaming.cmcd.mode;if(B===p.default.CMCD_MODE_QUERY){var j=function(e){try{var t=[],n=_.getQueryParameter(e);return n&&t.push(n),t}catch(e){return[]}}(c);U=u.default.addAditionalQueryParameterToUrl(U,j)}else B===p.default.CMCD_MODE_HEADER&&(F=_.getHeaderParameters(c))}c.url=U;var q=c.checkExistenceOnly?a.HTTPRequest.HEAD:a.HTTPRequest.GET,H=I.getXHRWithCredentialsForType(c.type);l={url:U,method:q,withCredentials:H,request:c,onload:function(){l.response.status>=200&&l.response.status<=299&&(L(!0),e.success&&e.success(l.response.response,l.response.statusText,l.response.responseURL),e.complete&&e.complete(c,l.response.statusText))},onend:k,onerror:k,progress:function(t){var n=new Date;h&&(h=!1,(!t.lengthComputable||t.lengthComputable&&t.total!==t.loaded)&&(c.firstByteDate=n)),t.lengthComputable&&(c.bytesLoaded=t.loaded,c.bytesTotal=t.total),t.noTrace||(d.push({s:b,d:t.time?t.time:n.getTime()-b.getTime(),b:[t.loaded?t.loaded-D:0],t:t.throughput}),b=n,D=t.loaded),e.progress&&t&&e.progress(t)},onabort:function(){e.abort&&e.abort(c)},ontimeout:function(e){var t;if(e.lengthComputable){var n=e.loaded/e.total*100;t="Request timeout: loaded: "+e.loaded+", out of: "+e.total+" : "+n.toFixed(3)+"% Completed"}else t="Request timeout: non-computable download size";E.warn(t)},loader:x,timeout:N,headers:F};var G=(new Date).getTime();if(isNaN(c.delayLoadingTime)||G>=c.delayLoadingTime)n.push(l),x.load(l);else{var V={httpRequest:l};s.push(V),V.delayTimeout=setTimeout((function(){if(-1!==s.indexOf(V)){s.splice(s.indexOf(V),1);try{m=new Date,b=m,n.push(V.httpRequest),x.load(V.httpRequest)}catch(e){V.httpRequest.onerror()}}}),c.delayLoadingTime-G)}}return t={load:function(e){e.request?M(e,I.getRetryAttemptsForType(e.request.type)):e.error&&e.error(e.request,"error")},abort:function(){y.forEach((function(e){clearTimeout(e.timeout),e.config.request&&e.config.abort&&e.config.abort(e.config.request)})),y=[],s.forEach((function(e){return clearTimeout(e.delayTimeout)})),s=[],n.forEach((function(e){e.request.type!==a.HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE&&(e.onloadend=e.onerror=e.onprogress=void 0,e.loader.abort(e))})),n=[]}},E=Object(c.default)(S).getInstance().getLogger(t),n=[],s=[],y=[],_=Object(l.default)(S).getInstance(),T=Object(g.default)(S).getInstance(),m(b={},a.HTTPRequest.MPD_TYPE,D.DOWNLOAD_ERROR_ID_MANIFEST_CODE),m(b,a.HTTPRequest.XLINK_EXPANSION_TYPE,D.DOWNLOAD_ERROR_ID_XLINK_CODE),m(b,a.HTTPRequest.INIT_SEGMENT_TYPE,D.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE),m(b,a.HTTPRequest.MEDIA_SEGMENT_TYPE,D.DOWNLOAD_ERROR_ID_CONTENT_CODE),m(b,a.HTTPRequest.INDEX_SEGMENT_TYPE,D.DOWNLOAD_ERROR_ID_CONTENT_CODE),m(b,a.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE,D.DOWNLOAD_ERROR_ID_CONTENT_CODE),m(b,a.HTTPRequest.OTHER_TYPE,D.DOWNLOAD_ERROR_ID_CONTENT_CODE),v=b,t}y.__dashjs_factory_name="HTTPLoader";var v=s.default.getClassFactory(y);t.default=v},"./src/streaming/net/SchemeLoaderFactory.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/streaming/net/HTTPLoader.js");function a(){var e;function t(){e={}}function n(){t()}return n(),{getLoader:function(t){for(var n in e)if(e.hasOwnProperty(n)&&t.startsWith(n))return e[n];return i.default},registerLoader:function(t,n){e[t]=n},unregisterLoader:function(t){e[t]&&delete e[t]},unregisterAllLoader:t,reset:n}}a.__dashjs_factory_name="SchemeLoaderFactory";var s=r.default.getSingletonFactory(a);t.default=s},"./src/streaming/net/URLLoader.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/streaming/net/SchemeLoaderFactory.js");function a(e){e=e||{};var t,n,r=this.context;return t=Object(i.default)(r).getInstance(),{load:function(i){if(!n){var a=t.getLoader(i&&i.request?i.request.url:null);n=a(r).create({errHandler:e.errHandler,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,dashMetrics:e.dashMetrics,boxParser:e.boxParser?e.boxParser:null,constants:e.constants?e.constants:null,dashConstants:e.dashConstants?e.dashConstants:null,urlUtils:e.urlUtils?e.urlUtils:null,requestTimeout:isNaN(e.requestTimeout)?0:e.requestTimeout,errors:e.errors})}n.load(i)},abort:function(){n&&n.abort()}}}a.__dashjs_factory_name="URLLoader";var s=r.default.getClassFactory(a);t.default=s},"./src/streaming/net/XHRLoader.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js");function i(e){var t=(e=e||{}).requestModifier;return{load:function(e){var n=new Date,r=e.request,i=new XMLHttpRequest;if(i.open(e.method,e.url,!0),r.responseType&&(i.responseType=r.responseType),r.range&&i.setRequestHeader("Range","bytes="+r.range),r.requestStartDate||(r.requestStartDate=n),t&&(i=t.modifyRequestHeader(i)),e.headers)for(var a in e.headers){var s=e.headers[a];s&&i.setRequestHeader(a,s)}i.withCredentials=e.withCredentials,i.onload=e.onload,i.onloadend=e.onend,i.onerror=e.onerror,i.onprogress=e.progress,i.onabort=e.onabort,i.ontimeout=e.ontimeout,i.timeout=e.timeout,i.send(),e.response=i},abort:function(e){var t=e.response;t.onloadend=t.onerror=t.onprogress=void 0,t.abort()}}}i.__dashjs_factory_name="XHRLoader";var a=r.default.getClassFactory(i);t.default=a},"./src/streaming/protection/CommonEncryption.js":function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(t);var i={attributes:["Laurl","laurl"],prefixes:["clearkey","dashif"]},a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,a;return t=e,a=[{key:"findCencContentProtection",value:function(e){for(var t=null,n=0;n<e.length;++n){var r=e[n];"urn:mpeg:dash:mp4protection:2011"!==r.schemeIdUri.toLowerCase()||"cenc"!==r.value.toLowerCase()&&"cbcs"!==r.value.toLowerCase()||(t=r)}return t}},{key:"getPSSHData",value:function(e){var t=8,n=new DataView(e),r=n.getUint8(t);return t+=20,r>0&&(t+=4+16*n.getUint32(t)),t+=4,e.slice(t)}},{key:"getPSSHForKeySystem",value:function(t,n){var r=e.parsePSSHList(n);return t&&r.hasOwnProperty(t.uuid.toLowerCase())?r[t.uuid.toLowerCase()]:null}},{key:"parseInitDataFromContentProtection",value:function(e,t){return"pssh"in e?(e.pssh.__text=e.pssh.__text.replace(/\r?\n|\r/g,"").replace(/\s+/g,""),t.decodeArray(e.pssh.__text).buffer):null}},{key:"parsePSSHList",value:function(e){if(null==e)return[];for(var t=new DataView(e.buffer||e),n={},r=0;;){var i,a,s=void 0,o=r;if(r>=t.buffer.byteLength)break;if(i=r+t.getUint32(r),r+=4,1886614376===t.getUint32(r))if(r+=4,0===(a=t.getUint8(r))||1===a){r++,r+=3,s="";var l=void 0,u=void 0;for(l=0;l<4;l++)s+=1===(u=t.getUint8(r+l).toString(16)).length?"0"+u:u;for(r+=4,s+="-",l=0;l<2;l++)s+=1===(u=t.getUint8(r+l).toString(16)).length?"0"+u:u;for(r+=2,s+="-",l=0;l<2;l++)s+=1===(u=t.getUint8(r+l).toString(16)).length?"0"+u:u;for(r+=2,s+="-",l=0;l<2;l++)s+=1===(u=t.getUint8(r+l).toString(16)).length?"0"+u:u;for(r+=2,s+="-",l=0;l<6;l++)s+=1===(u=t.getUint8(r+l).toString(16)).length?"0"+u:u;r+=6,r+=4,n[s=s.toLowerCase()]=t.buffer.slice(o,i),r=i}else r=i;else r=i}return n}},{key:"getLicenseServerUrlFromMediaInfo",value:function(e,t){try{if(!e||0===e.length)return null;for(var n=0,r=null;n<e.length&&!r;){var a=e[n];if(a&&a.contentProtection&&a.contentProtection.length>0){var s=a.contentProtection.filter((function(e){return e.schemeIdUri&&e.schemeIdUri===t}));if(s&&s.length>0)for(var o=0;o<s.length&&!r;){for(var l=s[o],u=0;u<i.attributes.length&&!r;){for(var c=0,d=i.attributes[u];c<i.prefixes.length&&!r;){var f=i.prefixes[c];l[d]&&l[d].__prefix&&l[d].__prefix===f&&l[d].__text&&(r=l[d].__text),c+=1}u+=1}o+=1}}n+=1}return r}catch(e){return null}}}],(n=null)&&r(t.prototype,n),a&&r(t,a),e}();t.default=a},"./src/streaming/protection/Protection.js":function(e,t,n){n.r(t);var r=n("./src/streaming/protection/controllers/ProtectionController.js"),i=n("./src/streaming/protection/controllers/ProtectionKeyController.js"),a=n("./src/streaming/protection/ProtectionEvents.js"),s=n("./src/streaming/protection/errors/ProtectionErrors.js"),o=n("./src/streaming/protection/models/ProtectionModel_21Jan2015.js"),l=n("./src/streaming/protection/models/ProtectionModel_3Feb2014.js"),u=n("./src/streaming/protection/models/ProtectionModel_01b.js"),c=[{generateKeyRequest:"generateKeyRequest",addKey:"addKey",cancelKeyRequest:"cancelKeyRequest",needkey:"needkey",keyerror:"keyerror",keyadded:"keyadded",keymessage:"keymessage"},{generateKeyRequest:"webkitGenerateKeyRequest",addKey:"webkitAddKey",cancelKeyRequest:"webkitCancelKeyRequest",needkey:"webkitneedkey",keyerror:"webkitkeyerror",keyadded:"webkitkeyadded",keymessage:"webkitkeymessage"}],d=[{setMediaKeys:"setMediaKeys",MediaKeys:"MediaKeys",release:"close",needkey:"needkey",error:"keyerror",message:"keymessage",ready:"keyadded",close:"keyclose"},{setMediaKeys:"msSetMediaKeys",MediaKeys:"MSMediaKeys",release:"close",needkey:"msneedkey",error:"mskeyerror",message:"mskeymessage",ready:"mskeyadded",close:"mskeyclose"}];function f(){var e,t=this.context;function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];if("function"==typeof e[r[Object.keys(r)[0]]])return r}return null}return e={createProtectionSystem:function(a){var s=null,f=Object(i.default)(t).getInstance();f.setConfig({debug:a.debug,BASE64:a.BASE64}),f.initialize();var h=function(r){var i=r.debug,a=i.getLogger(e),s=r.eventBus,f=r.errHandler,h=r.videoModel?r.videoModel.getElement():null;return h&&void 0===h.onencrypted||h&&void 0===h.mediaKeys?n(h,d)?(a.info("EME detected on this user agent! (ProtectionModel_3Feb2014)"),Object(l.default)(t).create({debug:i,eventBus:s,events:r.events,api:n(h,d)})):n(h,c)?(a.info("EME detected on this user agent! (ProtectionModel_01b)"),Object(u.default)(t).create({debug:i,eventBus:s,errHandler:f,events:r.events,api:n(h,c)})):(a.warn("No supported version of EME detected on this user agent! - Attempts to play encrypted content will fail!"),null):(a.info("EME detected on this user agent! (ProtectionModel_21Jan2015)"),Object(o.default)(t).create({debug:i,eventBus:s,events:r.events}))}(a);return!s&&h&&(s=Object(r.default)(t).create({protectionModel:h,protectionKeyController:f,eventBus:a.eventBus,debug:a.debug,events:a.events,BASE64:a.BASE64,constants:a.constants,cmcdModel:a.cmcdModel,settings:a.settings}),a.capabilities.setEncryptedMediaSupported(!0)),s}},e}f.__dashjs_factory_name="Protection";var h=dashjs.FactoryMaker.getClassFactory(f);h.events=a.default,h.errors=s.default,dashjs.FactoryMaker.updateClassFactory(f.__dashjs_factory_name,h),t.default=h},"./src/streaming/protection/ProtectionEvents.js":function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=s(e);if(t){var a=s(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}n.r(t);var o=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(n,e);var t=a(n);function n(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(e=t.call(this)).INTERNAL_KEY_MESSAGE="internalKeyMessage",e.INTERNAL_KEY_STATUS_CHANGED="internalkeyStatusChanged",e.KEY_ADDED="public_keyAdded",e.KEY_ERROR="public_keyError",e.KEY_MESSAGE="public_keyMessage",e.KEY_SESSION_CLOSED="public_keySessionClosed",e.KEY_SESSION_CREATED="public_keySessionCreated",e.KEY_SESSION_REMOVED="public_keySessionRemoved",e.KEY_STATUSES_CHANGED="public_keyStatusesChanged",e.KEY_SYSTEM_ACCESS_COMPLETE="public_keySystemAccessComplete",e.KEY_SYSTEM_SELECTED="public_keySystemSelected",e.LICENSE_REQUEST_COMPLETE="public_licenseRequestComplete",e.LICENSE_REQUEST_SENDING="public_licenseRequestSending",e.NEED_KEY="needkey",e.PROTECTION_CREATED="public_protectioncreated",e.PROTECTION_DESTROYED="public_protectiondestroyed",e.SERVER_CERTIFICATE_UPDATED="serverCertificateUpdated",e.TEARDOWN_COMPLETE="protectionTeardownComplete",e.VIDEO_ELEMENT_SELECTED="videoElementSelected",e.KEY_SESSION_UPDATED="public_keySessionUpdated",e}return n}(n("./src/core/events/EventsBase.js").default));t.default=o},"./src/streaming/protection/controllers/ProtectionController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/protection/CommonEncryption.js"),i=n("./src/streaming/protection/vo/MediaCapability.js"),a=n("./src/streaming/protection/vo/KeySystemConfiguration.js"),s=n("./src/streaming/protection/errors/ProtectionErrors.js"),o=n("./src/streaming/vo/DashJSError.js"),l=n("./src/streaming/protection/vo/LicenseRequest.js"),u=n("./src/streaming/protection/vo/LicenseResponse.js"),c=n("./src/streaming/vo/metrics/HTTPRequest.js"),d=n("./src/core/Utils.js"),f=n("./src/streaming/constants/Constants.js"),h=n("./src/core/FactoryMaker.js");function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function g(e){var t,n,h,g,m,y,v,_,T,E,b,S=(e=e||{}).protectionKeyController,A=e.protectionModel,w=e.eventBus,I=e.events,C=e.debug,R=e.BASE64,D=e.constants,N=[],O=e.cmcdModel,P=e.settings;function M(){if(!(w&&w.hasOwnProperty("on")&&S&&S.hasOwnProperty("getSupportedKeySystemsFromContentProtection")))throw new Error("Missing config parameter(s)")}function x(e,t){T?h.push(e):_?_&&function(e){var t=e.findIndex((function(e){return e.ks===_})),n=e[t];-1!==t&&n.initData&&L(n)}(e):function(e,t){T=!0;var r,i=[];h.push(e);for(var a=0;a<e.length;a++){var l=q(e[a]);i.push({ks:e[a].ks,configs:[l]})}A.requestKeySystemAccess(i).then((function(e){return r=e.data,n.info("DRM: KeySystem Access Granted ("+r.keySystem.systemString+")!  Selecting key system..."),A.selectKeySystem(r)})).then((function(e){if(_=e,T=!1,A){w.trigger(I.KEY_SYSTEM_SELECTED,{data:r});var t,n=U(_);n&&n.serverCertificate&&n.serverCertificate.length>0&&A.setServerCertificate(R.decodeArray(n.serverCertificate).buffer);for(var i=0;i<h.length;i++)for(t=0;t<h[i].length;t++)if(_===h[i][t].ks){L(h[i][t]);break}}})).catch((function(e){_=null,T=!1,t||w.trigger(I.KEY_SYSTEM_SELECTED,{data:null,error:new o.default(s.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,s.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+"Error selecting key system! -- "+e.error)})}))}(e,t)}function L(e){if(S.isClearKey(_)&&e.protData&&e.protData.hasOwnProperty("clearkeys")){var t={kids:Object.keys(e.protData.clearkeys)};e.initData=(new TextEncoder).encode(JSON.stringify(t))}e.sessionId?k(e):null!==e.initData&&F(e)}function k(e){M(),A.loadKeySession(e)}function F(e){var t=r.default.getPSSHForKeySystem(_,e?e.initData:null);if(t){if(function(e){if(!e)return!1;try{for(var t=A.getSessions(),n=0;n<t.length;n++)if(t[n].getKeyId()===e)return!0;return!1}catch(e){return!1}}(e.keyId))return;if(B(t))return;try{e.initData=t,A.createKeySession(e)}catch(e){w.trigger(I.KEY_SESSION_CREATED,{data:null,error:new o.default(s.default.KEY_SESSION_CREATED_ERROR_CODE,s.default.KEY_SESSION_CREATED_ERROR_MESSAGE+e.message)})}}else e&&e.initData?A.createKeySession(e):w.trigger(I.KEY_SESSION_CREATED,{data:null,error:new o.default(s.default.KEY_SESSION_CREATED_ERROR_CODE,s.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Selected key system is "+(_?_.systemString:null)+".  needkey/encrypted event contains no initData corresponding to that key system!")})}function U(e){if(e){var t=e.systemString;if(m)return t in m?m[t]:null}return null}function B(e){if(!e)return!1;try{for(var t=A.getAllInitData(),r=0;r<t.length;r++)if(S.initDataEquals(e,t[r]))return n.debug("DRM: Ignoring initData because we have already seen it!"),!0;return!1}catch(e){return!1}}function j(e){M(),e?(A.setMediaElement(e),w.on(I.NEED_KEY,W,t)):null===e&&(A.setMediaElement(e),w.off(I.NEED_KEY,W,t))}function q(e){var t=e.protData,n=[],r=[],s=t&&t.audioRobustness&&t.audioRobustness.length>0?t.audioRobustness:v,o=t&&t.videoRobustness&&t.videoRobustness.length>0?t.videoRobustness:v,l=e.sessionType,u=t&&t.distinctiveIdentifier?t.distinctiveIdentifier:"optional",c=t&&t.persistentState?t.persistentState:"temporary"===l?"optional":"required";return g.forEach((function(e){e.type===D.AUDIO?n.push(new i.default(e.codec,s)):e.type===D.VIDEO&&r.push(new i.default(e.codec,o))})),new a.default(n,r,u,c,[l])}function H(e){e.error?w.trigger(I.KEY_STATUSES_CHANGED,{data:null,error:e.error}):n.debug("DRM: key status = "+e.status)}function G(e){n.debug("DRM: onKeyMessage");var t=e.data;w.trigger(I.KEY_MESSAGE,{data:t});var i=t.messageType?t.messageType:"license-request",a=t.message,f=t.sessionToken,h=U(_),m=S.getLicenseServerModelInstance(_,h,i),y={sessionToken:f,messageType:i};if(a&&0!==a.byteLength){if(!m)return n.debug("DRM: License server request not required for this message (type = "+e.data.messageType+").  Session ID = "+f.getSessionId()),void V(y);if(S.isClearKey(_)){var v=S.processClearKeyLicenseRequest(_,h,a);if(v)return n.debug("DRM: ClearKey license request handled by application!"),V(y),void A.updateKeySession(f,v)}!function(e,t,n){var i=e.sessionToken,a=e.messageType?e.messageType:"license-request",f={sessionToken:i,messageType:a},h=_?_.systemString:null,m=function(e,t,n,i,a){var s=null,o=i.message;if(e&&e.serverURL){var l=e.serverURL;"string"==typeof l&&""!==l?s=l:"object"===p(l)&&l.hasOwnProperty(t)&&(s=l[t])}else if(e&&e.laURL&&""!==e.laURL)s=e.laURL;else if(!(s=r.default.getLicenseServerUrlFromMediaInfo(g,_.schemeIdURI))&&!S.isClearKey(_)){var u=r.default.getPSSHData(n.initData);(s=_.getLicenseServerURLFromInitData(u))||(s=i.laURL)}return a.getServerURLFromMessage(s,o,t)}(n,a,i,e,t);if(m){var y={},v=!1;n&&Z(y,n.httpRequestHeaders);var T=e.message;Z(y,_.getRequestHeadersFromMessage(T)),Object.keys(y).forEach((function(e){"authorization"===e.toLowerCase()&&(v=!0)})),n&&"boolean"==typeof n.withCredentials&&(v=n.withCredentials);var w=function(e){if(A)if(e.status>=200&&e.status<=299){var n=d.default.parseHttpHeaders(e.getAllResponseHeaders?e.getAllResponseHeaders():null),r=new u.default(e.responseURL,n,e.response);z(b,r).then((function(){var n=t.getLicenseMessage(r.data,h,a);null!==n?(V(f),A.updateKeySession(i,n)):K(e,f,h,a,t)}))}else K(e,f,h,a,t)},I=function(e){V(f,new o.default(s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+h+' update, XHR aborted. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))},C=function(e){V(f,new o.default(s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+h+' update, XHR error. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))},R=_.getLicenseRequestFromMessage(T),D=t.getHTTPMethod(a),N=t.getResponseType(h,a),O=n&&!isNaN(n.httpTimeout)?n.httpTimeout:8e3,M=i.getSessionId()||null,x=new l.default(m,D,N,y,v,a,M,R),L=isNaN(P.get().streaming.retryAttempts[c.HTTPRequest.LICENSE])?3:P.get().streaming.retryAttempts[c.HTTPRequest.LICENSE];z(E,x).then((function(){Y(x,L,O,w,I,C)}))}else V(f,new o.default(s.default.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE,s.default.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE))}(t,m,h)}else V(y,new o.default(s.default.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE,s.default.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE))}function V(e,t){w.trigger(I.LICENSE_REQUEST_COMPLETE,{data:e,error:t})}function Y(e,t,r,i,a,s){var o=new XMLHttpRequest;if(P.get().streaming.cmcd&&P.get().streaming.cmcd.enabled&&P.get().streaming.cmcd.mode===f.default.CMCD_MODE_QUERY){var l=O.getQueryParameter({url:e.url,type:c.HTTPRequest.LICENSE});l&&(e.url=d.default.addAditionalQueryParameterToUrl(e.url,[l]))}for(var u in o.open(e.method,e.url,!0),o.responseType=e.responseType,o.withCredentials=e.withCredentials,r>0&&(o.timeout=r),e.headers)o.setRequestHeader(u,e.headers[u]);if(P.get().streaming.cmcd&&P.get().streaming.cmcd.enabled&&P.get().streaming.cmcd.mode===f.default.CMCD_MODE_HEADER){var h=O.getHeaderParameters({url:e.url,type:c.HTTPRequest.LICENSE});if(h)for(var p in h){var g=h[p];g&&o.setRequestHeader(p,g)}}var m=function(){t--;var n=isNaN(P.get().streaming.retryIntervals[c.HTTPRequest.LICENSE])?1e3:P.get().streaming.retryIntervals[c.HTTPRequest.LICENSE];setTimeout((function(){Y(e,t,r,i,a,s)}),n)};o.onload=function(){this.status>=200&&this.status<=299||t<=0?i(this):(n.warn("License request failed ("+this.status+"). Retrying it... Pending retries: "+t),m())},o.ontimeout=o.onerror=function(){t<=0?s(this):(n.warn("License request network request failed . Retrying it... Pending retries: "+t),m())},o.onabort=function(){a(this)},w.trigger(I.LICENSE_REQUEST_SENDING,{url:e.url,headers:e.headers,payload:e.data,sessionId:e.sessionId}),o.send(e.data)}function Z(e,t){if(t)for(var n in t)e[n]=t[n]}function K(e,t,n,r,i){var a=e.response?i.getErrorResponse(e.response,n,r):"NONE";V(t,new o.default(s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,s.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+n+' update, XHR complete. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState+".  Response is "+a))}function z(e,t){return e?e.reduce((function(e,n){return e.then((function(){return n(t)}))}),Promise.resolve()):Promise.resolve()}function W(e,t){if(!P.get().streaming.protection.ignoreEmeEncryptedEvent){if(n.debug("DRM: onNeedKey"),"cenc"!==e.key.initDataType)return void n.warn("DRM:  Only 'cenc' initData is supported!  Ignoring initData of type: "+e.key.initDataType);if(0===g.length&&(n.warn("DRM: onNeedKey called before initializeForMedia, wait until initialized"),(t=void 0===t?1:t+1)<5))return void N.push(setTimeout((function(){W(e,t)}),500));var i=e.key.initData;if(ArrayBuffer.isView(i)&&(i=i.buffer),_){var a=r.default.getPSSHForKeySystem(_,i);if(a&&B(a))return}n.debug("DRM: initData:",String.fromCharCode.apply(null,new Uint8Array(i)));var s=S.getSupportedKeySystemsFromSegmentPssh(i,m,y);if(0===s.length)return void n.debug("DRM: Received needkey event with initData, but we don't support any of the key systems!");x(s,!1)}}return t={initializeForMedia:function(e){if(!e)throw new Error("mediaInfo can not be null or undefined");M(),g.push(e);var t=S.getSupportedKeySystemsFromContentProtection(e.contentProtection,m,y);(t=t.sort((function(e,n){return(m&&m[e.ks.systemString]&&m[e.ks.systemString].priority>=0?m[e.ks.systemString].priority:t.length)-(m&&m[n.ks.systemString]&&m[n.ks.systemString].priority>=0?m[n.ks.systemString].priority:t.length)})))&&t.length>0&&x(t,!0)},clearMediaInfoArray:function(){g=[]},createKeySession:F,loadKeySession:k,removeKeySession:function(e){M(),A.removeKeySession(e)},closeKeySession:function(e){M(),A.closeKeySession(e)},setServerCertificate:function(e){M(),A.setServerCertificate(e)},setMediaElement:j,setSessionType:function(e){y=e},setRobustnessLevel:function(e){v=e},setProtectionData:function(e){m=e,S.setProtectionData(e)},getSupportedKeySystemsFromContentProtection:function(e){return M(),S.getSupportedKeySystemsFromContentProtection(e,m,y)},getKeySystems:function(){return S?S.getKeySystems():[]},setKeySystems:function(e){S&&S.setKeySystems(e)},setLicenseRequestFilters:function(e){E=e},setLicenseResponseFilters:function(e){b=e},stop:function(){A&&A.stop()},reset:function(){w.off(I.INTERNAL_KEY_MESSAGE,G,t),w.off(I.INTERNAL_KEY_STATUS_CHANGED,H,t),M(),E=[],b=[],j(null),_=null,T=!1,A&&(A.reset(),A=null),N.forEach((function(e){return clearTimeout(e)})),N=[],g=[],h=[]}},n=C.getLogger(t),h=[],g=[],y="temporary",v="",E=[],b=[],w.on(I.INTERNAL_KEY_MESSAGE,G,t),w.on(I.INTERNAL_KEY_STATUS_CHANGED,H,t),t}g.__dashjs_factory_name="ProtectionController",t.default=h.default.getClassFactory(g)},"./src/streaming/protection/controllers/ProtectionKeyController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/protection/CommonEncryption.js"),i=n("./src/streaming/protection/drm/KeySystemClearKey.js"),a=n("./src/streaming/protection/drm/KeySystemW3CClearKey.js"),s=n("./src/streaming/protection/drm/KeySystemWidevine.js"),o=n("./src/streaming/protection/drm/KeySystemPlayReady.js"),l=n("./src/streaming/protection/servers/DRMToday.js"),u=n("./src/streaming/protection/servers/PlayReady.js"),c=n("./src/streaming/protection/servers/Widevine.js"),d=n("./src/streaming/protection/servers/ClearKey.js"),f=n("./src/streaming/constants/ProtectionConstants.js");function h(){var e,t,n,h,p,g,m,y=this.context;function v(e,t){return t&&e in t?t[e]:null}function _(e,t){return e&&e.sessionId?e.sessionId:t&&t.sessionId?t.sessionId:null}function T(e,t){return e&&e.sessionType?e.sessionType:t}return e={initialize:function(){var e;h=[],e=Object(o.default)(y).getInstance({BASE64:p}),h.push(e),e=Object(s.default)(y).getInstance({BASE64:p}),h.push(e),e=Object(i.default)(y).getInstance({BASE64:p}),h.push(e),g=e,e=Object(a.default)(y).getInstance({BASE64:p,debug:t}),h.push(e),m=e},setProtectionData:function(e){for(var t,n,r=0;r<h.length;r++){var i=h[r];i.hasOwnProperty("init")&&i.init((t=i.systemString,n=void 0,n=null,e&&(n=t in e?e[t]:null),n))}},isClearKey:function(e){return e===g||e===m},initDataEquals:function(e,t){if(e.byteLength===t.byteLength){for(var n=new Uint8Array(e),r=new Uint8Array(t),i=0;i<n.length;i++)if(n[i]!==r[i])return!1;return!0}return!1},getKeySystems:function(){return h},setKeySystems:function(e){h=e},getKeySystemBySystemString:function(e){for(var t=0;t<h.length;t++)if(h[t].systemString===e)return h[t];return null},getSupportedKeySystemsFromContentProtection:function(e,t,n){var i,a,s,o,l=[];if(e){var u=r.default.findCencContentProtection(e);for(s=0;s<h.length;++s){var c=v((a=h[s]).systemString,t);for(o=0;o<e.length;++o)if((i=e[o]).schemeIdUri.toLowerCase()===a.schemeIdURI){var d=a.getInitData(i,u);l.push({ks:h[s],keyId:i.keyId,initData:d,protData:c,cdmData:a.getCDMData(c?c.cdmData:null),sessionId:_(c,i),sessionType:T(c,n)})}}}return l},getSupportedKeySystemsFromSegmentPssh:function(e,t,n){for(var i,a=[],s=r.default.parsePSSHList(e),o=0;o<h.length;++o){var l=v((i=h[o]).systemString,t);i.uuid in s&&a.push({ks:i,initData:s[i.uuid],protData:l,cdmData:i.getCDMData(l?l.cdmData:null),sessionId:_(l),sessionType:T(l,n)})}return a},getLicenseServerModelInstance:function(e,t,n){if("license-release"===n||"individualization-request"===n)return null;var r=null;return t&&t.hasOwnProperty("drmtoday")?r=Object(l.default)(y).getInstance({BASE64:p}):e.systemString===f.default.WIDEVINE_KEYSTEM_STRING?r=Object(c.default)(y).getInstance():e.systemString===f.default.PLAYREADY_KEYSTEM_STRING?r=Object(u.default)(y).getInstance():e.systemString===f.default.CLEARKEY_KEYSTEM_STRING&&(r=Object(d.default)(y).getInstance()),r},processClearKeyLicenseRequest:function(e,t,r){try{return e.getClearKeysFromProtectionData(t,r)}catch(e){return n.error("Failed to retrieve clearkeys from ProtectionData"),null}},setConfig:function(r){r&&(r.debug&&(t=r.debug,n=t.getLogger(e)),r.BASE64&&(p=r.BASE64))}},e}h.__dashjs_factory_name="ProtectionKeyController",t.default=dashjs.FactoryMaker.getSingletonFactory(h)},"./src/streaming/protection/drm/KeySystemClearKey.js":function(e,t,n){n.r(t);var r=n("./src/streaming/protection/vo/KeyPair.js"),i=n("./src/streaming/protection/vo/ClearKeyKeySet.js"),a=n("./src/streaming/protection/CommonEncryption.js"),s=n("./src/streaming/constants/ProtectionConstants.js"),o="e2719d58-a985-b3c9-781a-b030af78d30e",l=s.default.CLEARKEY_KEYSTEM_STRING,u="urn:uuid:"+o;function c(e){var t,n=(e=e||{}).BASE64;return t={uuid:o,schemeIdURI:u,systemString:l,getInitData:function(e,t){try{var r=a.default.parseInitDataFromContentProtection(e,n);if(!r&&t){var i={kids:[function(e){try{var t=e.replace(/-/g,"");return(t=btoa(t.match(/\w{2}/g).map((function(e){return String.fromCharCode(parseInt(e,16))})).join(""))).replace(/=/g,"")}catch(e){return null}}(t["cenc:default_KID"])]};r=(new TextEncoder).encode(JSON.stringify(i))}return r}catch(e){return null}},getRequestHeadersFromMessage:function(){return{"Content-Type":"application/json"}},getLicenseRequestFromMessage:function(e){return JSON.parse(String.fromCharCode.apply(null,new Uint8Array(e)))},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getClearKeysFromProtectionData:function(e,t){var n=null;if(e){for(var a=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))),s=[],o=0;o<a.kids.length;o++){var l=a.kids[o],u=e.clearkeys&&e.clearkeys.hasOwnProperty(l)?e.clearkeys[l]:null;if(!u)throw new Error("DRM: ClearKey keyID ("+l+") is not known!");s.push(new r.default(l,u))}n=new i.default(s)}return n}},t}c.__dashjs_factory_name="KeySystemClearKey",t.default=dashjs.FactoryMaker.getSingletonFactory(c)},"./src/streaming/protection/drm/KeySystemPlayReady.js":function(e,t,n){n.r(t);var r=n("./src/streaming/protection/CommonEncryption.js"),i=n("./src/streaming/constants/ProtectionConstants.js"),a="9a04f079-9840-4286-ab92-e65be0885f95",s=i.default.PLAYREADY_KEYSTEM_STRING,o="urn:uuid:"+a;function l(e){var t,n="utf-16",i=(e=e||{}).BASE64;function l(){if(!i||!i.hasOwnProperty("decodeArray")||!i.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")}return t={uuid:a,schemeIdURI:o,systemString:s,getInitData:function(e){var t,n,a,s,o,u=new Uint8Array([112,115,115,104,0,0,0,0]),c=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]),d=0,f=null;if(l(),!e)return null;if("pssh"in e)return r.default.parseInitDataFromContentProtection(e,i);if("pro"in e)f=i.decodeArray(e.pro.__text);else{if(!("prheader"in e))return null;f=i.decodeArray(e.prheader.__text)}return t=f.length,n=4+u.length+c.length+4+t,a=new ArrayBuffer(n),s=new Uint8Array(a),(o=new DataView(a)).setUint32(d,n),d+=4,s.set(u,d),d+=u.length,s.set(c,d),d+=c.length,o.setUint32(d,t),d+=4,s.set(f,d),d+=t,s.buffer},getRequestHeadersFromMessage:function(e){var t,r,i={},a=new DOMParser,s="utf-16"===n?new Uint16Array(e):new Uint8Array(e);t=String.fromCharCode.apply(null,s);for(var o=(r=a.parseFromString(t,"application/xml")).getElementsByTagName("name"),l=r.getElementsByTagName("value"),u=0;u<o.length;u++)i[o[u].childNodes[0].nodeValue]=l[u].childNodes[0].nodeValue;return i.hasOwnProperty("Content")&&(i["Content-Type"]=i.Content,delete i.Content),i.hasOwnProperty("Content-Type")||(i["Content-Type"]="text/xml; charset=utf-8"),i},getLicenseRequestFromMessage:function(e){var t=null,r=new DOMParser,a="utf-16"===n?new Uint16Array(e):new Uint8Array(e);l();var s=String.fromCharCode.apply(null,a),o=r.parseFromString(s,"application/xml");if(!o.getElementsByTagName("PlayReadyKeyMessage")[0])return e;var u=o.getElementsByTagName("Challenge")[0].childNodes[0].nodeValue;return u&&(t=i.decode(u)),t},getLicenseServerURLFromInitData:function(e){if(e)for(var t=new DataView(e),n=t.getUint16(4,!0),r=6,i=new DOMParser,a=0;a<n;a++){var s=t.getUint16(r,!0);r+=2;var o=t.getUint16(r,!0);if(r+=2,1===s){var l=e.slice(r,r+o),u=String.fromCharCode.apply(null,new Uint16Array(l)),c=i.parseFromString(u,"application/xml");if(c.getElementsByTagName("LA_URL")[0]){var d=c.getElementsByTagName("LA_URL")[0].childNodes[0].nodeValue;if(d)return d}if(c.getElementsByTagName("LUI_URL")[0]){var f=c.getElementsByTagName("LUI_URL")[0].childNodes[0].nodeValue;if(f)return f}}else r+=o}return null},getCDMData:function(e){var t,n,r,a;if(l(),!e)return null;for(t=[],a=0;a<e.length;++a)t.push(e.charCodeAt(a)),t.push(0);for(t=String.fromCharCode.apply(null,t),t=i.encode(t),n='<PlayReadyCDMData type="LicenseAcquisition"><LicenseAcquisition version="1.0" Proactive="false"><CustomData encoding="base64encoded">%CUSTOMDATA%</CustomData></LicenseAcquisition></PlayReadyCDMData>'.replace("%CUSTOMDATA%",t),r=[],a=0;a<n.length;++a)r.push(n.charCodeAt(a)),r.push(0);return new Uint8Array(r).buffer},setPlayReadyMessageFormat:function(e){if("utf-8"!==e&&"utf-16"!==e)throw new Error('Specified message format is not one of "utf-8" or "utf-16"');n=e}},t}l.__dashjs_factory_name="KeySystemPlayReady",t.default=dashjs.FactoryMaker.getSingletonFactory(l)},"./src/streaming/protection/drm/KeySystemW3CClearKey.js":function(e,t,n){n.r(t);var r=n("./src/streaming/protection/vo/KeyPair.js"),i=n("./src/streaming/protection/vo/ClearKeyKeySet.js"),a=n("./src/streaming/protection/CommonEncryption.js"),s=n("./src/streaming/constants/ProtectionConstants.js"),o="1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",l=s.default.CLEARKEY_KEYSTEM_STRING,u="urn:uuid:"+o;function c(e){var t,n=e.BASE64,s=e.debug.getLogger(t);return t={uuid:o,schemeIdURI:u,systemString:l,getInitData:function(e){return a.default.parseInitDataFromContentProtection(e,n)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(e){return new Uint8Array(e)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getClearKeysFromProtectionData:function(e,t){var n=null;if(e){for(var a=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))),o=[],l=0;l<a.kids.length;l++){var u=a.kids[l],c=e.clearkeys&&e.clearkeys.hasOwnProperty(u)?e.clearkeys[u]:null;if(!c)throw new Error("DRM: ClearKey keyID ("+u+") is not known!");o.push(new r.default(u,c))}n=new i.default(o),s.warn("ClearKey schemeIdURI is using W3C Common PSSH systemID (1077efec-c0b2-4d02-ace3-3c1e52e2fb4b) in Content Protection. See DASH-IF IOP v4.1 section 7.6.2.4")}return n}},t}c.__dashjs_factory_name="KeySystemW3CClearKey",t.default=dashjs.FactoryMaker.getSingletonFactory(c)},"./src/streaming/protection/drm/KeySystemWidevine.js":function(e,t,n){n.r(t);var r=n("./src/streaming/protection/CommonEncryption.js"),i=n("./src/streaming/constants/ProtectionConstants.js"),a="edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",s=i.default.WIDEVINE_KEYSTEM_STRING,o="urn:uuid:"+a;function l(e){var t=(e=e||{}).BASE64;return{uuid:a,schemeIdURI:o,systemString:s,getInitData:function(e){return r.default.parseInitDataFromContentProtection(e,t)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(e){return new Uint8Array(e)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null}}}l.__dashjs_factory_name="KeySystemWidevine",t.default=dashjs.FactoryMaker.getSingletonFactory(l)},"./src/streaming/protection/errors/ProtectionErrors.js":function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=s(e);if(t){var a=s(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}n.r(t);var o=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(n,e);var t=a(n);function n(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(e=t.call(this)).MEDIA_KEYERR_CODE=100,e.MEDIA_KEYERR_UNKNOWN_CODE=101,e.MEDIA_KEYERR_CLIENT_CODE=102,e.MEDIA_KEYERR_SERVICE_CODE=103,e.MEDIA_KEYERR_OUTPUT_CODE=104,e.MEDIA_KEYERR_HARDWARECHANGE_CODE=105,e.MEDIA_KEYERR_DOMAIN_CODE=106,e.MEDIA_KEY_MESSAGE_ERROR_CODE=107,e.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE=108,e.SERVER_CERTIFICATE_UPDATED_ERROR_CODE=109,e.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE=110,e.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE=111,e.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE=112,e.KEY_SESSION_CREATED_ERROR_CODE=113,e.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE=114,e.MEDIA_KEYERR_UNKNOWN_MESSAGE="An unspecified error occurred. This value is used for errors that don't match any of the other codes.",e.MEDIA_KEYERR_CLIENT_MESSAGE="The Key System could not be installed or updated.",e.MEDIA_KEYERR_SERVICE_MESSAGE="The message passed into update indicated an error from the license service.",e.MEDIA_KEYERR_OUTPUT_MESSAGE="There is no available output device with the required characteristics for the content protection system.",e.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE="A hardware configuration change caused a content protection error.",e.MEDIA_KEYERR_DOMAIN_MESSAGE="An error occurred in a multi-device domain licensing configuration. The most common error is a failure to join the domain.",e.MEDIA_KEY_MESSAGE_ERROR_MESSAGE="Multiple key sessions were creates with a user-agent that does not support sessionIDs!! Unpredictable behavior ahead!",e.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE="DRM: Empty key message from CDM",e.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE="Error updating server certificate -- ",e.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE="DRM: KeyStatusChange error! -- License has expired",e.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE="DRM: No license server URL specified!",e.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE="DRM: KeySystem Access Denied! -- ",e.KEY_SESSION_CREATED_ERROR_MESSAGE="DRM: unable to create session! --",e.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE="DRM: licenser error! --",e}return n}(n("./src/core/errors/ErrorsBase.js").default));t.default=o},"./src/streaming/protection/models/ProtectionModel_01b.js":function(e,t,n){n.r(t);var r=n("./src/streaming/protection/controllers/ProtectionKeyController.js"),i=n("./src/streaming/protection/vo/NeedKey.js"),a=n("./src/streaming/vo/DashJSError.js"),s=n("./src/streaming/protection/vo/KeyMessage.js"),o=n("./src/streaming/protection/vo/KeySystemConfiguration.js"),l=n("./src/streaming/protection/vo/KeySystemAccess.js"),u=n("./src/streaming/protection/errors/ProtectionErrors.js");function c(e){e=e||{};var t,n,c,d,f,h,p,g,m,y=this.context,v=e.eventBus,_=e.events,T=e.debug,E=e.api,b=e.errHandler;function S(){c&&I();for(var e=0;e<p.length;e++)A(p[e]);v.trigger(_.TEARDOWN_COMPLETE)}function A(e){try{c[E.cancelKeyRequest](d.systemString,e.sessionId)}catch(t){v.trigger(_.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+e.sessionId+") "+t.message})}}function w(e,t){if(t&&e){for(var n=e.length,r=0;r<n;r++)if(e[r].sessionId==t)return e[r];return null}return null}function I(){c.removeEventListener(E.keyerror,m),c.removeEventListener(E.needkey,m),c.removeEventListener(E.keymessage,m),c.removeEventListener(E.keyadded,m)}return t={getAllInitData:function(){for(var e=[],t=0;t<h.length;t++)e.push(h[t].initData);for(var n=0;n<p.length;n++)e.push(p[n].initData);return e},getSessions:function(){return p.concat(h)},requestKeySystemAccess:function(e){return new Promise((function(t,n){var r=c;r||(r=document.createElement("video"));for(var i=!1,a=0;a<e.length;a++)for(var s=e[a].ks.systemString,u=e[a].configs,d=null,h=null,p=0;p<u.length;p++){var g=u[p].videoCapabilities;if(g&&0!==g.length){h=[];for(var m=0;m<g.length;m++)""!==r.canPlayType(g[m].contentType,s)&&h.push(g[m])}if(h&&(!h||0!==h.length)){i=!0;var y=new o.default(d,h),T=f.getKeySystemBySystemString(s),E=new l.default(T,y);v.trigger(_.KEY_SYSTEM_ACCESS_COMPLETE,{data:E}),t({data:E});break}}if(!i){var b="Key system access denied! -- No valid audio/video content configurations detected!";v.trigger(_.KEY_SYSTEM_ACCESS_COMPLETE,{error:b}),n({error:b})}}))},selectKeySystem:function(e){return d=e.keySystem,Promise.resolve(d)},setMediaElement:function(e){if(c!==e){if(c){I();for(var t=0;t<p.length;t++)A(p[t]);p=[]}(c=e)&&(c.addEventListener(E.keyerror,m),c.addEventListener(E.needkey,m),c.addEventListener(E.keymessage,m),c.addEventListener(E.keyadded,m),v.trigger(_.VIDEO_ELEMENT_SELECTED))}},createKeySession:function(e){if(!d)throw new Error("Can not create sessions until you have selected a key system");if(g||0===p.length){var t={sessionId:null,keyId:e.keyId,initData:e.initData,getKeyId:function(){return this.keyId},getSessionId:function(){return this.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"}};return h.push(t),c[E.generateKeyRequest](d.systemString,new Uint8Array(e.initData)),t}throw new Error("Multiple sessions not allowed!")},updateKeySession:function(e,t){var n=e.sessionId;if(f.isClearKey(d))for(var r=0;r<t.keyPairs.length;r++)c[E.addKey](d.systemString,t.keyPairs[r].key,t.keyPairs[r].keyID,n);else c[E.addKey](d.systemString,new Uint8Array(t),new Uint8Array(e.initData),n);v.trigger(_.KEY_SESSION_UPDATED)},closeKeySession:A,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},stop:S,reset:S},n=T.getLogger(t),c=null,d=null,h=[],p=[],f=Object(r.default)(y).getInstance(),m={handleEvent:function(e){var t=null;switch(e.type){case E.needkey:var r=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;v.trigger(_.NEED_KEY,{key:new i.default(r,"cenc")});break;case E.keyerror:if((t=w(p,e.sessionId))||(t=w(h,e.sessionId)),t){var o=u.default.MEDIA_KEYERR_CODE,l="";switch(e.errorCode.code){case 1:o=u.default.MEDIA_KEYERR_UNKNOWN_CODE,l+="MEDIA_KEYERR_UNKNOWN - "+u.default.MEDIA_KEYERR_UNKNOWN_MESSAGE;break;case 2:o=u.default.MEDIA_KEYERR_CLIENT_CODE,l+="MEDIA_KEYERR_CLIENT - "+u.default.MEDIA_KEYERR_CLIENT_MESSAGE;break;case 3:o=u.default.MEDIA_KEYERR_SERVICE_CODE,l+="MEDIA_KEYERR_SERVICE - "+u.default.MEDIA_KEYERR_SERVICE_MESSAGE;break;case 4:o=u.default.MEDIA_KEYERR_OUTPUT_CODE,l+="MEDIA_KEYERR_OUTPUT - "+u.default.MEDIA_KEYERR_OUTPUT_MESSAGE;break;case 5:o=u.default.MEDIA_KEYERR_HARDWARECHANGE_CODE,l+="MEDIA_KEYERR_HARDWARECHANGE - "+u.default.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE;break;case 6:o=u.default.MEDIA_KEYERR_DOMAIN_CODE,l+="MEDIA_KEYERR_DOMAIN - "+u.default.MEDIA_KEYERR_DOMAIN_MESSAGE}l+="  System Code = "+e.systemCode,v.trigger(_.KEY_ERROR,{error:new a.default(o,l,t)})}else n.error("No session token found for key error");break;case E.keyadded:(t=w(p,e.sessionId))||(t=w(h,e.sessionId)),t?(n.debug("DRM: Key added."),v.trigger(_.KEY_ADDED,{data:t})):n.debug("No session token found for key added");break;case E.keymessage:if((g=null!==e.sessionId&&void 0!==e.sessionId)?!(t=w(p,e.sessionId))&&h.length>0&&(t=h.shift(),p.push(t),t.sessionId=e.sessionId,v.trigger(_.KEY_SESSION_CREATED,{data:t})):h.length>0&&(t=h.shift(),p.push(t),0!==h.length&&b.error(new a.default(u.default.MEDIA_KEY_MESSAGE_ERROR_CODE,u.default.MEDIA_KEY_MESSAGE_ERROR_MESSAGE))),t){var c=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;t.keyMessage=c,v.trigger(_.INTERNAL_KEY_MESSAGE,{data:new s.default(t,c,e.defaultURL)})}else n.warn("No session token found for key message")}}},t}c.__dashjs_factory_name="ProtectionModel_01b",t.default=dashjs.FactoryMaker.getClassFactory(c)},"./src/streaming/protection/models/ProtectionModel_21Jan2015.js":function(e,t,n){n.r(t);var r=n("./src/streaming/protection/controllers/ProtectionKeyController.js"),i=n("./src/streaming/protection/vo/NeedKey.js"),a=n("./src/streaming/protection/errors/ProtectionErrors.js"),s=n("./src/streaming/vo/DashJSError.js"),o=n("./src/streaming/protection/vo/KeyMessage.js"),l=n("./src/streaming/protection/vo/KeySystemAccess.js"),u=n("./src/streaming/constants/ProtectionConstants.js");function c(e){e=e||{};var t,n,c,d,f,h,p,g,m=this.context,y=e.eventBus,v=e.events,_=e.debug;function T(e,t,n,r){if(void 0===navigator.requestMediaKeySystemAccess||"function"!=typeof navigator.requestMediaKeySystemAccess){var i="Insecure origins are not allowed";return y.trigger(v.KEY_SYSTEM_ACCESS_COMPLETE,{error:i}),void r({error:i})}var a=e[t].ks,s=e[t].configs,o=a.systemString;o===u.default.PLAYREADY_KEYSTEM_STRING&&"required"===s[0].persistentState&&(o+=".recommendation"),navigator.requestMediaKeySystemAccess(o,s).then((function(e){var t="function"==typeof e.getConfiguration?e.getConfiguration():null,r=new l.default(a,t);r.mksa=e,y.trigger(v.KEY_SYSTEM_ACCESS_COMPLETE,{data:r}),n({data:r})})).catch((function(i){if(t+1<e.length)T(e,t+1,n,r);else{var a="Key system access denied! ";y.trigger(v.KEY_SYSTEM_ACCESS_COMPLETE,{error:a+i.message}),r({error:a+i.message})}}))}function E(e){var t=e.session;return t.removeEventListener("keystatuseschange",e),t.removeEventListener("message",e),t.close()}function b(e){for(var t=0;t<h.length;t++)if(h[t]===e){h.splice(t,1);break}}function S(e){var t,n;return e&&e.length>0&&(e[0]&&("string"==typeof e[0]?t=e[0]:n=e[0]),e[1]&&("string"==typeof e[1]?t=e[1]:n=e[1])),{status:t,keyId:n}}function A(e,t){var r={session:e,keyId:t.keyId,initData:t.initData,sessionId:t.sessionId,sessionType:t.sessionType,handleEvent:function(e){switch(e.type){case"keystatuseschange":y.trigger(v.KEY_STATUSES_CHANGED,{data:this}),e.target.keyStatuses.forEach((function(){var e=S(arguments);"expired"===e.status?y.trigger(v.INTERNAL_KEY_STATUS_CHANGED,{error:new s.default(a.default.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE,a.default.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE)}):y.trigger(v.INTERNAL_KEY_STATUS_CHANGED,e)}));break;case"message":var t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;y.trigger(v.INTERNAL_KEY_MESSAGE,{data:new o.default(this,t,void 0,e.messageType)})}},getKeyId:function(){return this.keyId},getSessionId:function(){return e.sessionId},getSessionType:function(){return this.sessionType},getExpirationTime:function(){return e.expiration},getKeyStatuses:function(){return e.keyStatuses},getUsable:function(){var t=!1;return e.keyStatuses.forEach((function(){"usable"===S(arguments).status&&(t=!0)})),t}};return e.addEventListener("keystatuseschange",r),e.addEventListener("message",r),e.closed.then((function(){b(r),n.debug("DRM: Session closed.  SessionID = "+r.getSessionId()),y.trigger(v.KEY_SESSION_CLOSED,{data:r.getSessionId()})})),h.push(r),r}return t={getAllInitData:function(){for(var e=[],t=0;t<h.length;t++)h[t].initData&&e.push(h[t].initData);return e},getSessions:function(){return h},requestKeySystemAccess:function(e){return new Promise((function(t,n){T(e,0,t,n)}))},selectKeySystem:function(e){return new Promise((function(t,n){e.mksa.createMediaKeys().then((function(t){return c=e.keySystem,f=t,d?d.setMediaKeys(f):Promise.resolve()})).then((function(){t(c)})).catch((function(){n({error:"Error selecting keys system ("+e.keySystem.systemString+")! Could not create MediaKeys -- TODO"})}))}))},setMediaElement:function(e){d!==e&&(d&&(d.removeEventListener("encrypted",p),d.setMediaKeys&&d.setMediaKeys(null)),(d=e)&&(d.addEventListener("encrypted",p),d.setMediaKeys&&f&&d.setMediaKeys(f)))},setServerCertificate:function(e){if(!c||!f)throw new Error("Can not set server certificate until you have selected a key system");f.setServerCertificate(e).then((function(){n.info("DRM: License server certificate successfully updated."),y.trigger(v.SERVER_CERTIFICATE_UPDATED)})).catch((function(e){y.trigger(v.SERVER_CERTIFICATE_UPDATED,{error:new s.default(a.default.SERVER_CERTIFICATE_UPDATED_ERROR_CODE,a.default.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE+e.name)})}))},createKeySession:function(e){if(!c||!f)throw new Error("Can not create sessions until you have selected a key system");var t=f.createSession(e.sessionType),r=A(t,e),i=c.systemString===u.default.CLEARKEY_KEYSTEM_STRING&&(e.initData||e.protData&&e.protData.clearkeys)?u.default.INITIALIZATION_DATA_TYPE_KEYIDS:u.default.INITIALIZATION_DATA_TYPE_CENC;t.generateRequest(i,e.initData).then((function(){n.debug("DRM: Session created.  SessionID = "+r.getSessionId()),y.trigger(v.KEY_SESSION_CREATED,{data:r})})).catch((function(e){b(r),y.trigger(v.KEY_SESSION_CREATED,{data:null,error:new s.default(a.default.KEY_SESSION_CREATED_ERROR_CODE,a.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Error generating key request -- "+e.name)})}))},updateKeySession:function(e,t){var n=e.session;g.isClearKey(c)&&(t=t.toJWK()),n.update(t).then((function(){y.trigger(v.KEY_SESSION_UPDATED)})).catch((function(t){y.trigger(v.KEY_ERROR,{error:new s.default(a.default.MEDIA_KEYERR_CODE,"Error sending update() message! "+t.name,e)})}))},loadKeySession:function(e){if(!c||!f)throw new Error("Can not load sessions until you have selected a key system");for(var t=e.sessionId,r=0;r<h.length;r++)if(t===h[r].sessionId)return void n.warn("DRM: Ignoring session ID because we have already seen it!");var i=f.createSession(e.sessionType),o=A(i,e);i.load(t).then((function(e){e?(n.debug("DRM: Session loaded.  SessionID = "+o.getSessionId()),y.trigger(v.KEY_SESSION_CREATED,{data:o})):(b(o),y.trigger(v.KEY_SESSION_CREATED,{data:null,error:new s.default(a.default.KEY_SESSION_CREATED_ERROR_CODE,a.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session! Invalid Session ID ("+t+")")}))})).catch((function(e){b(o),y.trigger(v.KEY_SESSION_CREATED,{data:null,error:new s.default(a.default.KEY_SESSION_CREATED_ERROR_CODE,a.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session ("+t+")! "+e.name)})}))},removeKeySession:function(e){e.session.remove().then((function(){n.debug("DRM: Session removed.  SessionID = "+e.getSessionId()),y.trigger(v.KEY_SESSION_REMOVED,{data:e.getSessionId()})}),(function(t){y.trigger(v.KEY_SESSION_REMOVED,{data:null,error:"Error removing session ("+e.getSessionId()+"). "+t.name})}))},closeKeySession:function(e){E(e).catch((function(t){b(e),y.trigger(v.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+e.getSessionId()+") "+t.name})}))},stop:function(){for(var e,t=0;t<h.length;t++)(e=h[t]).getUsable()||E(e).catch((function(){b(e)}))},reset:function(){var e,t=h.length;0!==t?function(){for(var n=function(e){b(e),0===h.length&&(d?(d.removeEventListener("encrypted",p),d.setMediaKeys(null).then((function(){y.trigger(v.TEARDOWN_COMPLETE)}))):y.trigger(v.TEARDOWN_COMPLETE))},r=0;r<t;r++)!function(t){e.session.closed.then((function(){n(t)})),E(e).catch((function(){n(t)}))}(e=h[r])}():y.trigger(v.TEARDOWN_COMPLETE)}},n=_.getLogger(t),c=null,d=null,f=null,h=[],g=Object(r.default)(m).getInstance(),p={handleEvent:function(e){if("encrypted"===e.type&&e.initData){var t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;y.trigger(v.NEED_KEY,{key:new i.default(t,e.initDataType)})}}},t}c.__dashjs_factory_name="ProtectionModel_21Jan2015",t.default=dashjs.FactoryMaker.getClassFactory(c)},"./src/streaming/protection/models/ProtectionModel_3Feb2014.js":function(e,t,n){n.r(t);var r=n("./src/streaming/protection/controllers/ProtectionKeyController.js"),i=n("./src/streaming/protection/vo/NeedKey.js"),a=n("./src/streaming/vo/DashJSError.js"),s=n("./src/streaming/protection/errors/ProtectionErrors.js"),o=n("./src/streaming/protection/vo/KeyMessage.js"),l=n("./src/streaming/protection/vo/KeySystemConfiguration.js"),u=n("./src/streaming/protection/vo/KeySystemAccess.js");function c(e){e=e||{};var t,n,c,d,f,h,p,g,m,y=this.context,v=e.eventBus,_=e.events,T=e.debug,E=e.api;function b(){try{for(var e=0;e<p.length;e++)S(p[e]);c&&c.removeEventListener(E.needkey,g),v.trigger(_.TEARDOWN_COMPLETE)}catch(e){v.trigger(_.TEARDOWN_COMPLETE,{error:"Error tearing down key sessions and MediaKeys! -- "+e.message})}}function S(e){var t=e.session;t.removeEventListener(E.error,e),t.removeEventListener(E.message,e),t.removeEventListener(E.ready,e),t.removeEventListener(E.close,e);for(var n=0;n<p.length;n++)if(p[n]===e){p.splice(n,1);break}t[E.release]()}function A(){var e=null,t=function(){c.removeEventListener("loadedmetadata",e),c[E.setMediaKeys](f),v.trigger(_.VIDEO_ELEMENT_SELECTED)};c.readyState>=1?t():(e=t.bind(this),c.addEventListener("loadedmetadata",e))}return t={getAllInitData:function(){for(var e=[],t=0;t<p.length;t++)e.push(p[t].initData);return e},getSessions:function(){return p},requestKeySystemAccess:function(e){return new Promise((function(t,n){for(var r=!1,i=0;i<e.length;i++)for(var a=e[i].ks.systemString,s=e[i].configs,o=null,c=null,d=0;d<s.length;d++){var f=s[d].audioCapabilities,h=s[d].videoCapabilities;if(f&&0!==f.length){o=[];for(var p=0;p<f.length;p++)window[E.MediaKeys].isTypeSupported(a,f[p].contentType)&&o.push(f[p])}if(h&&0!==h.length){c=[];for(var g=0;g<h.length;g++)window[E.MediaKeys].isTypeSupported(a,h[g].contentType)&&c.push(h[g])}if(!(!o&&!c||o&&0===o.length||c&&0===c.length)){r=!0;var y=new l.default(o,c),T=m.getKeySystemBySystemString(a),b=new u.default(T,y);v.trigger(_.KEY_SYSTEM_ACCESS_COMPLETE,{data:b}),t({data:b});break}}if(!r){var S="Key system access denied! -- No valid audio/video content configurations detected!";v.trigger(_.KEY_SYSTEM_ACCESS_COMPLETE,{error:S}),n({error:S})}}))},selectKeySystem:function(e){return new Promise((function(t,n){try{f=e.mediaKeys=new window[E.MediaKeys](e.keySystem.systemString),d=e.keySystem,h=e,c&&A(),t(d)}catch(e){n({error:"Error selecting keys system ("+d.systemString+")! Could not create MediaKeys -- TODO"})}}))},setMediaElement:function(e){c!==e&&(c&&c.removeEventListener(E.needkey,g),(c=e)&&(c.addEventListener(E.needkey,g),f&&A()))},createKeySession:function(e){if(!d||!f||!h)throw new Error("Can not create sessions until you have selected a key system");var t=null;if(h.ksConfiguration.videoCapabilities&&h.ksConfiguration.videoCapabilities.length>0&&(t=h.ksConfiguration.videoCapabilities[0]),null===t&&h.ksConfiguration.audioCapabilities&&h.ksConfiguration.audioCapabilities.length>0&&(t=h.ksConfiguration.audioCapabilities[0]),null===t)throw new Error("Can not create sessions for unknown content types.");var r=t.contentType,i=f.createSession(r,new Uint8Array(e.initData),e.cdmData?new Uint8Array(e.cdmData):null),l=function(e,t){return{session:e,keyId:t.keyId,initData:t.initData,getKeyId:function(){return this.keyId},getSessionId:function(){return this.session.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"},handleEvent:function(e){switch(e.type){case E.error:var t="KeyError";v.trigger(_.KEY_ERROR,{error:new a.default(s.default.MEDIA_KEYERR_CODE,t,this)});break;case E.message:var r=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;v.trigger(_.INTERNAL_KEY_MESSAGE,{data:new o.default(this,r,e.destinationURL)});break;case E.ready:n.debug("DRM: Key added."),v.trigger(_.KEY_ADDED);break;case E.close:n.debug("DRM: Session closed.  SessionID = "+this.getSessionId()),v.trigger(_.KEY_SESSION_CLOSED,{data:this.getSessionId()})}}}}(i,e);i.addEventListener(E.error,l),i.addEventListener(E.message,l),i.addEventListener(E.ready,l),i.addEventListener(E.close,l),p.push(l),n.debug("DRM: Session created.  SessionID = "+l.getSessionId()),v.trigger(_.KEY_SESSION_CREATED,{data:l})},updateKeySession:function(e,t){var n=e.session;m.isClearKey(d)?n.update(new Uint8Array(t.toJWK())):n.update(new Uint8Array(t)),v.trigger(_.KEY_SESSION_UPDATED)},closeKeySession:S,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},stop:b,reset:b},n=T.getLogger(t),c=null,d=null,f=null,h=null,p=[],m=Object(r.default)(y).getInstance(),g={handleEvent:function(e){if(e.type===E.needkey&&e.initData){var t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;v.trigger(_.NEED_KEY,{key:new i.default(t,"cenc")})}}},t}c.__dashjs_factory_name="ProtectionModel_3Feb2014",t.default=dashjs.FactoryMaker.getClassFactory(c)},"./src/streaming/protection/servers/ClearKey.js":function(e,t,n){n.r(t);var r=n("./src/streaming/protection/vo/KeyPair.js"),i=n("./src/streaming/protection/vo/ClearKeyKeySet.js");function a(){var e;return e={getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"json"},getLicenseMessage:function(e){if(!e.hasOwnProperty("keys"))return null;for(var t=[],n=0;n<e.keys.length;n++){var a=e.keys[n],s=a.kid.replace(/=/g,""),o=a.k.replace(/=/g,"");t.push(new r.default(s,o))}return new i.default(t)},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}},e}a.__dashjs_factory_name="ClearKey",t.default=dashjs.FactoryMaker.getSingletonFactory(a)},"./src/streaming/protection/servers/DRMToday.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/ProtectionConstants.js");function i(e){var t=(e=e||{}).BASE64,n={};return n[r.default.WIDEVINE_KEYSTEM_STRING]={responseType:"json",getLicenseMessage:function(e){return t.decodeArray(e.license)},getErrorResponse:function(e){return e}},n[r.default.PLAYREADY_KEYSTEM_STRING]={responseType:"arraybuffer",getLicenseMessage:function(e){return e},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}},{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(e){return n[e].responseType},getLicenseMessage:function(e,r){return function(){if(!t||!t.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")}(),n[r].getLicenseMessage(e)},getErrorResponse:function(e,t){return n[t].getErrorResponse(e)}}}i.__dashjs_factory_name="DRMToday",t.default=dashjs.FactoryMaker.getSingletonFactory(i)},"./src/streaming/protection/servers/PlayReady.js":function(e,t,n){function r(){var e="http://schemas.xmlsoap.org/soap/envelope/";function t(e){var t=String.fromCharCode.apply(null,new Uint8Array(e));return decodeURIComponent(escape(t))}function n(n){if(window.DOMParser){var r=t(n),i=(new window.DOMParser).parseFromString(r,"text/xml"),a=i?i.getElementsByTagNameNS(e,"Envelope")[0]:null,s=a?a.getElementsByTagNameNS(e,"Body")[0]:null;if(s&&s.getElementsByTagNameNS(e,"Fault")[0])return null}return n}function r(n){var r="",i="",a="",s=-1,o=-1;if(window.DOMParser){var l=t(n),u=(new window.DOMParser).parseFromString(l,"text/xml"),c=u?u.getElementsByTagNameNS(e,"Envelope")[0]:null,d=c?c.getElementsByTagNameNS(e,"Body")[0]:null,f=d?d.getElementsByTagNameNS(e,"Fault")[0]:null,h=f?f.getElementsByTagName("detail")[0]:null,p=h?h.getElementsByTagName("Exception")[0]:null,g=null;if(null===f)return l;r=(g=f.getElementsByTagName("faultstring")[0].firstChild)?g.nodeValue:null,null!==p&&(i=(g=p.getElementsByTagName("StatusCode")[0])?g.firstChild.nodeValue:null,s=(a=(g=p.getElementsByTagName("Message")[0])?g.firstChild.nodeValue:null)?a.lastIndexOf("[")+1:-1,o=a?a.indexOf("]"):-1,a=a?a.substring(s,o):"")}var m="code: ".concat(i,", name: ").concat(r);return a&&(m+=", message: ".concat(a)),m}return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(e){return n.call(this,e)},getErrorResponse:function(e){return r.call(this,e)}}}n.r(t),r.__dashjs_factory_name="PlayReady",t.default=dashjs.FactoryMaker.getSingletonFactory(r)},"./src/streaming/protection/servers/Widevine.js":function(e,t,n){function r(){return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(e){return e},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}}}n.r(t),r.__dashjs_factory_name="Widevine",t.default=dashjs.FactoryMaker.getSingletonFactory(r)},"./src/streaming/protection/vo/ClearKeyKeySet.js":function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(t);var i=function(){function e(t,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n&&"persistent"!==n&&"temporary"!==n)throw new Error("Invalid ClearKey key set type!  Must be one of 'persistent' or 'temporary'");this.keyPairs=t,this.type=n}var t,n,i;return t=e,n=[{key:"toJWK",value:function(){var e,t=this.keyPairs.length,n={keys:[]};for(e=0;e<t;e++){var r={kty:"oct",alg:"A128KW",kid:this.keyPairs[e].keyID,k:this.keyPairs[e].key};n.keys.push(r)}this.type&&(n.type=this.type);var i=JSON.stringify(n),a=i.length,s=new ArrayBuffer(a),o=new Uint8Array(s);for(e=0;e<a;e++)o[e]=i.charCodeAt(e);return s}}],n&&r(t.prototype,n),i&&r(t,i),e}();t.default=i},"./src/streaming/protection/vo/KeyMessage.js":function(e,t,n){n.r(t),t.default=function e(t,n,r,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sessionToken=t,this.message=n,this.defaultURL=r,this.messageType=i||"license-request"}},"./src/streaming/protection/vo/KeyPair.js":function(e,t,n){n.r(t),t.default=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.keyID=t,this.key=n}},"./src/streaming/protection/vo/KeySystemAccess.js":function(e,t,n){n.r(t),t.default=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.keySystem=t,this.ksConfiguration=n}},"./src/streaming/protection/vo/KeySystemConfiguration.js":function(e,t,n){n.r(t),t.default=function e(t,n,r,i,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.initDataTypes=["cenc"],t&&t.length&&(this.audioCapabilities=t),n&&n.length&&(this.videoCapabilities=n),this.distinctiveIdentifier=r,this.persistentState=i,this.sessionTypes=a}},"./src/streaming/protection/vo/LicenseRequest.js":function(e,t,n){n.r(t),t.default=function e(t,n,r,i,a,s,o,l){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t,this.method=n,this.responseType=r,this.headers=i,this.withCredentials=a,this.messageType=s,this.sessionId=o,this.data=l}},"./src/streaming/protection/vo/LicenseResponse.js":function(e,t,n){n.r(t),t.default=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t,this.headers=n,this.data=r}},"./src/streaming/protection/vo/MediaCapability.js":function(e,t,n){n.r(t),t.default=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.contentType=t,this.robustness=n}},"./src/streaming/protection/vo/NeedKey.js":function(e,t,n){n.r(t),t.default=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.initData=t,this.initDataType=n}},"./src/streaming/rules/DroppedFramesHistory.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js");function i(){var e={},t={},n={};return{push:function(r,i,a){if(i){e[r]||(e[r]=[],t[r]=0,n[r]=0);var s=a&&a.droppedVideoFrames?a.droppedVideoFrames:0,o=a&&a.totalVideoFrames?a.totalVideoFrames:0,l=s-t;t[r]=s;var u=o-n;n[r]=o;var c=e[r];isNaN(i)||(c[i]?(c[i].droppedVideoFrames+=l,c[i].totalVideoFrames+=u):c[i]={droppedVideoFrames:l,totalVideoFrames:u})}},getFrameHistory:function(t){return e[t]},clearForStream:function(r){try{delete e[r],delete t[r],delete n[r]}catch(e){}},reset:function(){e={},t={},n={}}}}i.__dashjs_factory_name="DroppedFramesHistory";var a=r.default.getClassFactory(i);t.default=a},"./src/streaming/rules/RulesContext.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js");function i(e){var t=(e=e||{}).abrController,n=e.switchHistory,r=e.droppedFramesHistory,i=e.currentRequest,a=e.useBufferOccupancyABR,s=e.useL2AABR,o=e.useLoLPABR,l=e.streamProcessor?e.streamProcessor.getScheduleController():null,u=e.streamProcessor?e.streamProcessor.getRepresentationInfo():null,c=e.videoModel?e.videoModel:null;function d(){return u?u.mediaInfo:null}return{getMediaType:function(){var e=d();return e?e.type:null},getMediaInfo:d,getDroppedFramesHistory:function(){return r},getCurrentRequest:function(){return i},getSwitchHistory:function(){return n},getStreamInfo:function(){var e=d();return e?e.streamInfo:null},getScheduleController:function(){return l},getAbrController:function(){return t},getRepresentationInfo:function(){return u},useBufferOccupancyABR:function(){return a},useL2AABR:function(){return s},useLoLPABR:function(){return o},getVideoModel:function(){return c}}}i.__dashjs_factory_name="RulesContext",t.default=r.default.getClassFactory(i)},"./src/streaming/rules/SwitchRequest.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i={DEFAULT:.5,STRONG:1,WEAK:0};function a(e,t,n){var r,a;return r=void 0===e?-1:e,a=function(e){var t=i.DEFAULT;return e!==i.DEFAULT&&e!==i.STRONG&&e!==i.WEAK||(t=e),t}(n),{quality:r,reason:void 0===t?null:t,priority:a}}a.__dashjs_factory_name="SwitchRequest";var s=r.default.getClassFactory(a);s.NO_CHANGE=-1,s.PRIORITY=i,r.default.updateClassFactory(a.__dashjs_factory_name,s),t.default=s},"./src/streaming/rules/SwitchRequestHistory.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/streaming/rules/SwitchRequest.js");function a(){var e=[],t=[];return{push:function(n){n.newValue===i.default.NO_CHANGE&&(n.newValue=n.oldValue),e[n.oldValue]||(e[n.oldValue]={noDrops:0,drops:0,dropSize:0});var r=n.newValue-n.oldValue,a=r<0?1:0,s=a?-r:0,o=a?0:1;if(e[n.oldValue].drops+=a,e[n.oldValue].dropSize+=s,e[n.oldValue].noDrops+=o,t.push({idx:n.oldValue,noDrop:o,drop:a,dropSize:s}),t.length>8){var l=t.shift();e[l.idx].drops-=l.drop,e[l.idx].dropSize-=l.dropSize,e[l.idx].noDrops-=l.noDrop}},getSwitchRequests:function(){return e},reset:function(){e=[],t=[]}}}a.__dashjs_factory_name="SwitchRequestHistory";var s=r.default.getClassFactory(a);t.default=s},"./src/streaming/rules/ThroughputHistory.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/core/FactoryMaker.js");function a(e){var t,n,i,a,s,o=3,l=4,u=4,c=1.3,d=1.3,f=(e=e||{}).settings;function h(e,t,n,r){var i=Math.pow(.5,n/r.fast);e.fastEstimate=(1-i)*t+i*e.fastEstimate;var a=Math.pow(.5,n/r.slow);e.slowEstimate=(1-a)*t+a*e.slowEstimate,e.totalWeight+=n}function p(e,h,p){return f.get().streaming.abr.movingAverageMethod!==r.default.MOVING_AVERAGE_SLIDING_WINDOW?function(e,t){var n=e?s.throughputHalfLife:s.latencyHalfLife,r=e?i[t]:a[t];if(!r||r.totalWeight<=0)return NaN;var o=r.fastEstimate/(1-Math.pow(.5,r.totalWeight/n.fast)),l=r.slowEstimate/(1-Math.pow(.5,r.totalWeight/n.slow));return e?Math.min(o,l):Math.max(o,l)}(e,h):function(e,r,i){var a=function(e,r,i){var a,s;if(e?(a=t[r],s=i?o:l):(a=n[r],s=u),a){if(s>=a.length)s=a.length;else if(e)for(var f=1;f<s;++f){var h=a[a.length-f]/a[a.length-f-1];if((h>=d||h<=1/c)&&(s+=1)===a.length)break}}else s=0;return s}(e,r,i),s=(e?t:n)[r];return 0!==a&&s&&0!==s.length?(s=s.slice(-a)).reduce((function(e,t){return e+t}))/s.length:NaN}(e,h,p)}function g(e,t){return p(!0,e,t)}function m(e){t[e]=t[e]||[],n[e]=n[e]||[],i[e]=i[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0},a[e]=a[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0}}function y(){t={},n={},i={},a={}}var v={push:function(e,o,l){if(o.trace&&o.trace.length){var u=o.tresponse.getTime()-o.trequest.getTime()||1,c=o._tfinish.getTime()-o.tresponse.getTime()||1,d=o.trace.reduce((function(e,t){return e+t.b[0]}),0),p=0,g=0;if(f.get().streaming.lowLatencyEnabled){if(f.get().streaming.abr.fetchThroughputCalculationMode===r.default.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING){var y=o.trace.reduce((function(e,t){return e+t.t}),0);g=Math.round(y/o.trace.length)}0===g&&(p=o.trace.reduce((function(e,t){return e+t.d}),0))}else p=l?c:u+c;if(0!==p&&(g=Math.round(8*d/p)),m(e),function(e,t,n){return e===r.default.VIDEO?n<f.get().streaming.cacheLoadThresholds[r.default.VIDEO]:e===r.default.AUDIO?n<f.get().streaming.cacheLoadThresholds[r.default.AUDIO]:void 0}(e,0,c)){if(t[e].length>0&&!t[e].hasCachedEntries)return;t[e].hasCachedEntries=!0}else t[e]&&t[e].hasCachedEntries&&function(e){delete t[e],delete n[e],delete i[e],delete a[e],m(e)}(e);t[e].push(g),t[e].length>20&&t[e].shift(),n[e].push(u),n[e].length>20&&n[e].shift(),h(i[e],g,.001*c,s.throughputHalfLife),h(a[e],u,1,s.latencyHalfLife)}},getAverageThroughput:g,getSafeAverageThroughput:function(e,t){var n=g(e,t);return isNaN(n)||(n*=f.get().streaming.abr.bandwidthSafetyFactor),n},getAverageLatency:function(e){return p(!1,e)},reset:y};return s={throughputHalfLife:{fast:3,slow:8},latencyHalfLife:{fast:1,slow:2}},y(),v}a.__dashjs_factory_name="ThroughputHistory",t.default=i.default.getClassFactory(a)},"./src/streaming/rules/abr/ABRRulesCollection.js":function(e,t,n){n.r(t);var r=n("./src/streaming/rules/abr/ThroughputRule.js"),i=n("./src/streaming/rules/abr/InsufficientBufferRule.js"),a=n("./src/streaming/rules/abr/AbandonRequestsRule.js"),s=n("./src/streaming/rules/abr/DroppedFramesRule.js"),o=n("./src/streaming/rules/abr/SwitchHistoryRule.js"),l=n("./src/streaming/rules/abr/BolaRule.js"),u=n("./src/streaming/rules/abr/L2ARule.js"),c=n("./src/streaming/rules/abr/lolp/LoLpRule.js"),d=n("./src/core/FactoryMaker.js"),f=n("./src/streaming/rules/SwitchRequest.js"),h=n("./src/streaming/constants/Constants.js"),p="qualitySwitchRules",g="abandonFragmentRules";function m(e){e=e||{};var t,n,d=this.context,m=e.mediaPlayerModel,y=e.dashMetrics,v=e.settings;function _(e){return e.filter((function(e){return e.quality>f.default.NO_CHANGE}))}function T(e){var t,n,r,i,a,s={},o=null;if(0!==e.length){for(s[f.default.PRIORITY.STRONG]={quality:f.default.NO_CHANGE,reason:null},s[f.default.PRIORITY.WEAK]={quality:f.default.NO_CHANGE,reason:null},s[f.default.PRIORITY.DEFAULT]={quality:f.default.NO_CHANGE,reason:null},t=0,n=e.length;t<n;t+=1)(r=e[t]).quality!==f.default.NO_CHANGE&&(s[r.priority].quality===f.default.NO_CHANGE||s[r.priority].quality>r.quality)&&(s[r.priority].quality=r.quality,s[r.priority].reason=r.reason||null);return s[f.default.PRIORITY.WEAK].quality!==f.default.NO_CHANGE&&(o=s[f.default.PRIORITY.WEAK]),s[f.default.PRIORITY.DEFAULT].quality!==f.default.NO_CHANGE&&(o=s[f.default.PRIORITY.DEFAULT]),s[f.default.PRIORITY.STRONG].quality!==f.default.NO_CHANGE&&(o=s[f.default.PRIORITY.STRONG]),o&&(i=o.quality,a=o.reason),Object(f.default)(d).create(i,a)}}return{initialize:function(){t=[],n=[],v.get().streaming.abr.useDefaultABRRules&&(v.get().streaming.abr.ABRStrategy===h.default.ABR_STRATEGY_L2A?t.push(Object(u.default)(d).create({dashMetrics:y,mediaPlayerModel:m,settings:v})):v.get().streaming.abr.ABRStrategy===h.default.ABR_STRATEGY_LoLP?t.push(Object(c.default)(d).create({dashMetrics:y})):(t.push(Object(l.default)(d).create({dashMetrics:y,mediaPlayerModel:m,settings:v})),t.push(Object(r.default)(d).create({dashMetrics:y})),v.get().streaming.abr.additionalAbrRules.insufficientBufferRule&&t.push(Object(i.default)(d).create({dashMetrics:y,settings:v})),v.get().streaming.abr.additionalAbrRules.switchHistoryRule&&t.push(Object(o.default)(d).create()),v.get().streaming.abr.additionalAbrRules.droppedFramesRule&&t.push(Object(s.default)(d).create()),v.get().streaming.abr.additionalAbrRules.abandonRequestsRule&&n.push(Object(a.default)(d).create({dashMetrics:y,mediaPlayerModel:m,settings:v})))),m.getABRCustomRules().forEach((function(e){e.type===p&&t.push(e.rule(d).create()),e.type===g&&n.push(e.rule(d).create())}))},reset:function(){[t,n].forEach((function(e){e&&e.length&&e.forEach((function(e){return e.reset&&e.reset()}))})),t=[],n=[]},getMaxQuality:function(e){return T(_(t.map((function(t){return t.getMaxIndex(e)}))))||Object(f.default)(d).create()},getMinSwitchRequest:T,shouldAbandonFragment:function(e,t){return T(_(n.map((function(n){return n.shouldAbandon(e,t)}))))||Object(f.default)(d).create()},getQualitySwitchRules:function(){return t}}}m.__dashjs_factory_name="ABRRulesCollection";var y=d.default.getClassFactory(m);y.QUALITY_SWITCH_RULES=p,y.ABANDON_FRAGMENT_RULES=g,d.default.updateSingletonFactory(m.__dashjs_factory_name,y),t.default=y},"./src/streaming/rules/abr/AbandonRequestsRule.js":function(e,t,n){n.r(t);var r=n("./src/streaming/rules/SwitchRequest.js"),i=n("./src/core/FactoryMaker.js"),a=n("./src/core/Debug.js");function s(e){e=e||{};var t,n,i,o,l,u=this.context,c=e.mediaPlayerModel,d=e.dashMetrics,f=e.settings;function h(){i={},o={},l=[]}return t={shouldAbandon:function(e){var t=Object(r.default)(u).create(r.default.NO_CHANGE,{name:s.__dashjs_factory_name});if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getCurrentRequest")&&e.hasOwnProperty("getRepresentationInfo")&&e.hasOwnProperty("getAbrController")))return t;var a,h,p=e.getMediaInfo(),g=e.getMediaType(),m=e.getStreamInfo(),y=m?m.id:null,v=e.getCurrentRequest();if(!isNaN(v.index)){a=g,h=v.index,i[a]=i[a]||{},i[a][h]=i[a][h]||{};var _=c.getStableBufferTime();if(d.getCurrentBufferLevel(g)>_)return t;var T=i[g][v.index];if(null===T||null===v.firstByteDate||o.hasOwnProperty(T.id))return t;if(void 0===T.firstByteTime&&(l[g]=[],T.firstByteTime=v.firstByteDate.getTime(),T.segmentDuration=v.duration,T.bytesTotal=v.bytesTotal,T.id=v.index),T.bytesLoaded=v.bytesLoaded,T.elapsedTime=(new Date).getTime()-T.firstByteTime,T.bytesLoaded>0&&T.elapsedTime>0&&function(e,t){l[e]=l[e]||[],l[e].push(t)}(g,Math.round(8*T.bytesLoaded/T.elapsedTime)),l[g].length>=5&&T.elapsedTime>500&&T.bytesLoaded<T.bytesTotal){var E=l[g].reduce((function(e,t){return e+t}),0);if(T.measuredBandwidthInKbps=Math.round(E/l[g].length),T.estimatedTimeOfDownload=+(8*T.bytesTotal/T.measuredBandwidthInKbps/1e3).toFixed(2),T.estimatedTimeOfDownload<1.8*T.segmentDuration||0===e.getRepresentationInfo().quality)return t;if(!o.hasOwnProperty(T.id)){var b=e.getAbrController(),S=T.bytesTotal-T.bytesLoaded,A=b.getBitrateList(p),w=b.getQualityForBitrate(p,T.measuredBandwidthInKbps*f.get().streaming.abr.bandwidthSafetyFactor,y),I=b.getMinAllowedIndexFor(g,y),C=void 0!==I?Math.max(I,w):w;S>T.bytesTotal*A[C].bitrate/A[b.getQualityFor(g,y)].bitrate&&(t.quality=C,t.reason.throughput=T.measuredBandwidthInKbps,t.reason.fragmentID=T.id,o[T.id]=T,n.debug("["+g+"] frag id",T.id," is asking to abandon and switch to quality to ",C," measured bandwidth was",T.measuredBandwidthInKbps),delete i[g][T.id])}}else T.bytesLoaded===T.bytesTotal&&delete i[g][T.id]}return t},reset:h},n=Object(a.default)(u).getInstance().getLogger(t),h(),t}s.__dashjs_factory_name="AbandonRequestsRule",t.default=i.default.getClassFactory(s)},"./src/streaming/rules/abr/BolaRule.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/MetricsConstants.js"),i=n("./src/streaming/rules/SwitchRequest.js"),a=n("./src/core/FactoryMaker.js"),s=n("./src/streaming/vo/metrics/HTTPRequest.js"),o=n("./src/core/EventBus.js"),l=n("./src/core/events/Events.js"),u=n("./src/core/Debug.js"),c=n("./src/streaming/MediaPlayerEvents.js"),d=10;function f(e){e=e||{};var t,n,a,f=this.context,h=e.dashMetrics,p=e.mediaPlayerModel,g=Object(o.default)(f).getInstance();function m(e,t,n){var r=n.reduce((function(e,t,r){return t>n[e]?r:e}),0);if(0===r)return null;var i=Math.max(e,d+2*t.length),a=(n[r]-1)/(i/d-1);return{gp:a,Vp:d/a}}function y(e){var t={},n=e.getMediaInfo().bitrateList.map((function(e){return e.bandwidth})),r=function(e){return e.map((function(e){return Math.log(e)}))}(n);r=r.map((function(e){return e-r[0]+1}));var i=p.getStableBufferTime(),a=m(i,n,r);return a?(t.state=1,t.bitrates=n,t.utilities=r,t.stableBufferTime=i,t.Vp=a.Vp,t.gp=a.gp,t.lastQuality=0,v(t)):t.state=0,t}function v(e){e.placeholderBuffer=0,e.mostAdvancedSegmentStart=NaN,e.lastSegmentWasReplacement=!1,e.lastSegmentStart=NaN,e.lastSegmentDurationS=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN}function _(e,t){var n=p.getStableBufferTime();if(e.stableBufferTime!==n){var r=m(n,e.bitrates,e.utilities);if(r.Vp!==e.Vp||r.gp!==e.gp){var i=h.getCurrentBufferLevel(t),a=i+e.placeholderBuffer;a-=d,a*=r.Vp/e.Vp,a+=d,e.stableBufferTime=n,e.Vp=r.Vp,e.gp=r.gp,e.placeholderBuffer=Math.max(0,a-i)}}}function T(e,t){return e.Vp*(e.utilities[t]+e.gp)}function E(e,t){for(var n=e.bitrates[t],r=e.utilities[t],i=0,a=t-1;a>=0;--a)if(e.utilities[a]<e.utilities[t]){var s=e.bitrates[a],o=e.utilities[a],l=e.Vp*(e.gp+(n*o-s*r)/(n-s));i=Math.max(i,l)}return i}function b(){for(var e in a)a.hasOwnProperty(e)&&2===a[e].state&&(a[e].placeholderBuffer=0)}function S(){for(var e in a)if(a.hasOwnProperty(e)){var t=a[e];0!==t.state&&(t.state=1,v(t))}}function A(e){if(e&&e.chunk&&e.chunk.mediaInfo){var t=a[e.chunk.mediaInfo.type];if(t&&0!==t.state){var n=e.chunk.start;isNaN(t.mostAdvancedSegmentStart)||n>t.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=n,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=n,t.lastSegmentDurationS=e.chunk.duration,t.lastQuality=e.chunk.quality,I(t,e.chunk.mediaInfo.type)}}}function w(e){if(e&&e.metric===r.default.HTTP_REQUEST&&e.value&&e.value.type===s.HTTPRequest.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){var t=a[e.mediaType];t&&0!==t.state&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),I(t,e.mediaType))}}function I(e,t){if(!isNaN(e.lastSegmentStart)&&!isNaN(e.lastSegmentRequestTimeMs)&&!isNaN(e.placeholderBuffer)){if(e.placeholderBuffer*=.99,!isNaN(e.lastSegmentFinishTimeMs)){var n=h.getCurrentBufferLevel(t)+.001*(e.lastSegmentFinishTimeMs-e.lastSegmentRequestTimeMs),r=T(e,e.lastQuality),i=Math.max(0,r-n);e.placeholderBuffer=Math.min(i,e.placeholderBuffer)}e.lastSegmentWasReplacement&&!isNaN(e.lastSegmentDurationS)&&(e.placeholderBuffer+=e.lastSegmentDurationS),e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN}}function C(e){if(e){var t=a[e.mediaType];t&&0!==t.state&&(t.abrQuality=e.newQuality)}}function R(e){if(e){var t=a[e.mediaType];if(t&&0!==t.state){var n,r=h.getCurrentBufferLevel(e.mediaType);n=t.abrQuality>0?E(t,t.abrQuality):d;var i=Math.max(0,n-r);t.placeholderBuffer=Math.min(t.placeholderBuffer,i)}}}function D(){a={}}return t={getMaxIndex:function(e){var t=Object(i.default)(f).create();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getScheduleController")&&e.hasOwnProperty("getStreamInfo")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("useBufferOccupancyABR")))return t;var r=e.getMediaInfo(),s=e.getMediaType(),o=e.getScheduleController(),l=e.getStreamInfo(),u=e.getAbrController(),c=u.getThroughputHistory(),d=l?l.id:null,p=l&&l.manifestInfo&&l.manifestInfo.isDynamic,g=e.useBufferOccupancyABR();if(t.reason=t.reason||{},!g)return t;o.setTimeToLoadDelay(0);var m=function(e){var t=e.getMediaType(),n=a[t];return n?0!==n.state&&_(n,t):(n=y(e),a[t]=n),n}(e);if(0===m.state)return t;var b,S=h.getCurrentBufferLevel(s),A=c.getAverageThroughput(s,p),w=c.getSafeAverageThroughput(s,p),I=c.getAverageLatency(s);if(t.reason.state=m.state,t.reason.throughput=A,t.reason.latency=I,isNaN(A))return t;switch(m.state){case 1:b=u.getQualityForBitrate(r,w,d,I),t.quality=b,t.reason.throughput=w,m.placeholderBuffer=Math.max(0,E(m,b)-S),m.lastQuality=b,!isNaN(m.lastSegmentDurationS)&&S>=m.lastSegmentDurationS&&(m.state=2);break;case 2:!function(e,t){var n=Date.now();if(isNaN(e.lastSegmentFinishTimeMs)){if(!isNaN(e.lastCallTimeMs)){var r=.001*(n-e.lastCallTimeMs);e.placeholderBuffer+=Math.max(0,r)}}else{var i=.001*(n-e.lastSegmentFinishTimeMs);e.placeholderBuffer+=Math.max(0,i)}e.lastCallTimeMs=n,e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN,_(e,t)}(m,s),b=function(e,t){for(var n=e.bitrates.length,r=NaN,i=NaN,a=0;a<n;++a){var s=(e.Vp*(e.utilities[a]+e.gp)-t)/e.bitrates[a];(isNaN(i)||s>=i)&&(i=s,r=a)}return r}(m,S+m.placeholderBuffer);var C=u.getQualityForBitrate(r,w,d,I);b>m.lastQuality&&b>C&&(b=Math.max(C,m.lastQuality));var R=Math.max(0,S+m.placeholderBuffer-T(m,b));R<=m.placeholderBuffer?(m.placeholderBuffer-=R,R=0):(R-=m.placeholderBuffer,m.placeholderBuffer=0,b<u.getMaxAllowedIndexFor(s,d)?o.setTimeToLoadDelay(1e3*R):R=0),t.quality=b,t.reason.throughput=A,t.reason.latency=I,t.reason.bufferLevel=S,t.reason.placeholderBuffer=m.placeholderBuffer,t.reason.delay=R,m.lastQuality=b;break;default:n.debug("BOLA ABR rule invoked in bad state."),t.quality=u.getQualityForBitrate(r,w,d,I),t.reason.state=m.state,t.reason.throughput=w,t.reason.latency=I,m.state=1,v(m)}return t},reset:function(){D(),g.off(c.default.BUFFER_EMPTY,b,t),g.off(c.default.PLAYBACK_SEEKING,S,t),g.off(c.default.METRIC_ADDED,w,t),g.off(c.default.QUALITY_CHANGE_REQUESTED,C,t),g.off(c.default.FRAGMENT_LOADING_ABANDONED,R,t),g.off(l.default.MEDIA_FRAGMENT_LOADED,A,t)}},n=Object(u.default)(f).getInstance().getLogger(t),D(),g.on(c.default.BUFFER_EMPTY,b,t),g.on(c.default.PLAYBACK_SEEKING,S,t),g.on(c.default.METRIC_ADDED,w,t),g.on(c.default.QUALITY_CHANGE_REQUESTED,C,t),g.on(c.default.FRAGMENT_LOADING_ABANDONED,R,t),g.on(l.default.MEDIA_FRAGMENT_LOADED,A,t),t}f.__dashjs_factory_name="BolaRule",t.default=a.default.getClassFactory(f)},"./src/streaming/rules/abr/DroppedFramesRule.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/streaming/rules/SwitchRequest.js"),a=n("./src/core/Debug.js");function s(){var e,t,n=this.context;return e={getMaxIndex:function(e){var r=Object(i.default)(n).create();if(!e||!e.hasOwnProperty("getDroppedFramesHistory"))return r;var a=e.getDroppedFramesHistory(),s=e.getStreamInfo().id;if(a){var o=a.getFrameHistory(s);if(!o||0===o.length)return r;for(var l=0,u=0,c=i.default.NO_CHANGE,d=1;d<o.length;d++)if(o[d]&&(l=o[d].droppedVideoFrames,(u=o[d].totalVideoFrames)>375&&l/u>.15)){c=d-1,t.debug("index: "+c+" Dropped Frames: "+l+" Total Frames: "+u);break}return Object(i.default)(n).create(c,{droppedFrames:l})}return r}},t=Object(a.default)(n).getInstance().getLogger(e),e}s.__dashjs_factory_name="DroppedFramesRule",t.default=r.default.getClassFactory(s)},"./src/streaming/rules/abr/InsufficientBufferRule.js":function(e,t,n){n.r(t);var r=n("./src/core/EventBus.js"),i=n("./src/core/events/Events.js"),a=n("./src/core/FactoryMaker.js"),s=n("./src/core/Debug.js"),o=n("./src/streaming/rules/SwitchRequest.js"),l=n("./src/streaming/constants/Constants.js"),u=n("./src/streaming/constants/MetricsConstants.js"),c=n("./src/streaming/MediaPlayerEvents.js");function d(e){e=e||{};var t,n,a,d=2,f=this.context,h=Object(r.default)(f).getInstance(),p=e.dashMetrics,g=e.settings;function m(){(a={})[l.default.VIDEO]={ignoreCount:d},a[l.default.AUDIO]={ignoreCount:d}}function y(){m()}function v(e){isNaN(e.startTime)||e.mediaType!==l.default.AUDIO&&e.mediaType!==l.default.VIDEO||a[e.mediaType].ignoreCount>0&&a[e.mediaType].ignoreCount--}return t={getMaxIndex:function(e){var t=Object(o.default)(f).create();if(!e||!e.hasOwnProperty("getMediaType"))return t;!function(){if(!p||!p.hasOwnProperty("getCurrentBufferLevel")||!p.hasOwnProperty("getCurrentBufferState"))throw new Error(l.default.MISSING_CONFIG_ERROR)}();var r=e.getMediaType(),i=p.getCurrentBufferState(r),s=e.getRepresentationInfo().fragmentDuration,c=e.getStreamInfo(),d=c?c.id:null,h=c&&c.manifestInfo&&c.manifestInfo.isDynamic;if(function(e){return!g.get().streaming.lowLatencyEnabled&&a[e].ignoreCount>0}(r)||!s)return t;if(i&&i.state===u.default.BUFFER_EMPTY)n.debug("["+r+"] Switch to index 0; buffer is empty."),t.quality=0,t.reason="InsufficientBufferRule: Buffer is empty";else{var m=e.getMediaInfo(),y=e.getAbrController(),v=y.getThroughputHistory(),_=p.getCurrentBufferLevel(r),T=v.getAverageThroughput(r,h),E=v.getAverageLatency(r),b=T*(_/s)*.5;t.quality=y.getQualityForBitrate(m,b,d,E),t.reason="InsufficientBufferRule: being conservative to avoid immediate rebuffering"}return t},reset:function(){m(),h.off(c.default.PLAYBACK_SEEKING,y,t),h.off(i.default.BYTES_APPENDED_END_FRAGMENT,v,t)}},n=Object(s.default)(f).getInstance().getLogger(t),m(),h.on(c.default.PLAYBACK_SEEKING,y,t),h.on(i.default.BYTES_APPENDED_END_FRAGMENT,v,t),t}d.__dashjs_factory_name="InsufficientBufferRule",t.default=a.default.getClassFactory(d)},"./src/streaming/rules/abr/L2ARule.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/MetricsConstants.js"),i=n("./src/streaming/rules/SwitchRequest.js"),a=n("./src/core/FactoryMaker.js"),s=n("./src/streaming/vo/metrics/HTTPRequest.js"),o=n("./src/core/EventBus.js"),l=n("./src/core/events/Events.js"),u=n("./src/core/Debug.js"),c=n("./src/streaming/constants/Constants.js");function d(e){e=e||{};var t,n,a,d,f=this.context,h=e.dashMetrics,p=Object(o.default)(f).getInstance();function g(e){var t={},n=e.getMediaInfo(),r=n.bitrateList.map((function(e){return e.bandwidth/1e3}));return t.state=1,t.bitrates=r,t.lastQuality=0,function(e){e&&e.type&&(a[e.type]={},a[e.type].w=[],a[e.type].prev_w=[],a[e.type].Q=0,a[e.type].segment_request_start_s=0,a[e.type].segment_download_finish_s=0,a[e.type].B_target=1.5)}(n),m(t),t}function m(e){e.placeholderBuffer=0,e.mostAdvancedSegmentStart=NaN,e.lastSegmentWasReplacement=!1,e.lastSegmentStart=NaN,e.lastSegmentDurationS=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN}function y(){for(var e in n)if(n.hasOwnProperty(e)){var t=n[e];0!==t.state&&(t.state=1,m(t))}}function v(e){if(e&&e.chunk&&e.chunk.mediaInfo){var t=n[e.chunk.mediaInfo.type],r=a[e.chunk.mediaInfo.type];if(t&&0!==t.state){var i=e.chunk.start;isNaN(t.mostAdvancedSegmentStart)||i>t.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=i,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=i,t.lastSegmentDurationS=e.chunk.duration,t.lastQuality=e.chunk.quality,T(t,r)}}}function _(e){if(e&&e.metric===r.default.HTTP_REQUEST&&e.value&&e.value.type===s.HTTPRequest.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){var t=n[e.mediaType],i=a[e.mediaType];t&&0!==t.state&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),T(t,i))}}function T(e,t){isNaN(e.lastSegmentStart)||isNaN(e.lastSegmentRequestTimeMs)||(t.segment_request_start_s=.001*e.lastSegmentRequestTimeMs,t.segment_download_finish_s=.001*e.lastSegmentFinishTimeMs,e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN)}function E(e){if(e&&e.mediaType){var t=n[e.mediaType];t&&0!==t.state&&(t.abrQuality=e.newQuality)}}function b(e,t){if(e.length!==t.length)return-1;for(var n=0,r=0;r<e.length;r++)n+=e[r]*t[r];return n}function S(){n={},a={}}return t={getMaxIndex:function(e){var t,r=Object(i.default)(f).create(),s=Math.pow(4,.99),o=Math.max(Math.pow(4,1),s*Math.sqrt(4)),l=e.getMediaInfo(),u=e.getMediaType(),p=l.bitrateList.map((function(e){return e.bandwidth})),y=p.length,v=e.getScheduleController(),_=e.getStreamInfo(),T=e.getAbrController(),E=T.getThroughputHistory(),S=_&&_.manifestInfo&&_.manifestInfo.isDynamic,A=e.useL2AABR(),w=h.getCurrentBufferLevel(u,!0),I=E.getSafeAverageThroughput(u,S),C=E.getAverageThroughput(u,S),R=E.getAverageLatency(u),D=e.getVideoModel().getPlaybackRate();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getScheduleController")&&e.hasOwnProperty("getStreamInfo")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("useL2AABR")))return r;if(r.reason=r.reason||{},!A||u===c.default.AUDIO)return r;v.setTimeToLoadDelay(0);var N=function(e){var t=e.getMediaType(),r=n[t];return r||(r=g(e),n[t]=r),r}(e);if(0===N.state)return r;var O=a[u];if(!O)return r;if(r.reason.state=N.state,r.reason.throughput=C,r.reason.latency=R,isNaN(C))return r;switch(N.state){case 1:if(t=T.getQualityForBitrate(l,I,_.id,R),r.quality=t,r.reason.throughput=I,N.lastQuality=t,!isNaN(N.lastSegmentDurationS)&&w>=O.B_target){N.state=2,O.Q=s;for(var P=0;P<y;++P)P===N.lastQuality?O.prev_w[P]=1:O.prev_w[P]=0}break;case 2:var M=[],x=h.getCurrentHttpRequest(u).trace.reduce((function(e,t){return e+t.d}),0),L=h.getCurrentHttpRequest(u).trace.reduce((function(e,t){return e+t.b[0]}),0),k=Math.round(8*L/x);k<1&&(k=1);for(var F=N.lastSegmentDurationS,U=1,B=0;B<y;++B)p[B]=p[B]/1e3,D*p[B]>k&&(U=-1),O.w[B]=O.prev_w[B]+U*(F/(2*o))*((O.Q+s)*(D*p[B]/k));O.w=function(e){for(var t=e.length,n=!1,r=[],i=0;i<t;++i)r[i]=e[i];for(var a=e.sort((function(e,t){return t-e})),s=0,o=0,l=[],u=0;u<t-1;++u)if((o=((s+=a[u])-1)/(u+1))>=a[u+1]){n=!0;break}n||(o=(s+a[t-1]-1)/t);for(var c=0;c<t;++c)l[c]=Math.max(r[c]-o,0);return l}(O.w);for(var j=0;j<y;++j)M[j]=O.w[j]-O.prev_w[j],O.prev_w[j]=O.w[j];O.Q=Math.max(0,O.Q-F+F*D*((b(p,O.prev_w)+b(p,M))/k));for(var q=[],H=0;H<y;++H)q[H]=Math.abs(p[H]-b(O.w,p));(t=q.indexOf(Math.min.apply(Math,q)))>N.lastQuality&&p[N.lastQuality+1]<=k&&(t=N.lastQuality+1),p[t]>=k&&(O.Q=2*Math.max(s,O.Q)),r.quality=t,r.reason.throughput=C,r.reason.latency=R,r.reason.bufferLevel=w,N.lastQuality=r.quality;break;default:d.debug("L2A ABR rule invoked in bad state."),r.quality=T.getQualityForBitrate(l,I,_.id,R),r.reason.state=N.state,r.reason.throughput=I,r.reason.latency=R,N.state=1,m(N)}return r},reset:function(){S(),p.off(l.default.PLAYBACK_SEEKING,y,t),p.off(l.default.MEDIA_FRAGMENT_LOADED,v,t),p.off(l.default.METRIC_ADDED,_,t),p.off(l.default.QUALITY_CHANGE_REQUESTED,E,t)}},d=Object(u.default)(f).getInstance().getLogger(t),S(),p.on(l.default.PLAYBACK_SEEKING,y,t),p.on(l.default.MEDIA_FRAGMENT_LOADED,v,t),p.on(l.default.METRIC_ADDED,_,t),p.on(l.default.QUALITY_CHANGE_REQUESTED,E,t),t}d.__dashjs_factory_name="L2ARule",t.default=a.default.getClassFactory(d)},"./src/streaming/rules/abr/SwitchHistoryRule.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/core/Debug.js"),a=n("./src/streaming/rules/SwitchRequest.js");function s(){var e,t,n=this.context;return e={getMaxIndex:function(e){for(var r=e?e.getSwitchHistory():null,i=r?r.getSwitchRequests():[],s=0,o=0,l=0,u=Object(a.default)(n).create(),c=0;c<i.length;c++)if(void 0!==i[c]&&(s+=i[c].drops,o+=i[c].noDrops,l+=i[c].dropSize,s+o>=6&&s/o>.075)){u.quality=c>0&&i[c].drops>0?c-1:c,u.reason={index:u.quality,drops:s,noDrops:o,dropSize:l},t.debug("Switch history rule index: "+u.quality+" samples: "+(s+o)+" drops: "+s);break}return u}},t=Object(i.default)(n).getInstance().getLogger(e),e}s.__dashjs_factory_name="SwitchHistoryRule",t.default=r.default.getClassFactory(s)},"./src/streaming/rules/abr/ThroughputRule.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/streaming/rules/SwitchRequest.js"),a=n("./src/streaming/constants/Constants.js"),s=n("./src/streaming/constants/MetricsConstants.js");function o(e){e=e||{};var t=this.context,n=e.dashMetrics;return{getMaxIndex:function(e){var r=Object(i.default)(t).create();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("useBufferOccupancyABR")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("getScheduleController")))return r;!function(){if(!n||!n.hasOwnProperty("getCurrentBufferState"))throw new Error(a.default.MISSING_CONFIG_ERROR)}();var o=e.getMediaInfo(),l=e.getMediaType(),u=n.getCurrentBufferState(l),c=e.getScheduleController(),d=e.getAbrController(),f=e.getStreamInfo(),h=f?f.id:null,p=f&&f.manifestInfo?f.manifestInfo.isDynamic:null,g=d.getThroughputHistory(),m=g.getSafeAverageThroughput(l,p),y=g.getAverageLatency(l),v=e.useBufferOccupancyABR();return isNaN(m)||!u||v||d.getAbandonmentStateFor(h,l)!==s.default.ABANDON_LOAD&&(u.state===s.default.BUFFER_LOADED||p)&&(r.quality=d.getQualityForBitrate(o,m,h,y),c.setTimeToLoadDelay(0),r.reason={throughput:m,latency:y}),r},reset:function(){}}}o.__dashjs_factory_name="ThroughputRule",t.default=r.default.getClassFactory(o)},"./src/streaming/rules/abr/lolp/LearningAbrController.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/core/Debug.js"),a="manual_weight_selection",s="random_weight_selection",o="dynamic_weight_selection";function l(){var e,t,n,r,l,u,c,d,f,h=this.context;function p(){n=null,r=1,l=100,u=0,c=null,d=null,f=o}function g(){var e=0;if(n)for(var t=0;t<n.length;t++){var r=n[t];r.state.throughput>e&&(e=r.state.throughput)}return e}function m(e,t,n){var r=e.map((function(e,r){return n[r]*Math.pow(e-t[r],2)})).reduce((function(e,t){return e+t}));return(r<0?-1:1)*Math.sqrt(Math.abs(r))}function y(e,t){return m([e.state.throughput,e.state.latency,e.state.rebuffer,e.state.switch],[t.state.throughput,t.state.latency,t.state.rebuffer,t.state.switch],[1,1,1,1])}function v(e,t,n){for(var r=0;r<t.length;r++){var i=t[r],a=y(i,e);_(i,n,Math.exp(-1*Math.pow(a,2)/(2*Math.pow(.1,2))))}}function _(e,t,n){var r=e.state,i=[.01,.01,.01,.01];r.throughput=r.throughput+(t[0]-r.throughput)*i[0]*n,r.latency=r.latency+(t[1]-r.latency)*i[1]*n,r.rebuffer=r.rebuffer+(t[2]-r.rebuffer)*i[2]*n,r.switch=r.switch+(t[3]-r.switch)*i[3]*n}function T(e,t,n,r,i,a,s){c||(c=d[d.length-1]);var o=e.findWeightVector(t,n,r,i,a,s);null!==o&&-1!==o&&(c=o)}return e={getNextQuality:function(e,i,o,h,p,y,_){var E=o,b=h,S=i,A=function(e){if(!n){n=[];var t=e.bitrateList,i=[];u=t[0].bandwidth,t.forEach((function(e){i.push(e.bandwidth),e.bandwidth<u&&(u=e.bandwidth)})),o=i.map((function(e){return Math.pow(e,2)})).reduce((function(e,t){return e+t})),r=Math.sqrt(o);for(var a=0;a<t.length;a++){var s={qualityIndex:a,bitrate:t[a].bandwidth,state:{throughput:t[a].bandwidth/r,latency:0,rebuffer:0,switch:0}};n.push(s)}d=function(e){var t=[],n=function(e){for(var t=[],n=0;n<e;n++){var r=[Math.random()*g(),Math.random(),Math.random(),Math.random()];t.push(r)}return t}(Math.pow(e.length,2));t.push(n[0]);for(var r=[1,1,1,1],i=1;i<e.length;i++){for(var a=null,s=null,o=0;o<n.length;o++){for(var l=n[o],u=null,c=0;c<t.length;c++){var d=m(l,t[c],r);(null===u||d<u)&&(u=d)}(null===s||u>s)&&(a=l,s=u)}t.push(a)}for(var f=null,h=null,p=0;p<t.length;p++){for(var y=0,v=0;v<t.length;v++)p!==v&&(y+=m(t[p],t[v],r));(null===f||y>f)&&(f=y,h=p)}var _=[];for(_.push(t[h]),t.splice(h,1);t.length>0;){for(var T=null,E=null,b=0;b<t.length;b++){var S=m(_[0],t[b],r);(null===T||S<T)&&(T=S,E=b)}_.push(t[E]),t.splice(E,1)}return _}(n)}var o;return n}(e),w=i/r;w>1&&(w=g()),o/=l,t.debug("getNextQuality called throughput:".concat(w," latency:").concat(o," bufferSize:").concat(h," currentQualityIndex:").concat(y," playbackRate:").concat(p));var I=A[y],C=I.bitrate*_.getSegmentDuration()/S,R=Math.max(0,C-b);if(b-C<_.getMinBuffer())return t.debug("Buffer is low for bitrate= ".concat(I.bitrate," downloadTime=").concat(C," currentBuffer=").concat(b," rebuffer=").concat(R)),function(e,t){var r=0,i=e;if(n)for(var a=0;a<n.length;a++){var s=n[a];s.bitrate<e.bitrate&&s.bitrate>r&&t>s.bitrate&&(r=s.bitrate,i=s)}return i}(I,S).qualityIndex;switch(f){case a:c=[.4,.4,.4,.4];break;case s:!function(e){c=function(e,t){for(var n=[],r=Math.sqrt(2/e),i=0;i<t;i++)n.push(Math.random()*r);return c=n}(e.length,4)}(A);break;default:T(_,A,E,b,R,S,p)}for(var D=null,N=null,O=null,P=0;P<A.length;P++){var M=A[P],x=M.state,L=[x.throughput,x.latency,x.rebuffer,x.switch],k=c.slice(),F=_.getNextBufferWithBitrate(M.bitrate,b,S),U=F<_.getMinBuffer();U&&t.debug("Buffer is low for bitrate=".concat(M.bitrate," downloadTime=").concat(C," currentBuffer=").concat(b," nextBuffer=").concat(F)),(M.bitrate>i-1e4||U)&&M.bitrate!==u&&(k[0]=100);var B=m(L,[w,0,0,0],k);(null===D||B<D)&&(D=B,N=M.qualityIndex,O=M)}var j=Math.abs(I.bitrate-O.bitrate)/r;return v(I,A,[w,o,R,j]),v(O,A,[w,0,0,j]),N},reset:function(){p()}},t=Object(i.default)(h).getInstance().getLogger(e),p(),e}l.__dashjs_factory_name="LearningAbrController",t.default=r.default.getClassFactory(l)},"./src/streaming/rules/abr/lolp/LoLpQoEEvaluator.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/streaming/rules/abr/lolp/QoeInfo.js");function a(){var e,t,n,r,a;function s(){t=null,n=null,r=null,a=null}function o(e,t,n,r){var a=new i.default;return a.type=e,a.weights.bitrateReward=t||1,a.weights.bitrateSwitchPenalty=1,a.weights.rebufferPenalty=n||1e3,a.weights.latencyPenalty=[],a.weights.latencyPenalty.push({threshold:1.1,penalty:.05*r}),a.weights.latencyPenalty.push({threshold:1e8,penalty:.1*n}),a.weights.playbackSpeedPenalty=r||200,a}function l(e,t,n,r,i){i.bitrateWSum+=i.weights.bitrateReward*e,i.lastBitrate&&(i.bitrateSwitchWSum+=i.weights.bitrateSwitchPenalty*Math.abs(e-i.lastBitrate)),i.lastBitrate=e,i.rebufferWSum+=i.weights.rebufferPenalty*t;for(var a=0;a<i.weights.latencyPenalty.length;a++){var s=i.weights.latencyPenalty[a];if(n<=s.threshold){i.latencyWSum+=s.penalty*n;break}}i.playbackSpeedWSum+=i.weights.playbackSpeedPenalty*Math.abs(1-r),i.totalQoe=i.bitrateWSum-i.bitrateSwitchWSum-i.rebufferWSum-i.latencyWSum-i.playbackSpeedWSum}return e={setupPerSegmentQoe:function(e,i,s){t=o("segment",e,i,s),n=e,r=i,a=s},logSegmentMetrics:function(e,n,r,i){t&&l(e,n,r,i,t)},getPerSegmentQoe:function(){return t},calculateSingleUseQoe:function(e,t,i,s){var u=null;return n&&r&&a&&(u=o("segment",n,r,a)),u?(l(e,t,i,s,u),u.totalQoe):0},reset:function(){s()}},s(),e}a.__dashjs_factory_name="LoLpQoeEvaluator",t.default=r.default.getClassFactory(a)},"./src/streaming/rules/abr/lolp/LoLpRule.js":function(e,t,n){n.r(t);var r=n("./src/core/Debug.js"),i=n("./src/core/FactoryMaker.js"),a=n("./src/streaming/rules/abr/lolp/LearningAbrController.js"),s=n("./src/streaming/rules/abr/lolp/LoLpQoEEvaluator.js"),o=n("./src/streaming/rules/SwitchRequest.js"),l=n("./src/streaming/constants/MetricsConstants.js"),u=n("./src/streaming/rules/abr/lolp/LoLpWeightSelector.js"),c=n("./src/streaming/constants/Constants.js");function d(e){var t,n,i,d,f=(e=e||{}).dashMetrics,h=this.context;return n={getMaxIndex:function(e){try{var n=Object(o.default)(h).create(),r=e.getMediaInfo().type,a=e.getAbrController(),s=e.getStreamInfo(),p=a.getQualityFor(r,s.id),g=e.getMediaInfo(),m=f.getCurrentBufferState(r),y=e.getScheduleController(),v=f.getCurrentBufferLevel(r,!0),_=s&&s.manifestInfo?s.manifestInfo.isDynamic:null,T=y.getPlaybackController(),E=T.getCurrentLiveLatency();if(!e.useLoLPABR()||r===c.default.AUDIO)return n;E||(E=0);var b=T.getPlaybackRate(),S=a.getThroughputHistory().getSafeAverageThroughput(r,_);if(t.debug("Throughput ".concat(Math.round(S)," kbps")),isNaN(S)||!m)return n;if(a.getAbandonmentStateFor(s.id,r)===l.default.ABANDON_LOAD)return n;for(var A=g.bitrateList,w=e.getRepresentationInfo().fragmentDuration,I=A[0].bandwidth/1e3,C=A[A.length-1].bandwidth/1e3,R=0;R<A.length;R++){var D=A[R].bandwidth/1e3;D>C?C=D:D<I&&(I=D)}var N=A[p].bandwidth/1e3,O=f.getCurrentHttpRequest(r,!0),P=(O.tresponse.getTime()-O.trequest.getTime())/1e3,M=P>w?P-w:0;d.setupPerSegmentQoe(w,C,I),d.logSegmentMetrics(N,M,E,b);var x=Object(u.default)(h).create({targetLatency:1.5,bufferMin:.3,segmentDuration:w,qoeEvaluator:d});return n.quality=i.getNextQuality(g,1e3*S,E,v,b,p,x),n.reason={throughput:S,latency:E},n.priority=o.default.PRIORITY.STRONG,y.setTimeToLoadDelay(0),n.quality!==p&&console.log("[TgcLearningRule]["+r+"] requesting switch to index: ",n.quality,"Average throughput",Math.round(S),"kbps"),n}catch(e){throw e}},reset:function(){i.reset(),d.reset()}},t=Object(r.default)(h).getInstance().getLogger(n),i=Object(a.default)(h).create(),d=Object(s.default)(h).create(),n}d.__dashjs_factory_name="LoLPRule",t.default=i.default.getClassFactory(d)},"./src/streaming/rules/abr/lolp/LoLpWeightSelector.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js");function i(e){var t,n,r,i,a,s,o,l=e.targetLatency,u=e.bufferMin,c=e.segmentDuration,d=e.qoeEvaluator;function f(){return c}function h(e,t){var n=f();return t>n?e-n:e+n-t}return t={getMinBuffer:function(){return u},getSegmentDuration:f,getNextBufferWithBitrate:function(e,t,n){return h(t,e*c/n)},getNextBuffer:h,findWeightVector:function(e,t,i,a,s,o){var f=null,p=null,g=null,m=Math.abs(t-r);return e.forEach((function(e){n.forEach((function(n){n[0];var r=n[1],a=n[2],y=(n[3],e.bitrate*c/s),v=h(i,y),_=(0===a?10:1/a)*Math.max(1e-5,y-v),T=(0===r?10:1/r)*e.state.latency,E=d.calculateSingleUseQoe(e.bitrate,_,T,o);(null===f||E>f)&&function(e,t,n){return!(e>l+n)&&t>=u}(t,v,m)&&(f=E,p=n,g=e.bitrate)}))})),null===p&&null===g&&(p=-1),r=t,p}},a=4,s=(i=[.2,.4,.6,.8,1]).map((function(e){return[e]})),o=function e(t,n,r){if(r===n)return t;for(var a=t.length,s=0;s<a;s++)for(var o=t.shift(),l=0;l<i.length;l++)t.push(o.concat(i[l]));return e(t,n,r+1)},n=o(s,a,1),r=0,t}i.__dashjs_factory_name="LoLpWeightSelector",t.default=r.default.getClassFactory(i)},"./src/streaming/rules/abr/lolp/QoeInfo.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type=null,this.lastBitrate=null,this.weights={},this.weights.bitrateReward=null,this.weights.bitrateSwitchPenalty=null,this.weights.rebufferPenalty=null,this.weights.latencyPenalty=null,this.weights.playbackSpeedPenalty=null,this.bitrateWSum=0,this.bitrateSwitchWSum=0,this.rebufferWSum=0,this.latencyWSum=0,this.playbackSpeedWSum=0,this.totalQoe=0}},"./src/streaming/text/EmbeddedTextHtmlRender.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js");function i(){var e=0;function t(e){for(var t="",n=0;n<e.length;++n)t+=e[n].uchar;return t.length-t.replace(/^\s+/,"").length}function n(e){return"left: "+3.125*e.x+"%; top: "+6.66*e.y1+"%; width: "+(100-3.125*e.x)+"%; height: "+6.66*Math.max(e.y2-1-e.y1,1)+"%; align-items: flex-start; overflow: visible; -webkit-writing-mode: horizontal-tb;"}function r(e){return"red"===e?"rgb(255, 0, 0)":"green"===e?"rgb(0, 255, 0)":"blue"===e?"rgb(0, 0, 255)":"cyan"===e?"rgb(0, 255, 255)":"magenta"===e?"rgb(255, 0, 255)":"yellow"===e?"rgb(255, 255, 0)":"white"===e?"rgb(255, 255, 255)":"black"===e?"rgb(0, 0, 0)":e}function i(e,t){var n=e.videoHeight/15;return t?"font-size: "+n+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; color: "+(t.foreground?r(t.foreground):"rgb(255, 255, 255)")+"; font-style: "+(t.italics?"italic":"normal")+"; text-decoration: "+(t.underline?"underline":"none")+"; white-space: pre; background-color: "+(t.background?r(t.background):"transparent")+";":"font-size: "+n+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; justify-content: flex-start; text-align: left; color: rgb(255, 255, 255); font-style: normal; white-space: pre; line-height: normal; font-weight: normal; text-decoration: none; width: 100%; display: flex;"}function a(e){return e.replace(/^\s+/g,"")}function s(e){return e.replace(/\s+$/g,"")}return{createHTMLCaptionsFromScreen:function(r,o,l,u){var c,d,f=null,h=!1,p=-1,g={start:o,end:l,spans:[]},m="style_cea608_white_black",y={},v={},_=[];for(c=0;c<15;++c){var T=u.rows[c],E="",b=null;if(!1===T.isEmpty()){var S=t(T.chars);null===f&&(f={x:S,y1:c,y2:c+1,p:[]}),S!==p&&h&&(f.p.push(g),g={start:o,end:l,spans:[]},f.y2=c,f.name="region_"+f.x+"_"+f.y1+"_"+f.y2,!1===y.hasOwnProperty(f.name)?(_.push(f),y[f.name]=f):y[f.name].p.contat(f.p),f={x:S,y1:c,y2:c+1,p:[]});for(var A=0;A<T.chars.length;++A){var w=T.chars[A],I=w.penState;if(null===b||!I.equals(b)){E.trim().length>0&&(g.spans.push({name:m,line:E,row:c}),E="");var C="style_cea608_"+I.foreground+"_"+I.background;I.underline&&(C+="_underline"),I.italics&&(C+="_italics"),v.hasOwnProperty(C)||(v[C]=JSON.parse(JSON.stringify(I))),b=I,m=C}E+=w.uchar}E.trim().length>0&&g.spans.push({name:m,line:E,row:c}),h=!0,p=S}else h=!1,p=-1,f&&(f.p.push(g),g={start:o,end:l,spans:[]},f.y2=c,f.name="region_"+f.x+"_"+f.y1+"_"+f.y2,!1===y.hasOwnProperty(f.name)?(_.push(f),y[f.name]=f):y[f.name].p.contat(f.p),f=null)}f&&(f.p.push(g),f.y2=c+1,f.name="region_"+f.x+"_"+f.y1+"_"+f.y2,!1===y.hasOwnProperty(f.name)?(_.push(f),y[f.name]=f):y[f.name].p.contat(f.p),f=null);var R=[];for(c=0;c<_.length;++c){var D=_[c],N="sub_cea608_"+e++,O=document.createElement("div");O.id=N;var P=n(D);O.style.cssText="position: absolute; margin: 0; display: flex; box-sizing: border-box; pointer-events: none;"+P;var M=document.createElement("div");M.className="paragraph bodyStyle",M.style.cssText=i(r);var x=document.createElement("div");x.className="cueUniWrapper",x.style.cssText="unicode-bidi: normal; direction: ltr;";for(var L=0;L<D.p.length;++L){var k=D.p[L],F=0;for(d=0;d<k.spans.length;++d){var U=k.spans[d];if(U.line.length>0){if(0!==d&&F!=U.row){var B=document.createElement("br");B.className="lineBreak",x.appendChild(B)}var j=!1;F===U.row&&(j=!0),F=U.row;var q=v[U.name],H=document.createElement("span");H.className="spanPadding "+U.name+" customSpanColor",H.style.cssText=i(r,q),0!==d&&j?d===k.spans.length-1?H.textContent=s(U.line):H.textContent=U.line:k.spans.length>1&&d<k.spans.length-1&&U.row===k.spans[d+1].row?H.textContent=a(U.line):H.textContent=U.line.trim(),x.appendChild(H)}}}M.appendChild(x),O.appendChild(M);var G={bodyStyle:["%",90]};for(var V in v)v.hasOwnProperty(V)&&(G[V]=["%",90]);R.push({type:"html",start:o,end:l,cueHTMLElement:O,cueID:N,cellResolution:[32,15],isFromCEA608:!0,fontSize:G,lineHeight:{},linePadding:{}})}return R}}}i.__dashjs_factory_name="EmbeddedTextHtmlRender",t.default=r.default.getSingletonFactory(i)},"./src/streaming/text/NotFragmentedTextBufferController.js":function(e,t,n){n.r(t);var r=n("./src/core/EventBus.js"),i=n("./src/core/events/Events.js"),a=n("./src/core/FactoryMaker.js"),s=n("./src/streaming/utils/InitCache.js"),o=n("./src/streaming/SourceBufferSink.js"),l=n("./src/streaming/vo/DashJSError.js"),u=n("./src/core/errors/Errors.js"),c="NotFragmentedTextBufferController";function d(e){e=e||{};var t,n,a,d,f,h,p=this.context,g=Object(r.default)(p).getInstance(),m=e.textController,y=e.errHandler,v=e.streamInfo,_=e.type;function T(e){d=e}function E(e){var t,r,a;n!==e&&(n=e)&&(t=i.default.BUFFERING_COMPLETED,a=r||{},g.trigger(t,a,{streamId:v.id,mediaType:_}))}function b(e){e.chunk.bytes&&!n&&(h.save(e.chunk),f.append(e.chunk),E(!0))}return t={initialize:function(e){T(e)},getStreamId:function(){return v.id},getType:function(){return _},getBufferControllerType:function(){return c},createBufferSink:function(e){return new Promise((function(t,n){try{(f=Object(o.default)(p).create({mediaSource:d,textController:m,eventBus:g})).initializeForFirstUse(v,e),a||(f.getBuffer()&&"function"==typeof f.getBuffer().initialize&&f.getBuffer().initialize(),a=!0),t(f)}catch(e){y.error(new l.default(u.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,u.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+_)),n(e)}}))},getBuffer:function(){return f},getBufferLevel:function(){return 0},getRangeAt:function(){return null},getAllRangesWithSafetyFactor:function(){return[]},getContinuousBufferTimeForTargetTime:function(){return Number.POSITIVE_INFINITY},setMediaSource:T,getMediaSource:function(){return d},appendInitSegmentFromCache:function(e){return null!==h.extract(v.id,e)},getIsBufferingCompleted:function(){return n},setIsBufferingCompleted:E,getIsPruningInProgress:function(){return!1},reset:function(e){g.off(i.default.INIT_FRAGMENT_LOADED,b,t),!e&&f&&(f.abort(),f.reset(),f=null)},clearBuffers:function(){return Promise.resolve()},prepareForPlaybackSeek:function(){return Promise.resolve()},prepareForReplacementTrackSwitch:function(){return n=!1,Promise.resolve()},setSeekTarget:function(){},updateAppendWindow:function(){return Promise.resolve()},pruneAllSafely:function(){return Promise.resolve()},updateBufferTimestampOffset:function(){return Promise.resolve()},segmentRequestingCompleted:function(){}},a=!1,d=null,n=!1,h=Object(s.default)(p).getInstance(),g.on(i.default.INIT_FRAGMENT_LOADED,b,t),t}d.__dashjs_factory_name=c,t.default=a.default.getClassFactory(d)},"./src/streaming/text/TextController.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/core/FactoryMaker.js"),a=n("./src/streaming/text/TextSourceBuffer.js"),s=n("./src/streaming/text/TextTracks.js"),o=n("./src/streaming/utils/VTTParser.js"),l=n("./src/streaming/utils/TTMLParser.js"),u=n("./src/core/EventBus.js"),c=n("./src/core/events/Events.js"),d=n("./src/streaming/MediaPlayerEvents.js"),f=n("./src/streaming/utils/SupervisorTools.js");function h(e){var t,n,i,h,p,g,m,y,v,_,T,E,b,S=this.context,A=e.adapter,w=e.errHandler,I=e.manifestModel,C=e.mediaController,R=e.videoModel,D=e.settings;function N(e){var t=e.tracks,r=e.index,i=e.streamId;!1===D.get().streaming.text.defaultEnabled&&!P()||b?M(i,-1):(y&&t.some((function(e,t){if(C.matchSettings(y,e))return M(i,t),r=t,!0})),_=!1),n[i].lastEnabledIndex=r,m.trigger(d.default.TEXT_TRACKS_ADDED,{enabled:P(),index:r,tracks:t,streamId:i}),E=!0}function O(e){if(!v&&e&&e.newMediaInfo){var t=e.newMediaInfo;t.type===r.default.TEXT&&(y={lang:t.lang,role:t.roles[0],index:t.index,codec:t.codec,accessibility:t.accessibility[0]})}}function P(){var e=!0;return _&&!T&&(e=!1),e}function M(e,t){(_=-1===t)&&C&&C.saveTextSettingsDisabled();var n=x(e);if(n!==t&&h[e]){h[e].setModeForTrackIdx(n,r.default.TEXT_HIDDEN),h[e].setCurrentTrackIdx(t),h[e].setModeForTrackIdx(t,r.default.TEXT_SHOWING);var a=h[e].getCurrentTrackInfo();a&&a.isFragmented&&!a.isEmbedded?function(e,t,n){if(i[e])for(var a=i[e].getConfig().fragmentedTracks,s=0;s<a.length;s++){var o=a[s];if(t.lang===o.lang&&(o.id?t.id===o.id:t.index===o.index)){var l=C.getCurrentTrackFor(r.default.TEXT,e);(o.id?l.id!==o.id:l.index!==o.index)?(h[e].deleteCuesFromTrackIdx(n),i[e].setCurrentFragmentedTrackIdx(s)):-1===n&&m.trigger(c.default.SET_FRAGMENTED_TEXT_AFTER_DISABLED,{},{streamId:e,mediaType:r.default.TEXT})}}}(e,a,n):a&&!a.isFragmented&&function(e,t){m.trigger(c.default.SET_NON_FRAGMENTED_TEXT,{currentTrackInfo:t},{streamId:e,mediaType:r.default.TEXT})}(e,a),C.setTrack(a)}}function x(e){return h[e].getCurrentTrackIdx()}function L(){i={},h={},n={},_=!0,E=!1,b=!1}return t={deactivateStream:function(e){if(e){var t=e.id;i[t]&&i[t].resetMediaInfos(),h[t]&&h[t].deleteAllTextTracks()}},initialize:function(){m.on(c.default.CURRENT_TRACK_CHANGED,O,t),m.on(c.default.TEXT_TRACKS_QUEUE_INITIALIZED,N,t)},initializeForStream:function(e){var t=e.id,r=Object(s.default)(S).create({videoModel:R,streamInfo:e});r.initialize(),h[t]=r;var o=Object(a.default)(S).create({errHandler:w,adapter:A,manifestModel:I,mediaController:C,videoModel:R,textTracks:r,vttParser:p,ttmlParser:g,streamInfo:e});o.initialize(),i[t]=o,n[t]={},n[t].lastEnabledIndex=-1},createTracks:function(e){var t=e.id;h[t]&&h[t].createTracks()},getTextSourceBuffer:function(e){var t=e.id;if(i&&i[t])return i[t]},getAllTracksAreDisabled:function(){return _},addEmbeddedTrack:function(e,t){var n=e.id;i[n]&&i[n].addEmbeddedTrack(t)},setInitialSettings:function(e){y=e,v=!0},enableText:function(e,t){Object(f.checkParameterType)(t,"boolean"),P()!==t&&(t&&M(e,n[e].lastEnabledIndex),t||(n[e].lastEnabledIndex=x(e),E?M(e,-1):b=!0))},isTextEnabled:P,setTextTrack:M,getCurrentTrackIdx:x,enableForcedTextStreaming:function(e){Object(f.checkParameterType)(e,"boolean"),T=e},addMediaInfosToBuffer:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=e.id;i[a]&&i[a].addMediaInfos(t,n,r)},reset:function(){L(),m.off(c.default.CURRENT_TRACK_CHANGED,O,t),m.off(c.default.TEXT_TRACKS_QUEUE_INITIALIZED,N,t),Object.keys(i).forEach((function(e){i[e].resetEmbedded(),i[e].reset()}))}},y=null,T=!1,E=!1,v=!1,b=!1,p=Object(o.default)(S).getInstance(),g=Object(l.default)(S).getInstance(),m=Object(u.default)(S).getInstance(),L(),t}h.__dashjs_factory_name="TextController",t.default=i.default.getClassFactory(h)},"./src/streaming/text/TextSourceBuffer.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/streaming/vo/metrics/HTTPRequest.js"),a=n("./src/streaming/vo/TextTrackInfo.js"),s=n("./src/streaming/utils/BoxParser.js"),o=n("./src/streaming/utils/CustomTimeRanges.js"),l=n("./src/core/FactoryMaker.js"),u=n("./src/core/Debug.js"),c=n("./src/streaming/text/EmbeddedTextHtmlRender.js"),d=n("./node_modules/codem-isoboxer/dist/iso_boxer.js"),f=n.n(d),h=n("./externals/cea608-parser.js"),p=n.n(h),g=n("./src/core/EventBus.js"),m=n("./src/core/events/Events.js"),y=n("./src/streaming/vo/DashJSError.js"),v=n("./src/core/errors/Errors.js");function _(e){var t,n,l,d,h,_,T,E,b,S,A,w,I,C,R,D,N=e.errHandler,O=e.manifestModel,P=e.mediaController,M=e.videoModel,x=e.textTracks,L=e.vttParser,k=e.ttmlParser,F=e.streamInfo,U=this.context,B=Object(g.default)(U).getInstance(),j=!1;function q(){_=null,E=NaN,b=[],S=null,T=!1,h=[],d=null}function H(e){var t=new a.default;for(var n in e)t[n]=e[n];t.labels=e.labels,t.defaultTrack=function(e){var t=!1;return w.length>1&&e.isEmbedded?t=e.id&&e.id===r.default.CC1:1===w.length?e.id&&"string"==typeof e.id&&"CC"===e.id.substring(0,2)&&(t=!0):0===w.length&&(t=e.index===h[0].index),t}(e),t.isFragmented=e.isFragmented,t.isEmbedded=!!e.isEmbedded,t.isTTML=function(e){return e.codec&&e.codec.search(r.default.STPP)>=0||e.mimeType&&e.mimeType.search(r.default.TTML)>=0}(e),t.kind=function(e,t){var n=e.roles&&e.roles.length>0?t[e.roles[0]]:t.caption;return n===t.caption||n===t.subtitle?n:t.caption}(e,{subtitle:"subtitles",caption:"captions"}),x.addTextTrack(t)}function G(e){var t=e.chunk;t.mediaInfo.embeddedCaptions&&Y(t.bytes,t)}function V(e){A=e}function Y(e,a){var s=a.mediaInfo,o=s.type,u=s.mimeType,c=s.codec||u;c?-1!==s.codec.indexOf("application/mp4")?function(e,i,a){var s;if("InitializationSegment"===i.segmentType)T=!0,E=l.getMediaTimescaleFromMoov(e);else{if(!T)return;(s=l.getSamplesInfo(e).sampleList).length>0&&(S=s[0].cts-i.start*E),a.search(r.default.STPP)>=0?function(e,i,a){var s,o;for(d=null!==d?d:z(a),s=0;s<i.length;s++){var l=i[s],u=l.cts,c=K(),h=c+u/E,p=h+l.duration/E;t.buffered.add(h,p);var g=new DataView(e,l.offset,l.subSizes[0]),m=f.a.Utils.dataViewToString(g,r.default.UTF8),y=[],v=l.offset+l.subSizes[0];for(o=1;o<l.subSizes.length;o++){var T=new Uint8Array(e,v,l.subSizes[o]),b=String.fromCharCode.apply(null,T);y.push(b),v+=l.subSizes[o]}try{var S=O.getValue().ttmlTimeIsRelative?u/E:0,w=d.parse(m,S,u/E,(u+l.duration)/E,y);x.addCaptions(A,c,w)}catch(e){_.removeExecutedRequestsBeforeTime(),this.remove(),n.error("TTML parser error: "+e.message)}}}(e,s,a):function(e,r){var i,a,s,o=[];for(i=0;i<r.length;i++){var l=r[i];l.cts-=S;var u=K()+l.cts/E,c=u+l.duration/E;t.buffered.add(u,c);var d=e.slice(l.offset,l.offset+l.size),h=f.a.parseBuffer(d);for(a=0;a<h.boxes.length;a++){var p=h.boxes[a];if(n.debug("VTT box1: "+p.type),"vtte"!==p.type&&"vttc"===p.type)for(n.debug("VTT vttc boxes.length = "+p.boxes.length),s=0;s<p.boxes.length;s++){var g=p.boxes[s];if(n.debug("VTT box2: "+g.type),"payl"===g.type){var m=g.cue_text;n.debug("VTT cue_text = "+m);var y=l.cts/E,v=(l.cts+l.duration)/E;o.push({start:y,end:v,data:m,styles:{}}),n.debug("VTT "+y+"-"+v+" : "+m)}}}}o.length>0&&x.addCaptions(A,0,o)}(e,s)}}(e,a,c):o===r.default.VIDEO?function(e,t){var r,a;if(t.segmentType===i.HTTPRequest.INIT_SEGMENT_TYPE)0===I&&(I=l.getMediaTimescaleFromMoov(e));else if(t.segmentType===i.HTTPRequest.MEDIA_SEGMENT_TYPE){if(0===I)return void n.warn("CEA-608: No timescale for embeddedTextTrack yet");var s=(a=l.getSamplesInfo(e)).lastSequenceNumber;if(R[0]||R[1]||function(){for(var e,t=0;t<w.length;t++){if(-1===(e=x.getTrackIdxForId(w[t].id)))return void n.warn("CEA-608: data before track is ready.");var r=Z(e);R[t]=new p.a.Cea608Parser(t+1,{newCue:r},null)}}(),I){if(null!==C&&s!==C+a.numSequences)for(r=0;r<R.length;r++)R[r]&&R[r].reset();for(var o=function(e,t){if(0===t.length)return null;for(var n={splits:[],fields:[[],[]]},r=new DataView(e),i=0;i<t.length;i++)for(var a=t[i],s=p.a.findCea608Nalus(r,a.offset,a.size),o=null,l=0,u=0;u<s.length;u++)for(var c=p.a.extractCea608DataFromRange(r,s[u]),d=0;d<2;d++)if(c[d].length>0){a.cts!==o?l=0:l+=1;var f=K();n.fields[d].push([a.cts+f*I,c[d],l]),o=a.cts}return n.fields.forEach((function(e){e.sort((function(e,t){return e[0]===t[0]?e[2]-t[2]:e[0]-t[0]}))})),n}(e,a.sampleList),u=0;u<R.length;u++){var c=o.fields[u],d=R[u];if(d)for(r=0;r<c.length;r++)d.addData(c[r][0]/I,c[r][1])}C=s}}}(e,a):function(e,n,i){var a,s,o=new DataView(e,0,e.byteLength);s=f.a.Utils.dataViewToString(o,r.default.UTF8);try{a=z(i).parse(s,0),x.addCaptions(x.getCurrentTrackIdx(),0,a),t.buffered&&t.buffered.add(n.start,n.end)}catch(e){N.error(new y.default(v.default.TIMED_TEXT_ERROR_ID_PARSE_CODE,v.default.TIMED_TEXT_ERROR_MESSAGE_PARSE+e.message,s))}}(e,a,c):n.error("No text type defined")}function Z(e){return function(t,n,r){var i;(i=M.getTTMLRenderingDiv()?D.createHTMLCaptionsFromScreen(M.getElement(),t,n,r):[{start:t,end:n,data:r.getDisplayText(),styles:{}}])&&x.addCaptions(e,0,i)}}function K(){return isNaN(t.timestampOffset)?0:t.timestampOffset}function z(e){var t;return e.search(r.default.VTT)>=0?t=L:(e.search(r.default.TTML)>=0||e.search(r.default.STPP)>=0)&&(t=k),t}function W(e){w.forEach((function(t){var n=x.getTrackIdxForId(t.id);n>=0&&x.deleteCuesFromTrackIdx(n,e.from,e.to)}))}return t={initialize:function(){j||(w=[],A=null,I=0,R=[],C=null,j=!0,D=Object(c.default)(U).getInstance(),B.on(m.default.VIDEO_CHUNK_RECEIVED,G,t),B.on(m.default.BUFFER_CLEARED,W,t))},addMediaInfos:function(e,n,i){if(h=h.concat(n),e===r.default.TEXT&&n[0].isFragmented&&!n[0].isEmbedded){_=i,t.buffered=Object(o.default)(U).create(),b=P.getTracksFor(r.default.TEXT,F.id).filter((function(e){return e.isFragmented}));for(var a=P.getCurrentTrackFor(r.default.TEXT,F.id),s=0;s<b.length;s++)if(b[s]===a){V(s);break}}for(var l=0;l<n.length;l++)H(n[l])},resetMediaInfos:function(){h=[]},getStreamId:function(){return F.id},append:Y,abort:function(){},addEmbeddedTrack:function(e){if(j&&e)if(e.id===r.default.CC1||e.id===r.default.CC3){for(var t=0;t<w.length;t++)if(w[t].id===e.id)return;w.push(e)}else n.warn("Embedded track "+e.id+" not supported!")},resetEmbedded:function(){B.off(m.default.VIDEO_CHUNK_RECEIVED,G,t),B.off(m.default.BUFFER_CLEARED,W,t),x&&x.deleteAllTextTracks(),j=!1,w=[],R=[null,null],C=null},getConfig:function(){return{fragmentModel:_,fragmentedTracks:b,videoModel:M}},setCurrentFragmentedTrackIdx:V,remove:function(e,n){void 0===e&&e===n&&(e=t.buffered.start(0),n=t.buffered.end(t.buffered.length-1)),t.buffered.remove(e,n),x.deleteCuesFromTrackIdx(A,e,n)},reset:function(){q(),h=[],l=null}},n=Object(u.default)(U).getInstance().getLogger(t),l=Object(s.default)(U).getInstance(),q(),t}_.__dashjs_factory_name="TextSourceBuffer",t.default=l.default.getClassFactory(_)},"./src/streaming/text/TextTracks.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js"),i=n("./src/core/EventBus.js"),a=n("./src/core/events/Events.js"),s=n("./src/streaming/MediaPlayerEvents.js"),o=n("./src/core/FactoryMaker.js"),l=n("./src/core/Debug.js"),u=n("./node_modules/imsc/src/main/js/main.js");function c(e){var t,n,o,c,d,f,h,p,g,m,y,v,_,T,E,b,S,A=this.context,w=Object(i.default)(A).getInstance(),I=e.videoModel,C=e.streamInfo;function R(e,t,n,r,i,a){var s=0,o=0;e/t>n/r?s=(o=t)/r*n:o=(s=e)/n*r;var l,u,c=0,d=0;return s/o>i?(d=o,c=o*i):(c=s,d=s/i),l=(e-c)/2,u=(t-d)/2,a?{x:l+.1*c,y:u+.1*d,w:.8*c,h:.8*d}:{x:l,y:u,w:c,h:d}}function D(e,t){var n=I.getClientWidth(),r=I.getClientHeight(),i=I.getVideoWidth(),a=I.getVideoHeight(),o=I.getVideoRelativeOffsetTop(),l=I.getVideoRelativeOffsetLeft();if(0!==i&&0!==a){var u=i/a,c=!1;e.isFromCEA608&&(u=3.5/3,c=!0);var d=R.call(this,n,r,i,a,u,c),f=d.w,v=d.h,E=d.x,S=d.y;if(f!=g||v!=m||E!=h||S!=p||t){if(h=E+l,p=S+o,g=f,m=v,y){var A=y.style;A&&(A.left=h+"px",A.top=p+"px",A.width=g+"px",A.height=m+"px",A.zIndex=_&&document[_]||T?b:null,w.trigger(s.default.CAPTION_CONTAINER_RESIZE))}var C=e.activeCues;if(C)for(var D=C.length,N=0;N<D;++N){var O=C[N];O.scaleCue(O)}}}}function N(e){var t,n,r,i,a,s=g,o=m;if(e.cellResolution){var l=[s/e.cellResolution[0],o/e.cellResolution[1]];if(e.linePadding)for(t in e.linePadding)if(e.linePadding.hasOwnProperty(t)){n=(e.linePadding[t]*l[0]).toString();for(var u=document.getElementsByClassName("spanPadding"),c=0;c<u.length;c++)u[c].style.cssText=u[c].style.cssText.replace(/(padding-left\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+n),u[c].style.cssText=u[c].style.cssText.replace(/(padding-right\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+n)}if(e.fontSize){for(t in e.fontSize)if(e.fontSize.hasOwnProperty(t)){"%"===e.fontSize[t][0]?r=e.fontSize[t][1]/100:"c"===e.fontSize[t][0]&&(r=e.fontSize[t][1]),n=(r*l[1]).toString(),a="defaultFontSize"!==t?document.getElementsByClassName(t):document.getElementsByClassName("paragraph");for(var d=0;d<a.length;d++)a[d].style.cssText=a[d].style.cssText.replace(/(font-size\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+n)}if(e.lineHeight)for(t in e.lineHeight)if(e.lineHeight.hasOwnProperty(t)){"%"===e.lineHeight[t][0]?i=e.lineHeight[t][1]/100:"c"===e.fontSize[t][0]&&(i=e.lineHeight[t][1]),n=(i*l[1]).toString(),a=document.getElementsByClassName(t);for(var f=0;f<a.length;f++)a[f].style.cssText=a[f].style.cssText.replace(/(line-height\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+n)}}}if(e.isd){var h=document.getElementById(e.cueID);h&&y.removeChild(h),O(e)}}function O(e){if(y){var t=document.createElement("div");y.appendChild(t),E=Object(u.renderHTML)(e.isd,t,(function(t){var n=/^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/,r=/^#(.*)$/;if(n.test(t)){var i=n.exec(t),a=parseInt(i[4],10)-1;return"data:image/png;base64,"+btoa(e.images[a])}if(r.test(t)){var s=r.exec(t)[1];return"data:image/png;base64,"+e.embeddedImages[s]}return null}),y.clientHeight,y.clientWidth,!1,(function(e){n.info("renderCaption :",e)}),E,!0),t.id=e.cueID,w.trigger(s.default.CAPTION_RENDERED,{captionDiv:t,currentTrackIdx:f})}}function P(e,t,i){var a=M(e),l=this;if(a&&Array.isArray(i)&&0!==i.length)for(var u=0;u<i.length;u++){var c=void 0,d=i[u];a.cellResolution=d.cellResolution,a.isFromCEA608=d.isFromCEA608,"html"!==d.type||!y||isNaN(d.start)||isNaN(d.end)?!d.data||isNaN(d.start)||isNaN(d.end)||(c=new o(d.start-t,d.end-t,d.data),d.styles&&(void 0!==d.styles.align&&"align"in c&&(c.align=d.styles.align),void 0!==d.styles.line&&"line"in c&&(c.line=d.styles.line),void 0!==d.styles.position&&"position"in c&&(c.position=d.styles.position),void 0!==d.styles.size&&"size"in c&&(c.size=d.styles.size)),c.onenter=function(){a.mode===r.default.TEXT_SHOWING&&w.trigger(s.default.CAPTION_RENDERED,{currentTrackIdx:f})}):((c=new o(d.start+t,d.end+t,"")).cueHTMLElement=d.cueHTMLElement,c.isd=d.isd,c.images=d.images,c.embeddedImages=d.embeddedImages,c.cueID=d.cueID,c.scaleCue=N.bind(l),c.cellResolution=d.cellResolution,c.lineHeight=d.lineHeight,c.linePadding=d.linePadding,c.fontSize=d.fontSize,y.style.left=h+"px",y.style.top=p+"px",y.style.width=g+"px",y.style.height=m+"px",c.onenter=function(){a.mode===r.default.TEXT_SHOWING&&(this.isd?(O(this),n.debug("Cue enter id:"+this.cueID)):(y.appendChild(this.cueHTMLElement),N.call(l,this),w.trigger(s.default.CAPTION_RENDERED,{captionDiv:this.cueHTMLElement,currentTrackIdx:f})))},c.onexit=function(){if(y)for(var e=y.childNodes,t=0;t<e.length;++t)e[t].id===this.cueID&&(n.debug("Cue exit id:"+e[t].id),y.removeChild(e[t]),--t)});try{c?k(a,c)||a.addCue(c):n.error("impossible to display subtitles.")}catch(e){throw U(a),a.addCue(c),e}}}function M(e){return e>=0&&c[e]?I.getTextTrack(c[e].kind,c[e].id,c[e].lang,c[e].isTTML,c[e].isEmbedded):null}function x(e){var t=this;if(e!==f){var n=M(f=e);L.call(this,n),v&&(clearInterval(v),v=null),n&&"html"===n.renderingType&&(D.call(this,n,!0),window.ResizeObserver?(S=new window.ResizeObserver((function(){D.call(t,n,!0)}))).observe(I.getElement()):v=setInterval(D.bind(this,n),500))}}function L(e){q.call(this),e&&"html"===e.renderingType?B.call(this):j.call(this)}function k(e,t){if(!e.cues)return!1;for(var n=0;n<e.cues.length;n++)if(e.cues[n].startTime===t.startTime&&e.cues[n].endTime===t.endTime)return!0;return!1}function F(e,t,n){return(isNaN(t)||e.startTime>=t)&&(isNaN(n)||e.endTime<=n)}function U(e,t,n){if(e.cues)for(var r=e.cues,i=r.length-1;i>=0;i--)F(r[i],t,n)&&(r[i].onexit&&r[i].onexit(),e.removeCue(r[i]))}function B(){var e=document.getElementById("native-cue-style");if(!e){(e=document.createElement("style")).id="native-cue-style",document.head.appendChild(e);var t=e.sheet,r=I.getElement();try{r&&(r.id?t.insertRule("#"+r.id+"::cue {background: transparent}",0):0!==r.classList.length?t.insertRule("."+r.className+"::cue {background: transparent}",0):t.insertRule("video::cue {background: transparent}",0))}catch(e){n.info(""+e.message)}}}function j(){var e=document.getElementById("native-cue-style");e&&document.head.removeChild(e)}function q(){if(y)for(;y.firstChild;)y.removeChild(y.firstChild)}return t={initialize:function(){"undefined"!=typeof window&&"undefined"!=typeof navigator&&(o=window.VTTCue||window.TextTrackCue,c=[],d=[],f=-1,h=0,p=0,g=0,m=0,y=null,v=null,T=!1,b=2147483647,E=null,void 0!==document.fullscreenElement?_="fullscreenElement":void 0!==document.webkitIsFullScreen?_="webkitIsFullScreen":document.msFullscreenElement?_="msFullscreenElement":document.mozFullScreen&&(_="mozFullScreen"))},getStreamId:function(){return C.id},addTextTrack:function(e){c.push(e)},addCaptions:P,createTracks:function(){c.sort((function(e,t){return e.index-t.index})),y=I.getTTMLRenderingDiv();for(var e,t,n,i,o,l,u=-1,h=0;h<c.length;h++){var p=(t=void 0,n=void 0,i=void 0,o=void 0,l=void 0,t=(e=c[h]).kind,n=void 0!==e.id?e.id:e.lang,i=e.lang,o=e.isTTML,l=e.isEmbedded,I.addTextTrack(t,n,i,o,l));d.push(p),c[h].defaultTrack&&(p.default=!0,u=h);var g=M(h);g&&(g.mode=r.default.TEXT_SHOWING,y&&(c[h].isTTML||c[h].isEmbedded)?g.renderingType="html":g.renderingType="default"),P(h,0,c[h].captionData),w.trigger(s.default.TEXT_TRACK_ADDED)}if(x.call(this,u),u>=0){w.on(s.default.PLAYBACK_METADATA_LOADED,(function e(){var t=M(u);t&&"html"===t.renderingType&&D.call(this,t,!0),w.off(s.default.PLAYBACK_METADATA_LOADED,e,this)}),this);for(var m=0;m<c.length;m++){var v=M(m);v&&(v.mode=m===u?r.default.TEXT_SHOWING:r.default.TEXT_HIDDEN)}}w.trigger(a.default.TEXT_TRACKS_QUEUE_INITIALIZED,{index:f,tracks:c,streamId:C.id})},getCurrentTrackIdx:function(){return f},setCurrentTrackIdx:x,getTrackIdxForId:function(e){for(var t=-1,n=0;n<c.length;n++)if(c[n].id===e){t=n;break}return t},getCurrentTrackInfo:function(){return c[f]},setModeForTrackIdx:function(e,t){var n=M(e);n&&n.mode!==t&&(n.mode=t)},deleteCuesFromTrackIdx:function(e,t,n){var r=M(e);r&&U(r,t,n)},deleteAllTextTracks:function(){for(var e=d?d.length:0,t=0;t<e;t++){var n=M(t);n&&U.call(this,n,C.start,C.start+C.duration)}d=[],c=[],v&&(clearInterval(v),v=null),S&&I&&(S.unobserve(I.getElement()),S=null),f=-1,q.call(this)},deleteTextTrack:function(e){I.removeChild(d[e]),d.splice(e,1)}},n=Object(l.default)(A).getInstance().getLogger(t),t}c.__dashjs_factory_name="TextTracks",t.default=o.default.getClassFactory(c)},"./src/streaming/thumbnail/ThumbnailController.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/streaming/constants/Constants.js"),a=n("./src/streaming/vo/Thumbnail.js"),s=n("./src/streaming/thumbnail/ThumbnailTracks.js"),o=n("./src/streaming/vo/BitrateInfo.js"),l=n("./src/dash/utils/SegmentsUtils.js");function u(e){var t,n,r=this.context,u=e.streamInfo;function c(e){n.setTrackByIndex(e)}function d(){n&&n.reset()}return t={getStreamId:function(){return u.id},initialize:function(){n.addTracks();var e=n.getTracks();e&&e.length>0&&c(0)},provide:function(e,t){if("function"==typeof t){var r,i,s=n.getCurrentTrack();if(!s||s.segmentDuration<=0||null==e)t(null);else{(i=n.getThumbnailRequestForTime(e))&&(s.segmentDuration=i.duration),r=e%s.segmentDuration;var o=Math.floor(r*s.tilesHor*s.tilesVert/s.segmentDuration),u=new a.default;if(u.width=Math.floor(s.widthPerTile),u.height=Math.floor(s.heightPerTile),u.x=Math.floor(o%s.tilesHor)*s.widthPerTile,u.y=Math.floor(o/s.tilesHor)*s.heightPerTile,"readThumbnail"in s)return s.readThumbnail(e,(function(e){u.url=e,t(u)}));if(i)u.url=i.url,s.segmentDuration=NaN;else{var c=Math.floor(e/s.segmentDuration);u.url=function(e,t){var n=t+e.startNumber,r=Object(l.replaceTokenForTemplate)(e.templateUrl,"Number",n);return r=Object(l.replaceTokenForTemplate)(r,"Time",(n-1)*e.segmentDuration*e.timescale),r=Object(l.replaceTokenForTemplate)(r,"Bandwidth",e.bandwidth),Object(l.unescapeDollarsInTemplate)(r)}(s,c)}t(u)}}},setTrackByIndex:c,getCurrentTrackIndex:function(){return n.getCurrentTrackIndex()},getBitrateList:function(){var e=n.getTracks(),t=0;return e.map((function(e){var n=new o.default;return n.mediaType=i.default.IMAGE,n.qualityIndex=t++,n.bitrate=e.bitrate,n.width=e.width,n.height=e.height,n}))},reset:d},d(),n=Object(s.default)(r).create({streamInfo:u,adapter:e.adapter,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:e.debug,eventBus:e.eventBus,events:e.events,dashConstants:e.dashConstants,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController}),t}u.__dashjs_factory_name="ThumbnailController",t.default=r.default.getClassFactory(u)},"./src/streaming/thumbnail/ThumbnailTracks.js":function(e,t,n){n.r(t),n.d(t,"THUMBNAILS_SCHEME_ID_URIS",(function(){return h}));var r=n("./src/streaming/constants/Constants.js"),i=n("./src/dash/constants/DashConstants.js"),a=n("./src/core/FactoryMaker.js"),s=n("./src/streaming/vo/ThumbnailTrackInfo.js"),o=n("./src/streaming/utils/URLUtils.js"),l=n("./src/dash/utils/SegmentsUtils.js"),u=n("./src/streaming/utils/BoxParser.js"),c=n("./src/streaming/net/XHRLoader.js"),d=n("./src/dash/DashHandler.js"),f=n("./src/dash/controllers/SegmentsController.js"),h=["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"];function p(e){var t,n,a,p,g,m,y,v,_=this.context,T=e.adapter,E=e.baseURLController,b=e.streamInfo,S=e.timelineConverter,A=e.debug,w=e.eventBus,I=e.events,C=e.dashConstants,R=Object(o.default)(_).getInstance();function D(e,t){var r=new s.default;r.id=e.id,r.bitrate=e.bandwidth,r.width=e.width,r.height=e.height,r.tilesHor=1,r.tilesVert=1,e.essentialProperties&&e.essentialProperties.forEach((function(e){if(h.indexOf(e.schemeIdUri)>=0&&e.value){var t=e.value.split("x");2!==t.length||isNaN(t[0])||isNaN(t[1])||(r.tilesHor=parseInt(t[0],10),r.tilesVert=parseInt(t[1],10))}})),t?m.updateSegmentData(e).then((function(t){!function(e,t,n){var r=[],i=function(e,t){var n,r,i,a,s=[],o=0;for(n=0,r=e.segments.length;n<r;n++)i=e.segments[n],(a=Object(l.getTimeBasedSegment)(S,T.getIsDynamic(),t,i.startTime,i.duration,i.timescale,i.media,i.mediaRange,o))&&(s.push(a),a=null,o++);return s}(n,t);t.segments=i,e.segmentDuration=t.segments[0].duration,e.readThumbnail=function(e,n){var i=null;r.some((function(t){if(t.start<=e&&t.end>e)return i=t.url,!0})),i?n(i):t.segments.some((function(i){if(i.mediaStartTime<=e&&i.mediaStartTime+i.duration>e){var a=E.resolve(t.path);return y.load({method:"get",url:a.url,request:{range:i.mediaRange,responseType:"arraybuffer"},onload:function(e){var t=v.getSamplesInfo(e.target.response),a=new Blob([e.target.response.slice(t.sampleList[0].offset,t.sampleList[0].offset+t.sampleList[0].size)],{type:"image/jpeg"}),s=window.URL.createObjectURL(a);r.push({start:i.mediaStartTime,end:i.mediaStartTime+i.duration,url:s}),n&&n(s)}}),!0}}))}}(r,e,t)})):(r.startNumber=e.startNumber,r.segmentDuration=e.segmentDuration,r.timescale=e.timescale,r.templateUrl=function(e){var t=R.isRelative(e.media)?R.resolve(e.media,E.resolve(e.path).url):e.media;return t?Object(l.replaceIDForTemplate)(t,e.id):""}(e)),r.tilesHor>0&&r.tilesVert>0&&(r.widthPerTile=r.width/r.tilesHor,r.heightPerTile=r.height/r.tilesVert,n.push(r))}function N(){n=[],p=-1,g=null}return t={getTracks:function(){return n},addTracks:function(){if(b&&T&&(g=T.getMediaInfoForType(b,r.default.IMAGE))){var e=T.getVoRepresentations(g);e&&e.length>0&&e.forEach((function(e){(e.segmentInfoType===i.default.SEGMENT_TEMPLATE&&e.segmentDuration>0&&e.media||e.segmentInfoType===i.default.SEGMENT_TIMELINE)&&D(e),e.segmentInfoType===i.default.SEGMENT_BASE&&D(e,!0)})),n.length>0&&n.sort((function(e,t){return e.bitrate-t.bitrate}))}},reset:N,setTrackByIndex:function(e){n&&0!==n.length&&(e>=n.length&&(e=n.length-1),p=e)},getCurrentTrack:function(){return p<0?null:n[p]},getCurrentTrackIndex:function(){return p},getThumbnailRequestForTime:function(e){for(var t,r=T.getVoRepresentations(g),i=0;i<r.length;i++)if(n[p].id===r[i].id){t=r[i];break}return a.getSegmentRequestForTime(g,t,e)}},N(),y=Object(c.default)(_).create({}),v=Object(u.default)(_).getInstance(),m=Object(f.default)(_).create({events:I,eventBus:w,streamInfo:b,timelineConverter:S,dashConstants:C,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController,type:r.default.IMAGE}),(a=Object(d.default)(_).create({streamInfo:b,type:r.default.IMAGE,timelineConverter:S,segmentsController:m,baseURLController:E,debug:A,eventBus:w,events:I,dashConstants:C,urlUtils:R})).initialize(!!T&&T.getIsDynamic()),t}p.__dashjs_factory_name="ThumbnailTracks",t.default=a.default.getClassFactory(p)},"./src/streaming/utils/BaseURLSelector.js":function(e,t,n){n.r(t);var r=n("./src/core/errors/Errors.js"),i=n("./src/core/EventBus.js"),a=n("./src/core/events/Events.js"),s=n("./src/streaming/controllers/BlacklistController.js"),o=n("./src/streaming/utils/baseUrlResolution/DVBSelector.js"),l=n("./src/streaming/utils/baseUrlResolution/BasicSelector.js"),u=n("./src/core/FactoryMaker.js"),c=n("./src/streaming/vo/DashJSError.js"),d=n("./src/streaming/utils/SupervisorTools.js");function f(){var e,t,n,u,f,h=this.context,p=Object(i.default)(h).getInstance();function g(){t.reset()}return e={chooseSelector:function(e){Object(d.checkParameterType)(e,"boolean"),f=e?u:n},select:function(e){if(e){var t=e.baseUrls,i=e.selectedIdx;if(!isNaN(i))return t[i];var s=f.select(t);return s?(e.selectedIdx=t.indexOf(s),s):(p.trigger(a.default.URL_RESOLUTION_FAILED,{error:new c.default(r.default.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE,r.default.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE)}),void(f===n&&g()))}},reset:g,setConfig:function(e){e.selector&&(f=e.selector)}},t=Object(s.default)(h).create({updateEventName:a.default.SERVICE_LOCATION_BLACKLIST_CHANGED,addBlacklistEventName:a.default.SERVICE_LOCATION_BLACKLIST_ADD}),n=Object(l.default)(h).create({blacklistController:t}),u=Object(o.default)(h).create({blacklistController:t}),f=n,e}f.__dashjs_factory_name="BaseURLSelector",t.default=u.default.getClassFactory(f)},"./src/streaming/utils/BoxParser.js":function(e,t,n){n.r(t);var r=n("./src/core/Debug.js"),i=n("./src/streaming/utils/IsoFile.js"),a=n("./src/core/FactoryMaker.js"),s=n("./node_modules/codem-isoboxer/dist/iso_boxer.js"),o=n.n(s),l=n("./src/streaming/vo/IsoBoxSearchInfo.js");function u(){var e,t,n=this.context;function a(e){if(!e)return null;void 0===e.fileStart&&(e.fileStart=0);var t=o.a.parseBuffer(e),r=Object(i.default)(n).create();return r.setData(t),r}function s(e,t){return e[t+3]>>>0|e[t+2]<<8>>>0|e[t+1]<<16>>>0|e[t]<<24>>>0}function u(e,t){return String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t])}return t={parse:a,findLastTopIsoBoxCompleted:function(e,t,n){if(void 0===n&&(n=0),!t||n+8>=t.byteLength)return new l.default(0,!1);for(var r,i=t instanceof ArrayBuffer?new Uint8Array(t):t,a=0;n<i.byteLength;){var o=s(i,n),c=u(i,n+4);if(0===o)break;n+o<=i.byteLength&&(e.indexOf(c)>=0?r=new l.default(n,!0,o):a=n+o),n+=o}return r||new l.default(a,!1)},getMediaTimescaleFromMoov:function(e){var t=a(e),n=t?t.getBox("mdhd"):void 0;return n?n.timescale:NaN},getSamplesInfo:function(e){if(!e||0===e.byteLength)return{sampleList:[],lastSequenceNumber:NaN,totalDuration:NaN,numSequences:NaN};var t,n,r,i,s,o,l,u,c,d,f,h,p,g,m,y,v=a(e),_=v.getBoxes("moof"),T=v.getBoxes("mfhd");m=v.getBoxes("moof").length,g=T[T.length-1].sequence_number,n=0,s=[];var E=-1,b=-1;for(d=0;d<_.length;d++){var S=_[d],A=S.getChildBoxes("traf");for(u=0;u<A.length;u++){var w=A[u],I=w.getChildBox("tfhd"),C=w.getChildBox("tfdt");i=C.baseMediaDecodeTime;var R=w.getChildBoxes("trun"),D=w.getChildBoxes("subs");for(c=0;c<R.length;c++){var N=R[c];for(n=N.sample_count,p=(I.base_data_offset||0)+(N.data_offset||0),l=0;l<n;l++){t=void 0!==(o=N.samples[l]).sample_duration?o.sample_duration:I.default_sample_duration,r=void 0!==o.sample_size?o.sample_size:I.default_sample_size;var O={dts:i,cts:i+(void 0!==o.sample_composition_time_offset?o.sample_composition_time_offset:0),duration:t,offset:S.offset+p,size:r,subSizes:[r]};if(D)for(f=0;f<D.length;f++){var P=D[f];if(E<P.entry_count-1&&l>b&&(E++,b+=P.entries[E].sample_delta),l==b){O.subSizes=[];var M=P.entries[E];for(h=0;h<M.subsample_count;h++)O.subSizes.push(M.subsamples[h].subsample_size)}}s.push(O),p+=r,i+=t}}y=i-C.baseMediaDecodeTime}}return{sampleList:s,lastSequenceNumber:g,totalDuration:y,numSequences:m}},findInitRange:function(t){var n=null,r=a(t);if(!r)return n;var i=r.getBox("ftyp"),s=r.getBox("moov");return e.debug("Searching for initialization."),s&&s.isComplete&&(n=(i?i.offset:s.offset)+"-"+(s.offset+s.size-1),e.debug("Found the initialization.  Range: "+n)),n},parsePayload:function(e,t,n){if(void 0===n&&(n=0),!t||n+8>=t.byteLength)return new l.default(0,!1);for(var r,i=t instanceof ArrayBuffer?new Uint8Array(t):t,a=0;n<i.byteLength;){var o=s(i,n),c=u(i,n+4);if(0===o)break;n+o<=i.byteLength&&(e.indexOf(c)>=0?r=new l.default(n,!0,o,c):a=n+o),n+=o}return r||new l.default(a,!1)}},e=Object(r.default)(n).getInstance().getLogger(t),t}u.__dashjs_factory_name="BoxParser",t.default=a.default.getSingletonFactory(u)},"./src/streaming/utils/Capabilities.js":function(e,t,n){n.r(t),n.d(t,"supportsMediaSource",(function(){return o}));var r=n("./src/core/FactoryMaker.js"),i=n("./src/streaming/thumbnail/ThumbnailTracks.js"),a=n("./src/streaming/constants/Constants.js"),s=[{codec:"avc1",compatibleCodecs:["avc3"]},{codec:"avc3",compatibleCodecs:["avc1"]}];function o(){var e="WebKitMediaSource"in window,t="MediaSource"in window;return e||t}function l(){var e,t,n;return e={setConfig:function(e){e&&e.settings&&(t=e.settings)},supportsMediaSource:o,supportsEncryptedMedia:function(){return n},supportsCodec:function(e,n){return n!==a.default.AUDIO&&n!==a.default.VIDEO?Promise.resolve(!0):function(e,n){return t.get().streaming.capabilities.useMediaCapabilitiesApi&&navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo&&(e.codec&&n===a.default.AUDIO||n===a.default.VIDEO&&e.codec&&e.width&&e.height&&e.bitrate&&e.framerate)}(e,n)?function(e,t){return new Promise((function(n){if(e&&e.codec){var r={type:"media-source"};r[t]={},r[t].contentType=e.codec,r[t].width=e.width,r[t].height=e.height,r[t].bitrate=parseInt(e.bitrate),r[t].framerate=parseFloat(e.framerate),navigator.mediaCapabilities.decodingInfo(r).then((function(e){n(e.supported)})).catch((function(){n(!1)}))}else n(!1)}))}(e,n):function(e){return new Promise((function(t){if(e&&e.codec){var n=e.codec;e.width&&e.height&&(n+=';width="'+e.width+'";height="'+e.height+'"'),"MediaSource"in window&&MediaSource.isTypeSupported(n)||"WebKitMediaSource"in window&&WebKitMediaSource.isTypeSupported(n)?t(!0):t(!1)}else t(!1)}))}(e)},setEncryptedMediaSupported:function(e){n=e},supportsEssentialProperty:function(e){try{return-1!==i.THUMBNAILS_SCHEME_ID_URIS.indexOf(e.schemeIdUri)}catch(e){return!0}},codecRootCompatibleWithCodec:function(e,t){for(var n,r=e.split(".")[0],i=0===t.indexOf(r),a=0;a<s.length;a++)if(s[a].codec===r){n=s[a];break}return n?i||n.compatibleCodecs.some((function(e){return 0===t.indexOf(e)})):i}},n=!1,e}l.__dashjs_factory_name="Capabilities",t.default=r.default.getSingletonFactory(l)},"./src/streaming/utils/CapabilitiesFilter.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/core/Debug.js"),a=n("./src/streaming/constants/Constants.js");function s(){var e,t,n,r,s,o,l=this.context;function u(e,r){if(!r||!r.Period_asArray||0===r.Period_asArray.length)return Promise.resolve();var i=[];return r.Period_asArray.forEach((function(r){i.push(function(e,r){return new Promise((function(i){if(e&&e.AdaptationSet_asArray&&0!==e.AdaptationSet_asArray.length){var o=[];e.AdaptationSet_asArray.forEach((function(e){t.getIsTypeOf(e,r)&&o.push(function(e,r){return new Promise((function(i){if(e.Representation_asArray&&0!==e.Representation_asArray.length){var o=[],l=[];e.Representation_asArray.forEach((function(i,s){var u=t.getCodec(e,s,!1),c=function(e,t,n){switch(e){case a.default.VIDEO:return function(e,t){return{codec:t,width:e.width||null,height:e.height||null,framerate:e.frameRate||null,bitrate:e.bandwidth||null}}(t,n);case a.default.AUDIO:return function(e,t){var n=e.audioSamplingRate||null;return{codec:t,bitrate:e.bandwidth||null,samplerate:n}}(t,n);default:return null}}(r,i,u);l.push(c),o.push(n.supportsCodec(c,r))})),Promise.all(o).then((function(t){e.Representation_asArray=e.Representation_asArray.filter((function(e,n){return t[n]||s.debug("[Stream] Codec ".concat(l[n].codec," not supported ")),t[n]})),i()})).catch((function(){i()}))}else i()}))}(e,r))})),Promise.all(o).then((function(){e.AdaptationSet_asArray=e.AdaptationSet_asArray.filter((function(e){var t=e.Representation_asArray&&e.Representation_asArray.length>0;return t||s.warn("AdaptationSet has been removed because of no supported Representation"),t})),i()})).catch((function(){i()}))}else i()}))}(r,e))})),Promise.all(i)}return e={setConfig:function(e){e&&(e.adapter&&(t=e.adapter),e.capabilities&&(n=e.capabilities),e.settings&&(r=e.settings))},filterUnsupportedFeatures:function(e){return new Promise((function(i){var l=[];l.push(u(a.default.VIDEO,e)),l.push(u(a.default.AUDIO,e)),Promise.all(l).then((function(){r.get().streaming.capabilities.filterUnsupportedEssentialProperties&&function(e){e&&e.Period_asArray&&0!==e.Period_asArray.length&&e.Period_asArray.forEach((function(e){e.AdaptationSet_asArray=e.AdaptationSet_asArray.filter((function(e){return!e.Representation_asArray||0===e.Representation_asArray.length||(e.Representation_asArray=e.Representation_asArray.filter((function(e){var r=t.getEssentialPropertiesForRepresentation(e);if(r&&r.length>0)for(var i=0;i<r.length;){if(!n.supportsEssentialProperty(r[i]))return s.debug("[Stream] EssentialProperty not supported: "+r[i].schemeIdUri),!1;i+=1}return!0})),e.Representation_asArray&&e.Representation_asArray.length>0)}))}))}(e),function(e){o&&0!==o.length&&e&&e.Period_asArray&&0!==e.Period_asArray.length&&e.Period_asArray.forEach((function(e){e.AdaptationSet_asArray=e.AdaptationSet_asArray.filter((function(e){return!e.Representation_asArray||0===e.Representation_asArray.length||(e.Representation_asArray=e.Representation_asArray.filter((function(e){return!o.some((function(t){return!t(e)}))})),e.Representation_asArray&&e.Representation_asArray.length>0)}))}))}(e),i()})).catch((function(){i()}))}))},setCustomCapabilitiesFilters:function(e){o=e}},s=Object(i.default)(l).getInstance().getLogger(e),e}s.__dashjs_factory_name="CapabilitiesFilter",t.default=r.default.getSingletonFactory(s)},"./src/streaming/utils/CustomTimeRanges.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/streaming/utils/SupervisorTools.js");function a(){return{customTimeRangeArray:[],length:0,add:function(e,t){var n=0;for(n=0;n<this.customTimeRangeArray.length&&e>this.customTimeRangeArray[n].start;n++);for(this.customTimeRangeArray.splice(n,0,{start:e,end:t}),n=0;n<this.customTimeRangeArray.length-1;n++)this.mergeRanges(n,n+1)&&n--;this.length=this.customTimeRangeArray.length},clear:function(){this.customTimeRangeArray=[],this.length=0},remove:function(e,t){for(var n=0;n<this.customTimeRangeArray.length;n++)if(e<=this.customTimeRangeArray[n].start&&t>=this.customTimeRangeArray[n].end)this.customTimeRangeArray.splice(n,1),n--;else{if(e>this.customTimeRangeArray[n].start&&t<this.customTimeRangeArray[n].end){this.customTimeRangeArray.splice(n+1,0,{start:t,end:this.customTimeRangeArray[n].end}),this.customTimeRangeArray[n].end=e;break}e>this.customTimeRangeArray[n].start&&e<this.customTimeRangeArray[n].end?this.customTimeRangeArray[n].end=e:t>this.customTimeRangeArray[n].start&&t<this.customTimeRangeArray[n].end&&(this.customTimeRangeArray[n].start=t)}this.length=this.customTimeRangeArray.length},mergeRanges:function(e,t){var n=this.customTimeRangeArray[e],r=this.customTimeRangeArray[t];return n.start<=r.start&&r.start<=n.end&&n.end<=r.end?(n.end=r.end,this.customTimeRangeArray.splice(t,1),!0):r.start<=n.start&&n.start<=r.end&&r.end<=n.end?(n.start=r.start,this.customTimeRangeArray.splice(t,1),!0):r.start<=n.start&&n.start<=r.end&&n.end<=r.end?(this.customTimeRangeArray.splice(e,1),!0):n.start<=r.start&&r.start<=n.end&&r.end<=n.end&&(this.customTimeRangeArray.splice(t,1),!0)},start:function(e){return Object(i.checkInteger)(e),e>=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].start},end:function(e){return Object(i.checkInteger)(e),e>=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].end}}}a.__dashjs_factory_name="CustomTimeRanges",t.default=r.default.getClassFactory(a)},"./src/streaming/utils/DOMStorage.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/core/Debug.js"),a=n("./src/streaming/constants/Constants.js"),s=[{oldKey:"dashjs_vbitrate",newKey:"dashjs_video_bitrate"},{oldKey:"dashjs_abitrate",newKey:"dashjs_audio_bitrate"},{oldKey:"dashjs_vsettings",newKey:"dashjs_video_settings"},{oldKey:"dashjs_asettings",newKey:"dashjs_audio_settings"}],o="dashjs_?_bitrate",l="dashjs_?_settings",u="localStorage",c="lastBitrate",d="lastMediaSettings";function f(e){e=e||{};var t,n,r,f=this.context,h=e.settings;function p(e){if(void 0!==r)return r;var t;r=!1;try{"undefined"!=typeof window&&(t=window[e])}catch(e){return n.warn("DOMStorage access denied: "+e.message),r}if(!t||e!==u&&"sessionStorage"!==e)return r;try{t.setItem("1","1"),t.removeItem("1"),r=!0}catch(e){n.warn("DOMStorage is supported, but cannot be used: "+e.message)}return r}function g(){var e=6e5;return Math.round((new Date).getTime()/e)*e}function m(e,t){return p(e)&&h.get().streaming[t+"CachingInfo"].enabled}function y(){if(!h)throw new Error(a.default.MISSING_CONFIG_ERROR)}return t={getSavedBitrateSettings:function(e){var t=NaN;if(y(),m(u,c)){var r=o.replace(/\?/,e);try{var i=JSON.parse(localStorage.getItem(r))||{},a=(new Date).getTime()-parseInt(i.timestamp,10)>=h.get().streaming.lastBitrateCachingInfo.ttl||!1,s=parseFloat(i.bitrate);isNaN(s)||a?a&&localStorage.removeItem(r):(t=s,n.debug("Last saved bitrate for "+e+" was "+s))}catch(e){return null}}return t},setSavedBitrateSettings:function(e,t){if(m(u,c)&&t){var r=o.replace(/\?/,e);try{localStorage.setItem(r,JSON.stringify({bitrate:t.toFixed(3),timestamp:g()}))}catch(e){n.error(e.message)}}},getSavedMediaSettings:function(e){var t=null;if(y(),m(u,d)){var n=l.replace(/\?/,e);try{var r=JSON.parse(localStorage.getItem(n))||{},i=(new Date).getTime()-parseInt(r.timestamp,10)>=h.get().streaming.lastMediaSettingsCachingInfo.ttl||!1;t=r.settings,i&&(localStorage.removeItem(n),t=null)}catch(e){return null}}return t},setSavedMediaSettings:function(e,t){if(m(u,d)){var r=l.replace(/\?/,e);try{localStorage.setItem(r,JSON.stringify({settings:t,timestamp:g()}))}catch(e){n.error(e.message)}}}},n=Object(i.default)(f).getInstance().getLogger(t),p(u)&&s.forEach((function(e){var t=localStorage.getItem(e.oldKey);if(t){localStorage.removeItem(e.oldKey);try{localStorage.setItem(e.newKey,t)}catch(e){n.error(e.message)}}})),t}f.__dashjs_factory_name="DOMStorage";var h=r.default.getSingletonFactory(f);t.default=h},"./src/streaming/utils/DefaultURLUtils.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js");function i(){var e,t=/^[a-z][a-z0-9+\-_.]*:/i,n=/^https?:\/\//i,r=/^https:\/\//i,i=/^([a-z][a-z0-9+\-_.]*:\/\/[^\/]+)\/?/i,a=function(e,t){try{return new window.URL(e,t).toString()}catch(t){return e}},s=function(e,t){var n=o;if(!t)return e;if(!c(e))return e;d(e)&&(n=l),f(e)&&(n=u);var r=n(t),i="/"!==r.charAt(r.length-1)&&"/"!==e.charAt(0)?"/":"";return[r,e].join(i)};function o(e){var t=e.indexOf("/"),n=e.lastIndexOf("/");return-1!==t?n===t+1?e:(-1!==e.indexOf("?")&&(e=e.substring(0,e.indexOf("?"))),e.substring(0,n+1)):""}function l(e){var t=e.match(i);return t?t[1]:""}function u(e){var n=e.match(t);return n?n[0]:""}function c(e){return!t.test(e)}function d(e){return c(e)&&"/"===e.charAt(0)}function f(e){return 0===e.indexOf("//")}return function(){try{new window.URL("x","http://y"),e=a}catch(e){}finally{e=e||s}}(),{parseBaseUrl:o,parseOrigin:l,parseScheme:u,isRelative:c,isPathAbsolute:d,isSchemeRelative:f,isHTTPURL:function(e){return n.test(e)},isHTTPS:function(e){return r.test(e)},removeHostname:function(e){return/^(?:\w+\:\/\/)?([^\/]+)(.*)$/.exec(e)[2].substring(1)},resolve:function(t,n){return e(t,n)}}}i.__dashjs_factory_name="DefaultURLUtils",t.default=r.default.getSingletonFactory(i)},"./src/streaming/utils/EBMLParser.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js");function i(e){var t;e=e||{};var n=new DataView(e.data),r=0;function i(e,t){var i=!0,a=0;if(void 0===t&&(t=!1),e.tag>16777215?(n.getUint32(r)!==e.tag&&(i=!1),a=4):e.tag>65535?(256*n.getUint16(r)+n.getUint8(r+2)!==e.tag&&(i=!1),a=3):e.tag>255?(n.getUint16(r)!==e.tag&&(i=!1),a=2):(n.getUint8(r)!==e.tag&&(i=!1),a=1),!i&&e.required&&!t)throw new Error("required tag not found");return i&&(r+=a),i}function a(e){var t=1,i=128,a=-1,s=0,o=n.getUint8(r),l=0;for(l=0;l<8;l+=1){if((o&i)===i){s=void 0===e?o&~i:o,a=l;break}i>>=1}for(l=0;l<a;l+=1,t+=1)s=s<<8|255&n.getUint8(r+t);return r+=t,s}return t={getPos:function(){return r},setPos:function(e){r=e},consumeTag:i,consumeTagAndSize:function(e,t){var n=i(e,t);return n&&a(),n},parseTag:function(e){var n;return i(e),n=a(),t[e.parse](n)},skipOverElement:function(e,t){var n,s=i(e,t);return s&&(n=a(),r+=n),s},getMatroskaCodedNum:a,getMatroskaFloat:function(e){var t;switch(e){case 4:t=n.getFloat32(r),r+=4;break;case 8:t=n.getFloat64(r),r+=8}return t},getMatroskaUint:function(e){for(var t=0,i=0;i<e;i+=1)t<<=8,t|=255&n.getUint8(r+i);return r+=e,t},moreData:function(){return r<n.byteLength}},t}i.__dashjs_factory_name="EBMLParser",t.default=r.default.getClassFactory(i)},"./src/streaming/utils/ErrorHandler.js":function(e,t,n){n.r(t);var r=n("./src/core/EventBus.js"),i=n("./src/core/events/Events.js"),a=n("./src/core/FactoryMaker.js");function s(){var e=this.context,t=Object(r.default)(e).getInstance();return{error:function(e){t.trigger(i.default.ERROR,{error:e})}}}s.__dashjs_factory_name="ErrorHandler",t.default=a.default.getSingletonFactory(s)},"./src/streaming/utils/InitCache.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js");function i(){var e={};return{save:function(t){var n=t.streamId,r=t.representationId;e[n]=e[n]||{},e[n][r]=t},extract:function(t,n){return e&&e[t]&&e[t][n]?e[t][n]:null},reset:function(){e={}}}}i.__dashjs_factory_name="InitCache",t.default=r.default.getSingletonFactory(i)},"./src/streaming/utils/IsoFile.js":function(e,t,n){n.r(t);var r=n("./src/streaming/vo/IsoBox.js"),i=n("./src/core/FactoryMaker.js");function a(){var e;function t(t){var r=[];if(!t||!e||"function"!=typeof e.fetchAll)return r;for(var i,a=e.fetchAll(t),s=0,o=a.length;s<o;s++)(i=n(a[s]))&&r.push(i);return r}function n(e){if(!e)return null;var t=new r.default(e);return e.hasOwnProperty("_incomplete")&&(t.isComplete=!e._incomplete),t}return{getBox:function(t){return t&&e&&e.boxes&&0!==e.boxes.length&&"function"==typeof e.fetch?n(e.fetch(t)):null},getBoxes:t,setData:function(t){e=t},getLastBox:function(){if(!e||!e.boxes||!e.boxes.length)return null;var n=t(e.boxes[e.boxes.length-1].type);return n.length>0?n[n.length-1]:null}}}a.__dashjs_factory_name="IsoFile",t.default=i.default.getClassFactory(a)},"./src/streaming/utils/ObjectUtils.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./node_modules/fast-deep-equal/index.js"),a=n.n(i);function s(){return{areEqual:function(e,t){return a()(e,t)}}}s.__dashjs_factory_name="ObjectUtils",t.default=r.default.getSingletonFactory(s)},"./src/streaming/utils/RequestModifier.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js");function i(){return{modifyRequestURL:function(e){return e},modifyRequestHeader:function(e){return e}}}i.__dashjs_factory_name="RequestModifier",t.default=r.default.getSingletonFactory(i)},"./src/streaming/utils/SupervisorTools.js":function(e,t,n){n.r(t),n.d(t,"checkParameterType",(function(){return a})),n.d(t,"checkInteger",(function(){return s})),n.d(t,"checkRange",(function(){return o})),n.d(t,"checkIsVideoOrAudioType",(function(){return l}));var r=n("./src/streaming/constants/Constants.js");function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){if(i(e)!==t)throw r.default.BAD_ARGUMENT_ERROR}function s(e){if(null===e||isNaN(e)||e%1!=0)throw r.default.BAD_ARGUMENT_ERROR+" : argument is not an integer"}function o(e,t,n){if(e<t||e>n)throw r.default.BAD_ARGUMENT_ERROR+" : argument out of range"}function l(e){if("string"!=typeof e||e!==r.default.AUDIO&&e!==r.default.VIDEO)throw r.default.BAD_ARGUMENT_ERROR}},"./src/streaming/utils/TTMLParser.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/core/Debug.js"),a=n("./src/core/EventBus.js"),s=n("./src/core/events/Events.js"),o=n("./node_modules/imsc/src/main/js/main.js"),l=n("./src/streaming/MediaPlayerEvents.js"),u=n("./src/streaming/constants/ConformanceViolationConstants.js");function c(){var e,t,n=this.context,r=Object(a.default)(n).getInstance(),c=0;return e={parse:function(e,n,i,a,d){var f,h,p,g="",m=[],y={},v={},_="",T="",E={onOpenTag:function(e,n,i){if(i[" imagetype"]&&!i[" imageType"]&&(r.trigger(l.default.CONFORMANCE_VIOLATION,{level:u.default.LEVELS.ERROR,event:u.default.EVENTS.NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE}),i[" imageType"]=i[" imagetype"]),"image"===n&&("http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt"===e||"http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"===e)){if(!i[" imageType"]||"PNG"!==i[" imageType"].value)return void t.warn("smpte-tt imageType != PNG. Discarded");_=i["http://www.w3.org/XML/1998/namespace id"].value}},onCloseTag:function(){_&&(v[_]=T.trim()),T="",_=""},onText:function(e){_&&(T+=e)}};if(!e)throw g="no ttml data to parse",new Error(g);y.data=e,r.trigger(s.default.TTML_TO_PARSE,y);var b=Object(o.fromXML)(y.data,(function(e){g=e}),E);r.trigger(s.default.TTML_PARSED,{ttmlString:y.data,ttmlDoc:b});var S,A=b.getMediaTimeEvents();for(p=0;p<A.length;p++){var w=Object(o.generateISD)(b,A[p],(function(e){g=e}));w.contents.some((function(e){return e.contents.length}))&&(f=A[p]+n<i?i:A[p]+n)<(h=A[p+1]+n>a?a:A[p+1]+n)&&m.push({start:f,end:h,type:"html",cueID:(S=void 0,S="cue_TTML_"+c,c++,S),isd:w,images:d,embeddedImages:v})}if(""!==g)throw t.error(g),new Error(g);return m}},t=Object(i.default)(n).getInstance().getLogger(e),e}c.__dashjs_factory_name="TTMLParser",t.default=r.default.getSingletonFactory(c)},"./src/streaming/utils/URLUtils.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/streaming/utils/DefaultURLUtils.js");function a(){var e,t,n=[],r=this.context;function a(e,r,i){var a=function(e){var r;for(r=0;r<n.length;r++)if(n[r].regex.test(e))return n[r].utils;return t}(i||r);return a&&"function"==typeof a[e]?a[e](r,i):t[e](r,i)}return t=Object(i.default)(r).getInstance(),e={registerUrlRegex:function(e,t){n.push({regex:e,utils:t})},parseBaseUrl:function(e){return a("parseBaseUrl",e)},parseOrigin:function(e){return a("parseOrigin",e)},parseScheme:function(e){return a("parseScheme",e)},isRelative:function(e){return a("isRelative",e)},isPathAbsolute:function(e){return a("isPathAbsolute",e)},isSchemeRelative:function(e){return a("isSchemeRelative",e)},isHTTPURL:function(e){return a("isHTTPURL",e)},isHTTPS:function(e){return a("isHTTPS",e)},removeHostname:function(e){return a("removeHostname",e)},resolve:function(e,t){return a("resolve",e,t)}},e}a.__dashjs_factory_name="URLUtils";var s=r.default.getSingletonFactory(a);t.default=s},"./src/streaming/utils/VTTParser.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js"),i=n("./src/core/Debug.js");function a(){var e,t,n,r,a,s,o=this.context;function l(e){var t=e.split(":"),n=t.length-1;return e=60*parseInt(t[n-1],10)+parseFloat(t[n]),2===n&&(e+=3600*parseInt(t[0],10)),e}function u(e){var t=e.split(r),n=t[1].split(s);return n.shift(),t[1]=n[0],n.shift(),{cuePoints:t,styles:c(n)}}function c(e){var t={};return e.forEach((function(e){if(e.split(/:/).length>1){var n=e.split(/:/)[1];n&&-1!=n.search(/%/)&&(n=parseInt(n.replace(/%/,""),10)),(e.match(/align/)||e.match(/A/))&&(t.align=n),(e.match(/line/)||e.match(/L/))&&(t.line=n),(e.match(/position/)||e.match(/P/))&&(t.position=n),(e.match(/size/)||e.match(/S/))&&(t.size=n)}})),t}function d(e,t){for(var n,i=t,a="",s="";""!==e[i]&&i<e.length;)i++;if((n=i-t)>1)for(var o=0;o<n;o++){if((s=e[t+o]).match(r)){a="";break}a+=s,o!==n-1&&(a+="\n")}else(s=e[t]).match(r)||(a=s);return a}return e={parse:function(e){var i,s,o=[];if(!e)return o;i=(e=e.split(n)).length,s=-1;for(var c=0;c<i;c++){var f=e[c];if(f.length>0&&"WEBVTT"!==f&&f.match(r)){var h=u(f),p=h.cuePoints,g=h.styles,m=d(e,c+1),y=l(p[0].replace(a,"")),v=l(p[1].replace(a,""));!isNaN(y)&&!isNaN(v)&&y>=s&&v>y?""!==m?(s=y,o.push({start:y,end:v,data:m,styles:g})):t.error("Skipping cue due to empty/malformed cue text"):t.error("Skipping cue due to incorrect cue timing")}}return o}},t=Object(i.default)(o).getInstance().getLogger(e),n=/(?:\r\n|\r|\n)/gm,r=/-->/,a=/(^[\s]+|[\s]+$)/g,s=/\s\b/g,e}a.__dashjs_factory_name="VTTParser",t.default=r.default.getSingletonFactory(a)},"./src/streaming/utils/baseUrlResolution/BasicSelector.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js");function i(e){var t=(e=e||{}).blacklistController;return{select:function(e){var n,r=0;return e&&e.some((function(e,n){return r=n,!t.contains(e.serviceLocation)}))&&(n=e[r]),n}}}i.__dashjs_factory_name="BasicSelector",t.default=r.default.getClassFactory(i)},"./src/streaming/utils/baseUrlResolution/DVBSelector.js":function(e,t,n){n.r(t);var r=n("./src/core/FactoryMaker.js");function i(e){var t=(e=e||{}).blacklistController;return{select:function(e){return e&&function(e){var t,n,r=0,i=[],a=0;if((n=e.sort((function(e,t){var n=e.dvb_priority-t.dvb_priority;return isNaN(n)?0:n})).filter((function(e,t,n){return!t||n[0].dvb_priority&&e.dvb_priority&&n[0].dvb_priority===e.dvb_priority}))).length)return n.length>1&&(n.forEach((function(e){r+=e.dvb_weight,i.push(r)})),t=Math.floor(Math.random()*(r-1)),i.every((function(e,n){return a=n,!(t<e)}))),n[a]}((n=[],e.filter((function(e){return!t.contains(e.serviceLocation)||(e.dvb_priority&&n.push(e.dvb_priority),!1)})).filter((function(e){return!n.length||!e.dvb_priority||-1===n.indexOf(e.dvb_priority)}))));var n}}}i.__dashjs_factory_name="DVBSelector",t.default=r.default.getClassFactory(i)},"./src/streaming/vo/BitrateInfo.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mediaType=null,this.bitrate=null,this.width=null,this.height=null,this.scanType=null,this.qualityIndex=NaN}},"./src/streaming/vo/DashJSError.js":function(e,t,n){n.r(t),t.default=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.code=t||null,this.message=n||null,this.data=r||null}},"./src/streaming/vo/DataChunk.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.streamId=null,this.mediaInfo=null,this.segmentType=null,this.quality=NaN,this.index=NaN,this.bytes=null,this.start=NaN,this.end=NaN,this.duration=NaN,this.representationId=null,this.endFragment=null}},"./src/streaming/vo/FragmentRequest.js":function(e,t,n){n.r(t);var r=n("./src/streaming/vo/metrics/HTTPRequest.js");function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.action=e.ACTION_DOWNLOAD,this.startTime=NaN,this.mediaStartTime=NaN,this.mediaType=null,this.mediaInfo=null,this.type=null,this.duration=NaN,this.timescale=NaN,this.range=null,this.url=t||null,this.serviceLocation=null,this.requestStartDate=null,this.firstByteDate=null,this.requestEndDate=null,this.quality=NaN,this.index=NaN,this.availabilityStartTime=null,this.availabilityEndTime=null,this.wallStartTime=null,this.bytesLoaded=NaN,this.bytesTotal=NaN,this.delayLoadingTime=NaN,this.responseType="arraybuffer",this.representationId=null}var t,n,a;return t=e,(n=[{key:"isInitializationRequest",value:function(){return this.type&&this.type===r.HTTPRequest.INIT_SEGMENT_TYPE}},{key:"setInfo",value:function(e){this.type=e&&e.init?r.HTTPRequest.INIT_SEGMENT_TYPE:r.HTTPRequest.MEDIA_SEGMENT_TYPE,this.url=e&&e.url?e.url:null,this.range=e&&e.range?e.range.start+"-"+e.range.end:null,this.mediaType=e&&e.mediaType?e.mediaType:null}}])&&i(t.prototype,n),a&&i(t,a),e}();a.ACTION_DOWNLOAD="download",a.ACTION_COMPLETE="complete",t.default=a},"./src/streaming/vo/HeadRequest.js":function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=s(e);if(t){var a=s(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}n.r(t);var o=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(n,e);var t=a(n);function n(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(r=t.call(this,e)).checkForExistenceOnly=!0,r}return n}(n("./src/streaming/vo/FragmentRequest.js").default);t.default=o},"./src/streaming/vo/IsoBox.js":function(e,t,n){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(t);var i=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.offset=t._offset,this.type=t.type,this.size=t.size,this.boxes=[],t.boxes)for(var n=0;n<t.boxes.length;n++)this.boxes.push(new e(t.boxes[n]));switch(this.isComplete=!0,t.type){case"sidx":if(this.timescale=t.timescale,this.earliest_presentation_time=t.earliest_presentation_time,this.first_offset=t.first_offset,this.references=t.references,t.references){this.references=[];for(var r=0;r<t.references.length;r++){var i={reference_type:t.references[r].reference_type,referenced_size:t.references[r].referenced_size,subsegment_duration:t.references[r].subsegment_duration};this.references.push(i)}}break;case"emsg":this.id=t.id,this.version=1===t.version?1:0,this.value=t.value,this.timescale=t.timescale,this.scheme_id_uri=t.scheme_id_uri,this.presentation_time_delta=1===t.version?t.presentation_time:t.presentation_time_delta,this.event_duration=t.event_duration,this.message_data=t.message_data;break;case"mdhd":this.timescale=t.timescale;break;case"mfhd":this.sequence_number=t.sequence_number;break;case"subs":this.entry_count=t.entry_count,this.entries=t.entries;break;case"tfhd":this.base_data_offset=t.base_data_offset,this.sample_description_index=t.sample_description_index,this.default_sample_duration=t.default_sample_duration,this.default_sample_size=t.default_sample_size,this.default_sample_flags=t.default_sample_flags,this.flags=t.flags;break;case"tfdt":this.version=t.version,this.baseMediaDecodeTime=t.baseMediaDecodeTime,this.flags=t.flags;break;case"trun":if(this.sample_count=t.sample_count,this.first_sample_flags=t.first_sample_flags,this.data_offset=t.data_offset,this.flags=t.flags,this.samples=t.samples,t.samples){this.samples=[];for(var a=0,s=t.samples.length;a<s;a++){var o={sample_size:t.samples[a].sample_size,sample_duration:t.samples[a].sample_duration,sample_composition_time_offset:t.samples[a].sample_composition_time_offset};this.samples.push(o)}}}}var t,n,i;return t=e,n=[{key:"getChildBox",value:function(e){for(var t=0;t<this.boxes.length;t++)if(this.boxes[t].type===e)return this.boxes[t]}},{key:"getChildBoxes",value:function(e){for(var t=[],n=0;n<this.boxes.length;n++)this.boxes[n].type===e&&t.push(this.boxes[n]);return t}}],n&&r(t.prototype,n),i&&r(t,i),e}();t.default=i},"./src/streaming/vo/IsoBoxSearchInfo.js":function(e,t,n){n.r(t),t.default=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.lastCompletedOffset=t,this.found=n,this.size=r}},"./src/streaming/vo/MetricsList.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.TcpList=[],this.HttpList=[],this.RepSwitchList=[],this.BufferLevel=[],this.BufferState=[],this.PlayList=[],this.DroppedFrames=[],this.SchedulingInfo=[],this.DVRInfo=[],this.ManifestUpdate=[],this.RequestsQueue=null,this.DVBErrors=[]}},"./src/streaming/vo/TextRequest.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/Constants.js");function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}function s(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=o(e);if(t){var a=o(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}var l=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(n,e);var t=s(n);function n(e,i){var a;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(a=t.call(this)).url=e||null,a.type=i||null,a.mediaType=r.default.STREAM,a.responseType="",a}return n}(n("./src/streaming/vo/FragmentRequest.js").default);t.default=l},"./src/streaming/vo/TextTrackInfo.js":function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){return i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=s(e);if(t){var a=s(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n)}}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}n.r(t);var o=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(n,e);var t=a(n);function n(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(e=t.call(this)).captionData=null,e.label=null,e.defaultTrack=!1,e.kind=null,e.isFragmented=!1,e.isEmbedded=!1,e.isTTML=null,e}return n}(n("./src/dash/vo/MediaInfo.js").default);t.default=o},"./src/streaming/vo/Thumbnail.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=null,this.width=null,this.height=null,this.x=null,this.y=null}},"./src/streaming/vo/ThumbnailTrackInfo.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.bitrate=0,this.width=0,this.height=0,this.tilesHor=0,this.tilesVert=0,this.widthPerTile=0,this.heightPerTile=0,this.startNumber=0,this.segmentDuration=0,this.timescale=0,this.templateUrl="",this.id=""}},"./src/streaming/vo/URIFragmentData.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.xywh=null,this.track=null,this.id=null,this.s=null,this.r=null}},"./src/streaming/vo/metrics/BufferLevel.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.level=null}},"./src/streaming/vo/metrics/BufferState.js":function(e,t,n){n.r(t);var r=n("./src/streaming/constants/MetricsConstants.js");t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.target=null,this.state=r.default.BUFFER_EMPTY}},"./src/streaming/vo/metrics/DVRInfo.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.time=null,this.range=null,this.manifestInfo=null}},"./src/streaming/vo/metrics/DroppedFrames.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.time=null,this.droppedFrames=null}},"./src/streaming/vo/metrics/HTTPRequest.js":function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.r(t),n.d(t,"HTTPRequest",(function(){return i})),n.d(t,"HTTPRequestTrace",(function(){return a}));var i=function e(){r(this,e),this.tcpid=null,this.type=null,this.url=null,this.actualurl=null,this.range=null,this.trequest=null,this.tresponse=null,this.responsecode=null,this.interval=null,this.trace=[],this._stream=null,this._tfinish=null,this._mediaduration=null,this._quality=null,this._responseHeaders=null,this._serviceLocation=null},a=function e(){r(this,e),this.s=null,this.d=null,this.b=[],this.t=null};i.GET="GET",i.HEAD="HEAD",i.MPD_TYPE="MPD",i.XLINK_EXPANSION_TYPE="XLinkExpansion",i.INIT_SEGMENT_TYPE="InitializationSegment",i.INDEX_SEGMENT_TYPE="IndexSegment",i.MEDIA_SEGMENT_TYPE="MediaSegment",i.BITSTREAM_SWITCHING_SEGMENT_TYPE="BitstreamSwitchingSegment",i.MSS_FRAGMENT_INFO_SEGMENT_TYPE="FragmentInfoSegment",i.LICENSE="license",i.OTHER_TYPE="other"},"./src/streaming/vo/metrics/ManifestUpdate.js":function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.r(t),n.d(t,"ManifestUpdate",(function(){return i})),n.d(t,"ManifestUpdateStreamInfo",(function(){return a})),n.d(t,"ManifestUpdateRepresentationInfo",(function(){return s}));var i=function e(){r(this,e),this.mediaType=null,this.type=null,this.requestTime=null,this.fetchTime=null,this.availabilityStartTime=null,this.presentationStartTime=0,this.clientTimeOffset=0,this.currentTime=null,this.buffered=null,this.latency=0,this.streamInfo=[],this.representationInfo=[]},a=function e(){r(this,e),this.id=null,this.index=null,this.start=null,this.duration=null},s=function e(){r(this,e),this.id=null,this.index=null,this.mediaType=null,this.streamIndex=null,this.presentationTimeOffset=null,this.startNumber=null,this.fragmentInfoType=null}},"./src/streaming/vo/metrics/PlayList.js":function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.r(t),n.d(t,"PlayList",(function(){return i})),n.d(t,"PlayListTrace",(function(){return a}));var i=function e(){r(this,e),this.start=null,this.mstart=null,this.starttype=null,this.trace=[]};i.INITIAL_PLAYOUT_START_REASON="initial_playout",i.SEEK_START_REASON="seek",i.RESUME_FROM_PAUSE_START_REASON="resume",i.METRICS_COLLECTION_START_REASON="metrics_collection_start";var a=function e(){r(this,e),this.representationid=null,this.subreplevel=null,this.start=null,this.mstart=null,this.duration=null,this.playbackspeed=null,this.stopreason=null};a.REPRESENTATION_SWITCH_STOP_REASON="representation_switch",a.REBUFFERING_REASON="rebuffering",a.USER_REQUEST_STOP_REASON="user_request",a.END_OF_PERIOD_STOP_REASON="end_of_period",a.END_OF_CONTENT_STOP_REASON="end_of_content",a.METRICS_COLLECTION_STOP_REASON="metrics_collection_end",a.FAILURE_STOP_REASON="failure"},"./src/streaming/vo/metrics/RepresentationSwitch.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.mt=null,this.to=null,this.lto=null}},"./src/streaming/vo/metrics/RequestsQueue.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.loadingRequests=[],this.executedRequests=[]}},"./src/streaming/vo/metrics/SchedulingInfo.js":function(e,t,n){n.r(t),t.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mediaType=null,this.t=null,this.type=null,this.startTime=null,this.availabilityStartTime=null,this.duration=null,this.quality=null,this.range=null,this.state=null}},0:function(e,t){},1:function(e,t){}}).default},qu(Hu={exports:{}}),Hu.exports),Yu=(Gu=Vu)&&Gu.__esModule&&Object.prototype.hasOwnProperty.call(Gu,"default")?Gu.default:Gu;function Zu(e,t){var n=e.dash.mediaPlayer,r=n.getTracksFor("audio"),i=e.audioTracks();function a(e){return"dash-audio-"+e}function s(e,t){return e.find((function(e){return a(e.index)===t.id}))}i.length&&t.clearTracks(["audio"]);var o=n.getCurrentTrackFor("audio");r.forEach((function(t){var n,r;if(Array.isArray(t.labels))for(var s=0;s<t.labels.length;s++)if(t.labels[s].lang&&-1!==e.language().indexOf(t.labels[s].lang.toLowerCase())){n=t.labels[s];break}n?r=n.text:Array.isArray(t.labels)&&1===t.labels.length?r=t.labels[0].text:(r=t.lang,t.roles&&t.roles.length&&(r+=" ("+t.roles.join(", ")+")")),i.addTrack(new ju.AudioTrack({enabled:t===o,id:a(t.index),kind:t.kind||"main",label:r,language:t.lang}))}));var l=function(){for(var e=0;e<i.length;e++){var t=i[e];if(t.enabled){var a=s(r,t);n.setCurrentTrack(a)}}};i.addEventListener("change",l),e.dash.mediaPlayer.on(Yu.MediaPlayer.events.STREAM_TEARDOWN_COMPLETE,(function(){i.removeEventListener("change",l)}))}function Ku(e,t){e.dash.mediaPlayer.on(Yu.MediaPlayer.events.PLAYBACK_METADATA_LOADED,Zu.bind(null,e,t))}function zu(e,t,n){i().VTTCue&&!/\[native code\]/.test(i().VTTCue.toString())&&(i().VTTCue=!1);var r=[];if(t.featuresNativeTextTracks)ju.log.error("You must pass {html: {nativeCaptions: false}} in the videojs constructor to use text tracks in videojs-contrib-dash");else{var a=e.dash.mediaPlayer;a.on(Yu.MediaPlayer.events.TEXT_TRACKS_ADDED,s),a.on(Yu.MediaPlayer.events.CAN_PLAY,(function(){a.off(Yu.MediaPlayer.events.TEXT_TRACKS_ADDED,s)}))}function s(t){t.index;var n=t.tracks;a.off(Yu.MediaPlayer.events.TEXT_TRACKS_ADDED,s),r.forEach(e.removeRemoteTextTrack.bind(e)),r=[],n.length&&(r=function(e,t,n){var r=[],i=n.map((function(t){var n;if(Array.isArray(t.labels))for(var r=0;r<t.labels.length;r++)if(t.labels[r].lang&&-1!==e.language().indexOf(t.labels[r].lang.toLowerCase())){n=t.labels[r];break}return{dashTrack:t,trackConfig:{label:n?n.text:Array.isArray(t.labels)&&1===t.labels.length?t.labels[0].text:t.lang||t.label,language:t.lang,srclang:t.lang,kind:t.kind}}})).map((function(t){var n=t.trackConfig,i=t.dashTrack;if(i.isTTML&&!e.getChild("TTMLTextTrackDisplay"))return null;var a=e.addRemoteTextTrack(n,!1);return r.push({textTrack:a.track,dashTrack:i}),a})).filter((function(e){return null!==e}));function a(){for(var t=e.dash.mediaPlayer,i=e.textTracks(),a=-1,s=function(e){var t=i[e];if("showing"===t.mode){var s=function(e,n){for(var r=0;r<e.length;r++)if(e[r].textTrack===t)return e[r]}(r),o=s?s.dashTrack:null;o&&(a=n.indexOf(o))}},o=0;o<i.length;o+=1)s(o);a!==t.getCurrentTextTrackIndex()&&t.setTextTrack(a)}return e.textTracks().on("change",a),e.dash.mediaPlayer.on(Yu.MediaPlayer.events.STREAM_TEARDOWN_COMPLETE,(function(){e.textTracks().off("change",a)})),a(),i}(e,0,n))}}function Wu(e,t){return Wu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Wu(e,t)}function Xu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var $u=ju.getComponent("Component"),Qu="#222",Ju={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function ec(e,t,n){try{e.style[t]=n}catch(e){return}}function tc(e){for(var t in e.style&&(e.style.left=null,e.style.width="100%"),e.children)tc(e.children[t])}function nc(e,t){var n;if(4===e.length)n=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");n=e.slice(1)}return"rgba("+parseInt(n.slice(0,2),16)+","+parseInt(n.slice(2,4),16)+","+parseInt(n.slice(4,6),16)+","+t+")"}var rc=function(e){var t,n;function r(t,n,r){var i;i=e.call(this,t,ju.mergeOptions(n,{playerOptions:{}}),r)||this;for(var a=t.getChild("TextTrackSettings").$$("select"),s=0;s<a.length;s++)i.on(a[s],"change",i.updateStyle.bind(Xu(i)));return t.dash.mediaPlayer.on(Yu.MediaPlayer.events.CAPTION_RENDERED,i.updateStyle.bind(Xu(i))),i}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Wu(t,n);var a=r.prototype;return a.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-text-track-display-ttml"},{"aria-live":"off","aria-atomic":"true"});return t.style.position="absolute",t.style.left="0",t.style.right="0",t.style.top="0",t.style.bottom="0",t.style.margin="1.5%",t},a.updateStyle=function(e){var t=e.captionDiv;if(this.player_.textTrackSettings){var n=this.player_.textTrackSettings.getValues();if(t=t||this.player_.getChild("TTMLTextTrackDisplay").el().firstChild){tc(t);for(var r=t.getElementsByTagName("span"),a=0;a<r.length;a++){var s=r[a];if(s.parentNode.style.textAlign="center",n.color&&(s.style.color=n.color),n.textOpacity&&ec(s,"color",nc(n.color||"#fff",n.textOpacity)),n.backgroundColor&&(s.style.backgroundColor=n.backgroundColor),n.backgroundOpacity&&ec(s,"backgroundColor",nc(n.backgroundColor||"#000",n.backgroundOpacity)),n.windowColor&&(n.windowOpacity?ec(s.parentNode,"backgroundColor",nc(n.windowColor,n.windowOpacity)):s.parent.style.backgroundColor=n.windowColor),n.edgeStyle&&("dropshadow"===n.edgeStyle?s.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px "+Qu:"raised"===n.edgeStyle?s.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px "+Qu:"depressed"===n.edgeStyle?s.style.textShadow="1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px "+Qu:"uniform"===n.edgeStyle&&(s.style.textShadow="0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px "+Qu)),n.fontPercent&&1!==n.fontPercent){var o=i().parseFloat(s.style.fontSize);s.style.fontSize=o*n.fontPercent+"px",s.style.height="auto",s.style.top="auto",s.style.bottom="2px"}n.fontFamily&&"default"!==n.fontFamily&&("small-caps"===n.fontFamily?s.style.fontVariant="small-caps":s.style.fontFamily=Ju[n.fontFamily])}}}},r}($u);ju.registerComponent("TTMLTextTrackDisplay",rc);var ic=function(){function e(t,n,r){var i=this;if(r=r||n.options_,this.player=ju(r.playerId),this.player.dash=this.player.dash||{},this.tech_=n,this.el_=n.el(),this.elParent_=this.el_.parentNode,this.hasFiniteDuration_=!1,t.src){n.isReady_=!1,e.updateSourceData&&(ju.log.warn('updateSourceData has been deprecated. Please switch to using hook("updatesource", callback).'),t=e.updateSourceData(t)),e.hooks("updatesource").forEach((function(e){t=e(t)}));var a=t.src;this.keySystemOptions_=e.buildDashJSProtData(t.keySystemOptions),this.player.dash.mediaPlayer=Yu.MediaPlayer().create(),this.mediaPlayer_=this.player.dash.mediaPlayer,e.useVideoJSDebug&&(ju.log.warn('useVideoJSDebug has been deprecated. Please switch to using hook("beforeinitialize", callback).'),e.useVideoJSDebug(this.mediaPlayer_)),e.beforeInitialize&&(ju.log.warn('beforeInitialize has been deprecated. Please switch to using hook("beforeinitialize", callback).'),e.beforeInitialize(this.player,this.mediaPlayer_)),e.hooks("beforeinitialize").forEach((function(e){e(i.player,i.mediaPlayer_)})),this.mediaPlayer_.initialize(),this.retriggerError_=function(e){if("capability"===e.error&&"mediasource"===e.event)i.player.error({code:4,message:"The media cannot be played because it requires a feature that your browser does not support."});else if("manifestError"!==e.error||"createParser"!==e.event.id&&"codec"!==e.event.id&&"nostreams"!==e.event.id&&"nostreamscomposed"!==e.event.id&&"parse"!==e.event.id&&"multiplexedrep"!==e.event.id)if("mediasource"===e.error)e.event.match("MEDIA_ERR_ABORTED")?i.player.error({code:1,message:e.event}):e.event.match("MEDIA_ERR_NETWORK")?i.player.error({code:2,message:e.event}):e.event.match("MEDIA_ERR_DECODE")?i.player.error({code:3,message:e.event}):e.event.match("MEDIA_ERR_SRC_NOT_SUPPORTED")?i.player.error({code:4,message:e.event}):e.event.match("MEDIA_ERR_ENCRYPTED")?i.player.error({code:5,message:e.event}):(e.event.match("UNKNOWN"),i.player.error({code:4,message:e.event}));else if("capability"===e.error&&"encryptedmedia"===e.event)i.player.error({code:5,message:"The media cannot be played because it requires encryption features that your browser does not support."});else if("key_session"===e.error)i.player.error({code:5,message:e.event});else if("download"===e.error)i.player.error({code:2,message:"The media playback was aborted because too many consecutive download errors occurred."});else{if("mssError"!==e.error)return;i.player.error({code:3,message:e.event})}else i.player.error({code:4,message:e.event.message});setTimeout((function(){i.mediaPlayer_.reset()}),10)},this.mediaPlayer_.on(Yu.MediaPlayer.events.ERROR,this.retriggerError_),this.getDuration_=function(e){var t=e.data.Period_asArray,n=i.hasFiniteDuration_;e.data.mediaPresentationDuration||t[t.length-1].duration?i.hasFiniteDuration_=!0:i.hasFiniteDuration_=!1,i.hasFiniteDuration_!==n&&i.player.trigger("durationchange")},this.mediaPlayer_.on(Yu.MediaPlayer.events.MANIFEST_LOADED,this.getDuration_),r.dash&&Object.keys(r.dash).forEach((function(e){var t;if("useTTML"!==e){var n="set"+e.charAt(0).toUpperCase()+e.slice(1),a=r.dash[e];i.mediaPlayer_.hasOwnProperty(n)&&(ju.log.warn("Using dash options in videojs-contrib-dash without the set prefix has been deprecated. Change '"+e+"' to '"+n+"'"),e=n),i.mediaPlayer_.hasOwnProperty(e)?(Array.isArray(a)||(a=[a]),(t=i.mediaPlayer_)[e].apply(t,a)):ju.log.warn("Warning: dash configuration option unrecognized: "+e)}})),this.mediaPlayer_.attachView(this.el_),r.dash&&r.dash.useTTML&&(this.ttmlContainer_=this.player.addChild("TTMLTextTrackDisplay"),this.mediaPlayer_.attachTTMLRenderingDiv(this.ttmlContainer_.el())),this.mediaPlayer_.setAutoPlay(!1),Ku.call(null,this.player,n),zu.call(null,this.player,n,r),this.mediaPlayer_.setProtectionData(this.keySystemOptions_),this.mediaPlayer_.attachSource(a),this.tech_.triggerReady()}}e.buildDashJSProtData=function(e){var t={};if(!e||!Array.isArray(e))return null;for(var n=0;n<e.length;n++){var r=e[n],i=ju.mergeOptions({},r.options);i.licenseUrl&&(i.serverURL=i.licenseUrl,delete i.licenseUrl),t[r.name]=i}return t};var t=e.prototype;return t.dispose=function(){this.mediaPlayer_&&(this.mediaPlayer_.off(Yu.MediaPlayer.events.ERROR,this.retriggerError_),this.mediaPlayer_.off(Yu.MediaPlayer.events.MANIFEST_LOADED,this.getDuration_),this.mediaPlayer_.reset()),this.player.dash&&delete this.player.dash,this.ttmlContainer_&&(this.ttmlContainer_.dispose(),this.player.removeChild("TTMLTextTrackDisplay"))},t.duration=function(){return this.mediaPlayer_.isDynamic()&&!this.hasFiniteDuration_?1/0:this.mediaPlayer_.duration()},e.hooks=function(t,n){return e.hooks_[t]=e.hooks_[t]||[],n&&(e.hooks_[t]=e.hooks_[t].concat(n)),e.hooks_[t]},e.hook=function(t,n){e.hooks(t,n)},e.removeHook=function(t,n){var r=e.hooks(t).indexOf(n);return-1!==r&&(e.hooks_[t]=e.hooks_[t].slice(),e.hooks_[t].splice(r,1),!0)},e}();ic.hooks_={},ju.DashSourceHandler=function(){return{canHandleSource:function(e){return function(e){e=JSON.parse(JSON.stringify(e)),ic.updateSourceData&&(ju.log.warn('updateSourceData has been deprecated. Please switch to using hook("updatesource", callback).'),e=ic.updateSourceData(e)),ic.hooks("updatesource").forEach((function(t){e=t(e)}));var t=l().createElement("video");return!(e.keySystemOptions&&!i().navigator.requestMediaKeySystemAccess&&!t.msSetMediaKeys)}(e)?ju.DashSourceHandler.canPlayType(e.type)?"probably":/\.mpd/i.test(e.src)?"maybe":"":""},handleSource:function(e,t,n){return new ic(e,t,n)},canPlayType:function(e){return ju.DashSourceHandler.canPlayType(e)}}},ju.DashSourceHandler.canPlayType=function(e){return/^application\/dash\+xml/i.test(e)?"probably":""},i().MediaSource&&ju.getTech("Html5").registerSourceHandler(ju.DashSourceHandler(),0),ju.Html5DashJS=ic;const ac=ic},1215:(e,t,n)=>{var r=n(9223).getUint64;e.exports=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8)},i=12;0===n.version?(n.earliestPresentationTime=t.getUint32(i),n.firstOffset=t.getUint32(i+4),i+=8):(n.earliestPresentationTime=r(e.subarray(i)),n.firstOffset=r(e.subarray(i+8)),i+=16),i+=2;var a=t.getUint16(i);for(i+=2;a>0;i+=12,a--)n.references.push({referenceType:(128&e[i])>>>7,referencedSize:2147483647&t.getUint32(i),subsegmentDuration:t.getUint32(i+4),startsWithSap:!!(128&e[i+8]),sapType:(112&e[i+8])>>>4,sapDeltaTime:268435455&t.getUint32(i+8)});return n}},9458:e=>{var t,n,r,i,a,s,o,l=9e4;t=function(e){return e*l},n=function(e,t){return e*t},r=function(e){return e/l},i=function(e,t){return e/t},a=function(e,n){return t(i(e,n))},s=function(e,t){return n(r(e),t)},o=function(e,t,n){return r(n?e:e-t)},e.exports={ONE_SECOND_IN_TS:l,secondsToVideoTs:t,secondsToAudioTs:n,videoTsToSeconds:r,audioTsToSeconds:i,audioTsToVideoTs:a,videoTsToAudioTs:s,metadataTsToSeconds:o}},9223:e=>{var t=Math.pow(2,32);e.exports={getUint64:function(e){var n,r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getBigUint64?(n=r.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(n):n:r.getUint32(0)*t+r.getUint32(4)},MAX_UINT32:t}},3407:(e,t,n)=>{var r=n(8908),i=e.exports={WebVTT:n(3706),VTTCue:n(2230),VTTRegion:n(3710)};r.vttjs=i,r.WebVTT=i.WebVTT;var a=i.VTTCue,s=i.VTTRegion,o=r.VTTCue,l=r.VTTRegion;i.shim=function(){r.VTTCue=a,r.VTTRegion=s},i.restore=function(){r.VTTCue=o,r.VTTRegion=l},r.VTTCue||i.shim()},3706:(e,t,n)=>{var r=n(9144),i=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();function a(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function s(e){function t(e,t,n,r){return 3600*(0|e)+60*(0|t)+(0|n)+(0|r)/1e3}var n=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return n?n[3]?t(n[1],n[2],n[3].replace(":",""),n[4]):n[1]>59?t(n[1],n[2],0,n[4]):t(0,n[1],n[2],n[4]):null}function o(){this.values=i(null)}function l(e,t,n,r){var i=r?e.split(r):[e];for(var a in i)if("string"==typeof i[a]){var s=i[a].split(n);2===s.length&&t(s[0].trim(),s[1].trim())}}function u(e,t,n){var r=e;function i(){var t=s(e);if(null===t)throw new a(a.Errors.BadTimeStamp,"Malformed timestamp: "+r);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function u(){e=e.replace(/^\s+/,"")}if(u(),t.startTime=i(),u(),"--\x3e"!==e.substr(0,3))throw new a(a.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+r);e=e.substr(3),u(),t.endTime=i(),u(),function(e,t){var r=new o;l(e,(function(e,t){switch(e){case"region":for(var i=n.length-1;i>=0;i--)if(n[i].id===t){r.set(e,n[i].region);break}break;case"vertical":r.alt(e,t,["rl","lr"]);break;case"line":var a=t.split(","),s=a[0];r.integer(e,s),r.percent(e,s)&&r.set("snapToLines",!1),r.alt(e,s,["auto"]),2===a.length&&r.alt("lineAlign",a[1],["start","center","end"]);break;case"position":a=t.split(","),r.percent(e,a[0]),2===a.length&&r.alt("positionAlign",a[1],["start","center","end"]);break;case"size":r.percent(e,t);break;case"align":r.alt(e,t,["start","center","end","left","right"])}}),/:/,/\s/),t.region=r.get("region",null),t.vertical=r.get("vertical","");try{t.line=r.get("line","auto")}catch(e){}t.lineAlign=r.get("lineAlign","start"),t.snapToLines=r.get("snapToLines",!0),t.size=r.get("size",100);try{t.align=r.get("align","center")}catch(e){t.align=r.get("align","middle")}try{t.position=r.get("position","auto")}catch(e){t.position=r.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=r.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}(e,t)}a.prototype=i(Error.prototype),a.prototype.constructor=a,a.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},o.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,n){for(var r=0;r<n.length;++r)if(t===n[r]){this.set(e,t);break}},integer:function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},percent:function(e,t){return!!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(t=parseFloat(t))>=0&&t<=100)&&(this.set(e,t),!0)}};var c=r.createElement&&r.createElement("textarea"),d={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},f={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)"},h={v:"title",lang:"lang"},p={rt:"ruby"};function g(e,t){function n(){if(!t)return null;var e,n=t.match(/^([^<]*)(<[^>]*>?)?/);return e=n[1]?n[1]:n[2],t=t.substr(e.length),e}function r(e){return c.innerHTML=e,e=c.textContent,c.textContent="",e}function i(e,t){return!p[t.localName]||p[t.localName]===e.localName}function a(t,n){var r=d[t];if(!r)return null;var i=e.document.createElement(r),a=h[t];return a&&n&&(i[a]=n.trim()),i}for(var o,l=e.document.createElement("div"),u=l,g=[];null!==(o=n());)if("<"!==o[0])u.appendChild(e.document.createTextNode(r(o)));else{if("/"===o[1]){g.length&&g[g.length-1]===o.substr(2).replace(">","")&&(g.pop(),u=u.parentNode);continue}var m,y=s(o.substr(1,o.length-2));if(y){m=e.document.createProcessingInstruction("timestamp",y),u.appendChild(m);continue}var v=o.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!v)continue;if(!(m=a(v[1],v[3])))continue;if(!i(u,m))continue;if(v[2]){var _=v[2].split(".");_.forEach((function(e){var t=/^bg_/.test(e),n=t?e.slice(3):e;if(f.hasOwnProperty(n)){var r=t?"background-color":"color",i=f[n];m.style[r]=i}})),m.className=_.join(" ")}g.push(v[1]),u.appendChild(m),u=m}return l}var m=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function y(e){for(var t=0;t<m.length;t++){var n=m[t];if(e>=n[0]&&e<=n[1])return!0}return!1}function v(e){var t=[],n="";if(!e||!e.childNodes)return"ltr";function r(e,t){for(var n=t.childNodes.length-1;n>=0;n--)e.push(t.childNodes[n])}function i(e){if(!e||!e.length)return null;var t=e.pop(),n=t.textContent||t.innerText;if(n){var a=n.match(/^.*(\n|\r)/);return a?(e.length=0,a[0]):n}return"ruby"===t.tagName?i(e):t.childNodes?(r(e,t),i(e)):void 0}for(r(t,e);n=i(t);)for(var a=0;a<n.length;a++)if(y(n.charCodeAt(a)))return"rtl";return"ltr"}function _(){}function T(e,t,n){_.call(this),this.cue=t,this.cueDiv=g(e,t.text);var r={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(r,this.cueDiv),this.div=e.document.createElement("div"),r={direction:v(this.cueDiv),writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:"middle"===t.align?"center":t.align,font:n.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(r),this.div.appendChild(this.cueDiv);var i=0;switch(t.positionAlign){case"start":case"line-left":i=t.position;break;case"center":i=t.position-t.size/2;break;case"end":case"line-right":i=t.position-t.size}""===t.vertical?this.applyStyles({left:this.formatStyle(i,"%"),width:this.formatStyle(t.size,"%")}):this.applyStyles({top:this.formatStyle(i,"%"),height:this.formatStyle(t.size,"%")}),this.move=function(e){this.applyStyles({top:this.formatStyle(e.top,"px"),bottom:this.formatStyle(e.bottom,"px"),left:this.formatStyle(e.left,"px"),right:this.formatStyle(e.right,"px"),height:this.formatStyle(e.height,"px"),width:this.formatStyle(e.width,"px")})}}function E(e){var t,n,r,i;if(e.div){n=e.div.offsetHeight,r=e.div.offsetWidth,i=e.div.offsetTop;var a=(a=e.div.childNodes)&&(a=a[0])&&a.getClientRects&&a.getClientRects();e=e.div.getBoundingClientRect(),t=a?Math.max(a[0]&&a[0].height||0,e.height/a.length):0}this.left=e.left,this.right=e.right,this.top=e.top||i,this.height=e.height||n,this.bottom=e.bottom||i+(e.height||n),this.width=e.width||r,this.lineHeight=void 0!==t?t:e.lineHeight}function b(e,t,n,r){var i=new E(t),a=t.cue,s=function(e){if("number"==typeof e.line&&(e.snapToLines||e.line>=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,n=t.textTrackList,r=0,i=0;i<n.length&&n[i]!==t;i++)"showing"===n[i].mode&&r++;return-1*++r}(a),o=[];if(a.snapToLines){var l;switch(a.vertical){case"":o=["+y","-y"],l="height";break;case"rl":o=["+x","-x"],l="width";break;case"lr":o=["-x","+x"],l="width"}var u=i.lineHeight,c=u*Math.round(s),d=n[l]+u,f=o[0];Math.abs(c)>d&&(c=c<0?-1:1,c*=Math.ceil(d/u)*u),s<0&&(c+=""===a.vertical?n.height:n.width,o=o.reverse()),i.move(f,c)}else{var h=i.lineHeight/n.height*100;switch(a.lineAlign){case"center":s-=h/2;break;case"end":s-=h}switch(a.vertical){case"":t.applyStyles({top:t.formatStyle(s,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(s,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(s,"%")})}o=["+y","-x","+x","-y"],i=new E(t)}var p=function(e,t){for(var i,a=new E(e),s=1,o=0;o<t.length;o++){for(;e.overlapsOppositeAxis(n,t[o])||e.within(n)&&e.overlapsAny(r);)e.move(t[o]);if(e.within(n))return e;var l=e.intersectPercentage(n);s>l&&(i=new E(e),s=l),e=new E(a)}return i||a}(i,o);t.move(p.toCSSCompatValues(n))}function S(){}_.prototype.applyStyles=function(e,t){for(var n in t=t||this.div,e)e.hasOwnProperty(n)&&(t.style[n]=e[n])},_.prototype.formatStyle=function(e,t){return 0===e?0:e+t},T.prototype=i(_.prototype),T.prototype.constructor=T,E.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},E.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top},E.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++)if(this.overlaps(e[t]))return!0;return!1},E.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},E.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.left<e.left;case"-x":return this.right>e.right;case"+y":return this.top<e.top;case"-y":return this.bottom>e.bottom}},E.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},E.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},E.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,n=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,r=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||r,height:e.height||t,bottom:e.bottom||r+(e.height||t),width:e.width||n}},S.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},S.convertCueToDOMTree=function(e,t){return e&&t?g(e,t):null},S.processCues=function(e,t,n){if(!e||!t||!n)return null;for(;n.firstChild;)n.removeChild(n.firstChild);var r=e.document.createElement("div");if(r.style.position="absolute",r.style.left="0",r.style.right="0",r.style.top="0",r.style.bottom="0",r.style.margin="1.5%",n.appendChild(r),function(e){for(var t=0;t<e.length;t++)if(e[t].hasBeenReset||!e[t].displayState)return!0;return!1}(t)){var i=[],a=E.getSimpleBoxPosition(r),s={font:Math.round(.05*a.height*100)/100+"px sans-serif"};!function(){for(var n,o,l=0;l<t.length;l++)o=t[l],n=new T(e,o,s),r.appendChild(n.div),b(0,n,a,i),o.displayState=n.div,i.push(E.getSimpleBoxPosition(n))}()}else for(var o=0;o<t.length;o++)r.appendChild(t[o].displayState)},S.Parser=function(e,t,n){n||(n=t,t={}),t||(t={}),this.window=e,this.vttjs=t,this.state="INITIAL",this.buffer="",this.decoder=n||new TextDecoder("utf8"),this.regionList=[]},S.Parser.prototype={reportOrThrowError:function(e){if(!(e instanceof a))throw e;this.onparsingerror&&this.onparsingerror(e)},parse:function(e){var t,n=this;function r(){for(var e=n.buffer,t=0;t<e.length&&"\r"!==e[t]&&"\n"!==e[t];)++t;var r=e.substr(0,t);return"\r"===e[t]&&++t,"\n"===e[t]&&++t,n.buffer=e.substr(t),r}e&&(n.buffer+=n.decoder.decode(e,{stream:!0}));try{var i;if("INITIAL"===n.state){if(!/\r\n|\n/.test(n.buffer))return this;var c=(i=r()).match(/^WEBVTT([ \t].*)?$/);if(!c||!c[0])throw new a(a.Errors.BadSignature);n.state="HEADER"}for(var d=!1;n.buffer;){if(!/\r\n|\n/.test(n.buffer))return this;switch(d?d=!1:i=r(),n.state){case"HEADER":/:/.test(i)?(t=i).match(/X-TIMESTAMP-MAP/)?l(t,(function(e,t){"X-TIMESTAMP-MAP"===e&&function(e){var t=new o;l(e,(function(e,n){switch(e){case"MPEGT":t.integer(e+"S",n);break;case"LOCA":t.set(e+"L",s(n))}}),/[^\d]:/,/,/),n.ontimestampmap&&n.ontimestampmap({MPEGTS:t.get("MPEGTS"),LOCAL:t.get("LOCAL")})}(t)}),/=/):l(t,(function(e,t){"Region"===e&&function(e){var t=new o;if(l(e,(function(e,n){switch(e){case"id":t.set(e,n);break;case"width":t.percent(e,n);break;case"lines":t.integer(e,n);break;case"regionanchor":case"viewportanchor":var r=n.split(",");if(2!==r.length)break;var i=new o;if(i.percent("x",r[0]),i.percent("y",r[1]),!i.has("x")||!i.has("y"))break;t.set(e+"X",i.get("x")),t.set(e+"Y",i.get("y"));break;case"scroll":t.alt(e,n,["up"])}}),/=/,/\s/),t.has("id")){var r=new(n.vttjs.VTTRegion||n.window.VTTRegion);r.width=t.get("width",100),r.lines=t.get("lines",3),r.regionAnchorX=t.get("regionanchorX",0),r.regionAnchorY=t.get("regionanchorY",100),r.viewportAnchorX=t.get("viewportanchorX",0),r.viewportAnchorY=t.get("viewportanchorY",100),r.scroll=t.get("scroll",""),n.onregion&&n.onregion(r),n.regionList.push({id:t.get("id"),region:r})}}(t)}),/:/):i||(n.state="ID");continue;case"NOTE":i||(n.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(i)){n.state="NOTE";break}if(!i)continue;n.cue=new(n.vttjs.VTTCue||n.window.VTTCue)(0,0,"");try{n.cue.align="center"}catch(e){n.cue.align="middle"}if(n.state="CUE",-1===i.indexOf("--\x3e")){n.cue.id=i;continue}case"CUE":try{u(i,n.cue,n.regionList)}catch(e){n.reportOrThrowError(e),n.cue=null,n.state="BADCUE";continue}n.state="CUETEXT";continue;case"CUETEXT":var f=-1!==i.indexOf("--\x3e");if(!i||f&&(d=!0)){n.oncue&&n.oncue(n.cue),n.cue=null,n.state="ID";continue}n.cue.text&&(n.cue.text+="\n"),n.cue.text+=i.replace(/\u2028/g,"\n").replace(/u2029/g,"\n");continue;case"BADCUE":i||(n.state="ID");continue}}}catch(e){n.reportOrThrowError(e),"CUETEXT"===n.state&&n.cue&&n.oncue&&n.oncue(n.cue),n.cue=null,n.state="INITIAL"===n.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var e=this;try{if(e.buffer+=e.decoder.decode(),(e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state)throw new a(a.Errors.BadSignature)}catch(t){e.reportOrThrowError(t)}return e.onflush&&e.onflush(),this}},e.exports=S},2230:e=>{var t={"":1,lr:1,rl:1},n={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function r(e){return"string"==typeof e&&!!n[e.toLowerCase()]&&e.toLowerCase()}function i(e,n,i){this.hasBeenReset=!1;var a="",s=!1,o=e,l=n,u=i,c=null,d="",f=!0,h="auto",p="start",g="auto",m="auto",y=100,v="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return a},set:function(e){a=""+e}},pauseOnExit:{enumerable:!0,get:function(){return s},set:function(e){s=!!e}},startTime:{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");o=e,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return l},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");l=e,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return u},set:function(e){u=""+e,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return c},set:function(e){c=e,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return d},set:function(e){var n=function(e){return"string"==typeof e&&!!t[e.toLowerCase()]&&e.toLowerCase()}(e);if(!1===n)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");d=n,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return f},set:function(e){f=!!e,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return h},set:function(e){if("number"!=typeof e&&"auto"!==e)throw new SyntaxError("Line: an invalid number or illegal string was specified.");h=e,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return p},set:function(e){var t=r(e);t?(p=t,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return g},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");g=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return m},set:function(e){var t=r(e);t?(m=t,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return y},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");y=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return v},set:function(e){var t=r(e);if(!t)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");v=t,this.hasBeenReset=!0}}}),this.displayState=void 0}i.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},e.exports=i},3710:e=>{var t={"":!0,up:!0};function n(e){return"number"==typeof e&&e>=0&&e<=100}e.exports=function(){var e=100,r=3,i=0,a=100,s=0,o=100,l="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!n(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return r},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");r=e}},regionAnchorY:{enumerable:!0,get:function(){return a},set:function(e){if(!n(e))throw new Error("RegionAnchorX must be between 0 and 100.");a=e}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!n(e))throw new Error("RegionAnchorY must be between 0 and 100.");i=e}},viewportAnchorY:{enumerable:!0,get:function(){return o},set:function(e){if(!n(e))throw new Error("ViewportAnchorY must be between 0 and 100.");o=e}},viewportAnchorX:{enumerable:!0,get:function(){return s},set:function(e){if(!n(e))throw new Error("ViewportAnchorX must be between 0 and 100.");s=e}},scroll:{enumerable:!0,get:function(){return l},set:function(e){var n=function(e){return"string"==typeof e&&!!t[e.toLowerCase()]&&e.toLowerCase()}(e);!1===n?console.warn("Scroll: an invalid or illegal string was specified."):l=n}}})}},5893:()=>{},434:e=>{function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(this,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},7462:(e,t,n)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}n.d(t,{Z:()=>r})}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var a=t[r]={exports:{}};return e[r].call(a.exports,a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e=n(5176),t=n.n(e),r=n(9755),i=r;n(6891),n(3430),n(7440),n(9459),n(3033),n(825),n.g.dashjs=t(),n.g.$=r,n.g.jQuery=i})()})();
\ No newline at end of file