PageSourceSearch

https://assets.tag24.de/dist/de/js/chunks/7650Legacy.49e857f321fd5c417854.js

js tag24.de collected 2026-09-24 08:47:58 UTC 770,417 bytes, 2 lines download raw bytes

1/*! For license information please see 7650Legacy.js.LICENSE.txt */
2(self.webpackChunk=self.webpackChunk||[]).push([[7650],{6483:function(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 i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(null,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},2925:function(e,t,n){"use strict";var i=n(7954);e.exports=function(e,t){return void 0===t&&(t=!1),function(n,r,a){if(n)e(n);else if(r.statusCode>=400&&r.statusCode<=599){var s=a;if(t)if(i.TextDecoder){var o=function(e){void 0===e&&(e="");return e.toLowerCase().split(";").reduce(function(e,t){var n=t.split("="),i=n[0],r=n[1];return"charset"===i.trim()?r.trim():e},"utf-8")}(r.headers&&r.headers["content-type"]);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)}}},9208:function(e){"use strict";function t(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return n(e,t)}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var i=function(){function e(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var n=e.prototype;return n.getIsEnabled=function(){return this.enabled_},n.enable=function(){this.enabled_=!0},n.disable=function(){this.enabled_=!1},n.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},n.addInterceptor=function(e,t){this.typeToInterceptorsMap_.has(e)||this.typeToInterceptorsMap_.set(e,new Set);var n=this.typeToInterceptorsMap_.get(e);return!n.has(t)&&(n.add(t),!0)},n.removeInterceptor=function(e,t){var n=this.typeToInterceptorsMap_.get(e);return!(!n||!n.has(t))&&(n.delete(t),!0)},n.clearInterceptorsByType=function(e){return!!this.typeToInterceptorsMap_.get(e)&&(this.typeToInterceptorsMap_.delete(e),this.typeToInterceptorsMap_.set(e,new Set),!0)},n.clear=function(){return!!this.typeToInterceptorsMap_.size&&(this.typeToInterceptorsMap_=new Map,!0)},n.getForType=function(e){return this.typeToInterceptorsMap_.get(e)||new Set},n.execute=function(e,n){for(var i,r=t(this.getForType(e));!(i=r()).done;){var a=i.value;try{n=a(n)}catch(e){}}return n},e}();e.exports=i},7448:function(e){"use strict";var t=function(){function e(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1}var t=e.prototype;return t.getIsEnabled=function(){return this.enabled_},t.enable=function(){this.enabled_=!0},t.disable=function(){this.enabled_=!1},t.reset=function(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1},t.getMaxAttempts=function(){return this.maxAttempts_},t.setMaxAttempts=function(e){this.maxAttempts_=e},t.getDelayFactor=function(){return this.delayFactor_},t.setDelayFactor=function(e){this.delayFactor_=e},t.getFuzzFactor=function(){return this.fuzzFactor_},t.setFuzzFactor=function(e){this.fuzzFactor_=e},t.getInitialDelay=function(){return this.initialDelay_},t.setInitialDelay=function(e){this.initialDelay_=e},t.createRetry=function(e){var t=void 0===e?{}:e,i=t.maxAttempts,r=t.delayFactor,a=t.fuzzFactor,s=t.initialDelay;return new n({maxAttempts:i||this.maxAttempts_,delayFactor:r||this.delayFactor_,fuzzFactor:a||this.fuzzFactor_,initialDelay:s||this.initialDelay_})},e}(),n=function(){function e(e){this.maxAttempts_=e.maxAttempts,this.delayFactor_=e.delayFactor,this.fuzzFactor_=e.fuzzFactor,this.currentDelay_=e.initialDelay,this.currentAttempt_=1}var t=e.prototype;return t.moveToNextAttempt=function(){this.currentAttempt_++;var e=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+e},t.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},t.getCurrentDelay=function(){return this.currentDelay_},t.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},t.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},t.getCurrentFuzzedDelay=function(){var e=this.getCurrentMinPossibleDelay(),t=this.getCurrentMaxPossibleDelay();return e+Math.random()*(t-e)},e}();e.exports=t},6031:function(e,t,n){var i,r=void 0!==n.g?n.g:"undefined"!=typeof window?window:{},a=n(4626);"undefined"!=typeof document?i=document:(i=r["__GLOBAL_DOCUMENT_CACHE@4"])||(i=r["__GLOBAL_DOCUMENT_CACHE@4"]=a),e.exports=i},7954:function(e,t,n){var i;i="undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},e.exports=i},7826:function(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},7401:function(e,t){"use strict";function n(e){return n="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},n(e)}function i(e,t){return void 0===t&&(t=Object),t&&"function"==typeof t.freeze?t.freeze(e):e}var r=i({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"}),a=i({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===a.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"}),s=/[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]/,o=new RegExp("[\\-\\.0-9"+s.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),u=new RegExp("^"+s.source+o.source+"*(?::"+s.source+o.source+"*)?$");t.assign=function(e,t){if(null===e||"object"!==n(e))throw new TypeError("target is not an object");for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);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 i=0;i<e.length;i++)if(Object.prototype.hasOwnProperty.call(e,i)){var r=e[i];if(t.call(void 0,r,i,e))return r}},t.freeze=i,t.MIME_TYPE=r,t.NAMESPACE=a,t.nameStartChar=s,t.nameChar=o,t.tagNamePattern=u},5941:function(e,t,n){var i=n(7401),r=n(9773),a=n(6306),s=n(3265),o=r.DOMImplementation,u=i.NAMESPACE,l=s.ParseError,c=s.XMLReader;function d(e){return e.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function h(e){this.options=e||{locator:{}}}function p(){this.cdata=!1}function f(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function m(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function g(e,t,n){return"string"==typeof e?e.substr(t,n):e.length>
vendor: 4,287 bytes, line 2
2=t+n||t?new java.lang.String(e,t,n)+"":e}function v(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}h.prototype.parseFromString=function(e,t){var n=this.options,i=new c,r=n.domBuilder||new p,s=n.errorHandler,o=n.locator,l=n.xmlns||{},h=/\/x?html?$/.test(t),f=h?a.HTML_ENTITIES:a.XML_ENTITIES;o&&r.setDocumentLocator(o),i.errorHandler=function(e,t,n){if(!e){if(t instanceof p)return t;e=t}var i={},r=e instanceof Function;function a(t){var a=e[t];!a&&r&&(a=2==e.length?function(n){e(t,n)}:e),i[t]=a&&function(e){a("[xmldom "+t+"]\t"+e+m(n))}||function(){}}return n=n||{},a("warning"),a("error"),a("fatalError"),i}(s,r,o),i.domBuilder=n.domBuilder||r,h&&(l[""]=u.HTML),l.xml=l.xml||u.XML;var g=n.normalizeLineEndings||d;return e&&"string"==typeof e?i.parse(g(e),l,f):i.errorHandler.error("invalid doc source"),r.doc},p.prototype={startDocument:function(){this.doc=(new o).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,i){var r=this.doc,a=r.createElementNS(e,n||t),s=i.length;v(this,a),this.currentElement=a,this.locator&&f(this.locator,a);for(var o=0;o<s;o++){e=i.getURI(o);var u=i.getValue(o),l=(n=i.getQName(o),r.createAttributeNS(e,n));this.locator&&f(i.getLocator(o),l),l.value=l.nodeValue=u,a.setAttributeNode(l)}},endElement:function(e,t,n){var i=this.currentElement;i.tagName;this.currentElement=i.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var n=this.doc.createProcessingInstruction(e,t);this.locator&&f(this.locator,n),v(this,n)},ignorableWhitespace:function(e,t,n){},characters:function(e,t,n){if(e=g.apply(this,arguments)){if(this.cdata)var i=this.doc.createCDATASection(e);else i=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(i):/^\s*$/.test(e)&&this.doc.appendChild(i),this.locator&&f(this.locator,i)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,n){e=g.apply(this,arguments);var i=this.doc.createComment(e);this.locator&&f(this.locator,i),v(this,i)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,n){var i=this.doc.implementation;if(i&&i.createDocumentType){var r=i.createDocumentType(e,t,n);this.locator&&f(this.locator,r),v(this,r),this.doc.doctype=r}},warning:function(e){console.warn("[xmldom warning]\t"+e,m(this.locator))},error:function(e){console.error("[xmldom error]\t"+e,m(this.locator))},fatalError:function(e){throw new l(e,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(e){p.prototype[e]=function(){return null}}),t.DOMParser=h},9773:function(e,t,n){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)}var r=n(7401),a=r.find,s=r.NAMESPACE,o=r.tagNamePattern;function u(e){return""!==e}function l(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function c(e){if(!e)return[];var t=function(e){return e?e.split(/[\t\n\f\r ]+/).filter(u):[]}(e);return Object.keys(t.reduce(l,{}))}function d(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}function h(e,t){var n=e.prototype;if(!(n instanceof t)){var i=function(){};i.prototype=t.prototype,d(n,i=new i),e.prototype=n=i}n.constructor!=e&&("function"!=typeof e&&console.error("unknown Class:"+e),n.constructor=e)}var p={},f=p.ELEMENT_NODE=1,m=p.ATTRIBUTE_NODE=2,g=p.TEXT_NODE=3,v=p.CDATA_SECTION_NODE=4,y=p.ENTITY_REFERENCE_NODE=5,_=p.ENTITY_NODE=6,b=p.PROCESSING_INSTRUCTION_NODE=7,T=p.COMMENT_NODE=8,k=p.DOCUMENT_NODE=9,S=p.DOCUMENT_TYPE_NODE=10,w=p.DOCUMENT_FRAGMENT_NODE=11,E=p.NOTATION_NODE=12,C={},I={},x=(C.INDEX_SIZE_ERR=(I[1]="Index size error",1),C.DOMSTRING_SIZE_ERR=(I[2]="DOMString size error",2),C.HIERARCHY_REQUEST_ERR=(I[3]="Hierarchy request error",3)),A=(C.WRONG_DOCUMENT_ERR=(I[4]="Wrong document",4),C.INVALID_CHARACTER_ERR=(I[5]="Invalid character",5)),D=(C.NO_DATA_ALLOWED_ER
2R=(I[6]="No data allowed",6),C.NO_MODIFICATION_ALLOWED_ERR=(I[7]="No modification allowed",7),C.NOT_FOUND_ERR=(I[8]="Not found",8)),P=(C.NOT_SUPPORTED_ERR=(I[9]="Not supported",9),C.INUSE_ATTRIBUTE_ERR=(I[10]="Attribute in use",10)),L=C.INVALID_STATE_ERR=(I[11]="Invalid state",11);C.SYNTAX_ERR=(I[12]="Syntax error",12),C.INVALID_MODIFICATION_ERR=(I[13]="Invalid modification",13),C.NAMESPACE_ERR=(I[14]="Invalid namespace",14),C.INVALID_ACCESS_ERR=(I[15]="Invalid access",15);function O(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,I[e]),this.message=I[e],Error.captureStackTrace&&Error.captureStackTrace(this,O);return n.code=e,t&&(this.message=this.message+": "+t),n}function R(){}function M(e,t){this._node=e,this._refresh=t,N(this)}function N(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var n=e._refresh(e._node);if(Ee(e,"length",n.length),!e.$$length||n.length<e.$$length)for(var i=n.length;i in e;i++)Object.prototype.hasOwnProperty.call(e,i)&&delete e[i];d(n,e),e._inc=t}}function U(){this._nameIndex=Object.create(null)}function B(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function F(e,t){e._nameIndex[t.nodeName]===t&&delete e._nameIndex[t.nodeName]}function q(e,t,n,i){if(i?(t[B(t,i)]=n,F(t,i)):t[t.length++]=n,function(e,t){e._nameIndex[t.nodeName]=t}(t,n),e){n.ownerElement=e;var r=e.ownerDocument;r&&(i&&K(r,e,i),function(e,t,n){e&&e._inc++;var i=n.namespaceURI;i===s.XMLNS&&(t._nsMap[n.prefix?n.localName:""]=n.value)}(r,e,n))}}function j(e,t,n){var i=B(t,n);if(!(i>=0))throw new O(D,new Error(e.tagName+"@"+n));for(var r=t.length-1;i<r;)t[i]=t[++i];if(t.length=r,F(t,n),e){var a=e.ownerDocument;a&&(K(a,e,n),n.ownerElement=null)}}function H(){}function V(){}function z(e){return("<"==e?"&lt;":">"==e&&"&gt;")||"&"==e&&"&amp;"||'"'==e&&"&quot;"||"&#"+e.charCodeAt()+";"}function W(e,t){return G(e,null,{enter:function(e){return!t(e)||G.STOP}})===G.STOP}function G(e,t,n){for(var i=[{node:e,context:t,phase:G.ENTER}];i.length>0;){var r=i.pop();if(r.phase===G.ENTER){var a=n.enter(r.node,r.context);if(a===G.STOP)return G.STOP;if(i.push({node:r.node,context:a,phase:G.EXIT}),null==a)continue;for(var s=r.node.lastChild;s;)i.push({node:s,context:a,phase:G.ENTER}),s=s.previousSibling}else n.exit&&n.exit(r.node,r.context)}}function X(){this.ownerDocument=this}function K(e,t,n,i){e&&e._inc++,n.namespaceURI===s.XMLNS&&delete t._nsMap[n.prefix?n.localName:""]}function Y(e,t,n){if(e&&e._inc){e._inc++;var i=t.childNodes;if(n)i[i.length++]=n;else{for(var r=t.firstChild,a=0;r;)i[a++]=r,r=r.nextSibling;i.length=a,delete i[i.length]}}}function Q(e,t){var n=t.previousSibling,i=t.nextSibling;return n?n.nextSibling=i:e.firstChild=i,i?i.previousSibling=n:e.lastChild=n,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,Y(e.ownerDocument,e),t}function $(e){return e&&e.nodeType===V.DOCUMENT_TYPE_NODE}function J(e){return e&&e.nodeType===V.ELEMENT_NODE}function Z(e){return e&&e.nodeType===V.TEXT_NODE}function ee(e,t){var n=e.childNodes||[];if(a(n,J)||$(t))return!1;var i=a(n,$);return!(t&&i&&n.indexOf(i)>n.indexOf(t))}function te(e,t){var n=e.childNodes||[];if(a(n,function(e){return J(e)&&e!==t}))return!1;var i=a(n,$);return!(t&&i&&n.indexOf(i)>n.indexOf(t))}function ne(e,t,n){if(!function(e){return e&&(e.nodeType===V.DOCUMENT_NODE||e.nodeType===V.DOCUMENT_FRAGMENT_NODE||e.nodeType===V.ELEMENT_NODE)}(e))throw new O(x,"Unexpected parent node type "+e.nodeType);if(n&&n.parentNode!==e)throw new O(D,"child not in parent");if(!function(e){return e&&(J(e)||Z(e)||$(e)||e.nodeType===V.DOCUMENT_FRAGMENT_NODE||e.nodeType===V.COMMENT_NODE||e.nodeType===V.PROCESSING_INSTRUCTION_NODE)}(t)||$(t)&&e.nodeType!==V.DOCUMENT_NODE)throw new O(x,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)}function ie(e,t,n){var i=e.childNodes||[],r=t.childNodes||[];
2if(t.nodeType===V.DOCUMENT_FRAGMENT_NODE){var s=r.filter(J);if(s.length>1||a(r,Z))throw new O(x,"More than one element or text in fragment");if(1===s.length&&!ee(e,n))throw new O(x,"Element in fragment can not be inserted before doctype")}if(J(t)&&!ee(e,n))throw new O(x,"Only one element can be added and only after doctype");if($(t)){if(a(i,$))throw new O(x,"Only one doctype is allowed");var o=a(i,J);if(n&&i.indexOf(o)<i.indexOf(n))throw new O(x,"Doctype can only be inserted before an element");if(!n&&o)throw new O(x,"Doctype can not be appended since element is present")}}function re(e,t,n){var i=e.childNodes||[],r=t.childNodes||[];if(t.nodeType===V.DOCUMENT_FRAGMENT_NODE){var s=r.filter(J);if(s.length>1||a(r,Z))throw new O(x,"More than one element or text in fragment");if(1===s.length&&!te(e,n))throw new O(x,"Element in fragment can not be inserted before doctype")}if(J(t)&&!te(e,n))throw new O(x,"Only one element can be added and only after doctype");if($(t)){if(a(i,function(e){return $(e)&&e!==n}))throw new O(x,"Only one doctype is allowed");var o=a(i,J);if(n&&i.indexOf(o)<i.indexOf(n))throw new O(x,"Doctype can only be inserted before an element")}}function ae(e,t,n,i){ne(e,t,n),e.nodeType===V.DOCUMENT_NODE&&(i||ie)(e,t,n);var r=t.parentNode;if(r&&r.removeChild(t),t.nodeType===w){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,se(a,e.ownerDocument||e)}while(a!==s&&(a=a.nextSibling));return Y(e.ownerDocument||e,e),t.nodeType==w&&(t.firstChild=t.lastChild=null),t}function se(e,t){if(e.ownerDocument!==t){if(e.ownerDocument=t,e.nodeType===f&&e.attributes)for(var n=0;n<e.attributes.length;n++){var i=e.attributes.item(n);i&&(i.ownerDocument=t)}for(var r=e.firstChild;r;)se(r,t),r=r.nextSibling}}function oe(){this._nsMap={}}function ue(){}function le(){}function ce(){}function de(){}function he(){}function pe(){}function fe(){}function me(){}function ge(){}function ve(){}function ye(){}function _e(){}function be(e,t,n){var i=!!n&&!!n.requireWellFormed,r=[],a=9==this.nodeType&&this.documentElement||this,s=a.prefix,o=a.namespaceURI;if(o&&null==s&&null==(s=a.lookupPrefix(o)))var u=[{namespace:o,prefix:null}];return Se(this,r,e,t,u,i),r.join("")}function Te(e,t,n){var i=e.prefix||"",r=e.namespaceURI;if(!r)return!1;if("xml"===i&&r===s.XML||r===s.XMLNS)return!1;for(var a=n.length;a--;){var o=n[a];if(o.prefix===i)return o.namespace!==r}return!0}function ke(e,t,n,i){if(i&&!o.test(t))throw new O(L,'The attribute name "'+t+'" is not a valid XML QName');e.push(" ",t,'="',n.replace(/[<>&"\t\n\r]/g,z),'"')}function Se(e,t,n,i,r,a){r||(r=[]),G(e,{ns:r,isHTML:n},{enter:function(e,n){var r=n.ns,u=n.isHTML;if(i){if(!(e=i(e)))return null;if("string"==typeof e)return t.push(e),null}switch(e.nodeType){case f:var l=e.attributes,c=l.length,d=e.tagName,h=d;if(!(u=s.isHTML(e.namespaceURI)||u)&&!e.prefix&&e.namespaceURI){for(var p,_=0;_<l.length;_++)if("xmlns"===l.item(_).name){p=l.item(_).value;break}if(!p)for(var E=r.length-1;E>=0;E--){if(""===(C=r[E]).prefix&&C.namespace===e.namespaceURI){p=C.namespace;break}}if(p!==e.namespaceURI)for(E=r.length-1;E>=0;E--){var C;if((C=r[E]).namespace===e.namespaceURI){C.prefix&&(h=C.prefix+":"+d);break}}}if(a&&!o.test(h))throw new O(L,'The element name "'+h+'" is not a valid XML QName');t.push("<",h);for(var I=r.slice(),x=0;x<c;x++){"xmlns"==(A=l.item(x)).prefix?I.push({prefix:A.localName,namespace:A.value}):"xmlns"==A.nodeName&&I.push({prefix:"",namespace:A.value})}for(x=0;x<c;x++){var A;if(Te(A=l.item(x),0,I)){var D=A.prefix||"",P=A.namespaceURI;ke(t,D?"xmlns:"+D:"xmlns",P,a),I.push({prefix:D,namespace:P})}var R=i?i(A):A;R&&("string"==typeof R?t.push(R):ke(t,R.name,R.value,a))}if(d===h&&Te(e,0,I)){var M=e.prefix||"";P=e.namespaceURI;ke(t,M?"xmlns:"+M:"xmlns",P,a),I.push({prefix:M,namespace:P})}var N=e.firstChild;if(N||u&&!/^(?:meta|link|img|br|hr|input)$/i.test(d)){if(t.push(">"),u&&/^script$/i.test(d)){for(;N;)N.data?t.push(N.data):Se(N,t,u,i,I.slice(),a),N=N.nextSibling;return t.push("</",d,">"),null}return{ns:I,isHTML:u,tag:h}}return t.push("/>"),null;case k:case w:return{ns:r.slice(),isHTML:u,tag:null};case m:return ke(t,e.name,e.value,a),null;case g:return t.push(e.data.replace(/[<&>]/g,z)),null;case v:if(a&&-1!==e.data.indexOf("]]>"))throw new O(L,'The CDATASection data contains "]]>"');
2return t.push("<![CDATA[",e.data.replace(/]]>/g,"]]]]><![CDATA[>"),"]]>"),null;case T:if(a&&-1!==e.data.indexOf("--\x3e"))throw new O(L,'The comment node data contains "--\x3e"');return t.push("\x3c!--",e.data,"--\x3e"),null;case S:if(a){if(!o.test(e.name))throw new O(L,'The doctype name "'+e.name+'" is not a valid XML Name');if(e.publicId&&!/^("[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%']*"|'[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%'"]*')$/.test(e.publicId))throw new O(L,"DocumentType publicId is not a valid PubidLiteral");if(e.systemId&&!/^("[^"]*"|'[^']*')$/.test(e.systemId))throw new O(L,"DocumentType systemId is not a valid SystemLiteral");if(e.internalSubset&&-1!==e.internalSubset.indexOf("]>"))throw new O(L,'DocumentType internalSubset contains "]>"')}var U=e.publicId,B=e.systemId;if(t.push("<!DOCTYPE ",e.name),U)t.push(" PUBLIC ",U),B&&"."!=B&&t.push(" ",B),t.push(">");else if(B&&"."!=B)t.push(" SYSTEM ",B,">");else{var F=e.internalSubset;F&&t.push(" [",F,"]"),t.push(">")}return null;case b:if(a){if(!o.test(e.target)||-1!==e.target.indexOf(":")||"xml"===e.target.toLowerCase())throw new O(L,'The processing instruction target "'+e.target+'" is not a valid XML NCName or is reserved');if(-1!==e.data.indexOf("?>"))throw new O(L,'The ProcessingInstruction data contains "?>"')}return t.push("<?",e.target," ",e.data,"?>"),null;case y:if(a&&!o.test(e.nodeName))throw new O(L,'The entity reference name "'+e.nodeName+'" is not a valid XML Name');return t.push("&",e.nodeName,";"),null;default:return t.push("??",e.nodeName),null}}
vendor: 5,167 bytes, line 2
2,exit:function(e,n){n&&n.tag&&t.push("</",n.tag,">")}})}function we(e,t,n){var r;return G(t,null,{enter:function(t,a){var s=new t.constructor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var u=t[o];"object"!=i(u)&&u!=s[o]&&(s[o]=u)}t.childNodes&&(s.childNodes=new R),s.ownerDocument=e;var l=n;switch(s.nodeType){case f:var c=t.attributes,d=s.attributes=new U,h=c.length;d._ownerElement=s;for(var p=0;p<h;p++)s.setAttributeNode(we(e,c.item(p),!0));break;case m:l=!0}return null!==a?a.appendChild(s):r=s,l?s:null}}),r}function Ee(e,t,n){e[t]=n}O.prototype=Error.prototype,d(C,O),R.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e,t,n){for(var i=!!n&&!!n.requireWellFormed,r=[],a=0;a<this.length;a++)Se(this[a],r,e,t,null,i);return r.join("")},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}},M.prototype.item=function(e){return N(this),this[e]||null},h(M,R),U.prototype={length:0,item:R.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 O(P);var n=this._nameIndex[e.nodeName];return q(this._ownerElement,this,e,n),n},setNamedItemNS:function(e){var t,n=e.ownerElement;if(n&&n!=this._ownerElement)throw new O(P);return t=this.getNamedItemNS(e.namespaceURI,e.localName),q(this._ownerElement,this,e,t),t},removeNamedItem:function(e){var t=this.getNamedItem(e);return j(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var n=this.getNamedItemNS(e,t);return j(this._ownerElement,this,n),n},getNamedItemNS:function(e,t){for(var n=this.length;n--;){var i=this[n];if(i.localName==t&&i.namespaceURI==e)return i}return null}},H.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,n){var i=new X;if(i.implementation=this,i.childNodes=new R,i.doctype=n||null,n&&i.appendChild(n),t){var r=i.createElementNS(e,t);i.appendChild(r)}return i},createDocumentType:function(e,t,n){var i=new pe;return i.name=e,i.nodeName=e,i.publicId=t||"",i.systemId=n||"",i}},V.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 ae(this,e,t)},replaceChild:function(e,t){ae(this,e,t,re),t&&this.removeChild(t)},removeChild:function(e){return Q(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return we(this.ownerDocument||this,this,e)},normalize:function(){G(this,null,{enter:function(e){for(var t=e.firstChild;t;){var n=t.nextSibling;if(null!==n&&n.nodeType===g&&t.nodeType===g){for(var i=[],r=n;null!==r&&r.nodeType===g;)i.push(r.data),r=r.nextSibling;for(var a=t.nextSibling;a!==r;){var s=a.nextSibling;a.parentNode=null,a.previousSibling=null,a.nextSibling=null,a=s}t.nextSibling=r,null!==r?r.previousSibling=t:e.lastChild=t,t.appendData(i.join("")),Y(e.ownerDocument,e),t=r}else t=n}return!0}})},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 i in n)if(Object.prototype.hasOwnProperty.call(n,i)&&n[i]===e)return i;t=t.nodeType==m?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==m?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},d(p,V),d(p,V.prototype),G.STOP=Symbol("walkDOM.STOP"),G.ENTER=0,G.EXIT=1,X.prototype={nodeName:"#document",nodeType:k,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==w){for(var n=e.firstChild;n;){var i=n.nextSibling;this.insertBefore(n,t),n=i}return e}return ae(this,e,t),se(e,this),null===this.documentElement&&e.nodeType===f&&(this.documentElement=e),e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),Q(this,e)},replaceChild:function(e,t){ae(this,e,t,re),se(e,this),t&&this.removeChild(t),J(e)&&(this.documentElement=e)},importNode:function(e,t){return function(e,t,n){var i;return G(t,null,{enter:function(t,r){var a=t.cloneNode(!1);return a.ownerDocument=e,a.parentNode=null,null===r?i=a:r.appendChild(a),t.nodeType===m||n?a:null}}),i}(this,e,t)},getElementById:function(e){var t=null;return W(this.documentElement,function(n){if(n.nodeType==f&&n.getAttribute("id")==e)return t=n,!0}),t},getElementsByClassName:function(e){var t=c(e);return new M(this,function(n){var i=[];return t.length>0&&W(n.documentElement,function(r){if(r!==n&&r.nodeType===f){var a=r.getAttribute("class");if(a){var s=e===a;if(!s){var o=c(a);s=t.every((u=o,function(e){return u&&-1!==u.indexOf(e)}))}s&&i.push(r)}}var u}),i})},createElement:function(e){var t=new oe;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new R,
vendor: 5,356 bytes, line 2
2(t.attributes=new U)._ownerElement=t,t},createDocumentFragment:function(){var e=new ve;return e.ownerDocument=this,e.childNodes=new R,e},createTextNode:function(e){var t=new ce;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new de;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){if(-1!==e.indexOf("]]>"))throw new O(A,'data contains "]]>"');var t=new he;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new ye;return n.ownerDocument=this,n.tagName=n.nodeName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new ue;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){if(!o.test(e))throw new O(A,'not a valid xml name "'+e+'"');var t=new ge;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new oe,i=t.split(":"),r=n.attributes=new U;return n.childNodes=new R,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,2==i.length?(n.prefix=i[0],n.localName=i[1]):n.localName=t,r._ownerElement=n,n},createAttributeNS:function(e,t){var n=new ue,i=t.split(":");return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,2==i.length?(n.prefix=i[0],n.localName=i[1]):n.localName=t,n}},h(X,V),oe.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===w?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,Y(e.ownerDocument,e,t),se(t,e.ownerDocument||e),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 i=this.ownerDocument.createAttributeNS(e,t);i.value=i.nodeValue=""+n,this.setAttributeNode(i)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new M(this,function(t){var n=[];return W(t,function(i){i===t||i.nodeType!=f||"*"!==e&&i.tagName!=e||n.push(i)}),n})},getElementsByTagNameNS:function(e,t){return new M(this,function(n){var i=[];return W(n,function(r){r===n||r.nodeType!==f||"*"!==e&&r.namespaceURI!==e||"*"!==t&&r.localName!=t||i.push(r)}),i})}},X.prototype.getElementsByTagName=oe.prototype.getElementsByTagName,X.prototype.getElementsByTagNameNS=oe.prototype.getElementsByTagNameNS,h(oe,V),ue.prototype.nodeType=m,h(ue,V),le.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(I[x])},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}},h(le,V),ce.prototype={nodeName:"#text",nodeType:g,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 i=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(i,this.nextSibling),i}},h(ce,le),de.prototype={nodeName:"#comment",nodeType:T},h(de,le),he.prototype={nodeName:"#cdata-section",nodeType:v},h(he,le),pe.prototype.nodeType=S,h(pe,V),fe.prototype.nodeType=E,h(fe,V),me.prototype.nodeType=_,h(me,V),ge.prototype.nodeType=y,h(ge,V),ve.prototype.nodeName="#document-fragment",ve.prototype.nodeType=w,h(ve,V),ye.prototype.nodeType=b,h(ye,V),_e.prototype.serializeToString=function(e,t,n,i){return be.call(e,t,n,i)},V.prototype.toString=be;try{Object.defineProperty&&(Object.defineProperty(M.prototype,"length",{get:function(){return N(this),this.$$length}}),Object.defineProperty(V.prototype,"textContent",{get:function(){if(this.nodeType===f||this.nodeType===w){var e=[];return G(this,null,{enter:function(t){return t.nodeType===f||t.nodeType===w||(t.nodeType===b||t.nodeType===T?null:void e.push(t.nodeValue))}}),e.join("")}return this.nodeValue},set:function(e){switch(this.nodeType){case f:case w: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}}}),Ee=function(e,t,n){e["$$"+t]=n})}catch(e){}t.DocumentType=pe,t.DOMException=O,t.DOMImplementation=H,t.Element=oe,t.Node=V,t.NodeList=R,t.walkDOM=G,t.XMLSerializer
2=_e},6306:function(e,t,n){"use strict";var i=n(7401).freeze;t.XML_ENTITIES=i({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),t.HTML_ENTITIES=i
vendor: 28,756 bytes, line 2
2({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},
24533:function(e,t,n){var i=n(9773);i.DOMImplementation,i.XMLSerializer,t.DOMParser=n(5941).DOMParser},3265:function(e,t,n){var i=n(7401).NAMESPACE,r=n(7401).tagNamePattern;function a(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,a)}function s(){}function o(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function u(e,t,n,r,a,s){function o(e,t,i){n.attributeNames.hasOwnProperty(e)&&s.fatalError("Attribute "+e+" redefined"),n.addValue(e,t.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,a),i)}for(var u,l=++t,c=0;;){var d=e.charAt(l);if(0===c&&"<"===d)throw new Error("unexpected < in tag name: "+e.slice(t,l));switch(d){case"=":if(1===c)u=e.slice(t,l),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 "="'),u=e.slice(t,l)),t=l+1,!((l=e.indexOf(d,t))>0))throw new Error("attribute value no end '"+d+"' match");o(u,h=e.slice(t,l),t-1),c=5}else{if(4!=c)throw new Error('attribute value must after "="');o(u,h=e.slice(t,l),t),s.warning('attribute "'+u+'" missed start quot('+d+")!!"),t=l+1,c=5}break;case"/":switch(c){case 0:n.setTagName(e.slice(t,l));
vendor: 5,245 bytes, line 2
2case 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,l)),l;case">":switch(c){case 0:n.setTagName(e.slice(t,l));case 5:case 6:case 7:break;case 4:case 1:"/"===(h=e.slice(t,l)).slice(-1)&&(n.closed=!0,h=h.slice(0,-1));case 2:2===c&&(h=u),4==c?(s.warning('attribute "'+h+'" missed quot(")!'),o(u,h,t)):(i.isHTML(r[""])&&h.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+h+'" missed value!! "'+h+'" instead!!'),o(h,h,t));break;case 3:throw new Error("attribute value missed!!")}return l;case"€":d=" ";default:if(d<=" ")switch(c){case 0:n.setTagName(e.slice(t,l)),c=6;break;case 1:u=e.slice(t,l),c=2;break;case 4:var h=e.slice(t,l);s.warning('attribute "'+h+'" missed quot(")!!'),o(u,h,t);case 5:c=6}else switch(c){case 2:n.tagName;i.isHTML(r[""])&&u.match(/^(?:disabled|checked|selected)$/i)||s.warning('attribute "'+u+'" missed value!! "'+u+'" instead2!!'),o(u,u,t),t=l,c=1;break;case 5:s.warning('attribute space is required"'+u+'"!!');case 6:c=1,t=l;break;case 3:c=4,t=l;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}l++}}function l(e,t,n){for(var r=e.tagName,a=null,s=e.length;s--;){var o=e[s],u=o.qName,l=o.value;if((p=u.indexOf(":"))>0)var c=o.prefix=u.slice(0,p),d=u.slice(p+1),h="xmlns"===c&&d;else d=u,c=null,h="xmlns"===u&&"";o.localName=d,!1!==h&&(null==a&&(a={},n=Object.create(n)),n[h]=a[h]=l,o.uri=i.XMLNS,t.startPrefixMapping(h,l))}for(s=e.length;s--;){(c=(o=e[s]).prefix)&&("xml"===c&&(o.uri=i.XML),"xmlns"!==c&&(o.uri=n[c||""]))}var p;(p=r.indexOf(":"))>0?(c=e.prefix=r.slice(0,p),d=e.localName=r.slice(p+1)):(c=null,d=e.localName=r);var f=e.uri=n[c||""];if(t.startElement(f,d,r,e),!e.closed)return e.currentNSMap=n,e.localNSMap=a,!0;if(t.endElement(f,d,r),a)for(c in a)Object.prototype.hasOwnProperty.call(a,c)&&t.endPrefixMapping(c)}function c(e,t,n,i,r){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)?(r.characters(s,0,s.length),a):(s=s.replace(/&#?\w+;/g,i),r.characters(s,0,s.length),a)}return t+1}function d(e,t,n,i){var r=i[n];return null==r&&((r=e.lastIndexOf("</"+n+">"))<t&&(r=e.lastIndexOf("</"+n)),i[n]=r),r<t}function h(e,t,n,i){if("-"===e.charAt(t+2))return"-"===e.charAt(t+3)?(r=e.indexOf("--\x3e",t+4))>t?(n.comment(e,t+4,r-t-4),r+3):(i.error("Unclosed comment"),-1):-1;if("CDATA["==e.substr(t+3,6)){var r=e.indexOf("]]>",t+9);return n.startCDATA(),n.characters(e,t+9,r-t-9),n.endCDATA(),r+3}var a=function(e,t){var n,i=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;r.lastIndex=t,r.exec(e);for(;n=r.exec(e);)if(i.push(n),n[1])return i}(e,t),s=a.length;if(s>1&&/!doctype/i.test(a[0][0])){var o=a[1][0],u=!1,l=!1;s>3&&(/^public$/i.test(a[2][0])?(u=a[3][0],l=s>4&&a[4][0]):/^system$/i.test(a[2][0])&&(l=a[3][0]));var c=a[s-1];return n.startDTD(o,u,l),n.endDTD(),c.index+c[0].length}return-1}function p(e,t,n){var i=e.indexOf("?>",t);if(i){var r=e.substring(t,i).match(/^<\?(\S*)\s*([\s\S]*?)$/);if(r){r[0].length;return n.processingInstruction(r[1],r[2]),i+2}return-1}return-1}function f(){this.attributeNames={}}a.prototype=new Error,a.prototype.name=a.name,s.prototype={parse:function(e,t,n){var s=this.domBuilder;s.startDocument(),function(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}(t,t={}),function(e,t,n,s,m){function g(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}function v(e){var t=e.slice(1,-1);return Object.hasOwnProperty.call(n,t)?n[t]:"#"===t.charAt(0)?g(parseInt(t.substr(1).replace("x","0x"))):(m.error("entity not found:"+e),e)}function y(t){if(t>C){var n=e.substring(C,t).replace(/&#?\w+;/g,v);S&&_(C),s.characters(n,0,t-C),C=t}}function _(t,n){for(;t>=T&&(n=k.exec(e));)b=n.index,T=b+n[0].length,S.lineNumber++;S.columnNumber=t-b+1}var b=0,T=0,k=/.*(?:\r\n?|\n)|.*$/g,S=s.locator,w=[{currentNSMap:t}],E={},C=0;for(;;){try{var I=e.indexOf("<",C);if(I<0){if(!e.substr(C).match(/^\s*$/)){var x=s.doc,A=x.createTextNode(e.substr(C));x.appendChild(A),s.currentElement=A}return}switch(I>C&&y(I),e.charAt(I+1)){case"/":var D=e.indexOf(">",I+3),P=e.substring(I+2,D).replace(/^([\s\S]*?[^ \t\n\r])?[ \t\n\r]*$/,"$1"),L=w.pop();D<0?(P=e.substring(I+2).replace(/[\s<].*/,""),m.error("end tag name: "+P+" is not complete:"+L.tagName),D=I+1+P.length):P.match(/\s</)?(P=P.replace(/[\s<].*/,""),m.error("end tag name: "+P+" maybe not complete"),D=I+1+P.length):/[ \t\n\r]/.test(P)&&r.test(P.split(/[ \t\n\r]/)[0])&&m.error('end tag name is followed by whitespace and trailing content: "'+P+'"');var O=L.localNSMap,R=L.tagName==P;if(R||L.tagName&&L.tagName.toLowerCase()==P.toLowerCase()){if(s.endElement(L.uri,L.localName,P),O)for(var M in O)Object.prototype.hasOwnProperty.call(O,M)&&s.endPrefixMapping(M);R||m.fatalError("end tag name: "+P+" is not match the current start tagName:"+L.tagName)}else w.push(L);D++;break;case"?":S&&_(I),D=p(e,I,s);break;case"!":S&&_(I),D=h(e,I,s,m);break;default:S&&_(I);var N=new f,U=w[w.length-1].currentNSMap,B=(D=u(e,I,N,U,v,m),N.length);
vendor: 5,614 bytes, line 2
2if(!N.closed&&d(e,D,N.tagName,E)&&(N.closed=!0,n.nbsp||m.warning("unclosed xml attribute")),S&&B){for(var F=o(S,{}),q=0;q<B;q++){var j=N[q];_(j.offset),j.locator=o(S,{})}s.locator=F,l(N,s,U)&&w.push(N),s.locator=S}else l(N,s,U)&&w.push(N);i.isHTML(N.uri)&&!N.closed?D=c(e,D,N.tagName,v,s):D++}}catch(e){if(e instanceof a)throw e;m.error("element parse error: "+e),D=-1}D>C?C=D:y(Math.max(I,C)+1)}}(e,t,n,s,this.errorHandler),s.endDocument()}},f.prototype={setTagName:function(e){if(!r.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,n){if(!r.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=s,t.ParseError=a},8144:function(e,t,n){var i=n(128).H;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)},r=12;0===n.version?(n.earliestPresentationTime=t.getUint32(r),n.firstOffset=t.getUint32(r+4),r+=8):(n.earliestPresentationTime=i(e.subarray(r)),n.firstOffset=i(e.subarray(r+8)),r+=16),r+=2;var a=t.getUint16(r);for(r+=2;a>0;r+=12,a--)n.references.push({referenceType:(128&e[r])>>>7,referencedSize:2147483647&t.getUint32(r),subsegmentDuration:t.getUint32(r+4),startsWithSap:!!(128&e[r+8]),sapType:(112&e[r+8])>>>4,sapDeltaTime:268435455&t.getUint32(r+8)});return n}},8956:function(e){var t,n,i,r,a,s,o,u=9e4;t=function(e){return e*u},n=function(e,t){return e*t},i=function(e){return e/u},r=function(e,t){return e/t},a=function(e,n){return t(r(e,n))},s=function(e,t){return n(i(e),t)},o=function(e,t,n){return i(n?e:e-t)},e.exports={WZ:u,secondsToVideoTs:t,secondsToAudioTs:n,videoTsToSeconds:i,audioTsToSeconds:r,audioTsToVideoTs:a,videoTsToAudioTs:s,metadataTsToSeconds:o}},128:function(e){var t=Math.pow(2,32);e.exports={H:function(e){var n,i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.getBigUint64?(n=i.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(n):n:i.getUint32(0)*t+i.getUint32(4)},MAX_UINT32:t}},1947:function(e,t,n){"use strict";n.d(t,{A:function(){return Zo}});var i=n.cw(function(e,t){var i=s(),u=n(6483),l=o(),c=r(),d=a();f.httpHandler=n(2925),f.requestInterceptorsStorage=new c,f.responseInterceptorsStorage=new c,f.retryManager=new d;var h=function(e){var t={};return e?(e.trim().split("\n").forEach(function(e){var n=e.indexOf(":"),i=e.slice(0,n).trim().toLowerCase(),r=e.slice(n+1).trim();void 0===t[i]?t[i]=r:Array.isArray(t[i])?t[i].push(r):t[i]=[t[i],r]}),t):t};function p(e,t,n){var i=e;return l(t)?(n=t,"string"==typeof e&&(i={uri:e})):i=u({},t,{uri:e}),i.callback=n,i}function f(e,t,n){return m(t=p(e,t,n))}function m(e){if(void 0===e.callback)throw new Error("callback argument missing");if(e.requestType&&f.requestInterceptorsStorage.getIsEnabled()){var t={uri:e.uri||e.url,headers:e.headers||{},body:e.body,metadata:e.metadata||{},retry:e.retry,timeout:e.timeout},n=f.requestInterceptorsStorage.execute(e.requestType,t);e.uri=n.uri,e.headers=n.headers,e.body=n.body,e.metadata=n.metadata,e.retry=n.retry,e.timeout=n.timeout}var i=!1,r=function(t,n,r){i||(i=!0,e.callback(t,n,r))};function a(){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),b)try{e=JSON.parse(e)}catch(e){}return e}function s(t){if(clearTimeout(d),clearTimeout(e.retryTimeout),t instanceof Error||(t=new Error(""+(t||"Unknown XMLHttpRequest Error"))),t.statusCode=0,l||!f.retryManager.getIsEnabled()||!e.retry||!e.retry.shouldRetry()){if(e.requestType&&f.responseInterceptorsStorage.getIsEnabled()){var n={headers:T.headers||{},body:T.body,responseUrl:c.responseURL,responseType:c.responseType},i=f.responseInterceptorsStorage.execute(e.requestType,n);T.body=i.body,T.headers=i.headers}return r(t,T)}e.retryTimeout=setTimeout(function(){e.retry.moveToNextAttempt(),e.xhr=c,m(e)},e.retry.getCurrentFuzzedDelay())}function o(){if(!l){var t;clearTimeout(d),clearTimeout(e.retryTimeout),t=e.useXDR&&void 0===c.status?200:1223===c.status?204:c.status;var n=T,i=null;if(0!==t?(n={body:a(),statusCode:t,method:g,headers:{},url:p,rawRequest:c},c.getAllResponseHeaders&&(n.headers=h(c.getAllResponseHeaders()))):i=new Error("Internal XMLHttpRequest Error"),e.requestType&&f.responseInterceptorsStorage.getIsEnabled()){var s={headers:n.headers||{},body:n.body,responseUrl:c.responseURL,responseType:c.responseType},o=f.responseInterceptorsStorage.execute(e.requestType,s);n.body=o.body,n.headers=o.headers}return r(i,n,n.body)}}var u,l,c=e.xhr||null;c||(c=e.cors||e.useXDR?new f.XDomainRequest:new f.XMLHttpRequest);var d,p=c.url=e.uri||e.url,g=c.method=e.method||"GET",v=e.body||e.data,y=c.headers=e.headers||{},_=!!e.sync,b=!1,T={body:void 0,headers:{},statusCode:0,method:g,url:p,rawRequest:c};if("json"in e&&!1!==e.json&&(b=!0,y.accept||y.Accept||(y.Accept="application/json"),"GET"!==g&&"HEAD"!==g&&(y["content-type"]||y["Content-Type"]||(y["Content-Type"]="application/json"),v=JSON.stringify(!0===e.json?v:e.json))),c.onreadystatechange=function(){4!==c.readyState||f.responseInterceptorsStorage.getIsEnabled()||setTimeout(o,0)},c.onload=o,c.onerror=s,c.onprogress=function(){}
2,c.onabort=function(){l=!0,clearTimeout(e.retryTimeout)},c.ontimeout=s,c.open(g,p,!_,e.username,e.password),_||(c.withCredentials=!!e.withCredentials),!_&&e.timeout>0&&(d=setTimeout(function(){if(!l){l=!0,c.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",s(e)}},e.timeout)),c.setRequestHeader)for(u in y)y.hasOwnProperty(u)&&c.setRequestHeader(u,y[u]);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(v||null),c}e.exports=f,e.exports.default=f,f.XMLHttpRequest=i.XMLHttpRequest||function(){},f.XDomainRequest="withCredentials"in new f.XMLHttpRequest?f.XMLHttpRequest:i.XDomainRequest,function(e,t){for(var n=0;n<e.length;n++)t(e[n])}(["get","put","post","patch","head","delete"],function(e){f["delete"===e?"del":e]=function(t,n,i){return(n=p(t,n,i)).method=e.toUpperCase(),m(n)}})}),r=function(){return n(9208)},a=function(){return n(7448)},s=function(){return n(7954)},o=function(){return n(7826)};function u(){return u.c||(u.c=n.n(s()))}s();var l=n(6031),c=n.n(l);function d(){return d.c||(d.c=n.n(i()))}i();var h=n(8830),p=n.n(h);function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},f.apply(null,arguments)}var m="https://example.com",g=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=u()().location&&u()().location.href||"");var n=/^\/\//.test(e),i=!u()().location&&!/\/\//i.test(e);e=new(u()().URL)(e,u()().location||m);var r=new URL(t,e);return i?r.href.slice(19):n?r.href.slice(r.protocol.length):r.href},v=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,i=0;i<n;++i)t[i].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),a=t.length,s=0;s<a;++s)t[s].apply(this,r)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",function(t){e.push(t)})},e}();function y(e){for(var t,n=(t=e,u()().atob?u()().atob(t):Buffer.from(t,"base64").toString("binary")),i=new Uint8Array(n.length),r=0;r<n.length;r++)i[r]=n.charCodeAt(r);return i}function _(e){return _="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},_(e)}function b(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function T(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,S(i.key),i)}}function k(e,t,n){return t&&T(e.prototype,t),n&&T(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function S(e){var t=function(e,t){if("object"!=_(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=_(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==_(t)?t:t+""}function w(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&&E(e,t)}function E(e,t){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},E(e,t)}function C(e,t,n){return t=x(t),function(e,t){if(t&&("object"==_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,I()?Reflect.construct(t,n||[],x(e).constructor):t.apply(e,n))}function I(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(I=function(){return!!e})()}
2function x(e){return x=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},x(e)}var A,D,P=function(e){function t(){var e;return b(this,t),(e=C(this,t)).buffer="",e}return w(t,e),k(t,[{key:"push",value: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)}}])}(v),L=String.fromCharCode(9),O=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},R=function(e){var t={};if(!e)return t;for(var n,i=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),r=i.length;r--;)""!==i[r]&&((n=/([^=]*)=(.*)/.exec(i[r]).slice(1))[0]=n[0].replace(/^\s+|\s+$/g,""),n[1]=n[1].replace(/^\s+|\s+$/g,""),n[1]=n[1].replace(/^['"](.*)['"]$/g,"$1"),t[n[0]]=n[1]);return t},M=function(e){var t=e.split("x"),n={};return t[0]&&(n.width=parseInt(t[0],10)),t[1]&&(n.height=parseInt(t[1],10)),n},N=function(e){function t(){var e;return b(this,t),(e=C(this,t)).customParsers=[],e.tagMappers=[],e}return w(t,e),k(t,[{key:"push",value:function(e){var t,n,i=this;0!==(e=e.trim()).length&&("#"===e[0]?this.tagMappers.reduce(function(t,n){var i=n(e);return i===e?t:t.concat([i])},[e]).forEach(function(e){for(var r=0;r<i.customParsers.length;r++)if(i.customParsers[r].call(i,e))return;if(0===e.indexOf("#EXT"))if(e=e.replace("\r",""),t=/^#EXTM3U/.exec(e))i.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 i.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 i.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 i.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 i.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 i.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 i.trigger("data",n);if(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(e))return n=f(O(t[1]),{type:"tag",tagType:"byterange"}),void i.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 i.trigger("data",n);if(t=/^#EXT-X-MAP:(.*)$/.exec(e)){if(n={type:"tag",tagType:"map"},t[1]){var a=R(t[1]);a.URI&&(n.uri=a.URI),a.BYTERANGE&&(n.byterange=O(a.BYTERANGE))}i.trigger("data",n)}else{if(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(e))return n={type:"tag",tagType:"stream-inf"},t[1]&&(n.attributes=R(t[1]),n.attributes.RESOLUTION&&(n.attributes.RESOLUTION=M(n.attributes.RESOLUTION)),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))),void i.trigger("data",n);if(t=/^#EXT-X-MEDIA:(.*)$/.exec(e))return n={type:"tag",tagType:"media"},t[1]&&(n.attributes=R(t[1])),void i.trigger("data",n);if(t=/^#EXT-X-ENDLIST/.exec(e))i.trigger("data",{type:"tag",tagType:"endlist"});else if(t=/^#EXT-X-DISCONTINUITY/.exec(e))i.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 i.trigger("data",n);if(t=/^#EXT-X-KEY:(.*)$/.exec(e))return n={type:"tag",tagType:"key"},t[1]&&(n.attributes=R(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 i.trigger("data",n);if(t=/^#EXT-X-START:(.*)$/.exec(e))return n={type:"tag",tagType:"start"},t[1]&&(n.attributes=R(t[1]),n.attributes["TIME-OFFSET"]=parseFloat(n.attributes["TIME-OFFSET"]),n.attributes.PRECISE=/YES/.test(n.attributes.PRECISE)),void i.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 i.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 i.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 i.trigger("data",n);if((t=/^#EXT-X-SKIP:(.*)$/.exec(e))&&t[1])return(n={type:"tag",tagType:"skip"}).attributes=R(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(L)),void i.trigger("data",n);
2if((t=/^#EXT-X-PART:(.*)$/.exec(e))&&t[1])return(n={type:"tag",tagType:"part"}).attributes=R(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=O(n.attributes.BYTERANGE)),void i.trigger("data",n);if((t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e))&&t[1])return(n={type:"tag",tagType:"server-control"}).attributes=R(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 i.trigger("data",n);if((t=/^#EXT-X-PART-INF:(.*)$/.exec(e))&&t[1])return(n={type:"tag",tagType:"part-inf"}).attributes=R(t[1]),["PART-TARGET"].forEach(function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseFloat(n.attributes[e]))}),void i.trigger("data",n);if((t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e))&&t[1])return(n={type:"tag",tagType:"preload-hint"}).attributes=R(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 i.trigger("data",n);if((t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e))&&t[1])return(n={type:"tag",tagType:"rendition-report"}).attributes=R(t[1]),["LAST-MSN","LAST-PART"].forEach(function(e){n.attributes.hasOwnProperty(e)&&(n.attributes[e]=parseInt(n.attributes[e],10))}),void i.trigger("data",n);if((t=/^#EXT-X-DATERANGE:(.*)$/.exec(e))&&t[1]){(n={type:"tag",tagType:"daterange"}).attributes=R(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))});var s=/^X-([A-Z]+-)+[A-Z]+$/;for(var o in n.attributes)if(s.test(o)){var u=/[0-9A-Fa-f]{6}/g.test(n.attributes[o]),l=/^\d+(\.\d+)?$/.test(n.attributes[o]);n.attributes[o]=u?n.attributes[o].toString(16):l?parseFloat(n.attributes[o]):String(n.attributes[o])}i.trigger("data",n)}else if(t=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(e))i.trigger("data",{type:"tag",tagType:"independent-segments"});else if(t=/^#EXT-X-I-FRAMES-ONLY/.exec(e))i.trigger("data",{type:"tag",tagType:"i-frames-only"});else{if(t=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(e))return(n={type:"tag",tagType:"content-steering"}).attributes=R(t[1]),void i.trigger("data",n);if(t=/^#EXT-X-I-FRAME-STREAM-INF:(.*)$/.exec(e))return(n={type:"tag",tagType:"i-frame-playlist"}).attributes=R(t[1]),n.attributes.URI&&(n.uri=n.attributes.URI),n.attributes.BANDWIDTH&&(n.attributes.BANDWIDTH=parseInt(n.attributes.BANDWIDTH,10)),n.attributes.RESOLUTION&&(n.attributes.RESOLUTION=M(n.attributes.RESOLUTION)),n.attributes["AVERAGE-BANDWIDTH"]&&(n.attributes["AVERAGE-BANDWIDTH"]=parseInt(n.attributes["AVERAGE-BANDWIDTH"],10)),n.attributes["FRAME-RATE"]&&(n.attributes["FRAME-RATE"]=parseFloat(n.attributes["FRAME-RATE"])),void i.trigger("data",n);if(t=/^#EXT-X-DEFINE:(.*)$/.exec(e))return(n={type:"tag",tagType:"define"}).attributes=R(t[1]),void i.trigger("data",n);i.trigger("data",{type:"tag",data:e.slice(4)})}}}}else i.trigger("data",{type:"comment",text:e.slice(1)})}):this.trigger("data",{type:"uri",uri:e}))}},{key:"addParser",value:function(e){var t=this,n=e.expression,i=e.customType,r=e.dataParser,a=e.segment;"function"!=typeof r&&(r=function(e){return e}),this.customParsers.push(function(e){if(n.exec(e))return t.trigger("data",{type:"custom",data:r(e),customType:i,segment:a}),!0})}},{key:"addTagMapper",value:function(e){var t=e.expression,n=e.map;this.tagMappers.push(function(e){return t.test(e)?n(e):e})}}])}(v),U=function(e){var t={};return Object.keys(e).forEach(function(n){var i;t[i=n,i.toLowerCase().replace(/-(\w)/g,function(e){return e[1].toUpperCase()})]=e[n]}),t},B=function(e){var t=e.serverControl,n=e.targetDuration,i=e.partTargetDuration;
2if(t){var r="#EXT-X-SERVER-CONTROL",a="holdBack",s="partHoldBack",o=n&&3*n,u=i&&2*i;n&&!t.hasOwnProperty(a)&&(t[a]=o,this.trigger("info",{message:"".concat(r," defaulting HOLD-BACK to targetDuration * 3 (").concat(o,").")})),o&&t[a]<o&&(this.trigger("warn",{message:"".concat(r," clamping HOLD-BACK (").concat(t[a],") to targetDuration * 3 (").concat(o,")")}),t[a]=o),i&&!t.hasOwnProperty(s)&&(t[s]=3*i,this.trigger("info",{message:"".concat(r," defaulting PART-HOLD-BACK to partTargetDuration * 3 (").concat(t[s],").")})),i&&t[s]<u&&(this.trigger("warn",{message:"".concat(r," clamping PART-HOLD-BACK (").concat(t[s],") to partTargetDuration * 2 (").concat(u,").")}),t[s]=u)}},F=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};b(this,t),(e=C(this,t)).lineStream=new P,e.parseStream=new N,e.lineStream.pipe(e.parseStream),e.mainDefinitions=n.mainDefinitions||{},e.params=new URL(n.uri,"https://a.com").searchParams,e.lastProgramDateTime=null;var i,r,a=e,s=[],o={},u=!1,l=function(){},c={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},d=0;e.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],iFramePlaylists:[],segments:[]};var h=0,p=0,m={};return e.on("end",function(){o.uri||!o.parts&&!o.preloadHints||(!o.map&&i&&(o.map=i),!o.key&&r&&(o.key=r),o.timeline||"number"!=typeof d||(o.timeline=d),e.manifest.preloadSegment=o)}),e.parseStream.on("data",function(e){var t,n;if(a.manifest.definitions)for(var g in a.manifest.definitions)if(e.uri&&(e.uri=e.uri.replace("{$".concat(g,"}"),a.manifest.definitions[g])),e.attributes)for(var v in e.attributes)"string"==typeof e.attributes[v]&&(e.attributes[v]=e.attributes[v].replace("{$".concat(g,"}"),a.manifest.definitions[g]));({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&&(o.byterange=t,t.length=e.length,"offset"in e||(e.offset=h)),"offset"in e&&(o.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.title&&(o.title=e.title),e.duration>0&&(o.duration=e.duration),0===e.duration&&(o.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=s},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:y(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(){i={}
2,e.uri&&(i.uri=e.uri),e.byterange&&(i.byterange=e.byterange),r&&(i.key=r)},"stream-inf":function(){this.manifest.playlists=s,this.manifest.mediaGroups=this.manifest.mediaGroups||c,e.attributes?(o.attributes||(o.attributes={}),f(o.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 i=this.manifest.mediaGroups[e.attributes.TYPE];i[e.attributes["GROUP-ID"]]=i[e.attributes["GROUP-ID"]]||{},t=i[e.attributes["GROUP-ID"]],(n={default:/yes/i.test(e.attributes.DEFAULT)}).default?n.autoselect=!0:n.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(n.language=e.attributes.LANGUAGE),e.attributes.URI&&(n.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(n.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(n.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(n.forced=/yes/i.test(e.attributes.FORCED)),t[e.attributes.NAME]=n}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){d+=1,o.discontinuity=!0,this.manifest.discontinuityStarts.push(s.length)},"program-date-time":function(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),o.dateTimeString=e.dateTimeString,o.dateTimeObject=e.dateTimeObject;var t=this.lastProgramDateTime;this.lastProgramDateTime=new Date(e.dateTimeString).getTime(),null===t&&this.manifest.segments.reduceRight(function(e,t){return t.programDateTime=e-1e3*t.duration,t.programDateTime},this.lastProgramDateTime)},targetduration:function(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration}):(this.manifest.targetDuration=e.duration,B.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(){o.cueOut=e.data},"cue-out-cont":function(){o.cueOutCont=e.data},"cue-in":function(){o.cueIn=e.data},skip:function(){this.manifest.skip=U(e.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",e.attributes,["SKIPPED-SEGMENTS"])},part:function(){var t=this;u=!0;var n=this.manifest.segments.length,i=U(e.attributes);o.parts=o.parts||[],o.parts.push(i),i.byterange&&(i.byterange.hasOwnProperty("offset")||(i.byterange.offset=p),p=i.byterange.offset+i.byterange.length);var r=o.parts.length-1;this.warnOnMissingAttributes_("#EXT-X-PART #".concat(r," for segment #").concat(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 #".concat(n," lacks required attribute(s): LAST-PART")})})},"server-control":function(){var t=this.manifest.serverControl=U(e.attributes);t.hasOwnProperty("canBlockReload")||(t.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),B.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=U(e.attributes),i=n.type&&"PART"===n.type;o.preloadHints=o.preloadHints||[],o.preloadHints.push(n),n.byterange&&(n.byterange.hasOwnProperty("offset")||(n.byterange.offset=i?p:0,i&&(p=n.byterange.offset+n.byterange.length)));var r=o.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #".concat(r," for segment #").concat(t),e.attributes,["TYPE","URI"]),n.type)for(var a=0;a<o.preloadHints.length-1;a++){var s=o.preloadHints[a];s.type&&(s.type===n.type&&this.trigger("warn",{message:"#EXT-X-PRELOAD-HINT #".concat(r," for segment #").concat(t," has the same TYPE ").concat(n.type," as preload hint #").concat(a)}
2))}},"rendition-report":function(){var t=U(e.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(t);var n=this.manifest.renditionReports.length-1,i=["LAST-MSN","URI"];u&&i.push("LAST-PART"),this.warnOnMissingAttributes_("#EXT-X-RENDITION-REPORT #".concat(n),e.attributes,i)},"part-inf":function(){this.manifest.partInf=U(e.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",e.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),B.call(this,this.manifest)},daterange:function(){this.manifest.dateRanges.push(U(e.attributes));var t=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_("#EXT-X-DATERANGE #".concat(t),e.attributes,["ID","START-DATE"]);var n=this.manifest.dateRanges[t];n.endDate&&n.startDate&&new Date(n.endDate)<new Date(n.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),n.duration&&n.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),n.plannedDuration&&n.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});var i=!!n.endOnNext;if(i&&!n.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute"}),i&&(n.duration||n.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),n.duration&&n.endDate){var r=n.startDate.getTime()+1e3*n.duration;this.manifest.dateRanges[t].endDate=new Date(r)}if(m[n.id]){for(var a in m[n.id])if(n[a]&&JSON.stringify(m[n.id][a])!==JSON.stringify(n[a])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}var s=this.manifest.dateRanges.findIndex(function(e){return e.id===n.id});this.manifest.dateRanges[s]=f(this.manifest.dateRanges[s],n),m[n.id]=f(m[n.id],n),this.manifest.dateRanges.pop()}else m[n.id]=n},"independent-segments":function(){this.manifest.independentSegments=!0},"i-frames-only":function(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering":function(){this.manifest.contentSteering=U(e.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",e.attributes,["SERVER-URI"])},define:function(){var t=this;this.manifest.definitions=this.manifest.definitions||{};var n=function(e,n){e in t.manifest.definitions?t.trigger("error",{message:"EXT-X-DEFINE: Duplicate name ".concat(e)}):t.manifest.definitions[e]=n};if("QUERYPARAM"in e.attributes){if("NAME"in e.attributes||"IMPORT"in e.attributes)return void this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});var i=this.params.get(e.attributes.QUERYPARAM);return i?void n(e.attributes.QUERYPARAM,decodeURIComponent(i)):void this.trigger("error",{message:"EXT-X-DEFINE: No query param ".concat(e.attributes.QUERYPARAM)})}return"NAME"in e.attributes?"IMPORT"in e.attributes?void this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"}):"VALUE"in e.attributes&&"string"==typeof e.attributes.VALUE?void n(e.attributes.NAME,e.attributes.VALUE):void this.trigger("error",{message:"EXT-X-DEFINE: No value for ".concat(e.attributes.NAME)}):"IMPORT"in e.attributes?this.mainDefinitions[e.attributes.IMPORT]?void n(e.attributes.IMPORT,this.mainDefinitions[e.attributes.IMPORT]):void this.trigger("error",{message:"EXT-X-DEFINE: No value ".concat(e.attributes.IMPORT," to import, or IMPORT used on main playlist")}):void this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist":function(){this.manifest.iFramePlaylists.push({attributes:e.attributes,uri:e.uri,timeline:d}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",e.attributes,["BANDWIDTH","URI"])}}[e.tagType]||l).call(a)},uri:function(){o.uri=e.uri,s.push(o),this.manifest.targetDuration&&!("duration"in o)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),o.duration=this.manifest.targetDuration),r&&(o.key=r),o.timeline=d,i&&(o.map=i),p=0,null!==this.lastProgramDateTime&&(o.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=1e3*o.duration),o={}},comment:function(){},custom:function(){e.segment?(o.custom=o.custom||{},o.custom[e.customType]=e.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[e.customType]=e.data)}})[e.type].call(a)}),e}return w(t,e),k(t,[{key:"requiredCompatibilityversion",value:function(e,t){(e<t||!e)&&this.trigger("warn",{message:"manifest must be at least version ".concat(t)})}},{key:"warnOnMissingAttributes_",value:function(e,t,n){var i=[];
2n.forEach(function(e){t.hasOwnProperty(e)||i.push(e)}),i.length&&this.trigger("warn",{message:"".concat(e," lacks required attribute(s): ").concat(i.join(", "))})}},{key:"push",value:function(e){this.lineStream.push(e)}},{key:"end",value:function(){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")}},{key:"addParser",value:function(e){this.parseStream.addParser(e)}},{key:"addTagMapper",value:function(e){this.parseStream.addTagMapper(e)}}])}(v),q={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^/},j=["video","audio","text"],H=["Video","Audio","Text"],V=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},z=function(e){void 0===e&&(e="");var t=e.split(","),n=[];return t.forEach(function(e){var t;e=e.trim(),j.forEach(function(i){var r=q[i].exec(e.toLowerCase());if(r&&!(r.length<=1)){t=i;var a=e.substring(0,r[1].length),s=e.replace(a,"");n.push({type:a,details:s,mediaType:i})}}),t||n.push({type:e,details:"",mediaType:"unknown"})}),n},W=function(e){return void 0===e&&(e=""),q.audio.test(e.trim().toLowerCase())},G=function(e){if(e&&"string"==typeof e){var t,n=e.toLowerCase().split(",").map(function(e){return V(e.trim())}),i="video";1===n.length&&W(n[0])?i="audio":1===n.length&&(void 0===(t=n[0])&&(t=""),q.text.test(t.trim().toLowerCase()))&&(i="application");var r="mp4";return n.every(function(e){return q.mp4.test(e)})?r="mp4":n.every(function(e){return q.webm.test(e)})?r="webm":n.every(function(e){return q.ogg.test(e)})&&(r="ogg"),i+"/"+r+';codecs="'+e+'"'}},X=function(e,t){return void 0===e&&(e=""),void 0===t&&(t=!1),u()().MediaSource&&u()().MediaSource.isTypeSupported&&u()().MediaSource.isTypeSupported(G(e))||t&&u()().ManagedMediaSource&&u()().ManagedMediaSource.isTypeSupported&&u()().ManagedMediaSource.isTypeSupported(G(e))||!1},K=function(e){return void 0===e&&(e=""),e.toLowerCase().split(",").every(function(e){e=e.trim();for(var t=0;t<H.length;t++){if(q["muxer"+H[t]].test(e))return!0}return!1})},Y="mp4a.40.2",Q=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,$=/^application\/dash\+xml/i,J=function(e){return Q.test(e)?"hls":$.test(e)?"dash":"application/vnd.videojs.vhs+json"===e?"vhs-json":null},Z=function(e){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},ee=function(e){return e instanceof Uint8Array?e:(Array.isArray(e)||Z(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))},te=u()().BigInt||Number,ne=[te("0x1"),te("0x100"),te("0x10000"),te("0x1000000"),te("0x100000000"),te("0x10000000000"),te("0x1000000000000"),te("0x100000000000000"),te("0x10000000000000000")],ie=(A=new Uint16Array([65484]),255===(D=new Uint8Array(A.buffer,A.byteOffset,A.byteLength))[0]||D[0],function(e,t){var n=void 0===t?{}:t,i=n.signed,r=void 0!==i&&i,a=n.le,s=void 0!==a&&a;e=ee(e);var o=s?"reduce":"reduceRight",u=(e[o]?e[o]:Array.prototype[o]).call(e,function(t,n,i){var r=s?i:Math.abs(i+1-e.length);return t+te(n)*ne[r]},te(0));if(r){var l=ne[e.length]/te(2)-te(1);(u=te(u))>l&&(u-=l,u-=l,u-=te(2))}return Number(u)}),re=function(e,t){var n=(void 0===t?{}:t).le,i=void 0!==n&&n;("bigint"!=typeof e&&"number"!=typeof e||"number"==typeof e&&e!=e)&&(e=0),e=te(e);for(var r,a=(r=e,Math.ceil(function(e){return e.toString(2).length}(r)/8)),s=new Uint8Array(new ArrayBuffer(a)),o=0;o<a;o++){var u=i?o:Math.abs(o+1-s.length);s[u]=Number(e/ne[o]&te(255)),e<0&&(s[u]=Math.abs(~s[u]),s[u]-=0===o?1:2)}return s},ae=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),i=0;i<e.length;i++)n[i]=e.charCodeAt(i);return n},se=function(e,t,n){var i=void 0===n?{}:n,r=i.offset,a=void 0===r?0:r,s=i.mask,o=void 0===s?[]:s;e=ee(e);var u=(t=ee(t)).every?t.every:Array.prototype.every;return t.length&&e.length-a>=t.length&&u.call(t,function(t,n){return t===(o[n]?o[n]&e[a+n]:e[a+n])})},oe=n(4533);function ue(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,a,s,o=[],u=!0,l=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(i=a.call(n)).done)&&(o.push(i.value),o.length!==t);u=!0);}catch(e){l=!0,r=e}
2finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw r}}return o}}(e,t)||de(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 le(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=pe(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=pe(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==pe(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ce(e){return function(e){if(Array.isArray(e))return he(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||de(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 de(e,t){if(e){if("string"==typeof e)return he(e,t);var n={}.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}}function he(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function pe(e){return pe="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},pe(e)}var fe,me=function(e){return!!e&&"object"===pe(e)},ge=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce(function(e,t){return"object"!==pe(t)||Object.keys(t).forEach(function(n){Array.isArray(e[n])&&Array.isArray(t[n])?e[n]=e[n].concat(t[n]):me(e[n])&&me(t[n])?e[n]=ge(e[n],t[n]):e[n]=t[n]}),e},{})},ve=function(e){return Object.keys(e).map(function(t){return e[t]})},ye=function(e){return e.reduce(function(e,t){return e.concat(t)},[])},_e=function(e){if(!e.length)return[];for(var t=[],n=0;n<e.length;n++)t.push(e[n]);return t},be="INVALID_NUMBER_OF_PERIOD",Te="DASH_EMPTY_MANIFEST",ke="DASH_INVALID_XML",Se="NO_BASE_URL",we="SEGMENT_TIME_UNSPECIFIED",Ee="UNSUPPORTED_UTC_TIMING_SCHEME",Ce=function(e){var t=e.baseUrl,n=void 0===t?"":t,i=e.source,r=void 0===i?"":i,a=e.range,s=void 0===a?"":a,o=e.indexRange,l=void 0===o?"":o,c={uri:r,resolvedUri:g(n||"",r)};if(s||l){var d,h=(s||l).split("-"),p=u()().BigInt?u()().BigInt(h[0]):parseInt(h[0],10),f=u()().BigInt?u()().BigInt(h[1]):parseInt(h[1],10);p<Number.MAX_SAFE_INTEGER&&"bigint"==typeof p&&(p=Number(p)),f<Number.MAX_SAFE_INTEGER&&"bigint"==typeof f&&(f=Number(f)),"bigint"==typeof(d="bigint"==typeof f||"bigint"==typeof p?u()().BigInt(f)-u()().BigInt(p)+u()().BigInt(1):f-p+1)&&d<Number.MAX_SAFE_INTEGER&&(d=Number(d)),c.byterange={length:d,offset:p}}return c},Ie=function(e){return e&&"number"!=typeof e&&(e=parseInt(e,10)),isNaN(e)?null:e},xe={static:function(e){var t=e.duration,n=e.timescale,i=void 0===n?1:n,r=e.sourceDuration,a=e.periodDuration,s=Ie(e.endNumber),o=t/i;return"number"==typeof s?{start:0,end:s}:"number"==typeof a?{start:0,end:a/o}:{start:0,end:r/o}},dynamic:function(e){var t=e.NOW,n=e.clientOffset,i=e.availabilityStartTime,r=e.timescale,a=void 0===r?1:r,s=e.duration,o=e.periodStart,u=void 0===o?0:o,l=e.minimumUpdatePeriod,c=void 0===l?0:l,d=e.timeShiftBufferDepth,h=void 0===d?1/0:d,p=Ie(e.endNumber),f=(t+n)/1e3,m=i+u,g=f+c-m,v=Math.ceil(g*a/s),y=Math.floor((f-m-h)*a
2/s),_=Math.floor((f-m)*a/s);return{start:Math.max(0,y),end:"number"==typeof p?p:Math.min(v,_)}}},Ae=function(e){var t=e.type,n=e.duration,i=e.timescale,r=void 0===i?1:i,a=e.periodDuration,s=e.sourceDuration,o=xe[t](e),u=function(e,t){for(var n=[],i=e;i<t;i++)n.push(i);return n}(o.start,o.end).map(function(e){return function(t){var n=e.duration,i=e.timescale,r=void 0===i?1:i,a=e.periodStart,s=e.startNumber;return{number:(void 0===s?1:s)+t,duration:n/r,timeline:a,time:t*n}}}(e));if("static"===t){var l=u.length-1,c="number"==typeof a?a:s;u[l].duration=c-n/r*l}return u},De=function(e){var t=e.baseUrl,n=e.initialization,i=void 0===n?{}:n,r=e.sourceDuration,a=e.indexRange,s=void 0===a?"":a,o=e.periodStart,u=e.presentationTime,l=e.number,c=void 0===l?0:l,d=e.duration;if(!t)throw new Error(Se);var h=Ce({baseUrl:t,source:i.sourceURL,range:i.range}),p=Ce({baseUrl:t,source:t,indexRange:s});if(p.map=h,d){var f=Ae(e);f.length&&(p.duration=f[0].duration,p.timeline=f[0].timeline)}else r&&(p.duration=r,p.timeline=o);return p.presentationTime=u||o,p.number=c,[p]},Pe=function(e,t,n){var i,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,c=t.timescale,d=t.references.filter(function(e){return 1!==e.referenceType}),h=[],p=e.endList?"static":"dynamic",f=e.sidx.timeline,m=f,g=e.mediaSequence||0;i="bigint"==typeof t.firstOffset?u()().BigInt(l)+t.firstOffset:l+t.firstOffset;for(var v=0;v<d.length;v++){var y=t.references[v],_=y.referencedSize,b=y.subsegmentDuration,T=void 0;T="bigint"==typeof i?i+u()().BigInt(_)-u()().BigInt(1):i+_-1;var k="".concat(i,"-").concat(T),S=De({baseUrl:n,timescale:c,timeline:s,periodStart:f,presentationTime:m,number:g,duration:b,sourceDuration:a,indexRange:k,type:p})[0];r&&(S.map=r),h.push(S),i+="bigint"==typeof i?u()().BigInt(_):_,m+=b/c,g++}return e.segments=h,e},Le=["AUDIO","SUBTITLES"],Oe=1/60,Re=function(e){return(t=e,n=function(e){return e.timeline},ve(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},Me=function(e){var t,n,i=[];return t=e,n=function(e,t,n,r){i=i.concat(e.playlists||[])},Le.forEach(function(e){for(var i in t.mediaGroups[e])for(var r in t.mediaGroups[e][i]){var a=t.mediaGroups[e][i][r];n(a,e,i,r)}}),i},Ne=function(e){var t=e.playlist,n=e.mediaSequence;t.mediaSequence=n,t.segments.forEach(function(e,n){e.number=t.mediaSequence+n})},Ue=function(e){var t=e.oldManifest,n=e.newManifest,i=t.playlists.concat(Me(t)),r=n.playlists.concat(Me(n));return n.timelineStarts=Re([t.timelineStarts,n.timelineStarts]),function(e){var t=e.oldPlaylists,n=e.newPlaylists,i=e.timelineStarts;n.forEach(function(e){e.discontinuitySequence=i.findIndex(function(t){return t.timeline===e.timeline});var n=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(n&&!e.sidx){var r=e.segments[0],a=n.segments.findIndex(function(e){return Math.abs(e.presentationTime-r.presentationTime)<Oe});if(-1===a)return Ne({playlist:e,mediaSequence:n.mediaSequence+n.segments.length}),e.segments[0].discontinuity=!0,e.discontinuityStarts.unshift(0),void((!n.segments.length&&e.timeline>n.timeline||n.segments.length&&e.timeline>n.segments[n.segments.length-1].timeline)&&e.discontinuitySequence--);n.segments[a].discontinuity&&!r.discontinuity&&(r.discontinuity=!0,e.discontinuityStarts.unshift(0),e.discontinuitySequence--),Ne({playlist:e,mediaSequence:n.segments[a].number})}})}({oldPlaylists:i,newPlaylists:r,timelineStarts:n.timelineStarts}),n},Be=function(e){return e&&e.uri+"-"+(t=e.byterange,n="bigint"==typeof t.offset||"bigint"==typeof t.length?u()().BigInt(t.offset)+u()().BigInt(t.length)-u()().BigInt(1):t.offset+t.length-1,"".concat(t.offset,"-").concat(n));var t,n},Fe=function(e){var t=e.reduce(function(e,t){return e[t.attributes.baseUrl]||(e[t.attributes.baseUrl]=[]),e[t.attributes.baseUrl].push(t),e},{}),n=[];return Object.values(t).forEach(function(e){var t=ve(e.reduce(function(e,t){var n=t.attributes.id+(t.attributes.lang||"");if(e[n]){var i;if(t.segments)t.segments[0]&&(t.segments[0].discontinuity=!0),(i=e[n].segments).push.apply(i,ce(t.segments));t.attributes.contentProtection&&(e[n].attributes.contentProtection=t.attributes.contentProtection)}else e[n]=t,e[n].attributes.timelineStarts=[];return e[n].attributes.timelineStarts.push({start:t.attributes.periodStart,timeline:t.attributes.periodStart}),e},{}));n=n.concat(t)}),n.map(function(e){var t,n;return e.discontinuityStarts=(t=e.segments||[],n="discontinuity",t.reduce(function(e,t,i){return t[n]&&e.push(i),e},[])),e})},qe=function(e,t){var n=Be(e.sidx),i=n&&t[n]&&t[n].sidx;return i&&Pe(e,i,e.sidx.resolvedUri),e},je=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Object.keys(t).length)return e;for(var n in e)e[n]=qe(e[n],t);return e},He=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e.reduce(function(e,r){var a=r.attributes.role&&r.attributes.role.value||"",s=r.attributes.lang||"",o=r.attributes.label||"main";if(s&&!r.attributes.label){var u=a?" (".concat(a,")"):"";o="".concat(r.attributes.lang).concat(u)}e[o]||(e[o]={language:s,autoselect:!0,default:"main"===a,playlists:[],uri:""});var l=qe(function(e,t){var n=e.attributes,i=e.segments,r=e.sidx,a=e.mediaSequence,s=e.discontinuitySequence,o=e.discontinuityStarts,u={attributes:le({NAME:n.id,BANDWIDTH:n.bandwidth,CODECS:n.codecs},"PROGRAM-ID",1),uri:"",endList:"static"===n.type,timeline:n.periodStart,resolvedUri:n.baseUrl||"",targetDuration:n.duration,discontinuitySequence:s,discontinuityStarts:o,timelineStarts:n.timelineStarts,mediaSequence:a,segments:i};return n.contentProtection&&(u.contentProtection=n.contentProtection),n.serviceLocation&&(u.attributes.serviceLocation=n.serviceLocation),r&&(u.sidx=r),t&&(u.attributes.AUDIO="audio",u.attributes.SUBTITLES="subs"),u}(r,i),n);return e[o].playlists.push(l),void 0===t&&"main"===a&&((t=r).default=!0),e},{});t||(r[Object.keys(r)[0]].default=!0);return r},Ve=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.reduce(function(e,n){var i=n.attributes.label||n.attributes.lang||"text",r=n.attributes.lang||"und";return e[i]||(e[i]={language:r,default:!1,autoselect:!1,playlists:[],uri:""}),e[i].playlists.push(qe(function(e){var t=e.attributes,n=e.segments,i=e.mediaSequence,r=e.discontinuityStarts,a=e.discontinuitySequence;void 0===n&&(n=[{uri:t.baseUrl,timeline:t.periodStart,resolvedUri:t.baseUrl||"",duration:t.sourceDuration,number:0}],t.duration=t.sourceDuration);var s=le({NAME:t.id,BANDWIDTH:t.bandwidth},"PROGRAM-ID",1);t.codecs&&(s.CODECS=t.codecs);var o={attributes:s,uri:"",endList:"static"===t.type,timeline:t.periodStart,resolvedUri:t.baseUrl||"",targetDuration:t.duration,timelineStarts:t.timelineStarts,discontinuityStarts:r,discontinuitySequence:a,mediaSequence:i,segments:n};return t.serviceLocation&&(o.attributes.serviceLocation=t.serviceLocation),o}(n),t)),e},{})},ze=function(e){var t=e.attributes,n=e.segments,i=e.sidx,r=e.discontinuityStarts,a={attributes:le({NAME:t.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:t.width,height:t.height},CODECS:t.codecs,BANDWIDTH:t.bandwidth},"PROGRAM-ID",1),uri:"",endList:"static"===t.type,timeline:t.periodStart,resolvedUri:t.baseUrl||"",targetDuration:t.duration,discontinuityStarts:r,timelineStarts:t.timelineStarts,segments:n};return t.frameRate&&(a.attributes["FRAME-RATE"]=t.frameRate),void 0!==t.qualityRanking&&(a.attributes.SCORE=1/(t.qualityRanking+1)),t.contentProtection&&(a.contentProtection=t.contentProtection),t.serviceLocation&&(a.attributes.serviceLocation=t.serviceLocation),i&&(a.sidx=i),a},We=function(e){var t=e.attributes;return"video/mp4"===t.mimeType||"video/webm"===t.mimeType||"video"===t.contentType},Ge=function(e){var t=e.attributes;return"audio/mp4"===t.mimeType||"audio/webm"===t.mimeType||"audio"===t.contentType},Xe=function(e){var t=e.attributes;return"text/vtt"===t.mimeType||"text"===t.contentType},Ke=function(e){return e?Object.keys(e).reduce(function(t,n){var i=e[n];return t.concat(i.playlists)},[]):[]},Ye=function(e,t,n){var i=e.NOW,r=e.clientOffset,a=e.availabilityStartTime,s=e.timescale,o=void 0===s?1:s,u=e.periodStart,l=void 0===u?0:u,c=e.minimumUpdatePeriod,d=(i+r)/1e3+(void 0===c?0:c)-(a+l);return Math.ceil((d*o-t)/n)},Qe=function(e,t){for(var n=e.type,i=e.minimumUpdatePeriod,r=void 0===i?0:i,a=e.media,s=void 0===a?"":a,o=e.sourceDuration,u=e.timescale,l=void 0===u?1:u,c=e.startNumber,d=void 0===c?1:c,h=e.periodStart,p=[],f=-1,m=0;m<t.length;m++){var g=t[m],v=g.d,y=g.r||0,_=g.t||0;f<0&&(f=_),_&&_>f&&(f=_);var b=void 0;if(y<0){var T=m+1;b=T===t.length?"dynamic"===n&&r>0&&s.indexOf("$Number$")>0?Ye(e,f,v):(o*l-f)/v:(t[T].t-f)/v}else b=y+1;for(var k=d+p.length+b,S=d+p.length;S<k;)p.push({number:S,duration:v/l,time:f,timeline:h}),f+=v,S++}return p},$e=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,Je=function(e,t){return e.replace($e,function(e){return function(t,n,i,r){if("$$"===t)return"$";if(void 0===e[n])return t;var a=""+e[n];return"RepresentationID"===n?a:(r=i?parseInt(r,10):1,a.length>
2=r?a:"".concat(new Array(r-a.length+1).join("0")).concat(a))}}(t))},Ze=function(e,t){var n={RepresentationID:e.id,Bandwidth:e.bandwidth||0},i=e.initialization,r=void 0===i?{sourceURL:"",range:""}:i,a=Ce({baseUrl:e.baseUrl,source:Je(r.sourceURL,n),range:r.range}),s=function(e,t){return e.duration||t?e.duration?Ae(e):Qe(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 i=Je(e.media||"",n),r=e.timescale||1,s=e.presentationTimeOffset||0,o=e.periodStart+(t.time-s)/r;return{uri:i,timeline:t.timeline,duration:t.duration,resolvedUri:g(e.baseUrl||"",i),map:a,number:t.number,presentationTime:o}})},et=function(e,t){var n=e.duration,i=e.segmentUrls,r=void 0===i?[]:i,a=e.periodStart;if(!n&&!t||n&&t)throw new Error(we);var s,o=r.map(function(t){return function(e,t){var n=e.baseUrl,i=e.initialization,r=void 0===i?{}:i,a=Ce({baseUrl:n,source:r.sourceURL,range:r.range}),s=Ce({baseUrl:n,source:t.media,range:t.mediaRange});return s.map=a,s}(e,t)});return n&&(s=Ae(e)),t&&(s=Qe(e,t)),s.map(function(t,n){if(o[n]){var i=o[n],r=e.timescale||1,s=e.presentationTimeOffset||0;return i.timeline=t.timeline,i.duration=t.duration,i.number=t.number,i.presentationTime=a+(t.time-s)/r,i}}).filter(function(e){return e})},tt=function(e){var t,n,i=e.attributes,r=e.segmentInfo;r.template?(n=Ze,t=ge(i,r.template)):r.base?(n=De,t=ge(i,r.base)):r.list&&(n=et,t=ge(i,r.list));var a={attributes:i};if(!n)return a;var s=n(t,r.segmentTimeline);if(t.duration){var o=t,u=o.duration,l=o.timescale,c=void 0===l?1:l;t.duration=u/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,r.base&&t.indexRange&&(a.sidx=s[0],a.segments=[]),a},nt=function(e,t){return _e(e.childNodes).filter(function(e){return e.tagName===t})},it=function(e){return e.textContent.trim()},rt=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=ue(t.slice(1),6),i=n[0],r=n[1],a=n[2],s=n[3],o=n[4],u=n[5];return 31536e3*parseFloat(i||0)+2592e3*parseFloat(r||0)+86400*parseFloat(a||0)+3600*parseFloat(s||0)+60*parseFloat(o||0)+parseFloat(u||0)},at={mediaPresentationDuration:function(e){return rt(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 rt(e)},suggestedPresentationDelay:function(e){return rt(e)},type:function(e){return e},timeShiftBufferDepth:function(e){return rt(e)},start:function(e){return rt(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)?rt(e):t},d:function(e){return parseInt(e,10)},t:function(e){return parseInt(e,10)},r:function(e){return parseInt(e,10)},presentationTime:function(e){return parseInt(e,10)},qualityRanking:function(e){return parseInt(e,10)},qualityranking:function(e){return parseInt(e,10)},DEFAULT:function(e){return e}},st={qualityranking:"qualityRanking"},ot=function(e){return e&&e.attributes?_e(e.attributes).reduce(function(e,t){var n=at[t.name]||at.DEFAULT;return e[st[t.name]||t.name]=n(t.value),e},{}):{}},ut={"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"},lt=function(e,t){return t.length?ye(e.map(function(e){return t.map(function(t){var n=it(t),i=g(e.baseUrl,n),r=ge(ot(t),{baseUrl:i});return i!==n&&!r.serviceLocation&&e.serviceLocation&&(r.serviceLocation=e.serviceLocation),r})})):e},ct=function(e){var t=nt(e,"SegmentTemplate")[0],n=nt(e,"SegmentList")[0],i=n&&nt(n,"SegmentURL").map(function(e){return ge({tag:"SegmentURL"},ot(e))}),r=nt(e,"SegmentBase")[0],a=n||t,s=a&&nt(a,"SegmentTimeline")[0],o=n||r||t,u=o&&nt(o,"Initialization")[0],l=t&&ot(t);l&&u?l.initialization=u&&ot(u):l&&l.initialization&&(l.initialization={sourceURL:l.initialization});var c={template:l,segmentTimeline:s&&nt(s,"S").map(function(e){return ot(e)}),list:n&&ge(ot(n),{segmentUrls:i,initialization:ot(u)}),base:r&&ge(ot(r),{initialization:ot(u)})};
2return Object.keys(c).forEach(function(e){c[e]||delete c[e]}),c},dt=function(e){return ye(nt(e.node,"EventStream").map(function(t){var n=ot(t),i=n.schemeIdUri;return nt(t,"Event").map(function(t){var r=ot(t),a=r.presentationTime||0,s=n.timescale||1,o=r.duration||0,u=a/s+e.attributes.start;return{schemeIdUri:i,value:n.value,id:r.id,start:u,end:u+o/s,messageData:it(t)||r.messageData,contentEncoding:n.contentEncoding,presentationTimeOffset:n.presentationTimeOffset||0}})}))},ht=function(e,t,n){return function(i){var r,a=ot(i),s=lt(t,nt(i,"BaseURL")),o=nt(i,"Role")[0],u={role:ot(o)},l=ge(e,a,u),c=nt(i,"Accessibility")[0],d="urn:scte:dash:cc:cea-608:2015"===(r=ot(c)).schemeIdUri?("string"!=typeof r.value?[]:r.value.split(";")).map(function(e){var t,n;if(n=e,/^CC\d=/.test(e)){var i=ue(e.split("="),2);t=i[0],n=i[1]}else/^CC\d$/.test(e)&&(t=e);return{channel:t,language:n}}):"urn:scte:dash:cc:cea-708:2015"===r.schemeIdUri?("string"!=typeof r.value?[]:r.value.split(";")).map(function(e){var t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){var n=ue(e.split("="),2),i=n[0],r=n[1],a=void 0===r?"":r;t.channel=i,t.language=e,a.split(",").forEach(function(e){var n=ue(e.split(":"),2),i=n[0],r=n[1];"lang"===i?t.language=r:"er"===i?t.easyReader=Number(r):"war"===i?t.aspectRatio=Number(r):"3D"===i&&(t["3D"]=Number(r))})}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t}):void 0;d&&(l=ge(l,{captionServices:d}));var h=nt(i,"Label")[0];if(h&&h.childNodes.length){var p=h.childNodes[0].nodeValue.trim();l=ge(l,{label:p})}var f=nt(i,"ContentProtection").reduce(function(e,t){var n=ot(t);n.schemeIdUri&&(n.schemeIdUri=n.schemeIdUri.toLowerCase());var i=ut[n.schemeIdUri];if(i){e[i]={attributes:n};var r=nt(t,"cenc:pssh")[0];if(r){var a=it(r);e[i].pssh=a&&y(a)}}return e},{});Object.keys(f).length&&(l=ge(l,{contentProtection:f}));var m=ct(i),g=nt(i,"Representation"),v=ge(n,m);return ye(g.map(function(e,t,n){return function(i){var r=nt(i,"BaseURL"),a=lt(t,r),s=ge(e,ot(i)),o=ct(i);return a.map(function(e){return{segmentInfo:ge(n,o),attributes:ge(s,e)}})}}(l,s,v)))}},pt=function(e,t){return function(n,i){var r=lt(t,nt(n.node,"BaseURL")),a=ge(e,{periodStart:n.attributes.start});"number"==typeof n.attributes.duration&&(a.periodDuration=n.attributes.duration);var s=nt(n.node,"AdaptationSet"),o=ct(n.node);return ye(s.map(ht(a,r,o)))}},ft=function(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;var n=ge({serverURL:it(e[0])},ot(e[0]));return n.queryBeforeStart="true"===n.queryBeforeStart,n},mt=function(e){if(""===e)throw new Error(Te);var t,n,i=new oe.DOMParser;try{n=(t=i.parseFromString(e,"application/xml"))&&"MPD"===t.documentElement.tagName?t.documentElement:null}catch(e){}if(!n||n&&n.getElementsByTagName("parsererror").length>0)throw new Error(ke);return n},gt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.manifestUri,i=void 0===n?"":n,r=t.NOW,a=void 0===r?Date.now():r,s=t.clientOffset,o=void 0===s?0:s,u=t.eventHandler,l=void 0===u?function(){}:u,c=nt(e,"Period");if(!c.length)throw new Error(be);var d=nt(e,"Location"),h=ot(e),p=lt([{baseUrl:i}],nt(e,"BaseURL")),f=nt(e,"ContentSteering");h.type=h.type||"static",h.sourceDuration=h.mediaPresentationDuration||0,h.NOW=a,h.clientOffset=o,d.length&&(h.locations=d.map(it));var m=[];return c.forEach(function(e,t){var n=ot(e),i=m[t-1];n.start=function(e){var t=e.attributes,n=e.priorPeriodAttributes,i=e.mpdType;return"number"==typeof t.start?t.start:n&&"number"==typeof n.start&&"number"==typeof n.duration?n.start+n.duration:n||"static"!==i?null:0}({attributes:n,priorPeriodAttributes:i?i.attributes:null,mpdType:h.type}),m.push({node:e,attributes:n})}),{locations:h.locations,contentSteeringInfo:ft(f,l),representationInfo:ye(m.map(pt(h,p))),eventStream:ye(m.map(dt))}}(mt(e),t);return function(e){var t=e.dashPlaylists,n=e.locations,i=e.contentSteering,r=e.sidxMapping,a=void 0===r?{}:r,s=e.previousManifest,o=e.eventStream;if(!t.length)return{};var u=t[0].attributes,l=u.sourceDuration,c=u.type,d=u.suggestedPresentationDelay,h=u.minimumUpdatePeriod,p=Fe(t.filter(We)).map(ze),f=Fe(t.filter(Ge)),m=Fe(t.filter(Xe)),g=t.map(function(e){return e.attributes.captionServices}
2).filter(Boolean),v={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:le(le({AUDIO:{},VIDEO:{}},"CLOSED-CAPTIONS",{}),"SUBTITLES",{}),uri:"",duration:l,playlists:je(p,a)};h>=0&&(v.minimumUpdatePeriod=1e3*h),n&&(v.locations=n),i&&(v.contentSteering=i),"dynamic"===c&&(v.suggestedPresentationDelay=d),o&&o.length>0&&(v.eventStream=o);var y,_,b=0===v.playlists.length,T=f.length?He(f,a,b):null,k=m.length?Ve(m,a):null,S=p.concat(Ke(T),Ke(k)),w=S.map(function(e){return e.timelineStarts});return v.timelineStarts=Re(w),y=S,_=v.timelineStarts,y.forEach(function(e){e.mediaSequence=0,e.discontinuitySequence=_.findIndex(function(t){return t.timeline===e.timeline}),e.segments&&e.segments.forEach(function(e,t){e.number=t})}),T&&(v.mediaGroups.AUDIO.audio=T),k&&(v.mediaGroups.SUBTITLES.subs=k),g.length&&(v.mediaGroups["CLOSED-CAPTIONS"].cc=g.reduce(function(e,t){return t?(t.forEach(function(t){var n=t.channel,i=t.language;e[i]={autoselect:!1,default:!1,instreamId:n,language:i},t.hasOwnProperty("aspectRatio")&&(e[i].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[i].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[i]["3D"]=t["3D"])}),e):e},{})),s?Ue({oldManifest:s,newManifest:v}):v}({dashPlaylists:n.representationInfo.map(tt),locations:n.locations,contentSteering:n.contentSteeringInfo,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest,eventStream:n.eventStream})},vt=function(e){return function(e){var t=nt(e,"UTCTiming")[0];if(!t)return null;var n=ot(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(Ee)}return n}(mt(e))},yt=n(8144),_t=n.n(yt),bt=ee([73,68,51]),Tt=function e(t,n){return void 0===n&&(n=0),(t=ee(t)).length-n<10||!se(t,bt,{offset:n})?n:(n+=function(e,t){void 0===t&&(t=0);var n=(e=ee(e))[t+5],i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&n)>>4?i+20:i+10}(t,n),e(t,n))},kt=(new Uint8Array([79,112,117,115,72,101,97,100]),function(e){return"string"==typeof e?ae(e):e}),St=function(e){e=ee(e);for(var t=[],n=0;e.length>n;){var i=e[n],r=0,a=0,s=e[++a];for(a++;128&s;)r=(127&s)<<7,s=e[a],a++;r+=127&s;for(var o=0;o<fe.length;o++){var u=fe[o],l=u.id,c=u.parser;if(i===l){t.push(c(e.subarray(a,a+r)));break}}n+=r+a}return t};fe=[{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,ee(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=St(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:St(e.subarray(13))}}},{id:5,parser:function(e){return{tag:5,bytes:e}}},{id:6,parser:function(e){return{tag:6,bytes:e}}}];var wt=function e(t,n,i){void 0===i&&(i=!1),n=function(e){return Array.isArray(e)?e.map(function(e){return kt(e)}):[kt(e)]}(n),t=ee(t);var r=[];if(!n.length)return r;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 u=a+s;if(u>t.length){if(i)break;u=t.length}var l=t.subarray(a+8,u);se(o,n[0])&&(1===n.length?r.push(l):r.push.apply(r,e(l,n.slice(1),i))),a=u}return r},Et={EBML:ee([26,69,223,163]),DocType:ee([66,130]),Segment:ee([24,83,128,103]),SegmentInfo:ee([21,73,169,102]),Tracks:ee([22,84,174,107]),Track:ee([174]),TrackNumber:ee([215]),DefaultDuration:ee([35,227,131]),TrackEntry:ee([174]),TrackType:ee([131]),FlagDefault:ee([136]),CodecID:ee([134]),CodecPr
2ivate:ee([99,162]),VideoTrack:ee([224]),AudioTrack:ee([225]),Cluster:ee([31,67,182,117]),Timestamp:ee([231]),TimestampScale:ee([42,215,177]),BlockGroup:ee([160]),BlockDuration:ee([155]),Block:ee([161]),SimpleBlock:ee([163])},Ct=[128,64,32,16,8,4,2,1],It=function(e,t,n,i){void 0===n&&(n=!0),void 0===i&&(i=!1);var r=function(e){for(var t=1,n=0;n<Ct.length&&!(e&Ct[n]);n++)t++;return t}(e[t]),a=e.subarray(t,t+r);return n&&((a=Array.prototype.slice.call(e,t,t+r))[0]^=Ct[r-1]),{length:r,value:ie(a,{signed:i}),bytes:a}},xt=function e(t){return"string"==typeof t?t.match(/.{1,2}/g).map(function(t){return e(t)}):"number"==typeof t?re(t):t},At=function e(t,n,i){if(i>=n.length)return n.length;var r=It(n,i,!1);if(se(t.bytes,r.bytes))return i;var a=It(n,i+r.length);return e(t,n,i+a.length+a.value+r.length)},Dt=function e(t,n){n=function(e){return Array.isArray(e)?e.map(function(e){return xt(e)}):[xt(e)]}(n),t=ee(t);var i=[];if(!n.length)return i;for(var r=0;r<t.length;){var a=It(t,r,!1),s=It(t,r+a.length),o=r+a.length+s.length;127===s.value&&(s.value=At(a,t,o),s.value!==t.length&&(s.value-=o));var u=o+s.value>t.length?t.length:o+s.value,l=t.subarray(o,u);se(n[0],a.bytes)&&(1===n.length?i.push(l):i=i.concat(e(l,n.slice(1)))),r+=a.length+s.length+l.length}return i},Pt=ee([0,0,0,1]),Lt=ee([0,0,1]),Ot=ee([0,0,3]),Rt=function(e){for(var t=[],n=1;n<e.length-2;)se(e.subarray(n,n+3),Ot)&&(t.push(n+2),n++),n++;if(0===t.length)return e;var i=e.length-t.length,r=new Uint8Array(i),a=0;for(n=0;n<i;a++,n++)a===t[0]&&(a++,t.shift()),r[n]=e[a];return r},Mt=function(e,t,n,i){void 0===i&&(i=1/0),e=ee(e),n=[].concat(n);for(var r,a=0,s=0;a<e.length&&(s<i||r);){var o=void 0;if(se(e.subarray(a),Pt)?o=4:se(e.subarray(a),Lt)&&(o=3),o){if(s++,r)return Rt(e.subarray(r,a));var u=void 0;"h264"===t?u=31&e[a+o]:"h265"===t&&(u=e[a+o]>>1&63),-1!==n.indexOf(u)&&(r=a+o),a+=o+("h264"===t?1:2)}else a++}return e.subarray(0,0)},Nt={webm:ee([119,101,98,109]),matroska:ee([109,97,116,114,111,115,107,97]),flac:ee([102,76,97,67]),ogg:ee([79,103,103,83]),ac3:ee([11,119]),riff:ee([82,73,70,70]),avi:ee([65,86,73]),wav:ee([87,65,86,69]),"3gp":ee([102,116,121,112,51,103]),mp4:ee([102,116,121,112]),fmp4:ee([115,116,121,112]),mov:ee([102,116,121,112,113,116]),moov:ee([109,111,111,118]),moof:ee([109,111,111,102]),vtt:ee([87,69,66,86,84,84])},Ut={aac:function(e){var t=Tt(e);return se(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Tt(e);return se(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=Dt(e,[Et.EBML,Et.DocType])[0];return se(t,Nt.webm)},mkv:function(e){var t=Dt(e,[Et.EBML,Et.DocType])[0];return se(t,Nt.matroska)},mp4:function(e){return!Ut["3gp"](e)&&!Ut.mov(e)&&(!(!se(e,Nt.mp4,{offset:4})&&!se(e,Nt.fmp4,{offset:4}))||(!(!se(e,Nt.moof,{offset:4})&&!se(e,Nt.moov,{offset:4}))||void 0))},mov:function(e){return se(e,Nt.mov,{offset:4})},"3gp":function(e){return se(e,Nt["3gp"],{offset:4})},ac3:function(e){var t=Tt(e);return se(e,Nt.ac3,{offset:t})},vtt:function(e){return se(e,Nt.vtt)},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=Tt(e);return se(e,Nt.flac,{offset:t})},ogg:function(e){return se(e,Nt.ogg)},avi:function(e){return se(e,Nt.riff)&&se(e,Nt.avi,{offset:8})},wav:function(e){return se(e,Nt.riff)&&se(e,Nt.wav,{offset:8})},h264:function(e){return function(e,t,n){return Mt(e,"h264",t,n)}(e,7,3).length},h265:function(e){return function(e,t,n){return Mt(e,"h265",t,n)}(e,[32,33],3).length}},Bt=Object.keys(Ut).filter(function(e){return"ts"!==e&&"h264"!==e&&"h265"!==e}).concat(["ts","h264","h265"]);Bt.forEach(function(e){var t=Ut[e];Ut[e]=function(e){return t(ee(e))}});var Ft=Ut,qt=function(e){e=ee(e);for(var t=0;t<Bt.length;t++){var n=Bt[t];if(Ft[n](e))return n}return""},jt=n(8956);function Ht(e){var t="function"==typeof Map?new Map:void 0;return Ht=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 Vt(e,arguments,Zt(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Xt(n,e)},Ht(e)}function Vt(e,t,n){if(Qt())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,t);var r=new(e.bind.apply(e,i));return n&&Xt(r,n.prototype),r}function zt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];
2if(!n){if(Array.isArray(e)||(n=ln(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}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=n.call(e)},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 Wt(e,t,n){return(t=on(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gt(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&&Xt(e,t)}function Xt(e,t){return Xt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Xt(e,t)}function Kt(e,t,n){return t=Zt(t),Yt(e,Qt()?Reflect.construct(t,n||[],Zt(e).constructor):t.apply(e,n))}function Yt(e,t){if(t&&("object"==hn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Qt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Qt=function(){return!!e})()}function $t(e,t,n,i){var r=Jt(Zt(1&i?e.prototype:e),t,n);return 2&i&&"function"==typeof r?function(e){return r.apply(n,e)}:r}function Jt(){return Jt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Zt(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},Jt.apply(null,arguments)}function Zt(e){return Zt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Zt(e)}function en(e,t){return nn(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,a,s,o=[],u=!0,l=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(i=a.call(n)).done)&&(o.push(i.value),o.length!==t);u=!0);}catch(e){l=!0,r=e}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw r}}return o}}(e,t)||ln(e,t)||tn()}function tn(){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 nn(e){if(Array.isArray(e))return e}function rn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function an(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,on(i.key),i)}}function sn(e,t,n){return t&&an(e.prototype,t),n&&an(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function on(e){var t=function(e,t){if("object"!=hn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=hn(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==hn(t)?t:t+""}function un(e){return function(e){if(Array.isArray(e))return dn(e)}(e)||cn(e)||ln(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 ln(e,t){if(e){if("string"==typeof e)return dn(e,t);var n={}.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)?dn(e,t):void 0}}function cn(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function dn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function hn(e){return hn="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},hn(e)}for(var pn,fn="8.24.0",mn={},gn=function(e,t){return mn[e]=mn[e]||[],t&&(mn[e]=mn[e].concat(t)),mn[e]},vn=function(e,t){var n=gn(e).indexOf(t);return!(n<=-1)&&(mn[e]=mn[e].slice(),mn[e].splice(n,1),!0)},yn={prefixed:!0},_n=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],bn=_n[
20],Tn=0;Tn<_n.length;Tn++)if(_n[Tn][1]in c()){pn=_n[Tn];break}if(pn){for(var kn=0;kn<pn.length;kn++)yn[bn[kn]]=pn[kn];yn.prefixed=pn[0]!==bn[0]}var Sn=[];var wn=function e(t){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:":",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a="info";function s(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];n("log",a,t)}return n=function(e,t,n){return function(i,r,a){var s=t.levels[r],o=new RegExp("^(".concat(s,")$")),l=e;if("log"!==i&&a.unshift(i.toUpperCase()+":"),n&&(l="%c".concat(e),a.unshift(n)),a.unshift(l+":"),Sn){Sn.push([].concat(a));var c=Sn.length-1e3;Sn.splice(0,c>0?c:0)}if(u()().console){var d=u()().console[i];d||"debug"!==i||(d=u()().console.info||u()().console.log),d&&s&&o.test(i)&&d[Array.isArray(a)?"apply":"call"](u()().console,a)}}}(t,s,r),s.createLogger=function(n,a,s){var o=void 0!==a?a:i,u=void 0!==s?s:r;return e("".concat(t," ").concat(o," ").concat(n),o,u)},s.createNewLogger=function(t,n,i){return e(t,n,i)},s.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:a},s.level=function(e){if("string"==typeof e){if(!s.levels.hasOwnProperty(e))throw new Error('"'.concat(e,'" in not a valid log level'));a=e}return a},s.history=function(){return Sn?[].concat(Sn):[]},s.history.filter=function(e){return(Sn||[]).filter(function(t){return new RegExp(".*".concat(e,".*")).test(t[0])})},s.history.clear=function(){Sn&&(Sn.length=0)},s.history.disable=function(){null!==Sn&&(Sn.length=0,Sn=null)},s.history.enable=function(){null===Sn&&(Sn=[])},s.error=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return n("error",a,t)},s.warn=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return n("warn",a,t)},s.debug=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return n("debug",a,t)},s}("VIDEOJS"),En=wn.createLogger,Cn=Object.prototype.toString,In=function(e){return Dn(e)?Object.keys(e):[]};function xn(e,t){In(e).forEach(function(n){return t(e[n],n)})}function An(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return In(e).reduce(function(n,i){return t(n,e[i],i)},n)}function Dn(e){return!!e&&"object"===hn(e)}function Pn(e){return Dn(e)&&"[object Object]"===Cn.call(e)&&e.constructor===Object}function Ln(){for(var e={},t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return n.forEach(function(t){t&&xn(t,function(t,n){Pn(t)?(Pn(e[n])||(e[n]={}),e[n]=Ln(e[n],t)):e[n]=t})}),e}function On(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=[];for(var n in e)if(e.hasOwnProperty(n)){var i=e[n];t.push(i)}return t}function Rn(e,t,n){var i=function(n){return Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0})},r={configurable:!0,enumerable:!0,get:function(){var e=n();return i(e),e}};return(!(arguments.length>3&&void 0!==arguments[3])||arguments[3])&&(r.set=i),Object.defineProperty(e,t,r)}var Mn,Nn,Un=Object.freeze({__proto__:null,each:xn,reduce:An,isObject:Dn,isPlain:Pn,merge:Ln,values:On,defineLazyProperty:Rn}),Bn=!1,Fn=null,qn=!1,jn=!1,Hn=!1,Vn=!1,zn=!1,Wn=null,Gn=null,Xn=Boolean(u()().cast&&u()().cast.framework&&u()().cast.framework.CastReceiverContext),Kn=null,Yn=!1,Qn=!1,$n=!1,Jn=!1,Zn=!1,ei=!1,ti=!1,ni=Boolean(li()&&("ontouchstart"in u()()||u()().navigator.maxTouchPoints||u()().DocumentTouch&&u()().document instanceof u()().DocumentTouch)),ii=u()().navigator&&u()().navigator.userAgentData;if(ii&&ii.platform&&ii.brands&&(qn="Android"===ii.platform,Hn=Boolean(ii.brands.find(function(e){return"Microsoft Edge"===e.brand})),Vn=Boolean(ii.brands.find(function(e){return"Chromium"===e.brand})),zn=!Hn&&Vn,Wn=Gn=(ii.brands.find(function(e){return"Chromium"===e.brand})||{}).version||null,Qn="Windows"===ii.platform),!Vn){var ri=u()().navigator&&u()().navigator.userAgent||"";Bn=/iPod/i.test(ri),Nn=ri.match(/OS (\d+)_/i),Fn=Nn&&Nn[1]?Nn[1]:null,qn=/Android/i.test(ri),Mn=function(){var e=ri.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}(),jn=/Firefox/i.test(ri),Hn=/Edg/i.test(ri),Vn=/Chrome/i.test(ri)||/CriOS/i.test(ri),zn=!Hn&&Vn,Wn=Gn=function(){var e=ri.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),Kn=function(){var e=/MSIE\s(\d+)\.\d/.exec(ri),t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(ri)&&/rv:11.0/.test(ri)&&(t=11),t}(),Zn=/Tizen/i.test(ri),ei=/Web0S/i.test(ri),ti=Zn||ei,Yn=/Safari/i.test(ri)&&!zn&&!qn&&!Hn&&!ti,Qn=/Windows/i.test(ri),$n=/iPad/i.test(ri)||Yn&&ni&&!/iPhone/i.test(ri),Jn=/iPhone/i.test(ri)&&!$n}var ai=Jn||$n||Bn,si=(Yn||ai)&&!zn,oi=Object.freeze({__proto__:null,get IS_IPOD(){return Bn},get IOS_VERSION(){return Fn},get IS_ANDROID(){return qn},get ANDROID_VERSION(){return Mn},get IS_FIREFOX(){return jn},get IS_EDGE(){return Hn},get IS_CHROMIUM(){return Vn},get IS_CHROME(){return zn},get CHROMIUM_VERSION(){return Wn},get CHROME_VERSION(){return Gn},IS_CHROMECAST_RECEIVER:Xn,get IE_VERSION(){return Kn},get IS_SAFARI(){return Yn},get IS_WINDOWS(){return Qn},get IS_IPAD(){return $n},get IS_IPHONE(){return Jn},get IS_TIZEN(){return Zn},get IS_WEBOS(){return ei},get IS_SMART_TV(){return ti},TOUCH_ENABLED:ni,IS_IOS:ai,IS_ANY_SAFARI:si});function ui(e){return"string"==typeof e&&Boolean(e.trim())}function li(){return c()===u()().document}function ci(e){return Dn(e)&&1===e.nodeType}function di(){try{return u()().parent!==u()().self}catch(e){return!0}}function hi(e){return function(t,n){if(!ui(t))return c()[e](null);ui(n)&&(n=c().querySelector(n));var i=ci(n)?n:c();return i[e]&&i[e](t)}}function pi(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0,r=c().createElement(e);return Object.getOwnPropertyNames(t).forEach(function(e){var n=t[e];"textContent"===e?fi(r,n):r[e]===n&&"tabIndex"!==e||(r[e]=n)}
2),Object.getOwnPropertyNames(n).forEach(function(e){r.setAttribute(e,n[e])}),i&&Oi(r,i),r}function fi(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function mi(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function gi(e,t){return function(e){if(e.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}(t),e.classList.contains(t)}function vi(e){for(var t,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return(t=e.classList).add.apply(t,un(i.reduce(function(e,t){return e.concat(t.split(/\s+/))},[]))),e}function yi(e){var t;if(!e)return wn.warn("removeClass was called with an element that doesn't exist"),null;for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return(t=e.classList).remove.apply(t,un(i.reduce(function(e,t){return e.concat(t.split(/\s+/))},[]))),e}function _i(e,t,n){return"function"==typeof n&&(n=n(e,t)),"boolean"!=typeof n&&(n=void 0),t.split(/\s+/).forEach(function(t){return e.classList.toggle(t,n)}),e}function bi(e,t){Object.getOwnPropertyNames(t).forEach(function(n){var i=t[n];null==i||!1===i?e.removeAttribute(n):e.setAttribute(n,!0===i?"":i)})}function Ti(e){var t={},n=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(e&&e.attributes&&e.attributes.length>0)for(var i=e.attributes,r=i.length-1;r>=0;r--){var a=i[r].name,s=i[r].value;n.includes(a)&&(s=null!==s),t[a]=s}return t}function ki(e,t){return e.getAttribute(t)}function Si(e,t,n){e.setAttribute(t,n)}function wi(e,t){e.removeAttribute(t)}function Ei(){c().body.focus(),c().onselectstart=function(){return!1}}function Ci(){c().onselectstart=function(){return!0}}function Ii(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(Bi(e,"height"))),n.width||(n.width=parseFloat(Bi(e,"width"))),n}}function xi(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};for(var t=e.offsetWidth,n=e.offsetHeight,i=0,r=0;e.offsetParent&&e!==c()[yn.fullscreenElement];)i+=e.offsetLeft,r+=e.offsetTop,e=e.offsetParent;return{left:i,top:r,width:t,height:n}}function Ai(e,t){var n={x:0,y:0};if(ai)for(var i=e;i&&"html"!==i.nodeName.toLowerCase();){var r=Bi(i,"transform");
2if(/^matrix/.test(r)){var a=r.slice(7,-1).split(/,\s/).map(Number);n.x+=a[4],n.y+=a[5]}else if(/^matrix3d/.test(r)){var s=r.slice(9,-1).split(/,\s/).map(Number);n.x+=s[12],n.y+=s[13]}if(i.assignedSlot&&i.assignedSlot.parentElement&&u()().WebKitCSSMatrix){var o=u()().getComputedStyle(i.assignedSlot.parentElement).transform,l=new(u()().WebKitCSSMatrix)(o);n.x+=l.m41,n.y+=l.m42}i=i.parentNode||i.host}var c={},d=xi(t.target),h=xi(e),p=h.width,f=h.height,m=t.offsetY-(h.top-d.top),g=t.offsetX-(h.left-d.left);return t.changedTouches&&(g=t.changedTouches[0].pageX-h.left,m=t.changedTouches[0].pageY+h.top,ai&&(g-=n.x,m-=n.y)),c.y=1-Math.max(0,Math.min(1,m/f)),c.x=Math.max(0,Math.min(1,g/p)),c}function Di(e){return Dn(e)&&3===e.nodeType}function Pi(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function Li(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map(function(e){return"function"==typeof e&&(e=e()),ci(e)||Di(e)?e:"string"==typeof e&&/\S/.test(e)?c().createTextNode(e):void 0}).filter(function(e){return e})}function Oi(e,t){return Li(t).forEach(function(t){return e.appendChild(t)}),e}function Ri(e,t){return Oi(Pi(e),t)}function Mi(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||("mousedown"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons)))}var Ni=hi("querySelector"),Ui=hi("querySelectorAll");function Bi(e,t){if(!e||!t)return"";if("function"==typeof u()().getComputedStyle){var n;try{n=u()().getComputedStyle(e)}catch(e){return""}return n?n.getPropertyValue(t)||n[t]:""}return""}function Fi(e){un(c().styleSheets).forEach(function(t){try{var n=un(t.cssRules).map(function(e){return e.cssText}).join(""),i=c().createElement("style");i.textContent=n,e.document.head.appendChild(i)}catch(n){var r=c().createElement("link");r.rel="stylesheet",r.type=t.type,r.media=t.media.mediaText,r.href=t.href,e.document.head.appendChild(r)}})}var qi,ji=Object.freeze({__proto__:null,isReal:li,isEl:ci,isInFrame:di,createEl:pi,textContent:fi,prependTo:mi,hasClass:gi,addClass:vi,removeClass:yi,toggleClass:_i,setAttributes:bi,getAttributes:Ti,getAttribute:ki,setAttribute:Si,removeAttribute:wi,blockTextSelection:Ei,unblockTextSelection:Ci,getBoundingClientRect:Ii,findPosition:xi,getPointerPosition:Ai,isTextNode:Di,emptyEl:Pi,normalizeContent:Li,appendContent:Oi,insertContent:Ri,isSingleLeftClick:Mi,$:Ni,$$:Ui,computedStyle:Bi,copyStyleSheetsToWindow:Fi}),Hi=!1,Vi=function(){if(!1!==qi.options.autoSetup){var e=Array.prototype.slice.call(c().getElementsByTagName("video")),t=Array.prototype.slice.call(c().getElementsByTagName("audio")),n=Array.prototype.slice.call(c().getElementsByTagName("video-js")),i=e.concat(t,n);if(i&&i.length>0)for(var r=0,a=i.length;r<a;r++){var s=i[r];if(!s||!s.getAttribute){zi(1);break}void 0===s.player&&null!==s.getAttribute("data-setup")&&qi(s)}else Hi||zi(1)}};function zi(e,t){li()&&(t&&(qi=t),u()().setTimeout(Vi,e))}function Wi(){Hi=!0,u()().removeEventListener("load",Wi)}li()&&("complete"===c().readyState?Wi():u()().addEventListener("load",Wi));var Gi,Xi=function(e){var t=c().createElement("style");return t.className=e,t},Ki=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t},Yi=new WeakMap,Qi=3;function $i(){return Qi++}function Ji(e,t){if(Yi.has(e)){var n=Yi.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&&Yi.delete(e)}}function Zi(e,t,n,i){n.forEach(function(n){e(t,n,i)})}function er(e){if(e.fixed_)return e;function t(){return!0}function n(){return!1}if(!e||!e.isPropagationStopped||!e.isImmediatePropagationStopped){var i=e||u()().event;e={};var r=["layerX","layerY","keyLocation","path","webkitMovementX","webkitMovementY","mozPressure","mozInputSource"];for(var a in i)r.includes(a)||"returnValue"===a&&i.preventDefault||(e[a]=i[a]);if(e.target||(e.target=e.srcElement||c()),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){i.preventDefault&&i.preventDefault(),e.returnValue=!1,i.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){i.stopPropagation&&i.stopPropagation(),e.cancelBubble=!0,i.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=n,e.stopImmediatePropagation=function(){i.stopImmediatePropagation&&i.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=n,null!==e.clientX&&void 0!==e.clientX){var s=c().documentElement,o=c().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 tr=["touchstart","touchmove"];function nr(e,t,n){if(Array.isArray(t))return Zi(nr,e,t,n);Yi.has(e)||Yi.set(e,{});var i=Yi.get(e);if(i.handlers||(i.handlers={}),i.handlers[t]||(i.handlers[t]=[]),n.guid||(n.guid=$i()),i.handlers[t].push(n),i.dispatcher||(i.disabled=!1,i.dispatcher=function(t,n){if(!i.disabled){t=er(t);var r=i.handlers[t.type];if(r)for(var a=r.slice(0),s=0,o=a.length;s<o&&!t.isImmediatePropagationStopped();s++)try{a[s].call(e,t,n)}catch(e){wn.error(e)}}}),1===i.handlers[t].length)if(e.addEventListener){var r=!1;(function(){if("boolean"!=typeof Gi){Gi=!1;try{var e=Object.defineProperty({},"passive",{get:function(){Gi=!0}});u()().addEventListener("test",null,e),u()().removeEventListener("test",null,e)}catch(e){}}return Gi})()&&tr.indexOf(t)>-1&&(r={passive:!0}),e.addEventListener(t,i.dispatcher,r)}else e.attachEvent&&e.attachEvent("on"+t,i.dispatcher)}
2function ir(e,t,n){if(Yi.has(e)){var i=Yi.get(e);if(i.handlers){if(Array.isArray(t))return Zi(ir,e,t,n);var r=function(e,t){i.handlers[t]=[],Ji(e,t)};if(void 0!==t){var a=i.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);Ji(e,t)}else r(e,t)}else for(var o in i.handlers)Object.prototype.hasOwnProperty.call(i.handlers||{},o)&&r(e,o)}}}function rr(e,t,n){var i=Yi.has(e)?Yi.get(e):{},r=e.parentNode||e.ownerDocument;if("string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=er(t),i.dispatcher&&i.dispatcher.call(e,t,n),r&&!t.isPropagationStopped()&&!0===t.bubbles)rr.call(null,r,t,n);else if(!r&&!t.defaultPrevented&&t.target&&t.target[t.type]){Yi.has(t.target)||Yi.set(t.target,{});var a=Yi.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 ar(e,t,n){if(Array.isArray(t))return Zi(ar,e,t,n);var i=function(){ir(e,t,i),n.apply(this,arguments)};i.guid=n.guid=n.guid||$i(),nr(e,t,i)}function sr(e,t,n){var i=function(){ir(e,t,i),n.apply(this,arguments)};i.guid=n.guid=n.guid||$i(),nr(e,t,i)}var or,ur=Object.freeze({__proto__:null,fixEvent:er,on:nr,off:ir,trigger:rr,one:ar,any:sr}),lr=30,cr=function(e,t,n){t.guid||(t.guid=$i());var i=t.bind(e);return i.guid=n?n+"_"+t.guid:t.guid,i},dr=function(e,t){var n=u()().performance.now();return function(){var i=u()().performance.now();i-n>=t&&(e.apply(void 0,arguments),n=i)}},hr=function(e,t,n){var i,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:u()(),a=function(){var a=this,s=arguments,o=function(){i=null,o=null,n||e.apply(a,s)};!i&&n&&e.apply(a,s),r.clearTimeout(i),i=r.setTimeout(o,t)};return a.cancel=function(){r.clearTimeout(i),i=null},a},pr=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:lr,bind_:cr,throttle:dr,debounce:hr}),fr=function(){return sn(function e(){rn(this,e)},[{key:"on",value:function(e,t){var n=this.addEventListener;this.addEventListener=function(){},nr(this,e,t),this.addEventListener=n}},{key:"off",value:function(e,t){ir(this,e,t)}},{key:"one",value:function(e,t){var n=this.addEventListener;this.addEventListener=function(){},ar(this,e,t),this.addEventListener=n}},{key:"any",value:function(e,t){var n=this.addEventListener;this.addEventListener=function(){},sr(this,e,t),this.addEventListener=n}},{key:"trigger",value:function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=er(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),rr(this,e)}},{key:"queueTrigger",value:function(e){var t=this;or||(or=new Map);var n=e.type||e,i=or.get(this);i||(i=new Map,or.set(this,i));var r=i.get(n);i.delete(n),u()().clearTimeout(r);var a=u()().setTimeout(function(){i.delete(n),0===i.size&&(i=null,or.delete(t)),t.trigger(e)},0);i.set(n,a)}}])}();fr.prototype.allowedEvents_={},fr.prototype.addEventListener=fr.prototype.on,fr.prototype.removeEventListener=fr.prototype.off,fr.prototype.dispatchEvent=fr.prototype.trigger;var mr=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:hn(e)},gr=function(e){return e instanceof fr||!!e.eventBusEl_&&["on","one","off","trigger"].every(function(t){return"function"==typeof e[t]})},vr=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},yr=function(e,t,n){if(!e||!e.nodeName&&!gr(e))throw new Error("Invalid target for ".concat(mr(t),"#").concat(n,"; must be a DOM node or evented object."))},_r=function(e,t,n){if(!vr(e))throw new Error("Invalid event type for ".concat(mr(t),"#").concat(n,"; must be a non-empty string or array."))},br=function(e,t,n){if("function"!=typeof e)throw new Error("Invalid listener for ".concat(mr(t),"#").concat(n,"; must be a function."))},Tr=function(e,t,n){var i,r,a,s=t.length<3||t[0]===e||t[0]===e.eventBusEl_;if(s){i=e.eventBusEl_,t.length>=3&&t.shift();var o=en(t,2);r=o[0],a=o[1]}else i=t[0],r=t[1],a=t[2];return yr(i,e,n),_r(r,e,n),br(a,e,n),{isTargetingSelf:s,target:i,type:r,listener:a=cr(e,a)}},kr=function(e,t,n,i){yr(e,e,t),e.nodeName?ur[t](e,n,i):e[t](n,i)},Sr={on:function(){for(var e=this,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var r=Tr(this,n,"on"),a=r.isTargetingSelf,s=r.target,o=r.type,u=r.listener;if(kr(s,"on",o,u),!a){var l=function(){return e.off(s,o,u)};l.guid=u.guid;var c=function(){return e.off("dispose",l)};c.guid=u.guid,kr(this,"on","dispose",l),kr(s,"on","dispose",c)}},one:function(){for(var e=this,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var r=Tr(this,n,"one"),a=r.isTargetingSelf,s=r.target,o=r.type,u=r.listener;if(a)kr(s,"one",o,u);else{var l=function(){e.off(s,o,l);for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];u.apply(null,n)};l.guid=u.guid,kr(s,"one",o,l)}},any:function(){for(var e=this,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var r=Tr(this,n,"any"),a=r.isTargetingSelf,s=r.target,o=r.type,u=r.listener;if(a)kr(s,"any",o,u);else{var l=function(){e.off(s,o,l);for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];u.apply(null,n)};l.guid=u.guid,kr(s,"any",o,l)}},off:function(e,t,n){if(!e||vr(e))ir(this.eventBusEl_,e,t);else{var i=e,r=t;yr(i,this,"off"),_r(r,this,"off"),br(n,this,"off"),n=cr(this,n),this.off("dispose",n),i.nodeName?(ir(i,r,n),ir(i,"dispose",n)):gr(i)&&(i.off(r,n),i.off("dispose",n))}},trigger:function(e,t){yr(this.eventBusEl_,this,"trigger");var n=e&&"string"!=typeof e?e.type:e;if(!vr(n))throw new Error("Invalid event type for ".concat(mr(this),"#trigger; ")+"must be a non-empty string or object with a type key that has a non-empty value.");return rr(this.eventBusEl_,e,t)}};function wr(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).eventBusKey;if(t){if(!e[t].nodeName)throw new Error('The eventBusKey "'.concat(t,'" does not refer to an element.'));e.eventBusEl_=e[t]}else e.eventBusEl_=pi("span",{className:"vjs-event-bus"});return Object.assign(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&&Yi.has(e)&&Yi.delete(e)}),u()().setTimeout(function(){e.eventBusEl_=null},0)}),e}var Er={state:{},setState:function(e){var t,n=this;return"function"==typeof e&&(e=e()),xn(e,function(e,i){n.state[i]!==e&&((t=t||{})[i]={from:n.state[i],to:e}),n.state[i]=e}),t&&gr(this)&&this.trigger({changes:t,type:"statechanged"}),t}};function Cr(e,t){return Object.assign(e,Er),e.state=Object.assign({},e.state,t),"function"==typeof e.handleStateChanged&&gr(e)&&e.on("statechanged",e.handleStateChanged),e}var Ir=function(e){return"string"!=typeof e?e:e.replace(/./,function(e){return e.toLowerCase()})},xr=function(e){return"string"!=typeof e?e:e.replace(/./,function(e){return e.toUpperCase()})},Ar=function(e,t){return xr(e)===xr(t)},Dr=Object.freeze({__proto__:null,toLowerCase:Ir,toTitleCase:xr,titleCaseEquals:Ar}),Pr=function(){function e(t,n,i){var r=this;if(rn(this,e),!t&&this.play?this.player_=t=this:this.player_=t,this.isDisposed_=!1,this.parentComponent_=null,this.options_=Ln({},this.options_),n=this.options_=Ln(this.options_,n),this.id_=n.id||n.el&&n.el.id,!this.id_){var a=t&&t.id&&t.id()||"no_player";this.id_="".concat(a,"_component_").concat($i())}this.name_=n.name||null,n.el?this.el_=n.el:!1!==n.createEl&&(this.el_=this.createEl()),n.className&&this.el_&&n.className.split(" ").forEach(function(e){return r.addClass(e)}),["on","off","one","any","trigger"].forEach(function(e){r[e]=void 0}),!1!==n.evented&&(wr(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),Cr(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!==n.initChildren&&this.initChildren(),this.ready(i),!1!==n.reportTouchActivity&&this.enableTouchActivity()}return sn(e,[{key:"dispose",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(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}}},{key:"isDisposed",value:function(){return Boolean(this.isDisposed_)}},{key:"player",value:function(){return this.player_}},{key:"options",value:function(e){return e?(this.options_=Ln(this.options_,e),this.options_):this.options_}},{key:"el",value:function(){return this.el_}},{key:"createEl",value:function(e,t,n){return pi(e,t,n)}},{key:"localize",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,i=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),a=r&&r[i],s=i&&i.split("-")[0],o=r&&r[s],u=n;return a&&a[e]?u=a[e]:o&&o[e]&&(u=o[e]),t&&(u=u.replace(/\{(\d+)\}/g,function(e,n){var i=t[n-1],r=i;return void 0===i&&(r=e),r})),u}},{key:"handleLanguagechange",value:function(){}},{key:"contentEl",value:function(){return this.contentEl_||this.el_}},{key:"id",value:function(){return this.id_}},{key:"name",value:function(){return this.name_}},{key:"children",value:function(){return this.children_}},{key:"getChildById",value:function(e){return this.childIndex_[e]}},{key:"getChild",value:function(e){if(e)return this.childNameIndex_[e]}},{key:"getDescendant",value: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 i=this,r=0;r<t.length;r++)if(!(i=i.getChild(t[r]))||!i.getChild)return;return i}},{key:"setIcon",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.el();if(this.player_.options_.experimentalSvgIcons){var n="http://www.w3.org/2000/svg",i=pi("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),r=c().createElementNS(n,"svg");r.setAttributeNS(null,"viewBox","0 0 512 512");var a=c().createElementNS(n,"use");return r.appendChild(a),a.setAttributeNS(null,"href","#vjs-icon-".concat(e)),i.appendChild(r),this.iconIsSet_?t.replaceChild(i,t.querySelector(".vjs-icon-placeholder")):t.appendChild(i),this.iconIsSet_=!0,i}}},{key:"addChild",value:function(t){var n,i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.children_.length;if("string"==typeof t){i=xr(t);var s=r.componentClass||i;r.name=i;var o=e.getComponent(s);if(!o)throw new Error("Component ".concat(s," does not exist"));if("function"!=typeof o)return null;n=new o(this.player_||this,r)}else n=t;if(n.parentComponent_&&n.parentComponent_.removeChild(n),this.children_.splice(a,0,n),n.parentComponent_=this,"function"==typeof n.id&&(this.childIndex_[n.id()]=n),(i=i||n.name&&xr(n.name()))&&(this.childNameIndex_[i]=n,this.childNameIndex_[Ir(i)]=n),"function"==typeof n.el&&n.el()){var u=null;this.children_[a+1]&&(this.children_[a+1].el_?u=this.children_[a+1].el_:ci(this.children_[a+1])&&(u=this.children_[a+1])),this.contentEl().insertBefore(n.el(),u)}return n}},{key:"removeChild",value: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_[xr(e.name())]=null,this.childNameIndex_[Ir(e.name())]=null;var i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}}},{key:"initChildren",value:function(){var t=this,n=this.options_.children;if(n){var i,r=this.options_,a=e.getComponent("Tech");(i=Array.isArray(n)?n:Object.keys(n)).concat(Object.keys(this.options_).filter(function(e){return!i.some(function(t){return"string"==typeof t?e===t:e===t.name})})).map(function(e){var i,r;return"string"==typeof e?r=n[i=e]||t.options_[i]||{}:(i=e.name,r=e),{name:i,opts:r}}).filter(function(t){var n=e.getComponent(t.opts.componentClass||xr(t.name));return n&&!a.isTech(n)}
2).forEach(function(e){var n=e.name,i=e.opts;if(void 0!==r[n]&&(i=r[n]),!1!==i){!0===i&&(i={}),i.playerOptions=t.options_.playerOptions;var a=t.addChild(n,i);a&&(t[n]=a)}})}}},{key:"buildCSSClass",value:function(){return""}},{key:"ready",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))}},{key:"triggerReady",value: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)}},{key:"$",value:function(e,t){return Ni(e,t||this.contentEl())}},{key:"$$",value:function(e,t){return Ui(e,t||this.contentEl())}},{key:"hasClass",value:function(e){return gi(this.el_,e)}},{key:"addClass",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];vi.apply(void 0,[this.el_].concat(t))}},{key:"removeClass",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];yi.apply(void 0,[this.el_].concat(t))}},{key:"toggleClass",value:function(e,t){_i(this.el_,e,t)}},{key:"show",value:function(){this.removeClass("vjs-hidden")}},{key:"hide",value:function(){this.addClass("vjs-hidden")}},{key:"lockShowing",value:function(){this.addClass("vjs-lock-showing")}},{key:"unlockShowing",value:function(){this.removeClass("vjs-lock-showing")}},{key:"getAttribute",value:function(e){return ki(this.el_,e)}},{key:"setAttribute",value:function(e,t){Si(this.el_,e,t)}},{key:"removeAttribute",value:function(e){wi(this.el_,e)}},{key:"width",value:function(e,t){return this.dimension("width",e,t)}},{key:"height",value:function(e,t){return this.dimension("height",e,t)}},{key:"dimensions",value:function(e,t){this.width(e,!0),this.height(t)}},{key:"dimension",value:function(e,t,n){if(void 0!==t)return null!==t&&t==t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(n||this.trigger("componentresize"));if(!this.el_)return 0;var i=this.el_.style[e],r=i.indexOf("px");return-1!==r?parseInt(i.slice(0,r),10):parseInt(this.el_["offset"+xr(e)],10)}},{key:"currentDimension",value:function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if(t=Bi(this.el_,e),0===(t=parseFloat(t))||isNaN(t)){var n="offset".concat(xr(e));t=this.el_[n]}return t}},{key:"currentDimensions",value:function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}},{key:"currentWidth",value:function(){return this.currentDimension("width")}},{key:"currentHeight",value:function(){return this.currentDimension("height")}},{key:"getPositions",value:function(){var e=this.el_.getBoundingClientRect();return{boundingClientRect:{x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},center:{x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2}}}},{key:"focus",value:function(){this.el_.focus()}},{key:"blur",value:function(){this.el_.blur()}},{key:"handleKeyDown",value:function(e){this.player_&&("Tab"===e.key||this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled||e.stopPropagation(),this.player_.handleKeyDown(e))}},{key:"handleKeyPress",value:function(e){this.handleKeyDown(e)}},{key:"emitTapEvents",value:function(){var e,t=0,n=null;this.on("touchstart",function(i){1===i.touches.length&&(n={pageX:i.touches[0].pageX,pageY:i.touches[0].pageY},t=u()().performance.now(),e=!0)}),this.on("touchmove",function(t){if(t.touches.length>1)e=!1;else if(n){var i=t.touches[0].pageX-n.pageX,r=t.touches[0].pageY-n.pageY;Math.sqrt(i*i+r*r)>10&&(e=!1)}});var i=function(){e=!1};this.on("touchleave",i),this.on("touchcancel",i),this.on("touchend",function(i){(n=null,!0===e)&&(u()().performance.now()-t<200&&(i.preventDefault(),this.trigger("tap")))})}},{key:"enableTouchActivity",value:function(){if(this.player()&&this.player().reportUserActivity){var e,t=cr(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)}}},{key:"setTimeout",value:function(e,t){var n,i=this;return e=cr(this,e),this.clearTimersOnDispose_(),n=u()().setTimeout(function(){i.setTimeoutIds_.has(n)&&i.setTimeoutIds_.delete(n),e()},t),this.setTimeoutIds_.add(n),n}},{key:"clearTimeout",value:function(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),u()().clearTimeout(e)),e}},{key:"setInterval",value:function(e,t){e=cr(this,e),this.clearTimersOnDispose_();var n=u()().setInterval(e,t);return this.setIntervalIds_.add(n),n}},{key:"clearInterval",value:function(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),u()().clearInterval(e)),e}},{key:"requestAnimationFrame",value:function(e){var t,n=this;return this.clearTimersOnDispose_(),e=cr(this,e),t=u()().requestAnimationFrame(function(){n.rafIds_.has(t)&&n.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}},{key:"requestNamedAnimationFrame",value:function(e,t){var n=this;this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),t=cr(this,t);var i=this.requestAnimationFrame(function(){t(),n.namedRafs_.has(e)&&n.namedRafs_.delete(e)});return this.namedRafs_.set(e,i),e}},{key:"cancelNamedAnimationFrame",value:function(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}},{key:"cancelAnimationFrame",value:function(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),u()().cancelAnimationFrame(e)),e}},{key:"clearTimersOnDispose_",value:function(){var e=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEac
2h(function(t){var n=en(t,2),i=n[0],r=n[1];e[i].forEach(function(t,n){return e[r](n)})}),e.clearingTimersOnDispose_=!1}))}},{key:"getIsDisabled",value:function(){return Boolean(this.el_.disabled)}},{key:"getIsExpresslyInert",value:function(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}},{key:"getIsFocusable",value:function(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}},{key:"getIsAvailableToBeFocused",value:function(e){function t(e){var t=u()().getComputedStyle(e,null),n=t.getPropertyValue("visibility");return"none"!==t.getPropertyValue("display")&&!["hidden","collapse"].includes(n)}return e||(e=this.el()),!!(function(e){if(e.offsetWidth+e.offsetHeight+e.getBoundingClientRect().height+e.getBoundingClientRect().width===0)return!1;var t={x:e.getBoundingClientRect().left+e.offsetWidth/2,y:e.getBoundingClientRect().top+e.offsetHeight/2};if(t.x<0)return!1;if(t.x>(c().documentElement.clientWidth||u()().innerWidth))return!1;if(t.y<0)return!1;if(t.y>(c().documentElement.clientHeight||u()().innerHeight))return!1;for(var n=c().elementFromPoint(t.x,t.y);n;){if(n===e)return!0;if(!n.parentNode)return!1;n=n.parentNode}}(e)&&(n=e,t(n.parentElement)&&t(n)&&"0"!==n.style.opacity&&"0px"!==u()().getComputedStyle(n).height&&"0px"!==u()().getComputedStyle(n).width)&&(!e.parentElement||e.tabIndex>=0));var n}}],[{key:"registerComponent",value:function(t,n){if("string"!=typeof t||!t)throw new Error('Illegal component name, "'.concat(t,'"; must be a non-empty string.'));var i,r=e.getComponent("Tech"),a=r&&r.isTech(n),s=e===n||e.prototype.isPrototypeOf(n.prototype);if(a||!s)throw i=a?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'.concat(t,'"; ').concat(i,"."));t=xr(t),e.components_||(e.components_={});var o=e.getComponent("Player");if("Player"===t&&o&&o.players){var u=o.players,l=Object.keys(u);if(u&&l.length>0)for(var c=0;c<l.length;c++)if(null!==u[l[c]])throw new Error("Can not register Player component after player has been created.")}return e.components_[t]=n,e.components_[Ir(t)]=n,n}},{key:"getComponent",value:function(t){if(t&&e.components_)return e.components_[t]}}])}();function Lr(e,t,n,i){return function(e,t,n){if("number"!=typeof t||t<0||t>n)throw new Error("Failed to execute '".concat(e,"' on 'TimeRanges': The index provided (").concat(t,") is non-numeric or out of bounds (0-").concat(n,")."))}(e,i,n.length-1),n[i][t]}function Or(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)},u()().Symbol&&u()().Symbol.iterator&&(t[u()().Symbol.iterator]=function(){return(e||[]).values()}),t}function Rr(e,t){return Array.isArray(e)?Or(e):void 0===e||void 0===t?Or():Or([[e,t]])}Pr.registerComponent("Component",Pr);var Mr=function(e,t){e=e<0?0:e;var n=Math.floor(e%60),i=Math.floor(e/60%60),r=Math.floor(e/3600),a=Math.floor(t/60%60),s=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(r=i=n="-"),(r=r>0||s>0?r+":":"")+(i=((r||a>=10)&&i<10?"0"+i:i)+":")+(n=n<10?"0"+n:n)},Nr=Mr;function Ur(e){Nr=e}function Br(){Nr=Mr}function Fr(e){return Nr(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:e)}var qr=Object.freeze({__proto__:null,createTimeRanges:Rr,createTimeRange:Rr,setFormatTime:Ur,resetFormatTime:Br,formatTime:Fr});function jr(e,t){var n,i,r=0;if(!t)return 0;e&&e.length||(e=Rr(0,0));for(var a=0;a<e.length;a++)n=e.start(a),(i=e.end(a))>t&&(i=t),r+=i-n;return r/t}function Hr(e){if(e instanceof Hr)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:Dn(e)&&("number"==typeof e.code&&(this.code=e.code),Object.assign(this,e)),this.message||(this.message=Hr.defaultMessages[this.code]||"")}function Vr(e){return null!=e&&"function"==typeof e.then}function zr(e){Vr(e)&&e.then(null,function(e){})}Hr.prototype.code=0,Hr.prototype.message="",Hr.prototype.status=null,Hr.prototype.metadata=null,Hr.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Hr.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."},Hr.MEDIA_ERR_CUSTOM=0,Hr.prototype.MEDIA_ERR_CUSTOM=0,Hr.MEDIA_ERR_ABORTED=1,Hr.prototype.MEDIA_ERR_ABORTED=1,Hr.MEDIA_ERR_NETWORK=2,Hr.prototype.MEDIA_ERR_NETWORK=2,Hr.MEDIA_ERR_DECODE=3,Hr.prototype.MEDIA_ERR_DECODE=3,Hr.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Hr.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Hr.MEDIA_ERR_ENCRYPTED=5,Hr.prototype.MEDIA_ERR_ENCRYPTED=5;var Wr=function(e){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(function(t,n,i){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}})})},Gr=function(e){var t=e.$$("track"),n=Array.prototype.map.call(t,function(e){return e.track});return Array.prototype.map.call(t,function(e){var t=Wr(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(Wr))},Xr=function(e,t){return e.forEach(function(e){var n=t.addRemoteTextTrack(e).track;
2!e.src&&e.cues&&e.cues.forEach(function(e){return n.addCue(e)})}),t.textTracks()},Kr=Wr,Yr="vjs-modal-dialog",Qr=function(e){function t(e,n){var i;return rn(this,t),(i=Kt(this,t,[e,n])).handleKeyDown_=function(e){return i.handleKeyDown(e)},i.close_=function(e){return i.close(e)},i.opened_=i.hasBeenOpened_=i.hasBeenFilled_=!1,i.closeable(!i.options_.uncloseable),i.content(i.options_.content),i.contentEl_=pi("div",{className:"".concat(Yr,"-content")},{role:"document"}),i.descEl_=pi("p",{className:"".concat(Yr,"-description vjs-control-text"),id:i.el().getAttribute("aria-describedby")}),fi(i.descEl_,i.description()),i.el_.appendChild(i.descEl_),i.el_.appendChild(i.contentEl_),i}return Gt(t,e),sn(t,[{key:"createEl",value:function(){return $t(t,"createEl",this,3)(["div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":"".concat(this.id(),"_description"),"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"}])}},{key:"dispose",value:function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,$t(t,"dispose",this,3)([])}},{key:"buildCSSClass",value:function(){return"".concat(Yr," vjs-hidden ").concat($t(t,"buildCSSClass",this,3)([]))}},{key:"label",value:function(){return this.localize(this.options_.label||"Modal Window")}},{key:"description",value: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}},{key:"open",value:function(){if(this.opened_)this.options_.fillAlways&&this.fill();else{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}}},{key:"opened",value:function(e){return"boolean"==typeof e&&this[e?"open":"close"](),this.opened_}},{key:"close",value: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({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}}},{key:"closeable",value:function(e){if("boolean"==typeof e){var t=this.closeable_=!!e,n=this.getChild("closeButton");if(t&&!n){var i=this.contentEl_;this.contentEl_=this.el_,n=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=i,this.on(n,"close",this.close_)}!t&&n&&(this.off(n,"close",this.close_),this.removeChild(n),n.dispose())}return this.closeable_}},{key:"fill",value:function(){this.fillWith(this.content())}},{key:"fillWith",value:function(e){var t=this.contentEl(),n=t.parentNode,i=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,n.removeChild(t),this.empty(),Ri(t,e),this.trigger("modalfill"),i?n.insertBefore(t,i):n.appendChild(t);var r=this.getChild("closeButton");r&&n.appendChild(r.el_),this.trigger("aftermodalfill")}},{key:"empty",value:function(){this.trigger("beforemodalempty"),Pi(this.contentEl()),this.trigger("modalempty")}},{key:"content",value:function(e){return void 0!==e&&(this.content_=e),this.content_}},{key:"conditionalFocus_",value:function(){var e=c().activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}},{key:"conditionalBlur_",value:function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}},{key:"handleKeyDown",value:function(e){if(this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),"Escape"===e.key&&this.closeable())return e.preventDefault(),void this.close();if("Tab"===e.key){for(var t,n=this.focusableEls_(),i=this.el_.querySelector(":focus"),r=0;r<n.length;r++)if(i===n[r]){t=r;break}c().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())}}},{key:"focusableEls_",value:function(){var e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,function(e){return(e instanceof u()().HTMLAnchorElement||e instanceof u()().HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof u()().HTMLInputElement||e instanceof u()().HTMLSelectElement||e instanceof u()().HTMLTextAreaElement||e instanceof u()().HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof u()().HTMLIFrameElement||e instanceof u()().HTMLObjectElement||e instanceof u()().HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable")})}}])}(Pr);
2Qr.prototype.options_={pauseOnOpen:!0,temporary:!0},Pr.registerComponent("ModalDialog",Qr);var $r=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];rn(this,t),(e=Kt(this,t)).tracks_=[];for(var i=0;i<n.length;i++)e.addTrack(n[i]);return e}return Gt(t,e),sn(t,[{key:"length",get:function(){return this.tracks_.length}},{key:"addTrack",value: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})},gr(e)&&e.addEventListener("labelchange",e.labelchange_)}},{key:"removeTrack",value:function(e){for(var t,n=0,i=this.length;n<i;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})}},{key:"getTrackById",value:function(e){for(var t=null,n=0,i=this.length;n<i;n++){var r=this[n];if(r.id===e){t=r;break}}return t}}])}(fr);for(var Jr in $r.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"},$r.prototype.allowedEvents_)$r.prototype["on"+Jr]=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)},ea=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];rn(this,t);for(var i=n.length-1;i>=0;i--)if(n[i].enabled){Zr(n,n[i]);break}return(e=Kt(this,t,[n])).changing_=!1,e}return Gt(t,e),sn(t,[{key:"addTrack",value:function(e){var n=this;e.enabled&&Zr(this,e),$t(t,"addTrack",this,3)([e]),e.addEventListener&&(e.enabledChange_=function(){n.changing_||(n.changing_=!0,Zr(n,e),n.changing_=!1,n.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}},{key:"removeTrack",value:function(e){$t(t,"removeTrack",this,3)([e]),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}}])}($r),ta=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)},na=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];rn(this,t);for(var i=n.length-1;i>=0;i--)if(n[i].selected){ta(n,n[i]);break}return(e=Kt(this,t,[n])).changing_=!1,Object.defineProperty(e,"selectedIndex",{get:function(){for(var e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set:function(){}}),e}return Gt(t,e),sn(t,[{key:"addTrack",value:function(e){var n=this;e.selected&&ta(this,e),$t(t,"addTrack",this,3)([e]),e.addEventListener&&(e.selectedChange_=function(){n.changing_||(n.changing_=!0,ta(n,e),n.changing_=!1,n.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}},{key:"removeTrack",value:function(e){$t(t,"removeTrack",this,3)([e]),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}}])}($r),ia=function(e){function t(){return rn(this,t),Kt(this,t,arguments)}return Gt(t,e),sn(t,[{key:"addTrack",value:function(e){var n=this;$t(t,"addTrack",this,3)([e]),this.queueChange_||(this.queueChange_=function(){return n.queueTrigger("change")}),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=function(){return n.trigger("selectedlanguagechange")}),e.addEventListener("modechange",this.queueChange_);-1===["metadata","chapters"].indexOf(e.kind)&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}},{key:"removeTrack",value:function(e){$t(t,"removeTrack",this,3)([e]),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}},{key:"toJSON",value:function(){return this.tracks_.map(function(e){return e.toJSON()})}}])}($r),ra=function(){return sn(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];rn(this,e),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var n=0,i=t.length;n<i;n++)this.addTrackElement_(t[n])},[{key:"addTrackElement_",value:function(e){var t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.trackElements_[t]}}
2),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)}},{key:"getTrackElementByTrack_",value:function(e){for(var t,n=0,i=this.trackElements_.length;n<i;n++)if(e===this.trackElements_[n].track){t=this.trackElements_[n];break}return t}},{key:"removeTrackElement_",value: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}}}])}(),aa=function(){return sn(function e(t){rn(this,e),e.prototype.setCues_.call(this,t),Object.defineProperty(this,"length",{get:function(){return this.length_}})},[{key:"setCues_",value:function(e){var t=this.length||0,n=0,i=e.length;this.cues_=e,this.length_=e.length;var r=function(e){""+e in this||Object.defineProperty(this,""+e,{get:function(){return this.cues_[e]}})};if(t<i)for(n=t;n<i;n++)r.call(this,n)}},{key:"getCueById",value:function(e){for(var t=null,n=0,i=this.length;n<i;n++){var r=this[n];if(r.id===e){t=r;break}}return t}}])}(),sa={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},oa={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},ua={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},la={disabled:"disabled",hidden:"hidden",showing:"showing"},ca=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};rn(this,t),e=Kt(this,t);var i={id:n.id||"vjs_track_"+$i(),kind:n.kind||"",language:n.language||""},r=n.label||"",a=function(t){Object.defineProperty(e,t,{get:function(){return i[t]},set:function(){}})};for(var s in i)a(s);return Object.defineProperty(e,"label",{get:function(){return r},set:function(e){e!==r&&(r=e,this.trigger("labelchange"))}}),e}return Gt(t,e),sn(t)}(fr),da=function(e){return new URL(e,c().baseURI)},ha=function(e){return new URL(e,c().baseURI).href},pa=function(e){if("string"==typeof e){var t=e.split("?")[0].replace(/\/+$/,"").match(/\.([^.\/]+)$/);return t?t[1].toLowerCase():""}return""},fa=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u()().location;return da(e).origin!==t.origin},ma=Object.freeze({__proto__:null,parseUrl:da,getAbsoluteURL:ha,getFileExtension:pa,isCrossOrigin:fa}),ga=function(e,t){var n=new(u()().WebVTT.Parser)(u()(),u()().vttjs,u()().WebVTT.StringDecoder()),i=[];n.oncue=function(e){t.addCue(e)},n.onparsingerror=function(e){i.push(e)},n.onflush=function(){t.trigger({type:"loadeddata",target:t})},n.parse(e),i.length>0&&(u()().console&&u()().console.groupCollapsed&&u()().console.groupCollapsed("Text Track parsing errors for ".concat(t.src)),i.forEach(function(e){return wn.error(e)}),u()().console&&u()().console.groupEnd&&u()().console.groupEnd()),n.flush()},va=function(e,t){var n={uri:e},i=fa(e);i&&(n.cors=i);var r="use-credentials"===t.tech_.crossOrigin();r&&(n.withCredentials=r),d()()(n,cr(this,function(e,n,i){if(e)return wn.error(e,n);t.loaded_=!0,"function"!=typeof u()().WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],function(e){if("vttjserror"!==e.type)return ga(i,t);wn.error("vttjs failed to load, stopping trying to process ".concat(t.src))}):ga(i,t)}))},ya=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(rn(this,t),!n.tech)throw new Error("A tech was not provided.");var i=Ln(n,{kind:ua[n.kind]||"subtitles",language:n.language||n.srclang||""}),r=la[i.mode]||"disabled",a=i.default;"metadata"!==i.kind&&"chapters"!==i.kind||(r="hidden"),(e=Kt(this,t,[i])).tech_=i.tech,e.cues_=[],e.activeCues_=[],e.preload_=!1!==e.tech_.preloadTextTracks;var s=new aa(e.cues_),o=new aa(e.activeCues_),u=!1;e.timeupdateHandler=cr(e,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.tech_.isDisposed()||(this.tech_.isReady_?(this.activeCues=this.activeCues,u&&(this.trigger("cuechange"),u=!1),"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))):"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)))});return e.tech_.one("dispose",function(){e.stopTracking()}),"disabled"!==r&&e.startTracking(),Object.defineProperties(e,{default:{get:function(){return a}
2,set:function(){}},mode:{get:function(){return r},set:function(e){la[e]&&r!==e&&(r=e,this.preload_||"disabled"===r||0!==this.cues.length||va(this.src,this),this.stopTracking(),"disabled"!==r&&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,i=this.cues.length;n<i;n++){var r=this.cues[n];r.startTime<=e&&r.endTime>=e&&t.push(r)}if(u=!1,t.length!==this.activeCues_.length)u=!0;else for(var a=0;a<t.length;a++)-1===this.activeCues_.indexOf(t[a])&&(u=!0);return this.activeCues_=t,o.setCues_(this.activeCues_),o},set:function(){}}}),i.src?(e.src=i.src,e.preload_||(e.loaded_=!0),(e.preload_||"subtitles"!==i.kind&&"captions"!==i.kind)&&va(e.src,e)):e.loaded_=!0,e}return Gt(t,e),sn(t,[{key:"startTracking",value:function(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)}},{key:"stopTracking",value:function(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)}},{key:"addCue",value:function(e){var t=e;if(!("getCueAsHTML"in t)){for(var n in t=new(u()().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 i=this.tech_.textTracks(),r=0;r<i.length;r++)i[r]!==this&&i[r].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}},{key:"toJSON",value:function(){return Kr(this)}},{key:"removeCue",value: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}}}}])}(ca);ya.prototype.allowedEvents_={cuechange:"cuechange"};var _a=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};rn(this,t);var i=Ln(n,{kind:oa[n.kind]||""});e=Kt(this,t,[i]);var r=!1;return Object.defineProperty(e,"enabled",{get:function(){return r},set:function(e){"boolean"==typeof e&&e!==r&&(r=e,this.trigger("enabledchange"))}}),i.enabled&&(e.enabled=i.enabled),e.loaded_=!0,e}return Gt(t,e),sn(t)}(ca),ba=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};rn(this,t);var i=Ln(n,{kind:sa[n.kind]||""});e=Kt(this,t,[i]);var r=!1;return Object.defineProperty(e,"selected",{get:function(){return r},set:function(e){"boolean"==typeof e&&e!==r&&(r=e,this.trigger("selectedchange"))}}),i.selected&&(e.selected=i.selected),e}return Gt(t,e),sn(t)}(ca),Ta=function(e){function t(){var e,n,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};rn(this,t),e=Kt(this,t);var r=new ya(i);return e.kind=r.kind,e.src=r.src,e.srclang=r.language,e.label=r.label,e.default=r.default,Object.defineProperties(e,{readyState:{get:function(){return n}},track:{get:function(){return r}}}),n=t.NONE,r.addEventListener("loadeddata",function(){n=t.LOADED,e.trigger({type:"load",target:e})}),e}return Gt(t,e),sn(t)}(fr);Ta.prototype.allowedEvents_={load:"load"},Ta.NONE=0,Ta.LOADING=1,Ta.LOADED=2,Ta.ERROR=3;var ka={audio:{ListClass:ea,TrackClass:_a,capitalName:"Audio"},video:{ListClass:na,TrackClass:ba,capitalName:"Video"},text:{ListClass:ia,TrackClass:ya,capitalName:"Text"}};Object.keys(ka).forEach(function(e){ka[e].getterName="".concat(e,"Tracks"),ka[e].privateName="".concat(e,"Tracks_")});var Sa={remoteText:{ListClass:ia,TrackClass:ya,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:ra,TrackClass:Ta,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},wa=Object.assign({},ka,Sa);Sa.names=Object.keys(Sa),ka.names=Object.keys(ka),wa.names=[].concat(Sa.names).concat(ka.names);var Ea=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};return rn(this,t),n.reportTouchActivity=!1,(e=Kt(this,t,[null,n,i])).onDurationChange_=function(t){return e.onDurationChange(t)}
2,e.trackProgress_=function(t){return e.trackProgress(t)},e.trackCurrentTime_=function(t){return e.trackCurrentTime(t)},e.stopTrackingCurrentTime_=function(t){return e.stopTrackingCurrentTime(t)},e.disposeSourceHandler_=function(t){return e.disposeSourceHandler(t)},e.queuedHanders_=new Set,e.hasStarted_=!1,e.on("playing",function(){this.hasStarted_=!0}),e.on("loadstart",function(){this.hasStarted_=!1}),wa.names.forEach(function(t){var i=wa[t];n&&n[i.getterName]&&(e[i.privateName]=n[i.getterName])}),e.featuresProgressEvents||e.manualProgressOn(),e.featuresTimeupdateEvents||e.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(function(t){!1===n["native".concat(t,"Tracks")]&&(e["featuresNative".concat(t,"Tracks")]=!1)}),!1===n.nativeCaptions||!1===n.nativeTextTracks?e.featuresNativeTextTracks=!1:!0!==n.nativeCaptions&&!0!==n.nativeTextTracks||(e.featuresNativeTextTracks=!0),e.featuresNativeTextTracks||e.emulateTextTracks(),e.preloadTextTracks=!1!==n.preloadTextTracks,e.autoRemoteTextTracks_=new wa.text.ListClass,e.initTrackListeners(),n.nativeControlsForTouch||e.emitTapEvents(),e.constructor&&(e.name_=e.constructor.name||"Unknown Tech"),e}return Gt(t,e),sn(t,[{key:"triggerSourceset",value: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"})}},{key:"manualProgressOn",value:function(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}},{key:"manualProgressOff",value:function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}},{key:"trackProgress",value:function(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(cr(this,function(){var e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()}),500)}},{key:"onDurationChange",value:function(e){this.duration_=this.duration()}},{key:"buffered",value:function(){return Rr(0,0)}},{key:"bufferedPercent",value:function(){return jr(this.buffered(),this.duration_)}},{key:"stopTrackingProgress",value:function(){this.clearInterval(this.progressInterval)}},{key:"manualTimeUpdatesOn",value:function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}},{key:"manualTimeUpdatesOff",value:function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}},{key:"trackCurrentTime",value:function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}},{key:"stopTrackingCurrentTime",value:function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}},{key:"dispose",value:function(){this.clearTracks(ka.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),$t(t,"dispose",this,3)([])}},{key:"clearTracks",value:function(e){var t=this;
2(e=[].concat(e)).forEach(function(e){for(var n=t["".concat(e,"Tracks")]()||[],i=n.length;i--;){var r=n[i];"text"===e&&t.removeRemoteTextTrack(r),n.removeTrack(r)}})}},{key:"cleanupAutoTextTracks",value:function(){for(var e=this.autoRemoteTextTracks_||[],t=e.length;t--;){var n=e[t];this.removeRemoteTextTrack(n)}}},{key:"reset",value:function(){}},{key:"crossOrigin",value:function(){}},{key:"setCrossOrigin",value:function(){}},{key:"error",value:function(e){return void 0!==e&&(this.error_=new Hr(e),this.trigger("error")),this.error_}},{key:"played",value:function(){return this.hasStarted_?Rr(0,0):Rr()}},{key:"play",value:function(){}},{key:"setScrubbing",value:function(e){}},{key:"scrubbing",value:function(){}},{key:"setCurrentTime",value:function(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}},{key:"initTrackListeners",value:function(){var e=this;ka.names.forEach(function(t){var n=ka[t],i=function(){e.trigger("".concat(t,"trackchange"))},r=e[n.getterName]();r.addEventListener("removetrack",i),r.addEventListener("addtrack",i),e.on("dispose",function(){r.removeEventListener("removetrack",i),r.removeEventListener("addtrack",i)})})}},{key:"addWebVttScript_",value:function(){var e=this;if(!u()().WebVTT)if(c().body.contains(this.el())){if(!this.options_["vtt.js"]&&Pn(p())&&Object.keys(p()).length>0)return void this.trigger("vttjsloaded");var t=c().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}),u()().WebVTT=!0,this.el().parentNode.appendChild(t)}else this.ready(this.addWebVttScript_)}},{key:"emulateTextTracks",value:function(){var e=this,t=this.textTracks(),n=this.remoteTextTracks(),i=function(e){return t.addTrack(e.track)},r=function(e){return t.removeTrack(e.track)};n.on("addtrack",i),n.on("removetrack",r),this.addWebVttScript_();var a=function(){return e.trigger("texttrackchange")},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",i),n.off("removetrack",r),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)}})}},{key:"addTextTrack",value:function(e,t,n){if(!e)throw new Error("TextTrack kind is required but was not provided");return function(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=e.textTracks();r.kind=t,n&&(r.label=n),i&&(r.language=i),r.tech=e;var s=new wa.text.TrackClass(r);return a.addTrack(s),s}(this,e,t,n)}},{key:"createRemoteTextTrack",value:function(e){var t=Ln(e,{tech:this});return new Sa.remoteTextEl.TrackClass(t)}},{key:"addRemoteTextTrack",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,i=this.createRemoteTextTrack(t);return"boolean"!=typeof n&&(n=!1),this.remoteTextTrackEls().addTrackElement_(i),this.remoteTextTracks().addTrack(i.track),!1===n&&this.ready(function(){return e.autoRemoteTextTracks_.addTrack(i.track)}),i}},{key:"removeRemoteTextTrack",value:function(e){var t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}},{key:"getVideoPlaybackQuality",value:function(){return{}}},{key:"requestPictureInPicture",value:function(){return Promise.reject()}},{key:"disablePictureInPicture",value:function(){return!0}},{key:"setDisablePictureInPicture",value:function(){}},{key:"requestVideoFrameCallback",value:function(e){var t=this,n=$i();return!this.isReady_||this.paused()?(this.queuedHanders_.add(n),this.one("playing",function(){t.queuedHanders_.has(n)&&(t.queuedH
2anders_.delete(n),e())})):this.requestNamedAnimationFrame(n,e),n}},{key:"cancelVideoFrameCallback",value:function(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}},{key:"setPoster",value:function(){}},{key:"playsinline",value:function(){}},{key:"setPlaysinline",value:function(){}},{key:"overrideNativeAudioTracks",value:function(e){}},{key:"overrideNativeVideoTracks",value:function(e){}},{key:"canPlayType",value:function(e){return""}}],[{key:"canPlayType",value:function(e){return""}},{key:"canPlaySource",value:function(e,n){return t.canPlayType(e.type)}},{key:"isTech",value:function(e){return e.prototype instanceof t||e instanceof t||e===t}},{key:"registerTech",value:function(e,n){if(t.techs_||(t.techs_={}),!t.isTech(n))throw new Error("Tech ".concat(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=xr(e),t.techs_[e]=n,t.techs_[Ir(e)]=n,"Tech"!==e&&t.defaultTechOrder_.push(e),n}},{key:"getTech",value:function(e){if(e)return t.techs_&&t.techs_[e]?t.techs_[e]:(e=xr(e),u()()&&u()().videojs&&u()().videojs[e]?(wn.warn("The ".concat(e," tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)")),u()().videojs[e]):void 0)}}])}(Pr);wa.names.forEach(function(e){var t=wa[e];Ea.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}}),Ea.prototype.featuresVolumeControl=!0,Ea.prototype.featuresMuteControl=!0,Ea.prototype.featuresFullscreenResize=!1,Ea.prototype.featuresPlaybackRate=!1,Ea.prototype.featuresProgressEvents=!1,Ea.prototype.featuresSourceset=!1,Ea.prototype.featuresTimeupdateEvents=!1,Ea.prototype.featuresNativeTextTracks=!1,Ea.prototype.featuresVideoFrameCallback=!1,Ea.withSourceHandlers=function(e){e.registerSourceHandler=function(t,n){var i=e.sourceHandlers;
2i||(i=e.sourceHandlers=[]),void 0===n&&(n=i.length),i.splice(n,0,t)},e.canPlayType=function(t){for(var n,i=e.sourceHandlers||[],r=0;r<i.length;r++)if(n=i[r].canPlayType(t))return n;return""},e.selectSourceHandler=function(t,n){for(var i=e.sourceHandlers||[],r=0;r<i.length;r++)if(i[r].canHandleSource(t,n))return i[r];return null},e.canPlaySource=function(t,n){var i=e.selectSourceHandler(t,n);return i?i.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:wn.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)}},Pr.registerComponent("Tech",Ea),Ea.registerTech("Tech",Ea),Ea.defaultTechOrder_=[];var Ca={},Ia={},xa={};function Aa(e,t,n){e.setTimeout(function(){return Ma(t,Ca[t.type],n,e)},1)}function Da(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r="call"+xr(n),a=e.reduce(Ra(r),i),s=a===xa,o=s?null:t[n](a);return function(e,t,n,i){for(var r=e.length-1;r>=0;r--){var a=e[r];a[t]&&a[t](i,n)}}(e,n,o,s),o}var Pa={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},La={setCurrentTime:1,setMuted:1,setVolume:1},Oa={play:1,pause:1};function Ra(e){return function(t,n){return t===xa?xa:n[e]?n[e](t):t}}function Ma(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=nn(e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[])||cn(e)||ln(e)||tn(),o=s[0],u=dn(s).slice(1);if("string"==typeof o)Ma(t,Ca[o],n,i,r,a);else if(o){var l=function(e,t){var n=Ia[e.id()],i=null;if(null==n)return i=t(e),Ia[e.id()]=[[t,i]],i;for(var r=0;r<n.length;r++){var a=en(n[r],2),s=a[0],o=a[1];s===t&&(i=o)}return null===i&&(i=t(e),n.push([t,i])),i}(i,o);if(!l.setSource)return r.push(l),Ma(t,u,n,i,r,a);l.setSource(Object.assign({},t),function(e,s){if(e)return Ma(t,u,n,i,r,a);r.push(l),Ma(s,t.type===s.type?u:Ca[s.type],n,i,r,a)})}else u.length?Ma(t,u,n,i,r,a):a?n(t,r):Ma(t,Ca["*"],n,i,r,!0)}var Na={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"},Ua=function(){var e=pa(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"");return Na[e.toLowerCase()]||""},Ba=function(e){if(Array.isArray(e)){var t=[];e.forEach(function(e){e=Ba(e),Array.isArray(e)?t=t.concat(e):Dn(e)&&t.push(e)}),e=t}else e="string"==typeof e&&e.trim()?[Fa({src:e})]:Dn(e)&&"string"==typeof e.src&&e.src&&e.src.trim()?[Fa(e)]:[];return e};function Fa(e){if(!e.type){var t=Ua(e.src);t&&(e.type=t)}return e}var qa=Zn?10009:ei?461:8,ja={codes:{play:415,pause:19,ff:417,rw:412,back:qa},names:Wt({415:"play",19:"pause",417:"ff",412:"rw"},qa,"back"),isEventKey:function(e,t){return t=t.toLowerCase(),!(!this.names[e.keyCode]||this.names[e.keyCode]!==t)},getEventName:function(e){if(this.names[e.keyCode])return this.names[e.keyCode];if(this.codes[e.code]){var t=this.codes[e.code];return this.names[t]}return null}},Ha=function(e){function t(e){var n;return rn(this,t),(n=Kt(this,t)).player_=e,n.focusableComponents=[],n.isListening_=!1,n.isPaused_=!1,n.onKeyDown_=n.onKeyDown_.bind(n),n.lastFocusedComponent_=null,n}return Gt(t,e),sn(t,[{key:"start",value:function(){var e=this;
2this.isListening_||(this.player_.on("keydown",this.onKeyDown_),this.player_.on("modalKeydown",this.onKeyDown_),this.player_.on("loadedmetadata",function(){e.focus(e.updateFocusableComponents()[0])}),this.player_.on("modalclose",function(){e.refocusComponent()}),this.player_.on("focusin",this.handlePlayerFocus_.bind(this)),this.player_.on("focusout",this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on("aftermodalfill",function(){e.updateFocusableComponents(),e.focusableComponents.length&&(e.focusableComponents.length>1?e.focusableComponents[1].focus():e.focusableComponents[0].focus())}))}},{key:"stop",value:function(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}},{key:"onKeyDown_",value:function(e){var t=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){if(this.isPaused_)return;t.preventDefault();var n=t.key.substring(5).toLowerCase();this.move(n)}else if(ja.isEventKey(t,"play")||ja.isEventKey(t,"pause")||ja.isEventKey(t,"ff")||ja.isEventKey(t,"rw")){t.preventDefault();var i=ja.getEventName(t);this.performMediaAction_(i)}else ja.isEventKey(t,"Back")&&e.target&&"function"==typeof e.target.closeable&&e.target.closeable()&&(t.preventDefault(),e.target.close())}},{key:"performMediaAction_",value:function(e){if(this.player_)switch(e){case"play":this.player_.paused()&&this.player_.play();break;case"pause":this.player_.paused()||this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+5);break;case"rw":this.userSeek_(this.player_.currentTime()-5)}}},{key:"userSeek_",value:function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}},{key:"pause",value:function(){this.isPaused_=!0}},{key:"resume",value:function(){this.isPaused_=!1}},{key:"handlePlayerBlur_",value:function(e){var t=e.relatedTarget,n=null,i=this.getCurrentComponent(e.target);t&&(n=Boolean(t.closest(".video-js")),t.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(e.currentTarget.contains(e.relatedTarget)||n)&&t||(i&&"CloseButton"===i.name()?this.refocusComponent():(this.pause(),i&&i.el()&&(this.lastFocusedComponent_=i)))}},{key:"handlePlayerFocus_",value:function(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}},{key:"updateFocusableComponents",value:function(){var e=this,t=this.player_,n=[];function i(e){var t,r=zt(e);try{for(r.s();!(t=r.n()).done;){var a=t.value;a.hasOwnProperty("el_")&&a.getIsFocusable()&&a.getIsAvailableToBeFocused(a.el())&&n.push(a),a.hasOwnProperty("children_")&&a.children_.length>0&&i(a.children_)}}catch(e){r.e(e)}finally{r.f()}}return t.children_.forEach(function(t){if(t.hasOwnProperty("el_")){if(t.getIsFocusable&&t.getIsAvailableToBeFocused&&t.getIsFocusable()&&t.getIsAvailableToBeFocused(t.el()))return void n.push(t);t.hasOwnProperty("children_")&&t.children_.length>0?i(t.children_):t.hasOwnProperty("items")&&t.items.length>0?i(t.items):e.findSuitableDOMChild(t)&&n.push(t)}if("ErrorDisplay"===t.name_&&t.opened_){var r=t.el_.querySelector(".vjs-errors-ok-button-container");if(r)r.querySelectorAll("button").forEach(function(e,t){n.push({name:function(){return"ModalButton"+(t+1)},el:function(){return e},getPositions:function(){var t=e.getBoundingClientRect();return{boundingClientRect:{x:t.x,y:t.y,width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left},center:{x:t.left+t.width/2,y:t.top+t.height/2,width:0,height:0,top:t.top+t.height/2,right:t.left+t.width/2,bottom:t.top+t.height/2,left:t.left+t.width/2}}},getIsAvailableToBeFocused:function(){return!0},getIsFocusable:function(e){return!0},focus:function(){return e.focus()}})})}}),this.focusableComponents=n,this.focusableComponents}},{key:"findSuitableDOMChild",value:function(e){return e.el()?function t(n){if(e.getIsFocusable(n)&&e.getIsAvailableToBeFocused(n))return n;for(var i=0;i<n.children.length;i++){var r=t(n.children[i]);if(r)return r}return null}(e.el()):null}},{key:"getCurrentComponent",value:function(e){this.updateFocusableComponents();var t=e||document.activeElement;if(this.focusableComponents.length){var n,i=zt(this.focusableComponents);try{for(i.s();!(n=i.n()).done;){var r=n.value;if(r.el()===t)return r}}catch(e){i.e(e)}finally{i.f()}}}},{key:"add",value:function(e){var t=un(this.focusableComponents);e.hasOwnProperty("el_")&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el())&&t.pu
2sh(e),this.focusableComponents=t,this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}},{key:"remove",value:function(e){for(var t=0;t<this.focusableComponents.length;t++)if(this.focusableComponents[t].name()===e.name())return this.focusableComponents.splice(t,1),void this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}},{key:"clear",value:function(){this.focusableComponents.length>0&&(this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents}))}},{key:"move",value:function(e){var t=this,n=this.getCurrentComponent();if(n){var i=n.getPositions(),r=this.focusableComponents.filter(function(r){return r!==n&&t.isInDirection_(i.boundingClientRect,r.getPositions().boundingClientRect,e)}),a=this.findBestCandidate_(i.center,r,e);a?this.focus(a):this.trigger({type:"endOfFocusableComponents",direction:e,focusedComponent:n})}}},{key:"findBestCandidate_",value:function(e,t,n){var i,r=1/0,a=null,s=zt(t);try{for(s.s();!(i=s.n()).done;){var o=i.value,u=o.getPositions().center,l=this.calculateDistance_(e,u,n);l<r&&(r=l,a=o)}}catch(e){s.e(e)}finally{s.f()}return a}},{key:"isInDirection_",value:function(e,t,n){switch(n){case"right":return t.left>=e.right;case"left":return t.right<=e.left;case"down":return t.top>=e.bottom;case"up":return t.bottom<=e.top;default:return!1}}},{key:"refocusComponent",value:function(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(var e=0;e<this.focusableComponents.length;e++)if(this.focusableComponents[e].name()===this.lastFocusedComponent_.name())return void this.focus(this.focusableComponents[e])}else this.focus(this.updateFocusableComponents()[0])}},{key:"focus",value:function(e){"object"===hn(e)&&(e.getIsAvailableToBeFocused(e.el())?e.focus():this.findSuitableDOMChild(e)&&this.findSuitableDOMChild(e).focus())}},{key:"calculateDistance_",value:function(e,t,n){var i,r=Math.abs(e.x-t.x),a=Math.abs(e.y-t.y);switch(n){case"right":case"left":i=r+100*a;break;case"up":i=2*a+.5*r;break;case"down":i=5*a+r;break;default:i=r+a}return i}},{key:"searchForTrackSelect_",value:function(){var e,t=zt(this.updateFocusableComponents());try{for(t.s();!(e=t.n()).done;){var n=e.value;if("TextTrackSelect"===n.constructor.name){this.focus(n);break}}}catch(e){t.e(e)}finally{t.f()}}}])}(fr),Va=function(e){function t(e,n,i){var r;if(rn(this,t),r=Kt(this,t,[e,Ln({createEl:!1},n),i]),n.playerOptions.sources&&0!==n.playerOptions.sources.length)e.src(n.playerOptions.sources);else for(var a=0,s=n.playerOptions.techOrder;a<s.length;a++){var o=xr(s[a]),u=Ea.getTech(o);if(o||(u=Pr.getComponent(o)),u&&u.isSupported()){e.loadTech_(o);break}}return r}return Gt(t,e),sn(t)}(Pr);Pr.registerComponent("MediaLoader",Va);var za=function(e){function t(e,n){var i;return rn(this,t),(i=Kt(this,t,[e,n])).options_.controlText&&i.controlText(i.options_.controlText),i.handleMouseOver_=function(e){return i.handleMouseOver(e)},i.handleMouseOut_=function(e){return i.handleMouseOut(e)},i.handleClick_=function(e){return i.handleClick(e)},i.handleKeyDown_=function(e){return i.handleKeyDown(e)},i.emitTapEvents(),i.enable(),i}return Gt(t,e),sn(t,[{key:"createEl",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),"button"===e&&wn.error("Creating a ClickableComponent with an HTML element of ".concat(e," is not supported; use a Button instead.")),n=Object.assign({role:"button"},n),this.tabIndex_=t.tabIndex;var i=pi(e,t,n);return this.player_.options_.experimentalSvgIcons||i.appendChild(pi("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(i),i}},{key:"dispose",value:function(){this.controlTextEl_=null,$t(t,"dispose",this,3)([])}},{key:"createControlTextEl",value:function(e){return this.controlTextEl_=pi("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}},{key:"controlText",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.el();if(void 0===e)return this.controlText_||"Need Text";var n=this.localize(e);this.controlText_=e,fi(this.controlTextEl_,n),this.nonIconControl||this.player_.options_.noUITitleAttributes||t.setAttribute("title",n)}},{key:"buildCSSClass",value:function(){return"vjs-control vjs-button ".concat($t(t,"buildCSSClass",this,3)([]))}},{key:"enable",value: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_))}},{key:"disable",value: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_)}},{key:"handleLanguagechange",value:function(){this.controlText(this.controlText_)}},{key:"handleClick",value:function(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}},{key:"handleKeyDown",value:function(e){" "===e.key||"Enter"===e.key?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):$t(t,"handleKeyDown",this,3)([e])}}])}(Pr);Pr.registerComponent("ClickableComponent",za);var Wa=function(e){function t(e,n){var i;rn(this,t),i=Kt(this,t,[e,n]);var r=(n&&n.playerOptions||{}).mainContent;return i.isMainContent=r,i.update(),i.update_=function(e){return i.update(e)},e.on("posterchange",i.update_),i}return Gt(t,e),sn(t,[{key:"dispose",value:function(){this.player().off("posterchange",this.update_),$t(t,"dispose",this,3)([])}},{key:"createEl",value:function(){return pi("div",{className:"vjs-poster"})}},{key:"crossOrigin",value:function(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 "'.concat(e,'"'))}},{key:"update",value:function(e){var t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}},{key:"setSrc",value:function(e){e?(this.$("img")||this.el_.appendChild(pi("picture",{className:"vjs-poster",tabIndex:-1},{},pi("img",{loading:this.isMainContent?"eager":"lazy",fetchPriority:this.isMainContent?"high":"auto",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e):this.el_.textContent=""}},{key:"handleClick",value:function(e){if(this.player_.controls()){var t=this.player_.getChild("controlBar"),n=t&&t.getChild("playToggle");Hn?(n||this.player_).focus():this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?zr(this.player_.play()):this.player_.pause()}}}])}(za);Wa.prototype.crossorigin=Wa.prototype.crossOrigin,Pr.registerComponent("PosterImage",Wa);var Ga="#222",Xa="#ccc",Ka={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',
2script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Ya(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 Qa(e,t,n){try{e.style[t]=n}catch(e){return}}function $a(e){return e?"".concat(e,"px"):""}var Ja=function(e){function t(e,n,i){var r;rn(this,t),r=Kt(this,t,[e,n,i]);var a=function(e){return r.updateDisplay(e)},s=function(e){r.updateDisplayOverlay(),r.updateDisplay(e)};return e.on("loadstart",function(e){return r.toggleDisplay(e)}),e.on("useractive",a),e.on("userinactive",a),e.on("texttrackchange",a),e.on("loadedmetadata",function(e){r.updateDisplayOverlay(),r.preselectTrack(e)}),e.ready(cr(r,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks)this.hide();else{e.on("fullscreenchange",s),e.on("playerresize",s);var t=u()().screen.orientation||u()(),n=u()().screen.orientation?"change":"orientationchange";t.addEventListener(n,s),e.on("dispose",function(){return t.removeEventListener(n,s)});for(var i=this.options_.playerOptions.tracks||[],r=0;r<i.length;r++)this.player_.addRemoteTextTrack(i[r],!0);this.preselectTrack()}})),r}return Gt(t,e),sn(t,[{key:"preselectTrack",value:function(){for(var e,t,n,i={captions:1,subtitles:1},r=this.player_.textTracks(),a=this.player_.cache_.selectedLanguage,s=0;s<r.length;s++){var o=r[s];a&&a.enabled&&a.language&&a.language===o.language&&o.kind in i?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 i&&!t&&(t=o):e=o)}n?n.mode="showing":t?t.mode="showing":e&&(e.mode="showing")}},{key:"toggleDisplay",value:function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()}},{key:"createEl",value:function(){return $t(t,"createEl",this,3)(["div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"}])}},{key:"clearDisplay",value:function(){"function"==typeof u()().WebVTT&&u()().WebVTT.processCues(u()(),[],this.el_)}},{key:"updateDisplay",value:function(){var e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){for(var n=[],i=0;i<e.length;++i){var r=e[i];"showing"===r.mode&&n.push(r)}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)}if(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)),void 0===u()().CSS||!u()().CSS.supports("inset","10px")){var c=this.el_,d=c.querySelectorAll(".vjs-text-track-cue"),h=this.player_.controlBar.el_.getBoundingClientRect().height,p=this.player_.el_.getBoundingClientRect().height;c.style="",Qa(c,"position","relative"),Qa(c,"height",p-h+"px"),Qa(c,"top","unset"),Qa(c,"bottom",ti?p+"px":"0px"),d.length>0&&d.forEach(function(e){if(e.style.inset){var t=e.style.inset.split(" ");3===t.length&&Object.assign(e.style,{top:t[0],right:t[1],bottom:t[2],left:"unset"})}})}}}},{key:"updateDisplayOverlay",value:function(){if(this.player_.videoHeight()&&void 0!==u()().CSS&&u()().CSS.supports("inset-inline: 10px")){var e=this.player_.currentWidth(),t=this.player_.currentHeight(),n=e/t,i=this.player_.videoWidth()/this.player_.videoHeight(),r=0,a=0;Math.abs(n-i)>.1&&(n>i?r=Math.round((e-t*i)/2):a=Math.round((t-e/i)/2)),Qa(this.el_,"insetInline",$a(r)),Qa(this.el_,"insetBlock",$a(a))}}},{key:"updateDisplayState",value:function(e){for(var t=this.player_.textTrackSettings.getValues(),n=e.activeCues,i=n.length;i--;){var r=n[i];if(r){var a=r.displayState;if(t.color&&(a.firstChild.style.color=t.color),t.textOpacity&&Qa(a.firstChild,"color",Ya(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(a.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&Qa(a.firstChild,"backgroundColor",Ya(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?Qa(a,"backgroundColor",Ya(t.windowColor,t.windowOpacity)):a.style.backgroundColor=t.windowColor),t.edgeStyle&&("dropshadow"===t.edgeStyle?a.firstChild.style.textShadow="2px 2px 3px ".concat(Ga,", 2px 2px 4px ").concat(Ga,", 2px 2px 5px ").concat(Ga):"raised"===t.edgeStyle?a.firstChild.style.textShadow="1px 1px ".concat(Ga,", 2px 2px ").concat(Ga,", 3px 3px ").concat(Ga):"depressed"===t.edgeStyle?a.firstChild.style.textShadow="1px 1px ".concat(Xa,", 0 1px ").concat(Xa,", -1px -1px ").concat(Ga,", 0 -1px ").concat(Ga):"uniform"===t.edgeStyle&&(a.firstChild.style.textShadow="0 0 4px ".concat(Ga,", 0 0 4px ").concat(Ga,", 0 0 4px ").concat(Ga,", 0 0 4px ").concat(Ga))),t.fontPercent&&1!==t.fontPercent){var s=u()().parseFloat(a.style.fontSize);a.style.fontSize=s*t.fontPercent+"px",a.style.height="auto",a.style.top="auto"}
2t.fontFamily&&"default"!==t.fontFamily&&("small-caps"===t.fontFamily?a.firstChild.style.fontVariant="small-caps":a.firstChild.style.fontFamily=Ka[t.fontFamily])}}}},{key:"updateForTrack",value:function(e){if(Array.isArray(e)||(e=[e]),"function"==typeof u()().WebVTT&&!e.every(function(e){return!e.activeCues})){for(var t=[],n=0;n<e.length;++n)for(var i=e[n],r=0;r<i.activeCues.length;++r)t.push(i.activeCues[r]);u()().WebVTT.processCues(u()(),t,this.el_);for(var a=0;a<e.length;++a){for(var s=e[a],o=0;o<s.activeCues.length;++o){var l=s.activeCues[o].displayState;vi(l,"vjs-text-track-cue","vjs-text-track-cue-"+(s.language?s.language:a)),s.language&&Si(l,"lang",s.language)}this.player_.textTrackSettings&&this.updateDisplayState(s)}}}}])}(Pr);Pr.registerComponent("TextTrackDisplay",Ja);var Za=function(e){function t(){return rn(this,t),Kt(this,t,arguments)}return Gt(t,e),sn(t,[{key:"createEl",value:function(){var e=this.player_.isAudio(),n=this.localize(e?"Audio Player":"Video Player"),i=pi("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[n])}),r=$t(t,"createEl",this,3)(["div",{className:"vjs-loading-spinner",dir:"ltr"}]);return r.appendChild(i),r}},{key:"handleLanguagechange",value:function(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}}])}(Pr);Pr.registerComponent("LoadingSpinner",Za);var es=function(e){function t(){return rn(this,t),Kt(this,t,arguments)}return Gt(t,e),sn(t,[{key:"createEl",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=pi(e="button",t=Object.assign({className:this.buildCSSClass()},t),n=Object.assign({type:"button"},n));return this.player_.options_.experimentalSvgIcons||i.appendChild(pi("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(i),i}},{key:"addChild",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.constructor.name;return wn.warn("Adding an actionable (user controllable) child to a Button (".concat(n,") is not supported; use a ClickableComponent instead.")),Pr.prototype.addChild.call(this,e,t)}},{key:"enable",value:function(){$t(t,"enable",this,3)([]),this.el_.removeAttribute("disabled")}},{key:"disable",value:function(){$t(t,"disable",this,3)([]),this.el_.setAttribute("disabled","disabled")}},{key:"handleKeyDown",value:function(e){" "!==e.key&&"Enter"!==e.key?$t(t,"handleKeyDown",this,3)([e]):e.stopPropagation()}}])}(za);Pr.registerComponent("Button",es);var ts=function(e){function t(e,n){var i;return rn(this,t),(i=Kt(this,t,[e,n])).mouseused_=!1,i.setIcon("play"),i.on("mousedown",function(e){return i.handleMouseDown(e)}),i}return Gt(t,e),sn(t,[{key:"buildCSSClass",value:function(){return"vjs-big-play-button"}},{key:"handleClick",value:function(e){var t=this.player_.play(),n=this.player_.getChild("controlBar"),i=n&&n.getChild("playToggle");if("tap"===e.type||this.mouseused_&&"clientX"in e&&"clientY"in e)return zr(t),void(Hn?(i||this.player_).focus():this.player_.tech(!0)&&this.player_.tech(!0).focus());if(i){var r=function(){return i.focus()};Vr(t)?t.then(r,function(){}):this.setTimeout(r,1)}else this.player_.tech(!0).focus()}},{key:"handleKeyDown",value:function(e){this.mouseused_=!1,$t(t,"handleKeyDown",this,3)([e])}},{key:"handleMouseDown",value:function(e){this.mouseused_=!0}}])}(es);ts.prototype.controlText_="Play Video",Pr.registerComponent("BigPlayButton",ts);var ns=function(e){function t(e,n){var i;
2return rn(this,t),(i=Kt(this,t,[e,n])).setIcon("cancel"),i.controlText(n&&n.controlText||i.localize("Close")),i}return Gt(t,e),sn(t,[{key:"buildCSSClass",value:function(){return"vjs-close-button ".concat($t(t,"buildCSSClass",this,3)([]))}},{key:"handleClick",value:function(e){this.trigger({type:"close",bubbles:!1})}},{key:"handleKeyDown",value:function(e){"Escape"===e.key?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):$t(t,"handleKeyDown",this,3)([e])}}])}(es);Pr.registerComponent("CloseButton",ns);var is=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return rn(this,t),n=Kt(this,t,[e,i]),i.replay=void 0===i.replay||i.replay,n.setIcon("play"),n.on(e,"play",function(e){return n.handlePlay(e)}),n.on(e,"pause",function(e){return n.handlePause(e)}),i.replay&&n.on(e,"ended",function(e){return n.handleEnded(e)}),n}return Gt(t,e),sn(t,[{key:"buildCSSClass",value:function(){return"vjs-play-control ".concat($t(t,"buildCSSClass",this,3)([]))}},{key:"handleClick",value:function(e){this.player_.paused()?zr(this.player_.play()):this.player_.pause()}},{key:"handleSeeked",value:function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}},{key:"handlePlay",value:function(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}},{key:"handlePause",value:function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}},{key:"handleEnded",value:function(e){var t=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",function(e){return t.handleSeeked(e)})}}])}(es);is.prototype.controlText_="Play",Pr.registerComponent("PlayToggle",is);var rs=function(e){function t(e,n){var i;return rn(this,t),(i=Kt(this,t,[e,n])).on(e,["timeupdate","ended","seeking"],function(e){return i.update(e)}),i.updateTextNode_(),i}return Gt(t,e),sn(t,[{key:"createEl",value:function(){var e=this.buildCSSClass(),n=$t(t,"createEl",this,3)(["div",{className:"".concat(e," vjs-time-control vjs-control")}]),i=pi("span",{className:"vjs-control-text",textContent:"".concat(this.localize(this.labelText_)," ")},{role:"presentation"});return n.appendChild(i),this.contentEl_=pi("span",{className:"".concat(e,"-display")},{role:"presentation"}),n.appendChild(this.contentEl_),n}},{key:"dispose",value:function(){this.contentEl_=null,this.textNode_=null,$t(t,"dispose",this,3)([])}},{key:"update",value:function(e){(this.player_.options_.enableSmoothSeeking||"seeking"!==e.type)&&this.updateContent(e)}},{key:"updateTextNode_",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;t=Fr(t),this.formattedTime_!==t&&(this.formattedTime_=t,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",function(){if(e.contentEl_){var t=e.textNode_;t&&e.contentEl_.firstChild!==t&&(t=null,wn.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),e.textNode_=c().createTextNode(e.formattedTime_),e.textNode_&&(t?e.contentEl_.replaceChild(e.textNode_,t):e.contentEl_.appendChild(e.textNode_))}}))}},{key:"updateContent",value:function(e){}}])}(Pr);rs.prototype.labelText_="Time",rs.prototype.controlText_="Time",Pr.registerComponent("TimeDisplay",rs);var as=function(e){function t(){return rn(this,t),Kt(this,t,arguments)}return Gt(t,e),sn(t,[{key:"buildCSSClass",value:function(){return"vjs-current-time"}},{key:"updateContent",value:function(e){var t;t=this.player_.ended()?this.player_.duration():e&&e.target&&"function"==typeof e.target.pendingSeekTime&&null!==e.target.pendingSeekTime()?e.target.pendingSeekTime():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}])}(rs);as.prototype.labelText_="Current Time",as.prototype.controlText_="Current Time",Pr.registerComponent("CurrentTimeDisplay",as);var ss=function(e){function t(e,n){var i;rn(this,t);var r=function(e){return i.updateContent(e)};return(i=Kt(this,t,[e,n])).on(e,"durationchange",r),i.on(e,"loadstart",r),i.on(e,"loadedmetadata",r),i}return Gt(t,e),sn(t,[{key:"buildCSSClass",value:function(){return"vjs-duration"}},{key:"updateContent",value:function(e){var t=this.player_.duration();this.updateTextNode_(t)}}])}(rs);ss.prototype.labelText_="Duration",ss.prototype.controlText_="Duration",Pr.registerComponent("DurationDisplay",ss);var os=function(e){function t(){return rn(this,t),Kt(this,t,arguments)}return Gt(t,e),sn(t,[{key:"createEl",value:function(){var e=$t(t,"createEl",this,3)(["div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}]),n=$t(t,"createEl",this,3)(["div"]),i=$t(t,"createEl",this,3)(["span",{textContent:"/"}]);return n.appendChild(i),e.appendChild(n),e}}])}(Pr);Pr.registerComponent("TimeDivider",os);var us=function(e){function t(e,n){var i;return rn(this,t),(i=Kt(this,t,[e,n])).on(e,"durationchange",function(e){return i.updateContent(e)}),i}return Gt(t,e),sn(t,[{key:"buildCSSClass",value:function(){return"vjs-remaining-time"}},{key:"createEl",value:function(){var e=$t(t,"createEl",this,3)([]);return!1!==this.options_.displayNegative&&e.insertBefore(pi("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}},{key:"updateContent",value: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))}}])}(rs);us.prototype.labelText_="Remaining Time",us.prototype.controlText_="Remaining Time",Pr.registerComponent("RemainingTimeDisplay",us);var ls=function(e){function t(e,n){var i;return rn(this,t),(i=Kt(this,t,[e,n])).updateShowing(),i.on(i.player(),"durationchange",function(e){return i.updateShowing(e)}),i}return Gt(t,e),sn(t,[{key:"createEl",value:function(){var e=$t(t,"createEl",this,3)(["div",{className:"vjs-live-control vjs-control"}]);return this.contentEl_=pi("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(pi("span",{className:"vjs-control-text",textContent:"".concat(this.localize("Stream Type")," ")})),this.contentEl_.appendChild(c().createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}},{key:"dispose",value:function(){this.contentEl_=null,$t(t,"dispose",this,3)([])}},{key:"updateShowing",value:function(e){this.player().duration()===1/0?this.show():this.hide()}}])}(Pr);Pr.registerComponent("LiveDisplay",ls);var cs=function(e){function t(e,n){var i;return rn(this,t),(i=Kt(this,t,[e,n])).updateLiveEdgeStatus(),i.player_.liveTracker&&(i.updateLiveEdgeStatusHandler_=function(e){return i.updateLiveEdgeStatus(e)},i.on(i.player_.liveTracker,"liveedgechange",i.updateLiveEdgeStatusHandler_)),i}return Gt(t,e),sn(t,[{key:"createEl",value:function(){var e=$t(t,"createEl",this,3)(["button",{className:"vjs-seek-to-live-control vjs-control"}]);return this.setIcon("circle",e),this.textEl_=pi("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}},{key:"updateLiveEdgeStatus",value: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"))}},{key:"handleClick",value:function(){this.player_.liveTracker.seekToLiveEdge()}},{key:"dispose",value:function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,$t(t,"dispose",this,3)([])}}])}(es);function ds(e,t,n){return e=Number(e),Math.min(n,Math.max(t,isNaN(e)?t:e))}cs.prototype.controlText_="Seek to live, currently playing live",Pr.registerComponent("SeekToLive",cs);var hs=Object.freeze({__proto__:null,clamp:ds}),ps=function(e){function t(e,n){var i;return rn(this,t),(i=Kt(this,t,[e,n])).handleMouseDown_=function(e){return i.handleMouseDown(e)},i.handleMouseUp_=function(e){return i.handleMouseUp(e)},i.handleKeyDown_=function(e){return i.handleKeyDown(e)},i.handleClick_=function(e){return i.handleClick(e)},i.handleMouseMove_=function(e){return i.handleMouseMove(e)},i.update_=function(e){return i.update(e)},i.bar=i.getChild(i.options_.barName),i.vertical(!!i.options_.vertical),i.enable(),i}return Gt(t,e),sn(t,[{key:"enabled",value:function(){return this.enabled_}},{key:"enable",value: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)}},{key:"disable",value: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}}},{key:"createEl",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.className=n.className+" vjs-slider",n=Object.assign({tabIndex:0},n),i=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},i),$t(t,"createEl",this,3)([e,n,i])}},{key:"handleMouseDown",value:function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||zn||e.preventDefault(),Ei(),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)}},{key:"handleMouseMove",value:function(e){}},{key:"handleMouseUp",value:function(e){var t=this.bar.el_.ownerDocument;Ci(),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()}},{key:"update",value: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}}},{key:"getProgress",value:function(){return Number(ds(this.getPercent(),0,1).toFixed(4))}},{key:"calculateDistance",value:function(e){var t=Ai(this.el_,e);return this.vertical()?t.y:t.x}},{key:"handleKeyDown",value:function(e){var n=this.options_.playerOptions.spatialNavigation,i=n&&n.enabled,r=n&&n.horizontalSeek;i?r&&"ArrowLeft"===e.key||!r&&"ArrowDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepBack()):r&&"ArrowRight"===e.key||!r&&"ArrowUp"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(this.pendingSeekTime()&&(this.pendingSeekTime(null),this.userSeek_(this.player_.currentTime())),$t(t,"handleKeyDown",this,3)([e])):"ArrowLeft"===e.key||"ArrowDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepBack()):"ArrowUp"===e.key||"ArrowRight"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepForward()):$t(t,"handleKeyDown",this,3)([e])}},{key:"handleClick",value:function(e){e.stopPropagation(),e.preventDefault()}},{key:"vertical",value: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")}}])}(Pr);Pr.registerComponent("Slider",ps);
2var fs=function(e,t){return ds(e/t*100,0,100).toFixed(2)+"%"},ms=function(e){function t(e,n){var i;return rn(this,t),(i=Kt(this,t,[e,n])).partEls_=[],i.on(e,"progress",function(e){return i.update(e)}),i}return Gt(t,e),sn(t,[{key:"createEl",value:function(){var e=$t(t,"createEl",this,3)(["div",{className:"vjs-load-progress"}]),n=pi("span",{className:"vjs-control-text"}),i=pi("span",{textContent:this.localize("Loaded")}),r=c().createTextNode(": ");return this.percentageEl_=pi("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(n),n.appendChild(i),n.appendChild(r),n.appendChild(this.percentageEl_),e}},{key:"dispose",value:function(){this.partEls_=null,this.percentageEl_=null,$t(t,"dispose",this,3)([])}},{key:"update",value:function(e){var t=this;this.requestNamedAnimationFrame("LoadProgressBar#update",function(){var e=t.player_.liveTracker,n=t.player_.buffered(),i=e&&e.isLive()?e.seekableEnd():t.player_.duration(),r=t.player_.bufferedEnd(),a=t.partEls_,s=fs(r,i);t.percent_!==s&&(t.el_.style.width=s,fi(t.percentageEl_,s),t.percent_=s);for(var o=0;o<n.length;o++){var u=n.start(o),l=n.end(o),c=a[o];c||(c=t.el_.appendChild(pi()),a[o]=c),c.dataset.start===u&&c.dataset.end===l||(c.dataset.start=u,c.dataset.end=l,c.style.left=fs(u,r),c.style.width=fs(l-u,r))}for(var d=a.length;d>n.length;d--)t.el_.removeChild(a[d-1]);a.length=n.length})}}])}(Pr);Pr.registerComponent("LoadProgressBar",ms);var gs=function(e){function t(e,n){var i;return rn(this,t),(i=Kt(this,t,[e,n])).update=dr(cr(i,i.update),lr),i}return Gt(t,e),sn(t,[{key:"createEl",value:function(){return $t(t,"createEl",this,3)(["div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"}])}},{key:"update",value:function(e,t,n){var i=xi(this.el_),r=Ii(this.player_.el()),a=e.width*t;if(r&&i){var s=e.left-r.left+a,o=e.width-a+(r.right-e.right);o||(o=e.width-a,s=a);var u=i.width/2;s<u?u+=u-s:o<u&&(u=o),u<0?u=0:u>i.width&&(u=i.width),u=Math.round(u),this.el_.style.right="-".concat(u,"px"),this.write(n)}}},{key:"write",value:function(e){fi(this.el_,e)}},{key:"updateTime",value:function(e,t,n,i){var r=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",function(){var a,s=r.player_.duration();if(r.player_.liveTracker&&r.player_.liveTracker.isLive()){var o=r.player_.liveTracker.liveWindow(),u=o-t*o;a=(u<1?"":"-")+Fr(u,o)}else a=Fr(n,s);r.update(e,t,a),i&&i()})}}])}(Pr);Pr.registerComponent("TimeTooltip",gs);var vs=function(e){function t(e,n){var i;return rn(this,t),(i=Kt(this,t,[e,n])).setIcon("circle"),i.update=dr(cr(i,i.update),lr),i}return Gt(t,e),sn(t,[{key:"createEl",value:function(){return $t(t,"createEl",this,3)(["div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"}])}},{key:"update",value:function(e,t,n){var i=this.getChild("timeTooltip");if(i){var r=n&&n.target&&"function"==typeof n.target.pendingSeekTime?n.target.pendingSeekTime():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,t,r)}}}])}(Pr);vs.prototype.options_={children:[]},ai||qn||vs.prototype.options_.children.push("timeTooltip"),Pr.registerComponent("PlayProgressBar",vs);var ys=function(e){function t(e,n){var i;return rn(this,t),(i=Kt(this,t,[e,n])).update=dr(cr(i,i.update),lr),i}return Gt(t,e),sn(t,[{key:"createEl",value:function(){return $t(t,"createEl",this,3)(["div",{className:"vjs-mouse-display"}])}},{key:"update",value:function(e,t){var n=this,i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,function(){n.el_.style.left="".concat(e.width*t,"px")})}}])}(Pr);ys.prototype.options_={children:["timeTooltip"]},Pr.registerComponent("MouseTimeDisplay",ys);var _s=function(e){function t(e,n){var i;rn(this,t),(n=Ln(t.prototype.options_,n)).children=un(n.children);var r=e.options_.disableSeekWhileScrubbingOnMobile&&(ai||qn)||e.options_.disableSeekWhileScrubbingOnSTV;return(!ai&&!qn||r)&&n.children.splice(1,0,"mouseTimeDisplay"),(i=Kt(this,t,[e,n])).shouldDisableSeekWhileScrubbing_=r,i.pendingSeekTime_=null,i.setEventHandlers_(),i}return Gt(t,e),sn(t,[{key:"setEventHandlers_",value:function(){var e=this;this.update_=cr(this,this.update),this.update=dr(this.update_,lr),this.on(this.player_,["durationchange","timeupdate"],this.update),this.on(this.player_,["ended"],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 c()&&"visibilityState"in c()&&this.on(c(),"visibilitychange",this.toggleVisibility_)}},{key:"toggleVisibility_",value:function(e){"hidden"===c().visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())}},{key:"enableInterval_",value:function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,lr))}},{key:"disableInterval_",value:function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}},{key:"createEl",value:function(){return $t(t,"createEl",this,3)(["div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")}])}},{key:"update",value:function(e){var n=this;if("hidden"!==c().visibilityState){var i=$t(t,"update",this,3)([]);return this.requestNamedAnimationFrame("SeekBar#update",function(){var t=n.player_.ended()?n.player_.duration():n.getCurrentTime_(),r=n.player_.liveTracker,a=n.player_.duration();
2r&&r.isLive()&&(a=n.player_.liveTracker.liveCurrentTime()),n.percent_!==i&&(n.el_.setAttribute("aria-valuenow",(100*i).toFixed(2)),n.percent_=i),n.currentTime_===t&&n.duration_===a||(n.el_.setAttribute("aria-valuetext",n.localize("progress bar timing: currentTime={1} duration={2}",[Fr(t,a),Fr(a,a)],"{1} of {2}")),n.currentTime_=t,n.duration_=a),n.bar&&n.bar.update(Ii(n.el()),n.getProgress(),e)}),i}}},{key:"userSeek_",value:function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}},{key:"getCurrentTime_",value:function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}},{key:"pendingSeekTime",value:function(e){if(void 0!==e)if(null!==e){var t=this.player_.duration();this.pendingSeekTime_=Math.max(0,Math.min(e,t))}else this.pendingSeekTime_=null;return this.pendingSeekTime_}},{key:"getPercent",value:function(){if(null!==this.pendingSeekTime())return this.pendingSeekTime()/this.player_.duration();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}},{key:"handleMouseDown",value:function(e){Mi(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.shouldDisableSeekWhileScrubbing_||this.player_.pause(),$t(t,"handleMouseDown",this,3)([e]))}},{key:"handleMouseMove",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Mi(e)&&!isNaN(this.player_.duration())){var n;t||this.player_.scrubbing()||this.player_.scrubbing(!0);var i=this.calculateDistance(e),r=this.player_.liveTracker;if(r&&r.isLive()){if(i>=.99)return void r.seekToLiveEdge();var a=r.seekableStart(),s=r.liveCurrentTime();if((n=a+i*r.liveWindow())>=s&&(n=s),n<=a&&(n=a+.1),n===1/0)return}else(n=i*this.player_.duration())===this.player_.duration()&&(n-=.1);this.shouldDisableSeekWhileScrubbing_?this.pendingSeekTime(n):this.userSeek_(n),this.player_.options_.enableSmoothSeeking&&this.update()}}},{key:"enable",value:function(){$t(t,"enable",this,3)([]);var e=this.getChild("mouseTimeDisplay");e&&e.show()}},{key:"disable",value:function(){$t(t,"disable",this,3)([]);var e=this.getChild("mouseTimeDisplay");e&&e.hide()}},{key:"handleMouseUp",value:function(e){$t(t,"handleMouseUp",this,3)([e]),e&&e.stopPropagation(),this.player_.scrubbing(!1),null!==this.pendingSeekTime()&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?zr(this.player_.play()):this.update_()}},{key:"handlePendingSeek_",value:function(e){this.player_.paused()||this.player_.pause();var t=null!==this.pendingSeekTime()?this.pendingSeekTime():this.player_.currentTime();this.pendingSeekTime(t+e),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}},{key:"stepForward",value:function(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(this.options().stepSeconds):this.userSeek_(this.player_.currentTime()+this.options().stepSeconds)}},{key:"stepBack",value:function(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(-this.options().stepSeconds):this.userSeek_(this.player_.currentTime()-this.options().stepSeconds)}},{key:"handleAction",value:function(e){null!==this.pendingSeekTime()&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.paused()?this.player_.play():this.player_.pause()}},{key:"handleKeyDown",value:function(e){var n=this.player_.liveTracker;if(" "===e.key||"Enter"===e.key)e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if("Home"===e.key)e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if("End"===e.key)e.preventDefault(),e.stopPropagation(),n&&n.isLive()?this.userSeek_(n.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();var i=.1*parseInt(e.key,10);n&&n.isLive()?this.userSeek_(n.seekableStart()+n.liveWindow()*i):this.userSeek_(this.player_.duration()*i)}else"PageDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-this.options().stepSeconds*this.options().pageMultiplier)):"PageUp"===e.key?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+this.options().stepSeconds*this.options().pageMultiplier)):$t(t,"handleKeyDown",this,3)([e])}},{key:"dispose",value:function(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],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 c()&&"visibilityState"in c()&&this.off(c(),"visibilitychange",this.toggleVisibility_),$t(t,"dispose",this,3)([])}}])}(ps);_s.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar",stepSeconds:5,pageMultiplier:12},Pr.registerComponent("SeekBar",_s);var bs=function(e){function t(e,n){var i;return rn(this,t),(i=Kt(this,t,[e,n])).handleMouseMove=dr(cr(i,i.handleMouseMove),lr),i.throttledHandleMouseSeek=dr(cr(i,i.handleMouseSeek),lr),i.handleMouseUpHandler_=function(e){return i.handleMouseUp(e)},i.handleMouseDownHandler_=function(e){return i.handleMouseDown(e)},i.enable(),i}return Gt(t,e),sn(t,[{key:"createEl",value:function(){return $t(t,"createEl",this,3)(["div",{className:"vjs-progress-control vjs-control"}])}},{key:"handleMouseMove",value:function(e){var t=this.getChild("seekBar");if(t){var n=t.getChild("playProgressBar"),i=t.getChild("mouseTimeDisplay");if(n||i){var r=t.el(),a=xi(r),s=Ai(r,e).x;s=ds(s,0,1),i&&i.update(a,s),n&&n.update(a,t.getProgress())}}}},{key:"handleMouseSeek",value:function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)}},{key:"enabled",value:function(){return this.enabled_}}
2,{key:"disable",value: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","touchmove"],this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){var e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&zr(this.player_.play())}}},{key:"enable",value:function(){this.children().forEach(function(e){return e.enable&&e.enable()}),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}},{key:"removeListenersAddedOnMousedownAndTouchstart",value: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_)}},{key:"handleMouseDown",value: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_)}},{key:"handleMouseUp",value:function(e){var t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}])}(Pr);bs.prototype.options_={children:["seekBar"]},Pr.registerComponent("ProgressControl",bs);var Ts=function(e){function t(e,n){var i;return rn(this,t),(i=Kt(this,t,[e,n])).setIcon("picture-in-picture-enter"),i.on(e,["enterpictureinpicture","leavepictureinpicture"],function(e){return i.handlePictureInPictureChange(e)}),i.on(e,["disablepictureinpicturechanged","loadedmetadata"],function(e){return i.handlePictureInPictureEnabledChange(e)}),i.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],function(){return i.handlePictureInPictureAudioModeChange()}),i.disable(),i}return Gt(t,e),sn(t,[{key:"buildCSSClass",value:function(){return"vjs-picture-in-picture-control vjs-hidden ".concat($t(t,"buildCSSClass",this,3)([]))}},{key:"handlePictureInPictureAudioModeChange",value:function(){"audio"===this.player_.currentType().substring(0,5)||this.player_.audioPosterMode()||this.player_.audioOnlyMode()?(this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()):this.show()}},{key:"handlePictureInPictureEnabledChange",value:function(){c().pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in u()()?this.enable():this.disable()}},{key:"handlePictureInPictureChange",value:function(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()}},{key:"handleClick",value:function(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}},{key:"show",value:function(){"function"==typeof c().exitPictureInPicture&&$t(t,"show",this,3)([])}}])}(es);Ts.prototype.controlText_="Picture-in-Picture",Pr.registerComponent("PictureInPictureToggle",Ts);var ks=function(e){function t(e,n){var i;return rn(this,t),(i=Kt(this,t,[e,n])).setIcon("fullscreen-enter"),i.on(e,"fullscreenchange",function(e){return i.handleFullscreenChange(e)}),!1===c()[e.fsApi_.fullscreenEnabled]&&i.disable(),i}return Gt(t,e),sn(t,[{key:"buildCSSClass",value:function(){return"vjs-fullscreen-control ".concat($t(t,"buildCSSClass",this,3)([]))}},{key:"handleFullscreenChange",value:function(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}},{key:"handleClick",value:function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}])}(es);ks.prototype.controlText_="Fullscreen",Pr.registerComponent("FullscreenToggle",ks);var Ss=function(e){function t(){return rn(this,t),Kt(this,t,arguments)}return Gt(t,e),sn(t,[{key:"createEl",value:function(){var e=$t(t,"createEl",this,3)(["div",{className:"vjs-volume-level"}]);
2return this.setIcon("circle",e),e.appendChild($t(t,"createEl",this,3)(["span",{className:"vjs-control-text"}])),e}}])}(Pr);Pr.registerComponent("VolumeLevel",Ss);var ws=function(e){function t(e,n){var i;return rn(this,t),(i=Kt(this,t,[e,n])).update=dr(cr(i,i.update),lr),i}return Gt(t,e),sn(t,[{key:"createEl",value:function(){return $t(t,"createEl",this,3)(["div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"}])}},{key:"update",value:function(e,t,n,i){if(!n){var r=Ii(this.el_),a=Ii(this.player_.el()),s=e.width*t;if(!a||!r)return;var o=e.left-a.left+s,u=e.width-s+(a.right-e.right),l=r.width/2;o<l?l+=l-o:u<l&&(l=u),l<0?l=0:l>r.width&&(l=r.width),this.el_.style.right="-".concat(l,"px")}this.write("".concat(i,"%"))}},{key:"write",value:function(e){fi(this.el_,e)}},{key:"updateVolume",value:function(e,t,n,i,r){var a=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",function(){a.update(e,t,n,i.toFixed(0)),r&&r()})}}])}(Pr);Pr.registerComponent("VolumeLevelTooltip",ws);var Es=function(e){function t(e,n){var i;return rn(this,t),(i=Kt(this,t,[e,n])).update=dr(cr(i,i.update),lr),i}return Gt(t,e),sn(t,[{key:"createEl",value:function(){return $t(t,"createEl",this,3)(["div",{className:"vjs-mouse-display"}])}},{key:"update",value:function(e,t,n){var i=this,r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,n,r,function(){n?i.el_.style.bottom="".concat(e.height*t,"px"):i.el_.style.left="".concat(e.width*t,"px")})}}])}(Pr);Es.prototype.options_={children:["volumeLevelTooltip"]},Pr.registerComponent("MouseVolumeLevelDisplay",Es);var Cs=function(e){function t(e,n){var i;return rn(this,t),(i=Kt(this,t,[e,n])).on("slideractive",function(e){return i.updateLastVolume_(e)}),i.on(e,"volumechange",function(e){return i.updateARIAAttributes(e)}),e.ready(function(){return i.updateARIAAttributes()}),i}return Gt(t,e),sn(t,[{key:"createEl",value:function(){return $t(t,"createEl",this,3)(["div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"}])}},{key:"handleMouseDown",value:function(e){Mi(e)&&$t(t,"handleMouseDown",this,3)([e])}},{key:"handleMouseMove",value:function(e){var t=this.getChild("mouseVolumeLevelDisplay");if(t){var n=this.el(),i=Ii(n),r=this.vertical(),a=Ai(n,e);a=ds(a=r?a.y:a.x,0,1),t.update(i,a,r)}Mi(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}},{key:"checkMuted",value:function(){this.player_.muted()&&this.player_.muted(!1)}},{key:"getPercent",value:function(){return this.player_.muted()?0:this.player_.volume()}},{key:"stepForward",value:function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}},{key:"stepBack",value:function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}},{key:"updateARIAAttributes",value:function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}},{key:"volumeAsPercentage_",value:function(){return Math.round(100*this.player_.volume())}},{key:"updateLastVolume_",value:function(){var e=this,t=this.player_.volume();this.one("sliderinactive",function(){0===e.player_.volume()&&e.player_.lastVolume_(t)})}}])}(ps);Cs.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},ai||qn||Cs.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),Cs.prototype.playerEvent="volumechange",Pr.registerComponent("VolumeBar",Cs);var Is=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return rn(this,t),i.vertical=i.vertical||!1,(void 0===i.volumeBar||Pn(i.volumeBar))&&(i.volumeBar=i.volumeBar||{},i.volumeBar.vertical=i.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")})}(n=Kt(this,t,[e,i]),e),n.throttledHandleMouseMove=dr(cr(n,n.handleMouseMove),lr),n.handleMouseUpHandler_=function(e){return n.handleMouseUp(e)},n.on("mousedown",function(e){return n.handleMouseDown(e)}),n.on("touchstart",function(e){return n.handleMouseDown(e)}),n.on("mousemove",function(e){return n.handleMouseMove(e)}),n.on(n.volumeBar,["focus","slideractive"],function(){n.volumeBar.addClass("vjs-slider-active"),n.addClass("vjs-slider-active"),n.trigger("slideractive")}),n.on(n.volumeBar,["blur","sliderinactive"],function(){n.volumeBar.removeClass("vjs-slider-active"),n.removeClass("vjs-slider-active"),n.trigger("sliderinactive")}),n}return Gt(t,e),sn(t,[{key:"createEl",value:function(){var e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),$t(t,"createEl",this,3)(["div",{className:"vjs-volume-control vjs-control ".concat(e)}])}},{key:"handleMouseDown",value: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_)}},{key:"handleMouseUp",value: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_)}},{key:"handleMouseMove",value:function(e){this.volumeBar.handleMouseMove(e)}}])}(Pr);Is.prototype.options_={children:["volumeBar"]}
2,Pr.registerComponent("VolumeControl",Is);var xs=function(e){function t(e,n){var i;return rn(this,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")})}(i=Kt(this,t,[e,n]),e),i.on(e,["loadstart","volumechange"],function(e){return i.update(e)}),i}return Gt(t,e),sn(t,[{key:"buildCSSClass",value:function(){return"vjs-mute-control ".concat($t(t,"buildCSSClass",this,3)([]))}},{key:"handleClick",value:function(e){var t=this.player_.volume(),n=this.player_.lastVolume_();if(0===t){var i=n<.1?.1:n;this.player_.volume(i),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}},{key:"update",value:function(e){this.updateIcon_(),this.updateControlText_()}},{key:"updateIcon_",value:function(){var e=this.player_.volume(),t=3;this.setIcon("volume-high"),ai&&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),yi(this.el_,[0,1,2,3].reduce(function(e,t){return e+"".concat(t?" ":"","vjs-vol-").concat(t)},"")),vi(this.el_,"vjs-vol-".concat(t))}},{key:"updateControlText_",value:function(){var e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)}}])}(es);xs.prototype.controlText_="Mute",Pr.registerComponent("MuteToggle",xs);var As=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return rn(this,t),void 0!==i.inline?i.inline=i.inline:i.inline=!0,(void 0===i.volumeControl||Pn(i.volumeControl))&&(i.volumeControl=i.volumeControl||{},i.volumeControl.vertical=!i.inline),(n=Kt(this,t,[e,i])).handleKeyPressHandler_=function(e){return n.handleKeyPress(e)},n.on(e,["loadstart"],function(e){return n.volumePanelState_(e)}),n.on(n.muteToggle,"keyup",function(e){return n.handleKeyPress(e)}),n.on(n.volumeControl,"keyup",function(e){return n.handleVolumeControlKeyUp(e)}),n.on("keydown",function(e){return n.handleKeyPress(e)}),n.on("mouseover",function(e){return n.handleMouseOver(e)}),n.on("mouseout",function(e){return n.handleMouseOut(e)}),n.on(n.volumeControl,["slideractive"],n.sliderActive_),n.on(n.volumeControl,["sliderinactive"],n.sliderInactive_),n}return Gt(t,e),sn(t,[{key:"sliderActive_",value:function(){this.addClass("vjs-slider-active")}},{key:"sliderInactive_",value:function(){this.removeClass("vjs-slider-active")}},{key:"volumePanelState_",value: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")}},{key:"createEl",value:function(){var e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),$t(t,"createEl",this,3)(["div",{className:"vjs-volume-panel vjs-control ".concat(e)}])}},{key:"dispose",value:function(){this.handleMouseOut(),$t(t,"dispose",this,3)([])}},{key:"handleVolumeControlKeyUp",value:function(e){"Escape"===e.key&&this.muteToggle.focus()}},{key:"handleMouseOver",value:function(e){this.addClass("vjs-hover"),nr(c(),"keyup",this.handleKeyPressHandler_)}},{key:"handleMouseOut",value:function(e){this.removeClass("vjs-hover"),ir(c(),"keyup",this.handleKeyPressHandler_)}},{key:"handleKeyPress",value:function(e){"Escape"===e.key&&this.handleMouseOut()}}])}(Pr);As.prototype.options_={children:["muteToggle","volumeControl"]},Pr.registerComponent("VolumePanel",As);var Ds=function(e){function t(e,n){var i;return rn(this,t),(i=Kt(this,t,[e,n])).validOptions=[5,10,30],i.skipTime=i.getSkipForwardTime(),i.skipTime&&i.validOptions.includes(i.skipTime)?(i.setIcon("forward-".concat(i.skipTime)),i.controlText(i.localize("Skip forward {1} seconds",[i.skipTime.toLocaleString(e.language())])),i.show()):i.hide(),i}return Gt(t,e),sn(t,[{key:"getSkipForwardTime",value:function(){var e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}},{key:"buildCSSClass",value:function(){return"vjs-skip-forward-".concat(this.getSkipForwardTime()," ").concat($t(t,"buildCSSClass",this,3)([]))}},{key:"handleClick",value:function(e){if(!isNaN(this.player_.duration())){var t,n=this.player_.currentTime(),i=this.player_.liveTracker,r=i&&i.isLive
2()?i.seekableEnd():this.player_.duration();t=n+this.skipTime<=r?n+this.skipTime:r,this.player_.currentTime(t)}}},{key:"handleLanguagechange",value:function(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}])}(es);Ds.prototype.controlText_="Skip Forward",Pr.registerComponent("SkipForward",Ds);var Ps=function(e){function t(e,n){var i;return rn(this,t),(i=Kt(this,t,[e,n])).validOptions=[5,10,30],i.skipTime=i.getSkipBackwardTime(),i.skipTime&&i.validOptions.includes(i.skipTime)?(i.setIcon("replay-".concat(i.skipTime)),i.controlText(i.localize("Skip backward {1} seconds",[i.skipTime.toLocaleString(e.language())])),i.show()):i.hide(),i}return Gt(t,e),sn(t,[{key:"getSkipBackwardTime",value:function(){var e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}},{key:"buildCSSClass",value:function(){return"vjs-skip-backward-".concat(this.getSkipBackwardTime()," ").concat($t(t,"buildCSSClass",this,3)([]))}},{key:"handleClick",value:function(e){var t,n=this.player_.currentTime(),i=this.player_.liveTracker,r=i&&i.isLive()&&i.seekableStart();t=r&&n-this.skipTime<=r?r:n>=this.skipTime?n-this.skipTime:0,this.player_.currentTime(t)}},{key:"handleLanguagechange",value:function(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}])}(es);Ps.prototype.controlText_="Skip Backward",Pr.registerComponent("SkipBackward",Ps);var Ls=function(e){function t(e,n){var i;return rn(this,t),i=Kt(this,t,[e,n]),n&&(i.menuButton_=n.menuButton),i.focusedChild_=-1,i.on("keydown",function(e){return i.handleKeyDown(e)}),i.boundHandleBlur_=function(e){return i.handleBlur(e)},i.boundHandleTapClick_=function(e){return i.handleTapClick(e)},i}return Gt(t,e),sn(t,[{key:"addEventListenerForItem",value:function(e){e instanceof Pr&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}},{key:"removeEventListenerForItem",value:function(e){e instanceof Pr&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}},{key:"removeChild",value:function(e){"string"==typeof e&&(e=this.getChild(e)),this.removeEventListenerForItem(e),$t(t,"removeChild",this,3)([e])}},{key:"addItem",value:function(e){var t=this.addChild(e);t&&this.addEventListenerForItem(t)}},{key:"createEl",value:function(){var e=this.options_.contentElType||"ul";this.contentEl_=pi(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var n=$t(t,"createEl",this,3)(["div",{append:this.contentEl_,className:"vjs-menu"}]);return n.appendChild(this.contentEl_),nr(n,"click",function(e){e.preventDefault(),e.stopImmediatePropagation()}),n}},{key:"dispose",value:function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,$t(t,"dispose",this,3)([])}},{key:"handleBlur",value:function(e){var t=e.relatedTarget||c().activeElement;if(!this.children().some(function(e){return e.el()===t})){var n=this.menuButton_;n&&n.buttonPressed_&&t!==n.el().firstChild&&n.unpressButton()}}},{key:"handleTapClick",value: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()}}},{key:"handleKeyDown",value:function(e){"ArrowLeft"===e.key||"ArrowDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepForward()):"ArrowRight"!==e.key&&"ArrowUp"!==e.key||(e.preventDefault(),e.stopPropagation(),this.stepBack())}},{key:"stepForward",value:function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)}},{key:"stepBack",value:function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)}},{key:"focus",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,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())}}])}(Pr);Pr.registerComponent("Menu",Ls);var Os=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};rn(this,t),(n=Kt(this,t,[e,i])).menuButton_=new es(e,i),n.menuButton_.controlText(n.controlText_),n.menuButton_.el_.setAttribute("aria-haspopup","true");var r=es.prototype.buildCSSClass();n.menuButton_.el_.className=n.buildCSSClass()+" "+r,n.menuButton_.removeClass("vjs-control"),n.addChild(n.menuButton_),n.update(),n.enabled_=!0;var a=function(e){return n.handleClick(e)};return n.handleMenuKeyUp_=function(e){return n.handleMenuKeyUp(e)},n.on(n.menuButton_,"tap",a),n.on(n.menuButton_,"click",a),n.on(n.menuButton_,"keydown",function(e){return n.handleKeyDown(e)}),n.on(n.menuButton_,"mouseenter",function(){n.addClass("vjs-hover"),n.menu.show(),nr(c(),"keyup",
2n.handleMenuKeyUp_)}),n.on("mouseleave",function(e){return n.handleMouseLeave(e)}),n.on("keydown",function(e){return n.handleSubmenuKeyDown(e)}),n}return Gt(t,e),sn(t,[{key:"update",value: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"))}},{key:"createMenu",value:function(){var e=new Ls(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var t=pi("li",{className:"vjs-menu-title",textContent:xr(this.options_.title),tabIndex:-1}),n=new Pr(this.player_,{el:t});e.addItem(n)}if(this.items=this.createItems(),this.items)for(var i=0;i<this.items.length;i++)e.addItem(this.items[i]);return e}},{key:"createItems",value:function(){}},{key:"createEl",value:function(){return $t(t,"createEl",this,3)(["div",{className:this.buildWrapperCSSClass()},{}])}},{key:"setIcon",value:function(e){return $t(t,"setIcon",this,3)([e,this.menuButton_.el_])}},{key:"buildWrapperCSSClass",value:function(){var e="vjs-menu-button";!0===this.options_.inline?e+="-inline":e+="-popup";var n=es.prototype.buildCSSClass();return"vjs-menu-button ".concat(e," ").concat(n," ").concat($t(t,"buildCSSClass",this,3)([]))}},{key:"buildCSSClass",value:function(){var e="vjs-menu-button";return!0===this.options_.inline?e+="-inline":e+="-popup","vjs-menu-button ".concat(e," ").concat($t(t,"buildCSSClass",this,3)([]))}},{key:"controlText",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.menuButton_.el();return this.menuButton_.controlText(e,t)}},{key:"dispose",value:function(){this.handleMouseLeave(),$t(t,"dispose",this,3)([])}},{key:"handleClick",value:function(e){this.buttonPressed_?this.unpressButton():this.pressButton()}},{key:"handleMouseLeave",value:function(e){this.removeClass("vjs-hover"),ir(c(),"keyup",this.handleMenuKeyUp_)}},{key:"focus",value:function(){this.menuButton_.focus()}},{key:"blur",value:function(){this.menuButton_.blur()}},{key:"handleKeyDown",value:function(e){"Escape"===e.key||"Tab"===e.key?(this.buttonPressed_&&this.unpressButton(),"Tab"===!e.key&&(e.preventDefault(),this.menuButton_.focus())):"Up"!==e.key&&("Down"!==e.key||this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)||this.buttonPressed_||(e.preventDefault(),this.pressButton())}},{key:"handleMenuKeyUp",value:function(e){"Escape"!==e.key&&"Tab"!==e.key||this.removeClass("vjs-hover")}},{key:"handleSubmenuKeyPress",value:function(e){this.handleSubmenuKeyDown(e)}},{key:"handleSubmenuKeyDown",value:function(e){"Escape"!==e.key&&"Tab"!==e.key||(this.buttonPressed_&&this.unpressButton(),"Tab"===!e.key&&(e.preventDefault(),this.menuButton_.focus()))}},{key:"pressButton",value:function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),ai&&di())return;this.menu.focus()}}},{key:"unpressButton",value:function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))}},{key:"disable",value:function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()}},{key:"enable",value:function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()}}])}(Pr);Pr.registerComponent("MenuButton",Os);var Rs=function(e){function t(e,n){var i;rn(this,t);var r=n.tracks;return(i=Kt(this,t,[e,n])).items.length<=1&&i.hide(),r?(i.updateHandler_=cr(i,i.update),i.cleanupHandler_=cr(i,i.cleanupTrackListeners_),r.addEventListener("removetrack",i.updateHandler_),r.addEventListener("addtrack",i.updateHandler_),r.addEventListener("labelchange",i.updateHandler_),i.player_.on("ready",i.updateHandler_),i.player_.on("dispose",i.cleanupHandler_),i):Yt(i)}return Gt(t,e),sn(t,[{key:"cleanupTrackListeners_",value:function(){if(this.updateHandler_){var e=this.options_.tracks;e&&(e.removeEventListener("removetrack",this.updateHandler_),e.removeEventListener("addtrack",this.updateHandler_),e.removeEventListener("labelchange",this.updateHandler_)),this.player_&&(this.player_.off("ready",this.updateHandler_),this.player_.off("dispose",this.cleanupHandler_)),this.updateHandler_=null,this.cleanupHandler_=null}}},{key:"dispose",value:function(){this.cleanupTrackListeners_(),$t(t,"dispose",this,3)([])}}])}(Os);Pr.registerComponent("TrackButton",Rs);var Ms=function(e){function t(e,n){var i;return rn(this,t),(i=Kt(this,t,[e,n])).selectable=n.selectable,i.isSelected_=n.selected||!1,i.multiSelectable=n.multiSelectable,i.selected(i.isSelected_),i.selectable?i.multiSelectable?i.el_.setAttribute("role","menuitemcheckbox"):i.el_.setAttribute("role","menuitemradio"):i.el_.setAttribute("role","menuitem"),i}return Gt(t,e),sn(t,[{key:"createEl",value:function(e,n,i){this.nonIconControl
2=!0;var r=$t(t,"createEl",this,3)(["li",Object.assign({className:"vjs-menu-item",tabIndex:-1},n),i]),a=pi("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?r.appendChild(a):r.replaceChild(a,r.querySelector(".vjs-icon-placeholder")),r}},{key:"handleKeyDown",value:function(e){["Tab","Escape","ArrowUp","ArrowLeft","ArrowRight","ArrowDown"].includes(e.key)||$t(t,"handleKeyDown",this,3)([e])}},{key:"handleClick",value:function(e){this.selected(!0)}},{key:"selected",value: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))}}])}(za);Pr.registerComponent("MenuItem",Ms);var Ns=function(e){function t(e,n){var i;rn(this,t);var r=n.track,a=e.textTracks();n.label=r.label||r.language||"Unknown",n.selected="showing"===r.mode,(i=Kt(this,t,[e,n])).track=r,i.kinds=(n.kinds||[n.kind||i.track.kind]).filter(Boolean);var s,o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];i.handleTracksChange.apply(i,t)},l=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];i.handleSelectedLanguageChange.apply(i,t)};(e.on(["loadstart","texttrackchange"],o),a.addEventListener("change",o),a.addEventListener("selectedlanguagechange",l),i.on("dispose",function(){e.off(["loadstart","texttrackchange"],o),a.removeEventListener("change",o),a.removeEventListener("selectedlanguagechange",l)}),void 0===a.onchange)&&i.on(["tap","click"],function(){if("object"!==hn(u()().Event))try{s=new(u()().Event)("change")}catch(e){}s||(s=c().createEvent("Event")).initEvent("change",!0,!0),a.dispatchEvent(s)});return i.handleTracksChange(),i}return Gt(t,e),sn(t,[{key:"handleClick",value:function(e){var n=this.track,i=this.player_.textTracks();if($t(t,"handleClick",this,3)([e]),i)for(var r=0;r<i.length;r++){var a=i[r];-1!==this.kinds.indexOf(a.kind)&&(a===n?"showing"!==a.mode&&(a.mode="showing"):"disabled"!==a.mode&&(a.mode="disabled"))}}},{key:"handleTracksChange",value:function(e){var t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)}},{key:"handleSelectedLanguageChange",value: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}}}},{key:"dispose",value:function(){this.track=null,$t(t,"dispose",this,3)([])}}])}(Ms);Pr.registerComponent("TextTrackMenuItem",Ns);var Us=function(e){function t(e,n){return rn(this,t),n.track={player:e,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,Kt(this,t,[e,n])}return Gt(t,e),sn(t,[{key:"handleTracksChange",value:function(e){for(var t=this.player().textTracks(),n=!0,i=0,r=t.length;i<r;i++){var a=t[i];if(this.options_.kinds.indexOf(a.kind)>-1&&"showing"===a.mode){n=!1;break}}n!==this.isSelected_&&this.selected(n)}},{key:"handleSelectedLanguageChange",value:function(e){for(var t=this.player().textTracks(),n=!0,i=0,r=t.length;i<r;i++){var a=t[i];if(["captions","descriptions","subtitles"].indexOf(a.kind)>-1&&"showing"===a.mode){n=!1;break}}n&&(this.player_.cache_.selectedLanguage={enabled:!1})}},{key:"handleLanguagechange",value:function(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),$t(t,"handleLanguagechange",this,3)([])}}])}(Ns);Pr.registerComponent("OffTextTrackMenuItem",Us);var Bs=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return rn(this,t),n.tracks=e.textTracks(),Kt(this,t,[e,n])}return Gt(t,e),sn(t,[{key:"createItems",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ns;this.label_&&(e="".concat(this.label_," off")),t.push(new Us(this.player_,{kinds:this.kinds_,kind:this.kind_,label:e})),this.hideThreshold_+=1;var i=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var r=0;r<i.length;r++){var a=i[r];if(this.kinds_.indexOf(a.kind)>-1){var s=new n(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});s.addClass("vjs-".concat(a.kind,"-menu-item")),t.push(s)}}return t}}])}(Rs);Pr.registerComponent("TextTrackButton",Bs);var Fs=function(e){function t(e,n){var i;rn(this,t);var r=n.track,a=n.cue,s=e.currentTime();return n.selectable=!0,n.multiSelectable=!1,n.label=a.text,n.selected=a.startTime<=s&&s<a.endTime,(i=Kt(this,t,[e,n])).track=r,
2i.cue=a,i}return Gt(t,e),sn(t,[{key:"handleClick",value:function(e){$t(t,"handleClick",this,3)([]),this.player_.currentTime(this.cue.startTime)}}])}(Ms);Pr.registerComponent("ChaptersTrackMenuItem",Fs);var qs=function(e){function t(e,n,i){var r;return rn(this,t),(r=Kt(this,t,[e,n,i])).setIcon("chapters"),r.selectCurrentItem_=function(){r.items.forEach(function(e){e.selected(r.track_.activeCues[0]===e.cue)})},r}return Gt(t,e),sn(t,[{key:"buildCSSClass",value:function(){return"vjs-chapters-button ".concat($t(t,"buildCSSClass",this,3)([]))}},{key:"buildWrapperCSSClass",value:function(){return"vjs-chapters-button ".concat($t(t,"buildWrapperCSSClass",this,3)([]))}},{key:"update",value:function(e){if(!e||!e.track||"chapters"===e.track.kind){var n=this.findChaptersTrack();n!==this.track_?(this.setTrack(n),$t(t,"update",this,3)([])):(!this.items||n&&n.cues&&n.cues.length!==this.items.length)&&$t(t,"update",this,3)([])}}},{key:"setTrack",value: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_)}}}},{key:"findChaptersTrack",value: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}}},{key:"getMenuCaption",value:function(){return this.track_&&this.track_.label?this.track_.label:this.localize(xr(this.kind_))}},{key:"createMenu",value:function(){return this.options_.title=this.getMenuCaption(),$t(t,"createMenu",this,3)([])}},{key:"createItems",value:function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var n=0,i=t.length;n<i;n++){var r=t[n],a=new Fs(this.player_,{track:this.track_,cue:r});e.push(a)}return e}}])}(Bs);qs.prototype.kind_="chapters",qs.prototype.controlText_="Chapters",Pr.registerComponent("ChaptersButton",qs);var js=function(e){function t(e,n,i){var r;rn(this,t),(r=Kt(this,t,[e,n,i])).setIcon("audio-description");var a=e.textTracks(),s=cr(r,r.handleTracksChange);return a.addEventListener("change",s),r.on("dispose",function(){a.removeEventListener("change",s)}),r}return Gt(t,e),sn(t,[{key:"handleTracksChange",value:function(e){for(var t=this.player().textTracks(),n=!1,i=0,r=t.length;i<r;i++){var a=t[i];if(a.kind!==this.kind_&&"showing"===a.mode){n=!0;break}}n?this.disable():this.enable()}},{key:"buildCSSClass",value:function(){return"vjs-descriptions-button ".concat($t(t,"buildCSSClass",this,3)([]))}},{key:"buildWrapperCSSClass",value:function(){return"vjs-descriptions-button ".concat($t(t,"buildWrapperCSSClass",this,3)([]))}}])}(Bs);js.prototype.kind_="descriptions",js.prototype.controlText_="Descriptions",Pr.registerComponent("DescriptionsButton",js);var Hs=function(e){function t(e,n,i){var r;return rn(this,t),(r=Kt(this,t,[e,n,i])).setIcon("subtitles"),r}return Gt(t,e),sn(t,[{key:"buildCSSClass",value:function(){return"vjs-subtitles-button ".concat($t(t,"buildCSSClass",this,3)([]))}},{key:"buildWrapperCSSClass",value:function(){return"vjs-subtitles-button ".concat($t(t,"buildWrapperCSSClass",this,3)([]))}}])}(Bs);Hs.prototype.kind_="subtitles",Hs.prototype.controlText_="Subtitles",Pr.registerComponent("SubtitlesButton",Hs);var Vs=function(e){function t(e,n){var i;return rn(this,t),n.track={player:e,kind:n.kind,label:n.kind+" settings",selectable:!1,default:!1,mode:"disabled"},n.selectable=!1,n.name="CaptionSettingsMenuItem",(i=Kt(this,t,[e,n])).addClass("vjs-texttrack-settings"),i.controlText(", opens "+n.kind+" settings dialog"),i}return Gt(t,e),sn(t,[{key:"handleClick",value:function(e){this.player().getChild("textTrackSettings").open()}},{key:"handleLanguagechange",value:function(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.kind+" settings"),$t(t,"handleLanguagechange",this,3)([])}}])}(Ns);Pr.registerComponent("CaptionSettingsMenuItem",Vs);var zs=function(e){function t(e,n,i){var r;return rn(this,t),(r=Kt(this,t,[e,n,i])).setIcon("captions"),r}return Gt(t,e),sn(t,[{key:"buildCSSClass",value:function(){return"vjs-captions-button ".concat($t(t,"buildCSSClass",this,3)([]))}},{key:"buildWrapperCSSClass",value:function(){return"vjs-captions-button ".concat($t(t,"buildWrapperCSSClass",this,3)([]))}},{key:"createItems",value:function(){var e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new Vs(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),$t(t,"createItems",this,3)([e])}}])}(Bs);
2zs.prototype.kind_="captions",zs.prototype.controlText_="Captions",Pr.registerComponent("CaptionsButton",zs);var Ws=function(e){function t(){return rn(this,t),Kt(this,t,arguments)}return Gt(t,e),sn(t,[{key:"createEl",value:function(e,n,i){var r=$t(t,"createEl",this,3)([e,n,i]),a=r.querySelector(".vjs-menu-item-text");return"captions"===this.options_.track.kind&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",r):a.appendChild(pi("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),a.appendChild(pi("span",{className:"vjs-control-text",textContent:" ".concat(this.localize("Captions"))}))),r}}])}(Ns);Pr.registerComponent("SubsCapsMenuItem",Ws);var Gs=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return rn(this,t),(n=Kt(this,t,[e,i])).label_="subtitles",n.setIcon("subtitles"),["en","en-us","en-ca","fr-ca"].indexOf(n.player_.language_)>-1&&(n.label_="captions",n.setIcon("captions")),n.menuButton_.controlText(xr(n.label_)),n}return Gt(t,e),sn(t,[{key:"buildCSSClass",value:function(){return"vjs-subs-caps-button ".concat($t(t,"buildCSSClass",this,3)([]))}},{key:"buildWrapperCSSClass",value:function(){return"vjs-subs-caps-button ".concat($t(t,"buildWrapperCSSClass",this,3)([]))}},{key:"createItems",value:function(){var e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new Vs(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=$t(t,"createItems",this,3)([e,Ws])}}])}(Bs);Gs.prototype.kinds_=["captions","subtitles"],Gs.prototype.controlText_="Subtitles",Pr.registerComponent("SubsCapsButton",Gs);var Xs=function(e){function t(e,n){var i;rn(this,t);var r=n.track,a=e.audioTracks();n.label=r.label||r.language||"Unknown",n.selected=r.enabled,(i=Kt(this,t,[e,n])).track=r,i.addClass("vjs-".concat(r.kind,"-menu-item"));var s=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];i.handleTracksChange.apply(i,t)};return a.addEventListener("change",s),i.on("dispose",function(){a.removeEventListener("change",s)}),i}return Gt(t,e),sn(t,[{key:"createEl",value:function(e,n,i){var r=$t(t,"createEl",this,3)([e,n,i]),a=r.querySelector(".vjs-menu-item-text");return["main-desc","descriptions","description"].indexOf(this.options_.track.kind)>=0&&(a.appendChild(pi("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),a.appendChild(pi("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),r}},{key:"handleClick",value:function(e){if($t(t,"handleClick",this,3)([e]),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks)for(var n=this.player_.audioTracks(),i=0;i<n.length;i++){var r=n[i];r!==this.track&&(r.enabled=r===this.track)}}},{key:"handleTracksChange",value:function(e){this.selected(this.track.enabled)}}])}(Ms);Pr.registerComponent("AudioTrackMenuItem",Xs);var Ks=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return rn(this,t),i.tracks=e.audioTracks(),(n=Kt(this,t,[e,i])).setIcon("audio"),n}return Gt(t,e),sn(t,[{key:"buildCSSClass",value:function(){return"vjs-audio-button ".concat($t(t,"buildCSSClass",this,3)([]))}},{key:"buildWrapperCSSClass",value:function(){return"vjs-audio-button ".concat($t(t,"buildWrapperCSSClass",this,3)([]))}},{key:"createItems",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.hideThreshold_=1;for(var t=this.player_.audioTracks(),n=0;n<t.length;n++){var i=t[n];e.push(new Xs(this.player_,{track:i,selectable:!0,multiSelectable:!1}))}return e}}])}(Rs);Ks.prototype.controlText_="Audio Track",Pr.registerComponent("AudioTrackButton",Ks);var Ys=function(e){function t(e,n){var i;rn(this,t);var r=n.rate,a=parseFloat(r,10);return n.label=r,n.selected=a===e.playbackRate(),n.selectable=!0,n.multiSelectable=!1,(i=Kt(this,t,[e,n])).label=r,i.rate=a,i.on(e,"ratechange",function(e){return i.update(e)}),i}return Gt(t,e),sn(t,[{key:"handleClick",value:function(e){$t(t,"handleClick",this,3)([]),this.player().playbackRate(this.rate)}},{key:"update",value:function(e){this.selected(this.player().playbackRate()===this.rate)}}])}(Ms);Ys.prototype.contentElType="button",Pr.registerComponent("PlaybackRateMenuItem",Ys);var Qs=function(e){function t(e,n){var i;return rn(this,t),(i=Kt(this,t,[e,n])).menuButton_.el_.setAttribute("aria-describedby",i.labelElId_),i.updateVisibility(),i.updateLabel(),i.on(e,"loadstart",function(e){return i.updateVisibility(e)}),i.on(e,"ratechange",function(e){return i.updateLabel(e)}
2),i.on(e,"playbackrateschange",function(e){return i.handlePlaybackRateschange(e)}),i}return Gt(t,e),sn(t,[{key:"createEl",value:function(){var e=$t(t,"createEl",this,3)([]);return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=pi("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}},{key:"dispose",value:function(){this.labelEl_=null,$t(t,"dispose",this,3)([])}},{key:"buildCSSClass",value:function(){return"vjs-playback-rate ".concat($t(t,"buildCSSClass",this,3)([]))}},{key:"buildWrapperCSSClass",value:function(){return"vjs-playback-rate ".concat($t(t,"buildWrapperCSSClass",this,3)([]))}},{key:"createItems",value:function(){for(var e=this.playbackRates(),t=[],n=e.length-1;n>=0;n--)t.push(new Ys(this.player(),{rate:e[n]+"x"}));return t}},{key:"handlePlaybackRateschange",value:function(e){this.update()}},{key:"playbackRates",value:function(){var e=this.player();return e.playbackRates&&e.playbackRates()||[]}},{key:"playbackRateSupported",value:function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}},{key:"updateVisibility",value:function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}},{key:"updateLabel",value:function(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}])}(Os);Qs.prototype.controlText_="Playback Rate",Pr.registerComponent("PlaybackRateMenuButton",Qs);var $s=function(e){function t(){return rn(this,t),Kt(this,t,arguments)}return Gt(t,e),sn(t,[{key:"buildCSSClass",value:function(){return"vjs-spacer ".concat($t(t,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.className||(n.className=this.buildCSSClass()),$t(t,"createEl",this,3)([e,n,i])}}])}(Pr);Pr.registerComponent("Spacer",$s);var Js=function(e){function t(){return rn(this,t),Kt(this,t,arguments)}return Gt(t,e),sn(t,[{key:"buildCSSClass",value:function(){return"vjs-custom-control-spacer ".concat($t(t,"buildCSSClass",this,3)([]))}},{key:"createEl",value:function(){return $t(t,"createEl",this,3)(["div",{className:this.buildCSSClass(),textContent:" "}])}}])}($s);Pr.registerComponent("CustomControlSpacer",Js);var Zs=function(e){function t(){return rn(this,t),Kt(this,t,arguments)}return Gt(t,e),sn(t,[{key:"createEl",value:function(){return $t(t,"createEl",this,3)(["div",{className:"vjs-control-bar",dir:"ltr"}])}}])}(Pr);Zs.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]},Pr.registerComponent("ControlBar",Zs);var eo=function(e){function t(e,n){var i;return rn(this,t),(i=Kt(this,t,[e,n])).on(e,"error",function(e){i.open(e)}),i}return Gt(t,e),sn(t,[{key:"buildCSSClass",value:function(){return"vjs-error-display ".concat($t(t,"buildCSSClass",this,3)([]))}},{key:"content",value:function(){var e=this.player().error();return e?this.localize(e.message):""}}])}(Qr);eo.prototype.options_=Object.assign({},Qr.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),Pr.registerComponent("ErrorDisplay",eo);var to=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return rn(this,t),(n=Kt(this,t,[e,i])).el_.setAttribute("aria-labelledby",n.selectLabelledbyIds),n}return Gt(t,e),sn(t,[{key:"createEl",value:function(){var e=this;return this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim(),pi("select",{id:this.options_.id},{},this.options_.SelectOptions.map(function(t){var n=(e.options_.labelId?e.options_.labelId:"vjs-track-option-".concat($i()))+"-"+t[1].replace(/\W+/g,""),i=pi("option",{id:n,value:e.localize(t[0]),textContent:e.localize(t[1])});return i.setAttribute("aria-labelledby","".concat(e.selectLabelledbyIds," ").concat(n)),i}))}}])}(Pr);Pr.registerComponent("TextTrackSelect",to);var no=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};rn(this,t);var r=pi("legend",{textContent:(n=Kt(this,t,[e,i])).localize(n.options_.legendText),id:n.options_.legendId});n.el().appendChild(r);var a,s=zt(n.options_.selects);try{for(s.s();!(a=s.n()).done;){var o=a.value,u=n.options_.selectConfigs[o],l=u.className,c=u.id.replace("%s",n.options_.id_),d=null,h="vjs_select_".concat($i());if("colors"===n.options_.type){d=pi("span",{className:l});var p=pi("label",{id:c,className:"vjs-label",textContent:n.localize(u.label)});p.setAttribute("for",h),d.appendChild(p)}var f=new to(e,{SelectOptions:u.options,legendId:n.options_.legendId,id:h,labelId:c});n.addChild(f),"colors"===n.options_.type&&(d.appendChild(f.el()),n.el().appendChild(d))}}catch(e){s.e(e)}finally{s.f()}return n}return Gt(t,e),sn(t,[{key:"createEl",value:function(){return pi("fieldset",{className:this.options_.className})}}])}(Pr);Pr.registerComponent("TextTrackFieldset",no);var io=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};rn(this,t);var r=(n=Kt(this,t,[e,i])).options_.textTrackComponentid,a=new no(e,{id_:r,legendId:"captions-text-legend-".concat(r),legendText:n.localize("Text"),className:"vjs-fg vjs-track-setting",selects:n.options_.fieldSets[
20],selectConfigs:n.options_.selectConfigs,type:"colors"});n.addChild(a);var s=new no(e,{id_:r,legendId:"captions-background-".concat(r),legendText:n.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:n.options_.fieldSets[1],selectConfigs:n.options_.selectConfigs,type:"colors"});n.addChild(s);var o=new no(e,{id_:r,legendId:"captions-window-".concat(r),legendText:n.localize("Caption Area Background"),className:"vjs-window vjs-track-setting",selects:n.options_.fieldSets[2],selectConfigs:n.options_.selectConfigs,type:"colors"});return n.addChild(o),n}return Gt(t,e),sn(t,[{key:"createEl",value:function(){return pi("div",{className:"vjs-track-settings-colors"})}}])}(Pr);Pr.registerComponent("TextTrackSettingsColors",io);var ro=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};rn(this,t);var r=(n=Kt(this,t,[e,i])).options_.textTrackComponentid,a=new no(e,{id_:r,legendId:"captions-font-size-".concat(r),legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:n.options_.fieldSets[0],selectConfigs:n.options_.selectConfigs,type:"font"});n.addChild(a);var s=new no(e,{id_:r,legendId:"captions-edge-style-".concat(r),legendText:n.localize("Text Edge Style"),className:"vjs-edge-style vjs-track-setting",selects:n.options_.fieldSets[1],selectConfigs:n.options_.selectConfigs,type:"font"});n.addChild(s);var o=new no(e,{id_:r,legendId:"captions-font-family-".concat(r),legendText:n.localize("Font Family"),className:"vjs-font-family vjs-track-setting",selects:n.options_.fieldSets[2],selectConfigs:n.options_.selectConfigs,type:"font"});return n.addChild(o),n}return Gt(t,e),sn(t,[{key:"createEl",value:function(){return pi("div",{className:"vjs-track-settings-font"})}}])}(Pr);Pr.registerComponent("TextTrackSettingsFont",ro);var ao=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};rn(this,t),n=Kt(this,t,[e,i]);var r=new es(e,{controlText:n.localize("restore all settings to the default values"),className:"vjs-default-button"});r.el().classList.remove("vjs-control","vjs-button"),r.el().textContent=n.localize("Reset"),n.addChild(r);var a=n.localize("Done"),s=new es(e,{controlText:a,className:"vjs-done-button"});return s.el().classList.remove("vjs-control","vjs-button"),s.el().textContent=a,n.addChild(s),n}return Gt(t,e),sn(t,[{key:"createEl",value:function(){return pi("div",{className:"vjs-track-settings-controls"})}}])}(Pr);Pr.registerComponent("TrackSettingsControls",ao);var so="vjs-text-track-settings",oo=["#000","Black"],uo=["#00F","Blue"],lo=["#0FF","Cyan"],co=["#0F0","Green"],ho=["#F0F","Magenta"],po=["#F00","Red"],fo=["#FFF","White"],mo=["#FF0","Yellow"],go=["1","Opaque"],vo=["0.5","Semi-Transparent"],yo=["0","Transparent"],_o={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[oo,fo,po,co,uo,mo,ho,lo],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[go,vo,yo],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[fo,oo,po,co,uo,mo,ho,lo],className:"vjs-text-color"},edgeStyle:{selector:".vjs-edge-style > select",id:"",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"",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:"",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:"Opacity",options:[go,vo],className:"vjs-text-opacity vjs-opacity"},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color",className:"vjs-window-color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[yo,vo,go],className:"vjs-window-opacity vjs-opacity"}};function bo(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}_o.windowColor.options=_o.backgroundColor.options;var To=function(e){function t(e,n){var i;return rn(this,t),n.temporary=!1,(i=Kt(this,t,[e,n])).updateDisplay=i.updateDisplay.bind(i),i.fill(),i.hasBeenOpened_=i.hasBeenFilled_=!0,i.renderModalComponents(e),i.endDialog=pi("p",{className:"vjs-control-text",textContent:i.localize("End of dialog window.")}),i.el().appendChild(i.endDialog),i.setDefaults(),void 0===n.persistTextTrackSettings&&(i.options_.persistTextTrackSettings=i.options_.playerOptions.persistTextTrackSettings),i.bindFunctionsToSelectsAndButtons(),i.options_.persistTextTrackSettings&&i.restoreSettings(),i}return Gt(t,e),sn(t,[{key:"renderModalComponents",value:function(e){var t=new io(e,{textTrackComponentid:this.id_,selectConfigs:_o,fieldSets:[["color","textOpacity"],["backgroundColor","backgroundOpacity"],["windowColor","windowOpacity"]]});this.addChild(t);var n=new ro(e,{textTrackComponentid:this.id_,selectConfigs:_o,fieldSets:[["fontPercent"],["edgeStyle"],["fontFamily"]]});this.addChild(n);var i=new ao(e);this.addChild(i)}},{key:"bindFunctionsToSelectsAndButtons",value:function(){var e=this;this.on(this.$(".vjs-done-button"),["click","tap"],function(){e.saveSettings(),e.close()}),this.on(this.$(".vjs-default-button"),["click","tap"],function(){e.setDefaults(),e.updateDisplay()}),xn(_o,function(t){e.on(e.$(t.selector),"change",e.updateDisplay)})}},{key:"dispose",value:function(){this.endDialog=null,$t(t,"dispose",this,3)([])}},{key:"label",value:function(){return this.localize("Caption Settings Dialog")}},{key:"description",value:function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}},{key:"buildCSSClass",value:function(){return $t(t,"buildCSSClass",this,3)([])+" vjs-text-track-settings"}},{key:"getValues",value:function(){var e=this;return An(_o,function(t,n,i){var r,a,s=(r=e.$(n.selector),a=n.parser,bo(r.options[r.options.selectedIndex].value,a));return void 0!==s&&(t[i]=s),t},{})}},{key:"setValues",value:function(e){var t=this;xn(_o,function(n,i){!function(e,t,n){if(t)for(var i=0;i<e.options.length;i++)if(bo(e.options[i].value,n)===t){e.selectedIndex=i;break}}(t.$(n.selector),e[i],n.parser)})}},{key:"setDefaults",value:function(){var e=this;xn(_o,function(t){var n=t.hasOwnProperty("default")?t.default:0;e.$(t.selector).selectedIndex=n})}},{key:"restoreSettings",value:function(){var e;try{e=JSON.parse(u()().localStorage.getItem(so))}catch(e){wn.warn(e)}e&&this.setValues(e)}},{key:"saveSettings",value:function(){if(this.options_.persistTextTrackSettings){var e=this.getValues();try{Object.keys(e).length?u()().localStorage.setItem(so,JSON.stringify(e)):u()().localStorage.removeItem(so)}catch(e){wn.warn(e)}}}},{key:"updateDisplay",value:function(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}},{key:"handleLanguagechange",value:function(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}}])}(Qr);Pr.registerComponent("TextTrackSettings",To);var ko=function(e){function t(e,n){var i;rn(this,t);var r=n.ResizeObserver||u()().ResizeObserver;null===n.ResizeObserver&&(r=!1);var a=Ln({createEl:!r,reportTouchActivity:!1},n);return(i=Kt(this,t,[e,a])).ResizeObserver=n.ResizeObserver||u()().ResizeObserver,i.loadListener_=null,i.resizeObserver_=null,i.debouncedHandler_=hr(function(){i.resizeHandler()},100,!1,i),r?(i.resizeObserver_=new i.ResizeObserver(i.debouncedHandler_),i.resizeObserver_.observe(e.el(
2))):(i.loadListener_=function(){if(i.el_&&i.el_.contentWindow){var e=i.debouncedHandler_,t=i.unloadListener_=function(){ir(this,"resize",e),ir(this,"unload",t),t=null};nr(i.el_.contentWindow,"unload",t),nr(i.el_.contentWindow,"resize",e)}},i.one("load",i.loadListener_)),i}return Gt(t,e),sn(t,[{key:"createEl",value:function(){return $t(t,"createEl",this,3)(["iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"}])}},{key:"resizeHandler",value:function(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")}},{key:"dispose",value: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,$t(t,"dispose",this,3)([])}}])}(Pr);Pr.registerComponent("ResizeManager",ko);var So={trackingThreshold:20,liveTolerance:15},wo=function(e){function t(e,n){var i;rn(this,t);var r=Ln(So,n,{createEl:!1});return(i=Kt(this,t,[e,r])).trackLiveHandler_=function(){return i.trackLive_()},i.handlePlay_=function(e){return i.handlePlay(e)},i.handleFirstTimeupdate_=function(e){return i.handleFirstTimeupdate(e)},i.handleSeeked_=function(e){return i.handleSeeked(e)},i.seekToLiveEdge_=function(e){return i.seekToLiveEdge(e)},i.reset_(),i.on(i.player_,"durationchange",function(e){return i.handleDurationchange(e)}),i.on(i.player_,"canplay",function(){return i.toggleTracking()}),i}return Gt(t,e),sn(t,[{key:"trackLive_",value:function(){var e=this.player_.seekable();if(e&&e.length){var t=Number(u()().performance.now().toFixed(4)),n=-1===this.lastTime_?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+n;var i=this.liveCurrentTime(),r=this.player_.currentTime(),a=this.player_.paused()||this.seekedBehindLive_||Math.abs(i-r)>this.options_.liveTolerance;this.timeupdateSeen_&&i!==1/0||(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"))}}},{key:"handleDurationchange",value:function(){this.toggleTracking()}},{key:"toggleTracking",value: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())}},{key:"startTracking",value:function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,lr),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_)))}},{key:"handleFirstTimeupdate",value:function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}},{key:"handleSeeked",value:function(){var e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}},{key:"handlePlay",value:function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}},{key:"reset_",value: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_)}},{key:"nextSeekedFromUser",value:function(){this.nextSeekedFromUser_=!0}},{key:"stopTracking",value:function(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}},{key:"seekableEnd",value: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}},{key:"seekableStart",value: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}
2},{key:"liveWindow",value:function(){var e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}},{key:"isLive",value:function(){return this.isTracking()}},{key:"atLiveEdge",value:function(){return!this.behindLiveEdge()}},{key:"liveCurrentTime",value:function(){return this.pastSeekEnd()+this.seekableEnd()}},{key:"pastSeekEnd",value:function(){var e=this.seekableEnd();return-1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}},{key:"behindLiveEdge",value:function(){return this.behindLiveEdge_}},{key:"isTracking",value:function(){return"number"==typeof this.trackingInterval_}},{key:"seekToLiveEdge",value:function(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}},{key:"dispose",value:function(){this.stopTracking(),$t(t,"dispose",this,3)([])}}])}(Pr);Pr.registerComponent("LiveTracker",wo);var Eo=function(e){function t(e,n){var i;return rn(this,t),(i=Kt(this,t,[e,n])).on("statechanged",function(e){return i.updateDom_()}),i.updateDom_(),i}return Gt(t,e),sn(t,[{key:"createEl",value:function(){return this.els={title:pi("div",{className:"vjs-title-bar-title",id:"vjs-title-bar-title-".concat($i())}),description:pi("div",{className:"vjs-title-bar-description",id:"vjs-title-bar-description-".concat($i())})},pi("div",{className:"vjs-title-bar"},{},On(this.els))}},{key:"updateDom_",value:function(){var e=this,t=this.player_.tech_,n=t&&t.el_,i={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(function(t){var r=e.state[t],a=e.els[t],s=i[t];Pi(a),r&&fi(a,r),n&&(n.removeAttribute(s),r&&n.setAttribute(s,a.id))}),this.state.title||this.state.description?this.show():this.hide()}},{key:"update",value:function(e){this.setState(e)}},{key:"dispose",value:function(){var e=this.player_.tech_,n=e&&e.el_;n&&(n.removeAttribute("aria-labelledby"),n.removeAttribute("aria-describedby")),$t(t,"dispose",this,3)([]),this.els=null}}])}(Pr);Pr.registerComponent("TitleBar",Eo);var Co={initialDisplay:4e3,position:[],takeFocus:!1},Io=function(e){function t(e,n){var i;return rn(this,t),n=Ln(Co,n),(i=Kt(this,t,[e,n])).controlText(n.controlText),i.hide(),i.on(i.player_,["useractive","userinactive"],function(e){i.removeClass("force-display")}),i}return Gt(t,e),sn(t,[{key:"buildCSSClass",value:function(){return"vjs-transient-button focus-visible ".concat(this.options_.position.map(function(e){return"vjs-".concat(e)}).join(" "))}},{key:"createEl",value:function(){var e=pi("button",{},{type:"button",class:this.buildCSSClass()},pi("span"));return this.controlTextEl_=e.querySelector("span"),e}},{key:"show",value:function(){var e=this;$t(t,"show",this,3)([]),this.addClass("force-display"),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout(function(){e.removeClass("force-display")},this.options_.initialDisplay)}},{key:"hide",value:function(){this.removeClass("force-display"),$t(t,"hide",this,3)([])}},{key:"dispose",value:function(){this.player_.clearTimeout(this.forceDisplayTimeout),$t(t,"dispose",this,3)([])}}])}(es);Pr.registerComponent("TransientButton",Io);var xo=function(e){var t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;var n=e.$$("source"),i=[],r="";if(!n.length)return!1;for(var a=0;a<n.length;a++){var s=n[a].src;s&&-1===i.indexOf(s)&&i.push(s)}return!!i.length&&(1===i.length&&(r=i[0]),e.triggerSourceset(r),!0)},Ao=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(e){var t=c().createElement(this.nodeName.toLowerCase());t.innerHTML=e;for(var n=c().createDocumentFragment();t.childNodes.length;)n.appendChild(t.childNodes[0]);return this.innerText="",u()().Element.prototype.appendChild.call(this,n),this.innerHTML}}),Do=function(e,t){for(var n={},i=0;i<e.length&&!((n=Object.getOwnPropertyDescriptor(e[i],t))&&n.set&&n.get);i++);return n.enumerable=!0,n.configurable=!0,n},Po=function(e){var t=e.el();if(!t.resetSourceWatch_){var n={},i=function(e){return Do([e.el(),u()().HTMLMediaElement.prototype,u()().Element.prototype,Ao],"innerHTML")}(e),r=function(n){return function(){for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];var s=n.apply(t,r);return xo(e),s}};["append","appendChild","insertAdjacentHTML"].forEach(function(e){t[e]&&(n[e]=t[e],t[e]=r(n[e]))}),Object.defineProperty(t,"innerHTML",Ln(i,{set:r(i.set)})),t.resetSourceWatch_=function(){t.resetSourceWatch_=null,Object.keys(n).forEac
2h(function(e){t[e]=n[e]}),Object.defineProperty(t,"innerHTML",i)},e.one("sourceset",t.resetSourceWatch_)}},Lo=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?ha(u()().Element.prototype.getAttribute.call(this,"src")):""},set:function(e){return u()().Element.prototype.setAttribute.call(this,"src",e),e}}),Oo=function(e){if(e.featuresSourceset){var t=e.el();if(!t.resetSourceset_){var n=function(e){return Do([e.el(),u()().HTMLMediaElement.prototype,Lo],"src")}(e),i=t.setAttribute,r=t.load;Object.defineProperty(t,"src",Ln(n,{set:function(i){var r=n.set.call(t,i);return e.triggerSourceset(t.src),r}})),t.setAttribute=function(n,r){var a=i.call(t,n,r);return/src/i.test(n)&&e.triggerSourceset(t.src),a},t.load=function(){var n=r.call(t);return xo(e)||(e.triggerSourceset(""),Po(e)),n},t.currentSrc?e.triggerSourceset(t.currentSrc):xo(e)||Po(e),t.resetSourceset_=function(){t.resetSourceset_=null,t.load=r,t.setAttribute=i,Object.defineProperty(t,"src",n),t.resetSourceWatch_&&t.resetSourceWatch_()}}}},Ro=function(e){function t(e,n){var i;rn(this,t),i=Kt(this,t,[e,n]);var r=e.source,a=!1;if(i.featuresVideoFrameCallback=i.featuresVideoFrameCallback&&"VIDEO"===i.el_.tagName,r&&(i.el_.currentSrc!==r.src||e.tag&&3===e.tag.initNetworkState_)?i.setSource(r):i.handleLateInit_(i.el_),e.enableSourceset&&i.setupSourcesetHandling_(),i.isScrubbing_=!1,i.el_.hasChildNodes()){for(var s=i.el_.childNodes,o=s.length,u=[];o--;){var l=s[o];"track"===l.nodeName.toLowerCase()&&(i.featuresNativeTextTracks?(i.remoteTextTrackEls().addTrackElement_(l),i.remoteTextTracks().addTrack(l.track),i.textTracks().addTrack(l.track),a||i.el_.hasAttribute("crossorigin")||!fa(l.src)||(a=!0)):u.push(l))}for(var c=0;c<u.length;c++)i.el_.removeChild(u[c])}return i.proxyNativeTracks_(),i.featuresNativeTextTracks&&a&&wn.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading."),i.restoreMetadataTracksInIOSNativePlayer_(),(ni||Jn)&&!0===e.nativeControlsForTouch&&i.setControls(!0),i.proxyWebkitFullscreen_(),i.triggerReady(),i}return Gt(t,e),sn(t,[{key:"dispose",value:function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),t.dis
2poseMediaElement(this.el_),this.options_=null,$t(t,"dispose",this,3)([])}},{key:"setupSourcesetHandling_",value:function(){Oo(this)}},{key:"restoreMetadataTracksInIOSNativePlayer_",value:function(){var e,t=this.textTracks(),n=function(){e=[];for(var n=0;n<t.length;n++){var i=t[n];"metadata"===i.kind&&e.push({track:i,storedMode:i.mode})}};n(),t.addEventListener("change",n),this.on("dispose",function(){return t.removeEventListener("change",n)});var i=function(){for(var n=0;n<e.length;n++){var r=e[n];"disabled"===r.track.mode&&r.track.mode!==r.storedMode&&(r.track.mode=r.storedMode)}t.removeEventListener("change",i)};this.on("webkitbeginfullscreen",function(){t.removeEventListener("change",n),t.removeEventListener("change",i),t.addEventListener("change",i)}),this.on("webkitendfullscreen",function(){t.removeEventListener("change",n),t.addEventListener("change",n),t.removeEventListener("change",i)})}},{key:"overrideNative_",value:function(e,t){var n=this;if(t===this["featuresNative".concat(e,"Tracks")]){var i=e.toLowerCase();this["".concat(i,"TracksListeners_")]&&Object.keys(this["".concat(i,"TracksListeners_")]).forEach(function(e){n.el()["".concat(i,"Tracks")].removeEventListener(e,n["".concat(i,"TracksListeners_")][e])}),this["featuresNative".concat(e,"Tracks")]=!t,this["".concat(i,"TracksListeners_")]=null,this.proxyNativeTracksForType_(i)}}},{key:"overrideNativeAudioTracks",value:function(e){this.overrideNative_("Audio",e)}},{key:"overrideNativeVideoTracks",value:function(e){this.overrideNative_("Video",e)}},{key:"proxyNativeTracksForType_",value:function(e){var t=this,n=ka[e],i=this.el()[n.getterName],r=this[n.getterName]();if(this["featuresNative".concat(n.capitalName,"Tracks")]&&i&&i.addEventListener){var a={change:function(n){var i={type:"change",target:r,currentTarget:r,srcElement:r};r.trigger(i),"text"===e&&t[Sa.remoteText.getterName]().trigger(i)},addtrack:function(e){r.addTrack(e.track)},removetrack:function(e){r.removeTrack(e.track)}},s=function(){for(var e=[],t=0;t<r.length;t++){for(var n=!1,a=0;a<i.length;a++)if(i[a]===r[t]){n=!0;break}n||e.push(r[t])}for(;e.length;)r.removeTrack(e.shift())};this[n.getterName+"Listeners_"]=a,Object.keys(a).forEach(function(e){var n=a[e];i.addEventListener(e,n),t.on("dispose",function(t){return i.removeEventListener(e,n)})}),this.on("loadstart",s),this.on("dispose",function(e){return t.off("loadstart",s)})}}},{key:"proxyNativeTracks_",value:function(){var e=this;ka.names.forEach(function(t){e.proxyNativeTracksForType_(t)})}},{key:"createEl",value: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=c().createElement("video");var i=Ln({},this.options_.tag&&Ti(this.options_.tag));ni&&!0===this.options_.nativeControlsForTouch||delete i.controls,bi(e,Object.assign(i,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}void 0!==this.options_.preload&&Si(e,"preload",this.options_.preload),void 0!==this.options_.disablePictureInPicture&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);for(var r=["loop","muted","playsinline","autoplay"],a=0;a<r.length;a++){var s=r[a],o=this.options_[s];void 0!==o&&(o?Si(e,s,s):wi(e,s),e[s]=o)}return e}},{key:"handleLateInit_",value: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 i=function(){t||this.trigger("loadstart")};return this.on("loadedmetadata",i),void this.ready(function(){this.off("loadstart",n),this.off("loadedmetadata",i),t||this.trigger("loadstart")})}var r=["loadstart"];r.push("loadedmetadata"),e.readyState>=2&&r.push("loadeddata"),e.readyState>=3&&r.push("canplay"),e.readyState>=4&&r.push("canplaythrough"),this.ready(function(){r.forEach(function(e){this.trigger(e)},this)})}}},{key:"setScrubbing",value:function(e){this.isScrubbing_=e}},{key:"scrubbing",value:function(){return this.isScrubbing_}},{key:"setCurrentTime",value:function(e){try{this.isScrubbing_&&this.el_.fastSeek&&si?this.el_.fastSeek(e):this.el_.currentTime=e}catch(e){wn(e,"Video is not ready. (Video.js)")}}},{key:"duration",value:function(){var e=this;if(this.el_.duration===1/0&&qn&&zn&&0===this.el_.currentTime){var t=function(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",t))};return this.on("timeupdate",t),NaN}return this.el_.duration||NaN}},{key:"width",value:function(){return this.el_.offsetWidth}},{key:"height",value:function(){return this.el_.offsetHeight}},{key:"proxyWebkitFullscreen_",value: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)})}}},{key:"supportsFullScreen",value:function(){return"function"==typeof this.el_.webkitEnterFullScreen}},{key:"enterFullScreen",value:function(){var e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)zr(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)}}},{key:"exitFullScreen",value:function(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))}},{key:"requestPictureInPicture",value:function(){return this.el_.requestPictureInPicture()}},{key:"requestVideoFrameCallback",value:function(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):$t(t,"requestVideoFrameCallback",this,3)([e])}},{key:"cancelVideoFrameCallback",value:function(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):$t(t,"cancelVideoFrameCallback",this,3)([e])}},{key:"src",value:function(e){if(void 0===e)return this.el_.src;this.setSrc(e)}},{key:"addSourceElement",value:function(e,t){if(!e)return wn.error("Invalid source URL."),!1;var n={src:e};t&&(n.type=t);var i=pi("source",{},n);return this.el_.appendChild(i),!0}},{key:"removeSourceElement",value:function(e){if(!e)return wn.error("Source URL is required to remove the source element."),!1;var t,n=zt(this.el_.querySelectorAll("source"));try{for(n.s();!(t=n.n()).done;){var i=t.value;if(i.src===e)return this.el_.removeChild(i),!0}}catch(e){n.e(e)}finally{n.f()}return wn.warn("No matching source element found with src: ".concat(e)),!1}},{key:"reset",value:function(){t.resetMediaElement(this.el_)}},{key:"currentSrc",value:function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}},{key:"setControls",value:function(e){this.el_.controls=!!e}},{key:"addTextTrack",value:function(e,n,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,n,i):$t(t,"addTextTrack",this,3)([e,n,i])}},{key:"createRemoteTextTrack",value:function(e){if(!this.featuresNativeTextTracks)return $t(t,"createRemoteTextTrack",this,3)([e]);var n=c().createElement("track");return e.kind&&(n.kind=e.kind),e.label&&(n.label=e.label),(e.language||e.srclang)&&(n.srclang=e.language||e.srclang),e.default&&(n.default=e.default),e.id&&(n.id=e.id),e.src&&(n.src=e.src),n}},{key:"addRemoteTextTrack",value:function(e,n){var i=$t(t,"addRemoteTextTrack",this,3)([e,n]);return this.featuresNativeTextTracks&&this.el().appendChild(i),i}},{key:"removeRemoteTextTrack",value:function(e){if($t(t,"removeRemoteTextTrack",this,3)([e]),this.featuresNativeTextTracks)for(var n=this.$$("track"),i=n.length;i--;)e!==n[i]&&e!==n[i].track||this.el().removeChild(n[i])}},{key:"getVideoPlaybackQuality",value: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),u()().performance&&(e.creationTime=u()().performance.now()),e}}])}(Ea);Rn(Ro,"TEST_VID",function(){if(li()){var e=c().createElement("video"),t=c().createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e}}),Ro.isSupported=function(){try{Ro.TEST_VID.volume=.5}catch(e){return!1}return!(!Ro.TEST_VID||!Ro.TEST_VID.canPlayType)},Ro.canPlayType=function(e){return Ro.TEST_VID.canPlayType(e)},Ro.canPlaySource=function(e,t){return Ro.canPlayType(e.type)},Ro.canControlVolume=function(){try{var e=Ro.TEST_VID.volume;Ro.TEST_VID.volume=e/2+.1;var t=e!==Ro.TEST_VID.volume;return t&&ai?(u()().setTimeout(function(){Ro&&Ro.prototype&&(Ro.prototype.featuresVolumeControl=e!==Ro.TEST_VID.volume)}),!1):t}catch(e){return!1}},Ro.canMuteVolume=function(){try{var e=Ro.TEST_VID.muted;return Ro.TEST_VID.muted=!e,Ro.TEST_VID.muted?Si(Ro.TEST_VID,"muted","muted"):wi(Ro.TEST_VID,"muted"),e!==Ro.TEST_VID.muted}catch(e){return!1}},Ro.canControlPlaybackRate=function(){if(qn&&zn&&Gn<58)return!1;try{var e=Ro.TEST_VID.playbackRate;return Ro.TEST_VID.playbackRate=e/2+.1,e!==Ro.TEST_VID.playbackRate}catch(e){return!1}},Ro.canOverrideAttributes=function(){try{var e=function(){};Object.defineProperty(c().createElement("video"),"src",{get:e,set:e}),Object.defineProperty(c().createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(c().createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(c().createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return!1}return!0},Ro.supportsNativeTextTracks=function(){return si||ai&&zn},Ro.supportsNativeVideoTracks=function(){return!(!Ro.TEST_VID||!Ro.TEST_VID.videoTracks)},Ro.supportsNativeAudioTracks=function(){return!(!Ro.TEST_VID||!Ro.TEST_VID.audioTracks)},Ro.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"]].forEac
2h(function(e){var t=en(e,2),n=t[0],i=t[1];Rn(Ro.prototype,n,function(){return Ro[i]()},!0)}),Ro.prototype.featuresVolumeControl=Ro.canControlVolume(),Ro.prototype.movingMediaElementInDOM=!ai,Ro.prototype.featuresFullscreenResize=!0,Ro.prototype.featuresProgressEvents=!0,Ro.prototype.featuresTimeupdateEvents=!0,Ro.prototype.featuresVideoFrameCallback=!(!Ro.TEST_VID||!Ro.TEST_VID.requestVideoFrameCallback),Ro.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){}}()}},Ro.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){Ro.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(e){Ro.prototype["set"+xr(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){Ro.prototype[e]=function(){return this.el_[e]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(e){Ro.prototype["set"+xr(e)]=function(t){this.el_[e]=t}}),["pause","load","play"].forEach(function(e){Ro.prototype[e]=function(){return this.el_[e]()}}),Ea.withSourceHandlers(Ro),Ro.nativeSourceHandler={},Ro.nativeSourceHandler.canPlayType=function(e){try{return Ro.TEST_VID.canPlayType(e)}catch(e){return""}},Ro.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return Ro.nativeSourceHandler.canPlayType(e.type);if(e.src){var n=pa(e.src);return Ro.nativeSourceHandler.canPlayType("video/".concat(n))}return""},Ro.nativeSourceHandler.handleSource=function(e,t,n){t.setSrc(e.src)},Ro.nativeSourceHandler.dispose=function(){},Ro.registerSourceHandler(Ro.nativeSourceHandler),Ea.registerTech("Html5",Ro);var Mo=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],No={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Uo=["tiny","xsmall","small","medium","large","xlarge","huge"],Bo={};Uo.forEach(function(e){var t="x"===e.charAt(0)?"x-".concat(e.substring(1)):e;Bo[e]="vjs-layout-".concat(t)});var Fo={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},qo=function(e){function t(e,n,i){var r;if(rn(this,t),e.id=e.id||n.id||"vjs_video_".concat($i()),(n=Object.assign(t.getTagSettings(e),n)).initChildren=!1,n.createEl=!1,n.evented=!1,n.reportTouchActivity=!1,!n.language){var a=e.closest("[lang]");a&&(n.language=a.getAttribute("lang"))}if((r=Kt(this,t,[null,n,i])).boundDocumentFullscreenChange_=function(e){return r.documentFullscreenChange_(e)},r.boundFullWindowOnEscKey_=function(e){return r.fullWindowOnEscKey(e)},r.boundUpdateStyleEl_=function(e){return r.updateStyleEl_(e)},r.boundApplyInitTime_=function(e){return r.applyInitTime_(e)},r.boundUpdateCurrentBreakpoint_=function(e){return r.updateCurrentBreakpoint_(e)},r.boundHandleTechClick_=function(e){return r.handleTechClick_(e)},r.boundHandleTechDoubleClick_=function(e){return r.handleTechDoubleClick_(e)},r.boundHandleTechTouchStart_=function(e){return r.handleTechTouchStart_(e)},r.boundHandleTechTouchMove_=function(e){return r.handleTechTouchMove_(e)},r.boundHandleTechTouchEnd_=function(e){return r.handleTechTouchEnd_(e)},r.boundHandleTechTap_=function(e){return r.handleTechTap_(e)},r.boundUpdatePlayerHeightOnAudioOnlyMode_=function(e){return r.updatePlayerHeightOnAudioOnlyMode_(e)},r.isFullscreen_=!1,r.log=En(r.id_),r.fsApi_=yn,r.isPosterFromTech_=!1,r.queuedCallbacks_=[],r.isReady_=!1,r.hasStarted_=!1,r.userActive_=!1,r.debugEnabled_=!1,r.audioOnlyMode_=!1,r.audioPosterMode_=!1,r.audioOnlyCache_={controlBarHeight:null,playerHe
2ight:null,hiddenChildren:[]},!r.options_||!r.options_.techOrder||!r.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(r.tag=e,r.tagAttributes=e&&Ti(e),r.language(r.options_.language),n.languages){var s={};Object.getOwnPropertyNames(n.languages).forEach(function(e){s[e.toLowerCase()]=n.languages[e]}),r.languages_=s}else r.languages_=t.prototype.options_.languages;r.resetCache_(),r.poster_=n.poster||"",r.controls_=!!n.controls,e.controls=!1,e.removeAttribute("controls"),r.changingSrc_=!1,r.playCallbacks_=[],r.playTerminatedQueue_=[],e.hasAttribute("autoplay")?r.autoplay(!0):r.autoplay(r.options_.autoplay),n.plugins&&Object.keys(n.plugins).forEach(function(e){if("function"!=typeof r[e])throw new Error('plugin "'.concat(e,'" does not exist'))}),r.scrubbing_=!1,r.el_=r.createEl(),wr(r,{eventBusKey:"el_"}),r.fsApi_.requestFullscreen&&(nr(c(),r.fsApi_.fullscreenchange,r.boundDocumentFullscreenChange_),r.on(r.fsApi_.fullscreenchange,r.boundDocumentFullscreenChange_)),r.fluid_&&r.on(["playerreset","resize"],r.boundUpdateStyleEl_);var o=Ln(r.options_);if(n.plugins&&Object.keys(n.plugins).forEach(function(e){r[e](n.plugins[e])}),n.debug&&r.debug(!0),r.options_.playerOptions=o,r.middleware_=[],r.playbackRates(n.playbackRates),n.experimentalSvgIcons){var l=(new(u()
vendor: 17,799 bytes, line 2
2().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 1200 1227" id="vjs-icon-twitter">\n      <path d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z"/>\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(
2l.querySelector("parsererror"))wn.warn("Failed to load SVG Icons. Falling back to Font Icons."),r.options_.experimentalSvgIcons=null;else{var d=l.documentElement;d.style.display="none",r.el_.appendChild(d),r.addClass("vjs-svg-icons-enabled")}}r.initChildren(),r.isAudio("audio"===e.nodeName.toLowerCase()),r.controls()?r.addClass("vjs-controls-enabled"):r.addClass("vjs-controls-disabled"),r.el_.setAttribute("role","region"),r.isAudio()?r.el_.setAttribute("aria-label",r.localize("Audio Player")):r.el_.setAttribute("aria-label",r.localize("Video Player")),r.isAudio()&&r.addClass("vjs-audio"),n.spatialNavigation&&n.spatialNavigation.enabled&&(r.spatialNavigation=new Ha(r),r.addClass("vjs-spatial-navigation-enabled")),ni&&r.addClass("vjs-touch-enabled"),ai||r.addClass("vjs-workinghover"),t.players[r.id_]=r;var h=fn.split(".")[0];return r.addClass("vjs-v".concat(h)),r.userActive(!0),r.reportUserActivity(),r.one("play",function(e){return r.listenForUserActivity_(e)}
2),r.on("keydown",function(e){return r.handleKeyDown(e)}),r.on("languagechange",function(e){return r.handleLanguagechange(e)}),r.breakpoints(r.options_.breakpoints),r.responsive(r.options_.responsive),r.on("ready",function(){r.audioPosterMode(r.options_.audioPosterMode),r.audioOnlyMode(r.options_.audioOnlyMode)}),r}return Gt(t,e),sn(t,[{key:"dispose",value:function(){var e,n=this;this.trigger("dispose"),this.off("dispose"),ir(c(),this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),ir(c(),"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),e=this,Ia.hasOwnProperty(e.id())&&delete Ia[e.id()],wa.names.forEach(function(e){var t=wa[e],i=n[t.getterName]();i&&i.off&&i.off()}),$t(t,"dispose",this,3)([{restoreEl:this.options_.restoreEl}])}},{key:"createEl",value:function(){var e,n=this.tag,i=this.playerElIngest_=n.parentNode&&n.parentNode.hasAttribute&&n.parentNode.hasAttribute("data-vjs-player"),r="video-js"===this.tag.tagName.toLowerCase();i?e=this.el_=n.parentNode:r||(e=this.el_=$t(t,"createEl",this,3)(["div"]));var a=Ti(n);if(r){for(e=this.el_=n,n=this.tag=c().createElement("video");e.children.length;)n.appendChild(e.firstChild);gi(e,"video-js")||vi(e,"video-js"),e.appendChild(n),i=this.playerElIngest_=e,Object.keys(e).forEach(function(t){try{n[t]=e[t]}catch(e){}})}n.setAttribute("tabindex","-1"),a.tabindex="-1",zn&&Qn&&(n.setAttribute("role","application"),a.role="application"),n.removeAttribute("width"),n.removeAttribute("height"),"width"in a&&delete a.width,"height"in a&&delete a.height,Object.getOwnPropertyNames(a).forEach(function(t){r&&"class"===t||e.setAttribute(t,a[t]),r&&n.setAttribute(t,a[t])}),n.playerId=n.id,n.id+="_html5_api",n.className="vjs-tech",n.player=e.player=this,this.addClass("vjs-paused");var s=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter(function(e){return oi[e]}).map(function(e){return"vjs-device-"+e.substring(3).toLowerCase().replace(/\_/g,"-")});if(this.addClass.apply(this,un(s)),!0!==u()().VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=Xi("vjs-styles-dimensions");var o=Ni(".vjs-styles-defaults"),l=Ni("head");l.insertBefore(this.styleEl_,o?o.nextSibling:l.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 d=n.getElementsByTagName("a"),h=0;h<d.length;h++){var p=d.item(h);vi(p,"vjs-hidden"),p.setAttribute("hidden","hidden")}return n.initNetworkState_=n.networkState,n.parentNode&&!i&&n.parentNode.insertBefore(e,n),mi(n,e),this.children_.unshift(n),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=e,e}},{key:"crossOrigin",value:function(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)):wn.warn('crossOrigin must be null,  "anonymous" or "use-credentials", given "'.concat(e,'"'))}},{key:"width",value:function(e){return this.dimension("width",e)}},{key:"height",value:function(e){return this.dimension("height",e)}},{key:"dimension",value: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 i=parseFloat(t);isNaN(i)?wn.error('Improper value "'.concat(t,'" supplied for for ').concat(e)):(this[n]=i,this.updateStyleEl_())}},{key:"fluid",value:function(e){var t,n,i=this;if(void 0===e)return!!this.fluid_;this.fluid_=!!e,gr(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),n=function(){i.on(["playerreset","resize"],i.boundUpdateStyleEl_)},gr(t=this)?n():(t.eventedCallbacks||(t.eventedCallbacks=[]),t.eventedCallbacks.push(n))):this.removeClass("vjs-fluid"),this.updateStyleEl_()}},{key:"fill",value:function(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}},{key:"aspectRatio",value: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_()}},{key:"updateStyleEl_",value:function(){if(!0!==u()().VIDEOJS_NO_DYNAMIC_STYLE){var e,t,n,i=(void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),r=i[1]/i[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/r:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*r,n=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(n),Ki(this.styleEl_,"\n      .".concat(n," {\n        width: ").concat(e,"px;\n        height: ").concat(t,"px;\n      }\n\n      .").concat(n,".vjs-fluid:not(.vjs-audio-only-mode) {\n        padding-top: ").concat(100*r,"%;\n      }\n    "))}else{var a="number"==typeof this.width_?this.width_:this.options_.width,s="number"==typeof this.height_?this.height_:this.options_.height,o=this.tech_&&this.tech_.el();o&&(a>=0&&(o.width=a),s>=0&&(o.height=s))}}},{key:"loadTech_",value:function(e,t){var n=this;this.tech_&&this.unloadTech_();var i=xr(e),r=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==i&&this.tag&&(Ea.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=i,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:"".concat(this.id(),"_").concat(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};
2wa.names.forEach(function(e){var t=wa[e];s[t.getterName]=n[t.privateName]}),Object.assign(s,this.options_[i]),Object.assign(s,this.options_[r]),Object.assign(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=Ea.getTech(e);if(!o)throw new Error("No Tech named '".concat(i,"' exists! '").concat(i,"' should be registered using videojs.registerTech()'"));this.tech_=new o(s),this.tech_.ready(cr(this,this.handleTechReady_),!0),Xr(this.textTracksJson_||[],this.tech_),Mo.forEach(function(e){n.on(n.tech_,e,function(t){return n["handleTech".concat(xr(e),"_")](t)})}),Object.keys(No).forEach(function(e){n.on(n.tech_,e,function(t){0===n.tech_.playbackRate()&&n.tech_.seeking()?n.queuedCallbacks_.push({callback:n["handleTech".concat(No[e],"_")].bind(n),event:t}):n["handleTech".concat(No[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_,"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"===i&&this.tag||mi(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}},{key:"unloadTech_",value:function(){var e=this;wa.names.forEach(function(t){var n=wa[t];e[n.privateName]=e[n.getterName]()}),this.textTracksJson_=Gr(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}},{key:"tech",value:function(e){return void 0===e&&wn.warn("Using the tech directly can be dangerous. I hope you know 
2what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_}},{key:"version",value:function(){return{"video.js":fn}}},{key:"addTechControlsListeners_",value: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_)}},{key:"removeTechControlsListeners_",value: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_)}},{key:"handleTechReady_",value:function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}},{key:"handleTechLoadStart_",value:function(){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())}},{key:"manualAutoplay_",value:function(e){var t=this;if(this.tech_&&"string"==typeof e){var n,i=function(){var e=t.muted();t.muted(!0);var n=function(){t.muted(e)};t.playTerminatedQueue_.push(n);var i=t.play();if(Vr(i))return i.catch(function(e){throw n(),new Error("Rejection at manualAutoplay. Restoring muted value. ".concat(e||""))})};if("any"!==e||this.muted()?n="muted"!==e||this.muted()?this.play():i():Vr(n=this.play())&&(n=n.catch(i)),Vr(n))return n.then(function(){t.trigger({type:"autoplay-success",autoplay:e})}).catch(function(){t.trigger({type:"autoplay-failure",autoplay:e})})}}},{key:"updateSourceCaches_",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",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 i=e.$$("source"),r=0;r<i.length;r++){var a=i[r];if(a.type&&a.src&&a.src===t)return a.type}return Ua(t)}(this,t)),this.cache_.source=Ln({},e,{src:t,type:n});for(var i=this.cache_.sources.filter(function(e){return e.src&&e.src===t}),r=[],a=this.$$("source"),s=[],o=0;o<a.length;o++){var u=Ti(a[o]);r.push(u),u.src&&u.src===t&&s.push(u.src)}s.length&&!i.length?this.cache_.sources=r:i.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}},{key:"handleTechSourceset_",value:function(e){var t=this;if(!this.changingSrc_){var n=function(e){return t.updateSourceCaches_(e)},i=this.currentSource().src,r=e.src;i&&!/^blob:/.test(i)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==i)&&(n=function(){}),n(r),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"})}},{key:"hasStarted",value:function(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"))}},{key:"handleTechPlay_",value:function(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}},{key:"handleTechRateChange_",value: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")}},{key:"handleTechWaiting_",value:function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting");var t=this.currentTime(),n=function(){t!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",n))};this.on("timeupdate",n)}},{key:"handleTechCanPlay_",value:function(){this.removeClass("vjs-waiting"),this.trigger("canplay")}},{key:"handleTechCanPlayThrough_",value:function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}},{key:"handleTechPlaying_",value:function(){this.removeClass("vjs-waiting"),this.trigger("playing")}},{key:"handleTechSeeking_",value:function(){this.addClass("vjs-seeking"),this.trigger("seeking")}},{key:"handleTechSeeked_",value:function(){this.removeClass("vjs-seeking","vjs-e
2nded"),this.trigger("seeked")}},{key:"handleTechPause_",value:function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}},{key:"handleTechEnded_",value:function(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}},{key:"handleTechDurationChange_",value:function(){this.duration(this.techGet_("duration"))}},{key:"handleTechClick_",value: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()?zr(this.play()):this.pause()))}},{key:"handleTechDoubleClick_",value: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.isInPictureInPicture()&&!c().pictureInPictureElement?this.exitPictureInPicture():this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))}},{key:"handleTechTap_",value:function(){this.userActive(!this.userActive())}},{key:"handleTechTouchStart_",value:function(){this.userWasActive=this.userActive()}},{key:"handleTechTouchMove_",value:function(){this.userWasActive&&this.reportUserActivity()}},{key:"handleTechTouchEnd_",value:function(e){e.cancelable&&e.preventDefault()}},{key:"toggleFullscreenClass_",value:function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}},{key:"documentFullscreenChange_",value:function(e){var t=e.target.player;if(!t||t===this){var n=this.el(),i=c()[this.fsApi_.fullscreenElement]===n;!i&&n.matches&&(i=n.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(i)}}},{key:"handleTechFullscreenChange_",value: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))}},{key:"handleTechFullscreenError_",value:function(e,t){this.trigger("fullscreenerror",t)}},{key:"togglePictureInPictureClass_",value:function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}},{key:"handleTechEnterPictureInPicture_",value:function(e){this.isInPictureInPicture(!0)}},{key:"handleTechLeavePictureInPicture_",value:function(e){this.isInPictureInPicture(!1)}},{key:"handleTechError_",value:function(){var e=this.tech_.error();e&&this.error(e)}},{key:"handleTechTextData_",value:function(){var e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}},{key:"getCache",value:function(){return this.cache_}},{key:"resetCache_",value: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}}},{key:"techCall_",value:function(e,t){this.ready(function(){if(e in La)return function(e,t,n,i){return t[n](e.reduce(Ra(n),i))}(this.middleware_,this.tech_,e,t);if(e in Oa)return Da(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(e){throw wn(e),e}},!0)}},{key:"techGet_",value:function(e){if(this.tech_&&this.tech_.isReady_){if(e in Pa)return function(e,t,n){return e.reduceRight(Ra(n),t[n]())}(this.middleware_,this.tech_,e);if(e in Oa)return Da(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw wn("Video.js: ".concat(e," method not defined for ").concat(this.techName_," playback technology."),t),t;if("TypeError"===t.name)throw wn("Video.js: ".concat(e," unavailable on ").concat(this.techName_," playback technology element."),t),this.tech_.isReady_=!1,t;throw wn(t),t}}}},{key:"play",value:function(){var e=this;return new Promise(function(t){e.play_(t)})}},{key:"play_",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:zr;this.playCallbacks_.push(t);var n=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc())),i=Boolean(si||ai);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!n)return this.waitToPlay_=function(t){e.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(!n&&i&&this.load());var r=this.techGet_("play");
2i&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),null===r?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)}},{key:"runPlayTerminatedQueue_",value:function(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(e){e()})}},{key:"runPlayCallbacks_",value:function(e){var t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(t){t(e)})}},{key:"pause",value:function(){this.techCall_("pause")}},{key:"paused",value:function(){return!1!==this.techGet_("paused")}},{key:"played",value:function(){return this.techGet_("played")||Rr(0,0)}},{key:"scrubbing",value: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")}},{key:"currentTime",value:function(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_)))}},{key:"applyInitTime_",value:function(){this.currentTime(this.cache_.initTime)}},{key:"duration",value: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"))}},{key:"remainingTime",value:function(){return this.duration()-this.currentTime()}},{key:"remainingTimeDisplay",value:function(){return Math.floor(this.duration())-Math.floor(this.currentTime())}},{key:"buffered",value:function(){var e=this.techGet_("buffered");return e&&e.length||(e=Rr(0,0)),e}},{key:"seekable",value:function(){var e=this.techGet_("seekable");return e&&e.length||(e=Rr(0,0)),e}},{key:"seeking",value:function(){return this.techGet_("seeking")}},{key:"ended",value:function(){return this.techGet_("ended")}},{key:"networkState",value:function(){return this.techGet_("networkState")}},{key:"readyState",value:function(){return this.techGet_("readyState")}},{key:"bufferedPercent",value:function(){return jr(this.buffered(),this.duration())}},{key:"bufferedEnd",value:function(){var e=this.buffered(),t=this.duration(),n=e.end(e.length-1);return n>t&&(n=t),n}},{key:"volume",value:function(e){var 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)}},{key:"muted",value:function(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)}},{key:"defaultMuted",value:function(e){return void 0!==e&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}},{key:"lastVolume_",value:function(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e}},{key:"supportsFullScreen",value:function(){return this.techGet_("supportsFullScreen")||!1}},{key:"isFullscreen",value: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_}},{key:"requestFullscreen",value:function(e){this.isInPictureInPicture()&&this.exitPictureInPicture();var t=this;return new Promise(function(n,i){function r(){t.off("fullscreenerror",s),t.off("fullscreenchange",a)}function a(){r(),n()}function s(e,t){r(),i(t)}t.one("fullscreenchange",a),t.one("fullscreenerror",s);var o=t.requestFullscreenHelper_(e);o&&(o.then(r,r),o.then(n,i))})}},{key:"requestFullscreenHelper_",value: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 i=this.el_[this.fsApi_.requestFullscreen](t);return i&&i.then(function(){return n.isFullscreen(!0)},function(){return n.isFullscreen(!1)}),i}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}},{key:"exitFullscreen",value:function(){var e=this;return new Promise(function(t,n){function i(){e.off("fullscreenerror",a),e.off("fullscreenchange",r)}function r(){i(),t()}function a(e,t){i(),n(t)}e.one("fullscreenchange",r),e.one("fullscreenerror",a);var s=e.exitFullscreenHelper_();s&&(s.then(i,i),s.then(t,n))})}},{key:"exitFullscreenHelper_",value:function(){var e=this;if(this.fsApi_.requestFullscreen){var t=c()[this.fsApi_.exitFullscreen]();return t&&zr(t.then(function(){return e.isFullscreen(!1)})),t}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}},{key:"enterFullWindow",value:function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=c().documentElement.style.overflow,nr(c(),"keydown",this.boundFullWindowOnEscKey_),c().documentElement.style.overflow="hidden",vi(c().body,"vjs-full-window"),this.trigger("enterFullWindow")}},{key:"fullWindowOnEscKey",value:function(e){"Escape"===e.key&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}},{key:"exitFullWindow",value:function(){this.isFullscreen(!1),this.isFullWindow=!1,ir(c(),"keydown",this.boundFullWindowOnEscKey_),c().documentElement.style.overflow=this.docOrigOverflow,yi(c().body,"vjs-full-window"),this.trigger("exitFullWindow")}},{key:"disablePictureInPicture",value:function(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}},{key:"isInPictureInPicture",value:function(e){return void 0!==e?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_}},{key:"requestPictureInPicture",value:function(){var e=this;
2if(this.options_.enableDocumentPictureInPicture&&u()().documentPictureInPicture){var t=c().createElement(this.el().tagName);return t.classList=this.el().classList,t.classList.add("vjs-pip-container"),this.posterImage&&t.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&t.appendChild(this.titleBar.el().cloneNode(!0)),t.appendChild(pi("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),u()().documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(function(n){return Fi(n),e.el_.parentNode.insertBefore(t,e.el_),n.document.body.appendChild(e.el_),n.document.body.classList.add("vjs-pip-window"),e.player_.isInPictureInPicture(!0),e.player_.trigger({type:"enterpictureinpicture",pipWindow:n}),n.addEventListener("pagehide",function(n){var i=n.target.querySelector(".video-js");t.parentNode.replaceChild(i,t),e.player_.isInPictureInPicture(!1),e.player_.trigger("leavepictureinpicture")}),n})}return"pictureInPictureEnabled"in c()&&!1===this.disablePictureInPicture()?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}},{key:"exitPictureInPicture",value:function(){return u()().documentPictureInPicture&&u()().documentPictureInPicture.window?(u()().documentPictureInPicture.window.close(),Promise.resolve()):"pictureInPictureEnabled"in c()?c().exitPictureInPicture():void 0}},{key:"handleKeyDown",value:function(e){var t=this.options_.userActions;if(t&&t.hotkeys){(function(e){var t=e.tagName.toLowerCase();if(e.isContentEditable)return!0;if("input"===t)return-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(e.type);return-1!==["textarea"].indexOf(t)})(this.el_.ownerDocument.activeElement)||("function"==typeof t.hotkeys?t.hotkeys.call(this,e):this.handleHotkeys(e))}}},{key:"handleHotkeys",value:function(e){var t=this.options_.userActions?this.options_.userActions.hotkeys:{},n=t.fullscreenKey,i=void 0===n?function(t){return"f"===e.key.toLowerCase()}:n,r=t.muteKey,a=void 0===r?function(t){return"m"===e.key.toLowerCase()}:r,s=t.playPauseKey,o=void 0===s?function(t){return"k"===e.key.toLowerCase()||" "===e.key.toLowerCase()}:s;if(i.call(this,e)){e.preventDefault(),e.stopPropagation();var u=Pr.getComponent("FullscreenToggle");!1!==c()[this.fsApi_.fullscreenEnabled]&&u.prototype.handleClick.call(this,e)}else if(a.call(this,e)){e.preventDefault(),e.stopPropagation(),Pr.getComponent("MuteToggle").prototype.handleClick.call(this,e)}else if(o.call(this,e)){e.preventDefault(),e.stopPropagation(),Pr.getComponent("PlayToggle").prototype.handleClick.call(this,e)}}},{key:"canPlayType",value:function(e){for(var t,n=0,i=this.options_.techOrder;n<i.length;n++){var r=i[n],a=Ea.getTech(r);if(a||(a=Pr.getComponent(r)),a){if(a.isSupported()&&(t=a.canPlayType(e)))return t}else wn.error('The "'.concat(r,'" tech is undefined. Skipped browser support check for that tech.'))}return""}},{key:"selectSource",value:function(e){var t,n,i=this,r=this.options_.techOrder.map(function(e){return[e,Ea.getTech(e)]}).filter(function(e){var t=en(e,2),n=t[0],i=t[1];return i?i.isSupported():(wn.error('The "'.concat(n,'" tech is undefined. Skipped browser support check for that tech.')),!1)}),a=function(e,t,n){var i;return e.some(function(e){return t.some(function(t){if(i=n(e,t))return!0})}),i},s=function(e,t){var n=en(e,2),r=n[0];if(n[1].canPlaySource(t,i.options_[r.toLowerCase()]))return{source:t,tech:r}};return t=this.options_.sourceOrder?a(e,r,(n=s,function(e,t){return n(t,e)})):a(r,e,s),t||!1}},{key:"handleSrc_",value:function(e,t){var n=this;if(void 0===e)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();var i=Ba(e);if(i.length){if(this.changingSrc_=!0,t||(this.cache_.sources=i),this.updateSourceCaches_(i[0]),Aa(this,i[0],function(e,r){var a,s;if(n.middleware_=r,t||(n.cache_.sources=i),n.updateSourceCaches_(e),n.src_(e))return i.length>1?n.handleSrc_(i.slice(1)):(n.changingSrc_=!1,n.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),void n.triggerReady());a=r,s=n.tech_,a.forEach(function(e){return e.setTech&&e.setTech(s)})}),i.length>1){var r=function(){n.error(null),n.handleSrc_(i.slice(1),!0)},a=function(){n.off("error",r)};this.one("error",r),this.one("playing",a),this.resetRetryOnError_=function(){n.off("error",r),n.off("playing",a)}}}else this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0)}},{key:"src",value:function(e){return this.handleSrc_(e,!1)}},{key:"src_",value:function(e){var t=this,n=this.selectSource([e]);return!n||(Ar(n.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_(n.tech,n.source),this.tech_.ready(function(){t.changingSrc_=!1}),!1))}},{key:"addSourceElement",value:function(e,t){return!!this.tech_&&this.tech_.addSourceElement(e,t)}},{key:"removeSourceElement",value:function(e){return!!this.tech_&&this.tech_.removeSourceElement(e)}},{key:"load",value:function(){this.tech_&&this.tech_.vhs?this.src(this.currentSource()):this.techCall_("load")}},{key:"reset",value:function(){var e=this;this.paused()?this.doReset_():zr(this.play().then(function(){return e.doReset_()}))}},{key:"doReset_",value:function(){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}),gr(this)&&this.trigger("playerreset")}},{key:"resetControlBarUI_",value:function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}},{key:"resetProgressBar_",value:function(){this.currentTime(0);var e=this.controlBar||{},t=e.currentTimeDisplay,n=e.durationDisplay,i=e.progressControl,r=e.remainingTimeDisplay,a=(i||{}).seekBar;t&&t.updateContent(),n&&n.updateContent(),r&&r.updateContent(),a&&(a.update(),a.loadProgressBar&&a.loadProgressBar.update(
2))}},{key:"resetPlaybackRate_",value:function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}},{key:"resetVolumeBar_",value:function(){this.volume(1),this.trigger("volumechange")}},{key:"currentSources",value:function(){var e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t}},{key:"currentSource",value:function(){return this.cache_.source||{}}},{key:"currentSrc",value:function(){return this.currentSource()&&this.currentSource().src||""}},{key:"currentType",value:function(){return this.currentSource()&&this.currentSource().type||""}},{key:"preload",value:function(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")}},{key:"autoplay",value: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)}},{key:"playsinline",value:function(e){return void 0!==e&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}},{key:"loop",value:function(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")}},{key:"poster",value: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"))}},{key:"handleTechPosterChange_",value: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"))}}},{key:"controls",value: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_()))}},{key:"usingNativeControls",value: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")))}},{key:"error",value:function(e){var t=this;if(void 0===e)return this.error_||null;if(gn("beforeerror").forEach(function(n){var i=n(t,e);Dn(i)&&!Array.isArray(i)||"string"==typeof i||"number"==typeof i||null===i?e=i: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_=null,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new Hr(e),this.addClass("vjs-error"),wn.error("(CODE:".concat(this.error_.code," ").concat(Hr.errorTypes[this.error_.code],")"),this.error_.message,this.error_),this.trigger("error"),gn("error").forEach(function(e){return e(t,t.error_)})}},{key:"reportUserActivity",value:function(e){this.userActivity_=!0}},{key:"userActive",value: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")}}},{key:"listenForUserActivity_",value:function(){var e,t,n,i=cr(this,this.reportUserActivity),r=function(t){i(),this.clearInterval(e)};this.on("mousedown",function(){i(),this.clearInterval(e),e=this.setInterval(i,250)}),this.on("mousemove",function(e){e.screenX===t&&e.screenY===n||(t=e.screenX,n=e.screenY,i())}),this.on("mouseup",r),this.on("mouseleave",r);var a,s=this.getChild("controlBar");!s||ai||qn||(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",i),this.on("keyup",i);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)}},{key:"playbackRate",value:function(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)}},{key:"defaultPlaybackRate",value:function(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}},{key:"isAudio",value:function(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e}},{key:"updatePlayerHeightOnAudioOnlyMode_",value:function(){var e=this.getChild("ControlBar");e&&this.audioOnlyCache_.controlBarHeight!==e.currentHeight()&&(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}},{key:"enableAudioOnlyUI_",value:function(){var e=this;this.addClass("vjs-audio-only-mode");var t=this.children(),n=this.getChild("ControlBar"),i=n&&n.currentHeight();t.forEach(function(t){t!==n&&t.el_&&!t.hasClass("vjs-hidden")&&(t.hide(),e.audioOnlyCache_.hiddenChildren.push(t))}
2),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=i,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(i),this.trigger("audioonlymodechange")}},{key:"disableAudioOnlyUI_",value:function(){this.removeClass("vjs-audio-only-mode"),this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach(function(e){return e.show()}),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}},{key:"audioOnlyMode",value:function(e){var t=this;if("boolean"!=typeof e||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){var n=[];return this.isInPictureInPicture()&&n.push(this.exitPictureInPicture()),this.isFullscreen()&&n.push(this.exitFullscreen()),this.audioPosterMode()&&n.push(this.audioPosterMode(!1)),Promise.all(n).then(function(){return t.enableAudioOnlyUI_()})}return Promise.resolve().then(function(){return t.disableAudioOnlyUI_()})}},{key:"enablePosterModeUI_",value:function(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}},{key:"disablePosterModeUI_",value:function(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}},{key:"audioPosterMode",value:function(e){var t=this;return"boolean"!=typeof e||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(function(){t.enablePosterModeUI_()}):Promise.resolve().then(function(){t.enablePosterModeUI_()}):Promise.resolve().then(function(){t.disablePosterModeUI_()}))}},{key:"addTextTrack",value:function(e,t,n){if(this.tech_)return this.tech_.addTextTrack(e,t,n)}},{key:"addRemoteTextTrack",value:function(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}},{key:"removeRemoteTextTrack",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.track;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}},{key:"getVideoPlaybackQuality",value:function(){return this.techGet_("getVideoPlaybackQuality")}},{key:"videoWidth",value:function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}},{key:"videoHeight",value:function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}},{key:"language",value:function(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),gr(this)&&this.trigger("languagechange"))}},{key:"languages",value:function(){return Ln(t.prototype.options_.languages,this.languages_)}},{key:"toJSON",value:function(){var e=Ln(this.options_),t=e.tracks;e.tracks=[];for(var n=0;n<t.length;n++){var i=t[n];(i=Ln(i)).player=void 0,e.tracks[n]=i}return e}},{key:"createModal",value:function(e,t){var n=this;(t=t||{}).content=e||"";var i=new Qr(this,t);return this.addChild(i),i.on("dispose",function(){n.removeChild(i)}),i.open(),i}},{key:"updateCurrentBreakpoint_",value:function(){if(this.responsive())for(var e=this.currentBreakpoint(),t=this.currentWidth(),n=0;n<Uo.length;n++){var i=Uo[n];if(t<=this.breakpoints_[i]){if(e===i)return;e&&this.removeClass(Bo[e]),this.addClass(Bo[i]),this.breakpoint_=i;break}}}},{key:"removeCurrentBreakpoint_",value:function(){var e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)}},{key:"breakpoints",value:function(e){return void 0===e||(this.removeCurrentBreakpoint_(),this.breakpoints_=Object.assign({},Fo,e),this.updateCurrentBreakpoint_()),Object.assign(this.breakpoints_)}},{key:"responsive",value: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}},{key:"currentBreakpoint",value:function(){return this.breakpoint_}},{key:"currentBreakpointClass",value:function(){return Bo[this.breakpoint_]||""}},{key:"loadMedia",value:function(e,t){var n=this;if(e&&"object"===hn(e)){var i=this.crossOrigin();this.reset(),this.cache_.media=Ln(e);var r=this.cache_.media,a=r.artist,s=r.artwork,o=r.description,u=r.poster,l=r.src,c=r.textTracks,d=r.title;!s&&u&&(this.cache_.media.artwork=[{src:u,type:Ua(u)}]),i&&this.crossOrigin(i),l&&this.src(l),u&&this.poster(u),Array.isArray(c)&&c.forEac
2h(function(e){return n.addRemoteTextTrack(e,!1)}),this.titleBar&&this.titleBar.update({title:d,description:o||a||""}),this.ready(t)}}},{key:"getMedia",value: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:Ua(t.poster)}]),t}return Ln(this.cache_.media)}},{key:"debug",value: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)}},{key:"playbackRates",value: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"))}}],[{key:"getTagSettings",value:function(e){var t={sources:[],tracks:[]},n=Ti(e),i=n["data-setup"];if(gi(e,"vjs-fill")&&(n.fill=!0),gi(e,"vjs-fluid")&&(n.fluid=!0),null!==i)try{Object.assign(n,JSON.parse(i||"{}"))}catch(e){wn.error("data-setup",e)}if(Object.assign(t,n),e.hasChildNodes())for(var r=e.childNodes,a=0,s=r.length;a<s;a++){var o=r[a],u=o.nodeName.toLowerCase();"source"===u?t.sources.push(Ti(o)):"track"===u&&t.tracks.push(Ti(o))}return t}}])}(Pr);qo.prototype.videoTracks=function(){},qo.prototype.audioTracks=function(){},qo.prototype.textTracks=function(){},qo.prototype.remoteTextTracks=function(){},qo.prototype.remoteTextTrackEls=function(){},wa.names.forEach(function(e){var t=wa[e];qo.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}}),qo.prototype.crossorigin=qo.prototype.crossOrigin,qo.players={};var jo=u()().navigator;qo.prototype.options_={techOrder:Ea.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:jo&&(jo.languages&&jo.languages[0]||jo.userLanguage||jo.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,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1,disableSeekWhileScrubbingOnMobile:!1,disableSeekWhileScrubbingOnSTV:!1},Mo.forEach(function(e){qo.prototype["handleTech".concat(xr(e),"_")]=function(){return this.trigger(e)}}),Pr.registerComponent("Player",qo);var Ho="plugin",Vo="activePlugins_",zo={},Wo=function(e){return zo.hasOwnProperty(e)},Go=function(e){return Wo(e)?zo[e]:void 0},Xo=function(e,t){e[Vo]=e[Vo]||{},e[Vo][t]=!0},Ko=function(e,t,n){var i=(n?"before":"")+"pluginsetup";e.trigger(i,t),e.trigger(i+":"+t.name,t)},Yo=function(e,t){return t.prototype.name=e,function(){Ko(this,{name:e,plugin:t,instance:null},!0);for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];var a=Vt(t,[this].concat(i));return this[e]=function(){return a},Ko(this,a.getEventHash()),a}},Qo=function(){function e(t){if(rn(this,e),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)),wr(this),delete this.trigger,Cr(this,this.constructor.defaultState),Xo(t,this.name),this.dispose=this.dispose.bind(this),t.on("dispose",this.dispose)}return sn(e,[{key:"version",value:function(){return this.constructor.VERSION}},{key:"getEventHash",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}},{key:"trigger",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return rr(this.eventBusEl_,e,this.getEventHash(t))}},{key:"handleStateChanged",value:function(e){}},{key:"dispose",value:function(){var e=this.name,t=this.player;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[Vo][e]=!1,this.player=this.state=null,t[e]=Yo(e,zo[e])}}],[{key:"isBasic",value:function(t){var n="string"==typeof t?Go(t):t;return"function"==typeof n&&!e.prototype.isPrototypeOf(n.prototype)}},{key:"registerPlugin",value:function(t,n){if("string"!=typeof t)throw new Error('Illegal plugin name, "'.concat(t,'", must be a string, was ').concat(hn(t),"."));if(Wo(t))wn.warn('A plugin named "'.concat(t,'" already exists. You may want to avoid re-registering plugins!'));else if(qo.prototype.hasOwnProperty(t))throw new Error('Illegal plugin name, "'.concat(t,'", cannot share a name with an existing player method!'));if("function"!=typeof n)throw new Error('Illegal plugin for "'.concat(t,'", must be a function, was ').concat(hn(n),"."));return zo[t]=n,t!==Ho&&(e.isBasic(n)?qo.prototype[t]=function(e,t){var n=function(){Ko(this,{name:e,plugin:t,instance:null},!0);var n=t.apply(this,arguments);return Xo(this,e),Ko(this,{name:e,plugin:t,instance:n}),n};return Object.keys(t).forEach(function(e){n[e]=t[e]}),n}(t,n):qo.prototype[t]=Yo(t,n)),n}},{key:"deregisterPlugin",value:function(e){if(e===Ho)throw new Error("Cannot de-register base plugin.");Wo(e)&&(delete zo[e],delete qo.prototype[e])}},{key:"getPlugins",value:function(){var e;return(arguments.length>
20&&void 0!==arguments[0]?arguments[0]:Object.keys(zo)).forEach(function(t){var n=Go(t);n&&((e=e||{})[t]=n)}),e}},{key:"getPluginVersion",value:function(e){var t=Go(e);return t&&t.VERSION||""}}])}();function $o(e,t,n,i){return function(e,t){var n=!1;return function(){n||wn.warn(e),n=!0;for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return t.apply(this,r)}}("".concat(t," is deprecated and will be removed in ").concat(e,".0; please use ").concat(n," instead."),i)}Qo.getPlugin=Go,Qo.BASE_PLUGIN_NAME=Ho,Qo.registerPlugin(Ho,Qo),qo.prototype.usingPlugin=function(e){return!!this[Vo]&&!0===this[Vo][e]},qo.prototype.hasPlugin=function(e){return!!Wo(e)};var Jo=function(e){return 0===e.indexOf("#")?e.slice(1):e};function Zo(e,t,n){var i=Zo.getPlayer(e);if(i)return t&&wn.warn('Player "'.concat(e,'" is already initialised. Options will not be applied.')),n&&i.ready(n),i;var r="string"==typeof e?Ni("#"+Jo(e)):e;if(!ci(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");var a="getRootNode"in r&&r.getRootNode()instanceof u()().ShadowRoot?r.getRootNode():r.ownerDocument.body;r.ownerDocument.defaultView&&a.contains(r)||wn.warn("The element supplied is not included in the DOM"),!0===(t=t||{}).restoreEl&&(t.restoreEl=(r.parentNode&&r.parentNode.hasAttribute&&r.parentNode.hasAttribute("data-vjs-player")?r.parentNode:r).cloneNode(!0)),gn("beforesetup").forEach(function(e){var n=e(r,Ln(t));Dn(n)&&!Array.isArray(n)?t=Ln(t,n):wn.error("please return an object in beforesetup hooks")});var s=Pr.getComponent("Player");return i=new s(r,t,n),gn("setup").forEach(function(e){return e(i)}),i}if(Zo.hooks_=mn,Zo.hooks=gn,Zo.hook=function(e,t){gn(e,t)},Zo.hookOnce=function(e,t){gn(e,[].concat(t).map(function(t){var n=function(){return vn(e,n),t.apply(void 0,arguments)};return n}))},Zo.removeHook=vn,!0!==u()().VIDEOJS_NO_DYNAMIC_STYLE&&li()){var eu=Ni(".vjs-styles-defaults");if(!eu){eu=Xi("vjs-styles-defaults");var tu=Ni("head");tu&&tu.insertBefore(eu,tu.firstChild),Ki(eu,"\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    ")}}zi(1,Zo),Zo.VERSION=fn,Zo.options=qo.prototype.options_,Zo.getPlayers=function(){return qo.players},Zo.getPlayer=function(e){var t,n=qo.players;if("string"==typeof e){var i=Jo(e),r=n[i];if(r)return r;t=Ni("#"+i)}else t=e;if(ci(t)){var a=t,s=a.player,o=a.playerId;if(s||n[o])return s||n[o]}},Zo.getAllPlayers=function(){return Object.keys(qo.players).map(function(e){return qo.players[e]}).filter(Boolean)},Zo.players=qo.players,Zo.getComponent=Pr.getComponent,Zo.registerComponent=function(e,t){return Ea.isTech(t)&&wn.warn("The ".concat(e," tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)")),Pr.registerComponent.call(Pr,e,t)},Zo.getTech=Ea.getTech,Zo.registerTech=Ea.registerTech,Zo.use=function(e,t){Ca[e]=Ca[e]||[],Ca[e].push(t)},Object.defineProperty(Zo,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(Zo.middleware,"TERMINATOR",{value:xa,writeable:!1,enumerable:!0}),Zo.browser=oi,Zo.obj=Un,Zo.mergeOptions=$o(9,"videojs.mergeOptions","videojs.obj.merge",Ln),Zo.defineLazyProperty=$o(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",Rn),Zo.bind=$o(9,"videojs.bind","native Function.prototype.bind",cr),Zo.registerPlugin=Qo.registerPlugin,Zo.deregisterPlugin=Qo.deregisterPlugin,Zo.plugin=function(e,t){return wn.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Qo.registerPlugin(e,t)},Zo.getPlugins=Qo.getPlugins,Zo.getPlugin=Qo.getPlugin,Zo.getPluginVersion=Qo.getPluginVersion,Zo.addLanguage=function(e,t){return e=(""+e).toLowerCase(),Zo.options.languages=Ln(Zo.options.languages,Wt({},e,t)),Zo.options.languages[e]},Zo.log=wn,Zo.createLogger=En,Zo.time=qr,Zo.createTimeRange=$o(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Rr),Zo.createTimeRanges=$o(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Rr),Zo.formatTime=$o(9,"videojs.formatTime","videojs.time.formatTime",Fr),Zo.setFormatTime=$o(9,"videojs.setFormatTime","videojs.time.setFormatTime",Ur),Zo.resetFormatTime=$o(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",Br),Zo.parseUrl=$o(9,"videojs.parseUrl","videojs.url.parseUrl",da),Zo.isCrossOrigin=$o(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",fa),Zo.EventTarget=fr,Zo.any=sr,Zo.on=nr,Zo.one=ar,Zo.off=ir,Zo.trigger=rr,Zo.xhr=d()(),Zo.TrackList=$r,Zo.TextTrack=ya,Zo.TextTrackList=ia,Zo.AudioTrack=_a,Zo.AudioTrackList=ea,Zo.VideoTrack=ba,Zo.VideoTrackList=na,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(function(e){Zo[e]=function(){return wn.warn("videojs.".concat(e,"() is deprecated; use videojs.dom.").concat(e,"() instead")),ji[e].apply(null,arguments)}}),Zo.computedStyle=$o(9,"videojs.computedStyle","videojs.dom.computedStyle",Bi),Zo.dom=ji,Zo.fn=pr,Zo.num=hs,Zo.str=Dr,Zo.url=ma,Zo.Error={NetworkBadStatus:"networkbadstatus",NetworkRequestFailed:"networkrequestfailed",NetworkRequestAborted:"networkrequestaborted",NetworkRequestTimeout:"networkrequesttimeout",NetworkBodyParserFailed:"networkbodyparserfailed",StreamingHlsPlaylistParserError:"streaminghlsplaylistparsererror",StreamingDashManifestParserError:"streamingdashmanifestparsererror",StreamingContentSteeringParserError:"streamingcontentsteeringparsererror",StreamingVttParserError:"streamingvttparsererror",StreamingFailedToSelectNextSegment:"streamingfailedtoselectnextsegment",StreamingFailedToDecryptSegment:"streamingfailedtodecryptsegment",StreamingFailedToTransmuxSegment:"streamingfailedtotransmuxsegment",StreamingFailedToAppendSegment:"streamingfailedtoappendsegment",StreamingCodecsChangeError:"streamingcodecschangeerror"};var nu=sn(function e(t){rn(this,e);var n=this;return n.id=t.id,n.label=n.id,n.width=t.width,n.height=t.height,n.bitrate=t.bandwidth,n.frameRate=t.frameRate,n.enabled_=t.enabled,Object.defineProperty(n,"enabled",{get:function(){return n.enabled_()},set:function(e){n.enabled_(e)}}),n}),iu=function(e){function t(){var e;rn(this,t);var n=e=Kt(this,t);return n.levels_=[],n.selectedIndex_=-1,Object.defineProperty(n,"selectedIndex",{get:function(){return n.selectedIndex_}}),Object.defineProperty(n,"length",{get:function(){return n.levels_.length}}),n[Symbol.iterator]=function(){return n.levels_.values()},Yt(e,n)}return Gt(t,e),sn(t,[{key:"addQualityLevel",value:function(e){var t=this.getQualityLevelById(e.id);if(t)return t;var n=this.levels_.length;return t=new nu(e),""+n in this||Object.defineProperty(this,n,{get:function(){return this.levels_[n]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}},{key:"removeQualityLevel",value:function(e){for(var t=null,n=0,i=this.length;n<i;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}},{key:"getQualityLevelById",value:function(e){for(var t=0,n=this.length;t<n;t++){var i=this[t];if(i.id===e)return i}return null}},{key:"dispose",value:function(){this.selectedIndex_=-1,this.levels_.length=0}}])}(Zo.EventTarget);for(var ru in iu.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"},iu.prototype.allowedEvents_)iu.prototype["on"+ru]=null;var au="4.1.0",su=function(e){return t=this,Zo.obj.merge({},e),n=t.qualityLevels,i=new iu,r=function(){i.dispose(),t.qualityLevels=n,t.off("dispose",r)},t.on("dispose",r),t.qualityLevels=function(){return i},t.qualityLevels.VERSION=au,i;var t,n,i,r};Zo.registerPlugin("qualityLevels",su),su.VERSION=au;var ou=g,uu=function(e,t){return t&&t.responseURL&&e!==t.responseURL?t.responseURL:e},lu=function(e){return Zo.log.debug?Zo.log.debug.bind(Zo,"VHS:","".concat(e," >")):function(){}};function cu(){for(var e=Zo.obj||Zo,t=e.merge||e.mergeOptions,n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return t.apply(e,i)}function du(){for(var e=Zo.time||Zo,t=e.createTimeRanges||e.createTimeRanges,n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return t.apply(e,i)}var hu=1/30,pu=.1,fu=function(e,t){var n,i=[];if(e&&e.length)for(n=0;n<e.length;n++)t(e.start(n),e.end(n))&&i.push([e.start(n),e.end(n)]);return du(i)},mu=function(e,t){return fu(e,function(e,n){return e-pu<=t&&n+pu>=t})},gu=function(e,t){return fu(e,function(e){return e-hu>=t})},vu=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(", ")},yu=function(e){for(var t=[],n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t},_u=function(e){if(e&&e.length&&e.end)return e.end(e.length-1)},bu=function(e,t){var n=0;if(!e||!e.length)return n;for(var i=0;i<e.length;i++){var r=e.start(i),a=e.end(i);t>a||(n+=t>r&&t<=a?a-t:a-r)}return n},Tu=function(e,t){if(!t.preload)return t.duration;var n=0;
2return(t.parts||[]).forEach(function(e){n+=e.duration}),(t.preloadHints||[]).forEach(function(t){"PART"===t.type&&(n+=e.partTargetDuration)}),n},ku=function(e){return(e.segments||[]).reduce(function(e,t,n){return t.parts?t.parts.forEach(function(i,r){e.push({duration:i.duration,segmentIndex:n,partIndex:r,part:i,segment:t})}):e.push({duration:t.duration,segmentIndex:n,partIndex:null,segment:t,part:null}),e},[])},Su=function(e){var t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},wu=function(e){var t=e.preloadSegment;if(t){var n=t.parts,i=(t.preloadHints||[]).reduce(function(e,t){return e+("PART"===t.type?1:0)},0);return i+=n&&n.length?n.length:0}},Eu=function(e,t){if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;var n=Su(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},Cu=function(e,t,n){if(void 0===t&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;var i=function(e,t){var n=0,i=t-e.mediaSequence,r=e.segments[i];if(r){if(void 0!==r.start)return{result:r.start,precise:!0};if(void 0!==r.end)return{result:r.end-r.duration,precise:!0}}for(;i--;){if(void 0!==(r=e.segments[i]).end)return{result:n+r.end,precise:!0};if(n+=Tu(e,r),void 0!==r.start)return{result:n+r.start,precise:!0}}return{result:n,precise:!1}}(e,t);if(i.precise)return i.result;var r=function(e,t){for(var n,i=0,r=t-e.mediaSequence;r<e.segments.length;r++){if(void 0!==(n=e.segments[r]).start)return{result:n.start-i,precise:!0};if(i+=Tu(e,n),void 0!==n.end)return{result:n.end-i,precise:!0}}return{result:-1,precise:!1}}(e,t);return r.precise?r.result:i.result+n},Iu=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 u()()[1/0]}return Cu(e,t,n)},xu=function(e){var t=e.defaultDuration,n=e.durationList,i=e.startIndex,r=e.endIndex,a=0;if(i>r){var s=[r,i];i=s[0],r=s[1]}if(i<0){for(var o=i;o<Math.min(0,r);o++)a+=t;i=0}for(var u=i;u<r;u++)a+=n[u].duration;return a},Au=function(e,t,n,i){if(!e||!e.segments)return null;if(e.endList)return Iu(e);if(null===t)return null;t=t||0;var r=Cu(e,e.mediaSequence+e.segments.length,t);return n&&(r-=i="number"==typeof i?i:Eu(null,e)),Math.max(0,r)},Du=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},Pu=function(e){return e.excludeUntil&&e.excludeUntil===1/0},Lu=function(e){var t=Du(e);return!e.disabled&&!t},Ou=function(e,t){return t.attributes&&t.attributes[e]},Ru=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!!Lu(e)&&(e.attributes.BANDWIDTH||0)<n}).length},Mu=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))))},Nu=function(e,t){var n=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{},i=!1;for(var r in n){for(var a in n[r])if(i=t(n[r][a]))break;if(i)break}return!!i},Uu=function(e){if(!e||!e.playlists||!e.playlists.length)return Nu(e,function(e){return e.playlists&&e.playlists.length||e.uri});for(var t,n=function(){var t=e.playlists[i],n=t.attributes&&t.attributes.CODECS;return n&&n.split(",").every(function(e){return W(e)})||Nu(e,function(e){return Mu(t,e)})?0:{v:!1}},i=0;i<e.playlists.length;i++)if(0!==(t=n())&&t)return t.v;return!0},Bu={liveEdgeDelay:Eu,duration:Iu,seekable:function(e,t,n){var i=t||0,r=Au(e,t,!0,n);return null===r?du():(r<i&&(r=i),du(i,r))},getMediaInfoForTime:function(e){for(var t=e.playlist,n=e.currentTime,i=e.startingSegmentIndex,r=e.startingPartIndex,a=e.startTime,s=e.exactManifestTimings,o=n-a,u=ku(t),l=0,c=0;c<u.length;c++){var d=u[c];if(i===d.segmentIndex&&("number"!=typeof r||"number"!=typeof d.partIndex||r===d.partIndex)){l=c;break}}if(o<0){if(l>0)for(var h=l-1;h>=0;h--){var p=u[h];
2if(o+=p.duration,s){if(o<0)continue}else if(o+hu<=0)continue;return{partIndex:p.partIndex,segmentIndex:p.segmentIndex,startTime:a-xu({defaultDuration:t.targetDuration,durationList:u,startIndex:l,endIndex:h})}}return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:n}}if(l<0){for(var f=l;f<0;f++)if((o-=t.targetDuration)<0)return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:n};l=0}for(var m=l;m<u.length;m++){var g=u[m];o-=g.duration;var v=g.duration>hu;if(!(0===o)&&!(v&&o+hu>=0)||m===u.length-1){if(s){if(o>0)continue}else if(o-hu>=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:a+xu({defaultDuration:t.targetDuration,durationList:u,startIndex:l,endIndex:m})}}}return{segmentIndex:u[u.length-1].segmentIndex,partIndex:u[u.length-1].partIndex,startTime:n}},isEnabled:Lu,isDisabled:function(e){return e.disabled},isExcluded:Du,isIncompatible:Pu,playlistEnd:Au,isAes:function(e){for(var t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},hasAttribute:Ou,estimateSegmentRequestTime:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return Ou("BANDWIDTH",n)?(e*n.attributes.BANDWIDTH-8*i)/t:NaN},isLowestEnabledRendition:Ru,isAudioOnly:Uu,playlistMatch:Mu,segmentDurationWithParts:Tu},Fu=Zo.log,qu=function(e,t){return"".concat(e,"-").concat(t)},ju=function(e,t,n){return"placeholder-uri-".concat(e,"-").concat(t,"-").concat(n)},Hu=function(e,t){e.mediaGroups&&["AUDIO","SUBTITLES"].forEach(function(n){if(e.mediaGroups[n])for(var i in e.mediaGroups[n])for(var r in e.mediaGroups[n][i]){var a=e.mediaGroups[n][i][r];t(a,n,i,r)}})},Vu=function(e){var t=e.playlist,n=e.uri,i=e.id;t.id=i,t.playlistErrors_=0,n&&(t.uri=n),t.attributes=t.attributes||{}},zu=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ju;e.uri=t;
2for(var i=0;i<e.playlists.length;i++)if(!e.playlists[i].uri){var r="placeholder-uri-".concat(i);e.playlists[i].uri=r}var a=Uu(e);Hu(e,function(t,i,r,s){if(!t.playlists||!t.playlists.length){if(a&&"AUDIO"===i&&!t.uri)for(var o=0;o<e.playlists.length;o++){var u=e.playlists[o];if(u.attributes&&u.attributes.AUDIO&&u.attributes.AUDIO===r)return}t.playlists=[f({},t)]}t.playlists.forEach(function(t,a){var o=n(i,r,s,t),u=qu(a,o);t.uri?t.resolvedUri=t.resolvedUri||ou(e.uri,t.uri):(t.uri=0===a?o:u,t.resolvedUri=t.uri),t.id=t.id||u,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];Vu({playlist:n,id:qu(t,n.uri)}),n.resolvedUri=ou(e.uri,n.uri),e.playlists[n.id]=n,e.playlists[n.uri]=n,n.attributes.BANDWIDTH||Fu.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}}(e),function(e){Hu(e,function(t){t.uri&&(t.resolvedUri=ou(e.uri,t.uri))})}(e)},Wu=function(){return sn(function e(){rn(this,e),this.offset_=null,this.pendingDateRanges_=new Map,this.processedDateRanges_=new Map},[{key:"setOffset",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(null===this.offset_&&e.length){var t=en(e,1)[0];void 0!==t.programDateTime&&(this.offset_=t.programDateTime/1e3)}}},{key:"setPendingDateRanges",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(e.length){var t=en(e,1)[0].startDate.getTime();this.trimProcessedDateRanges_(t),this.pendingDateRanges_=e.reduce(function(e,t){return e.set(t.id,t),e},new Map)}}},{key:"processDateRange",value:function(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}},{key:"getDateRangesToProcess",value:function(){var e=this;if(null===this.offset_)return[];var t={},n=[];this.pendingDateRanges_.forEach(function(i,r){if(!e.processedDateRanges_.has(r)&&(i.startTime=i.startDate.getTime()/1e3-e.offset_,i.processDateRange=function(){return e.processDateRange(i)},n.push(i),i.class))if(t[i.class]){var a=t[i.class].push(i);i.classListIndex=a-1}else t[i.class]=[i],i.classListIndex=0});for(var i=0,r=n;i<r.length;i++){var a=r[i],s=t[a.class]||[];a.endDate?a.endTime=a.endDate.getTime()/1e3-this.offset_:a.endOnNext&&s[a.classListIndex+1]?a.endTime=s[a.classListIndex+1].startTime:a.duration?a.endTime=a.startTime+a.duration:a.plannedDuration?a.endTime=a.startTime+a.plannedDuration:a.endTime=a.startTime}return n}},{key:"trimProcessedDateRanges_",value:function(e){var t=this;new Map(this.processedDateRanges_).forEach(function(n,i){n.startDate.getTime()<e&&t.processedDateRanges_.delete(i)})}}])}(),Gu=function(e){var t=e.requestType,n=e.request,i=e.error,r=e.parseFailure,a=n.status<200||n.status>299,s=n.status>=400&&n.status<=499,o={uri:n.uri,requestType:t},u=a&&!s||r;if(i&&s)o.error=f({},i),o.errorType=Zo.Error.NetworkRequestFailed;else if(n.aborted)o.errorType=Zo.Error.NetworkRequestAborted;else if(n.timedout)o.errorType=Zo.Error.NetworkRequestTimeout;else if(u){var l=r?Zo.Error.NetworkBodyParserFailed:Zo.Error.NetworkBadStatus;o.errorType=l,o.status=n.status,o.headers=n.headers}return o},Xu=lu("CodecUtils"),Ku=function(e){var t=e.attributes||{};if(t.CODECS)return z(t.CODECS)},Yu=function(e,t){var n=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&n.AUDIO&&e.mediaGroups.AUDIO[n.AUDIO]},Qu=function(e){var t={};return e.forEach(function(e){var n=e.mediaType,i=e.type,r=e.details;t[n]=t[n]||[],t[n].push(V("".concat(i).concat(r)))}),Object.keys(t).forEach(function(e){if(t[e].length>1)return Xu("multiple ".concat(e," codecs found as attributes: ").concat(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},$u=function(e){var t=0;return e.audio&&t++,e.video&&t++,t},Ju=function(e,t){var n=t.attributes||{},i=Qu(Ku(t)||[]);if(Yu(e,t)&&!i.audio&&!function(e,t){if(!Yu(e,t))return!0;var n=t.attributes||{},i=e.mediaGroups.AUDIO[n.AUDIO];for(var r in i)if(!i[r].uri&&!i[r].playlists)return!0;return!1}(e,t)){var r=Qu(function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var n=e.mediaGroups.AUDIO[t];if(!n)return null;for(var i in n){var r=n[i];if(r.default&&r.playlists)return z(r.playlists[0].attributes.CODECS)}return null}(e,n.AUDIO)||[]);r.audio&&(i.audio=r.audio)}return i},Zu=Zo.EventTarget,el=function(e,t){if(!e)return t;var n=cu(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 i=0;i<t.parts.length;
2i++)e.parts&&e.parts[i]&&(n.parts[i]=cu(e.parts[i],t.parts[i]));return!e.skipped&&t.skipped&&(n.skipped=!1),e.preload&&!t.preload&&(n.preload=!1),n},tl=function(e,t){!e.resolvedUri&&e.uri&&(e.resolvedUri=ou(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=ou(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=ou(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=ou(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach(function(e){e.resolvedUri||(e.resolvedUri=ou(t,e.uri))}),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach(function(e){e.resolvedUri||(e.resolvedUri=ou(t,e.uri))})},nl=function(e){var t=e.segments||[],n=e.preloadSegment;if(n&&n.parts&&n.parts.length){if(n.preloadHints)for(var i=0;i<n.preloadHints.length;i++)if("MAP"===n.preloadHints[i].type)return t;n.duration=e.targetDuration,n.preload=!0,t.push(n)}return t},il=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},rl=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:il,i=cu(e,{}),r=i.playlists[t.id];if(!r)return null;if(n(r,t))return null;t.segments=nl(t);var a=cu(r,t);if(a.preloadSegment&&!t.preloadSegment&&delete a.preloadSegment,r.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 i=e.slice(),r=t.slice();n=n||0;for(var a,s=[],o=0;o<r.length;o++){var u=i[o+n],l=r[o];u?(a=u.map||a,s.push(el(u,l))):(a&&!l.map&&(l.map=a),s.push(l))}return s}(r.segments,t.segments,t.mediaSequence-r.mediaSequence)}a.segments.forEach(function(e){tl(e,a.resolvedUri)});for(var o=0;o<i.playlists.length;o++)i.playlists[o].id===t.id&&(i.playlists[o]=a);return i.playlists[t.id]=a,i.playlists[t.uri]=a,Hu(e,function(e,n,i,r){if(e.playlists)for(var s=0;s<e.playlists.length;s++)t.id===e.playlists[s].id&&(e.playlists[s]=a)}),i},al=function(e,t){var n=e.segments||[],i=n[n.length-1],r=i&&i.parts&&i.parts[i.parts.length-1],a=r&&r.duration||i&&i.duration;return t&&a?1e3*a:500*(e.partTargetDuration||e.targetDuration||10)},sl=function(e,t,n){if(e){var i=[];return e.forEach(function(e){if(e.attributes){var t=e.attributes,n=t.BANDWIDTH,r=t.RESOLUTION,a=t.CODECS;i.push({id:e.id,bandwidth:n,resolution:r,codecs:a})}}),{type:t,isLive:n,renditions:i}}},ol=function(e){function t(e,n){var i,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(rn(this,t),i=Kt(this,t),!e)throw new Error("A non-empty playlist URL or object is required");i.logger_=lu("PlaylistLoader");var a=r.withCredentials,s=void 0!==a&&a;i.src=e,i.vhs_=n,i.withCredentials=s,i.addDateRangesToTextTrack_=r.addDateRangesToTextTrack;var o=n.options_;return i.customTagParsers=o&&o.customTagParsers||[],i.customTagMappers=o&&o.customTagMappers||[],i.llhls=o&&o.llhls,i.dateRangesStorage_=new Wu,i.state="HAVE_NOTHING",i.handleMediaupdatetimeout_=i.handleMediaupdatetimeout_.bind(i),i.on("mediaupdatetimeout",i.handleMediaupdatetimeout_),i.on("loadedplaylist",i.handleLoadedPlaylist_.bind(i)),i}return Gt(t,e),sn(t,[{key:"handleLoadedPlaylist_",value:function(){var e=this.media();if(e){this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);var t=this.dateRangesStorage_.getDateRangesToProcess();t.length&&this.addDateRangesToTextTrack_&&this.addDateRangesToTextTrack_(t)}}},{key:"handleMediaupdatetimeout_",value:function(){var e=this;if("HAVE_METADATA"===this.state){var t=this.media(),n=ou(this.main.uri,t.uri);this.llhls&&(n=function(e,t){if(t.endList||!t.serverControl)return e;var n={};if(t.serverControl.canBlockReload){var i=t.preloadSegment,r=t.mediaSequence+t.segments.length;if(i){var a=i.parts||[],s=wu(t)-1;s>-1&&s!==a.length-1&&(n._HLS_part=s),(s>-1||a.length)&&r--}n._HLS_msn=r}if(t.serverControl&&t.serverControl.canSkipUntil&&(n._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(n).length){var o=new(u()().URL)(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(e){n.hasOwnProperty(e)&&o.searchParams.set(e,n[e])}),e=o.toString()}return e}(n,t)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:n,withCredentials:this.withCredentials,requestType:"hls-playlist"},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})})}}},{key:"playlistRequestError",value:function(e,t,n){var i=t.uri,r=t.id;this.request=null,n&&(this.state=n),this.error={playlist:this.main.playlists[r],status:e.status,message:"HLS playlist request error at URL: ".concat(i,"."),responseText:e.responseText,code:e.status>=500?4:2,metadata:Gu({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}},{key:"parseManifest_",value:function(e){var t=this,n=e.url,i=e.manifestString;try{var r=function(e){var t=e.onwarn,n=e.oninfo,i=e.manifestString,r=e.customTagParsers,a=void 0===r?[]:r,s=e.customTagMappers,o=void 0===s?[]:s,u=e.llhls,l=new F;t&&l.on("warn",t),n&&l.on("info",n),a.forEach(function(e){return l.addParser(e)}),o.forEach(function(e){return l.addTagMapper(e)}),l.push(i),l.end();var c=l.manifest;if(u||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(e){c.hasOwnProperty(e)&&delete c[e]}
2),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({message:"manifest has no targetDuration defaulting to ".concat(d)}),c.targetDuration=d}var h=Su(c);if(h.length&&!c.partTargetDuration){var p=h.reduce(function(e,t){return Math.max(e,t.duration)},0);t&&(t({message:"manifest has no partTargetDuration defaulting to ".concat(p)}),Fu.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=p}return c}({onwarn:function(e){var i=e.message;return t.logger_("m3u8-parser warn for ".concat(n,": ").concat(i))},oninfo:function(e){var i=e.message;return t.logger_("m3u8-parser info for ".concat(n,": ").concat(i))},manifestString:i,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls});return r.playlists&&r.playlists.length?(this.excludeAudioOnlyVariants(r.playlists),r):r}catch(e){this.error=e,this.error.metadata={errorType:Zo.Error.StreamingHlsPlaylistParserError,error:e}}}},{key:"excludeAudioOnlyVariants",value:function(e){var t=function(e){var t=(e.attributes||{}).RESOLUTION||{},n=t.width,i=t.height;if(n&&i)return!0;var r=Ku(e)||[],a=Qu(r);return Boolean(a.video)};e.some(t)&&e.forEach(function(e){t(e)||(e.excludeUntil=1/0)})}},{key:"haveMetadata",value:function(e){var t=e.playlistString,n=e.playlistObject,i=e.url,r=e.id;this.request=null,this.state="HAVE_METADATA";var a={playlistInfo:{type:"media",uri:i}};this.trigger({type:"playlistparsestart",metadata:a});var s=n||this.parseManifest_({url:i,manifestString:t});s.lastRequest=Date.now(),Vu({playlist:s,uri:i,id:r});var o=rl(this.main,s);this.targetDuration=s.partTargetDuration||s.targetDuration,this.pendingMedia_=null,o?(this.main=o,this.media_=this.main.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(al(this.media(),!!o)),a.parsedPlaylist=sl(this.main.playlists,a.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:a}),this.trigger("loadedplaylist")}},{key:"dispose",value:function(){this.trigger("dispose"),this.stopRequest(),u()().clearTimeout(this.mediaUpdateTimeout),u()().clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new Wu,this.off()}},{key:"stopRequest",value:function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}},{key:"media",value: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.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(u()().clearTimeout(this.finalRenditionTimeout),t){var i=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=u()().setTimeout(this.media.bind(this,e,!1),i)}else{var r=this.state,a=!this.media_||e.id!==this.media_.id,s=this.main.playlists[e.id];if(s&&s.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(a&&(this.trigger("mediachanging"),"HAVE_MAIN_MANIFEST"===r?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(al(e,!0)),a){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;var o={playlistInfo:{type:"media",uri:e.uri}};this.trigger({type:"playlistrequeststart",metadata:o}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},function(t,i){if(n.request){if(e.lastRequest=Date.now(),e.resolvedUri=uu(e.resolvedUri,i),t)return n.playlistRequestError(n.request,e,r);n.trigger({type:"playlistrequestcomplete",metadata:o}),n.haveMetadata({playlistString:i.responseText,url:e.uri,id:e.id}),"HAVE_MAIN_MANIFEST"===r?n.trigger("loadedmetadata"):n.trigger("mediachange")}})}}}},{key:"pause",value:function(){this.mediaUpdateTimeout&&(u()().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")}},{key:"load",value:function(e){var t=this;this.mediaUpdateTimeout&&(u()().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var n=this.media();if(e){var i=n?(n.partTargetDuration||n.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=u()().setTimeout(function(){t.mediaUpdateTimeout=null,t.load()},i)}else this.started?n&&!n.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}},{key:"updateMediaUpdateTimeout_",value:function(e){var t=this;this.mediaUpdateTimeout&&(u()().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=u()().setTimeout(function(){t.mediaUpdateTimeout=null,t.trigger("mediaupdatetimeout"),t.updateMediaUpdateTimeout_(e)},e))}},{key:"start",value:function(){var e=this;if(this.started=!0,"object"===hn(this.src))return this.src.uri||(this.src.uri=u()().location.href),this.src.resolvedUri=this.src.uri,void setTimeout(function(){e.setupInitialPlaylist(e.src)},0);
2var t={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:t}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},function(n,i){if(e.request){if(e.request=null,n)return e.error={status:i.status,message:"HLS playlist request error at URL: ".concat(e.src,"."),responseText:i.responseText,code:2,metadata:Gu({requestType:i.requestType,request:i,error:n})},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");e.trigger({type:"playlistrequestcomplete",metadata:t}),e.src=uu(e.src,i),e.trigger({type:"playlistparsestart",metadata:t});var r=e.parseManifest_({manifestString:i.responseText,url:e.src});t.parsedPlaylist=sl(r.playlists,t.playlistInfo.type,!1),e.trigger({type:"playlistparsecomplete",metadata:t}),e.setupInitialPlaylist(r)}})}},{key:"srcUri",value:function(){return"string"==typeof this.src?this.src:this.src.uri}},{key:"setupInitialPlaylist",value:function(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists)return this.main=e,zu(this.main,this.srcUri()),e.playlists.forEac
2h(function(e){e.segments=nl(e),e.segments.forEach(function(t){tl(t,e.resolvedUri)})}),this.trigger("loadedplaylist"),void(this.request||this.media(this.main.playlists[0]));var t=this.srcUri()||u()().location.href;this.main=function(e,t){var n=qu(0,t),i={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:u()().location.href,resolvedUri:u()().location.href,playlists:[{uri:t,id:n,resolvedUri:t,attributes:{}}]};return i.playlists[n]=i.playlists[0],i.playlists[t]=i.playlists[0],i}(0,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}},{key:"updateOrDeleteClone",value:function(e,t){for(var n=this.main,i=e.ID,r=n.playlists.length;r--;){var a=n.playlists[r];if(a.attributes["PATHWAY-ID"]===i){var s=a.resolvedUri,o=a.id;if(t){var u=this.createCloneURI_(a.resolvedUri,e),l=qu(i,u),c=this.createCloneAttributes_(i,a.attributes),d=this.createClonePlaylist_(a,l,e,c);n.playlists[r]=d,n.playlists[l]=d,n.playlists[u]=d}else n.playlists.splice(r,1);delete n.playlists[o],delete n.playlists[s]}}this.updateOrDeleteCloneMedia(e,t)}},{key:"updateOrDeleteCloneMedia",value:function(e,t){var n=this.main,i=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(e){if(n.mediaGroups[e]&&n.mediaGroups[e][i])for(var t in n.mediaGroups[e])if(t===i){for(var r in n.mediaGroups[e][t]){n.mediaGroups[e][t][r].playlists.forEac
2h(function(e,t){var i=n.playlists[e.id],r=i.id,a=i.resolvedUri;delete n.playlists[r],delete n.playlists[a]})}delete n.mediaGroups[e][t]}}),t&&this.createClonedMediaGroups_(e)}},{key:"addClonePathway",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.main,i=n.playlists.length,r=this.createCloneURI_(t.resolvedUri,e),a=qu(e.ID,r),s=this.createCloneAttributes_(e.ID,t.attributes),o=this.createClonePlaylist_(t,a,e,s);n.playlists[i]=o,n.playlists[a]=o,n.playlists[r]=o,this.createClonedMediaGroups_(e)}},{key:"createClonedMediaGroups_",value:function(e){var t=this,n=e.ID,i=e["BASE-ID"],r=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(a){if(r.mediaGroups[a]&&!r.mediaGroups[a][n])for(var s in r.mediaGroups[a])if(s===i){r.mediaGroups[a][n]={};var o=function(i){var o=r.mediaGroups[a][s][i];r.mediaGroups[a][n][i]=f({},o);var u=r.mediaGroups[a][n][i],l=t.createCloneURI_(o.resolvedUri,e);u.resolvedUri=l,u.uri=l,u.playlists=[],o.playlists.forEach(function(s,o){var l=r.playlists[s.id],c=ju(a,n,i),d=qu(n,c);if(l&&!r.playlists[d]){var h=t.createClonePlaylist_(l,d,e),p=h.resolvedUri;r.playlists[d]=h,r.playlists[p]=h}u.playlists[o]=t.createClonePlaylist_(s,d,e)})};for(var u in r.mediaGroups[a][s])o(u)}})}},{key:"createClonePlaylist_",value:function(e,t,n,i){var r=this.createCloneURI_(e.resolvedUri,n),a={resolvedUri:r,uri:r,id:t};return e.segments&&(a.segments=[]),i&&(a.attributes=i),cu(e,a)}},{key:"createCloneURI_",value:function(e,t){var n=new URL(e);n.hostname=t["URI-REPLACEMENT"].HOST;for(var i=t["URI-REPLACEMENT"].PARAMS,r=0,a=Object.keys(i);r<a.length;r++){var s=a[r];n.searchParams.set(s,i[s])}return n.href}},{key:"createCloneAttributes_",value:function(e,t){var n=Wt({},"PATHWAY-ID",e);return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(i){t[i]&&(n[i]=e)}),n}},{key:"getKeyIdSet",value:function(e){var t=new Set;if(!e||!e.contentProtection)return t;for(var n in e.contentProtection)if(e.contentProtection[n]&&e.contentProtection[n].attributes&&e.contentProtection[n].attributes.keyId){var i=e.contentProtection[n].attributes.keyId;t.add(i.toLowerCase())}return t}}])}(Zu),ul=function(e,t,n,i){var r="arraybuffer"===e.responseType?e.response:e.responseText;!t&&r&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=r.byteLength||r.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&&(r||e.responseText)))),i(t,e)},ll=function(){var e=function e(t,n){t=cu({timeout:45e3},t);var i=e.beforeRequest||Zo.Vhs.xhr.beforeRequest,r=e._requestCallbackSet||Zo.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||Zo.Vhs.xhr._responseCallbackSet;i&&"function"==typeof i&&(Zo.log.warn("beforeRequest is deprecated, use onRequest instead."),r.add(i));var s=!0===Zo.Vhs.xhr.original?Zo.xhr:Zo.Vhs.xhr,o=function(e,t){if(e&&e.size){var n=t;return e.forEach(function(e){n=e(n)}),n}}(r,t);r.delete(i);var u=s(o||t,function(e,t){return function(e,t,n,i){e&&e.size&&e.forEach(function(e){e(t,n,i)})}(a,u,e,t),ul(u,e,t,n)}),l=u.abort;return u.abort=function(){return u.aborted=!0,l.apply(u,arguments)},u.uri=t.uri,u.requestType=t.requestType,u.requestTime=Date.now(),u};return e.original=!0,e},cl=function(e){var t,n={};return e.byterange&&(n.Range="bytes="+(t=e.byterange).offset+"-"+("bigint"==typeof t.offset||"bigint"==typeof t.length?u()().BigInt(t.offset)+u()().BigInt(t.length)-u()().BigInt(1):t.offset+t.length-1)),n},dl=function(e,t){return e.start(t)+"-"+e.end(t)},hl=function(e,t){var n=e.toString(16);return"00".substring(0,2-n.length)+n+(t%2?" ":"")},pl=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},fl=function(e){var t={};return Object.keys(e).forEach(function(n){var i=e[n];Z(i)?t[n]={bytes:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength}:t[n]=i}),t},ml=function(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},gl=function(e){return e.resolvedUri},vl=function(e){for(var t=Array.prototype.slice.call(e),n=16,i="",r=0;r<t.length/n;r++)i+=t.slice(r*n,r*n+n).map(hl).join("")+" "+t.slice(r*n,r*n+n).map(pl).join("")+"\n";return i},yl=Object.freeze({__proto__:null,createTransferableMessage:fl,initSegmentId:ml,segmentKeyId:gl,hexDump:vl,tagDump:function(e){var t=e.bytes;return vl(t)},textRanges:function(e){var t,n="";for(t=0;t<e.length;t++)n+=dl(e,t)+" ";return n}}),_l=function(e){var t=e.playlist,n=e.time,i=void 0===n?void 0:n,r=e.callback;if(!r)throw new Error("getProgramTime: callback must be provided");
2if(!t||void 0===i)return r({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,i=0,r=0;r<t.segments.length&&!(e<=(i=(n=t.segments[r]).videoTimingInfo?n.videoTimingInfo.transmuxedPresentationEnd:i+n.duration));r++);var a=t.segments[t.segments.length-1];if(a.videoTimingInfo&&a.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>i){if(e>i+.25*a.duration)return null;n=a}return{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:i-n.duration,type:n.videoTimingInfo?"accurate":"estimate"}}(i,t);if(!a)return r({message:"valid programTime was not found"});if("estimate"===a.type)return r({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:a.estimatedStart});var s={mediaSeconds:i},o=function(e,t){if(!t.dateTimeObject)return null;var n=t.videoTimingInfo.transmuxerPrependedSeconds,i=e-(t.videoTimingInfo.transmuxedPresentationStart+n);return new Date(t.dateTimeObject.getTime()+1e3*i)}(i,a.segment);return o&&(s.programDateTime=o.toISOString()),r(null,s)},bl=function(e){var t=e.programTime,n=e.playlist,i=e.retryCount,r=void 0===i?2:i,a=e.seekTo,s=e.pauseAfterSeek,o=void 0===s||s,u=e.tech,l=e.callback;if(!l)throw new Error("seekToProgramTime: callback must be provided");if(void 0===t||!n||!a)return l({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!n.endList&&!u.hasStarted_)return l({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}(n))return l({message:"programDateTime tags must be provided in the manifest "+n.resolvedUri});var c=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 i=t.segments[0];if(n<new Date(i.dateTimeObject))return null;for(var r=0;r<t.segments.length-1&&(i=t.segments[r],!(n<new Date(t.segments[r+1].dateTimeObject)));r++);var a,s=t.segments[t.segments.length-1],o=s.dateTimeObject,u=s.videoTimingInfo?(a=s.videoTimingInfo).transmuxedPresentationEnd-a.transmuxedPresentationStart-a.transmuxerPrependedSeconds:s.duration+.25*s.duration;return n>new Date(o.getTime()+1e3*u)?null:(n>new Date(o)&&(i=s),{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:Bu.duration(t,t.mediaSequence+t.segments.indexOf(i)),type:i.videoTimingInfo?"accurate":"estimate"})}(t,n);if(!c)return l({message:"".concat(t," was not found in the stream")});var d=c.segment,h=function(e,t){var n,i;try{n=new Date(e),i=new Date(t)}catch(e){}var r=n.getTime();return(i.getTime()-r)/1e3}(d.dateTimeObject,t);if("estimate"===c.type)return 0===r?l({message:"".concat(t," is not buffered yet. Try again")}):(a(c.estimatedStart+h),void u.one("seeked",function(){bl({programTime:t,playlist:n,retryCount:r-1,seekTo:a,pauseAfterSeek:o,tech:u,callback:l})}));var p=d.start+h;u.one("seeked",function(){return l(null,u.currentTime())}),o&&u.pause(),a(p)},Tl=function(e,t){if(4===e.readyState)return t()},kl=function(e,t,n,i){var r,a=[],s=!1,o=function(e,t,i,r){return t.abort(),s=!0,n(e,t,i,r)},u=function(e,t){if(!s){if(e)return e.metadata=Gu({requestType:i,request:t,error:e}),o(e,t,"",a);var n=t.responseText.substring(a&&a.byteLength||0,t.responseText.length);if(a=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}),t.length<=1)return ee(t[0]);var i=t.reduce(function(e,t,n){return e+(t.byteLength||t.length)},0),r=new Uint8Array(i),a=0;return t.forEach(function(e){e=ee(e),r.set(e,a),a+=e.byteLength}),r}(a,ae(n,!0)),r=r||Tt(a),a.length<10||r&&a.length<r+2)return Tl(t,function(){return o(e,t,"",a)});var u=qt(a);return"ts"===u&&a.length<188||!u&&a.length<376?Tl(t,function(){return o(e,t,"",a)}):o(null,t,u,a)}},l={uri:e,beforeSend:function(e){e.overrideMimeType("text/plain;
2 charset=x-user-defined"),e.addEventListener("progress",function(t){t.total,t.loaded;return ul(e,null,{statusCode:e.status},u)})}},c=t(l,function(e,t){return ul(c,e,t,u)});return c},Sl=Zo.EventTarget,wl=function(e,t){if(!il(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 i=e.segments[n],r=t.segments[n];if(i.uri!==r.uri)return!1;if(i.byterange||r.byterange){var a=i.byterange,s=r.byterange;if(a&&!s||!a&&s)return!1;if(a.offset!==s.offset||a.length!==s.length)return!1}}return!0},El=function(e,t,n,i){var r=i.attributes.NAME||n;return"placeholder-uri-".concat(e,"-").concat(t,"-").concat(r)},Cl=function(e,t,n){for(var i=!0,r=cu(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=Be(s.sidx);n&&n[o]&&n[o].sidx&&Pe(s,n[o].sidx,s.sidx.resolvedUri)}var u=rl(r,s,wl);u&&(r=u,i=!1)}return Hu(t,function(e,t,n,a){if(e.playlists&&e.playlists.length){var s=e.playlists[0].id,o=rl(r,e.playlists[0],wl);o&&(a in(r=o).mediaGroups[t][n]||(r.mediaGroups[t][n][a]=e),r.mediaGroups[t][n][a].playlists[0]=r.playlists[s],i=!1)}}),function(e,t){Hu(e,function(n,i,r,a){t.mediaGroups[i][r]&&a in t.mediaGroups[i][r]||delete e.mediaGroups[i][r][a]})}(r,t),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(i=!1),i?null:r},Il=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},xl=function(e,t){var n={};for(var i in e){var r=e[i].sidx;if(r){var a=Be(r);if(!t[a])break;var s=t[a].sidxInfo;Il(s,r)&&(n[a]=t[a])}}return n},Al=function(e){function t(e,n){var i,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0;rn(this,t),(i=Kt(this,t)).isPaused_=!0,i.mainPlaylistLoader_=a||i,a||(i.isMain_=!0);var s=r.withCredentials,o=void 0!==s&&s;if(i.vhs_=n,i.withCredentials=o,i.addMetadataToTextTrack=r.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");return i.on("minimumUpdatePeriod",function(){i.refreshXml_()}),i.on("mediaupdatetimeout",function(){i.refreshMedia_(i.media().id)}),i.state="HAVE_NOTHING",i.loadedPlaylists_={},i.logger_=lu("DashPlaylistLoader"),i.isMain_?(i.mainPlaylistLoader_.srcUrl=e,i.mainPlaylistLoader_.sidxMapping_={}):i.childPlaylist_=e,i}return Gt(t,e),sn(t,[{key:"isPaused",get:function(){return this.isPaused_}},{key:"requestErrored_",value:function(e,t,n){return!this.request||(this.request=null,e?(this.error="object"!==hn(e)||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata}:e,n&&(this.state=n),this.trigger("error"),!0):void 0)}},{key:"addSidxSegments_",value:function(e,t,n){var i=this,r=e.sidx&&Be(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r])return u()().clearTimeout(this.mediaRequest_),void(this.mediaRequest_=u()().setTimeout(function(){return n(!1)},0));var a=uu(e.sidx.resolvedUri),s=function(a,s){if(!i.requestErrored_(a,s,t)){var o,u=i.mainPlaylistLoader_.sidxMapping_,l=s.requestType;try{o=_t()(ee(s.response).subarray(8))}catch(e){return e.metadata=Gu({requestType:l,request:s,parseFailure:!0}),void i.requestErrored_(e,s,t)}return u[r]={sidxInfo:e.sidx,sidx:o},Pe(e,o,e.sidx.resolvedUri),n(!0)}};this.request=kl(a,this.vhs_.xhr,function(t,n,r,o){if(t)return s(t,n);if(!r||"mp4"!==r){var u=r||"unknown";return s({status:n.status,message:"Unsupported ".concat(u," container type for sidx segment at URL: ").concat(a),response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},n)}var l=e.sidx.byterange,c=l.offset,d=l.length;if(o.length>=d+c)return s(t,{response:o.subarray(c,c+d),status:n.status,uri:n.uri});i.request=i.vhs_.xhr({uri:a,responseType:"arraybuffer",requestType:"dash-sidx",headers:cl({byterange:e.sidx.byterange})},s)},"dash-sidx")}},{key:"dispose",value:function(){this.isPaused_=!0,this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},u()().clearTimeout(this.minimumUpdatePeriodTimeout_),u()().clearTimeout(this.mediaRequest_),u()().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()}},{key:"hasPendingRequest",value:function(){return this.request||this.mediaRequest_}},{key:"stopRequest",value:function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}},{key:"media",value: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.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}var i=!this.media_||e.id!==this.media_.id;if(i&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(i&&(this.trigger("mediachanging"),this.trigger("mediachange")));i&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,n,function(i){t.haveMetadata({startingState:n,playlist:e})}))}},{key:"haveMetadata",value:function(e){var t=e.startingState,n=e.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[n.id]=n,u()().clearTimeout(this.mediaRequest_),this.mediaRequest_=null,this.refreshMedia_(n.id),"HAVE_MAIN_MANIFEST"===t?this.trigger("loadedmetadata"):this.trigger("mediachange")}},{key:"pause",value:function(){this.isPaused_=!0,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),u()().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(u()().clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)}},{key:"load",value:function(e){var t=this;this.isPaused_=!1,u()().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var n=this.media();if(e){var i=n?n.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=u()().setTimeout(function(){return t.load()},i)}else this.started?n&&!n.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()}},{key:"start",value:function(){var e=this;if(this.started=!0,!this.isMain_)return u()().clearTimeout(this.mediaRequest_),void(this.mediaRequest_=u()().setTimeout(function(){return e.haveMain_()},0));this.requestMain_(function(t,n){e.haveMain_(),e.hasPendingRequest()||e.media_||e.media(e.mainPlaylistLoader_.main.playlists[0])})}},{key:"requestMain_",value:function(e){var t=this,n={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:n}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},function(i,r){if(i){var a=r.requestType;i.metadata=Gu({requestType:a,request:r,error:i})}if(!t.requestErrored_(i,r)){t.trigger({type:"manifestrequestcomplete",metadata:n});var s=r.responseText!==t.mainPlaylistLoader_.mainXml_;return t.mainPlaylistLoader_.mainXml_=r.responseText,r.responseHeaders&&r.responseHeaders.date?t.mainLoaded_=Date.parse(r.responseHeaders.date):t.mainLoaded_=Date.now(),t.mainPlaylistLoader_.srcUrl=uu(t.mainPlaylistLoader_.srcUrl,r),s?(t.handleMain_(),void t.syncClientServerClock_(function(){return e(r,s)})):e(r,s)}"HAVE_NOTHING"===t.state&&(t.started=!1)})}},{key:"syncClientServerClock_",value:function(e){var t=this,n=vt(this.mainPlaylistLoader_.mainXml_);return null===n?(this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()):"DIRECT"===n.method?(this.mainPlaylistLoader_.clientOffset_=n.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:ou(this.mainPlaylistLoader_.srcUrl,n.value),method:n.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},function(i,r){if(t.request){if(i){var a=r.requestType;return t.error.metadata=Gu({requestType:a,request:r,error:i}),t.mainPlaylistLoader_.clientOffset_=t.mainLoaded_-Date.now(),e()}var s;s="HEAD"===n.method?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):t.mainLoaded_:Date.parse(r.responseText),t.mainPlaylistLoader_.clientOffset_=s-Date.now(),e()}}))}},{key:"haveMain_",value:function(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}},{key:"handleMain_",value:function(){u()().clearTimeout(this.mediaRequest_),this.mediaRequest_=null;var e,t,n,i,r,a,s,o,l=this.mainPlaylistLoader_.main,c={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestparsestart",metadata:c});try{t={mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:l},n=t.mainXml,i=t.srcUrl,r=t.clientOffset,a=t.sidxMapping,s=t.previousManifest,o=gt(n,{manifestUri:i,clientOffset:r,sidxMapping:a,previousManifest:s}),zu(o,i,El),e=o}catch(e){this.error=e,this.error.metadata={errorType:Zo.Error.StreamingDashManifestParserError,error:e},this.trigger("error")}l&&(e=Cl(l,e,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=e||l;var d=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(d&&d!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=d),(!l||e&&e.minimumUpdatePeriod!==l.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(e),e){var h=e,p=h.duration,f=h.endList,m=[];
2e.playlists.forEach(function(e){m.push({id:e.id,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS})});var g={duration:p,isLive:!f,renditions:m};c.parsedManifest=g,this.trigger({type:"manifestparsecomplete",metadata:c})}return Boolean(e)}},{key:"updateMinimumUpdatePeriodTimeout_",value:function(){var e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(u()().clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);var 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 ".concat(t,", not setting a timeout")):this.createMUPTimeout_(t)}},{key:"createMUPTimeout_",value:function(e){var t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=u()().setTimeout(function(){t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}},{key:"refreshXml_",value:function(){var e=this;this.requestMain_(function(t,n){var i,r,a;n&&(e.media_&&(e.media_=e.mainPlaylistLoader_.main.playlists[e.media_.id]),e.mainPlaylistLoader_.sidxMapping_=(i=e.mainPlaylistLoader_.main,r=e.mainPlaylistLoader_.sidxMapping_,a=xl(i.playlists,r),Hu(i,function(e,t,n,i){if(e.playlists&&e.playlists.length){var s=e.playlists;a=cu(a,xl(s,r))}}),a),e.addSidxSegments_(e.media(),e.state,function(t){e.refreshMedia_(e.media().id)}))})}},{key:"refreshMedia_",value:function(e){var t=this;if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();var n=this.mainPlaylistLoader_.main.playlists,i=!this.media_||this.media_!==n[e];if(i?this.media_=n[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){var r=function(){t.media().endList||(t.mediaUpdateTimeout=u()().setTimeout(function(){t.trigger("mediaupdatetimeout"),r()},al(t.media(),Boolean(i))))};r()}this.trigger("loadedplaylist")}},{key:"addEventStreamToMetadataTrack_",value:function(e){if(e&&this.mainPlaylistLoader_.main.eventStream){var t=this.mainPlaylistLoader_.main.eventStream.map(function(e){return{cueTime:e.start,frames:[{data:e.messageData}]}});this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}},{key:"getKeyIdSet",value:function(e){if(e.contentProtection){var t=new Set;for(var n in e.contentProtection){var i=e.contentProtection[n].attributes["cenc:default_KID"];i&&t.add(i.replace(/-/g,"").toLowerCase())}return t}}}])}(Sl),Dl={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},Pl=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},Ll=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=Pl(new Worker(t));n.objURL=t;var i=n.terminate;return n.on=n.addEventListener,n.off=n.removeEventListener,n.terminate=function(){return URL.revokeObjectURL(t),i.call(this)},n}},Ol=function(e){return"var browserWorkerPolyFill = ".concat(Pl.toString(),";\n")+"browserWorkerPolyFill(self);\n"+e},Rl=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)},Ml=Ol(Rl(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 i;return!!e[t]&&(i=e[t].indexOf(n),e[t]=e[t].slice(),e[t].splice(i,1),i>-1)},this.trigger=function(t){var n,i,r,a;if(n=e[t])if(2===arguments.length)for(r=n.length,i=0;i<r;++i)n[i].call(this,arguments[1]);else{for(a=[],i=arguments.length,i=1;i<arguments.length;++i)a.push(arguments[i]);for(r=n.length,i=0;i<r;++i)n[i].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 i,r,a,s,o,u,l,c,d,h,p,f,m,g,v,y,_,b,T,k,S,w,E,C,I,x,A,D,P,L,O,R,M,N,U,B,F,q,j,H,V=t,z
vendor: 24,550 bytes, line 2
2=Math.pow(2,32),W={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)*z+n.getUint32(4)},MAX_UINT32:z},G=W.MAX_UINT32;!function(){var e;if(w={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 w)w.hasOwnProperty(e)&&(w[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);E=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)]),C=new Uint8Array([0,0,0,1]),x=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]),A=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:x,audio:A},O=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),L=new Uint8Array([0,0,0,0,0,0,0,0]),R=new Uint8Array([0,0,0,0,0,0,0,0]),M=R,N=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),U=R,P=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),i=function(e){var t,n,i=[],r=0;for(t=1;t<arguments.length;t++)i.push(arguments[t]);for(t=i.length;t--;)r+=i[t].byteLength;for(n=new Uint8Array(r+8),new DataView(n.buffer,n.byteOffset,n.byteLength).setUint32(0,n.byteLength),n.set(e,4),t=0,r=8;t<i.length;t++)n.set(i[t],r),r+=i[t].byteLength;return n},r=function(){return i(w.dinf,i(w.dref,O))},a=function(e){return i(w.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]))},v=function(e){return i(w.hdlr,D[e])},g=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),i(w.mdhd,t)},m=function(e){return i(w.mdia,g(e),v(e.type),u(e))},o=function(e){return i(w.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},u=function(e){return i(w.minf,"video"===e.type?i(w.vmhd,P):i(w.smhd,L),r(),_(e))},l=function(e,t){for(var n=[],r=t.length;r--;)n[r]=T(t[r]);return i.apply(null,[w.moof,o(e)].concat(n))},c=function(e){for(var t=e.length,n=[];t--;)n[t]=p(e[t]);return i.apply(null,[w.moov,h(4294967295)].concat(n).concat(d(e)))},d=function(e){for(var t=e.length,n=[];t--;)n[t]=k(e[t]);return i.apply(null,[w.mvex].concat(n))},h=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 i(w.mvhd,t)},y=function(e){var t,n,r=e.samples||[],a=new Uint8Array(4+r.length);for(n=0;n<r.length;n++)t=r[n].flags,a[n+4]=t.dependsOn<<4|t.isDependedOn<<2|t.hasRedundancy;return i(w.sdtp,a)},_=function(e){return i(w.stbl,b(e),i(w.stts,U),i(w.stsc,M),i(w.stsz,N),i(w.stco,R))},b=function(e){return i(w.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===e.type?B(e):F(e))},B=function(e){var t,n,r=e.sps||[],a=e.pps||[],s=[],o=[];for(t=0;t<r.length;t++)s.push((65280&r[t].byteLength)>>>8),s.push(255&r[t].byteLength),s=s.concat(Array.prototype.slice.call(r[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=[w.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]),i(w.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([r.length],s,[a.length],o))),i(w.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var u=e.sarRatio[0],l=e.sarRatio[1];n.push(i(w.pasp,new Uint8Array([(4278190080&u)>>24,(16711680&u)>>16,(65280&u)>>8,255&u,(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l])))}return i.apply(null,n)},F=function(e){return i(w.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))},f=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 i(w.tkhd,t)},T=function(e){var t,n,r,a,s,o;return t=i(w.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/G),o=Math.floor(e.baseMediaDecodeTime%G),n=i(w.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?(r=S(e,92),i(w.traf,t,n,r)):(a=y(e),r=S(e,a.length+92),i(w.traf,t,n,r,a))},p=function(e){return e.duration=e.duration||4294967295,i(w.trak,f(e),m(e))},k=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),i(w.trex,t)},H=function(e,t){var n=0,i=0,r=0,a=0;return e.length&&(void 0!==e[0].duration&&(n=1),void 0!==e[0].size&&(i=2),void 0!==e[0].flags&&(r=4),void 0!==e[0].compositionTimeOffset&&(a=8)),[0,0,n|i|r|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,t){var n,r,a,s,o,u;for(t+=20+16*(s=e.samples||[]).length,a=H(s,t),(r=new Uint8Array(a.length+16*s.length)).set(a),n=a.length,u=0;u<s.length;u++)o=s[u],r[n++]=(4278190080&o.duration)>>>24,r[n++]=(16711680&o.duration)>>>16,r[n++]=(65280&o.duration)>>>8,r[n++]=255&o.duration,r[n++]=(4278190080&o.size)>>>24,r[n++]=(16711680&o.size)>>>16,r[n++]=(65280&o.size)>>>8,r[n++]=255&o.size,r[n++]=o.flags.isLeading<<2|o.flags.dependsOn,r[n++]=o.flags.isDependedOn<<6|o.flags.hasRedundancy<<4|o.flags.paddingValue<<1|o.flags.isNonSyncSample,r[n++]=61440&o.flags.degradationPriority,r[n++]=15&o.flags.degradationPriority,r[n++]=(4278190080&o.compositionTimeOffset)>>>24,r[n++]=(16711680&o.compositionTimeOffset)>>>16,r[n++]=(65280&o.compositionTimeOffset)>>>8,r[n++]=255&o.compositionTimeOffset;return i(w.trun,r)},q=function(e,t){var n,r,a,s,o,u;for(t+=20+8*(s=e.samples||[]).length,a=H(s,t),(n=new Uint8Array(a.length+8*s.length)).set(a),r=a.length,u=0;u<s.length;u++)o=s[u],n[r++]=(4278190080&o.duration)>>>24,n[r++]=(16711680&o.duration)>>>16,n[r++]=(65280&o.duration)>>>8,n[r++]=255&o.duration,n[r++]=(4278190080&o.size)>>>24,n[r++]=(16711680&o.size)>>>16,n[r++]=(65280&o.size)>>>8,n[r++]=255&o.size;return i(w.trun,n)},S=function(e,t){return"audio"===e.type?q(e,t):j(e,t)};var X,K,Y,Q,$,J,Z,ee,te={ftyp:s=function(){return i(w.ftyp,E,C,E,I)},mdat:function(e){return i(w.mdat,e)},moof:l,moov:c,initSegment:function(e){var t,n=s(),i=c(e);return(t=new Uint8Array(n.byteLength+i.byteLength)).set(n),t.set(i,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},ie={groupNalsIntoFrames:function(e){var t,n,i=[],r=[];for(r.byteLength=0,r.nalCount=0,r.duration=0,i.byteLength=0,t=0;t<e.length;t++)"access_unit_delimiter_rbsp"===(n=e[t]).nalUnitType?(i.length&&(i.duration=n.dts-i.dts,r.byteLength+=i.byteLength,r.nalCount+=i.length,r.duration+=i.duration,r.push(i)),(i=[n]).byteLength=n.data.byteLength,i.pts=n.pts,i.dts=n.dts):("slice_layer_without_partitioning_rbsp_idr"===n.nalUnitType&&(i.keyFrame=!0),i.duration=n.dts-i.dts,i.byteLength+=n.data.byteLength,i.push(n));return r.length&&(!i.duration||i.duration<=0)&&(i.duration=r[r.length-1].duration),r.byteLength+=i.byteLength,r.nalCount+=i.length,r.duration+=i.duration,r.push(i),r},groupFramesIntoGops:function(e){var t,n,i=[],r=[];for(i.byteLength=0,i.nalCount=0,i.duration=0,i.pts=e[0].pts,i.dts=e[0].dts,r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,t=0;t<e.length;t++)(n=e[t]).keyFrame?(i.length&&(r.push(i),r.byteLength+=i.byteLength,r.nalCount+=i.nalCount,r.duration+=i.duration),(i=[n]).nalCount=n.length,i.byteLength=n.byteLength,i.pts=n.pts,i.dts=n.dts,i.duration=n.duration):(i.duration+=n.duration,i.nalCount+=n.length,i.byteLength+=n.byteLength,i.push(n));return r.length&&i.duration<=0&&(i.duration=r[r.length-1].duration),r.byteLength+=i.byteLength,r.nalCount+=i.nalCount,r.duration+=i.duration,r.push(i),r},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,i,r,a,s,o=t||0,u=[];for(n=0;n<e.length;n++)for(a=e[n],i=0;i<a.length;i++)s=a[i],o+=(r=ne(s,o)).size,u.push(r);return u},concatenateNalData:function(e){var t,n,i,r,a,s,o=0,u=e.byteLength,l=e.nalCount,c=new Uint8Array(u+4*l),d=new DataView(c.buffer);for(t=0;t<e.length;t++)for(r=e[t],n=0;n<r.length;n++)for(a=r[n],i=0;i<a.length;i++)s=a[i],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,i=[];return n=ne(e,t||0),i.push(n),i},concatenateNalDataForFrame:function(e){var t,n,i=0,r=e.byteLength,a=e.length,s=new Uint8Array(r+4*a),o=new DataView(s.buffer);for(t=0;t<e.length;t++)n=e[t],o.setUint32(i,n.data.byteLength),i+=4,s.set(n.data,i),i+=n.data.byteLength;return s}},re=[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;J=function(e,t){return K($(e,t))},Z=function(e,t){return Y(Q(e),t)},ee=function(e,t,n){return Q(n?e:e-t)};var ue={ONE_SECOND_IN_TS:oe,secondsToVideoTs:K=function(e){return e*oe},secondsToAudioTs:Y=function(e,t){return e*t},videoTsToSeconds:Q=function(e){return e/oe},audioTsToSeconds:$=function(e,t){return e/t},audioTsToVideoTs:J,videoTsToAudioTs:Z,metadataTsToSeconds:ee},le=function(){if(!X){var e={96e3:[re,[227,64],se(154),[56]],88200:[re,[231],se(170),[56]],64e3:[re,[248,192],se(240),[56]],48e3:[re,[255,192],se(268),[55,148,128],se(54),[112]],44100:[re,[255,192],se(268),[55,163,128],se(84),[112]],32e3:[re,[255,192],se(268),[55,234],se(226),[112]],24e3:[re,[255,192],se(268),[55,255,128],se(268),[111,112],se(126),[224]],16e3:[re,[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,X=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 X},ce=ue,de={prefixWithSilence:function(e,t,n,i){var r,a,s,o,u,l=0,c=0,d=0;if(t.length&&(r=ce.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),a=Math.ceil(ce.ONE_SECOND_IN_TS/(e.samplerate/1024)),n&&i&&(l=r-Math.max(n,i),d=(c=Math.floor(l/a))*a),!(c<1||d>ce.ONE_SECOND_IN_TS/2))){for((s=le()[e.samplerate])||(s=t[0].data),o=0;o<c;o++)u=t[0],t.splice(0,0,{data:s,dts:u.dts-a,pts:u.pts-a});return e.baseMediaDecodeTime-=Math.floor(ce.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,i=[];for(t=0;t<e.length;t++)n=e[t],i.push({size:n.data.byteLength,duration:1024});return i},concatenateFrameData:function(e){var t,n,i=0,r=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],r.set(n.data,i),i+=n.data.byteLength;return r}},he=ue.ONE_SECOND_IN_TS,pe={clearDtsInfo:function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},calculateTrackBaseMediaDecodeTime:function(e,t){var n,i=e.minSegmentDts;return t||(i-=e.timelineStartInfo.dts),n=e.timelineStartInfo.baseMediaDecodeTime,n+=i,n=Math.max(0,n),"audio"===e.type&&(n*=e.samplerate/he,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))}},fe={parseSei:function(e){for(var t=0,n={payloadType:-1,payloadSize:0},i=0,r=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)i+=255,t++;for(i+=e[t++];255===e[t];)r+=255,t++;if(r+=e[t++],!n.payload&&4===i){if("GA94"===String.fromCharCode(e[t+3],e[t+4],e[t+5],e[t+6])){n.payloadType=i,n.payloadSize=r,n.payload=e.subarray(t,t+r);break}n.payload=void 0}t+=r,i=0,r=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,i,r,a,s=[];if(!(64&t[0]))return s;for(i=31&t[0],n=0;n<i;n++)a={type:3&t[(r=3*n)+2],pts:e},4&t[r+2]&&(a.ccData=t[r+3]<<8|t[r+4],s.push(a));return s},discardEmulationPreventionBytes:function(e){for(var t,n,i=e.byteLength,r=[],a=1;a<i-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return e;t=i-r.length,n=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===r[0]&&(s++,r.shift()),n[a]=e[s];return n},USER_DATA_REGISTERED_ITU_T_T35:4},me=V,ge=fe,ve=function(e){e=e||{},ve.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 ke({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")))};ve.prototype=new me,ve.prototype.push=function(e){var t,n,i;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));i=ge.parseCaptionPackets(e.pts,n),this.captionPackets_=this.captionPackets_.concat(i),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},ve.prototype.flushCCStreams=function(e){this.ccStreams_.forEach(function(t){return"flush"===e?t.flush():t.partialFlush()},this)},ve.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)},ve.prototype.flush=function(){return this.flushStream("flush")},ve.prototype.partialFlush=function(){return this.flushStream("partialFlush")},ve.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(e){e.reset()})},ve.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)},ve.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},ve.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)},ve.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData)},ve.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},_e=function(e){return 32<=e&&e<=127||160<=e&&e<=255},be=function(e){this.windowNum=e,this.reset()};be.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},be.prototype.getText=function(){return this.rows.join("\n")},be.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},be.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--},be.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},be.prototype.addText=function(e){this.rows[this.rowIdx]+=e},be.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 be(-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 be(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 ke=function(e){e=e||{},ke.prototype.init.call(this);var t,n=this,i=e.captionServices||{},r={};Object.keys(i).forEach(function(e){t=i[e],/^SERVICE/.test(e)&&(r[e]=t.encoding)}),this.serviceEncodings=r,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))}};ke.prototype=new me,ke.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},ke.prototype.add708Bytes=function(e){var t=e.ccData,n=t>>>8,i=255&t;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(n),this.current708Packet.data.push(i)},ke.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,n=null,i=null,r=0,a=t[r++];for(e.seq=a>>6,e.sizeCode=63&a;r<t.length;r++)i=31&(a=t[r++]),7===(n=a>>5)&&i>0&&(n=a=t[r++]),this.pushServiceBlock(n,r,i),i>0&&(r+=i-1)},ke.prototype.pushServiceBlock=function(e,t,n){var i,r=t,a=this.current708Packet.data,s=this.services[e];for(s||(s=this.initService(e,r));r<t+n&&r<a.length;r++)i=a[r],_e(i)?r=this.handleText(r,s):24===i?r=this.multiByteCharacter(r,s):16===i?r=this.extendedCommands(r,s):128<=i&&i<=135?r=this.setCurrentWindow(r,s):152<=i&&i<=159?r=this.defineWindow(r,s):136===i?r=this.clearWindows(r,s):140===i?r=this.deleteWindows(r,s):137===i?r=this.displayWindows(r,s):138===i?r=this.hideWindows(r,s):139===i?r=this.toggleWindows(r,s):151===i?r=this.setWindowAttributes(r,s):144===i?r=this.setPenAttributes(r,s):145===i?r=this.setPenColor(r,s):146===i?r=this.setPenLocation(r,s):143===i?s=this.reset(r,s):8===i?s.currentWindow.backspace():12===i?s.currentWindow.clearText():13===i?s.currentWindow.pendingNewLine=!0:14===i?s.currentWindow.clearText():141===i&&r++},ke.prototype.extendedCommands=function(e,t){var n=this.current708Packet.data[++e];return _e(n)&&(e=this.handleText(e,t,{isExtended:!0})),e},ke.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)]},ke.prototype.initService=function(e,t){var n,i,r=this;return(n="SERVICE"+e)in this.serviceEncodings&&(i=this.serviceEncodings[n]),this.services[e]=new Te(e,i,r),this.services[e].init(this.getPts(t),function(t){r.flushDisplayed(t,r.services[e])}),this.services[e]},ke.prototype.handleText=function(e,t,n){var i,r,a,s,o=n&&n.isExtended,u=n&&n.isMultiByte,l=this.current708Packet.data,c=o?4096:0,d=l[e],h=l[e+1],p=t.currentWindow;if(u?(r=[d,h],e++):r=[d],t.textDecoder_&&!o)i=t.textDecoder_.decode(new Uint8Array(r));else if(u){var f=r.map(function(e){return("0"+(255&e).toString(16)).slice(-2)}).join("");i=String.fromCharCode(parseInt(f,16))}else s=ye[a=c|d]||a,i=4096&a&&a===s?"":String.fromCharCode(s);return p.pendingNewLine&&!p.isEmpty()&&p.newLine(this.getPts(e)),p.pendingNewLine=!1,p.addText(i),e},ke.prototype.multiByteCharacter=function(e,t){var n=this.current708Packet.data,i=n[e+1],r=n[e+2];return _e(i)&&_e(r)&&(e=this.handleText(++e,t,{isMultiByte:!0})),e},ke.prototype.setCurrentWindow=function(e,t){var n=7&this.current708Packet.data[e];return t.setCurrentWindow(n),e},ke.prototype.defineWindow=function(e,t){var n=this.current708Packet.data,i=n[e],r=7&i;t.setCurrentWindow(r);var a=t.currentWindow;return i=n[++e],a.visible=(32&i)>>5,a.rowLock=(16&i)>>4,a.columnLock=(8&i)>>3,a.priority=7&i,i=n[++e],a.relativePositioning=(128&i)>>7,a.anchorVertical=127&i,i=n[++e],a.anchorHorizontal=i,i=n[++e],a.anchorPoint=(240&i)>>4,a.rowCount=15&i,i=n[++e],a.columnCount=63&i,i=n[++e],a.windowStyle=(56&i)>>3,a.penStyle=7&i,a.virtualRowCount=a.rowCount+1,e},ke.prototype.setWindowAttributes=function(e,t){var n=this.current708Packet.data,i=n[e],r=t.currentWindow.winAttr;return i=n[++e],r.fillOpacity=(192&i)>>6,r.fillRed=(48&i)>>4,r.fillGreen=(12&i)>>2,r.fillBlue=3&i,i=n[++e],r.borderType=(192&i)>>6,r.borderRed=(48&i)>>4,r.borderGreen=(12&i)>>2,r.borderBlue=3&i,i=n[++e],r.borderType+=(128&i)>>5,r.wordWrap=(64&i)>>6,r.printDirection=(48&i)>>4,r.scrollDirection=(12&i)>>2,r.justify=3&i,i=n[++e],r.effectSpeed=(240&i)>>4,r.effectDirection=(12&i)>>2,r.displayEffect=3&i,e},ke.prototype.flushDisplayed=function(e,t){for(var n=[],i=0;i<8;i++)t.windows[i].visible&&!t.windows[i].isEmpty()&&n.push(t.windows[i].getText());t.endPts=e,t.text=n.join("\n\n"),this.pushCaption(t),t.startPts=e},ke.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream
vendor: 4,344 bytes, line 2
2:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts)},ke.prototype.displayWindows=function(e,t){var n=this.current708Packet.data[++e],i=this.getPts(e);this.flushDisplayed(i,t);for(var r=0;r<8;r++)n&1<<r&&(t.windows[r].visible=1);return e},ke.prototype.hideWindows=function(e,t){var n=this.current708Packet.data[++e],i=this.getPts(e);this.flushDisplayed(i,t);for(var r=0;r<8;r++)n&1<<r&&(t.windows[r].visible=0);return e},ke.prototype.toggleWindows=function(e,t){var n=this.current708Packet.data[++e],i=this.getPts(e);this.flushDisplayed(i,t);for(var r=0;r<8;r++)n&1<<r&&(t.windows[r].visible^=1);return e},ke.prototype.clearWindows=function(e,t){var n=this.current708Packet.data[++e],i=this.getPts(e);this.flushDisplayed(i,t);for(var r=0;r<8;r++)n&1<<r&&t.windows[r].clearText();return e},ke.prototype.deleteWindows=function(e,t){var n=this.current708Packet.data[++e],i=this.getPts(e);this.flushDisplayed(i,t);for(var r=0;r<8;r++)n&1<<r&&t.windows[r].reset();return e},ke.prototype.setPenAttributes=function(e,t){var n=this.current708Packet.data,i=n[e],r=t.currentWindow.penAttr;return i=n[++e],r.textTag=(240&i)>>4,r.offset=(12&i)>>2,r.penSize=3&i,i=n[++e],r.italics=(128&i)>>7,r.underline=(64&i)>>6,r.edgeType=(56&i)>>3,r.fontStyle=7&i,e},ke.prototype.setPenColor=function(e,t){var n=this.current708Packet.data,i=n[e],r=t.currentWindow.penColor;return i=n[++e],r.fgOpacity=(192&i)>>6,r.fgRed=(48&i)>>4,r.fgGreen=(12&i)>>2,r.fgBlue=3&i,i=n[++e],r.bgOpacity=(192&i)>>6,r.bgRed=(48&i)>>4,r.bgGreen=(12&i)>>2,r.bgBlue=3&i,i=n[++e],r.edgeRed=(48&i)>>4,r.edgeGreen=(12&i)>>2,r.edgeBlue=3&i,e},ke.prototype.setPenLocation=function(e,t){var n=this.current708Packet.data,i=n[e],r=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,i=n[++e],r.row=15&i,i=n[++e],r.column=63&i,e},ke.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},we=function(e){return null===e?"":(e=Se[e]||e,String.fromCharCode(e))},Ee=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Ce=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,i,r,a;if((t=32639&e.ccData)!==this.lastControlCode_){if(4096==(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),i=t>>>8,r=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_=Ce();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Ce();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=Ce()
vendor: 13,587 bytes, line 2
2),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(i,r))a=we((i=(3&i)<<8)|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isExtCharacter(i,r))"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=we((i=(3&i)<<8)|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isMidRowCode(i,r))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14&~r||this.addFormatting(e.pts,["i"]),1&~r||this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(i,r)){var s=3&r;this.nonDisplayed_[this.row_].offset=s,this.column_+=s}else if(this.isPAC(i,r)){var o=Ee.indexOf(7968&t);if("rollUp"===this.mode_&&(o-this.rollUpRows_+1<0&&(o=this.rollUpRows_-1),this.setRollUp(e.pts,o)),o!==this.row_&&o>=0&&o<=14&&(this.clearFormatting(e.pts),this.row_=o),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),!(16&~t)){var u=(14&t)>>1;this.column_=4*u,this.nonDisplayed_[this.row_].indent+=u}this.isColorPAC(r)&&(14&~r||this.addFormatting(e.pts,["i"]))}else this.isNormalChar(i)&&(0===r&&(r=null),a=we(i),a+=we(r),this[this.mode_](e.pts,a),this.column_+=a.length)}else this.lastControlCode_=null}};Ie.prototype=new me,Ie.prototype.flushDisplayed=function(e){var t=this,n=function(e){t.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+e+"."})},i=[];this.displayed_.forEach(function(e,t){if(e&&e.text&&e.text.length){try{e.text=e.text.trim()}catch(e){n(t)}e.text.length&&i.push({text:e.text,line:t+1,position:10+Math.min(70,10*e.indent)+2.5*e.offset})}else null==e&&n(t)}),i.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,content:i,stream:this.name_})},Ie.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Ce(),this.nonDisplayed_=Ce(),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_=Ce(),this.displayed_=Ce()),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 xe={CaptionStream:ve,Cea608Stream:Ie,Cea708Stream:ke},Ae={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},De=V,Pe="shared",Le=function(e,t){var n=1;for(e>t&&(n=-1);Math.abs(t-e)>4294967296;)e+=8589934592*n;return e},Oe=function(e){var t,n;Oe.prototype.init.call(this),this.type_=e||Pe,this.push=function(e){"metadata"!==e.type?this.type_!==Pe&&e.type!==this.type_||(void 0===n&&(n=e.dts),e.dts=Le(e.dts,n),e.pts=Le(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")}};Oe.prototype=new De;var Re,Me={TimestampRolloverStream:Oe,handleRollover:Le},Ne=function(e,t,n){if(!e)return-1;for(var i=n;i<e.length;i++)if(e[i]===t)return i;return-1},Ue=Ne,Be=3,Fe=function(e,t,n){var i,r="";for(i=t;i<n;i++)r+="%"+("00"+e[i].toString(16)).slice(-2);return r},qe=function(e,t,n){return decodeURIComponent(Fe(e,t,n))},je=function(e,t,n){return unescape(Fe(e,t,n))},He=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},Ve={APIC:function(e){var t,n,i=1;e.data[0]===Be&&((t=Ue(e.data,0,i))<0||(e.mimeType=je(e.data,i,t),i=t+1,e.pictureType=e.data[i],i++,(n=Ue(e.data,0,i))<0||(e.description=qe(e.data,i,n),i=n+1,"--\x3e"===e.mimeType?e.url=je(e.data,i,e.data.length):e.pictureData=e.data.subarray(i,e.data.length))))},"T*":function(e){e.data[0]===Be&&(e.value=qe(e.data,1,e.data.length).replace(/\0*$/,""),e.values=e.value.split("\0"))},TXXX:function(e){var t;e.data[0]===Be&&-1!==(t=Ue(e.data,0,1))&&(e.description=qe(e.data,1,t),e.value=qe(e.data,t+1,e.data.length).replace(/\0*$/,""),e.data=e.value)},"W*":function(e){e.url=je(e.data,0,e.data.length).replace(/\0.*$/,"")},WXXX:function(e){var t;e.data[0]===Be&&-1!==(t=Ue(e.data,0,1))&&(e.description=qe(e.data,1,t),e.url=je(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=je(e.data,0,t);break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}},ze={parseId3Frames:function(e){var t,n=10,i=0,r=[];if(!(e.length<10||e[0]!=="I".charCodeAt(0)||e[1]!=="D".charCodeAt(0)||e[2]!=="3".charCodeAt(0))){i=He(e.subarray(6,10)),i+=10,64&e[5]&&(n+=4,n+=He(e.subarray(10,14)),i-=He(e.subarray(16,20)));do{if((t=He(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,Ve[a.id]?Ve[a.id](a):"T"===a.id[0]?Ve["T*"](a):"W"===a.id[0]&&Ve["W*"](a),r.push(a),n+=10,n+=t}while(n<i);return r}},parseSyncSafeInteger:He,frameParsers:Ve},We=Ae,Ge=ze;(Re=function(e){var t,n={descriptor:e&&e.descriptor},i=0,r=[],a=0;if(Re.prototype.init.call(this),this.dispatchType=We.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,u;if("timed-metadata"===e.type)if(e.dataAlignmentIndicator&&(a=0,r.length=0),0===r.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(r.push(e),a+=e.data.byteLength,1===r.length&&(i=Ge.parseSyncSafeInteger(e.data.subarray(6,10)),i+=10),!(a<i)){for(t={data:new Uint8Array(i),frames:[],pts:r[0].pts,dts:r[0].dts},u=0;u<i;)t.data.set(r[0].data.subarray(0,i-u),u),u+=r[0].data.byteLength,a-=r[0].data.byteLength,r.shift();n=10,64&t.data[5]&&(n+=4,n+=Ge.parseSyncSafeInteger(t.data.subarray(10,14)),i-=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 l=o.data,c=(1&l[3])<<30|l[4]<<22|l[5]<<14|l[6]<<6|l[7]>>>2;c*=4,c+=3&l[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<i);this.trigger("data",t)}}}).prototype=new V;var Xe,Ke,Ye,Qe=Re,$e=V,Je=xe,Ze=Ae,et=Me.TimestampRolloverStream,tt=188;(Xe=function(){var e=new Uint8Array(tt),t=0;Xe.prototype.init.call(this),this.push=function(n){var i,r=0,a=tt;for(t?((i=new Uint8Array(n.byteLength+t)).set(e.subarray(0,t)),i.set(n,t),t=0):i=n;a<i.byteLength;)71!==i[r]||71!==i[a]?(r++,a++):(this.trigger("data",i.subarray(r,a)),r+=tt,a+=tt);r<i.byteLength&&(e.set(i.subarray(r),0),t=i.byteLength-r)},this.flush=function(){t===tt&&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 $e,Ke=function(){var e,t,n,i;Ke.prototype.init.call(this),i=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,i){var r=0;i.payloadUnitStartIndicator&&(r+=e[r]+1),"pat"===i.type?t(e.subarray(r),i):n(e.subarray(r),i)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],i.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=i.pmtPid},n=function(e,t){var n,r;if(1&e[5]){for(i.programMapTable={video:null,audio:null,"timed-metadata":{}},n=3+((15&e[1])<<8|e[2])-4,r=12+((15&e[10])<<8|e[11]);r<n;){var a=e[r],s=(31&e[r+1])<<8|e[r+2];a===Ze.H264_STREAM_TYPE&&null===i.programMapTable.video?i.programMapTable.video=s:a===Ze.ADTS_STREAM_TYPE&&null===i.programMapTable.audio?i.programMapTable.audio=s:a===Ze.METADATA_STREAM_TYPE&&(i.programMapTable["timed-metadata"][s]=a),r+=5+((15&e[r+3])<<8|e[r+4])}t.programMapTable=i.programMapTable}},this.push=function(t){var n={},i=4;if(n.payloadUnitStartIndicator=!!(64&t[1]),n.pid=31&t[1],n.pid<<=8,n.pid|=t[2],(48&t[3])>>>4>1&&(i+=t[i]+1),0===n.pid)n.type="pat",e(t.subarray(i),n),this.trigger("data",n);else if(n.pid===this.pmtPid)for(n.type="pmt",e(t.subarray(i),n),this.trigger("data",n);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,i,n]):this.processPes_(t,i,n)},this.processPes_=function(e,t,n){n.pid===this.programMapTable.video?n.streamType=Ze.H264_STREAM_TYPE:n.pid===this.programMapTable.audio?n.streamType=Ze.ADTS_STREAM_TYPE:n.streamType=this.programMapTable["timed-metadata"][n.pid],n.type="pes",n.data=e.subarray(t),this.trigger("data",n)}},Ke.prototype=new $e,Ke.STREAM_TYPES={h264:27,adts:15},Ye=function(){var e,t=this,n=!1,i={data:[],size:0},r={data:[],size:0},a={data:[],size:0},s=function(e,n,i){var r,a,s=new Uint8Array(e.size),o={type:n},u=0,l=0;if(e.data.length&&!(e.size<9)){for(o.trackId=e.data[0].pid,u=0;u<e.data.length;u++)a=e.data[u],s.set(a.data,l),l+=a.data.byteLength;var c,d,h,p;d=o,p=(c=s)[0]<<16|c[1]<<8|c[2],d.data=new Uint8Array,1===p&&(d.packetLength=6+(c[4]<<8|c[5]),d.dataAlignmentIndicator=!!(4&c[6]),192&(h=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&h&&(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])),r="video"===n||o.packetLength<=e.size,(i||r)&&(e.size=0,e.data.length=0),r&&t.trigger("data",o)}};Ye.prototype.init.call(this),this.push=function(o){({pat:function(){},pes:function(){var e,t;switch(o.streamType){case Ze.H264_STREAM_TYPE:e=i,t="video";break;case Ze.ADTS_STREAM_TYPE:e=r,t="audio";break;case Ze.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 i={type:"metadata",tracks:[]};null!==(e=o.programMapTable).video&&i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),n=!0,t.trigger("data",i)}})[o.type]()},this.reset=function(){i.size=0,i.data.length=0,r.size=0,r.data.length=0,this.trigger("reset")},this.flushStreams_=function(){s(i,"video"),s(r,"audio"),s(a,"timed-metadata")},this.flush=function(){if(!n&&e){var i={type:"metadata",tracks:[]};null!==e.video&&i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),t.trigger("data",i)}n=!1,this.flushStreams_(),this.trigger("done")}},Ye.prototype=new $e;var nt={PAT_PID:0,MP2T_PACKET_LENGTH:tt,TransportPacketStream:Xe,TransportParseStream
vendor: 6,853 bytes, line 2
2:Ke,ElementaryStream:Ye,TimestampRolloverStream:et,CaptionStream:Je.CaptionStream,Cea608Stream:Je.Cea608Stream,Cea708Stream:Je.Cea708Stream,MetadataStream:Qe};for(var it in Ze)Ze.hasOwnProperty(it)&&(nt[it]=Ze[it]);var rt,at=nt,st=ue.ONE_SECOND_IN_TS,ot=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];(rt=function(e){var t,n=0;rt.prototype.init.call(this),this.skipWarn_=function(e,t){this.trigger("log",{level:"warn",message:"adts skiping bytes ".concat(e," to ").concat(t," in frame ").concat(n," outside syncword")})},this.push=function(i){var r,a,s,o,u,l=0;if(e||(n=0),"audio"===i.type){var c;for(t&&t.length?(s=t,(t=new Uint8Array(s.byteLength+i.data.byteLength)).set(s),t.set(i.data,s.byteLength)):t=i.data;l+7<t.length;)if(255===t[l]&&240==(246&t[l+1])){if("number"==typeof c&&(this.skipWarn_(c,l),c=null),a=2*(1&~t[l+1]),r=(3&t[l+3])<<11|t[l+4]<<3|(224&t[l+5])>>5,u=(o=1024*(1+(3&t[l+6])))*st/ot[(60&t[l+2])>>>2],t.byteLength-l<r)break;this.trigger("data",{pts:i.pts+n*u,dts:i.dts+n*u,sampleCount:o,audioobjecttype:1+(t[l+2]>>>6&3),channelcount:(1&t[l+2])<<2|(192&t[l+3])>>>6,samplerate:ot[(60&t[l+2])>>>2],samplingfrequencyindex:(60&t[l+2])>>>2,samplesize:16,data:t.subarray(l+7+a,l+r)}),n++,l+=r}else"number"!=typeof c&&(c=l),l++;"number"==typeof c&&(this.skipWarn_(c,l),c=null),t=t.subarray(l)}},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 V;var ut,lt,ct,dt=rt,ht=V,pt=function(e){var t=e.byteLength,n=0,i=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+i},this.loadWord=function(){var r=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(r,r+s)),n=new DataView(a.buffer).getUint32(0),i=8*s,t-=s},this.skipBits=function(e){var r;i>e?(n<<=e,i-=e):(e-=i,e-=8*(r=Math.floor(e/8)),t-=r,this.loadWord(),n<<=e,i-=e)},this.readBits=function(e){var r=Math.min(i,e),a=n>>>32-r;return(i-=r)>0?n<<=r:t>0&&this.loadWord(),(r=e-r)>0?a<<r|this.readBits(r):a},this.skipLeadingZeros=function(){var e;for(e=0;e<i;++e)if(n&2147483648>>>e)return n<<=e,i-=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()};(lt=function(){var e,t,n=0;lt.prototype.init.call(this),this.push=function(i){var r;t?((r=new Uint8Array(t.byteLength+i.data.byteLength)).set(t),r.set(i.data,t.byteLength),t=r):t=i.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 ht,ct={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},ut=function(){var e,t,n,i,r,a,s,o=new lt;ut.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,n=e.pts,i=e.dts,o.push(e))},o.on("data",function(s){var o={trackId:t,pts:n,dts:i,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=r(s.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=r(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,i=8,r=8;for(n=0;n<e;n++)0!==r&&(r=(i+t.readExpGolomb()+256)%256),i=0===r?i:r},r=function(e){for(var t,n,i=e.byteLength,r=[],a=1;a<i-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(r.push(a+2),a+=2):a++;if(0===r.length)return e;t=i-r.length,n=new Uint8Array(t);var s=0;for(a=0;a<t;s++,a++)s===r[0]&&(s++,r.shift()),n[a]=e[s];return n},a=function(e){var t,n,i,r,a,o,u,l,c,d,h,p,f=0,m=0,g=0,v=0,y=[1,1];if(n=(t=new pt(e)).readUnsignedByte(),r=t.readUnsignedByte(),i=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),ct[n]&&(3===(a=t.readUnsignedExpGolomb())&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(h=3!==a?8:12,p=0;p<h;p++)t.readBoolean()&&s(p<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(),u=t.readUnsignedExpGolomb(),p=0;p<u;p++)t.skipExpGolomb();if(t.skipUnsignedExpGolomb(),t.skipBits(1),l=t.readUnsignedExpGolomb(),c=t.readUnsignedExpGolomb(),0===(d=t.readBits(1))&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(f=t.readUnsignedExpGolomb(),m=t.readUnsignedExpGolomb(),g=t.readUnsignedExpGolomb(),v=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(t.readUnsignedByte()){case 1:y=[1,1];break;case 2:y=[12,11];break;case 3:y=[10,11];break;case 4:y=[16,11];break;case 5:y=[40,33];break;case 6:y=[24,11];break;case 7:y=[20,11];break;case 8:y=[32,11];break;case 9:y=[80,33];break;case 10:y=[18,11];break;case 11:y=[15,11];break;case 12:y=[64,33];break;case 13:y=[160,99];break;case 14:y=[4,3];break;case 15:y=[3,2];break;case 16:y=[2,1];break;case 255:y=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()]}y&&(y[0],y[1])}return{profileIdc:n,levelIdc:i,profileCompatibility:r,width:16*(l+1)-2*f-2*m,height:(2-d)*(c+1)*16-2*g-2*v,sarRatio:y}}},ut.prototype=new ht;var ft,mt={H264Stream:ut,NalByteStream:lt},gt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],vt=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},yt=function(e,t){return e.length-t<10||e[t]!=="I".charCodeAt(0)||e[t+1
vendor: 9,685 bytes, line 2
2]!=="D".charCodeAt(0)||e[t+2]!=="3".charCodeAt(0)?t:(t+=vt(e,t),yt(e,t))},_t=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},bt=function(e,t,n){return unescape(function(e,t,n){var i,r="";for(i=t;i<n;i++)r+="%"+("00"+e[i].toString(16)).slice(-2);return r}(e,t,n))},Tt={isLikelyAacData:function(e){var t=yt(e,0);return e.length>=t+2&&!(255&~e[t])&&!(240&~e[t+1])&&16==(22&e[t+1])},parseId3TagSize:vt,parseAdtsSize:function(e,t){var n=(224&e[t+5])>>5,i=e[t+4]<<3;return 6144&e[t+3]|i|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&~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 gt[(60&e[t+2])>>>2];t++}return null},parseAacTimestamp:function(e){var t,n,i;t=10,64&e[5]&&(t+=4,t+=_t(e.subarray(10,14)));do{if((n=_t(e.subarray(t+4,t+8)))<1)return null;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){i=e.subarray(t+10,t+n+10);for(var r=0;r<i.byteLength;r++)if(0===i[r]){if("com.apple.streaming.transportStreamTimestamp"===bt(i,0,r)){var a=i.subarray(r+1),s=(1&a[3])<<30|a[4]<<22|a[5]<<14|a[6]<<6|a[7]>>>2;return s*=4,s+=3&a[7]}break}}t+=10,t+=n}while(t<e.byteLength);return null}},kt=Tt;(ft=function(){var e=new Uint8Array,t=0;ft.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(n){var i,r,a,s,o=0,u=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-u>=3;)if(e[u]!=="I".charCodeAt(0)||e[u+1]!=="D".charCodeAt(0)||e[u+2]!=="3".charCodeAt(0))if(255&~e[u]||240&~e[u+1])u++;else{if(e.length-u<7)break;if(u+(o=kt.parseAdtsSize(e,u))>e.length)break;a={type:"audio",data:e.subarray(u,u+o),pts:t,dts:t},this.trigger("data",a),u+=o}else{if(e.length-u<10)break;if(u+(o=kt.parseId3TagSize(e,u))>e.length)break;r={type:"timed-metadata",data:e.subarray(u,u+o)},this.trigger("data",r),u+=o}i=e.length-u,e=i>0?e.subarray(u):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){e=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new V;var St,wt,Et,Ct,It=V,xt=te,At=ie,Dt=de,Pt=pe,Lt=at,Ot=ue,Rt=dt,Mt=mt.H264Stream,Nt=ft,Ut=Tt.isLikelyAacData,Bt=ue.ONE_SECOND_IN_TS,Ft=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],qt=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],jt=function(e,t){t.stream=e,this.trigger("log",t)},Ht=function(e,t){for(var n=Object.keys(t),i=0;i<n.length;i++){var r=n[i];"headOfPipeline"!==r&&t[r].on&&t[r].on("log",jt.bind(e,r))}},Vt=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},zt=function(e,t,n,i,r,a){return{start:{dts:e,pts:e+(n-t)},end:{dts:e+(i-t),pts:e+(r-n)},prependedContentDuration:a,baseMediaDecodeTime:e}};wt=function(e,t){var n,i=[],r=0,a=0,s=1/0;n=(t=t||{}).firstSequenceNumber||0,wt.prototype.init.call(this),this.push=function(t){Pt.collectDtsInfo(e,t),e&&Ft.forEach(function(n){e[n]=t[n]}),i.push(t)},this.setEarliestDts=function(e){r=e},this.setVideoBaseMediaDecodeTime=function(e){s=e},this.setAudioAppendStart=function(e){a=e},this.flush=function(){var o,u,l,c,d,h,p;0!==i.length?(o=Dt.trimAdtsFramesByEarliestDts(i,e,r),e.baseMediaDecodeTime=Pt.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),p=Dt.prefixWithSilence(e,o,a,s),e.samples=Dt.generateSampleTable(o),l=xt.mdat(Dt.concatenateFrameData(o)),i=[],u=xt.moof(n,[e]),c=new Uint8Array(u.byteLength+l.byteLength),n++,c.set(u),c.set(l,u.byteLength),Pt.clearDtsInfo(e),d=Math.ceil(1024*Bt/e.samplerate),o.length&&(h=o.length*d,this.trigger("segmentTimingInfo",zt(Ot.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),o[0].dts,o[0].pts,o[0].dts+h,o[0].pts+h,p||0)),this.trigger("timingInfo",{start:o[0].pts,end:o[0].pts+h})),this.trigger("data",{track:e,boxes:c}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")},this.reset=function(){Pt.clearDtsInfo(e),i=[],this.trigger("reset")}},wt.prototype=new It,St=function(e,t){var n,i,r,a=[],s=[];n=(t=t||{}).firstSequenceNumber||0,St.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){Pt.collectDtsInfo(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||i||(i=t.config,e.sps=[t.data],qt.forEach(function(t){e[t]=i[t]},this)),"pic_parameter_set_rbsp"!==t.nalUnitType||r||(r=t.data,e.pps=[t.data]),a.push(t)},this.flush=function(){for(var i,r,o,u,l,c,d,h,p=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(i=At.groupNalsIntoFrames(a),(o=At.groupFramesIntoGops(i))[0][0].keyFrame||((r=this.getGopForFusion_(a[0],e))?(p=r.duration,o.unshift(r),o.byteLength+=r.byteLength,o.nalCount+=r.nalCount,o.pts=r.pts,o.dts=r.dts,o.duration+=r.duration):o=At.extendFirstKeyFrame(o)),s.length){var f;if(!(f=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");Pt.clearDtsInfo(e),o=f}Pt.collectDtsInfo(e,o),e.samples=At.generateSampleTable(o),l=xt.mdat(At.concatenateNalData(o)),e.baseMediaDecodeTime=Pt.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",o.map(function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}})),d=o[0],h=o[o.length-1],this.trigger("segmentTimingInfo",zt(e.baseMediaDecodeTime,d.dts,d.pts,h.dts+h.duration,h.pts+h.duration,p)),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),u=xt.moof(n,[e]),c=new Uint8Array(u.byteLength+l.byteLength),n++,c.set(u),c.set(l,u.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(){Pt.clearDtsInfo(e),i=void 0,r=void 0},this.getGopForFusion_=function(t){var n,i,r,a,s,o=1/0;for(s=0;s<this.gopCache_.length;s++)r=(a=this.gopCache_[s]).gop,e.pps&&Vt(e.pps[0],a.pps[0])&&e.sps&&Vt(e.sps[0],a.sps[0])&&(r.dts<e.timelineStartInfo.dts||(n=t.dts-r.dts-r.duration)>=-1e4&&n<=45e3&&(!i||o>n)&&(i=a,o=n));return i?i.gop:null},this.alignGopsAtStart_=function(e){var t,n,i,r,a,o,u,l;for(a=e.byteLength,o=e.nalCount,u=e.duration,t=n=0;t<s.length&&n<e.length&&(i=s[t],r=e[n],i.pts!==r.pts);)r.pts>i.pts?t++:(n++,a-=r.byteLength,o-=r.nalCount,u-=r.duration);return 0===n?e:n===e.length?null:((l=e.slice(n)).byteLength=a,l.duration=u,l.nalCount=o,l.pts=l[0].pts,l.dts=l[0].dts,l)},this.alignGopsAtEnd_=function(e){var t,n,i,r,a,o,u;for(t=s.length-1,n=e.length-1,a=null,o=!1;t>=0&&n>=0;){if(i=s[t],r=e[n],i.pts===r.pts){o=!0;break}i.pts>r.pts?t--:(t===s.length-1&&(a=n),n--)}if(!o&&null===a)return null;if(0===(u=o?n:a))return e;var l=e.slice(u),c=l.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 l.byteLength=c.byteLength,l.duration=c.duration,l.nalCount=c.nalCount,l.pts=l[0].pts,l.dts=l[0].dts,l},this.alignGopsWith=function(e){s=e}},St.prototype=new It,Ct=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,Ct.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))))}},Ct.prototype=new It,Ct.prototype.flush=function(e){var t,n,i,r,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,qt.forEach(function(e){s.info[e]=this.videoTrack[e]},this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,Ft.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,i=xt.initSegment(this.pendingTracks),s.initSegment=new Uint8Array(i.byteLength),s.initSegment.set(i),s.data=new Uint8Array(this.pendingBytes),r=0;r<this.pendingBoxes.length;r++)s.data.set(this.pendingBoxes[r],a),a+=this.pendingBoxes[r].byteLength;for(r=0;r<this.pendingCaptions.length;r++)(t=this.pendingCaptions[r]).startTime=Ot.metadataTsToSeconds(t.startPts,o,this.keepOriginalTimestamps),t.endTime=Ot.metadataTsToSeconds(t.endPts,o,this.keepOriginalTimestamps),s.captionStream
vendor: 7,013 bytes, line 2
2s[t.stream]=!0,s.captions.push(t);for(r=0;r<this.pendingMetadata.length;r++)(n=this.pendingMetadata[r]).cueTime=Ot.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),r=0;r<s.captions.length;r++)t=s.captions[r],this.trigger("caption",t);for(r=0;r<s.metadata.length;r++)n=s.metadata[r],this.trigger("id3Frame",n)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},Ct.prototype.setRemux=function(e){this.remuxTracks=e},(Et=function(e){var t,n,i=this,r=!0;Et.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="aac",r.metadataStream=new Lt.MetadataStream,r.aacStream=new Nt,r.audioTimestampRolloverStream=new Lt.TimestampRolloverStream("audio"),r.timedMetadataTimestampRolloverStream=new Lt.TimestampRolloverStream("timed-metadata"),r.adtsStream=new Rt,r.coalesceStream=new Ct(e,r.metadataStream),r.headOfPipeline=r.aacStream,r.aacStream.pipe(r.audioTimestampRolloverStream).pipe(r.adtsStream),r.aacStream.pipe(r.timedMetadataTimestampRolloverStream).pipe(r.metadataStream).pipe(r.coalesceStream),r.metadataStream.on("timestamp",function(e){r.aacStream.setTimestamp(e.timeStamp)}),r.aacStream.on("data",function(a){"timed-metadata"!==a.type&&"audio"!==a.type||r.audioSegmentStream||(n=n||{timelineStartInfo:{baseMediaDecodeTime:i.baseMediaDecodeTime},codec:"adts",type:"audio"},r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new wt(n,e),r.audioSegmentStream.on("log",i.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",i.trigger.bind(i,"audioTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream),i.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!t}))}),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("done",this.trigger.bind(this,"done")),Ht(this,r)},this.setupTsPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="ts",r.metadataStream=new Lt.MetadataStream,r.packetStream=new Lt.TransportPacketStream,r.parseStream=new Lt.TransportParseStream,r.elementaryStream=new Lt.ElementaryStream,r.timestampRolloverStream=new Lt.TimestampRolloverStream,r.adtsStream=new Rt,r.h264Stream=new Mt,r.captionStream=new Lt.CaptionStream(e),r.coalesceStream=new Ct(e,r.metadataStream),r.headOfPipeline=r.packetStream,r.packetStream.pipe(r.parseStream).pipe(r.elementaryStream).pipe(r.timestampRolloverStream),r.timestampRolloverStream.pipe(r.h264Stream),r.timestampRolloverStream.pipe(r.adtsStream),r.timestampRolloverStream.pipe(r.metadataStream).pipe(r.coalesceStream),r.h264Stream.pipe(r.captionStream).pipe(r.coalesceStream),r.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=i.baseMediaDecodeTime):(t=a.tracks[s]).timelineStartInfo.baseMediaDecodeTime=i.baseMediaDecodeTime;t&&!r.videoSegmentStream&&(r.coalesceStream.numberOfTracks++,r.videoSegmentStream=new St(t,e),r.videoSegmentStream.on("log",i.getLogTrigger_("videoSegmentStream")),r.videoSegmentStream.on("timelineStartInfo",function(t){n&&!e.keepOriginalTimestamps&&(n.timelineStartInfo=t,r.audioSegmentStream.setEarliestDts(t.dts-i.baseMediaDecodeTime))}),r.videoSegmentStream.on("processedGopsInfo",i.trigger.bind(i,"gopInfo")),r.videoSegmentStream.on("segmentTimingInfo",i.trigger.bind(i,"videoSegmentTimingInfo")),r.videoSegmentStream.on("baseMediaDecodeTime",function(e){n&&r.audioSegmentStream.setVideoBaseMediaDecodeTime(e)}),r.videoSegmentStream.on("timingInfo",i.trigger.bind(i,"videoTimingInfo")),r.h264Stream.pipe(r.videoSegmentStream).pipe(r.coalesceStream)),n&&!r.audioSegmentStream&&(r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new wt(n,e),r.audioSegmentStream.on("log",i.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",i.trigger.bind(i,"audioTimingInfo")),r.audioSegmentStream.on("segmentTimingInfo",i.trigger.bind(i,"audioSegmentTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream)),i.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!t})}}),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("id3Frame",function(e){e.dispatchType=r.metadataStream.dispatchType,i.trigger("id3Frame",e)}),r.coalesceStream.on("caption",this.trigger.bind(this,"caption")),r.coalesceStream.on("done",this.trigger.bind(this,"done")),Ht(this,r)},this.setBaseMediaDecodeTime=function(i){var r=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=i),n&&(n.timelineStartInfo.dts=void 0,n.timelineStartInfo.pts=void 0,Pt.clearDtsInfo(n),r.audioTimestampRolloverStream&&r.audioTimestampRolloverStream.discontinuity()),t&&(r.videoSegmentStream&&(r.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,Pt.clearDtsInfo(t),r.captionStream.reset()),r.timestampRolloverStream&&r.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(r){var t=Ut(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),r=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){r=!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 It;var Wt,Gt,Xt={Transmuxer:Et,VideoSegmentStream:St,AudioSegmentStream:wt,AUDIO_PROPERTIES:Ft,VIDEO_PROPERTIES:qt,generateSegmentTimingInfo:zt},Kt=function(e){return e>>>0},Yt=function(e){return("00"+e.toString(16)).slice(-2)},Qt=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),t+=String.fromCharCode(e[2]),t+=String.fromCharCode(e[3])},$t=Kt,Jt=Qt,Zt=function(e,t){var n,i,r,a,s,o=[];if(!t.length)return null;for(n=0;n<e.byteLength;)i=$t(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3]),r=Jt(e.subarray(n+4,n+8)),a=i>1?n+i:e.byteLength,r===t[0]&&(1===t.length?o.push(e.subarray(n+8,a)):(s=Zt(e.subarray(n+8,a),t.slice(1))).length&&(o=o.c
vendor: 6,925 bytes, line 2
2oncat(s))),n=a;return o},en=Zt,tn=Kt,nn=W.getUint64,an=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};return 1===t.version?t.baseMediaDecodeTime=nn(e.subarray(4)):t.baseMediaDecodeTime=tn(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),t},on=function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:n.getUint32(4)},r=1&i.flags[2],a=2&i.flags[2],s=8&i.flags[2],o=16&i.flags[2],u=32&i.flags[2],l=65536&i.flags[0],c=131072&i.flags[0];return t=8,r&&(t+=4,i.baseDataOffset=n.getUint32(12),t+=4),a&&(i.sampleDescriptionIndex=n.getUint32(t),t+=4),s&&(i.defaultSampleDuration=n.getUint32(t),t+=4),o&&(i.defaultSampleSize=n.getUint32(t),t+=4),u&&(i.defaultSampleFlags=n.getUint32(t)),l&&(i.durationIsEmpty=!0),!r&&c&&(i.baseDataOffsetIsMoof=!0),i},un=W.getUint64,ln=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]}},cn=function(e){var t,n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},i=new DataView(e.buffer,e.byteOffset,e.byteLength),r=1&n.flags[2],a=4&n.flags[2],s=1&n.flags[1],o=2&n.flags[1],u=4&n.flags[1],l=8&n.flags[1],c=i.getUint32(4),d=8;for(r&&(n.dataOffset=i.getInt32(d),d+=4),a&&c&&(t={flags:ln(e.subarray(d,d+4))},d+=4,s&&(t.duration=i.getUint32(d),d+=4),o&&(t.size=i.getUint32(d),d+=4),l&&(1===n.version?t.compositionTimeOffset=i.getInt32(d):t.compositionTimeOffset=i.getUint32(d),d+=4),n.samples.push(t),c--);c--;)t={},s&&(t.duration=i.getUint32(d),d+=4),o&&(t.size=i.getUint32(d),d+=4),u&&(t.flags=ln(e.subarray(d,d+4)),d+=4),l&&(1===n.version?t.compositionTimeOffset=i.getInt32(d):t.compositionTimeOffset=i.getUint32(d),d+=4),n.samples.push(t);return n},dn=W.getUint64,pn=function(e){return new Date(1e3*e-20828448e5)},fn=Qt,mn=function(e){var t,n,i=new DataView(e.buffer,e.byteOffset,e.byteLength),r=[];for(t=0;t+4<e.length;t+=n)if(n=i.getUint32(t),t+=4,n<=0)r.push("<span style='color:red;'>MALFORMED DATA</span>");else switch(31&e[t]){case 1:r.push("slice_layer_without_partitioning_rbsp");break;case 5:r.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:r.push("sei_rbsp");break;case 7:r.push("seq_parameter_set_rbsp");break;case 8:r.push("pic_parameter_set_rbsp");break;case 9:r.push("access_unit_delimiter_rbsp");break;default:r.push("UNKNOWN NAL - "+e[t]&31)}return r},gn={avc1:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{dataReferenceIndex:t.getUint16(6),width:t.getUint16(24),height:t.getUint16(26),horizresolution:t.getUint16(28)+t.getUint16(30)/16,vertresolution:t.getUint16(32)+t.getUint16(34)/16,frameCount:t.getUint16(40),depth:t.getUint16(74),config:Wt(e.subarray(78,e.byteLength))}},avcC:function(e){var t,n,i,r,a=new DataView(e.buffer,e.byteOffset,e.byteLength),s={configurationVersion:e[0],avcProfileIndication:e[1],profileCompatibility:e[2],avcLevelIndication:e[3],lengthSizeMinusOne:3&e[4],sps:[],pps:[]},o=31&e[5];for(i=6,r=0;r<o;r++)n=a.getUint16(i),i+=2,s.sps.push(new Uint8Array(e.subarray(i,i+n))),i+=n;for(t=e[i],i++,r=0;r<t;r++)n=a.getUint16(i),i+=2,s.pps.push(new Uint8Array(e.subarray(i,i+n))),i+=n;return s},btrt:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{bufferSizeDB:t.getUint32(0),maxBitrate:t.getUint32(4),avgBitrate:t.getUint32(8)}},edts:function(e){return{boxes:Wt(e)}},elst:function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:n.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),edits:[]},r=n.getUint32(4);for(t=8;r;r--)0===i.version?(i.edits.push({segmentDuration:n.getUint32(t),mediaTime:n.getInt32(t+4),mediaRate:n.getUint16(t+8)+n.getUint16(t+10)/65536}),t+=12):(i.edits.push({segmentDuration:dn(e.subarray(t)),mediaTime:dn(e.subarray(t+8)),mediaRate:n.getUint16(t+16)+n.getUint16(t+18)/65536}),t+=20);return i},esds:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),esId:e[6]<<8|e[7],streamPriority:31&e[8],decoderConfig:{objectProfileIndication:e[11],streamType:e[12]>>>2&63,bufferSize:e[13]<<16|e[14]<<8|e[15],maxBitrate:e[16]<<24|e[17]<<16|e[18]<<8|e[19],avgBitrate:e[20]<<24|e[21]<<16|e[22]<<8|e[23],decoderConfigDescriptor:{tag:e[24],length:e[25],audioObjectType:e[26]>>>3&31,samplingFrequencyIndex:(7&e[26])<<1|e[27]>>>7&1,channelConfiguration:e[27]>>>3&15}}}},ftyp:function(e){for(var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n={majorBrand:fn(e.subarray(0,4)),minorVersion:t.getUint32(4),compatibleBrands:[]},i=8;i<e.byteLength;)n.compatibleBrands.push(fn(e.subarray(i,i+4))),i+=4;return n},dinf:function(e){return{boxes:Wt(e)}},dref:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),dataReferences:Wt(e.subarray(8))}},hdlr:function(e){var t={version:new DataView(e.buffer,e.byteOffset,e.byteLength).getUint8(0),flags:new Uint8Array(e.subarray(1,4)),handlerType:fn(e.subarray(8,12)),name:""},n=8;for(n=24;n<e.byteLength;n++){if(0===e[n]){n++;break}t.name+=String.fromCharCode(e[n])}return t.name=decodeURIComponent(escape(t.name)),t},mdat:function(e){return{byteLength:e.byteLength,nals:mn(e)}},mdhd:function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength),i=4,r={version:n.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),language:""};return 1===r.version?(i+=4,r.creationTime=pn(n.getUint32(i)),i+=8,r.modificationTime=pn(n.getUint32(i)),i+=4,r.timescale=n.getUint32(i),i+=8,r.duration=n.getUint32(i)):(r.creationTime=pn(n.getUint32(i)),i+=4,r.modificationTime=pn(n.getUint32(i)),i+=4,r.timescale=n.getUint32(i),i+=4,r.duration=n.getUint32(i)),i+=4,t=n.getUint16(i),r.language+=String.fromCharCode(96+(t>>10)),r.language+=String.fromCharCode(96+((992&t)>>5)),r.language+=String.fromCharCode(96+(31&t)),r},mdia:function(e){return{boxes:Wt(e)}},mfhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sequenceNumber:e[4]<<24|e[5]<<16|e[6]<<8|e[7]}},minf:function(e){return{boxes:Wt(e)}},mp4a:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n={dataReferenceIndex:t.getUint16(6),channelcount:t.getUint16(16),samplesize:t.getUint16(18),samplerate:t.getUint16(24)+t.getUint16(26)/65536};return e.byteLength>28&&(n.streamDescriptor=Wt(e.subarray(28))[0]),n},moof:function(e){return{boxes:Wt(e)}},moov:function(e){return{boxes:Wt(e)}},mvex:function(e){return{boxes:Wt(e)}},mvhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=4,i={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};return 1===i.version?(n+=4,i.creationTime=pn(t.getUint32(n)),n+=8,i.modificationTime=pn(t.getUint32(n)),n+=4,i.timescale=t.getUint32(n),n+=8,i.duration=t.getUint32(n)):(i.creationTime=pn(t.getUint32(n)),n+=4,i.modificationTime=pn(t.getUint32(n)),n+=4,i.timescale=t.getUint32(n),n+=4,i.duration=t.getUint32(n)),n+=4,i.rate=t.getUint16(n)+t.getUint16(n+2)/16,n+=4,i.volume=t.getUint8(n)+t.getUint8(n+1)/8,n+=2,
vendor: 4,274 bytes, line 2
2n+=2,n+=8,i.matrix=new Uint32Array(e.subarray(n,n+36)),n+=36,n+=24,i.nextTrackId=t.getUint32(n),i},pdin:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),rate:t.getUint32(4),initialDelay:t.getUint32(8)}},sdtp:function(e){var t,n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]};for(t=4;t<e.byteLength;t++)n.samples.push({dependsOn:(48&e[t])>>4,isDependedOn:(12&e[t])>>2,hasRedundancy:3&e[t]});return n},sidx: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=un(e.subarray(i)),n.firstOffset=un(e.subarray(i+8)),i+=16),i+=2;var r=t.getUint16(i);for(i+=2;r>0;i+=12,r--)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},smhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),balance:e[4]+e[5]/256}},stbl:function(e){return{boxes:Wt(e)}},ctts:function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:n.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),compositionOffsets:[]},r=n.getUint32(4);for(t=8;r;t+=8,r--)i.compositionOffsets.push({sampleCount:n.getUint32(t),sampleOffset:n[0===i.version?"getUint32":"getInt32"](t+4)});return i},stss:function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:n.getUint8(0),flags:new Uint8Array(e.subarray(1,4)),syncSamples:[]},r=n.getUint32(4);for(t=8;r;t+=4,r--)i.syncSamples.push(n.getUint32(t));return i},stco:function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),chunkOffsets:[]},r=n.getUint32(4);for(t=8;r;t+=4,r--)i.chunkOffsets.push(n.getUint32(t));return i},stsc:function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength),i=n.getUint32(4),r={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleToChunks:[]};for(t=8;i;t+=12,i--)r.sampleToChunks.push({firstChunk:n.getUint32(t),samplesPerChunk:n.getUint32(t+4),sampleDescriptionIndex:n.getUint32(t+8)});return r},stsd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleDescriptions:Wt(e.subarray(8))}},stsz:function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleSize:n.getUint32(4),entries:[]};for(t=12;t<e.byteLength;t+=4)i.entries.push(n.getUint32(t));return i},stts:function(e){var t,n=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),timeToSamples:[]},r=n.getUint32(4);for(t=8;r;t+=8,r--)i.timeToSamples.push({sampleCount:n.getUint32(t),sampleDelta:n.getUint32(t+4)});return i},styp:function(e){return gn.ftyp(e)},tfdt:an,tfhd:on,tkhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=4,i={version:t.getUint8(0),flags:new Uint8Array(e.subarray(1,4))};return 1===i.version?(n+=4,i.creationTime=pn(t.getUint32(n)),n+=8,i.modificationTime=pn(t.getUint32(n)),n+=4,i.trackId=t.getUint32(n),n+=4,n+=8,i.duration=t.getUint32(n)):(i.creationTime=pn(t.getUint32(n)),n+=4,i.modificationTime=pn(t.getUint32(n)),n+=4,i.trackId=t.getUint32(n),n+=4,n+=4,i.duration=t.getUint32(n)),n+=4,n+=8,i.layer=t.getUint16(n),n+=2,i.alternateGroup=t.getUint16(n),n+=2,i.volume=t.getUint8(n)+t.getUint8(n+1)/8,n+=2,n+=2,i.matrix=new Uint32Array(e.subarray(n,n+36)),n+=36,i.width=t.getUint16(n)+t.getUint16(n+2)/65536,n+=4,i.height=t.getUint16(n)+t.getUint16(n+2)/65536,i},traf:function(e){return{boxes:Wt(e)}},trak:function(e){return{boxes:Wt(e)}},trex:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:t.getUint32(4),defaultSampleDescriptionIndex:t.getUint32(8),defaultSampleDuration:t.getUint32(12),defaultSampleSize:t.getUint32(16),sampleDependsOn:3&e[20],sampleIsDependedOn:(192&e[21])>>6,sampleHasRedundancy:(48&e[21])>>4,samplePaddingValue:(14&e[21])>>
vendor: 5,945 bytes, line 2
21,sampleIsDifferenceSample:!!(1&e[21]),sampleDegradationPriority:t.getUint16(22)}},trun:cn,"url ":function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4))}},vmhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),graphicsmode:t.getUint16(4),opcolor:new Uint16Array([t.getUint16(6),t.getUint16(8),t.getUint16(10)])}}};Wt=function(e){for(var t,n,i,r,a,s=0,o=[],u=new ArrayBuffer(e.length),l=new Uint8Array(u),c=0;c<e.length;++c)l[c]=e[c];for(t=new DataView(u);s<e.byteLength;)n=t.getUint32(s),i=fn(e.subarray(s+4,s+8)),r=n>1?s+n:e.byteLength,(a=(gn[i]||function(e){return{data:e}})(e.subarray(s+8,r))).size=n,a.type=i,o.push(a),s=r;return o},Gt=function(e,t){var n;return t=t||0,n=new Array(2*t+1).join(" "),e.map(function(e,i){return n+e.type+"\n"+Object.keys(e).filter(function(e){return"type"!==e&&"boxes"!==e}).map(function(t){var i=n+"  "+t+": ",r=e[t];if(r instanceof Uint8Array||r instanceof Uint32Array){var a=Array.prototype.slice.call(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)).map(function(e){return" "+("00"+e.toString(16)).slice(-2)}).join("").match(/.{1,24}/g);return a?1===a.length?i+"<"+a.join("").slice(1)+">":i+"<\n"+a.map(function(e){return n+"  "+e}).join("\n")+"\n"+n+"  >":i+"<>"}return i+JSON.stringify(r,null,2).split("\n").map(function(e,t){return 0===t?e:n+"  "+e}).join("\n")}).join("\n")+(e.boxes?"\n"+Gt(e.boxes,t+1):"")}).join("\n")};var vn,yn,_n,bn,Tn,kn,Sn,wn,En={inspect:Wt,textify:Gt,parseType:fn,findBox:en,parseTraf:gn.traf,parseTfdt:gn.tfdt,parseHdlr:gn.hdlr,parseTfhd:gn.tfhd,parseTrun:gn.trun,parseSidx:gn.sidx},Cn=function(e){for(var t=0,n=String.fromCharCode(e[t]),i="";"\0"!==n;)i+=n,t++,n=String.fromCharCode(e[t]);return i+=n},In=W.getUint64,xn=function(e,t){var n="\0"!==t.scheme_id_uri,i=0===e&&An(t.presentation_time_delta)&&n,r=1===e&&An(t.presentation_time)&&n;return!(e>1)&&i||r},An=function(e){return void 0!==e||null!==e},Dn={parseEmsgBox:function(e){var t,n,i,r,a,s,o,u=4,l=e[0];if(0===l)u+=(t=Cn(e.subarray(u))).length,u+=(n=Cn(e.subarray(u))).length,i=(c=new DataView(e.buffer)).getUint32(u),u+=4,a=c.getUint32(u),u+=4,s=c.getUint32(u),u+=4,o=c.getUint32(u),u+=4;else if(1===l){var c;i=(c=new DataView(e.buffer)).getUint32(u),u+=4,r=In(e.subarray(u)),u+=8,s=c.getUint32(u),u+=4,o=c.getUint32(u),u+=4,u+=(t=Cn(e.subarray(u))).length,u+=(n=Cn(e.subarray(u))).length}var d={scheme_id_uri:t,value:n,timescale:i||1,presentation_time:r,presentation_time_delta:a,event_duration:s,id:o,message_data:new Uint8Array(e.subarray(u,e.byteLength))};return xn(l,d)?d:void 0},scaleTime:function(e,t,n,i){return e||0===e?e/t:i+n/t}},Pn=(vn="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},Kt),Ln=Yt,On=en,Rn=Qt,Mn=Dn,Nn=on,Un=cn,Bn=an,Fn=W.getUint64,qn=vn,jn=ze.parseId3Frames;yn=function(e){return On(e,["moov","trak"]).reduce(function(e,t){var n,i,r,a,s;return(n=On(t,["tkhd"])[0])?(i=n[0],a=Pn(n[r=0===i?12:20]<<24|n[r+1]<<16|n[r+2]<<8|n[r+3]),(s=On(t,["mdia","mdhd"])[0])?(r=0===(i=s[0])?12:20,e[a]=Pn(s[r]<<24|s[r+1]<<16|s[r+2]<<8|s[r+3]),e):null):null},{})},_n=function(e,t){var n=On(t,["moof","traf"]).reduce(function(t,n){var i,r,a=On(n,["tfhd"])[0],s=Pn(a[4]<<24|a[5]<<16|a[6]<<8|a[7]),o=e[s]||9e4,u=On(n,["tfdt"])[0],l=new DataView(u.buffer,u.byteOffset,u.byteLength);return"bigint"==typeof(i=1===u[0]?Fn(u.subarray(4,12)):l.getUint32(4))?r=i/qn.BigInt(o):"number"!=typeof i||isNaN(i)||(r=i/o),r<Number.MAX_SAFE_INTEGER&&(r=Number(r)),r<t&&(t=r),t},1/0);return"bigint"==typeof n||isFinite(n)?n:0},bn=function(e,t){var n,i=On(t,["moof","traf"]),r=0,a=0;if(i&&i.length){var s=On(i[0],["tfhd"])[0],o=On(i[0],["trun"])[0],u=On(i[0],["tfdt"])[0];if(s)n=Nn(s).trackId;if(u)r=Bn(u).baseMediaDecodeTime;if(o){var l=Un(o);l.samples&&l.samples.length&&(a=l.samples[0].compositionTimeOffset||0)}}var c=e[n]||9e4;"bigint"==typeof r&&(a=qn.BigInt(a),c=qn.BigInt(c));var d=(r+a)/c;return"bigint"==typeof d&&d<Number.MAX_SAFE_INTEGER&&(d=Number(d)),d},Tn=function(e){var t=On(e,["moov","trak"]),n=[];return t.forEach(function(e){var t=On(e,["mdia","hdlr"]),i=On(e,["tkhd"]);t.forEach(function(e,t){var r,a,s=Rn(e.subarray(8,12)),o=i[t];"vide"===s&&(a=0===(r=new DataView(o.buffer,o.byteOffset,o.byteLength)).getUint8(0)?r.getUint32(12):r.getUint32(20),n.push(a))})}),n},Sn=function(e){var t=0===e[0]?12:20;return Pn(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])},kn=function(e){var t=On(e,["moov","trak"]),n=[];return t.forEach(function(e){var t,i,r={},a=On(e,["tkhd"])[0];a&&(i=(t=new DataView(a.buffer,a.byteOffset,a.byteLength)).getUint8(0),r.id=0===i?t.getUint32(12):t.getUint32(20));var s=On(e,["mdia","hdlr"])[0];if(s){var o=Rn(s.subarray(8,12));r.type="vide"===o?"video":"soun"===o?"audio":o}var u=On(e,["mdia","minf","stbl","stsd"])[0];if(u){var l=u.subarray(8);r.codec=Rn(l.subarray(4,8));var c,d=On(l,[r.codec])[0];d&&(/^[asm]vc[1-9]$/i.test(r.codec)?(c=d.subarray(78),"avcC"===Rn(c.subarray(4,8))&&c.length>11?(r.codec+=".",r.codec+=Ln(c[9]),r.codec+=Ln(c[10]),r.codec+=Ln(c[11])):r.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(r.codec)?(c=d.subarray(28),"esds"===Rn(c.subarray(4,8))&&c.length>20&&0!==c[19]?(r.codec+="."+Ln(c[19]),r.codec+="."+Ln(c[20]>>>2&63).replace(/^0/,"")):r.codec="mp4a.40.2"):r.codec=r.codec.toLowerCase())}var h=On(e,["mdia","mdhd"])[0];h&&(r.timescale=Sn(h)),n.push(r)}),n},wn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return On(e,["emsg"]).map(function(e){var n=Mn.parseEmsgBox(new Uint8Array(e)),i=jn(n.message_data);return{cueTime:Mn.scaleTime(n.presentation_time,n.timescale,n.presentation_time_delta,t),duration:Mn.scaleTime(n.event_duration,n.timescale),frames:i}})};var Hn={findBox:On,parseType:Rn,timescale:yn,startTime:_n,compositionStartTime:bn,videoTrackIds:Tn,tracks:kn,getTimescaleFromMediaHeader:Sn,getEmsgID3:wn},Vn=En.parseTrun,zn=Hn.findBox,Wn=vn,Gn=function(e){var t=zn(e,["moof","traf"]),n=zn(e,["mdat"]),i=[];
vendor: 8,400 bytes, line 2
2return n.forEach(function(e,n){var r=t[n];i.push({mdat:e,traf:r})}),i},Xn=function(e,t,n){var i=t,r=n.defaultSampleDuration||0,a=n.defaultSampleSize||0,s=n.trackId,o=[];return e.forEach(function(e){var t=Vn(e).samples;t.forEach(function(e){void 0===e.duration&&(e.duration=r),void 0===e.size&&(e.size=a),e.trackId=s,e.dts=i,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),"bigint"==typeof i?(e.pts=i+Wn.BigInt(e.compositionTimeOffset),i+=Wn.BigInt(e.duration)):(e.pts=i+e.compositionTimeOffset,i+=e.duration)}),o=o.concat(t)}),o},Kn=fe.discardEmulationPreventionBytes,Yn=xe.CaptionStream,Qn=en,$n=an,Jn=on,Zn=Gn,ei=Xn,ti=function(e,t){for(var n=e,i=0;i<t.length;i++){var r=t[i];if(n<r.size)return r;n-=r.size}return null},ni=function(e,t){var n={};return Zn(e).forEach(function(e){var i,r=e.mdat,a=e.traf,s=Qn(a,["tfhd"]),o=Jn(s[0]),u=o.trackId,l=Qn(a,["tfdt"]),c=l.length>0?$n(l[0]).baseMediaDecodeTime:0,d=Qn(a,["trun"]);t===u&&d.length>0&&(i=function(e,t,n){var i,r,a,s,o=new DataView(e.buffer,e.byteOffset,e.byteLength),u={logs:[],seiNals:[]};for(r=0;r+4<e.length;r+=a)if(a=o.getUint32(r),r+=4,!(a<=0))switch(31&e[r]){case 6:var l=e.subarray(r+1,r+1+a),c=ti(r,t);if(i={nalUnitType:"sei_rbsp",size:a,data:l,escapedRBSP:Kn(l),trackId:n},c)i.pts=c.pts,i.dts=c.dts,s=c;else{if(!s){u.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+r+" for trackId "+n+". See mux.js#223."});break}i.pts=s.pts,i.dts=s.dts}u.seiNals.push(i)}return u}(r,ei(d,c,o),u),n[u]||(n[u]={seiNals:[],logs:[]}),n[u].seiNals=n[u].seiNals.concat(i.seiNals),n[u].logs=n[u].logs.concat(i.logs))}),n},ii=function(){var e,t,n,i,r,a,s=!1;this.isInitialized=function(){return s},this.init=function(t){e=new Yn,s=!0,a=!!t&&t.isPartial,e.on("data",function(e){e.startTime=e.startPts/i,e.endTime=e.endPts/i,r.captions.push(e),r.captionStreams[e.stream]=!0}),e.on("log",function(e){r.logs.push(e)})},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"===hn(t)&&0===Object.keys(t).length)&&(n!==e[0]||i!==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],i=s[n];else if(null===n||!i)return t.push(e),null;for(;t.length>0;){var u=t.shift();this.parse(u,a,s)}return o=function(e,t,n){if(null===t)return null;var i=ni(e,t)[t]||{};return{seiNals:i.seiNals,logs:i.logs,timescale:n}}(e,n,i),o&&o.logs&&(r.logs=r.logs.concat(o.logs)),null!==o&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),r):r.logs.length?{logs:r.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(){r.captions=[],r.captionStreams={},r.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],n=null,i=null,r?this.clearParsedCaptions():r={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},ri=En.parseTfdt,ai=en,si=Hn.getTimescaleFromMediaHeader,oi=Xn,ui=Gn,li=function(){var e=9e4;this.init=function(t){var n=ai(t,["moov","trak","mdia","mdhd"])[0];n&&(e=si(n))},this.parseSegment=function(t){var n=[],i=ui(t),r=0;return i.forEach(function(t){var i=t.mdat,a=t.traf,s=ai(a,["tfdt"])[0],o=ai(a,["tfhd"])[0],u=ai(a,["trun"]);if(s){var l=ri(s);r=l.baseMediaDecodeTime}if(u.length&&o){var c=oi(u,r,o),d=0;c.forEach(function(t){var r=new TextDecoder("utf-8"),a=i.slice(d,d+t.size);ai(a,["vtte"])[0]?d+=t.size:(ai(a,["vttc"]).forEach(function(i){var a,s,o=ai(i,["payl"])[0],u=ai(i,["sttg"])[0],l=t.pts/e,c=(t.pts+t.duration)/e;if(o)try{a=r.decode(o)}catch(e){console.error(e)}if(u)try{s=r.decode(u)}catch(e){console.error(e)}t.duration&&a&&n.push({cueText:a,start:l,end:c,settings:s})}),d+=t.size)})}}),n}},ci=Ae,di=function(e){var t=31&e[1];return t<<=8,t|=e[2]},hi=function(e){return!!(64&e[1])},pi=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},fi=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}},mi={parseType:function(e,t){var n=di(e);return 0===n?"pat":n===t?"pmt":t?"pes":null},parsePat:function(e){var t=hi(e),n=4+pi(e);return t&&(n+=e[n]+1),(31&e[n+10])<<8|e[n+11]},parsePmt:function(e){var t={},n=hi(e),i=4+pi(e);if(n&&(i+=e[i]+1),1&e[i+5]){var r;r=3+((15&e[i+1])<<8|e[i+2])-4;for(var a=12+((15&e[i+10])<<8|e[i+11]);a<r;){var s=i+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:hi,parsePesType:function(e,t){switch(t[di(e)]){case ci.H264_STREAM_TYPE:return"video";case ci.ADTS_STREAM_TYPE:return"audio";case ci.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(e){if(!hi(e))return null;var t=4+pi(e);if(t>=e.byteLength)return null;var n,i=null;return 192&(n=e[t+7])&&((i={}).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,i.pts*=4,i.pts+=(6&e[t+13])>>>1,i.dts=i.pts,64&n&&(i.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,i.dts*=4,i.dts+=(6&e[t+18])>>>1)),i},videoPacketContainsKeyFrame:function(e){for(var t=4+pi(e),n=e.subarray(t),i=0,r=0,a=!1;r<n.byteLength-3;r++)if(1===n[r+2]){i=r+5;break}for(;i<n.byteLength;)switch(n[i]){case 0:if(0!==n[i-1]){i+=2;break}if(0!==n[i-2]){i++;break}r+3!==i-2&&"slice_layer_without_partitioning_rbsp_idr"===fi(31&n[r+3])&&(a=!0);do{i++}while(1!==n[i]&&i<n.length);r=i-2,i+=3;break;case 1:if(0!==n[i-1]||0!==n[i-2]){i+=3;break}"slice_layer_without_partitioning_rbsp_idr"===fi(31&n[r+3])&&(a=!0),r=i-2,i+=3;break;default:i+=3}return n=n.subarray(r),i-=r,r=0,n&&n.byteLength>3&&"slice_layer_without_partitioning_rbsp_idr"===fi(31&n[r+3])&&(a=!0),a}},gi=Ae,vi=Me.handleRollover,yi={};yi.ts=mi,yi.aac=Tt;var _i=ue.ONE_SECOND_IN_TS,bi=188,Ti=71,ki=function(e,t,n){for(var i,r,a,s,o=0,u=bi,l=!1;u<=e.byteLength;)if(e[o]!==Ti||e[u]!==Ti&&u!==e.byteLength)o++,u++;else{if(i=e.subarray(o,u),"pes"===yi.ts.parseType(i,t.pid))r=yi.ts.parsePesType(i,t.table),a=yi.ts.parsePayloadUnitStartIndicator(i),"audio"===r&&a&&(s=yi.ts.parsePesTime(i))&&(s.type="audio",n.audio.push(s),l=!0);if(l)break;o+=bi,u+=bi}for(o=(u=e.byteLength)-bi,l=!1;o>=0;)if(e[o]!==Ti||e[u]!==Ti&&u!==e.byteLength)o--,u--;else{if(i=e.subarray(o,u),"pes"===yi.ts.parseType(i,t.pid))r=yi.ts.parsePesType(i,t.table),a=yi.ts.parsePayloadUnitStartIndicator(i),"audio"===r&&a&&(s=yi.ts.parsePesTime(i))&&(s.type="audio",n.audio.push(s),l=!0);if(l)break;o-=bi,u-=bi}},Si=function(e,t,n){for(var i,r,a,s,o,u,l,c=0,d=bi,h=!1,p={data:[],size:0};d<e.byteLength;)if(e[c]!==Ti||e[d]!==Ti)c++,d++;else{if(i=e.subarray(c,d),"pes"===yi.ts.parseType(i,t.pid))if(r=yi.ts.parsePesType(i,t.table),a=yi.ts.parsePayloadUnitStartIndicator(i),"video"===r&&(a&&!h&&(s=yi.ts.parsePesTime(i))&&(s.type="video",n.video.push(s),h=!0),!n.firstKeyFrame)){if(a&&0!==p.size){for(o=new Uint8Array(p.size),u=0;p.data.length;)l=p.data.shift(),o.set(l,u),u+=l.byteLength;if(yi.ts.videoPacketContainsKeyFrame(o)){var f=yi.ts.parsePesTime(o);f?(n.firstKeyFrame=f,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.")}p.size=0}p.data.push(i),p.size+=i.byteLength}if(h&&n.firstKeyFrame)break;c+=bi,d+=bi}for(c=(d=e.byteLength)-bi,h=!1;c>=0;)if(e[c]!==Ti||e[d]!==Ti)c--,d--;else{if(i=e.subarray(c,d),"pes"===yi.ts.parseType(i,t.pid))r=yi.ts.parsePesType(i,t.table),a=yi.ts.parsePayloadUnitStartIndicator(i),"video"===r&&a&&(s=yi.ts.parsePesTime(i))&&(s.type="video",n.video.push(s),h=!0);if(h)break;c-=bi,d-=bi}},wi=function(e){var t={pid:null,table:null},n={};for(var i in function(e,t){for(var n,i=0,r=bi;r<e.byteLength;)if(e[i]!==Ti||e[r]!==Ti)i++,r++;else{switch(n=e.subarray(i,r),yi.ts.parseType(n,t.pid)){case"pat":t.pid=yi.ts.parsePat(n);break;case"pmt":var a=yi.ts.parsePmt(n);t.table=t.table||{}
2,Object.keys(a).forEach(function(e){t.table[e]=a[e]})}i+=bi,r+=bi}}(e,t),t.table){if(t.table.hasOwnProperty(i))switch(t.table[i]){case gi.H264_STREAM_TYPE:n.video=[],Si(e,t,n),0===n.video.length&&delete n.video;break;case gi.ADTS_STREAM_TYPE:n.audio=[],ki(e,t,n),0===n.audio.length&&delete n.audio}}return n},Ei=function(e,t){var n;return n=yi.aac.isLikelyAacData(e)?function(e){for(var t,n=!1,i=0,r=null,a=null,s=0,o=0;e.length-o>=3;){switch(yi.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10){n=!0;break}if((s=yi.aac.parseId3TagSize(e,o))>e.length){n=!0;break}null===a&&(t=e.subarray(o,o+s),a=yi.aac.parseAacTimestamp(t)),o+=s;break;case"audio":if(e.length-o<7){n=!0;break}if((s=yi.aac.parseAdtsSize(e,o))>e.length){n=!0;break}null===r&&(t=e.subarray(o,o+s),r=yi.aac.parseSampleRate(t)),i++,o+=s;break;default:o++}if(n)return null}if(null===r||null===a)return null;var u=_i/r;return{audio:[{type:"audio",dts:a,pts:a},{type:"audio",dts:a+1024*i*u,pts:a+1024*i*u}]}}(e):wi(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=vi(e.dts,n),e.pts=vi(e.pts,n),e.dtsTime=e.dts/_i,e.ptsTime=e.pts/_i})}if(e.video&&e.video.length){var i=t;if((void 0===i||isNaN(i))&&(i=e.video[0].dts),e.video.forEach(function(e){e.dts=vi(e.dts,i),e.pts=vi(e.pts,i),e.dtsTime=e.dts/_i,e.ptsTime=e.pts/_i}),e.firstKeyFrame){var r=e.firstKeyFrame;r.dts=vi(r.dts,i),r.pts=vi(r.pts,i),r.dtsTime=r.dts/_i,r.ptsTime=r.pts/_i}}}(n,t),n):null},Ci=function(){return sn(function e(t,n){rn(this,e),this.options=n||{},this.self=t,this.init()},[{key:"init",value:function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Xt.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 i=t.data;t.data=i.buffer,e.postMessage({action:"data",segment:t,byteOffset:i.byteOffset,byteLength:i.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.videoTsToSeconds(t.start.dts),presentation:ue.videoTsToSeconds(t.start.pts)},end:{decode:ue.videoTsToSeconds(t.end.dts),presentation:ue.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:ue.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(n.prependedContentDuration=ue.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:n})}),t.on("audioSegmentTimingInfo",function(t){var n={start:{decode:ue.videoTsToSeconds(t.start.dts),presentation:ue.videoTsToSeconds(t.start.pts)},end:{decode:ue.videoTsToSeconds(t.end.dts),presentation:ue.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:ue.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(n.prependedContentDuration=ue.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:ue.videoTsToSeconds(t.start),end:ue.videoTsToSeconds(t.end)}})}),t.on("videoTimingInfo",function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:ue.videoTsToSeconds(t.start),end:ue.videoTsToSeconds(t.end)}})}),t.on("log",function(t){e.postMessage({action:"log",log:t})})}(this.self,this.transmuxer)}},{key:"pushMp4Captions",value:function(e){this.captionParser||(this.captionParser=new ii,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])}},{key:"initMp4WebVttParser",value:function(e){this.webVttParser||(this.webVttParser=new li);var t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.webVttParser.init(t)}},{key:"getMp4WebVttText",value:function(e){this.webVttParser||(this.webVttParser=new li);var t=new Uint8Array(e.data,e.byteOffset,e.byteLength),n=this.webVttParser.parseSegment(t);this.self.postMessage({action:"getMp4WebVttText",mp4VttCues:n||[],data:t.buffer},[t.buffer])}},{key:"probeMp4StartTime",value:function(e){var t=e.timescales,n=e.data,i=Hn.startTime(t,n);this.self.postMessage({action:"probeMp4StartTime",startTime:i,data:n},[n.buffer])}},{key:"probeMp4Tracks",value:function(e){var t=e.data,n=Hn.tracks(t);this.self.postMessage({action:"probeMp4Tracks",tracks:n,data:t},[t.buffer])}},{key:"probeEmsgID3",value:function(e){var t=e.data,n=e.offset,i=Hn.getEmsgID3(t,n);this.self.postMessage({action:"probeEmsgID3",id3Frames:i,emsgData:t},[t.buffer])}},{key:"probeTs",value:function(e){var t=e.data,n=e.baseStartTime,i="number"!=typeof n||isNaN(n)?void 0:n*ue.ONE_SECOND_IN_TS,r=Ei(t,i),a=null;r&&((a={hasVideo:r.video&&2===r.video.length||!1,hasAudio:r.audio&&2===r.audio.length||!1}).hasVideo&&(a.videoStart=r.video[0].ptsTime),a.hasAudio&&(a.audioStart=r.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:a,data:t},[t.buffer])}},{key:"clearAllMp4Captions",value:function(){this.captionParser&&this.captionParser.clearAllCaptions()}},{key:"clearParsedMp4Captions",value:function(){this.captionParser&&this.captionParser.clearParsedCaptions()}},{key:"push",value:function(e){var t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)}},{key:"reset",value:function(){this.transmuxer.reset()}},{key:"setTimestampOffset",value:function(e){var t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(ue.secondsToVideoTs(t)))}},{key:"setAudioAppendStart",value:function(e){this.transmuxer.setAudioAppendStart(Math.ceil(ue.secondsToVideoTs(e.appendStart)))}},{key:"setRemux",value:function(e){this.transmuxer.setRemux(e.remux)}},{key:"flush",value:function(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}},{key:"endTimeline",value:function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}},{key:"alignGopsWith",value:function(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())}}])}();
2self.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new Ci(self,e.data.options):(this.messageHandlers||(this.messageHandlers=new Ci(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}})),Nl=Ll(Ml),Ul=function(e){var t=e.transmuxer,n=e.bytes,i=e.audioAppendStart,r=e.gopsToAlignWith,a=e.remux,s=e.onData,o=e.onTrackInfo,u=e.onAudioTimingInfo,l=e.onVideoTimingInfo,c=e.onVideoSegmentTimingInfo,d=e.onAudioSegmentTimingInfo,h=e.onId3,p=e.onCaptions,f=e.onDone,m=e.onEndedTimeline,g=e.onTransmuxerLog,v=e.isEndOfTimeline,y=e.segment,_=e.triggerSegmentEventFn,b={buffer:[]},T=v;if(t.onmessage=function(n){t.currentTransmux===e&&("data"===n.data.action&&function(e,t,n){var i=e.data.segment,r=i.type,a=i.initSegment,s=i.captions,o=i.captionStreams,u=i.metadata,l=i.videoFrameDtsTime,c=i.videoFramePtsTime;t.buffer.push({captions:s,captionStreams:o,metadata:u});var d=e.data.segment.boxes||{data:e.data.segment.data},h={type:r,data:new Uint8Array(d.data,d.data.byteOffset,d.data.byteLength),initSegment:new Uint8Array(a.data,a.byteOffset,a.byteLength)};void 0!==l&&(h.videoFrameDtsTime=l),void 0!==c&&(h.videoFramePtsTime=c),n(h)}(n,b,s),"trackinfo"===n.data.action&&o(n.data.trackInfo),"gopInfo"===n.data.action&&function(e,t){t.gopInfo=e.data.gopInfo}(n,b),"audioTimingInfo"===n.data.action&&u(n.data.audioTimingInfo),"videoTimingInfo"===n.data.action&&l(n.data.videoTimingInfo),"videoSegmentTimingInfo"===n.data.action&&c(n.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===n.data.action&&d(n.data.audioSegmentTimingInfo),"id3Frame"===n.data.action&&h([n.data.id3Frame],n.data.id3Frame.dispatchType),"caption"===n.data.action&&p(n.data.caption),"endedtimeline"===n.data.action&&(T=!1,m()),"log"===n.data.action&&g(n.data.log),"transmuxed"===n.data.type&&(T||(t.onmessage=null,function(e){var t=e.transmuxedData,n=e.callback;t.buffer=[],n(t)}({transmuxedData:b,callback:f}),Bl(t))))},t.onerror=function(){var e={message:"Received an error message from the transmuxer worker",metadata:{errorType:Zo.Error.StreamingFailedToTransmuxSegment,segmentInfo:Ic({segment:y})}};f(null,e)},i&&t.postMessage({action:"setAudioAppendStart",appendStart:i}),Array.isArray(r)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),void 0!==a&&t.postMessage({action:"setRemux",remux:a}),n.byteLength){var k=n instanceof ArrayBuffer?n:n.buffer,S=n instanceof ArrayBuffer?0:n.byteOffset;_({type:"segmenttransmuxingstart",segment:y}),t.postMessage({action:"push",data:k,byteOffset:S,byteLength:n.byteLength},[k])}v&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},Bl=function(e){e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():Ul(e.currentTransmux))},Fl=function(e,t){e.postMessage({action:t}),Bl(e)},ql=function(e,t){if(!t.currentTransmux)return t.currentTransmux=e,void Fl(t,e);t.transmuxQueue.push(Fl.bind(null,t,e))},jl=function(e){if(!e.transmuxer.currentTransmux)return e.transmuxer.currentTransmux=e,void Ul(e);e.transmuxer.transmuxQueue.push(e)},Hl=function(e){ql("reset",e)},Vl=function(e){var t=new Nl;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},zl=function(e){var t=e.transmuxer,n=e.endAction||e.action,i=e.callback,r=f({},e,{endAction:null,transmuxer:null,callback:null}),a=function(r){r.data.action===n&&(t.removeEventListener("message",a),r.data.data&&(r.data.data=new Uint8Array(r.data.data,e.byteOffset||0,e.byteLength||r.data.data.byteLength),e.data&&(e.data=r.data.data)),i(r.data))};if(t.addEventListener("message",a),e.data){var s=e.data instanceof ArrayBuffer;r.byteOffset=s?0:e.data.byteOffset,r.byteLength=e.data.byteLength;var o=[s?e.data:e.data.buffer];t.postMessage(r,o)}else t.postMessage(r)},Wl=2,Gl=-101,Xl=-102,Kl="wvtt",Yl=function(e){e.forEach(function(e){e.abort()})},Ql=function(e,t){var n=t.requestType,i=Gu({requestType:n,request:t,error:e});return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:Gl,xhr:t,metadata:i}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:Xl,xhr:t,metadata:i}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:Wl,xhr:t,metadata:i}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:Wl,xhr:t,metadata:i}:null},$l=function(e,t,n,i){return function(r,a){var s=a.response,o=Ql(r,a);if(o)return n(o,e);if(16!==s.byteLength)return n({status:a.status,message:"Invalid HLS key at URL: "+a.uri,code:Wl,xhr:a},e);for(var u=new DataView(s),l=new Uint32Array([u.getUint32(0),u.getUint32(4),u.getUint32(8),u.getUint32(12)]),c=0;c<t.length;c++)t[c].bytes=l;var d={uri:a.uri};return i({type:"segmentkeyloadcomplete",segment:e,keyInfo:d}),n(null,e)}},Jl=function(e,t){var n=qt(e.map.bytes);if("mp4"!==n){var i=e.map.resolvedUri||e.map.uri,r=n||"unknown";return t({internal:!0,message:"Found unsupported ".concat(r," container for initialization segment at URL: ").concat(i),code:Wl,metadata:{mediaType:r}})}zl({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:function(n){var i=n.tracks,r=n.data;
2return e.map.bytes=r,i.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),"text"===t.type&&function(e,t){t===Kl&&e.transmuxer.postMessage({action:"initMp4WebVttParser",data:e.map.bytes})}(e,t.codec))}),t(null)}})},Zl=function(e){var t=e.segment,n=e.finishProcessingFn,i=e.responseType,r=e.triggerSegmentEventFn;return function(e,a){var s=Ql(e,a);if(s)return n(s,t);r({type:"segmentloaded",segment:t});var o="arraybuffer"!==i&&a.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}(a.responseText.substring(t.lastReachedChar||0)):a.response;return t.stats=function(e){return{bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}}(a),t.key?t.encryptedBytes=new Uint8Array(o):t.bytes=new Uint8Array(o),n(null,t)}},ec=function(e){var t=e.segment,n=e.bytes,i=e.trackInfoFn,r=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,h=e.doneFn,p=e.onTransmuxerLog,f=e.triggerSegmentEventFn,m=t.map&&t.map.tracks||{},g=Boolean(m.audio&&m.video),v=r.bind(null,t,"audio","start"),y=r.bind(null,t,"audio","end"),_=r.bind(null,t,"video","start"),b=r.bind(null,t,"video","end");zl({action:"probeTs",transmuxer:t.transmuxer,data:n,baseStartTime:t.baseStartTime,callback:function(e){t.bytes=n=e.data;var r=e.result;r&&(i(t,{hasAudio:r.hasAudio,hasVideo:r.hasVideo,isMuxed:g}),i=null),jl({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){i&&(g&&(e.isMuxed=!0),i(t,e))},onAudioTimingInfo:function(e){v&&void 0!==e.start&&(v(e.start),v=null),y&&void 0!==e.end&&y(e.end)},onVideoTimingInfo:function(e){_&&void 0!==e.start&&(_(e.start),_=null),b&&void 0!==e.end&&b(e.end)},onVideoSegmentTimingInfo:function(e){var n={pts:{start:e.start.presentation,end:e.end.presentation},dts:{start:e.start.decode,end:e.end.decode}};f({type:"segmenttransmuxingtiminginfoavailable",segment:t,timingInfo:n}),a(e)},onAudioSegmentTimingInfo:function(e){var n={pts:{start:e.start.pts,end:e.end.pts},dts:{start:e.start.dts,end:e.end.dts}};f({type:"segmenttransmuxingtiminginfoavailable",segment:t,timingInfo:n}),s(e)},onId3:function(e,n){o(t,e,n)},onCaptions:function(e){u(t,[e])},isEndOfTimeline:l,onEndedTimeline:function(){c()},onTransmuxerLog:p,onDone:function(e,n){h&&(e.type="combined"===e.type?"video":e.type,f({type:"segmenttransmuxingcomplete",segment:t}),h(n,t,e))},segment:t,triggerSegmentEventFn:f})}})},tc=function(e){var t=e.segment,n=e.bytes,i=e.trackInfoFn,r=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,h=e.doneFn,p=e.onTransmuxerLog,f=e.triggerSegmentEventFn,m=new Uint8Array(n);if(function(e){return wt(e,["moof"]).length>0}(m)){t.isFmp4=!0;var g=t.map.tracks;
2if(g.text&&(!g.audio||!g.video))return d(t,{data:m,type:"text"}),void function(e,t,n){t===Kl&&zl({action:"getMp4WebVttText",data:e.bytes,transmuxer:e.transmuxer,callback:function(t){var i=t.data,r=t.mp4VttCues;e.bytes=i,n(null,e,{mp4VttCues:r})}})}(t,g.text.codec,h);var v={isFmp4:!0,hasVideo:!!g.video,hasAudio:!!g.audio};g.audio&&g.audio.codec&&"enca"!==g.audio.codec&&(v.audioCodec=g.audio.codec),g.video&&g.video.codec&&"encv"!==g.video.codec&&(v.videoCodec=g.video.codec),g.video&&g.audio&&(v.isMuxed=!0),i(t,v);var y=function(e,n){d(t,{data:m,type:v.hasAudio&&!v.isMuxed?"audio":"video"}),n&&n.length&&o(t,n),e&&e.length&&u(t,e),h(null,t,{})};zl({action:"probeMp4StartTime",timescales:t.map.timescales,data:m,transmuxer:t.transmuxer,callback:function(e){var i=e.data,a=e.startTime;n=i.buffer,t.bytes=m=i,v.hasAudio&&!v.isMuxed&&r(t,"audio","start",a),v.hasVideo&&r(t,"video","start",a),zl({action:"probeEmsgID3",data:m,transmuxer:t.transmuxer,offset:a,callback:function(e){var i=e.emsgData,r=e.id3Frames;n=i.buffer,t.bytes=m=i,g.video&&i.byteLength&&t.transmuxer?zl({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:t.transmuxer,data:m,timescales:t.map.timescales,trackIds:[g.video.id],callback:function(e){n=e.data.buffer,t.bytes=m=e.data,e.logs.forEach(function(e){p(cu(e,{stream:"mp4CaptionParser"}))}),y(e.captions,r)}}):y(void 0,r)}})}})}else if(t.transmuxer){if(void 0===t.container&&(t.container=qt(m)),"ts"!==t.container&&"aac"!==t.container)return i(t,{hasAudio:!1,hasVideo:!1}),void h(null,t,{});ec({segment:t,bytes:n,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:h,onTransmuxerLog:p,triggerSegmentEventFn:f})}else h(null,t,{})},nc=function(e,t){var n,i=e.id,r=e.key,a=e.encryptedBytes,s=e.decryptionWorker,o=e.segment,u=e.doneFn,l=function(e){if(e.data.source===i){s.removeEventListener("message",l);var n=e.data.decrypted;t(new Uint8Array(n.bytes,n.byteOffset,n.byteLength))}};s.onerror=function(){var e="An error occurred in the decryption worker",t=Ic({segment:o}),n={message:e,metadata:{error:new Error(e),errorType:Zo.Error.StreamingFailedToDecryptSegment,segmentInfo:t,keyInfo:{uri:o.key.resolvedUri||o.map.key.resolvedUri}}};u(n,o)},s.addEventListener("message",l),n=r.bytes.slice?r.bytes.slice():new Uint32Array(Array.prototype.slice.call(r.bytes)),s.postMessage(fl({source:i,encrypted:a,key:n,iv:r.iv}),[a.buffer,n.buffer])},ic=function(e){var t=e.activeXhrs,n=e.decryptionWorker,i=e.trackInfoFn,r=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,h=e.doneFn,p=e.onTransmuxerLog,f=e.triggerSegmentEventFn,m=0,g=!1;return function(e,v){if(!g){if(e)return g=!0,Yl(t),h(e,v);if((m+=1)===t.length){var y=function(){if(v.encryptedBytes)return function(e){var t=e.decryptionWorker,n=e.segment,i=e.trackInfoFn,r=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,h=e.doneFn,p=e.onTransmuxerLog,f=e.triggerSegmentEventFn;f({type:"segmentdecryptionstart"}),nc({id:n.requestId,key:n.key,encryptedBytes:n.encryptedBytes,decryptionWorker:t,segment:n,doneFn:h},function(e){n.bytes=e,f({type:"segmentdecryptioncomplete",segment:n}),tc({segment:n,bytes:n.bytes,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:h,onTransmuxerLog:p,triggerSegmentEventFn:f})})}({decryptionWorker:n,segment:v,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:h,onTransmuxerLog:p,triggerSegmentEventFn:f});tc({segment:v,bytes:v.bytes,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:h,onTransmuxerLog:p,triggerSegmentEventFn:f})};if(v.endOfAllRequests=Date.now(),v.map&&v.map.encryptedBytes&&!v.map.bytes)return f({type:"segmentdecryptionstart",segment:v}),nc({decryptionWorker:n,id:v.requestId+"-init",encryptedBytes:v.map.encryptedBytes,key:v.map.key,segment:v,doneFn:h},function(e){v.map.bytes=e,f({type:"segmentdecryptioncomplete",segment:v}),Jl(v,function(e){if(e)return Yl(t),h(e,v);y()})});y()}}}},rc=function(e){var t=e.segment,n=e.progressFn;e.trackInfoFn,e.timingInfoFn,e.videoSegmentTimingInfoFn,e.audioSegmentTimingInfoFn,e.id3Fn,e.captionsFn,e.isEndOfTimeline,e.endedT
2imelineFn,e.dataFn;return function(e){if(!e.target.aborted)return t.stats=cu(t.stats,function(e){var 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}(e)),!t.stats.firstBytesReceivedAt&&t.stats.bytesReceived&&(t.stats.firstBytesReceivedAt=Date.now()),n(e,t)}},ac=function(e){var t=e.xhr,n=e.xhrOptions,i=e.decryptionWorker,r=e.segment,a=e.abortFn,s=e.progressFn,o=e.trackInfoFn,u=e.timingInfoFn,l=e.videoSegmentTimingInfoFn,c=e.audioSegmentTimingInfoFn,d=e.id3Fn,h=e.captionsFn,p=e.isEndOfTimeline,f=e.endedTimelineFn,m=e.dataFn,g=e.doneFn,v=e.onTransmuxerLog,y=e.triggerSegmentEventFn,_=[],b=ic({activeXhrs:_,decryptionWorker:i,trackInfoFn:o,timingInfoFn:u,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:d,captionsFn:h,isEndOfTimeline:p,endedTimelineFn:f,dataFn:m,doneFn:g,onTransmuxerLog:v,triggerSegmentEventFn:y});if(r.key&&!r.key.bytes){var T=[r.key];r.map&&!r.map.bytes&&r.map.key&&r.map.key.resolvedUri===r.key.resolvedUri&&T.push(r.map.key);var k=cu(n,{uri:r.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),S=$l(r,T,b,y);y({type:"segmentkeyloadstart",segment:r,keyInfo:{uri:r.key.resolvedUri}});var w=t(k,S);_.push(w)}if(r.map&&!r.map.bytes){if(r.map.key&&(!r.key||r.key.resolvedUri!==r.map.key.resolvedUri)){var E=cu(n,{uri:r.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),C=$l(r,[r.map.key],b,y);y({type:"segmentkeyloadstart",segment:r,keyInfo:{uri:r.map.key.resolvedUri}});var I=t(E,C);_.push(I)}var x=cu(n,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:cl(r.map),requestType:"segment-media-initialization"}),A=function(e){var t=e.segment,n=e.finishProcessingFn,i=e.triggerSegmentEventFn;return function(e,r){var a=Ql(e,r);if(a)return n(a,t);var s=new Uint8Array(r.response);if(i({type:"segmentloaded",segment:t}),t.map.key)return t.map.encryptedBytes=s,n(null,t);t.map.bytes=s,Jl(t,function(e){if(e)return e.xhr=r,e.status=r.status,n(e,t);n(null,t)})}}({segment:r,finishProcessingFn:b,triggerSegmentEventFn:y});y({type:"segmentloadstart",segment:r});var D=t(x,A);_.push(D)}var P=cu(n,{uri:r.part&&r.part.resolvedUri||r.resolvedUri,responseType:"arraybuffer",headers:cl(r),requestType:"segment"}),L=Zl({segment:r,finishProcessingFn:b,responseType:P.responseType,triggerSegmentEventFn:y});y({type:"segmentloadstart",segment:r});var O=t(P,L);O.addEventListener("progress",rc({segment:r,progressFn:s,trackInfoFn:o,timingInfoFn:u,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:d,captionsFn:h,isEndOfTimeline:p,endedTimelineFn:f,dataFn:m})),_.push(O);var R={};return _.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 Yl(_)}},sc=lu("PlaylistSelector"),oc=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||""})}},uc=function(e,t){if(!e)return"";var n=u()().getComputedStyle(e);return n?n[t]:""},lc=function(e,t){var n=e.slice();e.sort(function(e,i){var r=t(e,i);return 0===r?n.indexOf(e)-n.indexOf(i):r})},cc=function(e,t){var n,i;return e.attributes.BANDWIDTH&&(n=e.attributes.BANDWIDTH),n=n||u()().Number.MAX_VALUE,t.attributes.BANDWIDTH&&(i=t.attributes.BANDWIDTH),n-(i=i||u()().Number.MAX_VALUE)},dc=function(e){var t=e.main,n=e.bandwidth,i=e.playerWidth,r=e.playerHeight,a=e.playerObjectFit,s=e.limitRenditionByPlayerDimensions,o=e.playlistController;if(t){var l={bandwidth:n,width:i,height:r,limitRenditionByPlayerDimensions:s},c=t.playlists;Bu.isAudioOnly(t)&&(c=o.getAudioTrackPlaylists_(),l.audioOnly=!0);var d=c.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||u()().Number.MAX_VALUE,width:t,height:n,playlist:e}});lc(d,function(e,t){return e.bandwidth-t.bandwidth});var h=(d=d.filter(function(e){return!Bu.isIncompatible(e.playlist)})).filter(function(e){return Bu.isEnabled(e.playlist)});h.length||(h=d.filter(function(e){return!Bu.isDisabled(e.playlist)}));var p=h.filter(function(e){return e.bandwidth*Dl.BANDWIDTH_VARIANCE<n}),f=p[p.length-1],m=p.filter(function(e){return e.bandwidth===f.bandwidth})[0];if(!1===s){var g=m||h[0]||d[0];if(g&&g.playlist){var v="sortedPlaylistReps";return m&&(v="bandwidthBestRep"),h[0]&&(v="enabledPlaylistReps"),sc("choosing ".concat(oc(g)," using ").concat(v," with options"),l),g.playlist}return sc("could not choose a playlist with options",l),null}var y=p.filter(function(e){return e.width&&e.height});lc(y,function(e,t){return e.width-t.width});var _=y.filter(function(e){return e.width===i&&e.height===r});f=_[_.length-1];var b,T,k,S,w=_.filter(function(e){return e.bandwidth===f.bandwidth})[0];if(w||(T=(b=y.filter(function(e){return"cover"===a?e.width>i&&e.height>r:e.width>i||e.height>r})).filter(function(e){return e.width===b[0].width&&e.height===b[0].height}),f=T[T.length-1],k=T.filter(function(e){return e.bandwidth===f.bandwidth})[0]),o.leastPixelDiffSelector){var E=y.map(function(e){return e.pixelDiff=Math.abs(e.width-i)+Math.abs(e.height-r),e});lc(E,function(e,t){return e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff}),S=E[0]}var C=S||k||w||m||h[0]||d[0];if(C&&C.playlist){var I="sortedPlaylistReps";return S?I="leastPixelDiffRep":k?I="resolutionPlusOneRep":w?I="resolutionBestRep":m?I="bandwidthBestRep":h[0]&&(I="enabledPlaylistReps"),sc("choosing ".concat(oc(C)," using ").concat(I," with options"),l),C.playlist}return sc("could not choose a playlist with options",l),null}},hc=function(){var e=this.useDevicePixelRatio&&u()().devicePixelRatio||1;return isNaN(this.customPixelRatio)||(e=this.customPixelRatio),dc({main:this.playlists.main,bandwidth:this.systemBandwidth,playerWidth:parseInt(uc(this.tech_.el(),"width"),10)*e,playerHe
2ight:parseInt(uc(this.tech_.el(),"height"),10)*e,playerObjectFit:this.usePlayerObjectFit?uc(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})};function pc(e){try{return new URL(e).pathname.split("/").slice(-2).join("/")}catch(e){return""}}var fc=function(e){var t=e.inbandTextTracks,n=e.metadataArray,i=e.timestampOffset,r=e.videoDuration;if(n){var a=u()().WebKitDataCue||u()().VTTCue,s=t.metadataTrack_;if(s&&(n.forEach(function(e){var t=e.cueTime+i;!("number"!=typeof t||u()().isNaN(t)||t<0)&&t<1/0&&e.frames&&e.frames.length&&e.frames.forEach(function(e){var 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:function(){return Zo.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get:function(){return Zo.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get:function(){return Zo.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})}(n),s.addCue(n)})}),s.cues&&s.cues.length)){for(var o=s.cues,l=[],c=0;c<o.length;c++)o[c]&&l.push(o[c]);var d=l.reduce(function(e,t){var n=e[t.startTime]||[];return n.push(t),e[t.startTime]=n,e},{}),h=Object.keys(d).sort(function(e,t){return Number(e)-Number(t)});h.forEach(function(e,t){var n=d[e],i=isFinite(r)?r:e,a=Number(h[t+1])||i;n.forEach(function(e){e.endTime=a})})}}},mc={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"},gc=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),vc=function(e,t,n){e.metadataTrack_||(e.metadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,Zo.browser.IS_ANY_SAFARI||(e.metadataTrack_.inBandMetadataTrackDispatchType=t))},yc=function(e,t,n){var i,r;if(n&&n.cues)for(i=n.cues.length;i--;)(r=n.cues[i]).startTime>=e&&r.endTime<=t&&n.removeCue(r)},_c=function(e){return"number"==typeof e&&isFinite(e)},bc=1/60,Tc=function(e){var t=e.startOfSegment,n=e.duration,i=e.segment,r=e.part,a=e.playlist,s=a.mediaSequence,o=a.id,u=a.segments,l=void 0===u?[]:u,c=e.mediaIndex,d=e.partIndex,h=e.timeline,p=l.length-1,f="mediaIndex/partIndex increment";e.getMediaInfoForTime?f="getMediaInfoForTime (".concat(e.getMediaInfoForTime,")"):e.isSyncRequest&&(f="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(f+=" with independent ".concat(e.independent));var m="number"==typeof d,g=e.segment.uri?"segment":"pre-segment",v=m?wu({preloadSegment:i})-1:0;return"".concat(g," [").concat(s+c,"/").concat(s+p,"]")+(m?" part [".concat(d,"/").concat(v,"]"):"")+" segment start/end [".concat(i.start," => ").concat(i.end,"]")+(m?" part start/end [".concat(r.start," => ").concat(r.end,"]"):"")+" startOfSegment [".concat(t,"]")+" duration [".concat(n,"]")+" timeline [".concat(h,"]")+" selected by [".concat(f,"]")+" playlist [".concat(o,"]")},kc=function(e){return"".concat(e,"TimingInfo")},Sc=function(e){var t=e.timelineChangeController,n=e.currentTimeline,i=e.segmentTimeline,r=e.loaderType,a=e.audioDisabled;if(n===i)return!1;if("audio"===r){var s=t.lastTimelineChange({type:"main"});return!s||s.to!==i}if("main"===r&&a){var o=t.pendingTimelineChange({type:"audio"});return!o||o.to!==i}return!1},wc=function(e){var t=e.pendingSegment_;if(t&&(Sc({timelineChangeController:e.timelineChangeController_,currentTimeline:e.currentTimeline_,segmentTimeline:t.timeline,loaderType:e.loaderType_,audioDisabled:e.audioDisabled_})&&function(e){if(!e)return!1;var t=e.pendingTimelineChange({type:"audio"}),n=e.pendingTimelineChange({type:"main"}),i=t&&n,r=i&&t.to!==n.to;return!(!i||-1===t.from||-1===n.from||!r)}(e.timelineChangeController_))){if(function(e){var t=e.timelineChangeController_.pendingTimelineChange({type:"audio"}),n=e.timelineChangeController_.pendingTimelineChange({type:"main"});return t&&n&&t.to<n.to}(e))return void e.timelineChangeController_.trigger("audioTimelineBehind");e.timelineChangeController_.trigger("fixBadTimelineChange")}},Ec=function(e){var t=e.segmentDuration,n=e.maxDuration;return!!t&&Math.round(t)>n+hu},Cc=function(e,t){if("hls"!==t)return null;var n,i,r=(n={audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo},i=0,["video","audio"].forEach(function(e){var t=n["".concat(e,"TimingInfo")];if(t){var r,a=t.start,s=t.end;"bigint"==typeof a||"bigint"==typeof s?r=u()().BigInt(s)-u()().BigInt(a):"number"==typeof a&&"number"==typeof s&&(r=s-a),void 0!==r&&r>i&&(i=r)}}),"bigint"==typeof i&&i<Number.MAX_SAFE_INTEGER&&(i=Number(i)),i);if(!r)return null;var a=e.playlist.targetDuration,s=Ec({segmentDuration:r,maxDuration:2*a}),o=Ec({segmentDuration:r,maxDuration:a}),l="Segment with index ".concat(e.mediaIndex," ")+"from playlist ".concat(e.playlist.id," ")+"has a duration of ".concat(r," ")+"when the reported duration is ".concat(e.duration," ")+"and the target duration is ".concat(a,". ")+"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 s||o?{severity:s?"warn":"info",message:l}:null},Ic=function(e){var t=e.type,n=e.segment;if(n){var i=Boolean(n.key||n.map&&n.map.ke),r=Boolean(n.map&&!n.map.bytes),a=void 0===n.startOfSegment?n.start:n.startOfSegment;return{type:t||n.type,uri:n.resolvedUri||n.uri,start:a,duration:n.duration,isEncrypted:i,isMediaInitialization:r}}},xc=function(e){function t(e){var n;if(rn(this,t),n=Kt(this,t),!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");return n.bandwidth=e.bandwidth,n.throughput={rate:0,count:0},n.roundTrip=NaN,n.resetStats_(),n.mediaIndex=null,n.partIndex=null,n.hasPlayed_=e.hasPlayed,n.currentTime_=e.currentTime,n.seekable_=e.seekable,n.seeking_=e.seeking,n.duration_=e.duration,n.mediaSource_=e.mediaSource,n.vhs_=e.vhs,n.loaderType_=e.loaderType,n.currentMediaInfo_=void 0,n.startingMediaInfo_=void 0,n.segmentMetadataTrack_=e.segmentMetadataTrack,n.goalBufferLength_=e.goalBufferLength,n.sourceType_=e.sourceType,n.sourceUpdater_=e.sourceUpdater,n.inbandTextTracks_=e.inbandTextTracks,n.state_="INIT",n.timelineChangeController_=e.timelineChangeController,n.shouldSaveSegmentTimingInfo_=!0,n.parse708captions_=e.parse708captions,n.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,n.captionServices_=e.captionServices,n.exactManifestTimings=e.exactManifestTimings,n.addMetadataToTextTrack=e.addMetadataToTextTrack,n.checkBufferTimeout_=null,n.error_=void 0,n.currentTimeline_=-1,n.shouldForceTimestampOffsetAfterResync_=!1,n.pendingSegment_=null,n.xhrOptions_=null,n.pendingSegments_=[],n.audioDisabled_=!1,n.isPendingTimestampOffset_=!1,n.gopBuffer_=[],n.timeMapping_=0,n.safeAppend_=!1,n.appendInitSegment_={audio:!0,video:!0},n.playlistOfLastInitSegment_={audio:null,video:null},n.callQueue_=[],n.loadQueue_=[],n.metadataQueue_={id3:[],caption:[]},n.waitingOnRemove_=!1,n.quotaExceededErrorRetryTimeout_=null,n.activeInitSegmentId_=null,n.initSegments_={}
2,n.cacheEncryptionKeys_=e.cacheEncryptionKeys,n.keyCache_={},n.decrypter_=e.decrypter,n.syncController_=e.syncController,n.syncPoint_={segmentIndex:0,time:0},n.transmuxer_=n.createTransmuxer_(),n.triggerSyncInfoUpdate_=function(){return n.trigger("syncinfoupdate")},n.syncController_.on("syncinfoupdate",n.triggerSyncInfoUpdate_),n.mediaSource_.addEventListener("sourceopen",function(){n.isEndOfStream_()||(n.ended_=!1)}),n.fetchAtBuffer_=!1,n.logger_=lu("SegmentLoader[".concat(n.loaderType_,"]")),Object.defineProperty(n,"state",{get:function(){return this.state_},set:function(e){e!==this.state_&&(this.logger_("".concat(this.state_," -> ").concat(e)),this.state_=e,this.trigger("statechange"))}}),n.sourceUpdater_.on("ready",function(){n.hasEnoughInfoToAppend_()?n.processCallQueue_():wc(n)}),n.sourceUpdater_.on("codecschange",function(e){n.trigger(f({type:"codecschange"},e))}),"main"===n.loaderType_&&n.timelineChangeController_.on("pendingtimelinechange",function(){n.hasEnoughInfoToAppend_()?n.processCallQueue_():wc(n)}),"audio"===n.loaderType_&&n.timelineChangeController_.on("timelinechange",function(e){n.trigger(f({type:"timelinechange"},e)),n.hasEnoughInfoToLoad_()?n.processLoadQueue_():wc(n),n.hasEnoughInfoToAppend_()?n.processCallQueue_():wc(n)}),n}return Gt(t,e),sn(t,[{key:"mediaSequenceSync_",get:function(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}},{key:"createTransmuxer_",value:function(){return Vl({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}},{key:"resetStats_",value: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}},{key:"dispose",value:function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&u()().clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}},{key:"setAudio",value:function(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}},{key:"abort",value:function(){if("WAITING"!==this.state)return this.pendingSegment_&&(this.pendingSegment_=null),void this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}},{key:"abort_",value: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,u()().clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}},{key:"checkForAbort_",value:function(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)}},{key:"error",value:function(e){return void 0!==e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}},{key:"endOfStream",value:function(){this.ended_=!0,this.transmuxer_&&Hl(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}},{key:"buffered_",value:function(){var e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return du();if("main"===this.loaderType_){var t=e.hasAudio,n=e.hasVideo,i=e.isMuxed;if(n&&t&&!this.audioDisabled_&&!i)return this.sourceUpdater_.buffered();if(n)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}},{key:"initSegmentForMap",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return null;var n=ml(e),i=this.initSegments_[n];return t&&!i&&e.bytes&&(this.initSegments_[n]=i={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),i||e}},{key:"segmentKey",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return null;var n=gl(e),i=this.keyCache_[n];this.cacheEncryptionKeys_&&t&&!i&&e.bytes&&(this.keyCache_[n]=i={resolvedUri:e.resolvedUri,bytes:e.bytes});var r={resolvedUri:(i||e).resolvedUri};return i&&(r.bytes=i.bytes),r}},{key:"couldBeginLoading_",value:function(){return this.playlist_&&!this.paused()}},{key:"load",value: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"))}},{key:"init_",value:function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}},{key:"playlist",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e&&!(this.playlist_&&this.playlist_.endList&&e.endList&&this.playlist_.uri===e.uri)){var n=this.playlist_,i=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 r=null;if(n&&(n.id?r=n.id:n.uri&&(r=n.uri)),this.logger_("playlist update [".concat(r," => ").concat(e.id||e.uri,"]")),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_("Playlist update:\ncurrentTime: ".concat(this.currentTime_(),"\nbufferedEnd: ").concat(_u(this.buffered_()),"\n"),this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!n||n.uri!==e.uri){if(null!==this.mediaIndex)!e.endList&&"number"==typeof e.partTargetDuration?this.resetLoader():this.resyncLoader();return this.currentMediaInfo_=void 0,void this.trigger("playlistupdate")}var a=e.mediaSequence-n.mediaSequence;if(this.logger_("live window shift [".concat(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 ".concat(this.partIndex,") no longer exists.")),this.resetLoader(),this.mediaIndex=o}}i&&(i.mediaIndex-=a,i.mediaIndex<0?(i.mediaIndex=null,i.partIndex=null):(i.mediaIndex>=0&&(i.segment=e.segments[i.mediaIndex]),i.partIndex>=0&&i.segment.parts&&(i.part=i.segment.parts[i.partIndex]))),this.syncController_.saveExpiredSegmentInfo(n,e)}}},{key:"pause",value:function(){this.checkBufferTimeout_&&(u()().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}},{key:"paused",value:function(){return null===this.checkBufferTimeout_}},{key:"resetEverything",value: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"}))}},{key:"resetLoader",value:function(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}},{key:"resyncLoader",value:function(){this.transmuxer_&&Hl(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;var e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;"hls"===this.sourceType_&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}},{key:"remove",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(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 r=1,a=function(){0===--r&&n()};for(var s in!i&&this.audioDisabled_||(r++,this.sourceUpdater_.removeAudio(e,t,a)),(i||"main"===this.loaderType_)&&(this.gopBuffer_=function(e,t,n,i){for(var r=Math.ceil((t-i)*jt.WZ),a=Math.ceil((n-i)*jt.WZ),s=e.slice(),o=e.length;o--&&!(e[o].pts<=a););if(-1===o)return s;for(var u=o+1;u--&&!(e[u].pts<=r););return u=Math.max(u,0),s.splice(u,o-u+1),s}(this.gopBuffer_,e,t,this.timeMapping_),r++,this.sourceUpdater_.removeVideo(e,t,a)),this.inbandTextTracks_)yc(e,t,this.inbandTextTracks_[s]);yc(e,t,this.segmentMetadataTrack_),a()}else this.logger_("skipping remove because no source updater or starting media info")}},{key:"monitorBuffer_",value:function(){this.checkBufferTimeout_&&u()().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=u()().setTimeout(this.monitorBufferTick_.bind(this),1)}},{key:"monitorBufferTick_",value:function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&u()().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=u()().setTimeout(this.monitorBufferTick_.bind(this),500)}},{key:"fillBuffer_",value:function(){if(!this.sourceUpdater_.updating()){var e=this.chooseNextRequest_();if(e){var t={segmentInfo:Ic({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:t}),"number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}}}},{key:"isEndOfStream_",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.mediaIndex,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.playlist_,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.partIndex;if(!t||!this.mediaSource_)return!1;var i="number"==typeof e&&t.segments[e],r=e+1===t.segments.length,a=!i||!i.parts||n+1===i.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&r&&a}},{key:"chooseNextRequest_",value:function(){var e=this.buffered_(),t=_u(e)||0,n=bu(e,this.currentTime_()),i=!this.hasPlayed_()&&n>=1,r=n>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||i||r)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);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 i=[],r=0,a=0;a<t.length;a++){var s=t[a];if(e===s.timeline&&(i.push(a),(r+=s.duration)>n))return a}return 0===i.length?0:i[i.length-1]}(this.currentTimeline_,a,t),this.logger_("choose next request. Can not find sync point. Fallback to media Index: ".concat(s.mediaIndex));else if(null!==this.mediaIndex){var o=a[this.mediaIndex],u="number"==typeof this.partIndex?this.partIndex:-1;s.startOfSegment=o.end?o.end:t,o.parts&&o.parts[u+1]?(s.mediaIndex=this.mediaIndex,s.partIndex=u+1):s.mediaIndex=this.mediaIndex+1}else{var l,c,d,h=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_("chooseNextRequest_ request after Quality Switch:\nFor TargetTime: ".concat(h,".\nCurrentTime: ").concat(this.currentTime_(),"\nBufferedEnd: ").concat(t,"\nFetch At Buffer: ").concat(this.fetchAtBuffer_,"\n"),this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){var p=this.getSyncInfoFromMediaSequenceSync_(h);if(!p){var f="No sync info found while using media sequence sync";return this.error({message:f,metadata:{errorType:Zo.Error.StreamingFailedToSelectNextSegment,error:new Error(f)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_("chooseNextRequest_ mediaSequence syncInfo (".concat(p.start," --\x3e ").concat(p.end,")")),l=p.segmentIndex,c=p.partIndex,d=p.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");var m=Bu.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:h,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});l=m.segmentIndex,c=m.partIndex,d=m.startTime}s.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd ".concat(h):"currentTime ".concat(h),s.mediaIndex=l,s.startOfSegment=d,s.partIndex=c,this.logger_("choose next request. Playlist switched and we have a sync point. Media Index: ".concat(s.mediaIndex," "))}var g=a[s.mediaIndex],v=g&&"number"==typeof s.partIndex&&g.parts&&g.parts[s.partIndex];if(!g||"number"==typeof s.partIndex&&!v)return null;"number"!=typeof s.partIndex&&g.parts&&(s.partIndex=0,v=g.parts[0]);var y=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!n&&v&&!y&&!v.independent)if(0===s.partIndex){var _=a[s.mediaIndex-1],b=_.parts&&_.parts.length&&_.parts[_.parts.length-1];b&&b.independent&&(s.mediaIndex-=1,s.partIndex=_.parts.length-1,s.independent="previous segment")}else g.parts[s.partIndex-1].independent&&(s.partIndex-=1,s.independent="previous part");var T=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return s.mediaIndex>=a.length-1&&T&&!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))}},{key:"getSyncInfoFromMediaSequenceSync_",value:function(e){if(!this.mediaSequenceSync_)return null;var t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_("getSyncInfoFromMediaSequenceSync_. Pulled target time from ".concat(e," to ").concat(t));var n=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!n)return null;if(!n.isAppended)return n;var i=this.mediaSequenceSync_.getSyncInfoForTime(n.end);return i?(i.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),i):null}},{key:"generateSegmentInfo_",value:function(e){var t=e.independent,n=e.playlist,i=e.mediaIndex,r=e.startOfSegment,a=e.isSyncRequest,s=e.partIndex,o=e.forceTimestampOffset,u=e.getMediaInfoForTime,l=n.segments[i],c="number"==typeof s&&l.parts[s],d={requestId:"segment-loader-"+Math.random(),uri:c&&c.resolvedUri||l.resolvedUri,mediaIndex:i,partIndex:c?s:null,isSyncRequest:a,startOfSegment:r,playlist:n,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:l.timeline,duration:c&&c.duration||l.duration,segment:l,part:c,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:u,independent:t},h=void 0!==o?o:this.isPendingTimestampOffset_;d.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:l.timeline,currentTimeline:this.currentTimeline_,startOfSegment:r,buffered:this.buffered_(),overrideCheck:h});
2var p=_u(this.sourceUpdater_.audioBuffered());return"number"==typeof p&&(d.audioAppendStart=p-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(d.gopsToAlignWith=function(e,t,n){if(null==t||!e.length)return[];var i,r=Math.ceil((t-n+3)*jt.WZ);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}},{key:"timestampOffsetForSegment_",value:function(e){return n=(t=e).segmentTimeline,i=t.currentTimeline,r=t.startOfSegment,a=t.buffered,t.overrideCheck||n!==i?n<i?r:a.length?a.end(a.length-1):r:null;var t,n,i,r,a}},{key:"earlyAbortWhenNeeded_",value: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,i=this.pendingSegment_.duration,r=Bu.estimateSegmentRequestTime(i,n,this.playlist_,e.bytesReceived),a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return((e.length?e.end(e.length-1):0)-t)/n}(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(!(r<=a)){var s=function(e){var t=e.main,n=e.currentTime,i=e.bandwidth,r=e.duration,a=e.segmentDuration,s=e.timeUntilRebuffer,o=e.currentTimeline,u=e.syncController,l=t.playlists.filter(function(e){return!Bu.isIncompatible(e)}),c=l.filter(Bu.isEnabled);c.length||(c=l.filter(function(e){return!Bu.isDisabled(e)}));var d=c.filter(Bu.hasAttribute.bind(null,"BANDWIDTH")).map(function(e){var t=u.getSyncPoint(e,r,o,n)?1:2;return{playlist:e,rebufferingImpact:Bu.estimateSegmentRequestTime(a,i,e)*t-s}}),h=d.filter(function(e){return e.rebufferingImpact<=0});return lc(h,function(e,t){return cc(t.playlist,e.playlist)}),h.length?h[0]:(lc(d,function(e,t){return e.rebufferingImpact-t.rebufferingImpact}),d[0]||null)}({main:this.vhs_.playlists.main,currentTime:t,bandwidth:n,duration:this.duration_(),segmentDuration:i,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(s){var o=r-a-s.rebufferingImpact,u=.5;a<=hu&&(u=1),!s.playlist||s.playlist.uri===this.playlist_.uri||o<u||(this.bandwidth=s.playlist.attributes.BANDWIDTH*Dl.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}}}}},{key:"handleAbort_",value:function(e){this.logger_("Aborting ".concat(Tc(e))),this.mediaRequestsAborted+=1}},{key:"handleProgress_",value:function(e,t){this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId)||this.trigger("progress")}},{key:"handleTrackInfo_",value:function(e,t){var n=t,i=n.hasAudio,r=n.hasVideo,a={segmentInfo:Ic({type:this.loaderType_,segment:e}),trackInfo:{hasAudio:i,hasVideo:r}};this.trigger({type:"segmenttransmuxingtrackinfoavailable",metadata:a}),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(),i=Object.keys(t).sort();if(n.length!==i.length)return!1;for(var r=0;r<n.length;r++){var a=n[r];if(a!==i[r])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_():wc(this)))}},{key:"handleTimingInfo_",value:function(e,t,n,i){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){var r=this.pendingSegment_,a=kc(t);r[a]=r[a]||{},r[a][n]=i,this.logger_("timinginfo: ".concat(t," - ").concat(n," - ").concat(i)),this.hasEnoughInfoToAppend_()?this.processCallQueue_():wc(this)}}},{key:"handleCaptions_",value:function(e,t){var n=this;if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId))if(0!==t.length)if(this.pendingSegment_.hasAppendedData_){var i=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),r={};t.forEach(function(e){r[e.stream]=r[e.stream]||{startTime:1/0,captions:[],endTime:0};var t=r[e.stream];t.startTime=Math.min(t.startTime,e.startTime+i),t.endTime=Math.max(t.endTime,e.endTime+i),t.captions.push(e)}),Object.keys(r).forEach(function(e){var t=r[e],a=t.startTime,s=t.endTime,o=t.captions,l=n.inbandTextTracks_;n.logger_("adding cues from ".concat(a," -> ").concat(s," for ").concat(e)),function(e,t,n){if(!e[n]){t.trigger({type:"usage",name:"vhs-608"});var i=n;/^cc708_/.test(n)&&(i="SERVICE"+n.split("_")[1]);var r=t.textTracks().getTrackById(i);if(r)e[n]=r;else{var a=n,s=n,o=!1,u=(t.options_.vhs&&t.options_.vhs.captionServices||{})[i];u&&(a=u.label,s=u.language,o=u.default),e[n]=t.addRemoteTextTrack({kind:"captions",id:i,default:o,label:a,language:s},!1).track}}}(l,n.vhs_.tech_,e),yc(a,s,l[e]),function(e){var t=e.inbandTextTracks,n=e.captionArray,i=e.timestampOffset;if(n){var r=u()().WebKitDataCue||u()().VTTCue;
2n.forEach(function(e){var n=e.stream;e.content?e.content.forEach(function(a){var s=new r(e.startTime+i,e.endTime+i,a.text);s.line=a.line,s.align="left",s.position=a.position,s.positionAlign="line-left",t[n].addCue(s)}):t[n].addCue(new r(e.startTime+i,e.endTime+i,e.text))})}}({captionArray:o,inbandTextTracks:l,timestampOffset:i})}),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")}},{key:"handleId3_",value:function(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)))}},{key:"processMetadataQueue_",value:function(){this.metadataQueue_.id3.forEach(function(e){return e()}),this.metadataQueue_.caption.forEach(function(e){return e()}),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}},{key:"processCallQueue_",value:function(){var e=this.callQueue_;this.callQueue_=[],e.forEach(function(e){return e()})}},{key:"processLoadQueue_",value:function(){var e=this.loadQueue_;this.loadQueue_=[],e.forEach(function(e){return e()})}},{key:"hasEnoughInfoToLoad_",value:function(){if("audio"!==this.loaderType_)return!0;var e=this.pendingSegment_;return!!e&&(!this.getCurrentMediaInfo_()||!Sc({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}},{key:"getCurrentMediaInfo_",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.pendingSegment_;return e&&e.trackInfo||this.currentMediaInfo_}},{key:"getMediaInfo_",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.pendingSegment_;return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}},{key:"getPendingSegmentPlaylist",value:function(){return this.pendingSegment_?this.pendingSegment_.playlist:null}},{key:"hasEnoughInfoToAppend_",value: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,i=t.hasVideo,r=t.isMuxed;return!(i&&!e.videoTimingInfo)&&(!(n&&!this.audioDisabled_&&!r&&!e.audioTimingInfo)&&!Sc({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}},{key:"handleData_",value:function(e,t){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(this.callQueue_.length||!this.hasEnoughInfoToAppend_())return wc(this),void this.callQueue_.push(this.handleData_.bind(this,e,t));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[kc(t.type)].start;else{var i,r=this.getCurrentMediaInfo_(),a="main"===this.loaderType_&&r&&r.hasVideo;a&&(i=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:i,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)}}}},{key:"updateAppendInitSegmentStatus",value: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)}},{key:"getInitSegmentAndUpdateState_",value:function(e){var t=e.type,n=e.initSegment,i=e.map,r=e.playlist;if(i){var a=ml(i);if(this.activeInitSegmentId_===a)return null;n=this.initSegmentForMap(i,!0).bytes,this.activeInitSegmentId_=a}return n&&this.appendInitSegment_[t]?(this.playlistOfLastInitSegment_[t]=r,this.appendInitSegment_[t]=!1,this.activeInitSegmentId_=null,n):null}},{key:"handleQuotaExceededError_",value:function(e,t){var n=this,i=e.segmentInfo,r=e.type,a=e.bytes,s=this.sourceUpdater_.audio
2Buffered(),o=this.sourceUpdater_.videoBuffered();s.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+yu(s).join(", ")),o.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+yu(o).join(", "));var l=s.length?s.start(0):0,c=s.length?s.end(s.length-1):0,d=o.length?o.start(0):0,h=o.length?o.end(o.length-1):0;if(c-l<=1&&h-d<=1)return this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. "+"Appended byte length: ".concat(a.byteLength,", ")+"audio buffer: ".concat(yu(s).join(", "),", ")+"video buffer: ".concat(yu(o).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:i,type:r,bytes:a}));var p=this.currentTime_()-1;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ".concat(p)),this.remove(0,p,function(){n.logger_("On QUOTA_EXCEEDED_ERR, retrying append in ".concat(1,"s")),n.waitingOnRemove_=!1,n.quotaExceededErrorRetryTimeout_=u()().setTimeout(function(){n.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),n.quotaExceededErrorRetryTimeout_=null,n.processCallQueue_()},1e3)},!0)}},{key:"handleAppendError_",value:function(e,t){var n=e.segmentInfo,i=e.type,r=e.bytes;t&&(22!==t.code?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",t),this.error({message:"".concat(i," append of ").concat(r.length,"b failed for segment ")+"#".concat(n.mediaIndex," in playlist ").concat(n.playlist.id),metadata:{errorType:Zo.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:n,type:i,bytes:r}))}},{key:"appendToSourceBuffer_",value:function(e){var t,n,i,r=e.segmentInfo,a=e.type,s=e.initSegment,o=e.data,u=e.bytes;if(!u){var l=[o],c=o.byteLength;s&&(l.unshift(s),c+=s.byteLength),i=0,(t={bytes:c,segments:l}).bytes&&(n=new Uint8Array(t.bytes),t.segments.forEach(function(e){n.set(e,i),i+=e.byteLength})),u=n}var d={segmentInfo:Ic({type:this.loaderType_,segment:r})};this.trigger({type:"segmentappendstart",metadata:d}),this.sourceUpdater_.appendBuffer({segmentInfo:r,type:a,bytes:u},this.handleAppendError_.bind(this,{segmentInfo:r,type:a,bytes:u}))}},{key:"handleSegmentTimingInfo_",value:function(e,t,n){if(this.pendingSegment_&&t===this.pendingSegment_.requestId){var i=this.pendingSegment_.segment,r="".concat(e,"TimingInfo");i[r]||(i[r]={}),i[r].transmuxerPrependedSeconds=n.prependedContentDuration||0,i[r].transmuxedPresentationStart=n.start.presentation,i[r].transmuxedDecodeStart=n.start.decode,i[r].transmuxedPresentationEnd=n.end.presentation,i[r].transmuxedDecodeEnd=n.end.decode,i[r].baseMediaDecodeTime=n.baseMediaDecodeTime}}},{key:"appendData_",value:function(e,t){var n=t.type,i=t.data;if(i&&i.byteLength&&("audio"!==n||!this.audioDisabled_)){var r=this.getInitSegmentAndUpdateState_({type:n,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:n,initSegment:r,data:i})}}},{key:"loadSegment_",value:function(e){var t=this;if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_())return wc(this),void this.loadQueue_.push(function(){var n=f({},e,{forceTimestampOffset:!0});f(e,t.generateSegmentInfo_(n)),t.isPendingTimestampOffset_=!1,t.updateTransmuxerAndRequestSegment_(e)});this.updateTransmuxerAndRequestSegment_(e)}},{key:"updateTransmuxerAndRequestSegment_",value: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),i=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=null!==this.mediaIndex,a=e.timeline!==this.currentTimeline_&&e.timeline>0,s=i||r&&a;this.logger_("Requesting\n".concat(pc(e.uri),"\n").concat(Tc(e))),n.map&&!n.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=ac({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_.b
2ind(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 i=n.message,r=n.level,a=n.stream;t.logger_("".concat(Tc(e)," logged from transmuxer stream ").concat(a," as a ").concat(r,": ").concat(i))},triggerSegmentEventFn:function(e){var n=e.type,i=e.segment,r=e.keyInfo,a=e.trackInfo,s=e.timingInfo,o={segmentInfo:Ic({segment:i})};r&&(o.keyInfo=r),a&&(o.trackInfo=a),s&&(o.timingInfo=s),t.trigger({type:n,metadata:o})}})}},{key:"trimBackBuffer_",value:function(e){var t=function(e,t,n){var i=t-Dl.BACK_BUFFER_LENGTH;e.length&&(i=Math.max(i,e.start(0)));var r=t-n;return Math.min(r,i)}(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}},{key:"createSimplifiedSegmentObj_",value:function(e){var t=e.segment,n=e.part,i=e.segment.key||e.segment.map&&e.segment.map.key,r=e.segment.map&&!e.segment.map.bytes,a={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,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:i,isMediaInitialization:r},s=e.playlist.segments[e.mediaIndex-1];if(s&&s.timeline===t.timeline&&(s.videoTimingInfo?a.baseStartTime=s.videoTimingInfo.transmuxedDecodeEnd:s.audioTimingInfo&&(a.baseStartTime=s.audioTimingInfo.transmuxedDecodeEnd)),t.key){var o=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);a.key=this.segmentKey(t.key),a.key.iv=o}return t.map&&(a.map=this.initSegmentForMap(t.map)),a}},{key:"saveTransferStats_",value:function(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}},{key:"saveBandwidthRelatedStats_",value:function(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e<bc)this.logger_("Ignoring segment's bandwidth because its duration of ".concat(e)+" is less than the min to record ".concat(bc));else{var n={bandwidthInfo:{from:this.bandwidth,to:t.bandwidth}};this.trigger({type:"bandwidthupdated",metadata:n}),this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime}}},{key:"handleTimeout_",value:function(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")}},{key:"segmentRequestFinished_",value: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===Xl)return;return this.pause(),e.code===Gl?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error"))}var i=this.pendingSegment_;this.saveBandwidthRelatedStats_(i.duration,t.stats),i.endOfAllRequests=t.endOfAllRequests,n.gopInfo&&(this.gopBuffer_=function(e,t,n){if(!t.length)return e;if(n)return t.slice();for(var i=t[0].pts,r=0;r<e.length&&!(e[r].pts>=i);r++);return e.slice(0,r).concat(t)}(this.gopBuffer_,n.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(i)}}},{key:"setTimeMapping_",value:function(e){var t=this.syncController_.mappingForTimeline(e);null!==t&&(this.timeMapping_=t)}},{key:"updateMediaSecondsLoaded_",value:function(e){"number"==typeof e.start&&"number"==typeof e.end?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration}},{key:"shouldUpdateTransmuxerTimestampOffset_",value:function(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())}},{key:"trueSegmentStart_",value:function(e){var t=e.currentStart,n=e.playlist,i=e.mediaIndex,r=e.firstVideoFrameTimeForData,a=e.currentVideoTimestampOffset,s=e.useVideoTimingInfo,o=e.videoTimingInfo,u=e.audioTimingInfo;if(void 0!==t)return t;if(!s)return u.start;var l=n.segments[i-1];return 0!==i&&l&&void 0!==l.start&&l.end===r+a?o.start:r}},{key:"waitForAppendsToComplete_",value:function(e){var 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");var n=t.hasAudio,i=t.hasVideo,r=t.isMuxed,a="main"===this.loaderType_&&i,s=!this.audioDisabled_&&n&&!r;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))}},{key:"checkAppendsDone_",value:function(e){this.checkForAbort_(e.requestId)||
2(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_())}},{key:"checkForIllegalMediaSwitch",value: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,playlistExclusionDuration:1/0}),this.trigger("error"),!0)}},{key:"updateSourceBufferTimestampOffset_",value: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")}}},{key:"getSegmentStartTimeForTimestampOffsetCalculation_",value:function(e){var t=e.videoTimingInfo,n=e.audioTimingInfo,i=e.timingInfo;return this.useDtsForTimestampOffset_?t&&"number"==typeof t.transmuxedDecodeStart?t.transmuxedDecodeStart:n&&"number"==typeof n.transmuxedDecodeStart?n.transmuxedDecodeStart:i.start:i.start}},{key:"updateTimingInfoEnd_",value: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)}},{key:"handleAppendsDone_",value:function(){if(this.pendingSegment_){var e={segmentInfo:Ic({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:e})}if(!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var t=this.pendingSegment_;t.part&&t.part.syncInfo?t.part.syncInfo.markAppended():t.segment.syncInfo&&t.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(t),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:t,shouldSaveTimelineMapping:"main"===this.loaderType_});var n=Cc(t,this.sourceType_);if(n&&("warn"===n.severity?Zo.log.warn(n.message):this.logger_(n.message)),this.recordThroughput_(t),this.pendingSegment_=null,this.state="READY",!t.isSyncRequest||(this.trigger("syncinfoupdate"),t.hasAppendedData_)){this.logger_("Appended ".concat(Tc(t))),this.addSegmentMetadataCue_(t),this.fetchAtBuffer_=!0,this.currentTimeline_!==t.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:t.timeline}),"main"!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:t.timeline})),this.currentTimeline_=t.timeline,this.trigger("syncinfoupdate");var i=t.segment,r=t.part,a=i.end&&this.currentTime_()-i.end>3*t.playlist.targetDuration,s=r&&r.end&&this.currentTime_()-r.end>3*t.playlist.partTargetDuration;if(a||s)return this.logger_("bad ".concat(a?"segment":"part"," ").concat(Tc(t))),void this.resetEverything();null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=t.mediaIndex,this.partIndex=t.partIndex,this.isEndOfStream_(t.mediaIndex,t.playlist,t.partIndex)&&this.endOfStream(),this.trigger("appended"),t.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}else this.logger_("Throwing away un-appended sync request ".concat(Tc(t)))}},{key:"recordThroughput_",value:function(e){if(e.duration<bc)this.logger_("Ignoring segment's throughput because its duration of ".concat(e.duration)+" is less than the min to record ".concat(bc));else{var t=this.throughput.rate,n=Date.now()-e.endOfAllRequests+1,i=Math.floor(e.byteLength/n*8*1e3);this.throughput.rate+=(i-t)/++this.throughput.count}}},{key:"addSegmentMetadataCue_",value:function(e){if(this.segmentMetadataTrack_){var t=e.segment,n=t.start,i=t.end;if(_c(n)&&_c(i)){yc(n,i,this.segmentMetadataTrack_);var r=u()().WebKitDataCue||u()().VTTCue,a={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.ur
2i,timeline:e.timeline,playlist:e.playlist.id,start:n,end:i},s=new r(n,i,JSON.stringify(a));s.value=a,this.segmentMetadataTrack_.addCue(s)}}}}])}(Zo.EventTarget);function Ac(){}var Dc,Pc=function(e){return"string"!=typeof e?e:e.replace(/./,function(e){return e.toUpperCase()})},Lc=["video","audio"],Oc=function(e,t){var n=t["".concat(e,"Buffer")];return n&&n.updating||t.queuePending[e]},Rc=function(e,t){if(0!==t.queue.length){var n=0,i=t.queue[n];if("mediaSource"!==i.type){if("mediaSource"!==e&&t.ready()&&"closed"!==t.mediaSource.readyState&&!Oc(e,t)){if(i.type!==e){if(n=function(e,t){for(var n=0;n<t.length;n++){var i=t[n];if("mediaSource"===i.type)return null;if(i.type===e)return n}return null}(e,t.queue),null===n)return;i=t.queue[n]}return t.queue.splice(n,1),t.queuePending[e]=i,i.action(e,t),i.doneFn?void 0:(t.queuePending[e]=null,void Rc(e,t))}}else t.updating()||"closed"===t.mediaSource.readyState||(t.queue.shift(),i.action(t),i.doneFn&&i.doneFn(),Rc("audio",t),Rc("video",t))}},Mc=function(e,t){var n=t["".concat(e,"Buffer")],i=Pc(e);n&&(n.removeEventListener("updateend",t["on".concat(i,"UpdateEnd_")]),n.removeEventListener("error",t["on".concat(i,"Error_")]),t.codecs[e]=null,t["".concat(e,"Buffer")]=null)},Nc=function(e,t){return e&&t&&-1!==Array.prototype.indexOf.call(e.sourceBuffers,t)},Uc=function(e,t,n){return function(i,r){var a=r["".concat(i,"Buffer")];if(Nc(r.mediaSource,a)){r.logger_("Appending segment ".concat(t.mediaIndex,"'s ").concat(e.length," bytes to ").concat(i,"Buffer"));try{a.appendBuffer(e)}catch(e){r.logger_("Error with code ".concat(e.code," ")+(22===e.code?"(QUOTA_EXCEEDED_ERR) ":"")+"when appending segment ".concat(t.mediaIndex," to ").concat(i,"Buffer")),r.queuePending[i]=null,n(e)}}}},Bc=function(e,t){return function(n,i){var r=i["".concat(n,"Buffer")];if(Nc(i.mediaSource,r)){i.logger_("Removing ".concat(e," to ").concat(t," from ").concat(n,"Buffer"));try{r.remove(e,t)}catch(r){i.logger_("Remove ".concat(e," to ").concat(t," from ").concat(n,"Buffer failed"))}}}},Fc=function(e){return function(t,n){var i=n["".concat(t,"Buffer")];Nc(n.mediaSource,i)&&(n.logger_("Setting ".concat(t,"timestampOffset to ").concat(e)),i.timestampOffset=e)}},qc=function(e){return function(t,n){e()}},jc=function(e){return function(t){if("open"===t.mediaSource.readyState){t.logger_("Calling mediaSource endOfStream(".concat(e||"",")"));try{t.mediaSource.endOfStream(e)}catch(e){Zo.log.warn("Failed to call media source endOfStream",e)}}}},Hc=function(e){return function(t){t.logger_("Setting mediaSource duration to ".concat(e));try{t.mediaSource.duration=e}catch(e){Zo.log.warn("Failed to set media source duration",e)}}},Vc=function(){return function(e,t){if("open"===t.mediaSource.readyState){var n=t["".concat(e,"Buffer")];if(Nc(t.mediaSource,n)){t.logger_("calling abort on ".concat(e,"Buffer"));try{n.abort()}catch(t){Zo.log.warn("Failed to abort on ".concat(e,"Buffer"),t)}}}}},zc=function(e,t){return function(n){var i=Pc(e),r=G(t);n.logger_("Adding ".concat(e,"Buffer with codec ").concat(t," to mediaSource"));var a=n.mediaSource.addSourceBuffer(r);a.addEventListener("updateend",n["on".concat(i,"UpdateEnd_")]),a.addEventListener("error",n["on".concat(i,"Error_")]),n.codecs[e]=t,n["".concat(e,"Buffer")]=a}},Wc=function(e){return function(t){var n=t["".concat(e,"Buffer")];if(Mc(e,t),Nc(t.mediaSource,n)){t.logger_("Removing ".concat(e,"Buffer with codec ").concat(t.codecs[e]," from mediaSource"));try{t.mediaSource.removeSourceBuffer(n)}catch(t){Zo.log.warn("Failed to removeSourceBuffer ".concat(e,"Buffer"),t)}}}},Gc=function(e){return function(t,n){var i=n["".concat(t,"Buffer")],r=G(e);if(Nc(n.mediaSource,i)){var a=e.substring(0,e.indexOf(".")),s=n.codecs[t];if(s.substring(0,s.indexOf("."))!==a){var o={codecsChangeInfo:{from:s,to:e}};n.trigger({type:"codecschange",metadata:o}),n.logger_("changing ".concat(t,"Buffer codec from ").concat(s," to ").concat(e));try{i.changeType(r),n.codecs[t]=e}catch(e){o.errorType=Zo.Error.StreamingCodecsChangeError,o.error=e,e.metadata=o,n.error_=e,n.trigger("error"),Zo.log.warn("Failed to changeType on ".concat(t,"Buffer"),e)}}}}},Xc=function(e){var t=e.type,n=e.sourceUpdater,i=e.action,r=e.doneFn,a=e.name;n.queue.push({type:t,action:i,doneFn:r,name:a}),Rc(t,n)},Kc=function(e,t){return function(n){var i=function(e){if(0===e.length)return"Buffered Ranges are empty";for(var t="Buffered Ranges: \n",n=0;n<e.length;n++){var i=e.start(n),r=e.end(n);t+="".concat(i," --\x3e ").concat(r,". Duration (").concat(r-i,")\n")}return t}(t["".concat(e,"Buffered")]());if(t.logger_('received "updateend" event for '.concat(e," Source Buffer: "),i),t.queuePending[e]){var r=t.queuePending[e].doneFn;t.queuePending[e]=null,r&&r(t["".concat(e,"Error_")])}Rc(e,t)}},Yc=function(e){function t(e){var n;return rn(this,t),(n=Kt(this,t)).mediaSource=e,n.sourceopenListener_=function(){return Rc("mediaSource",n)},n.mediaSource.addEventListener("sourceopen",n.sourceopenListener_),n.logger_=lu("SourceUpdater"),n.audioTimestampOffset_=0,n.videoTimestampOffset_=0,n.queue=[],n.queuePending={audio:null,video:null}
2,n.delayedAudioAppendQueue_=[],n.videoAppendQueued_=!1,n.codecs={},n.onVideoUpdateEnd_=Kc("video",n),n.onAudioUpdateEnd_=Kc("audio",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}return Gt(t,e),sn(t,[{key:"initializedEme",value:function(){this.initializedEme_=!0,this.triggerReady()}},{key:"hasCreatedSourceBuffers",value:function(){return this.createdSourceBuffers_}},{key:"hasInitializedAnyEme",value:function(){return this.initializedEme_}},{key:"ready",value:function(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}},{key:"createSourceBuffers",value:function(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}},{key:"triggerReady",value:function(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}},{key:"addSourceBuffer",value:function(e,t){Xc({type:"mediaSource",sourceUpdater:this,action:zc(e,t),name:"addSourceBuffer"})}},{key:"abort",value:function(e){Xc({type:e,sourceUpdater:this,action:Vc(e),name:"abort"})}},{key:"removeSourceBuffer",value:function(e){this.canRemoveSourceBuffer()?Xc({type:"mediaSource",sourceUpdater:this,action:Wc(e),name:"removeSourceBuffer"}):Zo.log.error("removeSourceBuffer is not supported!")}},{key:"canRemoveSourceBuffer",value:function(){return!Zo.browser.IS_FIREFOX&&u()().MediaSource&&u()().MediaSource.prototype&&"function"==typeof u()().MediaSource.prototype.removeSourceBuffer}},{key:"canChangeType",value:function(){return this.constructor.canChangeType()}},{key:"changeType",value:function(e,t){this.canChangeType()?Xc({type:e,sourceUpdater:this,action:Gc(t),name:"changeType"}):Zo.log.error("changeType is not supported!")}},{key:"addOrChangeSourceBuffers",value:function(e){var t=this;if(!e||"object"!==hn(e)||0===Object.keys(e).length)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(function(n){var i=e[n];if(!t.hasCreatedSourceBuffers())return t.addSourceBuffer(n,i);t.canChangeType()&&t.changeType(n,i)})}},{key:"appendBuffer",value:function(e,t){var n=this,i=e.segmentInfo,r=e.type,a=e.bytes;if(this.processedAppend_=!0,"audio"===r&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([e,t]),void this.logger_("delayed audio append of ".concat(a.length," until video append"));if(Xc({type:r,sourceUpdater:this,action:Uc(a,i||{mediaIndex:-1},t),doneFn:t,name:"appendBuffer"}),"video"===r){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;var s=this.delayedAudioAppendQueue_.slice();this.logger_("queuing delayed audio ".concat(s.length," appendBuffers")),this.delayedAudioAppendQueue_.length=0,s.forEach(function(e){n.appendBuffer.apply(n,e)})}}},{key:"audioBuffered",value:function(){return Nc(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:du()}},{key:"videoBuffered",value:function(){return Nc(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:du()}},{key:"buffered",value:function(){var e=Nc(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=Nc(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():function(e,t){var n=null,i=null,r=0,a=[],s=[];if(!(e&&e.length&&t&&t.length))return du();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===++r&&(n=a[o].time):"end"===a[o].type&&1===--r&&(i=a[o].time),null!==n&&null!==i&&(s.push([n,i]),n=null,i=null);return du(s)}(this.audioBuffered(),this.videoBuffered())}},{key:"setDuration",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ac;Xc({type:"mediaSource",sourceUpdater:this,action:Hc(e),name:"duration",doneFn:t})}},{key:"endOfStream",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ac;"string"!=typeof e&&(e=void 0),Xc({type:"mediaSource",sourceUpdater:this,action:jc(e),name:"endOfStream",doneFn:t})}},{key:"removeAudio",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ac;this.audioBuffered().length&&0!==this.audioBuffered().end(0)?Xc({type:"audio",sourceUpdater:this,action:Bc(e,t),doneFn:n,name:"remove"}):n()}},{key:"removeVideo",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ac;this.videoBuffered().length&&0!==this.videoBuffered().end(0)?Xc({type:"video",sourceUpdater:this,action:Bc(e,t),doneFn:n,name:"remove"}):n()}},{key:"updating",value:function(){return!(!Oc("audio",this)&&!Oc("video",this))}},{key:"audioTimestampOffset",value:function(e){return void 0!==e&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(Xc({type:"audio",sourceUpdater:this,action:Fc(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}},{key:"videoTimestampOffset",value:function(e){return void 0!==e&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(Xc({type:"video",sourceUpdater:this,action:Fc(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}},{key:"audioQueueCallback",value:function(e){this.audioBuffer&&Xc({type:"audio",sourceUpdater:this,action:qc(e),name:"callback"})}},{key:"videoQueueCallback",value:function(e){this.videoBuffer&&Xc({type:"video",sourceUpdater:this,action:qc(e),name:"callback"})}},{key:"dispose",value:function(){var e=this;this.trigger("dispose"),Lc.forEach(function(t){e.abort(t),e.canRemoveSourceBuffer()?e.removeSourceBuffer(t):e["".concat(t,"QueueCallback")](function(){return Mc(t,e)})}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}],[{key:"canChangeType",value:function(){return u()().SourceBuffer&&u()().SourceBuffer.prototype&&"function"==typeof u()().SourceBuffer.prototype.changeType}}])}(Zo.EventTarget),Qc=function(e){return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))},$c=new Uint8Array("\n\n".split("").map(function(e){return e.charCodeAt(0)})),Jc=function(e){function t(){return rn(this,t),Kt(this,t,["Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded."])}return Gt(t,e),sn(t)}(Ht(Error)),Zc=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return rn(this,t),(n=Kt(this,t,[e,i])).mediaSource_=null,n.subtitlesTrack_=null,n.featuresNativeTextTracks_=e.featuresNativeTextTracks,n.loadVttJs=e.loadVttJs,n.shouldSaveSegmentTimingInfo_=!1,n}return Gt(t,e),sn(t,[{key:"buffered_",value:function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return du();var e=this.subtitlesTrack_.cues;return du([[e[0].startTime,e[e.length-1].startTime]])}},{key:"initSegmentForMap",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return null;var n=ml(e),i=this.initSegments_[n];if(t&&!i&&e.bytes){var r=$c.byteLength+e.bytes.byteLength,a=new Uint8Array(r);a.set(e.bytes),a.set($c,e.bytes.byteLength),this.initSegments_[n]=i={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return i||e}},{key:"couldBeginLoading_",value:function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}},{key:"init_",value:function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}},{key:"track",value:function(e){return void 0===e||(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_}},{key:"remove",value:function(e,t){yc(e,t,this.subtitlesTrack_)}},{key:"fillBuffer_",value: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)}}},{key:"timestampOffsetForSegment_",value:function(){return null}},{key:"chooseNextRequest_",value:function(){return this.skipEmptySegments_($t(t,"chooseNextRequest_",this,3)([]))}},{key:"skipEmptySegments_",value: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}},{key:"stopForError",value:function(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}},{key:"segmentRequestFinished_",value:function(e,t,n){var i=this;if(this.subtitlesTrack_){if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===Gl&&this.handleTimeout_(),e.code===Xl?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);var r=this.pendingSegment_,a=n.mp4VttCues&&n.mp4VttCues.length;a&&(r.mp4VttCues=n.mp4VttCues),this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");var s=r.segment;if(s.map&&(s.map.bytes=t.map.bytes),r.bytes=t.bytes,"function"!=typeof u()().WebVTT&&"function"==typeof this.loadVttJs)return this.state="WAITING_ON_VTTJS",void this.loadVttJs().then(function(){return i.segmentRequestFinished_(e,t,n)},function(){return i.stopForError({message:"Error loading vtt.js"})});s.requested=!0;try{this.parseVTTCues_(r)}catch(e){return void this.stopForError({message:e.message,metadata:{errorType:Zo.Error.StreamingVttParserError,error:e}})}if(a||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+=s.duration,r.cues.forEac
2h(function(e){i.subtitlesTrack_.addCue(i.featuresNativeTextTracks_?new(u()().VTTCue)(e.startTime,e.endTime,e.text):e)}),function(e){var t=e.cues;if(t)for(var n={},i=t.length-1;i>=0;i--){var r=t[i],a="".concat(r.startTime,"-").concat(r.endTime,"-").concat(r.text);n[a]?e.removeCue(r):n[a]=r}}(this.subtitlesTrack_),this.handleAppendsDone_()}else this.state="READY"}},{key:"handleData_",value:function(e,n){var i=e&&"vtt"===e.type,r=n&&"text"===n.type;i&&r&&$t(t,"handleData_",this,3)([e,n])}},{key:"updateTimingInfoEnd_",value:function(){}},{key:"parseMp4VttCues_",value:function(e){var t=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();e.mp4VttCues.forEach(function(n){var i=n.start+t,r=n.end+t,a=new(u()().VTTCue)(i,r,n.cueText);n.settings&&n.settings.split(" ").forEach(function(e){var t=e.split(":"),n=t[0],i=t[1];a[n]=isNaN(i)?i:Number(i)}),e.cues.push(a)})}},{key:"parseVTTCues_",value:function(e){var t,n=!1;if("function"!=typeof u()().WebVTT)throw new Jc;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues)this.parseMp4VttCues_(e);else{"function"==typeof u()().TextDecoder?t=new(u()().TextDecoder)("utf8"):(t=u()().WebVTT.StringDecoder(),n=!0);var i=new(u()().WebVTT.Parser)(u()(),u()().vttjs,t);if(i.oncue=e.cues.push.bind(e.cues),i.ontimestampmap=function(t){e.timestampmap=t},i.onparsingerror=function(e){Zo.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){var r=e.segment.map.bytes;n&&(r=Qc(r)),i.parse(r)}var a=e.bytes;n&&(a=Qc(a)),i.parse(a),i.flush()}}},{key:"updateTimeMapping_",value:function(e,t,n){var i=this,r=e.segment;if(t)if(e.cues.length){var a=e.timestampmap,s=a.MPEGTS,o=a.LOCAL,u=s/jt.WZ-o+t.mapping;if(e.cues.forEach(function(e){var n=e.endTime-e.startTime,r=i.handleRollover_(e.startTime+u,t.time);e.startTime=Math.max(r,0),e.endTime=Math.max(r+n,0)}),!n.syncInfo){var l=e.cues[0].startTime,c=e.cues[e.cues.length-1].startTime;n.syncInfo={mediaSequence:n.mediaSequence+e.mediaIndex,time:Math.min(l,c-r.duration)}}}else r.empty=!0}},{key:"handleRollover_",value:function(e,t){if(null===t)return e;var n,i=e*jt.WZ,r=t*jt.WZ;for(n=r<i?-8589934592:8589934592;Math.abs(i-r)>4294967296;)i+=n;return i/jt.WZ}}])}(xc),ed=function(e,t){for(var n=e.cues,i=0;i<n.length;i++){var r=n[i];if(t>=r.adStartTime&&t<=r.adEndTime)return r}return null},td=function(){return sn(function e(t){var n=t.start,i=t.end,r=t.segmentIndex,a=t.partIndex,s=void 0===a?null:a,o=t.appended,u=void 0!==o&&o;rn(this,e),this.start_=n,this.end_=i,this.segmentIndex_=r,this.partIndex_=s,this.appended_=u},[{key:"isInRange",value:function(e){return e>=this.start&&e<this.end}},{key:"markAppended",value:function(){this.appended_=!0}},{key:"resetAppendedStatus",value:function(){this.appended_=!1}},{key:"isAppended",get:function(){return this.appended_}},{key:"start",get:function(){return this.start_}},{key:"end",get:function(){return this.end_}},{key:"segmentIndex",get:function(){return this.segmentIndex_}},{key:"partIndex",get:function(){return this.partIndex_}}])}(),nd=function(){return sn(function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];rn(this,e),this.segmentSyncInfo_=t,this.partsSyncInfo_=n},[{key:"segmentSyncInfo",get:function(){return this.segmentSyncInfo_}},{key:"partsSyncInfo",get:function(){return this.partsSyncInfo_}},{key:"hasPartsSyncInfo",get:function(){return this.partsSyncInfo_.length>0}},{key:"resetAppendStatus",value:function(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(function(e){return e.resetAppendedStatus()})}}])}(),id=function(){return sn(function e(){rn(this,e),this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0},[{key:"start",get:function(){return this.start_}},{key:"end",get:function(){return this.end_}},{key:"diagnostics",get:function(){return this.diagnostics_}},{key:"isReliable",get:function(){return this.isReliable_}},{key:"resetAppendedStatus",value:function(){this.storage_.forEach(function(e){return e.resetAppendStatus()})}},{key:"update",value:function(e,t){var n=e.mediaSequence,i=e.segments;if(this.isReliable_=this.isReliablePlaylist_(n,i),this.isReliable_)return this.updateStorage_(i,n,this.calculateBaseTime_(n,i,t))}},{key:"getSyncInfoForTime",value:function(e){var t,n=zt(this.storage_.values());try{for(n.s();!(t=n.n()).done;){var i=t.value,r=i.segmentSyncInfo,a=i.partsSyncInfo;if(a.length){var s,o=zt(a);try{for(o.s();!(s=o.n()).done;){var u=s.value;if(u.isInRange(e))return u}}catch(e){o.e(e)}finally{o.f()}}else if(r.isInRange(e))return r}}catch(e){n.e(e)}finally{n.f()}return null}},{key:"getSyncInfoForMediaSequence",value:function(e){return this.storage_.get(e)}},{key:"updateStorage_",value:function(e,t,n){var i=this,r=new Map,a="\n",s=n,o=t;this.start_=s,e.forEach(function(e,t){var n=i.storage_.get(o),u=s,l=u+e.duration,c=Boolean(n&&n.segmentSyncInfo&&n.segmentSyncInfo.isAppended),d=new td({start:u,end:l,appended:c,segmentIndex:t});e.syncInfo=d;var h=s,p=(e.parts||[]).map(function(e,i){var r=h,s=h+e.duration,u=Boolean(n&&n.partsSyncInfo&&n.partsSyncInfo[i]&&n.partsSyncInfo[i].isAppended),l=new td({start:r,end:s,appended:u,segmentIndex:t,partIndex:i});return h=s,a+="Media Sequence: ".concat(o,".").concat(i," | Range: ").concat(r," --\x3e ").concat(s," | Appended: ").concat(u,"\n"),e.syncInfo=l,l});r.set(o,new nd(d,p)),a+="".concat(pc(e.resolvedUri)," | Media Sequence: ").concat(o," | Range: ").concat(u," --\x3e ").concat(l," | Appended: ").concat(c,"\n"),o++,s=l}),this.end_=s,this.storage_=r,this.diagnostics_=a}},{key:"calculateBaseTime_",value:function(e,t,n){if(!this.storage_.size)return 0;if(this.storage_.has(e))return this.storage_.get(e).segmentSyncInfo.start;var i=Math.min.apply(Math,un(this.storage_.keys()));if(e<i){for(var r=i-e,a=this.storage_.get(i).segmentSyncInfo.start,s=0;s<r;s++){a-=t[s].duration}return a}return n}},{key:"isReliablePlaylist_",value:function(e,t){return null!=e&&Array.isArray(t)&&t.length}}])}(),rd=function(e){function t(e){var n;return rn(this,t),(n=Kt(this,t)).parent_=e,n}return Gt(t,e),sn(t,[{key:"calculateBaseTime_",value:function(e,n,i){if(!this.storage_.size){var r=this.parent_.getSyncInfoForMediaSequence(e);return r?r.segmentSyncInfo.start:0}return $t(t,"calculateBaseTime_",this,3)([e,n,i])}}])}(id),ad=[{name:"VOD",run:function(e,t,n,i,r){if(n!==1/0){return{time:0,segmentIndex:0,partIndex:null}}return null}},{name:"MediaSequence",run:function(e,t,n,i,r,a){var s=e.getMediaSequenceSync(a);if(!s)return null;if(!s.isReliable)return null;
2var o=s.getSyncInfoForTime(r);return o?{time:o.start,partIndex:o.partIndex,segmentIndex:o.segmentIndex}:null}},{name:"ProgramDateTime",run:function(e,t,n,i,r){if(!Object.keys(e.timelineToDatetimeMappings).length)return null;var a=null,s=null,o=ku(t);r=r||0;for(var u=0;u<o.length;u++){var l=o[t.endList||0===r?u:o.length-(u+1)],c=l.segment,d=e.timelineToDatetimeMappings[c.timeline];if(d&&c.dateTimeObject){var h=c.dateTimeObject.getTime()/1e3+d;if(c.parts&&"number"==typeof l.partIndex)for(var p=0;p<l.partIndex;p++)h+=c.parts[p].duration;var f=Math.abs(r-h);if(null!==s&&(0===f||s<f))break;s=f,a={time:h,segmentIndex:l.segmentIndex,partIndex:l.partIndex}}}return a}},{name:"Segment",run:function(e,t,n,i,r){var a=null,s=null;r=r||0;for(var o=ku(t),u=0;u<o.length;u++){var l=o[t.endList||0===r?u:o.length-(u+1)],c=l.segment,d=l.part&&l.part.start||c&&c.start;if(c.timeline===i&&void 0!==d){var h=Math.abs(r-d);if(null!==s&&s<h)break;(!a||null===s||s>=h)&&(s=h,a={time:d,segmentIndex:l.segmentIndex,partIndex:l.partIndex})}}return a}},{name:"Discontinuity",run:function(e,t,n,i,r){var a=null;if(r=r||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var s=null,o=0;o<t.discontinuityStarts.length;o++){var u=t.discontinuityStarts[o],l=t.discontinuitySequence+o+1,c=e.discontinuities[l];if(c){var d=Math.abs(r-c.time);if(null!==s&&s<d)break;(!a||null===s||s>=d)&&(s=d,a={time:c.time,segmentIndex:u,partIndex:null})}}return a}},{name:"Playlist",run:function(e,t,n,i,r){return t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}}],sd=function(e){function t(){var e;rn(this,t),(e=Kt(this,t)).timelines=[],e.discontinuities=[],e.timelineToDatetimeMappings={};var n=new id,i=new rd(n),r=new rd(n);return e.mediaSequenceStorage_={main:n,audio:i,vtt:r},e.logger_=lu("SyncController"),e}return Gt(t,e),sn(t,[{key:"getMediaSequenceSync",value:function(e){return this.mediaSequenceStorage_[e]||null}},{key:"getSyncPoint",value:function(e,t,n,i,r){if(t!==1/0)return ad.find(function(e){return"VOD"===e.name}).run(this,e,t);var a=this.runStrategies_(e,t,n,i,r);if(!a.length)return null;var s,o=zt(a);try{for(o.s();!(s=o.n()).done;){var u=s.value,l=u.syncPoint,c=u.strategy,d=l.segmentIndex,h=l.time;if(!(d<0)){var p=e.segments[d],f=h,m=f+p.duration;if(this.logger_("Strategy: ".concat(c,". Current time: ").concat(i,". selected segment: ").concat(d,". Time: [").concat(f," -> ").concat(m,"]}")),i>=f&&i<m)return this.logger_("Found sync point with exact match: ",l),l}}}catch(e){o.e(e)}finally{o.f()}return this.selectSyncPoint_(a,{key:"time",value:i})}},{key:"getExpiredTime",value:function(e,t){if(!e||!e.segments)return null;var n=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!n.length)return null;var i=this.selectSyncPoint_(n,{key:"segmentIndex",value:0});return i.segmentIndex>0&&(i.time*=-1),Math.abs(i.time+xu({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:i.segmentIndex,endIndex:0}))}},{key:"runStrategies_",value:function(e,t,n,i,r){for(var a=[],s=0;s<ad.length;s++){var o=ad[s],u=o.run(this,e,t,n,i,r);u&&(u.strategy=o.name,a.push({strategy:o.name,syncPoint:u}))}return a}},{key:"selectSyncPoint_",value:function(e,t){for(var n=e[0].syncPoint,i=Math.abs(e[0].syncPoint[t.key]-t.value),r=e[0].strategy,a=1;a<e.length;a++){var s=Math.abs(e[a].syncPoint[t.key]-t.value);s<i&&(i=s,n=e[a].syncPoint,r=e[a].strategy)}return this.logger_("syncPoint for [".concat(t.key,": ").concat(t.value,"] chosen with strategy")+" [".concat(r,"]: [time:").concat(n.time,",")+" segmentIndex:".concat(n.segmentIndex)+("number"==typeof n.partIndex?",partIndex:".concat(n.partIndex):"")+"]"),n}},{key:"saveExpiredSegmentInfo",value:function(e,t){var n=t.mediaSequence-e.mediaSequence;if(n>86400)Zo.log.warn("Not saving expired segment info. Media sequence gap ".concat(n," is too large."));else for(var i=n-1;i>=0;i--){var r=e.segments[i];if(r&&void 0!==r.start){t.syncInfo={mediaSequence:e.mediaSequence+i,time:r.start},this.logger_("playlist refresh sync: [time:".concat(t.syncInfo.time,",")+" mediaSequence: ".concat(t.syncInfo.mediaSequence,"]")),this.trigger("syncinfoupdate");break}}}},{key:"setDateTimeMappingForStart",value: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}}},{key:"saveSegmentTimingInfo",value:function(e){var t=e.segmentInfo,n=e.shouldSaveTimelineMapping,i=this.calculateSegmentTimeMapping_(t,t.timingInfo,n),r
2=t.segment;i&&(this.saveDiscontinuitySyncInfo_(t),t.playlist.syncInfo||(t.playlist.syncInfo={mediaSequence:t.playlist.mediaSequence+t.mediaIndex,time:r.start}));var a=r.dateTimeObject;r.discontinuity&&n&&a&&(this.timelineToDatetimeMappings[r.timeline]=-a.getTime()/1e3)}},{key:"timestampOffsetForTimeline",value:function(e){return void 0===this.timelines[e]?null:this.timelines[e].time}},{key:"mappingForTimeline",value:function(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping}},{key:"calculateSegmentTimeMapping_",value:function(e,t,n){var i,r,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 ".concat(e.timeline,": ")+"[time: ".concat(o.time,"] [mapping: ").concat(o.mapping,"]"))),i=e.startOfSegment,r=t.end+o.mapping;else{if(!o)return!1;i=t.start+o.mapping,r=t.end+o.mapping}return s&&(s.start=i,s.end=r),(!a.start||i<a.start)&&(a.start=i),a.end=r,!0}},{key:"saveDiscontinuitySyncInfo_",value: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 i=0;i<t.discontinuityStarts.length;i++){var r=t.discontinuityStarts[i],a=t.discontinuitySequence+i+1,s=r-e.mediaIndex,o=Math.abs(s);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>o){var u=void 0;u=s<0?n.start-xu({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:r}):n.end+xu({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:r}),this.discontinuities[a]={time:u,accuracy:o}}}}},{key:"dispose",value:function(){this.trigger("dispose"),this.off()}}])}(Zo.EventTarget),od=function(e){function t(){var e;return rn(this,t),(e=Kt(this,t)).pendingTimelineChanges_={},e.lastTimelineChanges_={},e}return Gt(t,e),sn(t,[{key:"clearPendingTimelineChange",value:function(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}},{key:"pendingTimelineChange",value:function(e){var t=e.type,n=e.from,i=e.to;return"number"==typeof n&&"number"==typeof i&&(this.pendingTimelineChanges_[t]={type:t,from:n,to:i},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[t]}},{key:"lastTimelineChange",value:function(e){var t=e.type,n=e.from,i=e.to;if("number"==typeof n&&"number"==typeof i){this.lastTimelineChanges_[t]={type:t,from:n,to:i},delete this.pendingTimelineChanges_[t];var r={timelineChangeInfo:{from:n,to:i}};this.trigger({type:"timelinechange",metadata:r})}return this.lastTimelineChanges_[t]}},{key:"dispose",value:function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}])}(Zo.EventTarget),ud=Ol(Rl(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,i=0;i<n;++i)t[i].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),a=t.length,s=0;s<a;++s)t[s].apply(this,r)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",function(t){e.push(t)})},e}();var t,i=null,r=function(){return sn(function e(t){var n,r,a;rn(this,e),i||(i=function(){var e,t,n,i,r,a,s,o,u=[[[],[],[],[],[]],[[],[],[],[],[]]],l=u[0],c=u[1],d=l[4],h=c[4],p=[],f=[];for(e=0;e<256;e++)f[(p[e]=e<<1^283*(e>>7))^e]=e;for(t=n=0;!d[t];t^=i||1,n=f[n]||1)for(a=(a=n^n<<1^n<<2^n<<3^n<<4)>>8^255&a^99,d[t]=a,h[a]=t,o=16843009*p[r=p[i=p[t]]]^65537*r^257*i^16843008*t,s=257*p[a]^16843008*a,e=0;e<4;e++)l[e][t]=s=s<<24^s>>>8,c[e][a]=o=o<<24^o>>>8;for(e=0;e<5;e++)l[e]=l[e].slice(0),c[e]=c[e].slice(0);return u}()),this._tables=[[i[0][0].slice(),i[0][1].slice(),i[0][2].slice(),i[0][3].slice(),i[0][4].slice()],[i[1][0].slice(),i[1][1].slice(),i[1][2].slice(),i[1][3].slice(),i[1][4].slice()]];var s=this._tables[0][4],o=this._tables[1],u=t.length,l=1;if(4!==u&&6!==u&&8!==u)throw new Error("Invalid aes key size");var c=t.slice(0),d=[];for(this._key=[c,d],n=u;n<4*u+28;n++)a=c[n-1],(n%u===0||8===u&&n%u===4)&&(a=s[a>>>24]<<24^s[a>>16&255]<<16^s[a>>8&255]<<8^s[255&a],n%u===0&&(a=a<<8^a>>>24^l<<24,l=l<<1^283*(l>>7))),c[n]=c[n-u]^a;for(r=0;n;r++,n--)a=c[3&r?n:n-4],d[r]=n<=4||r<4?a:o[0][s[a>>>24]]^o[1][s[a>>16&255]]^o[2][s[a>>8&255]]^o[3][s[255&a]]},[{key:"decrypt",value:function(e,t,n,i,r,a){var s,o,u,l,c=this._key[1],d=e^c[0],h=i^c[1],p=n^c[2],f=t^c[3],m=c.length/4-2,g=4,v=this._tables[1],y=v[0],_=v[1],b=v[2],T=v[3],k=v[4];for(l=0;l<m;l++)s=y[d>>>24]^_[h>>16&255]^b[p>>8&255]^T[255&f]^c[g],o=y[h>>>24]^_[p>>16&255]^b[f>>8&255]^T[255&d]^c[g+1],u=y[p>>>24]^_[f>>16&255]^b[d>>8&255]^T[255&h]^c[g+2],f=y[f>>>24]^_[d>>16&255]^b[h>>8&255]^T[255&p]^c[g+3],g+=4,d=s,h=o,p=u;for(l=0;l<4;l++)r[(3&-l)+a]=k[d>>>24]<<24^k[h>>16&255]<<16^k[p>>8&255]<<8^k[255&f]^c[g++],s=d,d=h,h=p,p=f,f=s}}])}(),a=function(t){function n(){var t;return rn(this,n),(t=Kt(this,n,[e])).jobs=[],t.delay=1,t.timeout_=null,t}return Gt(n,t),sn(n,[{key:"processJob_",value:function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}},{key:"push",value:function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}])}(e),s=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},o=function(){return sn(function e(t,n,i,r){rn(this,e);var o=e.STEP,u=new Int32Array(t.buffer),l=new Uint8Array(t.byteLength),c=0;for(this.asyncStream_=new a,this.asyncStream_.push(this.decryptChunk_(u.subarray(c,c+o),n,i,l)),c=o;c<u.length;c+=o)i=new Uint32Array([s(u[c-4]),s(u[c-3]),s(u[c-2]),s(u[c-1])]),this.asyncStream_.push(this.decryptChunk_(u.subarray(c,c+o),n,i,l));this.asyncStream_.push(function(){var e;r(null,(e=l).subarray(0,e.byteLength-e[e.byteLength-1]))})},[{key:"decryptChunk_",value:function(e,t,n,i){return function(){var a=function(e,t,n){var i,a,o,u,l,c,d,h,p,f=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),m=new r(Array.prototype.slice.call(t)),g=new Uint8Array(e.byteLength),v=new Int32Array(g.buffer);for(i=n[0],a=n[1],o=n[2],u=n[3],p=0;p<f.length;p+=4)l=s(f[p]),c=s(f[p+1]),d=s(f[p+2]),h=s(f[p+3]),m.decrypt(l,c,d,h,v,p),v[p]=s(v[p]^i),v[p+1]=s(v[p+1]^a),v[p+2]=s(v[p+2]^o),v[p+3]=s(v[p+3]^u),i=l,a=c,o=d,u=h;return g}(e,t,n);i.set(a,e.byteOffset)}}}],[{key:"STEP",get:function(){return 32e3}}])}(),u="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{};t="undefined"!=typeof window?window:void 0!==u?u:"undefined"!=typeof self?self:{};var l=t.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]}();var c=function(e){var t={};return Object.keys(e).forEach(function(n){var i,r=e[n];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};self.onmessage=function(e){var t=e.data,n=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),i=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),r=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new o(n,i,r,function(e,n){self.postMessage(c({source:t.source,decrypted:n}),[n.buffer])})}})),ld=Ll(ud),cd=function(e){var t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},dd=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},hd=function(e,t){t.activePlaylistLoader=e,e.load()},pd={AUDIO:function(e,t){return function(){var n=t.mediaTypes[e],i=t.excludePlaylist,r=n.activeTrack(),a=n.activeGroup(),s=(a.filter(function(e){return e.default})[0]||a[0]).id,o=n.tracks[s];if(r!==o){for(var u in Zo.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),n.tracks)n.tracks[u].enabled=n.tracks[u]===o;n.onTrackChanged()}else i({error:{message:"Problem encountered loading the default audio track."}})}},SUBTITLES:function(e,t){return function(){var n=t.mediaTypes[e];Zo.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");var i=n.activeTrack();i&&(i.mode="disabled"),n.onTrackChanged()}}},fd={AUDIO:function(e,t,n){if(t){var i=n.tech,r=n.requestOptions,a=n.segmentLoaders[e];t.on("loadedmetadata",function(){var e=t.media();a.playlist(e,r),(!i.paused()||e.endList&&"none"!==i.preload())&&a.load()}),t.on("loadedplaylist",function(){a.playlist(t.media(),r),i.paused()||a.load()}),t.on("error",pd[e](e,n))}},SUBTITLES:function(e,t,n){var i=n.tech,r=n.requestOptions,a=n.segmentLoaders[e],s=n.mediaTypes[e];t.on("loadedmetadata",function(){var e=t.media();a.playlist(e,r),a.track(s.activeTrack()),(!i.paused()||e.endList&&"none"!==i.preload())&&a.load()}),t.on("loadedplaylist",function(){a.playlist(t.media(),r),i.paused()||a.load()}),t.on("error",pd[e](e,n))}},md={AUDIO:function(e,t){var n=t.vhs,i=t.sourceType,r=t.segmentLoaders[e],a=t.requestOptions,s=t.main.mediaGroups,o=t.mediaTypes[e],u=o.groups,l=o.tracks,c=o.logger_,d=t.mainPlaylistLoader,h=Uu(d.main);for(var p in s[e]&&0!==Object.keys(s[e]).length||(s[e]={main:{default:{default:!0}}},h&&(s[e].main.default.playlists=d.main.playlists)),s[e])for(var f in u[p]||(u[p]=[]),s[e][p]){var m=s[e][p][f],g=void 0;if(h?(c("AUDIO group '".concat(p,"' label '").concat(f,"' is a main playlist")),m.isMainPlaylist=!0,g=null):g="vhs-json"===i&&m.playlists?new ol(m.playlists[0],n,a):m.resolvedUri?new ol(m.resolvedUri,n,a):m.playlists&&"dash"===i?new Al(m.playlists[0],n,a,d):null,m=cu({
2id:f,playlistLoader:g},m),fd[e](e,m.playlistLoader,t),u[p].push(m),void 0===l[f]){var v=new Zo.AudioTrack({id:f,kind:cd(m),enabled:!1,language:m.language,default:m.default,label:f});l[f]=v}}r.on("error",pd[e](e,t))},SUBTITLES:function(e,t){var n=t.tech,i=t.vhs,r=t.sourceType,a=t.segmentLoaders[e],s=t.requestOptions,o=t.main.mediaGroups,u=t.mediaTypes[e],l=u.groups,c=u.tracks,d=t.mainPlaylistLoader;for(var h in o[e])for(var p in l[h]||(l[h]=[]),o[e][h])if(i.options_.useForcedSubtitles||!o[e][h][p].forced){var f=o[e][h][p],m=void 0;if("hls"===r)m=new ol(f.resolvedUri,i,s);else if("dash"===r){if(!f.playlists.filter(function(e){return e.excludeUntil!==1/0}).length)return;m=new Al(f.playlists[0],i,s,d)}else"vhs-json"===r&&(m=new ol(f.playlists?f.playlists[0]:f.resolvedUri,i,s));if(f=cu({id:p,playlistLoader:m},f),fd[e](e,f.playlistLoader,t),l[h].push(f),void 0===c[p]){var g=n.addRemoteTextTrack({id:p,kind:"subtitles",default:f.default&&f.autoselect,language:f.language,label:p},!1).track;c[p]=g}}a.on("error",pd[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var n=t.tech,i=t.main.mediaGroups,r=t.mediaTypes[e],a=r.groups,s=r.tracks;for(var o in i[e])for(var u in a[o]||(a[o]=[]),i[e][o]){var l=i[e][o][u];if(/^(?:CC|SERVICE)/.test(l.instreamId)){var c=n.options_.vhs&&n.options_.vhs.captionServices||{},d={label:u,language:l.language,instreamId:l.instreamId,default:l.default&&l.autoselect};if(c[d.instreamId]&&(d=cu(d,c[d.instreamId])),void 0===d.default&&delete d.default,a[o].push(cu({id:u},l)),void 0===s[u]){var h=n.addRemoteTextTrack({id:d.instreamId,
2kind:"captions",default:d.default,language:d.language,label:d.label},!1).track;s[u]=h}}}}},gd=function(e,t){for(var n=0;n<e.length;n++){if(Mu(t,e[n]))return!0;if(e[n].playlists&&gd(e[n].playlists,t))return!0}return!1},vd={AUDIO:function(e,t){return function(){var n=t.mediaTypes[e].tracks;for(var i in n)if(n[i].enabled)return n[i];return null}},SUBTITLES:function(e,t){return function(){var n=t.mediaTypes[e].tracks;for(var i in n)if("showing"===n[i].mode||"hidden"===n[i].mode)return n[i];return null}}},yd=function(e){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(t){md[t](t,e)});var t=e.mediaTypes,n=e.mainPlaylistLoader,i=e.tech,r=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 i=t.mainPlaylistLoader,r=t.mediaTypes[e].groups,a=i.media();if(!a)return null;var s=null;a.attributes[e]&&(s=r[a.attributes[e]]);var o=Object.keys(r);if(!s)if("AUDIO"===e&&o.length>1&&Uu(t.main))for(var u=0;u<o.length;u++){var l=r[o[u]];if(gd(l,a)){s=l;break}}else r.main?s=r.main:1===o.length&&(s=r[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=vd[n](n,e),t[n].onGroupChanged=function(e,t){return function(){var n=t.segmentLoaders,i=n[e],r=n.main,a=t.mediaTypes[e],s=a.activeTrack(),o=a.getActiveGroup(),u=a.activePlaylistLoader,l=a.lastGroup_;o&&l&&o.id===l.id||(a.lastGroup_=o,a.lastTrack_=s,dd(i,a),o&&!o.isMainPlaylist&&(o.playlistLoader?(i.resyncLoader(),hd(o.playlistLoader,a)):u&&r.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.mainPlaylistLoader,i=t.segmentLoaders,r=i[e],a=i.main,s=t.mediaTypes[e],o=s.activeTrack(),u=s.getActiveGroup(),l=s.activePlaylistLoader,c=s.lastTrack_;if((!c||!o||c.id!==o.id)&&(s.lastGroup_=u,s.lastTrack_=o,dd(r,s),u)){if(u.isMainPlaylist){if(!o||!c||o.id===c.id)return;var d=t.vhs.playlistController_,h=d.selectPlaylist();if(d.media()===h)return;return s.logger_("track change. Switching main audio from ".concat(c.id," to ").concat(o.id)),n.pause(),a.resetEverything(),void d.fastQualityChange_(h)}if("AUDIO"===e){if(!u.playlistLoader)return a.setAudio(!0),void a.resetEverything();r.setAudio(!0),a.setAudio(!1)}l!==u.playlistLoader?(r.track&&r.track(o),r.resetEverything(),hd(u.playlistLoader,s)):hd(u.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 u=t.AUDIO.activeGroup();if(u){var l=(u.filter(function(e){return e.default})[0]||u[0]).id;t.AUDIO.tracks[l].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(),i.trigger({type:"usage",name:"vhs-audio-change"})};for(var d in i.audioTracks().addEventListener("change",c),i.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),r.on("dispose",function(){i.audioTracks().removeEventListener("change",c),i.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)}),i.clearTracks("audio"),t.AUDIO.tracks)i.audioTracks().addTrack(t.AUDIO.tracks[d])},_d=function(){return sn(function e(){rn(this,e),this.priority_=[],this.pathwayClones_=new Map},[{key:"version",get:function(){return this.version_},set:function(e){1===e&&(this.version_=e)}},{key:"ttl",get:function(){return this.ttl_},set:function(e){this.ttl_=e||300}},{key:"reloadUri",get:function(){return this.reloadUri_},set:function(e){e&&(this.reloadUri_=ou(this.reloadUri_,e))}},{key:"priority",get:function(){return this.priority_},set:function(e){e&&e.length&&(this.priority_=e)}},{key:"pathwayClones",get:function(){return this.pathwayClones_},set:function(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(function(e){return[e.ID,e]})))}}])}(),bd=function(e){function t(e,n){var i;return rn(this,t),(i=Kt(this,t)).currentPathway=null,i.defaultPathway=null,i.queryBeforeStart=!1,i.availablePathways_=new Set,i.steeringManifest=new _d,i.proxyServerUrl_=null,i.manifestType_=null,i.ttlTimeout_=null,i.request_=null,i.currentPathwayClones=new Map,i.nextPathwayClones=new Map,i.excludedSteeringManifestURLs=new Set,i.logger_=lu("Content Steering"),i.xhr_=e,i.getBandwidth_=n,i}return Gt(t,e),sn(t,[{key:"assignTagProperties",value:function(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";var n=t.serverUri||t.serverURL;if(!n)return this.logger_("steering manifest URL is ".concat(n,", cannot request steering manifest.")),void this.trigger("error");n.startsWith("data:")?this.decodeDataUriManifest_(n.substring(n.indexOf(",")+1)):(this.steeringManifest.reloadUri=ou(e,n),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering"))}},{key:"requestSteeringManifest",value:function(e){var t=this,n=this.steeringManifest.reloadUri;if(n){var i=e?n:this.getRequestURI(n);if(!i)return this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),void this.dispose();var r={contentSteeringInfo:{uri:i}};this.trigger({type:"contentsteeringloadstart",metadata:r}),this.request_=this.xhr_({uri:i,requestType:"content-steering-manifest"},function(e,n){if(e){if(410===n.status)return t.logger_("manifest request 410 ".concat(e,".")),t.logger_("There will be no more content steering requests to ".concat(i," this session.")),void t.excludedSteeringManifestURLs.add(i);if(429===n.status){var a=n.responseHeaders["retry-after"];return t.logger_("manifest request 429 ".concat(e,".")),t.logger_("content steering will retry in ".concat(a," seconds.")),void t.startTTLTimeout_(parseInt(a,10))}return t.logger_("manifest failed to load ".concat(e,".")),void t.startTTLTimeout_()}var s;t.trigger({type:"contentsteeringloadcomplete",metadata:r});try{s=JSON.parse(t.request_.responseText)}catch(e){var o={errorType:Zo.Error.StreamingContentSteeringParserError,error:e};t.trigger({type:"error",metadata:o})}t.assignSteeringProperties_(s);var u={contentSteeringInfo:r.contentSteeringInfo,contentSteeringManifest:{version:t.steeringManifest.version,reloadUri:t.steeringManifest.reloadUri,priority:t.steeringManifest.priority}};t.trigger({type:"contentsteeringparsed",metadata:u}),t.startTTLTimeout_()})}}},{key:"setProxyServerUrl_",value:function(e){var t=new(u()().URL)(e),n=new(u()().URL)(this.proxyServerUrl_);return n.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(n.toString())}},{key:"decodeDataUriManifest_",value:function(e){var t=JSON.parse(u()().atob(e));this.assignSteeringProperties_(t)}},{key:"setSteeringParams_",value:function(e){var t=new(u()().URL)(e),n=this.getPathway(),i=this.getBandwidth_();if(n){var r="_".concat(this.manifestType_,"_pathway");t.searchParams.set(r,n)}if(i){var a="_".concat(this.manifestType_,"_throughput");t.searchParams.set(a,i)}return t.toString()}},{key:"assignSteeringProperties_",value:function(e){var t=this;if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version)return this.logger_("manifest version is ".concat(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 c
2ontent steering. Ending content steering."),this.trigger("error"),this.dispose());var n=function(e){var n,i=zt(e);try{for(i.s();!(n=i.n()).done;){var r=n.value;if(t.availablePathways_.has(r))return r}}catch(e){i.e(e)}finally{i.f()}return un(t.availablePathways_)[0]}(this.steeringManifest.priority);this.currentPathway!==n&&(this.currentPathway=n,this.trigger("content-steering"))}},{key:"getPathway",value:function(){return this.currentPathway||this.defaultPathway}},{key:"getRequestURI",value:function(e){var t=this;if(!e)return null;var n=function(e){return t.excludedSteeringManifestURLs.has(e)};if(this.proxyServerUrl_){var i=this.setProxyServerUrl_(e);if(!n(i))return i}var r=this.setSteeringParams_(e);return n(r)?null:r}},{key:"startTTLTimeout_",value:function(){var e=this,t=1e3*(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.steeringManifest.ttl);this.ttlTimeout_=u()().setTimeout(function(){e.requestSteeringManifest()},t)}},{key:"clearTTLTimeout_",value:function(){u()().clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}},{key:"abort",value:function(){this.request_&&this.request_.abort(),this.request_=null}},{key:"dispose",value:function(){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 _d}},{key:"addAvailablePathway",value:function(e){e&&this.availablePathways_.add(e)}},{key:"clearAvailablePathways",value:function(){this.availablePathways_.clear()}},{key:"excludePathway",value:function(e){return this.availablePathways_.delete(e)}},{key:"didDASHTagChange",value:function(e,t){return!t&&this.steeringManifest.reloadUri||t&&(ou(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}},{key:"getAvailablePathways",value:function(){return this.availablePathways_}}])}(Zo.EventTarget),Td=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],kd=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},Sd=function(e){function t(e){var n,i,r,a;rn(this,t),(n=Kt(this,t)).fastQualityChange_=(i=n.fastQualityChange_.bind(n),r=100,a=null,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];clearTimeout(a),a=setTimeout(function(){i.apply(null,t)},r)});var s=e.src,o=e.withCredentials,l=e.tech,c=e.bandwidth,d=e.externVhs,h=e.useCueTags,p=e.playlistExclusionDuration,f=e.enableLowInitialPlaylist,m=e.sourceType,g=e.cacheEncryptionKeys,v=e.bufferBasedABR,y=e.leastPixelDiffSelector,_=e.captionServices,b=e.experimentalUseMMS;if(!s)throw new Error("A non-empty playlist URL or JSON manifest string is required");var T=e.maxPlaylistRetries;null==T&&(T=1/0),Dc=d,n.bufferBasedABR=Boolean(v),n.leastPixelDiffSelector=Boolean(y),n.withCredentials=o,n.tech_=l,n.vhs_=l.vhs,n.player_=e.player_,n.sourceType_=m,n.useCueTags_=h,n.playlistExclusionDuration=p,n.maxPlaylistRetries=T,n.enableLowInitialPlaylist=f,n.usingManagedMediaSource_=!1,n.useCueTags_&&(n.cueTagsTrack_=n.tech_.addTextTrack("metadata","ad-cues"),n.cueTagsTrack_.inBandMetadataTrackDispatchType=""),n.requestOptions_={withCredentials:o,maxPlaylistRetries:T,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:Ac,activeTrack:Ac,getActiveGroup:Ac,onGroupChanged:Ac,onTrackChanged:Ac,lastTrack_:null,logger_:lu("MediaGroups[".concat(t,"]"))}}),e}(),b&&u()().ManagedMediaSource?(n.tech_.el_.disableRemotePlayback=!0,n.mediaSource=new(u()().ManagedMediaSource),n.usingManagedMediaSource_=!0,Zo.log("Using ManagedMediaSource")):u()().MediaSource&&(n.mediaSource=new(u()().MediaSource)),n.handleDurationChange_=n.handleDurationChange_.bind(n),n.handleSourceOpen_=n.handleSourceOpen_.bind(n),n.handleSourceEnded_=n.handleSourceEnded_.bind(n),n.load=n.load.bind(n),n.pause=n.pause.bind(n),n.mediaSource.addEventListener("durationchange",n.handleDurationChange_),n.mediaSource.addEventListener("sourceopen",n.handleSourceOpen_),n.mediaSource.addEventListener("sourceended",n.handleSourceEnded_),n.mediaSource.addEventListener("startstreaming",n.load
2),n.mediaSource.addEventListener("endstreaming",n.pause),n.seekable_=du(),n.hasPlayed_=!1,n.syncController_=new sd(e),n.segmentMetadataTrack_=l.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,n.segmentMetadataTrack_.mode="hidden",n.decrypter_=new ld,n.sourceUpdater_=new Yc(n.mediaSource),n.inbandTextTracks_={},n.timelineChangeController_=new od,n.keyStatusMap_=new Map;var k={vhs:n.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:_,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:c,syncController:n.syncController_,decrypter:n.decrypter_,sourceType:n.sourceType_,inbandTextTracks:n.inbandTextTracks_,cacheEncryptionKeys:g,sourceUpdater:n.sourceUpdater_,timelineChangeController:n.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:n.addMetadataToTextTrack.bind(n)};n.mainPlaylistLoader_="dash"===n.sourceType_?new Al(s,n.vhs_,cu(n.requestOptions_,{addMetadataToTextTrack:n.addMetadataToTextTrack.bind(n)})):new ol(s,n.vhs_,cu(n.requestOptions_,{addDateRangesToTextTrack:n.addDateRangesToTextTrack_.bind(n)})),n.setupMainPlaylistLoaderListeners_(),n.mainSegmentLoader_=new xc(cu(k,{segmentMetadataTrack:n.segmentMetadataTrack_,loaderType:"main"}),e),n.audioSegmentLoader_=new xc(cu(k,{loaderType:"audio"}),e),n.subtitleSegmentLoader_=new Zc(cu(k,{loaderType:"vtt",featuresNativeTextTracks:n.tech_.featuresNativeTextTracks,loadVttJs:function(){return new Promise(function(e,t){function n(){l.off("vttjserror",i),e()}function i(){l.off("vttjsloaded",n),t()}l.one("vttjsloaded",n),l.one("vttjserror",i),l.addWebVttScript_()})}}),e);n.contentSteeringController_=new bd(n.vhs_.xhr,function(){return n.mainSegmentLoader_.bandwidth}),n.setupSegmentLoaderListeners_(),n.bufferBasedABR&&(n.mainPlaylistLoader_.one("loadedplaylist",function(){return n.startABRTimer_()}),n.tech_.on("pause",function(){return n.stopABRTimer_()}),n.tech_.on("play",function(){return n.startABRTimer_()})),Td.forEach(function(e){n[e+"_"]=kd.bind(n,e)}),n.logger_=lu("pc"),n.triggeredFmp4Usage=!1,"none"===n.tech_.preload()?(n.loadOnPlay_=function(){n.loadOnPlay_=null,n.mainPlaylistLoader_.load()},n.tech_.one("play",n.loadOnPlay_)):n.mainPlaylistLoader_.load(),n.timeToLoadedData__=-1,n.mainAppendsToLoadedData__=-1,n.audioAppendsToLoadedData__=-1;var S="none"===n.tech_.preload()?"play":"loadstart";return n.tech_.one(S,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}return Gt(t,e),sn(t,[{key:"mainAppendsToLoadedData_",value:function(){return this.mainAppendsToLoadedData__}},{key:"audioAppendsToLoadedData_",value:function(){return this.audioAppendsToLoadedData__}},{key:"appendsToLoadedData_",value:function(){var e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return-1===e||-1===t?-1:e+t}},{key:"timeToLoadedData_",value:function(){return this.timeToLoadedData__}},{key:"checkABR_",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"abr",t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}},{key:"switchMedia_",value:function(e,t,n){var i=this.media(),r=i&&(i.id||i.uri),a=e&&(e.id||e.uri);if(r&&r!==a){this.logger_("switch media ".concat(r," -> ").concat(a," from ").concat(t));var s={renditionInfo:{id:a,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:s}),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-".concat(t)})}this.mainPlaylistLoader_.media(e,n)}},{key:"switchMediaForDASHContentSteering_",value:function(){var e=this;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(t){var n=e.mediaTypes_[t],i=n?n.activeGroup():null,r=e.contentSteeringController_.getPathway();if(i&&r){var a=(i.length?i[0].playlists:i.playlists).filter(function(e){return e.attributes.serviceLocation===r});a.length&&e.mediaTypes_[t].activePlaylistLoader.media(a[0])}})}},{key:"startABRTimer_",value:function(){var e=this;this.stopABRTimer_(),this.abrTimer_=u()().setInterval(function(){return e.checkABR_()},250)}},{key:"stopABRTimer_",value:function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(u()().clearInterval(this.abrTimer_),this.abrTimer_=null)}},{key:"getAudioTrackPlaylists_",value:function(){var e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;var n,i=e.mediaGroups.AUDIO,r=Object.keys(i);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else{var a=i.main||r.length&&i[r[0]];for(var s in a)if(a[s].default){n={label:s};break}}if(!n)return t;var o=[];for(var u in i)if(i[u][n.label]){var l=i[u][n.label];if(l.playlists&&l.playlists.length)o.push.apply(o,l.playlists);else if(l.uri)o.push(l);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===u&&o.push(d)}}return o.length?o:t}},{key:"setupMainPlaylistLoaderListeners_",value:function(){var e=this;this.mainPlaylistLoader_.on("loadedmetadata",function(){var t=e.mainPlaylistLoader_.media(),n=1.5*t.targetDuration*1e3;Ru(e.mainPlaylistLoader_.main,e.mainPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=n,t.endList&&"none"!==e.tech_.preload()&&(e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.mainSegmentLoader_.load()),yd({sourceType:e.sourceType_,segmentLoaders:{AUDIO:e.audioSegmentLoader_,SUBTITLES:e.subtitleSegmentLoader_,main:e.mainSegmentLoader_},tech:e.tech_,requestOptions:e.requestOptions_,mainPlaylistLoader:e.mainPlaylistLoader_,vhs:e.vhs_,main:e.main(),mediaTypes:e.mediaTypes_,excludePlaylist:e.excludePlaylist.bind(e)}),e.triggerPresenceUsage_(e.main(),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.mainPlaylistLoader_.on("loadedplaylist",function(){e.loadOnPlay_&&e.tech_.off("play",e.loadOnPlay_);var t=e.mainPlaylistLoader_.media();if(!t){var n;if(e.attachContentSteeringListeners_(),e.initContentSteeringController_
2(),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.mainPlaylistLoader_.on("error",function(){var t=e.mainPlaylistLoader_.error;e.excludePlaylist({playlistToExclude:t.playlist,error:t})}),this.mainPlaylistLoader_.on("mediachanging",function(){e.mainSegmentLoader_.abort(),e.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",function(){var t=e.mainPlaylistLoader_.media(),n=1.5*t.targetDuration*1e3;Ru(e.mainPlaylistLoader_.main,e.mainPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=n,"dash"===e.sourceType_&&e.mainPlaylistLoader_.isPaused&&e.mainPlaylistLoader_.load(),e.mainSegmentLoader_.pause(),e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.waitingForFastQualityPlaylistReceived_?e.runFastQualitySwitch_():e.mainSegmentLoader_.load(),e.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",function(){var t=e.mainPlaylistLoader_.media();"playlist-unchanged"!==t.lastExcludeReason_&&(e.stuckAtPlaylistEnd_(t)&&(e.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),e.tech_.trigger("playliststuck")))}),this.mainPlaylistLoader_.on("renditiondisabled",function(){e.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",function(){e.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})});["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(function(t){e.mainPlaylistLoader_.on(t,function(t){e.player_.trigger(f({},t))})})}},{key:"handleUpdatedMediaPlaylist",value:function(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())}},{key:"triggerPresenceUsage_",value:function(e,t){var n=e.mediaGroups||{},i=!0,r=Object.keys(n.AUDIO);for(var a in n.AUDIO)for(var s in n.AUDIO[a]){n.AUDIO[a][s].uri||(i=!1)}i&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(n.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),Dc.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),r.length&&Object.keys(n.AUDIO[r[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}},{key:"shouldSwitchToMedia_",value:function(e){var t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,n=this.tech_.currentTime(),i=this.bufferLowWaterLine(),r=this.bufferHighWaterLine();return function(e){var t=e.currentPlaylist,n=e.buffered,i=e.currentTime,r=e.nextPlaylist,a=e.bufferLowWaterLine,s=e.bufferHighWaterLine,o=e.duration,u=e.bufferBasedABR,l=e.log;if(!r)return Zo.log.warn("We received no playlist to switch to. Please check your stream."),!1;var c="allowing switch ".concat(t&&t.id||"null"," -> ").concat(r.id);if(!t)return l("".concat(c," as current playlist is not set")),!0;if(r.id===t.id)return!1;var d=Boolean(mu(n,i).length);if(!t.endList)return d||"number"!=typeof t.partTargetDuration?(l("".concat(c," as current playlist is live")),!0):(l("not ".concat(c," as current playlist is live llhls, but currentTime isn't in buffered.")),!1);var h=bu(n,i),p=u?Dl.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Dl.MAX_BUFFER_LOW_WATER_LINE;if(o<p)return l("".concat(c," as duration < max low water line (").concat(o," < ").concat(p,")")),!0;var f=r.attributes.BANDWIDTH,m=t.attributes.BANDWIDTH;if(f<m&&(!u||h<s)){var g="".concat(c," as next bandwidth < current bandwidth (").concat(f," < ").concat(m,")");return u&&(g+=" and forwardBuffer < bufferHighWaterLine (".concat(h," < ").concat(s,")")),l(g),!0}if((!u||f>m)&&h>=a){var v="".concat(c," as forwardBuffer >= bufferLowWaterLine (").concat(h," >= ").concat(a,")");return u&&(v+=" and next bandwidth > current bandwidth (".concat(f," > ").concat(m,")")),l(v),!0}return l("not ".concat(c," as no switching criteria met")),!1}({buffered:this.tech_.buffered(),currentTime:n,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:i,bufferHighWaterLine:r,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}},{key:"setupSegmentLoaderListeners_",value:function(){var e=this;this.mainSegmentLoader_.on("bandwidthupdate",function(){e.checkABR_("bandwidthupdate"),e.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",function(){e.bufferBasedABR&&e.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",function(){e.trigger("progress")}),this.mainSegmentLoader_.on("error",function(){var t=e.mainSegmentLoader_.error();e.excludePlaylist({playlistToExclude:t.playlist,error:t})}),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"})}),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.timelineChangeController_.on("audioTimelineBehind",function(){var t=e.audioSegmentLoader_.pen
2dingSegment_;if(t&&t.segment&&t.segment.syncInfo){var n=t.segment.syncInfo.end+.01;e.tech_.setCurrentTime(n)}}),this.timelineChangeController_.on("fixBadTimelineChange",function(){e.logger_("Fix bad timeline change. Restarting al segment loaders..."),e.mainSegmentLoader_.pause(),e.mainSegmentLoader_.resetEverything(),e.mediaTypes_.AUDIO.activePlaylistLoader&&(e.audioSegmentLoader_.pause(),e.audioSegmentLoader_.resetEverything()),e.mediaTypes_.SUBTITLES.activePlaylistLoader&&(e.subtitleSegmentLoader_.pause(),e.subtitleSegmentLoader_.resetEverything()),e.load()}),this.mainSegmentLoader_.on("earlyabort",function(t){e.bufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:10}))});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.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",function(){e.logger_("audioSegmentLoader ended"),e.onEndOfStream()});["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(function(t){e.mainSegmentLoader_.on(t,function(t){e.player_.trigger(f({},t))}),e.audioSegmentLoader_.on(t,function(t){e.player_.trigger(f({},t))}),e.subtitleSegmentLoader_.on(t,function(t){e.player_.trigger(f({},t))})})}},{key:"mediaSecondsLoaded_",value:function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}},{key:"load",value:function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}},{key:"pause",value:function(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}},{key:"fastQualityChange_",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]: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)}},{key:"runFastQualitySwitch_",value:function(){this.waitingForFastQualityPlaylistReceived_=!1,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()),this.load()}},{key:"play",value: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}}},{key:"setupFirstPlay",value:function(){var e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList||e.start){var t=this.seekable();if(!t.length)return!1;var n=t.end(0),i=n;if(e.start){var r=e.start.timeOffset;if(r<0){var a=this.mainPlaylistLoader_.main,s=n+Dc.Playlist.liveEdgeDelay(a,e);i=Math.max(Math.min(s+r,n),t.start(0))}else i=Math.min(n,r)}this.trigger("firstplay"),this.tech_.setCurrentTime(i)}return this.hasPlayed_=!0,this.load(),!0}},{key:"handleSourceOpen_",value: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")}},{key:"handleSourceEnded_",value: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}}}},{key:"handleDurationChange_",value:function(){this.tech_.trigger("durationchange")}}
2,{key:"onEndOfStream",value: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())}},{key:"stuckAtPlaylistEnd_",value:function(e){if(!this.seekable().length)return!1;var t=this.syncController_.getExpiredTime(e,this.duration());if(null===t)return!1;var n=Dc.Playlist.playlistEnd(e,t),i=this.tech_.currentTime(),r=this.tech_.buffered();if(!r.length)return n-i<=pu;var a=r.end(r.length-1);return a-i<=pu&&n-a<=pu}},{key:"excludePlaylist",value:function(e){var t=this,n=e.playlistToExclude,i=void 0===n?this.mainPlaylistLoader_.media():n,r=e.error,a=void 0===r?{}:r,s=e.playlistExclusionDuration;if(i=i||this.mainPlaylistLoader_.media(),s=s||a.playlistExclusionDuration||this.playlistExclusionDuration,!i)return this.error=a,void("open"!==this.mediaSource.readyState?this.trigger("error"):this.sourceUpdater_.endOfStream("network"));i.playlistErrors_++;var o,u=this.mainPlaylistLoader_.main.playlists,l=u.filter(Lu),c=1===l.length&&l[0]===i;if(1===u.length&&s!==1/0)return Zo.log.warn("Problem encountered with playlist ".concat(i.id,". ")+"Trying again since it is the only playlist."),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(c);if(c){if(this.main().contentSteering){var d=this.pathwayAttribute_(i),h=1e3*this.contentSteeringController_.steeringManifest.ttl;return this.contentSteeringController_.excludePathway(d),this.excludeThenChangePathway_(),void setTimeout(function(){t.contentSteeringController_.addAvailablePathway(d)},h)}var p=!1;u.forEach(function(e){if(e!==i){var t=e.excludeUntil;void 0!==t&&t!==1/0&&(p=!0,delete e.excludeUntil)}}),p&&(Zo.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}o=i.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*s,i.excludeUntil=o,a.reason&&(i.lastExcludeReason_=a.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});var f=this.selectPlaylist();if(!f)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");var m=a.internal?this.logger_:Zo.log.warn,g=a.message?" "+a.message:"";m("".concat(a.internal?"Internal problem":"Problem"," encountered with playlist ").concat(i.id,".")+"".concat(g," Switching to playlist ").concat(f.id,".")),f.attributes.AUDIO!==i.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),f.attributes.SUBTITLES!==i.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var v=f.targetDuration/2*1e3||5e3,y="number"==typeof f.lastRequest&&Date.now()-f.lastRequest<=v;return this.switchMedia_(f,"exclude",c||y)}},{key:"pauseLoading",value:function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}},{key:"delegateLoaders_",value:function(e,t){var n=this,i=[],r="all"===e;(r||"main"===e)&&i.push(this.mainPlaylistLoader_);var a=[];(r||"audio"===e)&&a.push("AUDIO"),(r||"subtitle"===e)&&(a.push("CLOSED-CAPTIONS"),a.push("SUBTITLES")),a.forEach(function(e){var t=n.mediaTypes_[e]&&n.mediaTypes_[e].activePlaylistLoader;t&&i.push(t)}),["main","audio","subtitle"].forEach(function(t){var r=n["".concat(t,"SegmentLoader_")];!r||e!==t&&"all"!==e||i.push(r)}),i.forEach(function(e){return t.forEach(function(t){"function"==typeof e[t]&&e[t]()})})}},{key:"setCurrentTime",value:function(e){var t=mu(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}},{key:"duration",value:function(){if(!this.mainPlaylistLoader_)return 0;var e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Dc.Playlist.duration(e):1/0:0}},{key:"seekable",value:function(){return this.seekable_}},{key:"getSeekableRange_",value:function(e,t){var n=e.media();if(!n)return null;var i=this.syncController_.getMediaSequenceSync(t);if(i&&i.isReliable){var r=i.start,a=i.end;if(!isFinite(r)||!isFinite(a))return null;var s=Dc.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,n);return du([[r,Math.max(r,a-s)]])}var o=this.syncController_.getExpiredTime(n,this.duration());if(null===o)return null;var u=Dc.Playlist.seekable(n,o,Dc.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,n));return u.length?u:null}},{key:"computeFinalSeekable_",value:function(e,t){if(!t)return e;var n=e.start(0),i=e.end(0),r=t.start(0),a=t.end(0);return r>i||n>a?e:du([[Math.max(n,r),Math.min(i,a)]])}},{key:"onSyncInfoUpdate_",value:function(){if(this.mainPlaylistLoader_){var e,t=this.getSeekableRange_(this.mainPlaylistLoader_,"main");if(t)if(!this.mediaTypes_.AUDIO.activePlaylistLoader||(e=this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader,"audio"))){var n=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(t,e),this.seekable_&&!(n&&n.length&&this.seekable_.length&&n.start(0)===this.seekable_.start(0)&&n.end(0)===this.seekable_.end(0))){this.logger_("seekable updated [".concat(vu(this.seekable_),"]"));var i={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:i}),this.tech_.trigger("seekablechanged")}}}}},{key:"updateDuration",value: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(),i=Dc.Playlist.duration(this.mainPlaylistLoader_.media());n.length>0&&(i=Math.max(i,n.end(n.length-1))),this.mediaSource.duration!==i&&this.sourceUpdater_.setDuration(i)}}},{key:"dispose",value:function(){var e=this;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(function(t){var n=e.mediaTypes_[t].groups;
2for(var i in n)n[i].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()}},{key:"main",value:function(){return this.mainPlaylistLoader_.main}},{key:"media",value:function(){return this.mainPlaylistLoader_.media()||this.initialMedia_}},{key:"areMediaTypesKnown_",value:function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),n=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!n)}},{key:"getCodecsOrExclude_",value:function(){var e=this,t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},n=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();t.video=t.main;var i=Ju(this.main(),n),r={},a=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(r.video=i.video||t.main.videoCodec||"avc1.4d400d"),t.main.isMuxed&&(r.video+=",".concat(i.audio||t.main.audioCodec||Y)),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||a)&&(r.audio=i.audio||t.main.audioCodec||t.audio.audioCodec||Y,t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4),r.audio||r.video){var s,o={};if(["video","audio"].forEach(function(n){if(r.hasOwnProperty(n)&&(a=t[n].isFmp4,u=r[n],!(a?X(u,e.usingManagedMediaSource_):K(u)))){var i=t[n].isFmp4?"browser":"muxer";o[i]=o[i]||[],o[i].push(r[n]),"audio"===n&&(s=i)}var a,u}),a&&s&&n.attributes.AUDIO){var u=n.attributes.AUDIO;
2this.main().playlists.forEach(function(e){(e.attributes&&e.attributes.AUDIO)===u&&e!==n&&(e.excludeUntil=1/0)}),this.logger_("excluding audio group ".concat(u," as ").concat(s,' does not support codec(s): "').concat(r.audio,'"'))}if(!Object.keys(o).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var l=[];if(["video","audio"].forEach(function(t){var n=(z(e.sourceUpdater_.codecs[t]||"")[0]||{}).type,i=(z(r[t]||"")[0]||{}).type;n&&i&&n.toLowerCase()!==i.toLowerCase()&&l.push('"'.concat(e.sourceUpdater_.codecs[t],'" -> "').concat(r[t],'"'))}),l.length)return void this.excludePlaylist({playlistToExclude:n,error:{message:"Codec switching not supported: ".concat(l.join(", "),"."),internal:!0},playlistExclusionDuration:1/0})}return r}var c=Object.keys(o).reduce(function(e,t){return e&&(e+=", "),e+="".concat(t,' does not support codec(s): "').concat(o[t].join(","),'"')},"")+".";this.excludePlaylist({playlistToExclude:n,error:{internal:!0,message:c},playlistExclusionDuration:1/0})}else this.excludePlaylist({playlistToExclude:n,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0})}},{key:"tryToCreateSourceBuffers_",value: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)}}}},{key:"excludeUnsupportedVariants_",value:function(){var e=this,t=this.main().playlists,n=[];Object.keys(t).forEach(function(i){var r=t[i];if(-1===n.indexOf(r.id)){n.push(r.id);var a=Ju(e.main,r),s=[];!a.audio||K(a.audio)||X(a.audio,e.usingManagedMediaSource_)||s.push("audio codec ".concat(a.audio)),!a.video||K(a.video)||X(a.video,e.usingManagedMediaSource_)||s.push("video codec ".concat(a.video)),a.text&&"stpp.ttml.im1t"===a.text&&s.push("text codec ".concat(a.text)),s.length&&(r.excludeUntil=1/0,e.logger_("excluding ".concat(r.id," for unsupported: ").concat(s.join(", "))))}})}},{key:"excludeIncompatibleVariants_",value:function(e){var t=this,n=[],i=this.main().playlists,r=Qu(z(e)),a=$u(r),s=r.video&&z(r.video)[0]||null,o=r.audio&&z(r.audio)[0]||null;
2Object.keys(i).forEach(function(e){var r=i[e];if(-1===n.indexOf(r.id)&&r.excludeUntil!==1/0){n.push(r.id);var u=[],l=Ju(t.mainPlaylistLoader_.main,r),c=$u(l);if(l.audio||l.video){if(c!==a&&u.push('codec count "'.concat(c,'" !== "').concat(a,'"')),!t.sourceUpdater_.canChangeType()){var d=l.video&&z(l.video)[0]||null,h=l.audio&&z(l.audio)[0]||null;d&&s&&d.type.toLowerCase()!==s.type.toLowerCase()&&u.push('video codec "'.concat(d.type,'" !== "').concat(s.type,'"')),h&&o&&h.type.toLowerCase()!==o.type.toLowerCase()&&u.push('audio codec "'.concat(h.type,'" !== "').concat(o.type,'"'))}u.length&&(r.excludeUntil=1/0,t.logger_("excluding ".concat(r.id,": ").concat(u.join(" && "))))}}})}},{key:"updateAdCues_",value:function(e){var t=0,n=this.seekable();n.length&&(t=n.start(0)),function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(e.segments)for(var i,r=n,a=0;a<e.segments.length;a++){var s=e.segments[a];if(i||(i=ed(t,r+s.duration/2)),i){if("cueIn"in s){i.endTime=r,i.adEndTime=r,r+=s.duration,i=null;continue}if(r<i.endTime){r+=s.duration;continue}i.endTime+=s.duration}else if("cueOut"in s&&((i=new(u()().VTTCue)(r,r+s.duration,s.cueOut)).adStartTime=r,i.adEndTime=r+parseFloat(s.cueOut),t.addCue(i)),"cueOutCont"in s){var o=en(s.cueOutCont.split("/").map(parseFloat),2),l=o[0],c=o[1];(i=new(u()().VTTCue)(r,r+s.duration,"")).adStartTime=r-l,i.adEndTime=i.adStartTime+c,t.addCue(i)}r+=s.duration}}(e,this.cueTagsTrack_,t)}},{key:"goalBufferLength",value:function(){var e=this.tech_.currentTime(),t=Dl.GOAL_BUFFER_LENGTH,n=Dl.GOAL_BUFFER_LENGTH_RATE,i=Math.max(t,Dl.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*n,i)}},{key:"bufferLowWaterLine",value:function(){var e=this.tech_.currentTime(),t=Dl.BUFFER_LOW_WATER_LINE,n=Dl.BUFFER_LOW_WATER_LINE_RATE,i=Math.max(t,Dl.MAX_BUFFER_LOW_WATER_LINE),r=Math.max(t,Dl.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*n,this.bufferBasedABR?r:i)}},{key:"bufferHighWaterLine",value:function(){return Dl.BUFFER_HIGH_WATER_LINE}},{key:"addDateRangesToTextTrack_",value:function(e){vc(this.inbandTextTracks_,"com.apple.streaming",this.tech_),function(e){var t=e.inbandTextTracks,n=e.dateRanges,i=t.metadataTrack_;if(i){var r=u()().WebKitDataCue||u()().VTTCue;n.forEach(function(e){for(var t=0,n=Object.keys(e);t<n.length;t++){var a=n[t];if(!gc.has(a)){var s=new r(e.startTime,e.endTime,"");s.id=e.id,s.type="com.apple.quicktime.HLS",s.value={key:mc[a],data:e[a]},"scte35Out"!==a&&"scte35In"!==a||(s.value.data=new Uint8Array(s.value.data.match(/[\da-f]{2}/gi)).buffer),i.addCue(s)}}e.processDateRange()})}}({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}},{key:"addMetadataToTextTrack",value:function(e,t,n){var i=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();vc(this.inbandTextTracks_,e,this.tech_),fc({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:i,videoDuration:n})}},{key:"pathwayAttribute_",value:function(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}},{key:"initContentSteeringController_",value:function(){var e=this,t=this.main();if(t.contentSteering){var n,i=zt(t.playlists);try{for(i.s();!(n=i.n()).done;){var r=n.value;this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(r))}}catch(e){i.e(e)}finally{i.f()}this.contentSteeringController_.assignTagProperties(t.uri,t.contentSteering),this.contentSteeringController_.queryBeforeStart?this.contentSteeringController_.requestSteeringManifest(!0):this.tech_.one("canplay",function(){e.contentSteeringController_.requestSteeringManifest()})}}},{key:"resetContentSteeringController_",value:function(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}},{key:"attachContentSteeringListeners_",value:function(){var e=this;this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this));["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(function(t){e.contentSteeringController_.on(t,function(t){e.trigger(f({},t))})}),"dash"===this.sourceType_&&this.mainPlaylistLoader_.on("loadedplaylist",function(){var t=e.main();(e.contentSteeringController_.didDASHTagChange(t.uri,t.contentSteering)||function(){var n,i=e.contentSteeringController_.getAvailablePathways(),r=[],a=zt(t.playlists);try{for(a.s();!(n=a.n()).done;){var s=n.value.attributes.serviceLocation;if(s&&(r.push(s),!i.has(s)))return!0}}catch(e){a.e(e)}finally{a.f()}return!(r.length||!i.size)}
2())&&e.resetContentSteeringController_()})}},{key:"excludeThenChangePathway_",value:function(){var e=this,t=this.contentSteeringController_.getPathway();if(t){this.handlePathwayClones_();var n=this.main().playlists,i=new Set,r=!1;Object.keys(n).forEach(function(a){var s=n[a],o=e.pathwayAttribute_(s),u=o&&t!==o;s.excludeUntil===1/0&&"content-steering"===s.lastExcludeReason_&&!u&&(delete s.excludeUntil,delete s.lastExcludeReason_,r=!0);var l=!s.excludeUntil&&s.excludeUntil!==1/0;!i.has(s.id)&&u&&l&&(i.add(s.id),s.excludeUntil=1/0,s.lastExcludeReason_="content-steering",e.logger_("excluding ".concat(s.id," for ").concat(s.lastExcludeReason_)))}),"DASH"===this.contentSteeringController_.manifestType_&&Object.keys(this.mediaTypes_).forEach(function(n){var i=e.mediaTypes_[n];if(i.activePlaylistLoader){var a=i.activePlaylistLoader.media_;a&&a.attributes.serviceLocation!==t&&(r=!0)}}),r&&this.changeSegmentPathway_()}}},{key:"handlePathwayClones_",value:function(){var e=this,t=this.main().playlists,n=this.contentSteeringController_.currentPathwayClones,i=this.contentSteeringController_.nextPathwayClones;if(n&&n.size||i&&i.size){var r,a=zt(n.entries());try{for(a.s();!(r=a.n()).done;){var s=en(r.value,2),o=s[0],u=s[1];i.get(o)||(this.mainPlaylistLoader_.updateOrDeleteClone(u),this.contentSteeringController_.excludePathway(o))}}catch(e){a.e(e)}finally{a.f()}var l,c=zt(i.entries());try{var d=function(){var i=en(l.value,2),r=i[0],a=i[1],s=n.get(r);return s?e.equalPathwayClones_(s,a)?0:(e.mainPlaylistLoader_.updateOrDeleteClone(a,!0),void e.contentSteeringController_.addAvailablePathway(r)):(t.filter(function(e){return e.attributes["PATHWAY-ID"]===a["BASE-ID"]}).forEach(function(t){e.mainPlaylistLoader_.addClonePathway(a,t)}),e.contentSteeringController_.addAvailablePathway(r),0)};for(c.s();!(l=c.n()).done;)d()}catch(e){c.e(e)}finally{c.f()}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify(un(i))))}}},{key:"equalPathwayClones_",value:function(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;var n=e["URI-REPLACEMENT"].PARAMS,i=t["URI-REPLACEMENT"].PARAMS;for(var r in n)if(n[r]!==i[r])return!1;for(var a in i)if(n[a]!==i[a])return!1;return!0}},{key:"changeSegmentPathway_",value:function(){var e=this.selectPlaylist();this.pauseLoading(),"DASH"===this.contentSteeringController_.manifestType_&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}},{key:"excludeNonUsablePlaylistsByKeyId_",value:function(){var e=this;if(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.main){var t=0,n="non-usable";
2this.mainPlaylistLoader_.main.playlists.forEach(function(i){var r=e.mainPlaylistLoader_.getKeyIdSet(i);r&&r.size&&r.forEach(function(r){var a="usable",s=e.keyStatusMap_.has(r)&&e.keyStatusMap_.get(r)===a,o=i.lastExcludeReason_===n&&i.excludeUntil===1/0;s?s&&o&&(delete i.excludeUntil,delete i.lastExcludeReason_,e.logger_("enabling playlist ".concat(i.id," because key ID ").concat(r," is ").concat(a))):(i.excludeUntil!==1/0&&i.lastExcludeReason_!==n&&(i.excludeUntil=1/0,i.lastExcludeReason_=n,e.logger_("excluding playlist ".concat(i.id," because the key ID ").concat(r," doesn't exist in the keyStatusMap or is not ").concat(a))),t++)})}),t>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(function(e){var t=e&&e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height<720,i=e.excludeUntil===1/0&&e.lastExcludeReason_===n;t&&i&&(delete e.excludeUntil,Zo.log.warn("enabling non-HD playlist ".concat(e.id," because all playlists were excluded due to ").concat(n," key IDs")))})}}},{key:"addKeyStatus_",value:function(e,t){var n,i=("string"==typeof e?e:(n=new Uint8Array(e),Array.from(n).map(function(e){return e.toString(16).padStart(2,"0")}).join(""))).slice(0,32).toLowerCase();this.logger_("KeyStatus '".concat(t,"' with key ID ").concat(i," added to the keyStatusMap")),this.keyStatusMap_.set(i,t)}},{key:"updatePlaylistByKeyStatus",value:function(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))}},{key:"excludeNonUsableThenChangePlaylist_",value:function(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}])}(Zo.EventTarget),wd=sn(function e(t,n,i){rn(this,e);var r,a,s,o=t.playlistController_,u=o.fastQualityChange_.bind(o);if(n.attributes){var l=n.attributes.RESOLUTION;this.width=l&&l.width,this.height=l&&l.height,this.bandwidth=n.attributes.BANDWIDTH,this.frameRate=n.attributes["FRAME-RATE"]}this.codecs=Ju(o.main(),n),this.playlist=n,this.id=i,this.enabled=(r=t.playlists,a=n.id,s=u,function(e){var t=r.main.playlists[a],n=Pu(t),i=Lu(t);if(void 0===e)return i;e?delete t.disabled:t.disabled=!0;var o={renditionInfo:{id:a,bandwidth:t.attributes.BANDWIDTH,resolution:t.attributes.RESOLUTION,codecs:t.attributes.CODECS},cause:"fast-quality"};return e===i||n||(e?(s(t),r.trigger({type:"renditionenabled",metadata:o})):r.trigger({type:"renditiondisabled",metadata:o})),e})}),Ed=["seeking","seeked","pause","playing","error"],Cd=function(e){function t(e){var n;rn(this,t),(n=Kt(this,t)).playlistController_=e.playlistController,n.tech_=e.tech,n.seekable=e.seekable,n.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,n.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,n.media=e.media,n.playedRanges_=[],n.consecutiveUpdates=0,n.lastRecordedTime=null,n.checkCurrentTimeTimeout_=null,n.logger_=lu("PlaybackWatcher"),n.logger_("initialize");var i=function(){return n.monitorCurrentTime_()},r=function(){return n.monitorCurrentTime_()},a=function(){return n.techWaiting_()},s=function(){return n.resetTimeUpdate_()},o=n.playlistController_,l=["main","subtitle","audio"],c={};l.forEach(function(e){c[e]={reset:function(){return n.resetSegmentDownloads_(e)},updateend:function(){return n.checkSegmentDownloads_(e)}},o["".concat(e,"SegmentLoader_")].on("appendsdone",c[e].updateend),o["".concat(e,"SegmentLoader_")].on("playlistupdate",c[e].reset),n.tech_.on(["seeked","seeking"],c[e].reset)});var d=function(e){["main","audio"].forEach(function(t){o["".concat(t,"SegmentLoader_")][e]("appended",n.seekingAppendCheck_)})};return n.seekingAppendCheck_=function(){n.fixesBadSeeks_()&&(n.consecutiveUpdates=0,n.lastRecordedTime=n.tech_.currentTime(),d("off"))},n.clearSeekingAppendCheck_=function(){return d("off")},n.watchForBadSeeking_=function(){n.clearSeekingAppendCheck_(),d("on")},n.tech_.on("seeked",n.clearSeekingAppendCheck_),n.tech_.on("seeking",n.watchForBadSeeking_),n.tech_.on("waiting",a),n.tech_.on(Ed,s),n.tech_.on("canplay",r),n.te
2ch_.one("play",i),n.dispose=function(){n.clearSeekingAppendCheck_(),n.logger_("dispose"),n.tech_.off("waiting",a),n.tech_.off(Ed,s),n.tech_.off("canplay",r),n.tech_.off("play",i),n.tech_.off("seeking",n.watchForBadSeeking_),n.tech_.off("seeked",n.clearSeekingAppendCheck_),l.forEach(function(e){o["".concat(e,"SegmentLoader_")].off("appendsdone",c[e].updateend),o["".concat(e,"SegmentLoader_")].off("playlistupdate",c[e].reset),n.tech_.off(["seeked","seeking"],c[e].reset)}),n.checkCurrentTimeTimeout_&&u()().clearTimeout(n.checkCurrentTimeTimeout_),n.resetTimeUpdate_()},n}return Gt(t,e),sn(t,[{key:"monitorCurrentTime_",value:function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&u()().clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=u()().setTimeout(this.monitorCurrentTime_.bind(this),250)}},{key:"resetSegmentDownloads_",value:function(e){var t=this.playlistController_["".concat(e,"SegmentLoader_")];this["".concat(e,"StalledDownloads_")]>0&&this.logger_("resetting possible stalled download count for ".concat(e," loader")),this["".concat(e,"StalledDownloads_")]=0,this["".concat(e,"Buffered_")]=t.buffered_()}},{key:"checkSegmentDownloads_",value:function(e){var t=this.playlistController_,n=t["".concat(e,"SegmentLoader_")],i=n.buffered_(),r=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["".concat(e,"Buffered_")],i);if(this["".concat(e,"Buffered_")]=i,r){var a={bufferedRanges:i};return t.trigger({type:"bufferedrangeschanged",metadata:a}),void this.resetSegmentDownloads_(e)}this["".concat(e,"StalledDownloads_")]++,this.logger_("found #".concat(this["".concat(e,"StalledDownloads_")]," ").concat(e," appends that did not increase buffer (possible stalled download)"),{playlistId:n.playlist_&&n.playlist_.id,buffered:yu(i)}),this["".concat(e,"StalledDownloads_")]<10||(this.logger_("".concat(e," loader stalled download exclusion")),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:"vhs-".concat(e,"-download-exclusion")}),"subtitle"!==e&&t.excludePlaylist({error:{message:"Excessive ".concat(e," segment downloading detected.")},playlistExclusionDuration:1/0}))}},{key:"checkCurrentTime_",value:function(){if(!this.tech_.paused()&&!this.tech_.seeking()){var e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+pu>=t.end(t.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(du([this.lastRecordedTime,e]));var n={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:n}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}}},{key:"resetTimeUpdate_",value:function(){this.consecutiveUpdates=0}},{key:"fixesBadSeeks_",value:function(){if(!this.tech_.seeking())return!1;var e,t=this.seekable(),n=this.tech_.currentTime();this.afterSeekableWindow_(t,n,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(e=t.end(t.length-1));if(this.beforeSeekableWindow_(t,n)){var i=t.start(0);e=i+(i===t.end(0)?0:pu)}if(void 0!==e)return this.logger_("Trying to seek outside of seekable at time ".concat(n," with ")+"seekable range ".concat(vu(t),". Seeking to ")+"".concat(e,".")),this.tech_.setCurrentTime(e),!0;for(var r=this.playlistController_.sourceUpdater_,a=this.tech_.buffered(),s=r.audioBuffer?r.audioBuffered():null,o=r.videoBuffer?r.videoBuffered():null,u=this.media(),l=u.partTargetDuration?u.partTargetDuration:2*(u.targetDuration-hu),c=[s,o],d=0;d<c.length;d++){if(c[d])if(bu(c[d],n)<l)return!1}var h=gu(a,n);return 0!==h.length&&(e=h.start(0)+pu,this.logger_("Buffered region starts (".concat(h.start(0),") ")+" just beyond seek point (".concat(n,"). Seeking to ").concat(e,".")),this.tech_.setCurrentTime(e),!0)}},{key:"waiting_",value:function(){if(!this.techWaiting_()){var e=this.tech_.currentTime(),t=this.tech_.buffered(),n=mu(t,e);return n.length&&e+3<=n.end(0)?(this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_("Stopped at ".concat(e," while inside a buffered region ")+"[".concat(n.start(0)," -> ").concat(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}}},{key:"techWaiting_",value:function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;
2if(this.beforeSeekableWindow_(e,t)){var n=e.end(e.length-1);return this.logger_("Fell out of live window at time ".concat(t,". Seeking to ")+"live point (seekable end) ".concat(n)),this.resetTimeUpdate_(),this.tech_.setCurrentTime(n),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}var i=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;var a=gu(r,t);return a.length>0&&(this.logger_("Stopped at ".concat(t," and seeking to ").concat(a.start(0))),this.resetTimeUpdate_(),this.skipTheGap_(t),!0)}},{key:"afterSeekableWindow_",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!e.length)return!1;var r=e.end(e.length-1)+pu,a=!n.endList,s="number"==typeof n.partTargetDuration;return a&&(s||i)&&(r=e.end(e.length-1)+3*n.targetDuration),t>r}},{key:"beforeSeekableWindow_",value:function(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}},{key:"videoUnderflow_",value:function(e){var t=e.videoBuffered,n=e.audioBuffered,i=e.currentTime;if(t){var r;if(t.length&&n.length){var a=mu(t,i-3),s=mu(t,i),o=mu(n,i);o.length&&!s.length&&a.length&&(r={start:a.end(0),end:o.end(0)})}else{gu(t,i).length||(r=this.gapFromVideoUnderflow_(t,i))}return!!r&&(this.logger_("Encountered a gap in video from ".concat(r.start," to ").concat(r.end,". ")+"Seeking to current time ".concat(i)),!0)}}},{key:"skipTheGap_",value:function(e){var t=this.tech_.buffered(),n=this.tech_.currentTime(),i=gu(t,n);if(this.resetTimeUpdate_(),0!==i.length&&n===e){this.logger_("skipTheGap_:","currentTime:",n,"scheduled currentTime:",e,"nextRange start:",i.start(0)),this.tech_.setCurrentTime(i.start(0)+hu);var r={gapInfo:{from:n,to:i.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:r}),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}}},{key:"gapFromVideoUnderflow_",value:function(e,t){for(var n=function(e){if(e.length<2)return du();for(var t=[],n=1;n<e.length;n++){var i=e.end(n-1),r=e.start(n);t.push([i,r])}return du(t)}(e),i=0;i<n.length;i++){var r=n.start(i),a=n.end(i);if(t-r<4&&t-r>2)return{start:r,end:a}}return null}}])}(Zo.EventTarget),Id={errorInterval:30,getSource:function(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},xd=function(e,t){var n=0,i=0,r=cu(Id,t);e.ready(function(){e.trigger({type:"usage",name:"vhs-error-reload-initialized"})});var a=function(){i&&e.currentTime(i)},s=function(t){null!=t&&(i=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*r.errorInterval)e.trigger({type:"usage",name:"vhs-error-reload-canceled"});else{if(r.getSource&&"function"==typeof r.getSource)return n=Date.now(),r.getSource.call(e,s);Zo.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}},u=function(){e.off("loadedmetadata",a),e.off("error",o),e.off("dispose",u)};e.on("error",o),e.on("dispose",u),e.reloadSourceOnError=function(t){u(),xd(e,t)}},Ad="3.17.5",Dd={PlaylistLoader:ol,Playlist:Bu,utils:yl,STANDARD_PLAYLIST_SELECTOR:hc,INITIAL_PLAYLIST_SELECTOR:function(){var e=this,t=this.playlists.main.playlists.filter(Bu.isEnabled);return lc(t,function(e,t){return cc(e,t)}),t.filter(function(t){return!!Ju(e.playlists.main,t).video})[0]||null},lastBandwidthSelector:hc,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 i=this.useDevicePixelRatio&&u()().devicePixelRatio||1;return isNaN(this.customPixelRatio)||(i=this.customPixelRatio),t<0&&(t=this.systemBandwidth,n=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==n&&(t=e*this.systemBandwidth+(1-e)*t,n=this.systemBandwidth),dc({main:this.playlists.main,bandwidth:t,playerWidth:parseInt(uc(this.tech_.el(),"width"),10)*i,playerHe
2ight:parseInt(uc(this.tech_.el(),"height"),10)*i,playerObjectFit:this.usePlayerObjectFit?uc(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})}},comparePlaylistBandwidth:cc,comparePlaylistResolution:function(e,t){var n,i;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(n=e.attributes.RESOLUTION.width),n=n||u()().Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(i=t.attributes.RESOLUTION.width),n===(i=i||u()().Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:n-i},xhr:ll()};Object.keys(Dl).forEach(function(e){Object.defineProperty(Dd,e,{get:function(){return Zo.log.warn("using Vhs.".concat(e," is UNSAFE be sure you know what you are doing")),Dl[e]},set:function(t){Zo.log.warn("using Vhs.".concat(e," is UNSAFE be sure you know what you are doing")),"number"!=typeof t||t<0?Zo.log.warn("value of Vhs.".concat(e," must be greater than or equal to 0")):Dl[e]=t}})});var Pd="videojs-vhs",Ld=function(e,t){for(var n=t.media(),i=-1,r=0;r<e.length;r++)if(e[r].id===n.id){i=r;break}e.selectedIndex_=i,e.trigger({selectedIndex:i,type:"change"})};Dd.canPlaySource=function(){return Zo.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};var Od=function(e){var t=e.player,n=e.sourceKeySystems,i=e.audioMedia,r=e.mainPlaylists;if(!t.eme.initializeMediaKeys)return Promise.resolve();var a=function(e,t){return e.reduce(function(e,n){if(!n.contentProtection)return e;var i=t.reduce(function(e,t){var i=n.contentProtection[t];return i&&i.pssh&&(e[t]={pssh:i.pssh}),e},{});return Object.keys(i).length&&e.push(i),e},[])}(i?r.concat([i]):r,Object.keys(n)),s=[],o=[];return a.forEach(function(e){o.push(new Promise(function(e,n){t.tech_.one("keysessioncreated",e)})),s.push(new Promise(function(n,i){t.eme.initializeMediaKeys({keySystems:e},function(e){e?i(e):n()})}))}),Promise.race([Promise.all(s),Promise.race(o)])},Rd=function(e){var t=e.player,n=function(e,t,n){if(!e)return e;var i={};t&&t.attributes&&t.attributes.CODECS&&(i=Qu(z(t.attributes.CODECS))),n&&n.attributes&&n.attributes.CODECS&&(i.audio=n.attributes.CODECS);var r=G(i.video),a=G(i.audio),s={};for(var o in e)s[o]={},a&&(s[o].audioContentType=a),r&&(s[o].videoContentType=r),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 cu(e,s)}(e.sourceKeySystems,e.media,e.audioMedia);return!!n&&(t.currentSource().keySystems=n,!(n&&!t.eme)||(Zo.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1))},Md=function(){if(!u()().localStorage)return null;var e=u()().localStorage.getItem(Pd);if(!e)return null;try{return JSON.parse(e)}catch(e){return null}},Nd=function(e,t){e._requestCallbackSet||(e._requestCallbackSet=new Set),e._requestCallbackSet.add(t)},Ud=function(e,t){e._responseCallbackSet||(e._responseCallbackSet=new Set),e._responseCallbackSet.add(t)},Bd=function(e,t){e._requestCallbackSet&&(e._requestCallbackSet.delete(t),e._requestCallbackSet.size||delete e._requestCallbackSet)},Fd=function(e,t){e._responseCallbackSet&&(e._responseCallbackSet.delete(t),e._responseCallbackSet.size||delete e._responseCallbackSet)};Dd.supportsNativeHls=function(){if(!c()||!c().createElement)return!1;var e=c().createElement("video");if(!Zo.getTech("Html5").isSupported())return!1;return["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))})}(),Dd.supportsNativeDash=!!(c()&&c().createElement&&Zo.getTech("Html5").isSupported())&&/maybe|probably/i.test(c().createElement("video").canPlayType("application/dash+xml")),Dd.supportsTypeNatively=function(e){return"hls"===e?Dd.supportsNativeHls:"dash"===e&&Dd.supportsNativeDash},Dd.isSupported=function(){return Zo.log.warn("VHS is no longer a tech. Please remove it from your player'
2s techOrder.")},Dd.xhr.onRequest=function(e){Nd(Dd.xhr,e)},Dd.xhr.onResponse=function(e){Ud(Dd.xhr,e)},Dd.xhr.offRequest=function(e){Bd(Dd.xhr,e)},Dd.xhr.offResponse=function(e){Fd(Dd.xhr,e)};var qd=function(e){function t(e,n,i){var r;if(rn(this,t),r=Kt(this,t,[n,i.vhs]),"number"==typeof i.initialBandwidth&&(r.options_.bandwidth=i.initialBandwidth),r.logger_=lu("VhsHandler"),n.options_&&n.options_.playerId){var a=Zo.getPlayer(n.options_.playerId);r.player_=a}if(r.tech_=n,r.source_=e,r.stats={},r.ignoreNextSeekingEvent_=!1,r.setOptions_(),r.options_.overrideNative&&n.overrideNativeAudioTracks&&n.overrideNativeVideoTracks)n.overrideNativeAudioTracks(!0),n.overrideNativeVideoTracks(!0);else if(r.options_.overrideNative&&(n.featuresNativeVideoTracks||n.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");return r.on(c(),["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],function(e){var t=c().fullscreenElement||c().webkitFullscreenElement||c().mozFullScreenElement||c().msFullscreenElement;t&&t.contains(r.tech_.el())?r.playlistController_.fastQualityChange_():r.playlistController_.checkABR_()}),r.on(r.tech_,"seeking",function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())}),r.on(r.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),r.on(r.tech_,"play",r.play),r}return Gt(t,e),sn(t,[{key:"setOptions_",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.options_=cu(this.options_,t),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.usePlayerObjectFit=this.options_.usePlayerObjectFit||!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=void 0===this.options_.useNetworkInformationApi||this.options_.useNetworkInformationApi,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){var n=Md();n&&n.bandwidth&&(this.options_.bandwidth=n.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),n&&n.throughput&&(this.options_.throughput=n.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}"number"!=typeof this.options_.bandwidth&&(this.options_.bandwidth=Dl.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Dl.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","usePlayerObjectFit","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(function(t){void 0!==e.source_[t]&&(e.options_[t]=e.source_[t])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio,this.usePlayerObjectFit=this.options_.usePlayerObjectFit;var i=this.options_.customPixelRatio;"number"==typeof i&&i>=0&&(this.customPixelRatio=i)}},{key:"setOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.setOptions_(e)}},{key:"src",value:function(e,t){var n=this;if(e){var i;this.setOptions_(),this.options_.src=0===(i=this.source_.src).toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")?JSON.parse(i.substring(i.indexOf(",")+1)):i,this.options_.tech=this.tech_,this.options_.externVhs=Dd,this.options_.sourceType=J(t),this.options_.seekTo=function(e){n.tech_.setCurrentTime(e)},this.options_.player_=this.player_,this.playlistController_=new Sd(this.options_);var r=cu({liveRangeSafeTimeDelta:pu},this.options_,{seekable:function(){return n.seekable()},media:function(){return n.playlistController_.media()},playlistController:this.playlistController_});this.playbackWatcher_=new Cd(r),this.attachStreamingEventListeners_(),this.playlistController_.on("error",function(){var e=Zo.players[n.tech_.options_.playerId],t=n.playlistController_.error;"object"!==hn(t)||t.code?"string"==typeof t&&(t={message:t,code:3}):t.code=3,e.error(t)});var a=this.options_.bufferBasedABR?Dd.movingAverageBandwidthSelector(.55):Dd.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):a.bind(this),this.playlistController_.selectInitialPlaylist=Dd.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get:function(){return this.playlistController_.selectPlaylist},set:function(e){this.playlistController_.selectPlaylist=e.bind(this)}},throughput:{get:function(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set:function(e){this.playlistController_.mainSegmentLoader_.throughput.rate=e,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){var e=this.playlistController_.mainSegmentLoader_.bandwidth,t=u()().navigator.connection||u()().navigator.mozConnection||u()().navigator.webkitConnection,n=1e7;if(this.options_.useNetworkInformationApi&&t){var i=1e3*t.downlink*1e3;e=i>=n&&e>=n?Math.max(e,i):i}return e},set:function(e){this.playlistController_.mainSegmentLoader_.bandwidth=e,this.playlistController_.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(){Zo.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.playlistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return n.playlistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return n.playlistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return n.playlistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return n.playlistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return n.playlistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return n.playlistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return n.playlistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return n.playlistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return n.playlistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return n.playlistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return n.playlistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return yu(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},main:{get:function(){return n.playlists.main},enumerable:!0},playerDimensions:{get:function(){return n.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return yu(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.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",function(){n.options_.useBandwidthFromLocalStorage&&function(e){if(!u()().localStorage)return!1;var t=Md();t=t?cu(t,e):e;try{u()().localStorage.setItem(Pd,JSON.stringify(t))}catch(e){return!1}}({bandwidth:n.bandwidth,throughput:Math.round(n.throughput)})}),this.playlistController_.on("selectedinitialmedia",function(){var e;(e=n).representations=function(){var t=e.playlistController_.main(),n=Uu(t)?e.playlistController_.getAudioTrackPlaylists_():t.playlists;return n?n.filter(function(e){return!Pu(e)}).map(function(t,n){return new wd(e,t,t.id)}):[]}}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",function(){n.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_=u()().URL.createObjectURL(this.playlistController_.mediaSource),(Zo.browser.IS_ANY_SAFARI||Zo.browser.IS_IOS)&&this.options_.overrideNative&&"hls"===this.options_.sourceType&&"function"==typeof this.tech_.addSourceElement?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}}},{key:"createKeySessions_",value:function(){var e=this,t=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),Od({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:t&&t.media(),mainPlaylists:this.playlists.main.playlists}).then(function(){e.logger_("created EME key session"),e.playlistController_.sourceUpdater_.initializedEme()}).catch(function(t){e.logger_("error while creating EME key session",t),e.player_.error({message:"Failed to initialize media ke
2ys for EME",code:3})})}},{key:"handleWaitingForKey_",value:function(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}},{key:"setupEme_",value:function(){var e=this,t=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,n=Rd({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:t&&t.media()});this.player_.tech_.on("keystatuschange",function(t){e.playlistController_.updatePlaylistByKeyStatus(t.keyId,t.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),n?this.createKeySessions_():this.playlistController_.sourceUpdater_.initializedEme()}},{key:"setupQualityLevels_",value:function(){var e=this,t=Zo.players[this.tech_.options_.playerId];t&&t.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=t.qualityLevels(),this.playlistController_.on("selectedinitialmedia",function(){!function(e,t){t.representations().forEach(function(t){e.addQualityLevel(t)}),Ld(e,t.playlists)}(e.qualityLevels_,e)}),this.playlists.on("mediachange",function(){Ld(e.qualityLevels_,e.playlists)}))}},{key:"version",value:function(){return this.constructor.version()}},{key:"canChangeType",value:function(){return Yc.canChangeType()}},{key:"play",value:function(){this.playlistController_.play()}},{key:"setCurrentTime",value:function(e){this.playlistController_.setCurrentTime(e)}},{key:"duration",value:function(){return this.playlistController_.duration()}},{key:"seekable",value:function(){return this.playlistController_.seekable()}},{key:"dispose",value:function(){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_&&u()().URL.revokeObjectURL&&(u()().URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),$t(t,"dispose",this,3)([])}},{key:"convertToProgramTime",value:function(e,t){return _l({playlist:this.playlistController_.media(),time:e,callback:t})}},{key:"seekToProgramTime",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2;return bl({programTime:e,playlist:this.playlistController_.media(),retryCount:i,pauseAfterSeek:n,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}},{key:"setupXhrHooks_",value:function(){var e=this;this.xhr.onRequest=function(t){Nd(e.xhr,t)},this.xhr.onResponse=function(t){Ud(e.xhr,t)},this.xhr.offRequest=function(t){Bd(e.xhr,t)},this.xhr.offResponse=function(t){Fd(e.xhr,t)},this.player_.trigger("xhr-hooks-ready")}},{key:"attachStreamingEventListeners_",value:function(){var e=this;["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(function(t){e.playlistController_.on(t,function(t){e.player_.trigger(f({},t))})}),["gapjumped","playedrangeschanged"].forEach(function(t){e.playbackWatcher_.on(t,function(t){e.player_.trigger(f({},t))})})}}],[{key:"version",value:function(){return{"@videojs/http-streaming":Ad,"mux.js":"7.1.0","mpd-parser":"1.4.0","m3u8-parser":"7.2.0","aes-decrypter":"4.0.2"}}}])}(Zo.getComponent("Component")),jd={name:"videojs-http-streaming",VERSION:Ad,canHandleSource:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=cu(Zo.options,t);return!(!n.vhs.experimentalUseMMS&&!X("avc1.4d400d,mp4a.40.2",!1))&&jd.canPlayType(e.type,n)},handleSource:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=cu(Zo.options,n);return t.vhs=new qd(e,t,i),t.vhs.xhr=ll(),t.vhs.setupXhrHooks_(),t.vhs.src(e.src,e.type),t.vhs},canPlayType:function(e,t){var n=J(e);if(!n)return"";var i=jd.getOverrideNative(t);return!Dd.supportsTypeNatively(n)||i?"maybe":""},getOverrideNative:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).vhs,t=void 0===e?{}:e,n=!(Zo.browser.IS_ANY_SAFARI||Zo.browser.IS_IOS),i=t.overrideNative;return void 0===i?n:i}};X("avc1.4d400d,mp4a.40.2",!0)&&Zo.getTech("Html5").registerSourceHandler(jd,0),Zo.VhsHandler=qd,Zo.VhsSourceHandler=jd,Zo.Vhs=Dd,Zo.use||Zo.registerComponent("
2Vhs",Dd),Zo.options.vhs=Zo.options.vhs||{},Zo.getPlugin&&Zo.getPlugin("reloadSourceOnError")||Zo.registerPlugin("reloadSourceOnError",function(e){xd(this,e)})},8830:function(e,t,n){var i=n(7954),r=e.exports={WebVTT:n(1229),VTTCue:n(3318),VTTRegion:n(4977)};i.vttjs=r,i.WebVTT=r.WebVTT;var a=r.VTTCue,s=r.VTTRegion,o=i.VTTCue,u=i.VTTRegion;r.shim=function(){i.VTTCue=a,i.VTTRegion=s},r.restore=function(){i.VTTCue=o,i.VTTRegion=u},i.VTTCue||r.shim()},1229:function(e,t,n){var i=n(6031),r=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,i){return 3600*(0|e)+60*(0|t)+(0|n)+(0|i)/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=r(null)}function u(e,t,n,i){var r=i?e.split(i):[e];for(var a in r)if("string"==typeof r[a]){var s=r[a].split(n);if(2===s.length)t(s[0].trim(),s[1].trim())}}function l(e,t,n){var i=e;function r(){var t=s(e);if(null===t)throw new a(a.Errors.BadTimeStamp,"Malformed timestamp: "+i);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function l(){e=e.replace(/^\s+/,"")}if(l(),t.startTime=r(),l(),"--\x3e"!==e.substr(0,3))throw new a(a.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+i);e=e.substr(3),l(),t.endTime=r(),l(),function(e,t){var i=new o;u(e,function(e,t){switch(e){case"region":for(var r=n.length-1;r>=0;r--)if(n[r].id===t){i.set(e,n[r].region);break}break;case"vertical":i.alt(e,t,["rl","lr"]);break;case"line":var a=t.split(","),s=a[0];i.integer(e,s),i.percent(e,s)&&i.set("snapToLines",!1),i.alt(e,s,["auto"]),2===a.length&&i.alt("lineAlign",a[1],["start","center","end"]);break;case"position":a=t.split(","),i.percent(e,a[0]),2===a.length&&i.alt("positionAlign",a[1],["start","center","end"]);break;case"size":i.percent(e,t);break;case"align":i.alt(e,t,["start","center","end","left","right"])}},/:/,/\s/),t.region=i.get("region",null),t.vertical=i.get("vertical","");try{t.line=i.get("line","auto")}catch(e){}t.lineAlign=i.get("lineAlign","start"),t.snapToLines=i.get("snapToLines",!0),t.size=i.get("size",100);try{t.align=i.get("align","center")}catch(e){t.align=i.get("align","middle")}try{t.position=i.get("position","auto")}catch(e){t.position=i.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=i.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}(e,t)}a.prototype=r(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 i=0;i<n.length;++i)if(t===n[i]){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=i.createElement&&i.createElement("textarea"),d={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},h={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)"},p={v:"title",lang:"lang"},f={rt:"ruby"};function m(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 i(e){return c.innerHTML=e,e=c.textContent,c.textContent="",e}function r(e,t){return!f[t.localName]||f[t.localName]===e.localName}function a(t,n){var i=d[t];if(!i)return null;var r=e.document.createElement(i),a=p[t];return a&&n&&(r[a]=n.trim()),r}for(var o,u=e.document.createElement("div"),l=u,m=[];null!==(o=n());)if("<"!==o[0])l.appendChild(e.document.createTextNode(i(o)));else{if("/"===o[1]){m.length&&m[m.length-1]===o.substr(2).replace(">","")&&(m.pop(),l=l.parentNode);continue}var g,v=s(o.substr(1,o.length-2));if(v){g=e.document.createProcessingInstruction("timestamp",v),l.appendChild(g);continue}var y=o.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!y)continue;if(!(g=a(y[1],y[3])))continue;if(!r(l,g))continue;if(y[2]){var _=y[2].split(".");_.forEach(function(e){var t=/^bg_/.test(e),n=t?e.slice(3):e;if(h.hasOwnProperty(n)){var i=t?"background-color":"color",r=h[n];g.style[i]=r}}),g.className=_.join(" ")}m.push(y[1]),l.appendChild(g),l=g}return u}var g=[[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
vendor: 6,112 bytes, line 2
2],[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 v(e){for(var t=0;t<g.length;t++){var n=g[t];if(e>=n[0]&&e<=n[1])return!0}return!1}function y(e){var t=[],n="";if(!e||!e.childNodes)return"ltr";function i(e,t){for(var n=t.childNodes.length-1;n>=0;n--)e.push(t.childNodes[n])}function r(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?r(e):t.childNodes?(i(e,t),r(e)):void 0}for(i(t,e);n=r(t);)for(var a=0;a<n.length;a++)if(v(n.charCodeAt(a)))return"rtl";return"ltr"}function _(){}function b(e,t,n){_.call(this),this.cue=t,this.cueDiv=m(e,t.text);var i={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(i,this.cueDiv),this.div=e.document.createElement("div"),i={direction:y(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(i),this.div.appendChild(this.cueDiv);var r=0;switch(t.positionAlign){case"start":case"line-left":r=t.position;break;case"center":r=t.position-t.size/2;break;case"end":case"line-right":r=t.position-t.size}""===t.vertical?this.applyStyles({left:this.formatStyle(r,"%"),width:this.formatStyle(t.size,"%")}):this.applyStyles({top:this.formatStyle(r,"%"),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 T(e){var t,n,i,r;if(e.div){n=e.div.offsetHeight,i=e.div.offsetWidth,r=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||r,this.height=e.height||n,this.bottom=e.bottom||r+(e.height||n),this.width=e.width||i,this.lineHeight=void 0!==t?t:e.lineHeight}function k(e,t,n,i){var r=new T(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,i=0,r=0;r<n.length&&n[r]!==t;r++)"showing"===n[r].mode&&i++;return-1*++i}(a),o=[];if(a.snapToLines){var u;switch(a.vertical){case"":o=["+y","-y"],u="height";break;case"rl":o=["+x","-x"],u="width";break;case"lr":o=["-x","+x"],u="width"}var l=r.lineHeight,c=l*Math.round(s),d=n[u]+l,h=o[0];Math.abs(c)>d&&(c=c<0?-1:1,c*=Math.ceil(d/l)*l),s<0&&(c+=""===a.vertical?n.height:n.width,o=o.reverse()),r.move(h,c)}else{var p=r.lineHeight/n.height*100;switch(a.lineAlign){case"center":s-=p/2;break;case"end":s-=p}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"],r=new T(t)}var f=function(e,t){for(var r,a=new T(e),s=1,o=0;o<t.length;o++){for(;e.overlapsOppositeAxis(n,t[o])||e.within(n)&&e.overlapsAny(i);)e.move(t[o]);if(e.within(n))return e;var u=e.intersectPercentage(n);s>u&&(r=new T(e),s=u),e=new T(a)}return r||a}(r,o);t.move(f.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},b.prototype=r(_.prototype),b.prototype.constructor=b,T.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}},T.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top},T.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++)if(this.overlaps(e[t]))return!0;return!1},T.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},T.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}},T.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)},T.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}},T.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,n=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,i=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||i,height:e.height||t,bottom:e.bottom||i+(e.height||t),width:e.width||n}},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?m(e,t):null};S.processCues=function(e,t,n){if(!e||!t||!n)return null;for(;n.firstChild;)n.removeChild(n.firstChild);var i=e.document.createElement("div");if(i.style.position="absolute",i.style.left="0",i.style.right="0",i.style.top="0",i.style.bottom="0",
vendor: 3,985 bytes, line 2
2i.style.margin="1.5%",n.appendChild(i),function(e){for(var t=0;t<e.length;t++)if(e[t].hasBeenReset||!e[t].displayState)return!0;return!1}(t)){var r=[],a=T.getSimpleBoxPosition(i),s={font:Math.round(.05*a.height*100)/100+"px sans-serif"};!function(){for(var n,o,u=0;u<t.length;u++)o=t[u],n=new b(e,o,s),i.appendChild(n.div),k(0,n,a,r),o.displayState=n.div,r.push(T.getSimpleBoxPosition(n))}()}else for(var o=0;o<t.length;o++)i.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=this;function n(){for(var e=t.buffer,n=0;n<e.length&&"\r"!==e[n]&&"\n"!==e[n];)++n;var i=e.substr(0,n);return"\r"===e[n]&&++n,"\n"===e[n]&&++n,t.buffer=e.substr(n),i}function i(e){e.match(/X-TIMESTAMP-MAP/)?u(e,function(e,n){if("X-TIMESTAMP-MAP"===e)!function(e){var n=new o;u(e,function(e,t){switch(e){case"MPEGT":n.integer(e+"S",t);break;case"LOCA":n.set(e+"L",s(t))}},/[^\d]:/,/,/),t.ontimestampmap&&t.ontimestampmap({MPEGTS:n.get("MPEGTS"),LOCAL:n.get("LOCAL")})}(n)},/=/):u(e,function(e,n){if("Region"===e)!function(e){var n=new o;if(u(e,function(e,t){switch(e){case"id":n.set(e,t);break;case"width":n.percent(e,t);break;case"lines":n.integer(e,t);break;case"regionanchor":case"viewportanchor":var i=t.split(",");if(2!==i.length)break;var r=new o;if(r.percent("x",i[0]),r.percent("y",i[1]),!r.has("x")||!r.has("y"))break;n.set(e+"X",r.get("x")),n.set(e+"Y",r.get("y"));break;case"scroll":n.alt(e,t,["up"])}},/=/,/\s/),n.has("id")){var i=new(t.vttjs.VTTRegion||t.window.VTTRegion);i.width=n.get("width",100),i.lines=n.get("lines",3),i.regionAnchorX=n.get("regionanchorX",0),i.regionAnchorY=n.get("regionanchorY",100),i.viewportAnchorX=n.get("viewportanchorX",0),i.viewportAnchorY=n.get("viewportanchorY",100),i.scroll=n.get("scroll",""),t.onregion&&t.onregion(i),t.regionList.push({id:n.get("id"),region:i})}}(n)},/:/)}e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));try{var r;if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;var c=(r=n()).match(/^WEBVTT([ \t].*)?$/);if(!c||!c[0])throw new a(a.Errors.BadSignature);t.state="HEADER"}for(var d=!1;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(d?d=!1:r=n(),t.state){case"HEADER":/:/.test(r)?i(r):r||(t.state="ID");continue;case"NOTE":r||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(r)){t.state="NOTE";break}if(!r)continue;t.cue=new(t.vttjs.VTTCue||t.window.VTTCue)(0,0,"");try{t.cue.align="center"}catch(e){t.cue.align="middle"}if(t.state="CUE",-1===r.indexOf("--\x3e")){t.cue.id=r;continue}case"CUE":try{l(r,t.cue,t.regionList)}catch(e){t.reportOrThrowError(e),t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":var h=-1!==r.indexOf("--\x3e");if(!r||h&&(d=!0)){t.oncue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}t.cue.text&&(t.cue.text+="\n"),t.cue.text+=r.replace(/\u2028/g,"\n").replace(/u2029/g,"\n");continue;case"BADCUE":r||(t.state="ID");continue}}}catch(e){t.reportOrThrowError(e),"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.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},3318:function(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 i(e){return"string"==typeof e&&(!!n[e.toLowerCase()]&&e.toLowerCase())}function r(e,n,r){this.hasBeenReset=!1;var a="",s=!1,o=e,u=n,l=r,c=null,d="",h=!0,p="auto",f="start",m="auto",g="auto",v=100,y="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return a}
vendor: 2,712 bytes, line 2
2,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 u},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");u=e,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return l},set:function(e){l=""+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 h},set:function(e){h=!!e,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return p},set:function(e){if("number"!=typeof e&&"auto"!==e)throw new SyntaxError("Line: an invalid number or illegal string was specified.");p=e,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return f},set:function(e){var t=i(e);t?(f=t,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return m},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");m=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return g},set:function(e){var t=i(e);t?(g=t,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return v},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");v=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return y},set:function(e){var t=i(e);if(!t)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");y=t,this.hasBeenReset=!0}}}),this.displayState=void 0}r.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},e.exports=r},4977:function(e){var t={"":!0,up:!0};function n(e){return"number"==typeof e&&e>=0&&e<=100}e.exports=function(){var e=100,i=3,r=0,a=100,s=0,o=100,u="";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 i},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");i=e}},regionAnchorY:{enumerable:!0,get:function(){return a}
2,set:function(e){if(!n(e))throw new Error("RegionAnchorX must be between 0 and 100.");a=e}},regionAnchorX:{enumerable:!0,get:function(){return r},set:function(e){if(!n(e))throw new Error("RegionAnchorY must be between 0 and 100.");r=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 u},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."):u=n}}})}},337:function(){},9824:function(e,t,n){var i=n(5292),r=n(9893),a=n(9383),s=n(6884),o=n(9088),u=n(7997),l=n(337);l=l.__esModule?l.default:l;var c={};c.styleTagTransform=u,c.setAttributes=s,c.insert=a.bind(null,"head"),c.domAPI=r,c.insertStyleElement=o;i(l,c);e.exports=l&&l.locals||{}},5292:function(e){"use strict";var t=[];function n(e){for(var n=-1,i=0;i<t.length;i++)if(t[i].identifier===e){n=i;break}return n}function i(e,i){for(var a={},s=[],o=0;o<e.length;o++){var u=e[o],l=i.base?u[0]+i.base:u[0],c=a[l]||0,d="".concat(l," ").concat(c);a[l]=c+1;var h=n(d),p={css:u[1],media:u[2],sourceMap:u[3],supports:u[4],layer:u[5]};if(-1!==h)t[h].references++,t[h].updater(p);else{var f=r(p,i);i.byIndex=o,t.splice(o,0,{identifier:d,updater:f,references:1})}s.push(d)}return s}function r(e,t){var n=t.domAPI(t);n.update(e);return function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,r){var a=i(e=e||[],r=r||{});return function(e){e=e||[];for(var s=0;s<a.length;s++){var o=n(a[s]);t[o].references--}for(var u=i(e,r),l=0;l<a.length;l++){var c=n(a[l]);0===t[c].references&&(t[c].updater(),t.splice(c,1))}a=u}}},9383:function(e){"use strict";var t={};e.exports=function(e,n){var i=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}},9088:function(e){"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},6884:function(e,t,n){"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},9893:function(e){"use strict";e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var i="";n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,r&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}");var a=n.sourceMap;a&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),t.styleTagTransform(i,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},7997:function(e){"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.