cloudinary-video-player 2.0.2 → 2.0.3-edge.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cld-video-player.css +0 -3
- package/dist/cld-video-player.js +8 -6
- package/dist/cld-video-player.light.css +0 -3
- package/dist/cld-video-player.light.js +8 -6
- package/dist/cld-video-player.light.min.css +1 -1
- package/dist/cld-video-player.light.min.js +1 -1
- package/dist/cld-video-player.min.css +1 -1
- package/dist/cld-video-player.min.js +1 -1
- package/lib/all.js +1 -1
- package/lib/cld-video-player.js +1 -1
- package/lib/cld-video-player.min.css +1 -1
- package/lib/videoPlayer.js +1 -1
- package/lib/videoPlayerWithProfile.js +1 -1
- package/package.json +2 -2
package/lib/cld-video-player.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see cld-video-player.js.LICENSE.txt */
|
|
2
|
-
var e,t,i={1555:(e,t,i)=>{var s=i(5204);e.exports=function(e,t){return void 0===t&&(t=!1),function(i,n,r){if(i)e(i);else if(n.statusCode>=400&&n.statusCode<=599){var a=r;if(t)if(s.TextDecoder){var o=(void 0===(l=n.headers&&n.headers["content-type"])&&(l=""),l.toLowerCase().split(";").reduce((function(e,t){var i=t.split("="),s=i[0],n=i[1];return"charset"===s.trim()?n.trim():e}),"utf-8"));try{a=new TextDecoder(o).decode(r)}catch(e){}}else a=String.fromCharCode.apply(null,new Uint8Array(r));e({cause:a})}else e(null,r);var l}}},6e3:(e,t,i)=>{var s=i(5204),n=i(8304),r=i(8716);l.httpHandler=i(1555);var a=function(e){var t={};return e?(e.trim().split("\n").forEach((function(e){var i=e.indexOf(":"),s=e.slice(0,i).trim().toLowerCase(),n=e.slice(i+1).trim();void 0===t[s]?t[s]=n:Array.isArray(t[s])?t[s].push(n):t[s]=[t[s],n]})),t):t};function o(e,t,i){var s=e;return r(t)?(i=t,"string"==typeof e&&(s={uri:e})):s=n({},t,{uri:e}),s.callback=i,s}function l(e,t,i){return c(t=o(e,t,i))}function c(e){if(void 0===e.callback)throw new Error("callback argument missing");var t=!1,i=function(i,s,n){t||(t=!0,e.callback(i,s,n))};function s(){var e=void 0;if(e=u.response?u.response:u.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}(u),y)try{e=JSON.parse(e)}catch(e){}return e}function n(e){return clearTimeout(h),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,i(e,v)}function r(){if(!c){var t;clearTimeout(h),t=e.useXDR&&void 0===u.status?200:1223===u.status?204:u.status;var n=v,r=null;return 0!==t?(n={body:s(),statusCode:t,method:p,headers:{},url:d,rawRequest:u},u.getAllResponseHeaders&&(n.headers=a(u.getAllResponseHeaders()))):r=new Error("Internal XMLHttpRequest Error"),i(r,n,n.body)}}var o,c,u=e.xhr||null;u||(u=e.cors||e.useXDR?new l.XDomainRequest:new l.XMLHttpRequest);var h,d=u.url=e.uri||e.url,p=u.method=e.method||"GET",f=e.body||e.data,m=u.headers=e.headers||{},g=!!e.sync,y=!1,v={body:void 0,headers:{},statusCode:0,method:p,url:d,rawRequest:u};if("json"in e&&!1!==e.json&&(y=!0,m.accept||m.Accept||(m.Accept="application/json"),"GET"!==p&&"HEAD"!==p&&(m["content-type"]||m["Content-Type"]||(m["Content-Type"]="application/json"),f=JSON.stringify(!0===e.json?f:e.json))),u.onreadystatechange=function(){4===u.readyState&&setTimeout(r,0)},u.onload=r,u.onerror=n,u.onprogress=function(){},u.onabort=function(){c=!0},u.ontimeout=n,u.open(p,d,!g,e.username,e.password),g||(u.withCredentials=!!e.withCredentials),!g&&e.timeout>0&&(h=setTimeout((function(){if(!c){c=!0,u.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",n(e)}}),e.timeout)),u.setRequestHeader)for(o in m)m.hasOwnProperty(o)&&u.setRequestHeader(o,m[o]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(u.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(u),u.send(f||null),u}e.exports=l,e.exports.default=l,l.XMLHttpRequest=s.XMLHttpRequest||function(){},l.XDomainRequest="withCredentials"in new l.XMLHttpRequest?l.XMLHttpRequest:s.XDomainRequest,function(e,t){for(var i=0;i<e.length;i++)t(e[i])}(["get","put","post","patch","head","delete"],(function(e){l["delete"===e?"del":e]=function(t,i,s){return(i=o(t,i,s)).method=e.toUpperCase(),c(i)}}))},3314:(e,t)=>{function i(e,t){return void 0===t&&(t=Object),t&&"function"==typeof t.freeze?t.freeze(e):e}var s=i({HTML:"text/html",isHTML:function(e){return e===s.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),n=i({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===n.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});t.assign=function(e,t){if(null===e||"object"!=typeof e)throw new TypeError("target is not an object");for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.find=function(e,t,i){if(void 0===i&&(i=Array.prototype),e&&"function"==typeof i.find)return i.find.call(e,t);for(var s=0;s<e.length;s++)if(Object.prototype.hasOwnProperty.call(e,s)){var n=e[s];if(t.call(void 0,n,s,e))return n}},t.freeze=i,t.MIME_TYPE=s,t.NAMESPACE=n},6404:(e,t,i)=>{var s=i(3314),n=i(6278),r=i(251),a=i(8654),o=n.DOMImplementation,l=s.NAMESPACE,c=a.ParseError,u=a.XMLReader;function h(e){return e.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function d(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,i){return"string"==typeof e?e.substr(t,i):e.length>=t+i||t?new java.lang.String(e,t,i)+"":e}function y(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}d.prototype.parseFromString=function(e,t){var i=this.options,s=new u,n=i.domBuilder||new p,a=i.errorHandler,o=i.locator,c=i.xmlns||{},d=/\/x?html?$/.test(t),f=d?r.HTML_ENTITIES:r.XML_ENTITIES;o&&n.setDocumentLocator(o),s.errorHandler=function(e,t,i){if(!e){if(t instanceof p)return t;e=t}var s={},n=e instanceof Function;function r(t){var r=e[t];!r&&n&&(r=2==e.length?function(i){e(t,i)}:e),s[t]=r&&function(e){r("[xmldom "+t+"]\t"+e+m(i))}||function(){}}return i=i||{},r("warning"),r("error"),r("fatalError"),s}(a,n,o),s.domBuilder=i.domBuilder||n,d&&(c[""]=l.HTML),c.xml=c.xml||l.XML;var g=i.normalizeLineEndings||h;return e&&"string"==typeof e?s.parse(g(e),c,f):s.errorHandler.error("invalid doc source"),n.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,i,s){var n=this.doc,r=n.createElementNS(e,i||t),a=s.length;y(this,r),this.currentElement=r,this.locator&&f(this.locator,r);for(var o=0;o<a;o++){e=s.getURI(o);var l=s.getValue(o),c=(i=s.getQName(o),n.createAttributeNS(e,i));this.locator&&f(s.getLocator(o),c),c.value=c.nodeValue=l,r.setAttributeNode(c)}},endElement:function(e,t,i){var s=this.currentElement;s.tagName,this.currentElement=s.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var i=this.doc.createProcessingInstruction(e,t);this.locator&&f(this.locator,i),y(this,i)},ignorableWhitespace:function(e,t,i){},characters:function(e,t,i){if(e=g.apply(this,arguments)){if(this.cdata)var s=this.doc.createCDATASection(e);else s=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(s):/^\s*$/.test(e)&&this.doc.appendChild(s),this.locator&&f(this.locator,s)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,i){e=g.apply(this,arguments);var s=this.doc.createComment(e);this.locator&&f(this.locator,s),y(this,s)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,i){var s=this.doc.implementation;if(s&&s.createDocumentType){var n=s.createDocumentType(e,t,i);this.locator&&f(this.locator,n),y(this,n),this.doc.doctype=n}},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 c(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=d},6278:(e,t,i)=>{var s=i(3314),n=s.find,r=s.NAMESPACE;function a(e){return""!==e}function o(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function l(e){if(!e)return[];var t=function(e){return e?e.split(/[\t\n\f\r ]+/).filter(a):[]}(e);return Object.keys(t.reduce(o,{}))}function c(e,t){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}function u(e,t){var i=e.prototype;if(!(i instanceof t)){function s(){}s.prototype=t.prototype,c(i,s=new s),e.prototype=i=s}i.constructor!=e&&("function"!=typeof e&&console.error("unknown Class:"+e),i.constructor=e)}var h={},d=h.ELEMENT_NODE=1,p=h.ATTRIBUTE_NODE=2,f=h.TEXT_NODE=3,m=h.CDATA_SECTION_NODE=4,g=h.ENTITY_REFERENCE_NODE=5,y=h.ENTITY_NODE=6,v=h.PROCESSING_INSTRUCTION_NODE=7,_=h.COMMENT_NODE=8,b=h.DOCUMENT_NODE=9,T=h.DOCUMENT_TYPE_NODE=10,S=h.DOCUMENT_FRAGMENT_NODE=11,w=h.NOTATION_NODE=12,E={},C={},x=(E.INDEX_SIZE_ERR=(C[1]="Index size error",1),E.DOMSTRING_SIZE_ERR=(C[2]="DOMString size error",2),E.HIERARCHY_REQUEST_ERR=(C[3]="Hierarchy request error",3)),k=(E.WRONG_DOCUMENT_ERR=(C[4]="Wrong document",4),E.INVALID_CHARACTER_ERR=(C[5]="Invalid character",5),E.NO_DATA_ALLOWED_ERR=(C[6]="No data allowed",6),E.NO_MODIFICATION_ALLOWED_ERR=(C[7]="No modification allowed",7),E.NOT_FOUND_ERR=(C[8]="Not found",8)),A=(E.NOT_SUPPORTED_ERR=(C[9]="Not supported",9),E.INUSE_ATTRIBUTE_ERR=(C[10]="Attribute in use",10));function I(e,t){if(t instanceof Error)var i=t;else i=this,Error.call(this,C[e]),this.message=C[e],Error.captureStackTrace&&Error.captureStackTrace(this,I);return i.code=e,t&&(this.message=this.message+": "+t),i}function P(){}function O(e,t){this._node=e,this._refresh=t,L(this)}function L(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var i=e._refresh(e._node);if(ve(e,"length",i.length),!e.$$length||i.length<e.$$length)for(var s=i.length;s in e;s++)Object.prototype.hasOwnProperty.call(e,s)&&delete e[s];c(i,e),e._inc=t}}function D(){}function R(e,t){for(var i=e.length;i--;)if(e[i]===t)return i}function N(e,t,i,s){if(s?t[R(t,s)]=i:t[t.length++]=i,e){i.ownerElement=e;var n=e.ownerDocument;n&&(s&&$(n,e,s),function(e,t,i){e&&e._inc++,i.namespaceURI===r.XMLNS&&(t._nsMap[i.prefix?i.localName:""]=i.value)}(n,e,i))}}function M(e,t,i){var s=R(t,i);if(!(s>=0))throw new I(k,new Error(e.tagName+"@"+i));for(var n=t.length-1;s<n;)t[s]=t[++s];if(t.length=n,e){var r=e.ownerDocument;r&&($(r,e,i),i.ownerElement=null)}}function j(){}function U(){}function B(e){return("<"==e?"<":">"==e&&">")||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function F(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(F(e,t))return!0}while(e=e.nextSibling)}function q(){this.ownerDocument=this}function $(e,t,i,s){e&&e._inc++,i.namespaceURI===r.XMLNS&&delete t._nsMap[i.prefix?i.localName:""]}function H(e,t,i){if(e&&e._inc){e._inc++;var s=t.childNodes;if(i)s[s.length++]=i;else{for(var n=t.firstChild,r=0;n;)s[r++]=n,n=n.nextSibling;s.length=r,delete s[s.length]}}}function V(e,t){var i=t.previousSibling,s=t.nextSibling;return i?i.nextSibling=s:e.firstChild=s,s?s.previousSibling=i:e.lastChild=i,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,H(e.ownerDocument,e),t}function z(e){return e&&e.nodeType===U.DOCUMENT_TYPE_NODE}function W(e){return e&&e.nodeType===U.ELEMENT_NODE}function G(e){return e&&e.nodeType===U.TEXT_NODE}function X(e,t){var i=e.childNodes||[];if(n(i,W)||z(t))return!1;var s=n(i,z);return!(t&&s&&i.indexOf(s)>i.indexOf(t))}function Y(e,t){var i=e.childNodes||[];if(n(i,(function(e){return W(e)&&e!==t})))return!1;var s=n(i,z);return!(t&&s&&i.indexOf(s)>i.indexOf(t))}function K(e,t,i){var s=e.childNodes||[],r=t.childNodes||[];if(t.nodeType===U.DOCUMENT_FRAGMENT_NODE){var a=r.filter(W);if(a.length>1||n(r,G))throw new I(x,"More than one element or text in fragment");if(1===a.length&&!X(e,i))throw new I(x,"Element in fragment can not be inserted before doctype")}if(W(t)&&!X(e,i))throw new I(x,"Only one element can be added and only after doctype");if(z(t)){if(n(s,z))throw new I(x,"Only one doctype is allowed");var o=n(s,W);if(i&&s.indexOf(o)<s.indexOf(i))throw new I(x,"Doctype can only be inserted before an element");if(!i&&o)throw new I(x,"Doctype can not be appended since element is present")}}function Q(e,t,i){var s=e.childNodes||[],r=t.childNodes||[];if(t.nodeType===U.DOCUMENT_FRAGMENT_NODE){var a=r.filter(W);if(a.length>1||n(r,G))throw new I(x,"More than one element or text in fragment");if(1===a.length&&!Y(e,i))throw new I(x,"Element in fragment can not be inserted before doctype")}if(W(t)&&!Y(e,i))throw new I(x,"Only one element can be added and only after doctype");if(z(t)){function l(e){return z(e)&&e!==i}if(n(s,l))throw new I(x,"Only one doctype is allowed");var o=n(s,W);if(i&&s.indexOf(o)<s.indexOf(i))throw new I(x,"Doctype can only be inserted before an element")}}function J(e,t,i,s){(function(e,t,i){if(!function(e){return e&&(e.nodeType===U.DOCUMENT_NODE||e.nodeType===U.DOCUMENT_FRAGMENT_NODE||e.nodeType===U.ELEMENT_NODE)}(e))throw new I(x,"Unexpected parent node type "+e.nodeType);if(i&&i.parentNode!==e)throw new I(k,"child not in parent");if(!function(e){return e&&(W(e)||G(e)||z(e)||e.nodeType===U.DOCUMENT_FRAGMENT_NODE||e.nodeType===U.COMMENT_NODE||e.nodeType===U.PROCESSING_INSTRUCTION_NODE)}(t)||z(t)&&e.nodeType!==U.DOCUMENT_NODE)throw new I(x,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)})(e,t,i),e.nodeType===U.DOCUMENT_NODE&&(s||K)(e,t,i);var n=t.parentNode;if(n&&n.removeChild(t),t.nodeType===S){var r=t.firstChild;if(null==r)return t;var a=t.lastChild}else r=a=t;var o=i?i.previousSibling:e.lastChild;r.previousSibling=o,a.nextSibling=i,o?o.nextSibling=r:e.firstChild=r,null==i?e.lastChild=a:i.previousSibling=a;do{r.parentNode=e}while(r!==a&&(r=r.nextSibling));return H(e.ownerDocument||e,e),t.nodeType==S&&(t.firstChild=t.lastChild=null),t}function Z(){this._nsMap={}}function ee(){}function te(){}function ie(){}function se(){}function ne(){}function re(){}function ae(){}function oe(){}function le(){}function ce(){}function ue(){}function he(){}function de(e,t){var i=[],s=9==this.nodeType&&this.documentElement||this,n=s.prefix,r=s.namespaceURI;if(r&&null==n&&null==(n=s.lookupPrefix(r)))var a=[{namespace:r,prefix:null}];return me(this,i,e,t,a),i.join("")}function pe(e,t,i){var s=e.prefix||"",n=e.namespaceURI;if(!n)return!1;if("xml"===s&&n===r.XML||n===r.XMLNS)return!1;for(var a=i.length;a--;){var o=i[a];if(o.prefix===s)return o.namespace!==n}return!0}function fe(e,t,i){e.push(" ",t,'="',i.replace(/[<>&"\t\n\r]/g,B),'"')}function me(e,t,i,s,n){if(n||(n=[]),s){if(!(e=s(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case d:var a=e.attributes,o=a.length,l=e.firstChild,c=e.tagName,u=c;if(!(i=r.isHTML(e.namespaceURI)||i)&&!e.prefix&&e.namespaceURI){for(var h,y=0;y<a.length;y++)if("xmlns"===a.item(y).name){h=a.item(y).value;break}if(!h)for(var w=n.length-1;w>=0;w--)if(""===(E=n[w]).prefix&&E.namespace===e.namespaceURI){h=E.namespace;break}if(h!==e.namespaceURI)for(w=n.length-1;w>=0;w--){var E;if((E=n[w]).namespace===e.namespaceURI){E.prefix&&(u=E.prefix+":"+c);break}}}t.push("<",u);for(var C=0;C<o;C++)"xmlns"==(x=a.item(C)).prefix?n.push({prefix:x.localName,namespace:x.value}):"xmlns"==x.nodeName&&n.push({prefix:"",namespace:x.value});for(C=0;C<o;C++){var x,k,A;pe(x=a.item(C),0,n)&&(fe(t,(k=x.prefix||"")?"xmlns:"+k:"xmlns",A=x.namespaceURI),n.push({prefix:k,namespace:A})),me(x,t,i,s,n)}if(c===u&&pe(e,0,n)&&(fe(t,(k=e.prefix||"")?"xmlns:"+k:"xmlns",A=e.namespaceURI),n.push({prefix:k,namespace:A})),l||i&&!/^(?:meta|link|img|br|hr|input)$/i.test(c)){if(t.push(">"),i&&/^script$/i.test(c))for(;l;)l.data?t.push(l.data):me(l,t,i,s,n.slice()),l=l.nextSibling;else for(;l;)me(l,t,i,s,n.slice()),l=l.nextSibling;t.push("</",u,">")}else t.push("/>");return;case b:case S:for(l=e.firstChild;l;)me(l,t,i,s,n.slice()),l=l.nextSibling;return;case p:return fe(t,e.name,e.value);case f:return t.push(e.data.replace(/[<&>]/g,B));case m:return t.push("<![CDATA[",e.data,"]]>");case _:return t.push("\x3c!--",e.data,"--\x3e");case T:var I=e.publicId,P=e.systemId;if(t.push("<!DOCTYPE ",e.name),I)t.push(" PUBLIC ",I),P&&"."!=P&&t.push(" ",P),t.push(">");else if(P&&"."!=P)t.push(" SYSTEM ",P,">");else{var O=e.internalSubset;O&&t.push(" [",O,"]"),t.push(">")}return;case v:return t.push("<?",e.target," ",e.data,"?>");case g:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function ge(e,t,i){var s;switch(t.nodeType){case d:(s=t.cloneNode(!1)).ownerDocument=e;case S:break;case p:i=!0}if(s||(s=t.cloneNode(!1)),s.ownerDocument=e,s.parentNode=null,i)for(var n=t.firstChild;n;)s.appendChild(ge(e,n,i)),n=n.nextSibling;return s}function ye(e,t,i){var s=new t.constructor;for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=t[n];"object"!=typeof r&&r!=s[n]&&(s[n]=r)}switch(t.childNodes&&(s.childNodes=new P),s.ownerDocument=e,s.nodeType){case d:var a=t.attributes,o=s.attributes=new D,l=a.length;o._ownerElement=s;for(var c=0;c<l;c++)s.setAttributeNode(ye(e,a.item(c),!0));break;case p:i=!0}if(i)for(var u=t.firstChild;u;)s.appendChild(ye(e,u,i)),u=u.nextSibling;return s}function ve(e,t,i){e[t]=i}E.INVALID_STATE_ERR=(C[11]="Invalid state",11),E.SYNTAX_ERR=(C[12]="Syntax error",12),E.INVALID_MODIFICATION_ERR=(C[13]="Invalid modification",13),E.NAMESPACE_ERR=(C[14]="Invalid namespace",14),E.INVALID_ACCESS_ERR=(C[15]="Invalid access",15),I.prototype=Error.prototype,c(E,I),P.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e,t){for(var i=[],s=0;s<this.length;s++)me(this[s],i,e,t);return i.join("")},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}},O.prototype.item=function(e){return L(this),this[e]||null},u(O,P),D.prototype={length:0,item:P.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var i=this[t];if(i.nodeName==e)return i}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new I(A);var i=this.getNamedItem(e.nodeName);return N(this._ownerElement,this,e,i),i},setNamedItemNS:function(e){var t,i=e.ownerElement;if(i&&i!=this._ownerElement)throw new I(A);return t=this.getNamedItemNS(e.namespaceURI,e.localName),N(this._ownerElement,this,e,t),t},removeNamedItem:function(e){var t=this.getNamedItem(e);return M(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var i=this.getNamedItemNS(e,t);return M(this._ownerElement,this,i),i},getNamedItemNS:function(e,t){for(var i=this.length;i--;){var s=this[i];if(s.localName==t&&s.namespaceURI==e)return s}return null}},j.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,i){var s=new q;if(s.implementation=this,s.childNodes=new P,s.doctype=i||null,i&&s.appendChild(i),t){var n=s.createElementNS(e,t);s.appendChild(n)}return s},createDocumentType:function(e,t,i){var s=new re;return s.name=e,s.nodeName=e,s.publicId=t||"",s.systemId=i||"",s}},U.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return J(this,e,t)},replaceChild:function(e,t){J(this,e,t,Q),t&&this.removeChild(t)},removeChild:function(e){return V(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return ye(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;t&&t.nodeType==f&&e.nodeType==f?(this.removeChild(t),e.appendData(t.data)):(e.normalize(),e=t)}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){for(var t=this;t;){var i=t._nsMap;if(i)for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)&&i[s]===e)return s;t=t.nodeType==p?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var i=t._nsMap;if(i&&Object.prototype.hasOwnProperty.call(i,e))return i[e];t=t.nodeType==p?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},c(h,U),c(h,U.prototype),q.prototype={nodeName:"#document",nodeType:b,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==S){for(var i=e.firstChild;i;){var s=i.nextSibling;this.insertBefore(i,t),i=s}return e}return J(this,e,t),e.ownerDocument=this,null===this.documentElement&&e.nodeType===d&&(this.documentElement=e),e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),V(this,e)},replaceChild:function(e,t){J(this,e,t,Q),e.ownerDocument=this,t&&this.removeChild(t),W(e)&&(this.documentElement=e)},importNode:function(e,t){return ge(this,e,t)},getElementById:function(e){var t=null;return F(this.documentElement,(function(i){if(i.nodeType==d&&i.getAttribute("id")==e)return t=i,!0})),t},getElementsByClassName:function(e){var t=l(e);return new O(this,(function(i){var s=[];return t.length>0&&F(i.documentElement,(function(n){if(n!==i&&n.nodeType===d){var r=n.getAttribute("class");if(r){var a=e===r;if(!a){var o=l(r);a=t.every((c=o,function(e){return c&&-1!==c.indexOf(e)}))}a&&s.push(n)}}var c})),s}))},createElement:function(e){var t=new Z;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new P,(t.attributes=new D)._ownerElement=t,t},createDocumentFragment:function(){var e=new ce;return e.ownerDocument=this,e.childNodes=new P,e},createTextNode:function(e){var t=new ie;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new se;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new ne;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var i=new ue;return i.ownerDocument=this,i.tagName=i.nodeName=i.target=e,i.nodeValue=i.data=t,i},createAttribute:function(e){var t=new ee;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new le;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var i=new Z,s=t.split(":"),n=i.attributes=new D;return i.childNodes=new P,i.ownerDocument=this,i.nodeName=t,i.tagName=t,i.namespaceURI=e,2==s.length?(i.prefix=s[0],i.localName=s[1]):i.localName=t,n._ownerElement=i,i},createAttributeNS:function(e,t){var i=new ee,s=t.split(":");return i.ownerDocument=this,i.nodeName=t,i.name=t,i.namespaceURI=e,i.specified=!0,2==s.length?(i.prefix=s[0],i.localName=s[1]):i.localName=t,i}},u(q,U),Z.prototype={nodeType:d,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 i=this.ownerDocument.createAttribute(e);i.value=i.nodeValue=""+t,this.setAttributeNode(i)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===S?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,H(e.ownerDocument,e,t),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);i&&this.removeAttributeNode(i)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);return i&&i.value||""},setAttributeNS:function(e,t,i){var s=this.ownerDocument.createAttributeNS(e,t);s.value=s.nodeValue=""+i,this.setAttributeNode(s)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new O(this,(function(t){var i=[];return F(t,(function(s){s===t||s.nodeType!=d||"*"!==e&&s.tagName!=e||i.push(s)})),i}))},getElementsByTagNameNS:function(e,t){return new O(this,(function(i){var s=[];return F(i,(function(n){n===i||n.nodeType!==d||"*"!==e&&n.namespaceURI!==e||"*"!==t&&n.localName!=t||s.push(n)})),s}))}},q.prototype.getElementsByTagName=Z.prototype.getElementsByTagName,q.prototype.getElementsByTagNameNS=Z.prototype.getElementsByTagNameNS,u(Z,U),ee.prototype.nodeType=p,u(ee,U),te.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(C[x])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,i){i=this.data.substring(0,e)+i+this.data.substring(e+t),this.nodeValue=this.data=i,this.length=i.length}},u(te,U),ie.prototype={nodeName:"#text",nodeType:f,splitText:function(e){var t=this.data,i=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var s=this.ownerDocument.createTextNode(i);return this.parentNode&&this.parentNode.insertBefore(s,this.nextSibling),s}},u(ie,te),se.prototype={nodeName:"#comment",nodeType:_},u(se,te),ne.prototype={nodeName:"#cdata-section",nodeType:m},u(ne,te),re.prototype.nodeType=T,u(re,U),ae.prototype.nodeType=w,u(ae,U),oe.prototype.nodeType=y,u(oe,U),le.prototype.nodeType=g,u(le,U),ce.prototype.nodeName="#document-fragment",ce.prototype.nodeType=S,u(ce,U),ue.prototype.nodeType=v,u(ue,U),he.prototype.serializeToString=function(e,t,i){return de.call(e,t,i)},U.prototype.toString=de;try{if(Object.defineProperty){function _e(e){switch(e.nodeType){case d:case S:var t=[];for(e=e.firstChild;e;)7!==e.nodeType&&8!==e.nodeType&&t.push(_e(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}}Object.defineProperty(O.prototype,"length",{get:function(){return L(this),this.$$length}}),Object.defineProperty(U.prototype,"textContent",{get:function(){return _e(this)},set:function(e){switch(this.nodeType){case d:case S:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),ve=function(e,t,i){e["$$"+t]=i}}}catch(be){}t.DocumentType=re,t.DOMException=I,t.DOMImplementation=j,t.Element=Z,t.Node=U,t.NodeList=P,t.XMLSerializer=he},251:(e,t,i)=>{var s=i(3314).freeze;t.XML_ENTITIES=s({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),t.HTML_ENTITIES=s({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},2854:(e,t,i)=>{var s=i(6278);s.DOMImplementation,s.XMLSerializer,t.DOMParser=i(6404).DOMParser},8654:(e,t,i)=>{var s=i(3314).NAMESPACE,n=/[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]/,r=new RegExp("[\\-\\.0-9"+n.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),a=new RegExp("^"+n.source+r.source+"*(?::"+n.source+r.source+"*)?$");function o(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,o)}function l(){}function c(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function u(e,t,i,n,r,a){function o(e,t,s){i.attributeNames.hasOwnProperty(e)&&a.fatalError("Attribute "+e+" redefined"),i.addValue(e,t.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,r),s)}for(var l,c=++t,u=0;;){var h=e.charAt(c);switch(h){case"=":if(1===u)l=e.slice(t,c),u=3;else{if(2!==u)throw new Error("attribute equal must after attrName");u=3}break;case"'":case'"':if(3===u||1===u){if(1===u&&(a.warning('attribute value must after "="'),l=e.slice(t,c)),t=c+1,!((c=e.indexOf(h,t))>0))throw new Error("attribute value no end '"+h+"' match");o(l,d=e.slice(t,c),t-1),u=5}else{if(4!=u)throw new Error('attribute value must after "="');o(l,d=e.slice(t,c),t),a.warning('attribute "'+l+'" missed start quot('+h+")!!"),t=c+1,u=5}break;case"/":switch(u){case 0:i.setTagName(e.slice(t,c));case 5:case 6:case 7:u=7,i.closed=!0;case 4:case 1:break;case 2:i.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return a.error("unexpected end of input"),0==u&&i.setTagName(e.slice(t,c)),c;case">":switch(u){case 0:i.setTagName(e.slice(t,c));case 5:case 6:case 7:break;case 4:case 1:"/"===(d=e.slice(t,c)).slice(-1)&&(i.closed=!0,d=d.slice(0,-1));case 2:2===u&&(d=l),4==u?(a.warning('attribute "'+d+'" missed quot(")!'),o(l,d,t)):(s.isHTML(n[""])&&d.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+d+'" missed value!! "'+d+'" instead!!'),o(d,d,t));break;case 3:throw new Error("attribute value missed!!")}return c;case"":h=" ";default:if(h<=" ")switch(u){case 0:i.setTagName(e.slice(t,c)),u=6;break;case 1:l=e.slice(t,c),u=2;break;case 4:var d=e.slice(t,c);a.warning('attribute "'+d+'" missed quot(")!!'),o(l,d,t);case 5:u=6}else switch(u){case 2:i.tagName,s.isHTML(n[""])&&l.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+l+'" missed value!! "'+l+'" instead2!!'),o(l,l,t),t=c,u=1;break;case 5:a.warning('attribute space is required"'+l+'"!!');case 6:u=1,t=c;break;case 3:u=4,t=c;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function h(e,t,i){for(var n=e.tagName,r=null,a=e.length;a--;){var o=e[a],l=o.qName,c=o.value;if((p=l.indexOf(":"))>0)var u=o.prefix=l.slice(0,p),h=l.slice(p+1),d="xmlns"===u&&h;else h=l,u=null,d="xmlns"===l&&"";o.localName=h,!1!==d&&(null==r&&(r={},f(i,i={})),i[d]=r[d]=c,o.uri=s.XMLNS,t.startPrefixMapping(d,c))}for(a=e.length;a--;)(u=(o=e[a]).prefix)&&("xml"===u&&(o.uri=s.XML),"xmlns"!==u&&(o.uri=i[u||""]));var p;(p=n.indexOf(":"))>0?(u=e.prefix=n.slice(0,p),h=e.localName=n.slice(p+1)):(u=null,h=e.localName=n);var m=e.uri=i[u||""];if(t.startElement(m,h,n,e),!e.closed)return e.currentNSMap=i,e.localNSMap=r,!0;if(t.endElement(m,h,n),r)for(u in r)Object.prototype.hasOwnProperty.call(r,u)&&t.endPrefixMapping(u)}function d(e,t,i,s,n){if(/^(?:script|textarea)$/i.test(i)){var r=e.indexOf("</"+i+">",t),a=e.substring(t+1,r);if(/[&<]/.test(a))return/^script$/i.test(i)?(n.characters(a,0,a.length),r):(a=a.replace(/&#?\w+;/g,s),n.characters(a,0,a.length),r)}return t+1}function p(e,t,i,s){var n=s[i];return null==n&&((n=e.lastIndexOf("</"+i+">"))<t&&(n=e.lastIndexOf("</"+i)),s[i]=n),n<t}function f(e,t){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}function m(e,t,i,s){if("-"===e.charAt(t+2))return"-"===e.charAt(t+3)?(n=e.indexOf("--\x3e",t+4))>t?(i.comment(e,t+4,n-t-4),n+3):(s.error("Unclosed comment"),-1):-1;if("CDATA["==e.substr(t+3,6)){var n=e.indexOf("]]>",t+9);return i.startCDATA(),i.characters(e,t+9,n-t-9),i.endCDATA(),n+3}var r=function(e,t){var i,s=[],n=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(n.lastIndex=t,n.exec(e);i=n.exec(e);)if(s.push(i),i[1])return s}(e,t),a=r.length;if(a>1&&/!doctype/i.test(r[0][0])){var o=r[1][0],l=!1,c=!1;a>3&&(/^public$/i.test(r[2][0])?(l=r[3][0],c=a>4&&r[4][0]):/^system$/i.test(r[2][0])&&(c=r[3][0]));var u=r[a-1];return i.startDTD(o,l,c),i.endDTD(),u.index+u[0].length}return-1}function g(e,t,i){var s=e.indexOf("?>",t);if(s){var n=e.substring(t,s).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return n?(n[0].length,i.processingInstruction(n[1],n[2]),s+2):-1}return-1}function y(){this.attributeNames={}}o.prototype=new Error,o.prototype.name=o.name,l.prototype={parse:function(e,t,i){var n=this.domBuilder;n.startDocument(),f(t,t={}),function(e,t,i,n,r){function a(e){var t=e.slice(1,-1);return Object.hasOwnProperty.call(i,t)?i[t]:"#"===t.charAt(0)?function(e){if(e>65535){var t=55296+((e-=65536)>>10),i=56320+(1023&e);return String.fromCharCode(t,i)}return String.fromCharCode(e)}(parseInt(t.substr(1).replace("x","0x"))):(r.error("entity not found:"+e),e)}function l(t){if(t>E){var i=e.substring(E,t).replace(/&#?\w+;/g,a);T&&f(E),n.characters(i,0,t-E),E=t}}function f(t,i){for(;t>=_&&(i=b.exec(e));)v=i.index,_=v+i[0].length,T.lineNumber++;T.columnNumber=t-v+1}for(var v=0,_=0,b=/.*(?:\r\n?|\n)|.*$/g,T=n.locator,S=[{currentNSMap:t}],w={},E=0;;){try{var C=e.indexOf("<",E);if(C<0){if(!e.substr(E).match(/^\s*$/)){var x=n.doc,k=x.createTextNode(e.substr(E));x.appendChild(k),n.currentElement=k}return}switch(C>E&&l(C),e.charAt(C+1)){case"/":var A=e.indexOf(">",C+3),I=e.substring(C+2,A).replace(/[ \t\n\r]+$/g,""),P=S.pop();A<0?(I=e.substring(C+2).replace(/[\s<].*/,""),r.error("end tag name: "+I+" is not complete:"+P.tagName),A=C+1+I.length):I.match(/\s</)&&(I=I.replace(/[\s<].*/,""),r.error("end tag name: "+I+" maybe not complete"),A=C+1+I.length);var O=P.localNSMap,L=P.tagName==I;if(L||P.tagName&&P.tagName.toLowerCase()==I.toLowerCase()){if(n.endElement(P.uri,P.localName,I),O)for(var D in O)Object.prototype.hasOwnProperty.call(O,D)&&n.endPrefixMapping(D);L||r.fatalError("end tag name: "+I+" is not match the current start tagName:"+P.tagName)}else S.push(P);A++;break;case"?":T&&f(C),A=g(e,C,n);break;case"!":T&&f(C),A=m(e,C,n,r);break;default:T&&f(C);var R=new y,N=S[S.length-1].currentNSMap,M=(A=u(e,C,R,N,a,r),R.length);if(!R.closed&&p(e,A,R.tagName,w)&&(R.closed=!0,i.nbsp||r.warning("unclosed xml attribute")),T&&M){for(var j=c(T,{}),U=0;U<M;U++){var B=R[U];f(B.offset),B.locator=c(T,{})}n.locator=j,h(R,n,N)&&S.push(R),n.locator=T}else h(R,n,N)&&S.push(R);s.isHTML(R.uri)&&!R.closed?A=d(e,A,R.tagName,a,n):A++}}catch(e){if(e instanceof o)throw e;r.error("element parse error: "+e),A=-1}A>E?E=A:l(Math.max(C,E)+1)}}(e,t,i,n,this.errorHandler),n.endDocument()}},y.prototype={setTagName:function(e){if(!a.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,i){if(!a.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:i}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},t.XMLReader=l,t.ParseError=o},7878:e=>{const t=e=>{e.style.display="none"},i=e=>{e.style.display=""};e.exports={hide:t,show:i,setText:(e,s)=>{if(!s||s.length<=0)return e.innerText="",void t(e);e.innerText=s,i(e)}}},7668:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(7938),n=i.n(s);var r=i(608);const a={logoOnclickUrl:"https://cloudinary.com/",showLogo:!0,showJumpControls:!1,playsinline:n().browser.IS_IOS,skin:"dark",controls:!1,chaptersButton:!1,pictureInPictureToggle:!1,seekThumbnails:!0,aiHighlightsGraph:!1,preload:r.Am.AUTO,textTrackSettings:!1,loop:!1,muted:!1,posterOptions:{},sourceTypes:["auto"],contextMenu:{content:e=>{const t=e.loop(),i=e.paused(),s=e.muted(),n=e.isFullscreen(),r={class:"player-version",label:"Cloudinary Player v2.0.2"};return e.controls()?[{label:t?"Unloop":"Loop",listener:()=>{e.loop(!t)}},{label:i?"Play":"Pause",listener:()=>{i?e.play():e.pause()}},{label:s?"Unmute":"Mute",listener:()=>{e.muted(!s)}},{label:n?"Exit Fullscreen":"Fullscreen",listener:()=>{n?e.exitFullscreen():e.requestFullscreen()}},r]:[r]}},floatingWhenNotVisible:r.rT.NONE,hideContextMenu:!1,analytics:!1,cloudinaryAnalytics:!0,allowUsageReport:!0,playedEventPercents:[25,50,75,100]}},9911:(e,t,i)=>{i.d(t,{Ay:()=>At,xY:()=>Ct,GF:()=>kt,Iy:()=>xt});var s=i(7171),n=i.n(s),r=i(7938),a=i.n(r);const o={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let l;const c=new Uint8Array(16);function u(){if(!l&&(l="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!l))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return l(c)}const h=[];for(let e=0;e<256;++e)h.push((e+256).toString(16).slice(1));const d=function(e,t,i){if(o.randomUUID&&!t&&!e)return o.randomUUID();const s=(e=e||{}).random||(e.rng||u)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t){i=i||0;for(let e=0;e<16;++e)t[i+e]=s[e];return t}return function(e,t=0){return h[e[t+0]]+h[e[t+1]]+h[e[t+2]]+h[e[t+3]]+"-"+h[e[t+4]]+h[e[t+5]]+"-"+h[e[t+6]]+h[e[t+7]]+"-"+h[e[t+8]]+h[e[t+9]]+"-"+h[e[t+10]]+h[e[t+11]]+h[e[t+12]]+h[e[t+13]]+h[e[t+14]]+h[e[t+15]]}(s)};var p=i(5685),f=i.n(p),m=i(2832),g=i.n(m),y=i(8446),v=i.n(y),_=i(7571),b=i.n(_);const T=a().getComponent("ClickableComponent");a().registerComponent("JumpForwardButton",class extends T{handleClick(e){super.handleClick(e),this.player().currentTime(this.player().currentTime()+10)}createEl(){return a().dom.createEl("button",{className:"vjs-control vjs-icon-skip-10-plus vjs-icon-forward-10 vjs-button",ariaLabel:"Jump forward 10 seconds"})}});const S=a().getComponent("ClickableComponent");a().registerComponent("JumpBackButton",class extends S{handleClick(e){super.handleClick(e),this.player().currentTime(this.player().currentTime()-10)}createEl(){return a().dom.createEl("button",{className:"vjs-control vjs-icon-skip-10-min vjs-icon-replay-10 vjs-button",ariaLabel:"Jump back 10 seconds"})}});const w=a().getComponent("ClickableComponent");a().registerComponent("logoButton",class extends w{createEl(){const e=this.options_.playerOptions,t=e.showLogo?"block":"none",i=e.logoImageUrl?"background-image: url(".concat(e.logoImageUrl,")"):"";return a().dom.createEl("a",{},{class:"vjs-control vjs-cloudinary-button vjs-button",href:e.logoOnclickUrl,target:"_blank",style:"display: ".concat(t,"; ").concat(i),"aria-label":"Logo link"})}});const E=a().getComponent("Component");a().registerComponent("progressControlEventsBlocker",class extends E{constructor(e){super(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}createEl(){return super.createEl("div",{className:"vjs-progress-control-events-blocker"})}});var C=i(7878),x=i.n(C);const k=a().dom||a(),A=a().getComponent("Component");a().registerComponent("titleBar",class extends A{constructor(e){super(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),this.on(e,"cldsourcechanged",((e,t)=>{let{source:i}=t;return this.setItem(i)}))}setItem(e){if(!e)return this.setTitle(""),void this.setSubtitle("");const t=e.info();this.setTitle(t.title),this.setSubtitle(t.subtitle)}setTitle(e){return x().setText(this.titleEl,e),this.refresh(),e}setSubtitle(e){return x().setText(this.subtitleEl,e),this.refresh(),e}refresh(){(()=>this.titleEl.innerText)()||(()=>this.subtitleEl.innerText)()?this.show():this.hide()}createEl(){this.titleEl=k.createEl("div",{className:"vjs-title-bar-title"}),this.subtitleEl=k.createEl("div",{className:"vjs-title-bar-subtitle"});const e=super.createEl("div",{append:this.titleEl,className:"vjs-title-bar"});return e.appendChild(this.titleEl),e.appendChild(this.subtitleEl),e}});var I="3.0.1";const P=a().getTech("Html5"),O=a().registerPlugin||a().plugin,L=["abort","emptied","loadstart","play"],D=["abort","emptied"],R=["ad-playback","ads-ready?","postroll?","preroll?"];let N=0;const M=function(){const e=[];let t,i,s=!1,n=!0;const r=t=>function(i,s){if(this.perSourceBehaviors.disabled())return;const n=2===arguments.length,r=this.currentSrc(),a=[i],o=arguments[arguments.length-1],l=n?this:i,c=o.bind(l),u=(...e)=>{const i=this.currentSrc()!==r;this.perSourceBehaviors.disabled()||((i||t)&&this.off(...a),i||c(...e))};return u.guid=c.guid=o.guid="psb-"+ ++N,n||a.push(s),a.push(u),e.push(a),this.on(...a)};this.perSourceBehaviors={disable:function(){return this.clearTimeout(i),i=null,s=!0,s}.bind(this),disabled:()=>s,enable:()=>(s=!1,s),enabled:()=>!s,isSrcStable:()=>n,VERSION:I},this.onPerSrc=r(),this.onePerSrc=r(!0),this.on("dispose",(()=>{e.length=0})),this.on(L,(s=>{if(this.perSourceBehaviors.disabled()||i||((e,t)=>{return!!e.usingPlugin("ads")&&((e=>e.usingPlugin("ads")&&"function"==typeof e.ads.inAdBreak)(e)?e.ads.isInAdMode()&&"loadstart"!==t.type:(i=e.ads.state,R.indexOf(i)>-1));var i})(this,s))return;n&&D.indexOf(s.type)>-1&&(n=!1,this.trigger("sourceunstable"));const r=[],a=e=>r.push({time:Date.now(),event:e});a(s),this.on(P.Events,a),i=this.setTimeout((()=>{const s=this.currentSrc();n=!0,i=null,this.off(P.Events,a),s&&s!==t&&(e.forEach((e=>this.off(...e))),e.length=0,this.trigger("sourcechanged",{interimEvents:r,from:t,to:s}),t=s)}),1)}))};M.VERSION=I,O("perSourceBehaviors",M);const j=a().getComponent("MenuItem"),U=a().getComponent("Component");class B extends j{constructor(e,t){t.selectable=!0,t.multiSelectable=!1,super(e,t)}handleClick(){const e=this.options_;super.handleClick();const t=[...this.player_.qualityLevels().levels_];for(const[i,s]of t.entries())s.enabled=e.index===t.length||e.index===i}update(){const e=this.player_.qualityLevels().selectedIndex;this.selected(this.options_.index===e)}}U.registerComponent("SourceMenuItem",B);const F=B,q=a().getComponent("MenuButton"),$=class extends q{constructor(e,t){super(e,t);const i=this.player_.qualityLevels();if(t&&t.default)if("low"===t.default)for(const[e,t]of i.entries())t.enabled=0===e;else if("high"===t.default)for(let e=0;e<i.length;e++)i[e].enabled=e===i.length-1;this.player_.qualityLevels().on(["change","addqualitylevel","removequalitylevel"],a().bind(this,this.update))}createEl(){return a().dom.createEl("div",{className:"vjs-http-source-selector vjs-menu-button vjs-menu-button-popup vjs-control vjs-button"})}buildCSSClass(){return q.prototype.buildCSSClass.call(this)}update(){return q.prototype.update.call(this)}createItems(){const e=[],t=this.player_.qualityLevels(),i=[];for(let s=t.length-1;s>=0;s--){const n=s===t.selectedIndex;let r="".concat(s),a=s;const o=t[s];o.height?(r="".concat(o.height,"p"),a=Number.parseInt(o.height,10)):o.bitrate&&(r="".concat(Math.floor(o.bitrate/1e3)," kbps"),a=Number.parseInt(o.bitrate,10)),i.includes(r)||(i.push(r),e.push(new F(this.player_,{label:r,index:s,selected:n,sortValue:a})))}return t.length>1&&e.push(new F(this.player_,{label:"Auto",index:t.length,selected:!1,sortValue:999999})),e.sort((function(e,t){return t.options_.sortValue-e.options_.sortValue})),e}},H={},V=a().getPlugin("plugin");(0,a().registerPlugin)("httpSourceSelector",class extends V{constructor(e,t){a().registerComponent("SourceMenuButton",$),a().registerComponent("SourceMenuItem",F);const i=(a().obj&&a().obj.merge||a().mergeOptions)(H,t);super(e,i),this.options_=i,this.player_=e,this.on(e,"ready",(()=>{this.reset(),this.init()}))}init(){this.player_.addClass("vjs-http-source-selector"),this.player_.videojsHTTPSouceSelectorInitialized=!0,"Html5"===this.player_.techName_?this.on(this.player_,"loadedmetadata",(()=>{this.metadataLoaded()})):(console.error(this.player_.techName_+" tech is not supported"),this.reset())}reset(){this.player_.removeClass("vjs-http-source-selector"),!0===this.player_.videojsHTTPSouceSelectorInitialized&&(this.player_.controlBar.getChild("SourceMenuButton")||this.player_.controlBar.removeChild("SourceMenuButton",{}),this.player_.videojsHTTPSouceSelectorInitialized=!1)}metadataLoaded(){const e=this.player_.controlBar,t=e.getChild("fullscreenToggle");e.getChild("SourceMenuButton")||(t?e.el().insertBefore(e.addChild("SourceMenuButton").el(),t.el()):e.el().append(e.addChild("SourceMenuButton").el()))}});let z={};const W=function(){function e(e,t){return this.player=e,this.options=t,this.initializeHighlightsGraph(),this}return e.prototype.src=function(e){this.resetPlugin(),this.options.src=e,this.initializeHighlightsGraph()},e.prototype.detach=function(){this.resetPlugin()},e.prototype.resetPlugin=function(){this.graphHolder&&this.graphHolder.parentNode.removeChild(this.graphHolder),delete this.progressBar,delete this.graphHolder,delete this.lastStyle},e.prototype.initializeHighlightsGraph=function(){this.options.src&&fetch(this.options.src).then((e=>e.json())).then((e=>{this.setupHighlightsGraphElement(),this.graphHolder&&this.createHighlightsGraph(e)}))},e.prototype.setupHighlightsGraphElement=function(){if(this.progressBar=this.player.$(".vjs-progress-control"),!this.progressBar)return;const e=this.player.$(".vjs-highlights-graph-display")||document.createElement("div");e.setAttribute("class","vjs-highlights-graph-display"),this.progressBar.appendChild(e),this.graphHolder=e},e.prototype.createPath=function(e,t,i){const s=t/(e.length-1),n=e.map(((e,t)=>({x:t*s,y:i-e*i}))),r=document.createElementNS("http://www.w3.org/2000/svg","path");r.setAttribute("fill","lightblue");let a="M ".concat(n[0].x,",").concat(n[0].y);for(let e=0;e<n.length-1;e++){const t=(n[e].x+n[e+1].x)/2,i=(n[e].y+n[e+1].y)/2;a+=" Q ".concat(n[e].x,",").concat(n[e].y," ").concat(t,",").concat(i)}return a+=" Q ".concat(n[n.length-1].x,",").concat(n[n.length-1].y," ").concat(n[n.length-1].x,",").concat(n[n.length-1].y),a+=" L ".concat(n[n.length-1].x,",").concat(i," L ").concat(n[0].x,",").concat(i," Z"),r.setAttribute("d",a),r},e.prototype.createHighlightsGraph=function(e){const t=e.data,i=this.player.$(".vjs-highlights-graph-display > svg")||document.createElementNS("http://www.w3.org/2000/svg","svg");i.setAttribute("viewBox","0 0 ".concat(600," ").concat(20)),i.setAttribute("preserveAspectRatio","none"),i.setAttribute("width",600),i.setAttribute("height",20),i.innerHTML="";const s=this.createPath(t,600,20);i.appendChild(s),this.graphHolder.appendChild(i)},e}();var G=i(5871),X=i(6827),Y=i.n(X),K=i(8953),Q=i.n(K),J=i(1104);const Z={percentsplayed:{percents:[25,50,75,100]}},ee={events:[J.f.PERCENTS_PLAYED,J.f.PAUSE_NO_SEEK,J.f.SEEK,J.f.MUTE,J.f.UNMUTE,J.f.QUALITY_CHANGED]};class te extends(Y()){constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this.player=e;const i=a().obj.merge(ee,t);let s={lastState:void 0},n=0,r=0,o=!1,l=[],c=[],u=null,h=!1;const d=()=>{l=[],c=[]};this.events=ie(i.events,Z),s={lastState:void 0},n=r=0,o=!1,d(),this.player.on(J.f.PLAY,(()=>{h&&(this.player.trigger("replay"),h=!1)}).bind(this)),this.player.on(J.f.ENDED,(()=>{h=!0}).bind(this)),(this.events.percentsplayed||this.events.timeplayed||this.events.seek||this.events.totaltimeplayed)&&this.player.on(J.f.TIME_UPDATE,(e=>{const t=this.player.currentTime(),i=this.player.duration(),s=(t,i)=>{i.originalType="timeupdate",this.emit(t,e,i)};if(this.events.percentsplayed&&this.events.percentsplayed.percents.forEach((e=>{se(t,i,e)&&-1===l.indexOf(e)&&(l.push(e),s(J.f.PERCENTS_PLAYED,{percent:e}))})),this.events.timeplayed){const e=this.events.timeplayed;(e.interval?[Math.floor(t/e.interval)*e.interval]:e.times).forEach((e=>{ne(t,e)&&-1===c.indexOf(e)&&(c.push(e),s(J.f.TIME_PLAYED,{time:e}))}))}this.events.seek&&(n=r,r=t,Math.abs(n-r)>1&&(o=!0,d(),s(J.f.SEEK,{seekStart:n,seekEnd:r})))}).bind(this)),(this.events.mute||this.events.unmute)&&this.player.on(J.f.VOLUME_CHANGE,(e=>{this.player.muted()&&"muted"!==s.lastState?(s.lastState="muted",this.emit(J.f.MUTE,e)):this.player.muted()||"unmuted"===s.lastState||(s.lastState="unmuted",this.emit(J.f.UNMUTE,e))}).bind(this)),this.events.pausenoseek&&(this.player.on(J.f.PAUSE,(e=>{Math.round(this.player.currentTime())===Math.round(this.player.duration())||o||this.emit(J.f.PAUSE_NO_SEEK,e)}).bind(this)),this.player.on(J.f.PLAY,(()=>{o=!1}).bind(this))),this.player.on(J.f.LOADED_METADATA,(()=>{this.player.currentSource().src!==u&&(d(),u=this.player.currentSource().src)}).bind(this)),this.player.on(J.f.LOADED_DATA,(e=>{let t=this,i=this.player.textTracks(),s=null;for(let e=0;e<i.length;e++)"segment-metadata"===i[e].label&&(s=i[e]);let n=null;s&&s.on("cuechange",(function(){let i=s.activeCues[0];if(i){let s=i.value.resolution;if(n!==s){let i={from:n,to:s};t.emit(J.f.QUALITY_CHANGED,e,i)}n=s}}))}).bind(this))}}const ie=(e,t)=>{let i=e;return"Array"===e.constructor.name&&(i=e.reduce(((e,i)=>{const s=t[i]||{};return Q()(i)?e[i.type]=Object.assign({},s,i):e[i]=s,e}),{})),i},se=function(e,t,i){return ne(e,t*i/100,arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5)},ne=function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.5;return e<=t+i&&e>=t-i},re=te,ae=[J.f.PLAY,J.f.PAUSE,J.f.ENDED,J.f.VOLUME_CHANGE,J.f.RESIZE,J.f.ERROR,J.f.FULL_SCREEN_CHANGE,J.f.START,J.f.VIDEO_LOAD,J.f.PERCENTS_PLAYED,J.f.SEEK,J.f.PLAYER_LOAD],oe={percentsplayed:{percents:[25,50,75,100]}},le={events:ae,category:"Video",defaultLabel:e=>e.cloudinary&&e.cloudinary.currentPublicId()||e.currentSource().src};class ce{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.player=e,this.options=a().obj.merge(le,t),this.events=ie(this.options.events,oe);const i=(0,G.sliceProperties)(this.events,J.f.PERCENTS_PLAYED,J.f.TIME_PLAYED,J.f.PAUSE,J.f.SEEK);i.pause&&(delete i.pause,i.pausenoseek={}),this._extendedEvents=new re(e,{events:i}),this._currentSource=null,this._startTracked=null,this._endTracked=null,this.resetState()}init(){this.events.shoppable&&(this.player.on("productHover",((e,t)=>{this.track({action:"productHover",label:t.productName})}).bind(this)),this.player.on("productClick",((e,t)=>{this.track({action:"productClick",label:t.productName})}).bind(this)),this.player.on("productHoverPost",((e,t)=>{this.track({action:"productHoverPostPlay",label:t.productName})}).bind(this)),this.player.on("productClickPost",((e,t)=>{this.track({action:"productClickPostPlay",label:t.productName})}).bind(this)),this.player.on("productBarMin",(()=>{this.track({action:"shoppableBar",label:"closed"})}).bind(this)),this.player.on("productBarMax",(()=>{this.track({action:"shoppableBar",label:"opened"})}).bind(this)),this.player.on("replay",(()=>{this.track({action:"replay"})}).bind(this))),this.events.play&&this.player.on(J.f.PLAY,(()=>{this.track({action:"Play"})}).bind(this)),this.events.ended&&this.player.on(J.f.ENDED,(()=>{this._endTracked||(this.track({action:"Ended",nonInteraction:!0}),this._endTracked=!0)}).bind(this)),this.events.volumechange&&this.player.on(J.f.VOLUME_CHANGE,(()=>{const e=this.player.muted()?0:this.player.volume();this.track({action:"Volume Change",value:e})}).bind(this)),this.events.resize&&this.player.on(J.f.RESIZE,(()=>{const e="Resize - ".concat(this.player.width(),"x").concat(this.player.height(),"}");this.track({action:e})}).bind(this)),this.events.error&&this.player.on(J.f.ERROR,(()=>{this.track({action:"Error",nonInteraction:!0})}).bind(this)),this.events.start&&this.player.on(J.f.PLAYING,(()=>{this._startTracked&&(this.track({action:"Start"}),this._startTracked=!0)}).bind(this)),this.events.fullscreenchange&&this.player.on(J.f.FULL_SCREEN_CHANGE,(()=>{const e=this.player.isFullscreen()?"Enter Fullscreen":"Exit Fullscreen";this.track({action:e})}).bind(this)),this.events.percentsplayed&&this._extendedEvents.on(J.f.PERCENTS_PLAYED,((e,t)=>{const{percent:i}=t;this.track({action:"".concat(i," Percents Played"),nonInteraction:!0})}).bind(this)),this.events.timeplayed&&this._extendedEvents.on(J.f.TIME_PLAYED,((e,t)=>{const{time:i}=t;this.track({action:"".concat(i," Seconds Played"),value:i,nonInteraction:!0})}).bind(this)),this.events.pause&&this._extendedEvents.on(J.f.PAUSE_NO_SEEK,(()=>{this.track({action:"Pause"})}).bind(this)),this.events.seek&&this._extendedEvents.on(J.f.SEEK,((e,t)=>{const{seekStart:i,seekEnd:s}=t;this.track({action:"Seek Start",value:i}),this.track({action:"Seek End",value:s})}).bind(this)),this.events.playerload&&(()=>{this.track({action:"Player Load",label:window.location.href,nonInteraction:!0})})(),this.player.on(J.f.LOADED_METADATA,this.loadedmetadata.bind(this))}track(e){let{action:t,label:i,value:s=null,nonInteraction:n=!1}=e;const r={eventCategory:this.options.category,eventAction:t,eventLabel:i||this.options.defaultLabel(this.player),eventValue:s||Math.round(this.player.currentTime()),nonInteraction:n};window.ga("send","event",r)}videoload(){this.track({action:"Video Load",nonInteraction:!0})}resetState(){this._currentSource="",this._startTracked=!1,this._endTracked=!1}loadedmetadata(){const e=this.player.currentSource().src;e!==this._currentSource&&(this.resetState(),this._currentSource=e,this.events.videoload&&this.videoload())}}var ue=i(3171);const he={fraction:.5,isMuted:!0};class de{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=Object.assign({},he,t),this.player=e;let i=(0,G.sliceProperties)(t,"fraction"),s=!1,n=!1,r=null,a=null;this.init=()=>{h(),u()};const o=()=>{window.removeEventListener("DOMContentLoaded",u,!1),window.removeEventListener("load",u,!1),window.removeEventListener("scroll",u,!1),window.removeEventListener("resize",u,!1),this.player.off("pause",r),this.player.off("play",a)},l=()=>{s=!0,n=!1,this.player.pause()},c=()=>{s=!1,n=!0,this.player.play()},u=()=>{(0,ue.isElementInViewport)(this.player.el(),{fraction:i.fraction})?this.player.paused()&&c():this.player.paused()||this.player.activePlugins_.floatingPlayer||l()},h=()=>{r=()=>{this.player.waiting||s||o()},a=()=>{n||o()},window.addEventListener("DOMContentLoaded",u,!1),window.addEventListener("load",u,!1),window.addEventListener("scroll",u,!1),window.addEventListener("resize",u,!1),this.player.on("pause",r),this.player.on("play",a)}}}var pe=i(5004),fe=i(8033),me=i(5381);const ge=class{constructor(e){this._emitter=e,this._eventHandlers=[]}on(e,t){this._eventHandlers.push({type:e,handler:t}),this._emitter.on(e,t)}one(e,t){var i=this;this._eventHandlers.push({type:e,handler:t,wrapper:function(){t(...arguments),i.off(e,t)}}),this._emitter.one(e,t)}off(e,t){var i;const s=null===(i=this._eventHandlers)||void 0===i?void 0:i.findIndex((i=>i.type===e&&i.handler===t));if(-1===s)return;const n=this._eventHandlers[s];this._emitter.off(e,n.wrapper||n.handler),this._eventHandlers.splice(s,1)}removeAllListeners(){this._eventHandlers.forEach((e=>{this.off(e)}))}};var ye=i(4650),ve=i(7311);const _e={format:"jpg",resource_type:"video",transformation:{flags:"waveform"}},be=RegExp("\\.(".concat(["mp3","ogg","wav","mp4"].join("|"),")$$")),Te={resource_type:"video",type:"upload",transformation:[]};class Se extends me.A{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};({publicId:e,options:t}=(0,fe.a5)(e,t)),e=e.replace(be,""),t=Object.assign({},Te,t);const{poster:i}=(0,G.sliceAndUnsetProperties)(t,"poster");super(e,t),this._poster=null,this._type=J.x.AUDIO,this.poster(i)}getPoster(){return this._poster}poster(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e?e instanceof ye.A?(this._poster=e,this):(({publicId:e,options:t}=(0,fe.a5)(e,t,{tolerateMissingId:!0})),e||(e=this.publicId(),t=Object.assign({},t,_e)),t.cloudinaryConfig=t.cloudinaryConfig||this.cloudinaryConfig(),this._poster=new ye.A(e,t),this):this._poster}generateSources(){return this.sourceTypes().map((e=>{if("audio"===e){const t="mp3",i={},s=this.sourceTransformation()[e]||[this.transformation()];s&&(i.transformation=s),Object.assign(i,{resource_type:"video",format:t});const n=this.queryParams()?(0,ve.y)(this.queryParams()):"";return{type:"video/mp4",src:"".concat(this.config().url(this.publicId(),i)).concat(n),cldSrc:this,poster:this.getPoster().url()}}return null}),this)}}const we=Se,Ee={transformation:{},sourceTypes:[],sourceTransformation:[],posterOptions:{}},Ce=["cloudinaryConfig","transformation","sourceTypes","sourceTransformation","posterOptions","autoShowRecommendations"];class xe{constructor(e){var t=this;let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,fe.M6)(),this.player=e,s=Object.assign({},Ee,s);let n=null,r=null,a=null,o=null,l=null,c=null,u=null,h=null,d=null,p=s.chainTarget,f=null,m=null,g=!1;this.source=function(s){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r=Object.assign({},r),!s)return n;let a=null;if(s instanceof me.A)a=s;else{let{publicId:e,options:i}=(0,fe.a5)(s,r);a=t.buildSource(e,i)}const o=a.recommendations();if(o&&o.length){let t=null,s=!1;r.recommendationOptions&&({disableAutoShow:s,itemBuilder:t}=(0,G.sliceAndUnsetProperties)(r.recommendationOptions,"disableAutoShow","itemBuilder")),async function(e){try{return e.getChild("recommendationsOverlay")||(await Promise.all([i.e(869),i.e(410)]).then(i.bind(i,7604)),e.addChild("recommendationsOverlay")),e}catch(e){console.error("Failed to load plugin:",e)}}(e).then((()=>{y(o,{disableAutoShow:s,itemBuilder:t})}))}else _();return n=a,r.sourceTypes&&r.sourceTypes.some((e=>e.includes("dash")))?i.e(367).then(i.bind(i,6604)).then((()=>{b()})):r.skipRefresh||b(),t.player.trigger("cldsourcechanged",{source:a}),p},this.buildSource=function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=null;return({publicId:e,options:i}=(0,fe.a5)(e,i)),i.cloudinaryConfig=(0,fe.lP)(t.cloudinaryConfig(),i.cloudinaryConfig||{}),i.transformation=(0,fe.N7)(t.transformation(),i.transformation||{}),i.sourceTransformation=i.sourceTransformation||t.sourceTransformation(),i.sourceTypes=i.sourceTypes||t.sourceTypes(),i.poster=i.poster||S(),i.queryParams=Object.assign(i.queryParams||{},i.usageReport?{_s:"vp-".concat("2.0.2")}:{}),s=i.sourceTypes.indexOf("audio")>-1?new we(e,i):new me.A(e,i),s},this.posterOptions=e=>e?(l=e,p):l,this.disablePoster=e=>{this.player.poster(" "),this.player.posterImage.el().style.backgroundColor=e},this.cloudinaryConfig=e=>e?(c=e,p):c,this.transformation=e=>e?(u=e,p):u,this.sourceTypes=e=>e?(h=e,p):h,this.getCurrentSources=()=>r,this.sourceTransformation=e=>e?(d=e,p):d,this.on=function(){return f.on(...arguments)},this.one=function(){return f.one(...arguments)},this.off=function(){return f.off(...arguments)},this.autoShowRecommendations=e=>void 0===e?g:(g=e,p),this.dispose=()=>{this.playlist&&this.playlist()&&this.disposePlaylist(),_(),n=void 0,f.removeAllListeners()};const y=(e,t)=>{let{disableAutoShow:i=!1,itemBuilder:s=null}=t;if(_(),!Array.isArray(e)&&"function"!=typeof e&&!e.then)throw new Error('"recommendations" must be either an array or a function');m={},s=s||(e=>({source:e instanceof me.A?e:this.buildSource(e),action:()=>this.source(e)})),m.sourceChangedHandler=()=>{const t=e=>{if(void 0!==e&&e.length>0){const t=e.map((e=>s(e)));this.player.trigger("recommendationschanged",{items:t})}else this.player.trigger("recommendationsnoshow");m.sources=e};v()(e)?t(e()):e.then?e.then(t):t(e)},m.sourceChangedHandler(),m.endedHandler=()=>{!i&&this.autoShowRecommendations()&&this.player.trigger("recommendationsshow")},this.on("ended",m.endedHandler)},_=()=>{m&&(this.off("cldsourcechanged",m.sourceChangedHandler),this.off("ended",m.endedHandler),delete m.endedHandler,delete m.sourceChangedHandler),m=null},b=()=>{const e=this.source(),t=Object.assign({},this.player.cloudinary.posterOptions(),e.getInitOptions().poster);t.posterColor?this.disablePoster(t.posterColor):e.poster()&&this.player.poster(e.poster().url()),r=e.generateSources().reduce(((e,t)=>{if(t.isAdaptive)if(t.type.split("; ")[1]&&"MediaSource"in window){const i=t.type.split("; ");let s="video/mp4; ".concat(i[1]||"");T(s)&&e.push(t)}else e.push(t);else e.push(t);return e}),[]),this.player.src(r),a=e,this.playlist&&(o=this.playlist())},T=e=>document.createElement("video").canPlayType(e)||"MediaSource"in window&&MediaSource.isTypeSupported(e),S=()=>{const e=Object.assign({},this.posterOptions());e.transformation=e.transformation||{},!e.transformation.width&&!e.transformation.height||e.transformation.crop||(e.transformation.crop="scale");const t=this.player.el();if(t&&t.clientWidth&&t.clientHeight&&!(0,pe.isKeyInTransformation)(e.transformation,"width")&&!(0,pe.isKeyInTransformation)(e.transformation,"height")){const i=e=>100*Math.ceil(e/100);e.transformation=(0,fe.N7)(e.transformation,{width:i(t.clientWidth),height:i(t.clientHeight),crop:"limit"})}return e};f=new ge(this.player);const w=(0,G.sliceAndUnsetProperties)(s,...Ce);var E,C;E=this,C=w,Object.entries(C).forEach((e=>{let[t,i]=e;E[t]&&"function"==typeof E[t]&&E[t](i)})),this.on("sourcechanged",((e,t)=>{let i=t.to;a&&a.contains(i)?this.source()||(this.playlist&&o&&this.playlist(o),this.source(a,{skipRefresh:!0})):(this.player.trigger("cldsourcechanged",{}),this.dispose())}))}currentSourceType(){return this.source().getType()}currentPublicId(){return this.source()&&this.source().publicId()}currentPoster(){return this.source()&&this.source().poster()}}var ke=i(4138);function Ae(e,t,i){var s;return(t="symbol"==typeof(s=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var s=i.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?s:s+"")in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}class Ie{constructor(e){Ae(this,"getMetadata",(()=>({cloudName:this.player.cloudinary.cloudinaryConfig().cloud_name,publicId:this.player.cloudinary.currentPublicId()}))),Ae(this,"sourceChanged",(()=>{const e=this.getMetadata();e.cloudName&&e.publicId?(this.currentVideMetadata=e,this.cloudinaryAnalytics.startManualTracking(e,{videoPlayerType:"cloudinary video player",videoPlayerVersion:"2.0.2"})):this.currentVideMetadata.cloudName===e.cloudName&&this.currentVideMetadata.publicId===e.publicId||this.cloudinaryAnalytics.stopManualTracking()})),this.player=e,this.cloudinaryAnalytics=(0,ke.connectCloudinaryAnalytics)(this.player.videoElement),this.currentVideMetadata={cloudName:null,publicId:null}}init(){this.player.on(J.f.CLD_SOURCE_CHANGED,this.sourceChanged),this.player.on(J.f.SOURCE_CHANGED,this.sourceChanged)}}var Pe=i(4500),Oe=i(7134);const Le=a().getComponent("MenuItem"),De=class extends Le{handleClick(){super.handleClick(),this.options_.listener()}createEl(){const e=(0,Oe.n)("span",{class:"vjs-menu-item-text"+(this.options_.class?" ".concat(this.options_.class):"")});return e.appendChild(document.createTextNode(this.localize(this.options_.label))),(0,Oe.n)("li",{class:"vjs-menu-item",tabIndex:-1},e)}},Re=a().getComponent("Menu"),Ne=class extends Re{constructor(e,t){var i;super(e,t),i=this,t.content.forEach((t=>{let s=null;s=v()(t.listener)?t.listener:"string"==typeof t.href?()=>window.open(t.href):()=>!0,this.addItem(new De(e,{label:t.label,class:t.class,listener:function(){s(...arguments),i.dispose()}}))}))}setPosition(e,t){(0,ue.setPosition)(this.el(),e,t)}createEl(){const e=super.createEl();if(a().dom.addClass(e,"vjs-context-menu-ui"),this.options_.position){const{left:e,top:t}=this.options_.position;this.setPosition(e,t)}return e}},Me={cancel:!0,sensitivity:10,wait:500,disabled:!1},je="vjs-contextmenu";function Ue(e,t){if(e.contextmenu.options.disabled)return e;const i={target:e,type:je};return["clientX","clientY","pageX","pageY","screenX","screenY"].forEach((e=>{i[e]=t[e]})),e.trigger(i)}function Be(e){const t=this.contextmenu.current;if(!t)return;const i=this.contextmenu.options.wait;"touchend"===e.type&&(new Date).getTime()-t.time>=i&&Ue(this,e),this.contextmenu.current=null}function Fe(e){const t=this.contextmenu.current;if(!t)return;const i=e.touches[0],s=this.contextmenu.options.sensitivity;(i.screenX-t.screenX>s||i.screenY-t.screenY>s)&&(this.contextmenu.current=null)}function qe(e){if(this.contextmenu.current)return;const t=e.touches[0];this.contextmenu.current={screenX:t.screenX,screenY:t.screenY,time:(new Date).getTime()}}function $e(e){this.contextmenu.options.cancel&&!this.contextmenu.options.disabled&&e.preventDefault(),Ue(this,e),this.off(["touchcancel","touchend"],Be),this.off("touchmove",Fe),this.off("touchstart",qe)}a().registerPlugin("contextmenu",(function(e){this.contextmenu.options=a().obj.merge(Me,e),this.on("contextmenu",$e),this.on(["touchcancel","touchend"],Be),this.on("touchmove",Fe),this.on("touchstart",qe),this.ready((()=>this.addClass(je)))}));const He={showNativeOnRecurringEvent:!1};class Ve{constructor(e,t){if(!Array.isArray(t.content)&&!v()(t.content))throw new Error('"content" required');const i=Object.assign({},He,t);this.player=e;const s=(0,G.sliceProperties)(i,"content","showNativeOnRecurringEvent");this.init=()=>{this.player.contextmenu(),this.player.on("vjs-contextmenu",r),this.player.ready((()=>this.player.addClass("vjs-context-menu")))};const n=e=>{const t=this.menu.el();t.style.visibility="hidden",this.player.el().appendChild(t);const i=t.getBoundingClientRect();this.player.el().removeChild(t),t.style.visibility="visible";const s=(0,ue.getPointerPosition)(this.player.el(),e),n=this.player.el().getBoundingClientRect();let r=n.height-n.height*s.y+1,a=Math.round(n.width*s.x)+1,o=r,l=a;return r+i.height>n.height&&(o=r+i.height-n.height>i.height/2?r-i.height-1:n.height-i.height),a+i.width>n.width&&(l=a+i.width-n.width>i.width/2?a-i.width-1:n.width-i.width),o<r&&l<a&&(o=r-i.height-1,l=a-i.width-1),o=Math.max(0,o),l=Math.max(0,l),{left:l,top:o}},r=e=>{if(this.menu&&(this.menu.dispose(),s.showNativeOnRecurringEvent))return;s.showNativeOnRecurringEvent&&(this.player.contextmenu.options.cancel=!1),e.preventDefault();let t=s.content;v()(t)&&(t=t(this.player)),this.menu=new Ne(this.player,{content:t});const{left:i,top:r}=n(e);this.menu.setPosition(i,r);const o=e=>{("click"!==e.type||3!==e.which&&2!==e.button)&&this.menu.dispose()};this.menu.on("dispose",(()=>{this.player.contextmenu.options.cancel=!0,this.player.removeChild(this.menu),a().off(document,["click","tap"],o),delete this.menu})),this.player.addChild(this.menu),a().on(document,["click","tap"],o)}}}var ze=i(608);const We={fraction:.5,collapsedWidth:300,floatTo:"right"};class Ge{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=Object.assign({},We,t),t.floatTo&&t.floatTo!==ze.rT.LEFT&&t.floatTo!==ze.rT.RIGHT&&(t.floatTo=We.floatTo),this.player=e;const i=this.player.el();let s=(0,G.sliceProperties)(t,"fraction"),n=null,r=!1,a=!1;this.init=()=>{u(),"object"==typeof this.player.ima&&h()};const o=e=>{const t=document.createElement("div");for(e.appendChild(t);e.firstChild!==t;)t.appendChild(e.firstChild);return t},l=()=>{window.removeEventListener("DOMContentLoaded",m,!1),window.removeEventListener("load",m,!1),window.removeEventListener("scroll",m,!1),window.removeEventListener("resize",m,!1)},c=()=>{window.addEventListener("DOMContentLoaded",m,!1),window.addEventListener("load",m,!1),window.addEventListener("scroll",m,!1),window.addEventListener("resize",m,!1)},u=()=>{this.player.on("play",m),this.player.on("play",c),this.player.on("dispose",l)},h=()=>{const e=i.getBoundingClientRect();n=o(i);const t=o(n);t.setAttribute("class","cld-video-player-floater-inner"),t.setAttribute("style","padding-bottom: "+100*e.height/e.width+"%;");const s=document.createElement("button");s.setAttribute("class","cld-video-player-floater-close"),s.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><polygon fill-rule="evenodd" points="370 7.41 368.59 6 364 10.59 359.41 6 358 7.41 362.59 12 358 16.59 359.41 18 364 13.41 368.59 18 370 16.59 365.41 12" transform="translate(-358 -6)"/></svg>',s.onclick=()=>{p(),f()},n.appendChild(s)},d=()=>{const{ima:e}=this.player;e&&e.adsActive&&e.getAdsManager().resize(r?n.clientWidth:i.clientWidth,r?n.clientHeight:i.clientHeight)},p=()=>{n.classList.remove("cld-video-player-floating"),r=!1,d()},f=()=>{l(),this.player.off("play",m),this.player.off("play",c)},m=()=>{(0,ue.isElementInViewport)(this.player.el(),{fraction:s.fraction})?r&&p():r||(n||h(),a||(()=>{const e=i.getBoundingClientRect();n.setAttribute("class","cld-video-player-floater cld-video-player-floater-bottom-".concat(t.floatTo)),n.setAttribute("style",["width: "+t.collapsedWidth+"px;","top: "+e.top+"px;","left: "+e.left+"px;","right: "+(document.documentElement.clientWidth-e.right)+"px;","bottom: "+(document.documentElement.clientHeight-e.bottom)+"px;"].join("")),a=!0})(),r=!0,setTimeout((()=>{n.classList.add("cld-video-player-floating"),d()})))}}}let Xe={},Ye={};const Ke=function(){function e(e,t){return this.player=e,this.options=t,this.initializeThumbnails(),this}return e.prototype.src=function(e){this.resetPlugin(),this.options.src=e,this.initializeThumbnails()},e.prototype.detach=function(){this.resetPlugin()},e.prototype.resetPlugin=function(){this.thumbnailHolder&&this.thumbnailHolder.parentNode.removeChild(this.thumbnailHolder),delete this.vttData,delete this.thumbnailHolder,delete this.lastStyle},e.prototype.initializeThumbnails=function(){this.options.src&&fetch(this.options.src).then((e=>e.text())).then((e=>{this.vttData=this.processVtt(e),this.setupThumbnailElement()}))},e.prototype.setupThumbnailElement=function(){const e=this.player.$(".vjs-progress-holder .vjs-mouse-display");this.thumbnailHolder=this.player.$(".vjs-vtt-thumbnail-display")||a().dom.createEl("div",void 0,{class:"vjs-vtt-thumbnail-display",style:"width: ".concat(this.vttData[0].css.width)}),this.thumbnailHolder.innerHTML="",this.thumbnailHolder.setAttribute("class","vjs-vtt-thumbnail-display"),e.appendChild(this.thumbnailHolder);const t=parseInt(this.vttData[0].css.width,10)/2,i=this.updateThumbnailStyle.bind(this);this.player.getDescendant(["controlBar","progressControl","seekBar","mouseTimeDisplay"]).update=function(e,s){const n=s*this.player_.duration(),r=e.width;i(n),this.getChild("timeTooltip").updateTime(e,s,n,(()=>{e.width*s<t?this.el_.style.left="".concat(t,"px"):e.width*s+t>r?this.el_.style.left="".concat(e.width-t,"px"):this.el_.style.left="".concat(e.width*s,"px")})),this.getChild("timeTooltip").write(a().time.formatTime(n))}},e.prototype.getStyleForTime=function(e){for(let t=0;t<this.vttData.length;++t){let i=this.vttData[t];if(e>=i.start&&e<i.end){if(i.css.url&&!Ye[i.css.url]){let e=new Image;e.src=i.css.url,Ye[i.css.url]=e}return i.css}}},e.prototype.updateThumbnailStyle=function(e){let t=this.getStyleForTime(e);if(t){if(this.thumbnailHolder.style.opacity="1",!this.lastStyle||this.lastStyle!==t){this.lastStyle=t;for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(this.thumbnailHolder.style[e]=t[e])}}else this.thumbnailHolder.style.opacity="0"},e.prototype.processVtt=function(e){let t=[];return e.split(/[\r\n][\r\n]/i).forEach((e=>{if(e.match(/([0-9]{2}:)?([0-9]{2}:)?[0-9]{2}(.[0-9]{3})?( ?--> ?)([0-9]{2}:)?([0-9]{2}:)?[0-9]{2}(.[0-9]{3})?[\r\n]{1}.*/gi)){let i=e.split(/[\r\n]/i),s=i[0].split(/ ?--> ?/i),n=s[0],r=s[1],a=i[1].split("/").pop(),o=this.getVttCss(a);t.push({start:this.getSecondsFromTimestamp(n),end:this.getSecondsFromTimestamp(r),css:o})}})),t},e.prototype.getPropsFromDef=function(e){let t=e.split(/#xywh=/i),i=t[0],s=t[1].match(/[0-9]+/gi);return{x:s[0],y:s[1],w:s[2],h:s[3],image:i}},e.prototype.getVttCss=function(e){let t={};e=[this.options.src.split(/([^\/]*)$/gi).shift().trim(),e.trim()].join("/");let i=this.getPropsFromDef(e);return t.background='url("'+i.image+'") no-repeat -'+i.x+"px -"+i.y+"px",t.width=i.w+"px",t.height=i.h+"px",t.url=i.image,t},e.prototype.getSecondsFromTimestamp=function(e){const[t,i,s]=e.split(":").map(parseFloat);return 60*t*60+60*i+s},e}();var Qe=i(7588),Je=i(3066);const Ze={aiHighlightsGraph:function(e){this.ready((()=>{!function(e,t){e.addClass("vjs-ai-highlights-graph"),e.aiHighlightsGraph=new W(e,t)}(this,a().obj.merge(z,e))}))},analytics:function(){new ce(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).init()},autoplayOnScroll:function(){new de(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).init()},cloudinary:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.chainTarget=e.chainTarget||this,this.cloudinary=new xe(this,e)},cloudinaryAnalytics:function(){new Ie(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).init()},colors:Pe.A,contextMenu:function(){new Ve(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).init()},floatingPlayer:function(){new Ge(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).init()},pacedTranscript:function(e){const t=this,i=t.cloudinary.source(),s={kind:e.kind||"captions",label:e.label||"Captions",default:e.default,srclang:e.srclang||"en",src:e.src||(0,fe.KA)(i.publicId(),(0,fe.lP)(t.cloudinary.cloudinaryConfig(),{resource_type:"raw"}))+".transcript",maxWords:e.maxWords,wordHighlight:e.wordHighlight,timeOffset:e.timeOffset||0};t.textTrackDisplay.el().classList.add("cld-paced-text-tracks");t.one("loadedmetadata",(()=>{(async()=>{try{const e=await fetch(s.src),i=(e=>{const t=[],i=e=>{let{startTime:i,endTime:n,text:r}=e;t.push({startTime:i+s.timeOffset,endTime:n+s.timeOffset,text:r})};return e.forEach((e=>{const n=e.words,r=s.maxWords||n.length;for(let e=0;e<n.length;e+=r)s.wordHighlight?n.slice(e,Math.min(e+r,n.length)).forEach(((t,s)=>{i({startTime:t.start_time,endTime:t.end_time,text:n.slice(e,e+r).map((e=>e===t?"<b>".concat(e.word,"</b>"):e.word)).join(" ")}),n[s+1]&&t.end_time<n[s+1].start_time&&i({startTime:t.end_time,endTime:n[s+1].start_time,text:n.slice(e,e+r).map((e=>e.word)).join(" ")})})):t.push({startTime:n[e].start_time,endTime:n[Math.min(e+r-1,n.length-1)].end_time,text:n.slice(e,e+r).map((e=>e.word)).join(" ")})})),t})(await e.json()),n=t.addRemoteTextTrack({kind:s.kind,label:s.label,srclang:s.srclang,default:s.default,mode:s.default?"showing":"disabled"});await new Promise((e=>setTimeout(e,100))),i.forEach((e=>{n.track.addCue(new VTTCue(e.startTime,e.endTime,e.text))}))}catch(e){console.error("Error loading transcription file:",e)}})()}))},vttThumbnails:function(e){this.ready((()=>{!function(e,t){e.addClass("vjs-vtt-thumbnails"),e.vttThumbnails=new Ke(e,t)}(this,a().obj.merge(Xe,e))}))},chapters:async function(e){const t=this;try{const{default:s}=await Promise.all([i.e(869),i.e(625)]).then(i.bind(i,9234));t.ready((()=>s(e,t)))}catch(e){console.error("Failed to load plugin:",e)}},imaPlugin:async function(e,t){await Promise.all([i.e(869),i.e(330)]).then(i.bind(i,2650));const s=v()(e.ads),n="object"==typeof google&&"object"==typeof google.ima;if(t.ads&&(!s||!n))return s||console.warn("contribAds is not loaded"),n||console.warn("imaSdk is not loaded"),!1;e.ima({id:e.el().id,adTagUrl:t.ads.adTagUrl,disableFlashAds:!0,prerollTimeout:t.ads.prerollTimeout||5e3,postrollTimeout:t.ads.postrollTimeout||5e3,showCountdown:!1!==t.ads.showCountdown,adLabel:t.ads.adLabel||"Advertisement",locale:t.ads.locale||"en",autoPlayAdBreaks:!1!==t.ads.autoPlayAdBreaks,debug:t.ads.denug}),Object.keys(t.ads).length>0&&"object"==typeof e.ima&&("first-video"===t.ads.adsInPlaylist?e.one(J.f.SOURCE_CHANGED,(()=>{e.ima.playAdBreak()})):e.on(J.f.SOURCE_CHANGED,(()=>{e.ima.playAdBreak()})))},playlist:async function(e){const t=this;try{const{default:s}=await Promise.all([i.e(869),i.e(33)]).then(i.bind(i,5826)),n=s(t,e);return t.cloudinary.playlist=n,n}catch(e){console.error("Failed to load plugin:",e)}},shoppable:async function(e,t){const{default:s}=await Promise.all([i.e(869),i.e(525)]).then(i.bind(i,9987));new s(e,t.shoppable).init()},styledTextTracks:async function(e){const t=this;try{t.ready((()=>((e,t)=>{const i={theme:e.theme||"default",fontFace:e.fontFace,fontSize:e.fontSize,gravity:e.gravity||"bottom",box:e.box,style:e.style,wordHighlightStyle:e.wordHighlightStyle},s=document.createElement("style");t.el_.appendChild(s);const n=t.textTrackDisplay.el().classList;n.forEach((e=>{e.startsWith("cld-styled-text-tracks")&&n.remove(e)})),n.add("cld-styled-text-tracks"),n.add("cld-styled-text-tracks-theme-".concat(i.theme)),i.gravity.split("-").forEach((e=>{n.add("cld-styled-text-tracks-gravity-".concat(e))}));const r=(e,t)=>{if(Object.entries(e)){const i=Object.entries(e).reduce(((e,t)=>{let[i,s]=t;return e+"".concat(i,": ").concat(s," !important; ")}),"");s.innerHTML+="".concat(t," { ").concat(i," } ")}},a=e=>{const i="\n .".concat((0,Je.playerClassPrefix)(t)," .vjs-text-track-cue > div,\n .").concat((0,Je.playerClassPrefix)(t)," ::cue\n ");r(e,i)};if(i.fontFace&&((0,Qe.fontFace)(t.textTrackDisplay.el(),i.fontFace),a({"font-family":i.fontFace})),i.box){const{x:e,y:s,width:n,height:a}=i.box;(e=>{const i="\n .".concat((0,Je.playerClassPrefix)(t)," .vjs-text-track-display.cld-styled-text-tracks,\n .").concat((0,Je.playerClassPrefix)(t)," ::-webkit-media-text-track-display\n ");r(e,i)})({translate:"".concat(e||0," ").concat(s||0),...n?{width:n}:void 0,...a?{height:a}:void 0})}i.fontSize&&a({"font-size":i.fontSize}),i.style&&a(i.style),i.wordHighlightStyle&&(r(i.wordHighlightStyle,".".concat((0,Je.playerClassPrefix)(t)," .cld-paced-text-tracks .vjs-text-track-cue b")),r(i.wordHighlightStyle,"video::cue(b)"))})(e,t)))}catch(e){console.error("Failed to load plugin:",e)}},interactionAreas:async function(e,t,s){try{const{interactionAreasService:n}=await Promise.all([i.e(869),i.e(404)]).then(i.bind(i,1066));n(e,t,s)}catch(e){console.error("Failed to load plugin:",e)}}},et=Ze;var tt=i(5104),it=i(7668);const st=e=>class extends e{constructor(){var e;super(),e=this;const t={data:{},handlers:{}};this.on=function(){for(var i=arguments.length,s=new Array(i),n=0;n<i;n++)s[n]=arguments[n];const r=s.length-1,a=s[r];return t.handlers[a]=function(t){t.Player=e;for(var i=arguments.length,s=new Array(i>1?i-1:0),n=1;n<i;n++)s[n-1]=arguments[n];a(t,...s)},s[r]=t.handlers[a],e.videojs.on(...s)},this.one=function(){for(var i=arguments.length,s=new Array(i),n=0;n<i;n++)s[n]=arguments[n];const r=s.length-1,a=s[r];return t.handlers[a]=function(i){i.Player=e;for(var s=arguments.length,n=new Array(s>1?s-1:0),r=1;r<s;r++)n[r-1]=arguments[r];a(i,...n),delete t.handlers[a]},s[r]=t.handlers[a],e.videojs.one(...s)},this.off=function(){for(var i=arguments.length,s=new Array(i),n=0;n<i;n++)s[n]=arguments[n];const r=s.length-1,a=s[r];s[r]=t.handlers[a];const o=e.videojs.off(...s);return delete t.handlers[a],o},this.trigger=function(){e.videojs.trigger(...arguments)}}};var nt=i(8838),rt=i(5779);const at=e=>!f()(e)||null,ot=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{sourceTypes:e.sourceTypes,autoShowRecommendations:e.autoShowRecommendations,fontFace:e.fontFace,posterOptions:at(e.posterOptions),posterOptionsPublicId:e.posterOptions&&at(e.posterOptions.publicId)}},lt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{chapters:e.chapters&&(e.chapters.url?"url":"inline-chapters"),recommendations:e.recommendations&&e.recommendations.length,shoppable:at(e.shoppable),shoppableProductsLength:e.shoppable&&e.shoppable.products&&e.shoppable.products.length,...e.info?{sourceInfoTitle:e.info.title,sourceInfoSubtitle:e.info.subtitle,sourceInfoDescription:e.info.description}:{},...e.textTracks?{textTracks:at(e.textTracks),pacedTextTracks:at(e.textTracks)&&JSON.stringify(e.textTracks||{}).includes('"maxWords":'),wordHighlight:at(e.textTracks)&&JSON.stringify(e.textTracks||{}).includes('"wordHighlight":'),...e.textTracks.options?{styledTextTracksTheme:e.textTracks.options.theme,styledTextTracksFont:e.textTracks.options.fontFace,styledTextTracksFontSize:e.textTracks.options.fontSize,styledTextTracksGravity:e.textTracks.options.gravity,styledTextTracksBox:at(e.textTracks.options.box),styledTextTracksStyle:at(e.textTracks.options.style),styledTextTracksWordHighlightStyle:at(e.textTracks.options.wordHighlightStyle)}:{}}:{}}},ct=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{adsAdTagUrl:e.adTagUrl,adsShowCountdown:e.showCountdown,adsAdLabel:e.adLabel,adsLocale:e.locale,adsPrerollTimeout:e.prerollTimeout,adsPostrollTimeout:e.postrollTimeout,adsAdsInPlaylist:e.adsInPlaylist}},ut=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{playlistWidgetDirection:e.direction,playlistWidgetTotal:e.total}},ht=e=>{if(window.dashjs&&e&&e.qualityLevels&&e.dash&&e.dash.mediaPlayer){const t=dashjs.MediaPlayer;e.dash.qualityLevels=e.qualityLevels(),e.dash.mediaPlayer.getAutoSwitchQualityFor=t=>{const i=e.dash.mediaPlayer.getSettings();return!i||i.streaming.abr.autoSwitchBitrate[t]},e.dash.mediaPlayer.setAutoSwitchQualityFor=(t,i)=>{const s=e.dash.mediaPlayer,n={streaming:{abr:{autoSwitchBitrate:{}}}};n.streaming.abr.autoSwitchBitrate[t]=i,s.updateSettings(n)},e.dash.mediaPlayer.on(t.events.PLAYBACK_METADATA_LOADED,(()=>{const t=e.dash.mediaPlayer.getBitrateInfoListFor("video"),i=e.dash.mediaPlayer.getBitrateInfoListFor("audio");if(t.length>0){const s=t[t.length-1].bitrate;e.dash.audioMapper=t.map((e=>Math.round(e.bitrate/s*(i.length-1)))),t.forEach((t=>{e.dash.qualityLevels.addQualityLevel({id:t.bitrate,width:t.width,height:t.height,bandwidth:t.bitrate,selected:!0,enabled:function(t){if(void 0===t)return void 0===this.selected||this.selected;if(this.selected=t,!0===t){var i;const t=null===(i=e.qualityLevels().levels_)||void 0===i?void 0:i.findIndex((e=>e.id===this.id));e.qualityLevels().selectedIndex_=t,e.qualityLevels().trigger({type:"change",selectedIndex:t})}}})}))}})),e.qualityLevels().on("change",(t=>{1===e.dash.qualityLevels.levels_.filter((e=>e.enabled)).length?(e.dash.mediaPlayer.setQualityFor("video",t.selectedIndex),e.dash.mediaPlayer.setQualityFor("audio",e.dash.audioMapper[t.selectedIndex])):e.dash.mediaPlayer.getAutoSwitchQualityFor("video")||(e.dash.mediaPlayer.setAutoSwitchQualityFor("video",!0),e.dash.mediaPlayer.setAutoSwitchQualityFor("audio",!0))}))}},dt=e=>{const t=e.controlBar.getChild("sourceMenuButton");if(t){const i=e.qualityLevels();if(i&&i.length>1){const e=i.levels_.filter((e=>e.enabled));if(1===e.length){const s=i.levels_.findIndex((t=>t.id===e[0].id));t.children()[1].children()[s].selected(!0)}else t.children()[1].children()[0].selected(!0),t.children()[1].children().forEach(((e,t)=>{t>0&&e.selected(!1)}));t.show()}else t.hide()}};Object.keys(et).forEach((e=>{a().registerPlugin(e,et[e])})),(0,nt.go)();class pt extends(tt.A.mixin(st)){static all(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return[...document.querySelectorAll(e)].map((e=>new pt(e,...i)))}get playerOptions(){return this.options.playerOptions}constructor(e,t,i){var s,n,r,o;super(),s=this,r=()=>{this.videojs.clearTimeout(this.reTryId)},(n="symbol"==typeof(o=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var s=i.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n="_clearTimeOut"))?o:o+"")in s?Object.defineProperty(s,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):s[n]=r,this.nbCalls=0,this.videoElement=(0,nt.iG)(e),this.options=(0,nt.Wi)(this.videoElement,t),this._videojsOptions=this.options.videojsOptions,this.videoElement.classList.add("video-js"),tt.A.fontFace(this.videoElement,this.playerOptions.cloudinary.fontFace),"init"===this._videojsOptions.bigPlayButton&&(this.videoElement.classList.add("vjs-big-play-button-init-only"),this._videojsOptions.bigPlayButton=!0),this.videojs=a()(this.videoElement,this._videojsOptions),this._isPlayerConfigValid=!0,this.playerOptions.debug&&(0,rt.I6)(this.options).then((e=>{if(!e)return this._isPlayerConfigValid=!1,void this.videojs.error("invalid player configuration")})),this._videojsOptions.muted&&this.videojs.volume(.4),this.playerOptions.fluid&&this.fluid(this.playerOptions.fluid),this._setCssClasses(),this._initPlugins(),this._initJumpButtons(),this._initPictureInPicture(),this._setVideoJsListeners(i)}getVPInstanceId(){return this.vpInstanceId||(this.vpInstanceId=d()),this.vpInstanceId}_sendInternalAnalytics(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Object.assign({},this.playerOptions,this.options.videojsOptions,e);if(t.allowUsageReport)try{const e=(s={aiHighlightsGraph:(i=t).aiHighlightsGraph,analytics:at(i.analytics),autoplay:i.autoplay,autoplayMode:i.autoplayMode,bigPlayButton:i.bigPlayButton,className:i.class,cloudinaryAnalytics:i.cloudinaryAnalytics,controls:i.controls,floatingWhenNotVisible:i.floatingWhenNotVisible,fluid:i.fluid,height:i.height,hideContextMenu:i.hideContextMenu,logoImageUrl:i.logoImageUrl,logoOnclickUrl:i.logoOnclickUrl,loop:i.loop,maxTries:i.maxTries,muted:i.muted,playbackRates:i.playbackRates,playedEventPercents:i.playedEventPercents,playedEventTimes:i.playedEventTimes,playsinline:i.playsinline,preload:i.preload,videoTimeout:i.videoTimeout,seekThumbnails:i.seekThumbnails,showJumpControls:i.showJumpControls,chaptersButton:i.chaptersButton,pictureInPictureToggle:i.pictureInPictureToggle,showLogo:i.showLogo,skin:i.skin,videoJS:at(i.videoJS),width:i.width,withCredentials:i.withCredentials,debug:i.debug,colors:i.colors&&JSON.stringify(i.colors),controlBar:JSON.stringify(i.controlBar)!==JSON.stringify(it.A.controlBar)&&JSON.stringify(i.controlBar),...ot(i.cloudinary),...lt(i.source),...ct(i.ads),...ut(i.playlistWidget)},Object.entries(s).reduce(((e,t)=>{let[i,s]=t;return s!==it.A[i]&&null!=s&&(e[i]=s),e}),{})),n=new URLSearchParams(e).toString(),r=new URLSearchParams({vpVersion:"2.0.2",vpInstanceId:this.getVPInstanceId(),cloudName:t.cloudinary.cloudinaryConfig.cloud_name}).toString();fetch("".concat("https://analytics-api-s.cloudinary.com","/video_player_source?").concat(n,"&").concat(r))}catch(e){}var i,s}_setVideoJsListeners(e){this.videojs.on(J.f.ERROR,(()=>{const e=this.videojs.error();if(e){const t=this._isPlayerConfigValid&&this.videojs.cloudinary.currentSourceType();[3===e.code&&a().browser.IS_SAFARI,4===e.code].includes(!0)&&[J.x.AUDIO,J.x.VIDEO].includes(t)?(this.videojs.error(null),tt.A.handleCldError(this,this.playerOptions)):this._clearTimeOut()}})),this.videojs.tech_.on(J.f.RETRY_PLAYLIST,(()=>{g()(this.videojs,"hls.stats.mediaRequestsErrored",0)>0&&(this._clearTimeOut(),tt.A.handleCldError(this,this.playerOptions))})),this.videojs.on(J.f.PLAY,this._clearTimeOut),this.videojs.on(J.f.CAN_PLAY_THROUGH,this._clearTimeOut),this.videojs.on(J.f.CLD_SOURCE_CHANGED,this._onSourceChange.bind(this)),this.videojs.ready((()=>{this._onReady(),e&&e(this)}))}_initPlugins(){this._initIma(),this._initAutoplay(),this._initContextMenu(),this._initPerSrcBehaviors(),this._initCloudinary(),this._initAnalytics(),this._initCloudinaryAnalytics(),this._initFloatingPlayer(),this._initColors(),this._initTextTracks(),this._initHighlightsGraph(),this._initSeekThumbs(),this._initChapters(),this._initInteractionAreas()}_isFullScreen(){return this.videojs.player().isFullscreen()}_initIma(){this.playerOptions.ads&&0!==Object.keys(this.playerOptions.ads).length&&et.imaPlugin(this.videojs,this.playerOptions)}setTextTracks(e){const t=this.videojs.remoteTextTracks();if(t)for(let e=t.tracks_.length-1;e>=0;e--)this.videojs.removeRemoteTextTrack(t.tracks_[e]);if(e){const t=Object.keys(e),i=[];for(const s of t)if("options"!==s){const t=Array.isArray(e[s])?e[s]:[e[s]];for(const e of t)i.push({...e,kind:s,label:e.label,srclang:e.language,default:!!e.default,src:e.url})}tt.A.addTextTracks(i,this.videojs),e.options&&this.videojs.styledTextTracks&&this.videojs.styledTextTracks(e.options)}}_initSeekThumbs(){this.playerOptions.seekThumbnails&&this.videojs.on(J.f.CLD_SOURCE_CHANGED,((e,t)=>{let{source:i}=t;if(!i||i.getType()===J.x.AUDIO||(0,fe.iT)(i.publicId())||this.videojs.activePlugins_&&this.videojs.activePlugins_.vr)return;const s=i.publicId(),n=Object.assign({},i.transformation());n&&(delete n.streaming_profile,delete n.video_codec),n.flags=n.flags||[],n.flags.push("sprite");const r=i.config().url("".concat(s,".vtt"),{transformation:n}).replace(/\.json$/,"");v()(this.videojs.vttThumbnails)?this.videojs.vttThumbnails({src:r}):this.videojs.vttThumbnails.src(r)}))}_initHighlightsGraph(){this.playerOptions.aiHighlightsGraph&&this.videojs.on(J.f.CLD_SOURCE_CHANGED,((e,t)=>{let{source:i}=t;if(!i||i.getType()===J.x.AUDIO||(0,fe.iT)(i.publicId()))return;const s=i.publicId(),r=n()(i.transformation(),["start_offset","end_offset","duration"]),a=Object.assign({},r);a.effect="preview",a.flags=a.flags||[],a.flags.push("getinfo");const o=i.config().url("".concat(s),{transformation:a}).replace(/\.json$/,"");v()(this.videojs.aiHighlightsGraph)?this.videojs.aiHighlightsGraph({src:o}):this.videojs.aiHighlightsGraph.src(o)}))}_initChapters(){!this.playerOptions.chaptersButton&&this.videojs.controlBar&&this.videojs.controlBar.removeChild("chaptersButton"),this.videojs.on(J.f.CLD_SOURCE_CHANGED,((e,t)=>{let{source:i}=t;f()(i._chapters)&&!0!==i._chapters||!this.videojs.chapters||(v()(this.videojs.chapters)?this.videojs.chapters(i._chapters):this.videojs.chapters.src(i._chapters))}))}_initInteractionAreas(){this.videojs.on(J.f.READY,(async()=>{this.options.videojsOptions.interactionDisplay&&this.videojs.interactionAreas&&this.videojs.interactionAreas(this,this.playerOptions,this._videojsOptions)}))}_initColors(){this.videojs.colors(this.playerOptions.colors?{colors:this.playerOptions.colors}:{})}_initQualitySelector(){this.videojs.controlBar&&!1!==this.playerOptions.qualitySelector&&(this.videojs.httpSourceSelector({default:"auto"}),this.videojs.on(J.f.LOADED_METADATA,(()=>{ht(this.videojs)})),this.videojs.on(J.f.LOADED_DATA,(()=>{dt(this.videojs)})))}_initTextTracks(){this.videojs.on(J.f.CLD_SOURCE_CHANGED,((e,t)=>{let{source:i}=t;this.setTextTracks(i._textTracks)}))}_initPerSrcBehaviors(){this.videojs.perSourceBehaviors&&this.videojs.perSourceBehaviors()}_initJumpButtons(){!this.playerOptions.showJumpControls&&this.videojs.controlBar&&(this.videojs.controlBar.removeChild("JumpForwardButton"),this.videojs.controlBar.removeChild("JumpBackButton"))}_initPictureInPicture(){!this.playerOptions.pictureInPictureToggle&&this.videojs.controlBar&&this.videojs.controlBar.removeChild("pictureInPictureToggle")}_initCloudinary(){const{cloudinaryConfig:e}=this.playerOptions.cloudinary;e.chainTarget=this,!1!==e.secure&&(0,fe.lP)(e,{secure:!0}),this.videojs.cloudinary(this.playerOptions.cloudinary)}_initAnalytics(){const e=this.playerOptions.analytics;if(!window.ga&&e&&this.playerOptions.debug)console.error("Google Analytics script is missing");else if(e){const t="object"==typeof e?e:{};this.videojs.analytics(t)}}_initCloudinaryAnalytics(){this.playerOptions.cloudinaryAnalytics&&(this.videojs.videoElement=this.videoElement,this.videojs.cloudinaryAnalytics())}reTryVideo(e,t){if(!this.isVideoReady())if(this.nbCalls<e)this.nbCalls++,this.reTryId=this.videojs.setTimeout((()=>this.reTryVideo(e,t)),t);else{let e=new Error("Video is not ready please try later");this.videojs.trigger("error",e)}}isVideoReady(){return this.videojs.readyState()>=(/iPad|iPhone|iPod/.test(navigator.userAgent)?1:4)&&(this.nbCalls=0,!0)}_initAutoplay(){"on-scroll"===this.playerOptions.autoplayMode&&this.videojs.autoplayOnScroll()}_initContextMenu(){this.playerOptions.hideContextMenu||this.videojs.contextMenu(it.A.contextMenu)}_initFloatingPlayer(){this.playerOptions.floatingWhenNotVisible!==ze.rT.NONE&&this.videojs.floatingPlayer({floatTo:this.playerOptions.floatingWhenNotVisible})}_setCssClasses(){this.videojs.addClass(tt.A.CLASS_PREFIX),this.videojs.addClass(tt.A.playerClassPrefix(this.videojs)),tt.A.setSkinClassPrefix(this.videojs,tt.A.skinClassPrefix(this.videojs))}_onReady(){this._setExtendedEvents();const e=this.playerOptions.source||this.playerOptions.publicId;e&&this.source(e,this.playerOptions)}_onSourceChange(){this._sendInternalAnalytics(),this._initQualitySelector()}_setExtendedEvents(){const e=[];this.playerOptions.playedEventPercents&&e.push({type:J.f.PERCENTS_PLAYED,percents:this.playerOptions.playedEventPercents}),this.playerOptions.playedEventTimes&&e.push({type:J.f.TIME_PLAYED,times:this.playerOptions.playedEventTimes}),e.push(J.f.SEEK,J.f.MUTE,J.f.UNMUTE,J.f.QUALITY_CHANGED);const t=new re(this.videojs,{events:e});Object.keys(t.events).forEach((e=>{t.on(e,((t,i)=>{this.videojs.trigger({type:e,eventData:i})}))}))}cloudinaryConfig(e){return this.videojs.cloudinary.cloudinaryConfig(e)}currentPublicId(){return this.videojs.cloudinary.currentPublicId()}currentSourceUrl(){return this.videojs.currentSource().src}currentPoster(){return this.videojs.cloudinary.currentPoster()}source(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(({publicId:e,options:t}=(0,fe.a5)(e,t)),!this._isPlayerConfigValid)return;if(this.playerOptions.debug&&(0,rt.Is)(t).then((e=>{e||this.videojs.error("invalid source configuration")})),this._sendInternalAnalytics({source:t}),e instanceof me.A)return this.videojs.cloudinary.source(e,t);t.shoppable&&this.videojs.shoppable&&this.videojs.shoppable(this.videojs,t),this.playerOptions.allowUsageReport&&(t.usageReport=!0),this.playerOptions.withCredentials&&(t.withCredentials=!0),clearTimeout(this.reTryId),this.nbCalls=0;const i=this.videojs.options_.maxTries||3,s=this.videojs.options_.videoTimeout||55e3;return this.reTryVideo(i,s),this.videojs.cloudinary.source(e,t)}posterOptions(e){return this.videojs.cloudinary.posterOptions(e)}skin(e){return void 0!==e&&b()(e)&&tt.A.setSkinClassPrefix(this.videojs,e),tt.A.skinClassPrefix(this.videojs)}playlist(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t=Object.assign({},t,{playlistWidget:this.playerOptions.playlistWidget}),this.videojs.one(J.f.READY,(async()=>{(await this.videojs.playlist(t))(e,t)})),this.videojs.cloudinary.playlist?this.videojs.cloudinary.playlist(e,t):this}playlistByTag(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t=Object.assign({},t,{playlistWidget:this.playerOptions.playlistWidget}),new Promise((i=>{this.videojs.one(J.f.READY,(async()=>{(await this.videojs.playlist(t))(await this.sourcesByTag(e,t),t),i(this)}))}))}sourcesByTag(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.videojs.cloudinary.sourcesByTag(e,t)}fluid(e){return void 0===e?this.videojs.fluid():(e?this.videojs.addClass(ze.gi):this.videojs.removeClass(ze.gi),this.videojs.fluid(e),this.videojs.trigger(J.f.FLUID,e),this)}play(){return this.playWasCalled=!0,this.videojs.play(),this}stop(){return this.pause(),this.currentTime(0),this}playPrevious(){return this.playlist().playPrevious(),this}playNext(){return this.playlist().playNext(),this}transformation(e){return this.videojs.cloudinary.transformation(e)}sourceTypes(e){return this.videojs.cloudinary.sourceTypes(e)}sourceTransformation(e){return this.videojs.cloudinary.sourceTransformation(e)}autoShowRecommendations(e){return this.videojs.cloudinary.autoShowRecommendations(e)}duration(){return this.videojs.duration()}height(e){return e?(this.videojs.height(e),this):this.videojs.height()}width(e){return e?(this.videojs.width(e),this):this.videojs.width()}volume(e){return e?(this.videojs.volume(e),this):this.videojs.volume()}mute(){return this.isMuted()||this.videojs.muted(!0),this}unmute(){return this.isMuted()&&this.videojs.muted(!1),this}isMuted(){return this.videojs.muted()}pause(){return this.videojs.pause(),this}currentTime(e){return e||0===e?(this.videojs.currentTime(e),this):this.videojs.currentTime()}maximize(){return this.isMaximized()||this.videojs.requestFullscreen(),this}exitMaximize(){return this.isMaximized()&&this.videojs.exitFullscreen(),this}isMaximized(){return this.videojs.isFullscreen()}dispose(){this.videojs.dispose()}controls(e){return void 0===e?this.videojs.controls():(this.videojs.controls(e),this)}ima(){return{playAd:this.videojs.ima.playAd}}loop(e){return void 0===e?this.videojs.loop():(this.videojs.loop(e),this)}el(){return this.videojs.el()}}const ft=pt,mt={cldDefault:JSON.parse('{"playerOptions":{},"sourceOptions":{}}'),cldLooping:JSON.parse('{"playerOptions":{"fluid":true,"controls":false,"muted":true,"floatingWhenNotVisible":"none","hideContextMenu":false,"autoplay":true,"loop":true},"sourceOptions":{}}'),cldAdaptiveStream:JSON.parse('{"playerOptions":{"fluid":true,"controls":true,"controlBar":{"fullscreenToggle":false},"showJumpControls":true,"hideContextMenu":false,"floatingWhenNotVisible":"none"},"sourceOptions":{"chapters":true,"sourceTypes":["hls"],"transformation":[{"effect":["volume:auto"]}]}}')};var gt=i(5072),yt=i.n(gt);const vt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;const i=n()((e=>{let t={};for(const i of Object.keys(e))t[yt()(i)]=e[i];return t})(e),ze._V);return Object.assign(e,{cloudinaryConfig:t||i})},_t=e=>(t,i,s)=>new ft(t,vt(i,e),s),bt=e=>(t,i,s)=>ft.all(t,vt(i,e),s),Tt=_t(),St=bt();const wt={...window.cloudinary||{},videoPlayer:Tt,videoPlayers:St,videoPlayerWithProfile:(e,t,i)=>(async(e,t,i)=>{if(!t.profile)throw new Error('VideoPlayerProfile method requires "profile" property');try{const s=await(async(e,t)=>Object.keys(mt).includes(t)?mt[t]:await fetch(t,{method:"GET"}).then((e=>e.json())))(t.cloud_name,t.profile),n=Object.assign({},s.playerOptions,t),r=new ft(e,n,i),a=r.source;return r.source=(e,t)=>{const i=Object.assign({},s.sourceOptions,t);return a.call(r,e,i)},r}catch(i){throw new ft(e,t).videojs.error("Invalid profile"),i}})(e,vt(t,undefined),i),Cloudinary:{new:e=>(console.warn("Cloudinary.new() is deprecated and will be removed. Please use cloudinary.videoPlayer() instead."),{videoPlayer:_t(e),videoPlayers:bt(e)})}};window.cloudinary=wt;const Et=wt,Ct=Et.videoPlayer,xt=Et.videoPlayers,kt=Et.videoPlayerWithProfile,At=Et},8033:(e,t,i)=>{i.d(t,{bo:()=>gi,dC:()=>vi,ww:()=>yi,lP:()=>pi,KA:()=>fi,iT:()=>hi,Nl:()=>di,N7:()=>mi,a5:()=>ui,M6:()=>_i});var s=i(7938),n=i.n(s),r=i(4319),a=i.n(r),o=i(5871),l=i(8953),c=i.n(l),u=i(7571),h=i.n(u),d=i(5226);function p(e){return"object"==typeof e&&null!==e}function f(e){let t="";return t="undefined"!=typeof window?btoa(encodeURI(decodeURI(e))):global.Buffer.from(e).toString("base64"),t.replace(/\+/g,"-").replace(/\//g,"_")}const m={"=":"eq","!=":"ne","<":"lt",">":"gt","<=":"lte",">=":"gte","&&":"and","||":"or","*":"mul","/":"div","+":"add","-":"sub","^":"pow"},g="res.cloudinary.com",y={aspect_ratio:"ar",aspectRatio:"ar",current_page:"cp",currentPage:"cp",duration:"du",face_count:"fc",faceCount:"fc",height:"h",initial_aspect_ratio:"iar",initial_height:"ih",initial_width:"iw",initialAspectRatio:"iar",initialHeight:"ih",initialWidth:"iw",initial_duration:"idu",initialDuration:"idu",page_count:"pc",page_x:"px",page_y:"py",pageCount:"pc",pageX:"px",pageY:"py",tags:"tags",width:"w"},v="(([0-9]*)\\.([0-9]+)|([0-9]+))([%pP])?",_=RegExp(`^${v}$`),b=RegExp(`(${v})\\.\\.(${v})`),T={font_weight:"normal",font_style:"normal",text_decoration:"none",text_align:"",stroke:"none"};function S(e,t=/([^a-zA-Z0-9_.\-\/:]+)/g){return e.replace(t,(function(e){return e.split("").map((function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})).join("")}))}const w=e=>e.replace(/[A-Z]/g,(e=>`_${e.toLowerCase()}`));class E{constructor(e){this.options={},null!=e&&["resourceType","type","publicId","format"].forEach((t=>{var i;return this.options[t]=null!=(i=e[t])?i:e[w(t)]}))}resourceType(e){return this.options.resourceType=e,this}type(e){return this.options.type=e,this}publicId(e){return this.options.publicId=e,this}getPublicId(){var e;return null!=(e=this.options.publicId)?e.replace(/\//g,":"):void 0}getFullPublicId(){return null!=this.options.format?this.getPublicId()+"."+this.options.format:this.getPublicId()}format(e){return this.options.format=e,this}toString(){let e=[];if(null==this.options.publicId)throw"Must supply publicId";return"image"!==this.options.resourceType&&e.push(this.options.resourceType),"upload"!==this.options.type&&e.push(this.options.type),e.push(this.getFullPublicId()),e.filter((e=>!!e)).join(":")}clone(){return new E(this.options)}}const C=E;function x(e){return null==e||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length}const k=function(e){return null!=e&&!isNaN(parseFloat(e))},A=class extends C{constructor(e){let t;super(e),t=["resourceType","resourceType","fontFamily","fontSize","fontWeight","fontStyle","textDecoration","textAlign","stroke","letterSpacing","lineSpacing","fontHinting","fontAntialiasing","text"],null!=e&&t.forEach((t=>{var i;return this.options[t]=null!=(i=e[t])?i:e[w(t)]})),this.options.resourceType="text"}resourceType(e){throw"Cannot modify resourceType for text layers"}type(e){throw"Cannot modify type for text layers"}format(e){throw"Cannot modify format for text layers"}fontFamily(e){return this.options.fontFamily=e,this}fontSize(e){return this.options.fontSize=e,this}fontWeight(e){return this.options.fontWeight=e,this}fontStyle(e){return this.options.fontStyle=e,this}textDecoration(e){return this.options.textDecoration=e,this}textAlign(e){return this.options.textAlign=e,this}stroke(e){return this.options.stroke=e,this}letterSpacing(e){return this.options.letterSpacing=e,this}lineSpacing(e){return this.options.lineSpacing=e,this}fontHinting(e){return this.options.fontHinting=e,this}fontAntialiasing(e){return this.options.fontAntialiasing=e,this}text(e){return this.options.text=e,this}toString(){var e,t,i,s,n,r,a,o,l;if(a=this.textStyleIdentifier(),null!=this.options.publicId&&(i=this.getFullPublicId()),null!=this.options.text){if(e=!x(i),t=!x(a),e&&t||!e&&!t)throw"Must supply either style parameters or a public_id when providing text parameter in a text overlay/underlay, but not both!";for(s=/\$\([a-zA-Z]\w*\)/g,r=0,l=S(this.options.text,/[,\/]/g),o="";n=s.exec(l);)o+=S(l.slice(r,n.index)),o+=n[0],r=n.index+n[0].length;o+=S(l.slice(r))}return[this.options.resourceType,a,i,o].filter((e=>!!e)).join(":")}textStyleIdentifier(){var e;if(e=[],"normal"!==this.options.fontWeight&&e.push(this.options.fontWeight),"normal"!==this.options.fontStyle&&e.push(this.options.fontStyle),"none"!==this.options.textDecoration&&e.push(this.options.textDecoration),e.push(this.options.textAlign),"none"!==this.options.stroke&&e.push(this.options.stroke),x(this.options.letterSpacing)&&!k(this.options.letterSpacing)||e.push("letter_spacing_"+this.options.letterSpacing),x(this.options.lineSpacing)&&!k(this.options.lineSpacing)||e.push("line_spacing_"+this.options.lineSpacing),x(this.options.fontAntialiasing)||e.push("antialias_"+this.options.fontAntialiasing),x(this.options.fontHinting)||e.push("hinting_"+this.options.fontHinting),!x(e.filter((e=>!!e)))){if(x(this.options.fontFamily))throw`Must supply fontFamily. ${e}`;if(x(this.options.fontSize)&&!k(this.options.fontSize))throw"Must supply fontSize."}return e.unshift(this.options.fontFamily,this.options.fontSize),e.filter((e=>!!e)).join("_")}};function I(e){const t=[];let i="";if(Object.keys(T).forEach((i=>{let s=T[i],n=e[i]||s;n!==s&&t.push(n)})),Object.keys(e).forEach((i=>{"letter_spacing"!==i&&"line_spacing"!==i||t.push(`${i}_${e[i]}`),"font_hinting"===i&&t.push(`${i.split("_").pop()}_${e[i]}`),"font_antialiasing"===i&&t.push(`antialias_${e[i]}`)})),e.hasOwnProperty("font_size")||!t||0===t.length){if(!e.font_size)throw"Must supply font_size for text in overlay/underlay";if(!e.font_family)throw"Must supply font_family for text in overlay/underlay";t.unshift(e.font_size),t.unshift(e.font_family),i=t.filter((e=>e)).join("_")}return i}function P(e){if(e instanceof A||e instanceof C)return e.toString();let t="";if(p(e))if("fetch"===e.resource_type||null!=e.url)t=`fetch:${f(e.url)}`;else{let i=e.public_id,s=e.format,n=e.resource_type||"image",r=e.type||"upload",a=e.text,o=null,l=[];const c=!i||0===i.length;if(c||(i=i.replace(new RegExp("/","g"),":"),null!=s&&(i=`${i}.${s}`)),a&&0!==a.length||"text"===n){if(n="text",r=null,o=I(e),a&&a.length>=0){const e=!o;if(!c&&!e||c&&e)throw"Must supply either style parameters or a public_id when providing text parameter in a text overlay/underlay";let t=/\$\([a-zA-Z]\w*\)/g,i=0,s=S(decodeURIComponent(a),/[,\/]/g);a="";for(let e=t.exec(s);e;e=t.exec(s))a+=S(s.slice(i,e.index)),a+=e[0],i=e.index+e[0].length;a+=encodeURIComponent(s.slice(i))}}else{if(c)throw"Must supply public_id for resource_type layer_parameter";"subtitles"===n&&(o=I(e))}"image"!==n&&l.push(n),"upload"!==r&&l.push(r),l.push(o),l.push(i),l.push(a),t=l.filter((e=>e)).join(":")}else t=/^fetch:.+/.test(e)?`fetch:${f(e.substr(6))}`:e;return t}function O(e){if("string"!=typeof e||0===e.length||e.match(/^!.+!$/))return e?e.toString():e;e=String(e);const t=new RegExp("((\\|\\||>=|<=|&&|!=|>|=|<|/|-|\\+|\\*|\\^)(?=[ _]))","g");e=e.replace(t,(e=>m[e]));const i="("+Object.keys(y).join("|")+")",s=new RegExp(`(\\$_*[^_ ]+)|${i}`,"g");return(e=e.replace(s,(e=>y[e]||e))).replace(/[ _]+/g,"_")}function L(e){switch(!0){case null==e:return[];case Array.isArray(e):return e;default:return[e]}}function D(e){if(!p(e))return e;if("remote"===e.function_type){const t=f(e.source).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return[e.function_type,t].join(":")}return[e.function_type,e.source].join(":")}function R(e){switch(e&&e.constructor){case String:return b.test(e)?e.split(".."):e;case Array:return[[e],e[e.length-1]];default:return[null,null]}}function N(e){const t=String(e).match(_);if(t){const e=t[5]?"p":"";return`${t[1]||t[4]}${e}`}return e}function M(e){switch(e&&e.constructor){case Object:{let t="";return"codec"in e&&(t=e.codec,"profile"in e&&(t+=":"+e.profile,"level"in e&&(t+=":"+e.level))),t}case String:return e;default:return null}}class j{constructor(e){this.expressions=[],null!=e&&this.expressions.push(j.normalize(e))}static new(e){return new this(e)}static normalize(e){var t,i,s;return null==e?e:(e=String(e),t=new RegExp("((\\|\\||>=|<=|&&|!=|>|=|<|/|-|\\+|\\*|\\^)(?=[ _]))","g"),e=e.replace(t,(e=>U[e])),i="("+Object.keys(B).join("|")+")",s=new RegExp(i,"g"),(e=e.replace(s,((t,i,s)=>"$"===e[s-1]?t:B[t]))).replace(/[ _]+/g,"_"))}serialize(){return j.normalize(this.expressions.join("_"))}toString(){return this.serialize()}getParent(){return this.parent}setParent(e){return this.parent=e,this}predicate(e,t,i){return null!=U[t]&&(t=U[t]),this.expressions.push(`${e}_${t}_${i}`),this}and(){return this.expressions.push("and"),this}or(){return this.expressions.push("or"),this}then(){return this.getParent().if(this.toString())}height(e,t){return this.predicate("h",e,t)}width(e,t){return this.predicate("w",e,t)}aspectRatio(e,t){return this.predicate("ar",e,t)}pageCount(e,t){return this.predicate("pc",e,t)}faceCount(e,t){return this.predicate("fc",e,t)}value(e){return this.expressions.push(e),this}static variable(e,t){return new this(e).value(t)}static width(){return new this("width")}static height(){return new this("height")}static initialWidth(){return new this("initialWidth")}static initialHeight(){return new this("initialHeight")}static aspectRatio(){return new this("aspectRatio")}static initialAspectRatio(){return new this("initialAspectRatio")}static pageCount(){return new this("pageCount")}static faceCount(){return new this("faceCount")}static currentPage(){return new this("currentPage")}static tags(){return new this("tags")}static pageX(){return new this("pageX")}static pageY(){return new this("pageY")}}const U={"=":"eq","!=":"ne","<":"lt",">":"gt","<=":"lte",">=":"gte","&&":"and","||":"or","*":"mul","/":"div","+":"add","-":"sub","^":"pow"},B={aspect_ratio:"ar",aspectRatio:"ar",current_page:"cp",currentPage:"cp","preview:duration":"preview:duration",duration:"du",face_count:"fc",faceCount:"fc",height:"h",initial_aspect_ratio:"iar",initial_duration:"idu",initial_height:"ih",initial_width:"iw",initialAspectRatio:"iar",initialDuration:"idu",initialHeight:"ih",initialWidth:"iw",page_count:"pc",page_x:"px",page_y:"py",pageCount:"pc",pageX:"px",pageY:"py",tags:"tags",width:"w"},F=j,q=class extends F{constructor(e){super(e)}height(e,t){return this.predicate("h",e,t)}width(e,t){return this.predicate("w",e,t)}aspectRatio(e,t){return this.predicate("ar",e,t)}pageCount(e,t){return this.predicate("pc",e,t)}faceCount(e,t){return this.predicate("fc",e,t)}duration(e,t){return this.predicate("du",e,t)}initialDuration(e,t){return this.predicate("idu",e,t)}};"undefined"!=typeof window&&null!==window&&window.location&&window.location.protocol;var $="__lodash_hash_undefined__",H=9007199254740991,V="[object Arguments]",z="[object Boolean]",W="[object Date]",G="[object Function]",X="[object GeneratorFunction]",Y="[object Map]",K="[object Number]",Q="[object Object]",J="[object Promise]",Z="[object RegExp]",ee="[object Set]",te="[object String]",ie="[object Symbol]",se="[object WeakMap]",ne="[object ArrayBuffer]",re="[object DataView]",ae="[object Float32Array]",oe="[object Float64Array]",le="[object Int8Array]",ce="[object Int16Array]",ue="[object Int32Array]",he="[object Uint8Array]",de="[object Uint8ClampedArray]",pe="[object Uint16Array]",fe="[object Uint32Array]",me=/\w*$/,ge=/^\[object .+?Constructor\]$/,ye=/^(?:0|[1-9]\d*)$/,ve={};ve[V]=ve["[object Array]"]=ve[ne]=ve[re]=ve[z]=ve[W]=ve[ae]=ve[oe]=ve[le]=ve[ce]=ve[ue]=ve[Y]=ve[K]=ve[Q]=ve[Z]=ve[ee]=ve[te]=ve[ie]=ve[he]=ve[de]=ve[pe]=ve[fe]=!0,ve["[object Error]"]=ve[G]=ve[se]=!1;var _e="object"==typeof global&&global&&global.Object===Object&&global,be="object"==typeof self&&self&&self.Object===Object&&self,Te=_e||be||Function("return this")(),Se="object"==typeof exports&&exports&&!exports.nodeType&&exports,we=Se&&"object"==typeof module&&module&&!module.nodeType&&module,Ee=we&&we.exports===Se;function Ce(e,t){return e.set(t[0],t[1]),e}function xe(e,t){return e.add(t),e}function ke(e,t,i,s){var n=-1,r=e?e.length:0;for(s&&r&&(i=e[++n]);++n<r;)i=t(i,e[n],n,e);return i}function Ae(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!`${e}`}catch(e){}return t}function Ie(e){var t=-1,i=Array(e.size);return e.forEach((function(e,s){i[++t]=[s,e]})),i}function Pe(e,t){return function(i){return e(t(i))}}function Oe(e){var t=-1,i=Array(e.size);return e.forEach((function(e){i[++t]=e})),i}var Le,De=Array.prototype,Re=Function.prototype,Ne=Object.prototype,Me=Te["__core-js_shared__"],je=(Le=/[^.]+$/.exec(Me&&Me.keys&&Me.keys.IE_PROTO||""))?`Symbol(src)_1.${Le}`:"",Ue=Re.toString,Be=Ne.hasOwnProperty,Fe=Ne.toString,qe=RegExp(`^${Ue.call(Be).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")}$`),$e=Ee?Te.Buffer:void 0,He=Te.Symbol,Ve=Te.Uint8Array,ze=Pe(Object.getPrototypeOf,Object),We=Object.create,Ge=Ne.propertyIsEnumerable,Xe=De.splice,Ye=Object.getOwnPropertySymbols,Ke=$e?$e.isBuffer:void 0,Qe=Pe(Object.keys,Object),Je=Tt(Te,"DataView"),Ze=Tt(Te,"Map"),et=Tt(Te,"Promise"),tt=Tt(Te,"Set"),it=Tt(Te,"WeakMap"),st=Tt(Object,"create"),nt=xt(Je),rt=xt(Ze),at=xt(et),ot=xt(tt),lt=xt(it),ct=He?He.prototype:void 0,ut=ct?ct.valueOf:void 0;function ht(e){var t=-1,i=e?e.length:0;for(this.clear();++t<i;){var s=e[t];this.set(s[0],s[1])}}function dt(e){var t=-1,i=e?e.length:0;for(this.clear();++t<i;){var s=e[t];this.set(s[0],s[1])}}function pt(e){var t=-1,i=e?e.length:0;for(this.clear();++t<i;){var s=e[t];this.set(s[0],s[1])}}function ft(e){this.__data__=new dt(e)}function mt(e,t,i){var s=e[t];Be.call(e,t)&&At(s,i)&&(void 0!==i||t in e)||(e[t]=i)}function gt(e,t){for(var i=e.length;i--;)if(At(e[i][0],t))return i;return-1}function yt(e,t,i,s,n,r,a){var o;if(s&&(o=r?s(e,n,r,a):s(e)),void 0!==o)return o;if(!Dt(e))return e;var l=It(e);if(l){if(o=function(e){var t=e.length,i=e.constructor(t);return t&&"string"==typeof e[0]&&Be.call(e,"index")&&(i.index=e.index,i.input=e.input),i}(e),!t)return function(e,t){var i=-1,s=e.length;for(t||(t=Array(s));++i<s;)t[i]=e[i];return t}(e,o)}else{var c=wt(e),u=c==G||c==X;if(Ot(e))return function(e,t){if(t)return e.slice();var i=new e.constructor(e.length);return e.copy(i),i}(e,t);if(c==Q||c==V||u&&!r){if(Ae(e))return r?e:{};if(o=function(e){return"function"!=typeof e.constructor||Ct(e)?{}:Dt(t=ze(e))?We(t):{};var t}(u?{}:e),!t)return function(e,t){return _t(e,St(e),t)}(e,function(e,t){return e&&_t(t,Rt(t),e)}(o,e))}else{if(!ve[c])return r?e:{};o=function(e,t,i,s){var n,r=e.constructor;switch(t){case ne:return vt(e);case z:case W:return new r(+e);case re:return function(e,t){var i=t?vt(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)}(e,s);case ae:case oe:case le:case ce:case ue:case he:case de:case pe:case fe:return function(e,t){var i=t?vt(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}(e,s);case Y:return function(e,t,i){return ke(t?i(Ie(e),!0):Ie(e),Ce,new e.constructor)}(e,s,i);case K:case te:return new r(e);case Z:return function(e){var t=new e.constructor(e.source,me.exec(e));return t.lastIndex=e.lastIndex,t}(e);case ee:return function(e,t,i){return ke(t?i(Oe(e),!0):Oe(e),xe,new e.constructor)}(e,s,i);case ie:return n=e,ut?Object(ut.call(n)):{}}}(e,c,yt,t)}}a||(a=new ft);var h=a.get(e);if(h)return h;if(a.set(e,o),!l)var d=i?function(e){return function(e,t,i){var s=t(e);return It(e)?s:function(e,t){for(var i=-1,s=t.length,n=e.length;++i<s;)e[n+i]=t[i];return e}(s,i(e))}(e,Rt,St)}(e):Rt(e);return function(e,t){for(var i=-1,s=e?e.length:0;++i<s&&!1!==t(e[i],i););}(d||e,(function(n,r){d&&(n=e[r=n]),mt(o,r,yt(n,t,i,s,r,e,a))})),o}function vt(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t}function _t(e,t,i,s){i||(i={});for(var n=-1,r=t.length;++n<r;){var a=t[n],o=s?s(i[a],e[a],a,i,e):void 0;mt(i,a,void 0===o?e[a]:o)}return i}function bt(e,t){var i,s,n=e.__data__;return("string"==(s=typeof(i=t))||"number"==s||"symbol"==s||"boolean"==s?"__proto__"!==i:null===i)?n["string"==typeof t?"string":"hash"]:n.map}function Tt(e,t){var i=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Dt(e)||(t=e,je&&je in t))&&(Lt(e)||Ae(e)?qe:ge).test(xt(e));var t}(i)?i:void 0}ht.prototype.clear=function(){this.__data__=st?st(null):{}},ht.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},ht.prototype.get=function(e){var t=this.__data__;if(st){var i=t[e];return i===$?void 0:i}return Be.call(t,e)?t[e]:void 0},ht.prototype.has=function(e){var t=this.__data__;return st?void 0!==t[e]:Be.call(t,e)},ht.prototype.set=function(e,t){return this.__data__[e]=st&&void 0===t?$:t,this},dt.prototype.clear=function(){this.__data__=[]},dt.prototype.delete=function(e){var t=this.__data__,i=gt(t,e);return!(i<0||(i==t.length-1?t.pop():Xe.call(t,i,1),0))},dt.prototype.get=function(e){var t=this.__data__,i=gt(t,e);return i<0?void 0:t[i][1]},dt.prototype.has=function(e){return gt(this.__data__,e)>-1},dt.prototype.set=function(e,t){var i=this.__data__,s=gt(i,e);return s<0?i.push([e,t]):i[s][1]=t,this},pt.prototype.clear=function(){this.__data__={hash:new ht,map:new(Ze||dt),string:new ht}},pt.prototype.delete=function(e){return bt(this,e).delete(e)},pt.prototype.get=function(e){return bt(this,e).get(e)},pt.prototype.has=function(e){return bt(this,e).has(e)},pt.prototype.set=function(e,t){return bt(this,e).set(e,t),this},ft.prototype.clear=function(){this.__data__=new dt},ft.prototype.delete=function(e){return this.__data__.delete(e)},ft.prototype.get=function(e){return this.__data__.get(e)},ft.prototype.has=function(e){return this.__data__.has(e)},ft.prototype.set=function(e,t){var i=this.__data__;if(i instanceof dt){var s=i.__data__;if(!Ze||s.length<199)return s.push([e,t]),this;i=this.__data__=new pt(s)}return i.set(e,t),this};var St=Ye?Pe(Ye,Object):function(){return[]},wt=function(e){return Fe.call(e)};function Et(e,t){return!!(t=null==t?H:t)&&("number"==typeof e||ye.test(e))&&e>-1&&e%1==0&&e<t}function Ct(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ne)}function xt(e){if(null!=e){try{return Ue.call(e)}catch(e){}try{return`${e}`}catch(e){}}return""}function kt(e){return yt(e,!0,!0)}function At(e,t){return e===t||e!=e&&t!=t}(Je&&wt(new Je(new ArrayBuffer(1)))!=re||Ze&&wt(new Ze)!=Y||et&&wt(et.resolve())!=J||tt&&wt(new tt)!=ee||it&&wt(new it)!=se)&&(wt=function(e){var t=Fe.call(e),i=t==Q?e.constructor:void 0,s=i?xt(i):void 0;if(s)switch(s){case nt:return re;case rt:return Y;case at:return J;case ot:return ee;case lt:return se}return t});var It=Array.isArray;function Pt(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=H}(e.length)&&!Lt(e)}var Ot=Ke||function(){return!1};function Lt(e){var t=Dt(e)?Fe.call(e):"";return t==G||t==X}function Dt(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Rt(e){return Pt(e)?function(e,t){var i=It(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Pt(e)}(e)&&Be.call(e,"callee")&&(!Ge.call(e,"callee")||Fe.call(e)==V)}(e)?function(e,t){for(var i=-1,s=Array(e);++i<e;)s[i]=t(i);return s}(e.length,String):[],s=i.length,n=!!s;for(var r in e)!t&&!Be.call(e,r)||n&&("length"==r||Et(r,s))||i.push(r);return i}(e):function(e){if(!Ct(e))return Qe(e);var t=[];for(var i in Object(e))Be.call(e,i)&&"constructor"!=i&&t.push(i);return t}(e)}const Nt=function(e){let t=e.match(Ut);return t=t.map((e=>e.charAt(0).toLocaleUpperCase()+e.slice(1).toLocaleLowerCase())),t[0]=t[0].toLocaleLowerCase(),t.join("")};var Mt,jt,Ut=(jt="[A-Z]",Mt="[a-z]+",RegExp(jt+"+(?="+jt+Mt+")|"+jt+"?"+Mt+"|"+jt+"+|[0-9]+","g"));function Bt(e){return e}function Ft(e,t){for(let i=0;i<e.length;i++)if(e[i]===t)return!0;return!1}const qt=class extends A{constructor(e){super(e),this.options.resourceType="subtitles"}};function $t(e){return"string"==typeof e||e instanceof String}const Ht=class extends C{constructor(e){super(e),$t(e)?this.options.url=e:(null!=e?e.url:void 0)&&(this.options.url=e.url)}url(e){return this.options.url=e,this}toString(){return`fetch:${f(this.options.url)}`}};function Vt(e){return e instanceof Function}const zt=["accessibility","api_secret","auth_token","cdn_subdomain","cloud_name","cname","format","placeholder","private_cdn","resource_type","secure","secure_cdn_subdomain","secure_distribution","shorten","sign_url","signature","ssl_detected","type","url_suffix","use_root_path","version"];function Wt(e,...t){return t.forEach((t=>{Object.keys(t).forEach((i=>{null!=t[i]&&(e[i]=t[i])}))})),e}class Gt{constructor(e,t,i=Bt){this.name=e,this.shortName=t,this.process=i}set(e){return this.origValue=e,this}serialize(){var e,t;return e=this.value(),t=Array.isArray(e)||p(e)||$t(e)?!x(e):null!=e,null!=this.shortName&&t?`${this.shortName}_${e}`:""}value(){return this.process(this.origValue)}static norm_color(e){return null!=e?e.replace(/^#/,"rgb:"):void 0}static build_array(e){return null==e?[]:Array.isArray(e)?e:[e]}static process_video_params(e){var t;switch(e.constructor){case Object:return t="","codec"in e&&(t=e.codec,"profile"in e&&(t+=":"+e.profile,"level"in e&&(t+=":"+e.level))),t;case String:return e;default:return null}}}class Xt extends Gt{constructor(e,t,i=".",s=void 0){super(e,t,s),this.sep=i}serialize(){if(null!=this.shortName){let e=this.value();if(x(e))return"";if($t(e))return`${this.shortName}_${e}`;{let t=e.map((e=>Vt(e.serialize)?e.serialize():e)).join(this.sep);return`${this.shortName}_${t}`}}return""}value(){return Array.isArray(this.origValue)?this.origValue.map((e=>this.process(e))):this.process(this.origValue)}set(e){return null==e||Array.isArray(e)?super.set(e):super.set([e])}}class Yt extends Gt{constructor(e,t="t",i=".",s=void 0){super(e,t,s),this.sep=i}serialize(){let e="";const t=this.value();if(x(t))return e;if((i=t).length&&i.every($t)){const i=t.join(this.sep);x(i)||(e=`${this.shortName}_${i}`)}else e=t.map((e=>$t(e)&&!x(e)?`${this.shortName}_${e}`:Vt(e.serialize)?e.serialize():p(e)&&!x(e)?new ri(e).serialize():void 0)).filter((e=>e));var i;return e}set(e){return this.origValue=e,Array.isArray(this.origValue)?super.set(this.origValue):super.set([this.origValue])}}class Kt extends Gt{constructor(e,t,i=Kt.norm_range_value){super(e,t,i)}static norm_range_value(e){let t=String(e).match(new RegExp("^(([0-9]*)\\.([0-9]+)|([0-9]+))([%pP])?$"));if(t){let i=null!=t[5]?"p":"";e=(t[1]||t[4])+i}return e}}class Qt extends Gt{constructor(e,t,i=Bt){super(e,t,i)}serialize(){return this.value()}}class Jt extends Gt{value(){if(null==this.origValue)return"";let e;if(this.origValue instanceof C)e=this.origValue;else if(p(this.origValue)){let t=function(e,t){var i,s;i={};for(let n in e)s=e[n],t&&(n=t(n)),x(n)||(i[n]=s);return i}(this.origValue,Nt);e="text"===t.resourceType||null!=t.text?new A(t):"subtitles"===t.resourceType?new qt(t):"fetch"===t.resourceType||null!=t.url?new Ht(t):new C(t)}else e=$t(this.origValue)?/^fetch:.+/.test(this.origValue)?new Ht(this.origValue.substr(6)):this.origValue:"";return e.toString()}static textStyle(e){return new A(e).textStyleIdentifier()}}class Zt{constructor(e){let t,i;t=void 0,i={},this.toOptions=e=>{let t={};if(null==e&&(e=!0),Object.keys(i).forEach((e=>t[e]=i[e].origValue)),Wt(t,this.otherOptions),e&&!x(this.chained)){let e=this.chained.map((e=>e.toOptions()));e.push(t),t={},Wt(t,this.otherOptions),t.transformation=e}return t},this.setParent=e=>(t=e,null!=e&&this.fromOptions("function"==typeof e.toOptions?e.toOptions():void 0),this),this.getParent=()=>t,this.param=(e,t,s,n,r)=>(null==r&&(r=Vt(n)?n:Bt),i[t]=new Gt(t,s,r).set(e),this),this.rawParam=function(e,t,s,n,r){return r=si(arguments),i[t]=new Qt(t,s,r).set(e),this},this.rangeParam=function(e,t,s,n,r){return r=si(arguments),i[t]=new Kt(t,s,r).set(e),this},this.arrayParam=function(e,t,s,n=":",r=[],a=void 0){return a=si(arguments),i[t]=new Xt(t,s,n,a).set(e),this},this.transformationParam=function(e,t,s,n=".",r=void 0,a=void 0){return a=si(arguments),i[t]=new Yt(t,s,n,a).set(e),this},this.layerParam=function(e,t,s){return i[t]=new Jt(t,s).set(e),this},this.getValue=function(e){let t=i[e]&&i[e].value();return null!=t?t:this.otherOptions[e]},this.get=function(e){return i[e]},this.remove=function(e){var t;switch(!1){case null==i[e]:return t=i[e],delete i[e],t.origValue;case null==this.otherOptions[e]:return t=this.otherOptions[e],delete this.otherOptions[e],t;default:return null}},this.keys=function(){var e;return function(){var t;for(e in t=[],i)null!=e&&t.push(e.match(ei)?e:w(e));return t}().sort()},this.toPlainObject=function(){var e,t,s;for(t in e={},i)e[t]=i[t].value(),p(e[t])&&(e[t]=kt(e[t]));return x(this.chained)||((s=this.chained.map((e=>e.toPlainObject()))).push(e),e={transformation:s}),e},this.chain=function(){var e;return 0!==Object.getOwnPropertyNames(i).length&&(e=new this.constructor(this.toOptions(!1)),this.resetTransformations(),this.chained.push(e)),this},this.resetTransformations=function(){return i={},this},this.otherOptions={},this.chained=[],this.fromOptions(e)}fromOptions(e={}){if(e instanceof Zt)this.fromTransformation(e);else{($t(e)||Array.isArray(e))&&(e={transformation:e}),(e=kt(e)).if&&(this.set("if",e.if),delete e.if);for(let t in e){let i=e[t];null!=i&&(t.match(ei)?"$attr"!==t&&this.set("variable",t,i):this.set(t,i))}}return this}fromTransformation(e){return e instanceof Zt&&e.keys().forEach((t=>this.set(t,e.get(t).origValue))),this}set(e,...t){let i;return i=Nt(e),Ft(ai,i)?this[i].apply(this,t):this.otherOptions[e]=t[0],this}hasLayer(){return this.getValue("overlay")||this.getValue("underlay")}serialize(){var e,t,i,s,n,r,a,o,l,c,u,h,d,p,f,m,g,y;for(c=this.chained.map((e=>e.serialize())),s=this.keys(),p=null!=(n=this.get("transformation"))?n.serialize():void 0,e=null!=(r=this.get("if"))?r.serialize():void 0,m=function(e){var t,i,s,n,r;if(Array.isArray(e)){for(n=[],t=0,i=e.length;t<i;t++)[s,r]=e[t],n.push(`${s}_${F.normalize(r)}`);return n}return e}(null!=(a=this.get("variables"))?a.value():void 0),y=["transformation","if","variables"],s=s.filter((e=>!y.includes(e))),g=[],h=[],t=0,i=s.length;t<i;t++)(u=s[t]).match(ei)?g.push(u+"_"+F.normalize(null!=(o=this.get(u))?o.value():void 0)):h.push(null!=(l=this.get(u))?l.serialize():void 0);switch(!1){case!$t(p):h.push(p);break;case!Array.isArray(p):c=c.concat(p)}return h=function(){var e,t,i;for(i=[],e=0,t=h.length;e<t;e++)f=h[e],(Array.isArray(f)&&!x(f)||!Array.isArray(f)&&f)&&i.push(f);return i}(),h=g.sort().concat(m).concat(h.sort()),"if_end"===e?h.push(e):x(e)||h.unshift(e),x(d=h.filter((e=>!!e)).join(ii))||c.push(d),c.filter((e=>!!e)).join(ti)}static listNames(){return ai}toHtmlAttributes(){let e,t,i,s,n,r,a,o;return i={},Object.keys(this.otherOptions).forEach((t=>{r=this.otherOptions[t],o=w(t),Ft(oi,o)||Ft(zt,o)||(e=/^html_/.test(t)?t.slice(5):t,i[e]=r)})),this.keys().forEach((e=>{/^html_/.test(e)&&(i[Nt(e.slice(5))]=this.getValue(e))})),this.hasLayer()||this.getValue("angle")||Ft(["fit","limit","lfill"],this.getValue("crop"))||(a=null!=(s=this.get("width"))?s.origValue:void 0,t=null!=(n=this.get("height"))?n.origValue:void 0,parseFloat(a)>=1&&null==i.width&&(i.width=a),parseFloat(t)>=1&&null==i.height&&(i.height=t)),i}static isValidParamName(e){return ai.indexOf(Nt(e))>=0}toHtml(){var e;return null!=(e=this.getParent())&&"function"==typeof e.toHtml?e.toHtml():void 0}toString(){return this.serialize()}clone(){return new Zt(this.toOptions(!0))}}const ei=/^\$[a-zA-Z0-9]+$/,ti="/",ii=",";function si(e){var t;return Vt(t=null!=e?e[e.length-1]:void 0)?t:void 0}function ni({function_type:e,source:t}){return"remote"===e?[e,btoa(t)].join(":"):"wasm"===e?[e,t].join(":"):void 0}class ri extends Zt{constructor(e){super(e)}static new(e){return new ri(e)}angle(e){return this.arrayParam(e,"angle","a",".",F.normalize),this}audioCodec(e){return this.param(e,"audio_codec","ac"),this}audioFrequency(e){return this.param(e,"audio_frequency","af"),this}aspectRatio(e){return this.param(e,"aspect_ratio","ar",F.normalize),this}background(e){return this.param(e,"background","b",Gt.norm_color),this}bitRate(e){return this.param(e,"bit_rate","br"),this}border(e){return this.param(e,"border","bo",(e=>p(e)?`${(e=Object.assign({},{color:"black",width:2},e)).width}px_solid_${Gt.norm_color(e.color)}`:e))}color(e){return this.param(e,"color","co",Gt.norm_color),this}colorSpace(e){return this.param(e,"color_space","cs"),this}crop(e){return this.param(e,"crop","c"),this}customFunction(e){return this.param(e,"custom_function","fn",(()=>ni(e)))}customPreFunction(e){if(!this.get("custom_function"))return this.rawParam(e,"custom_function","",(()=>(e=ni(e))?`fn_pre:${e}`:e))}defaultImage(e){return this.param(e,"default_image","d"),this}delay(e){return this.param(e,"delay","dl"),this}density(e){return this.param(e,"density","dn"),this}duration(e){return this.rangeParam(e,"duration","du"),this}dpr(e){return this.param(e,"dpr","dpr",(e=>(null!=(e=e.toString())?e.match(/^\d+$/):void 0)?e+".0":F.normalize(e)))}effect(e){return this.arrayParam(e,"effect","e",":",F.normalize),this}else(){return this.if("else")}endIf(){return this.if("end")}endOffset(e){return this.rangeParam(e,"end_offset","eo"),this}fallbackContent(e){return this.param(e,"fallback_content"),this}fetchFormat(e){return this.param(e,"fetch_format","f"),this}format(e){return this.param(e,"format"),this}flags(e){return this.arrayParam(e,"flags","fl","."),this}gravity(e){return this.param(e,"gravity","g"),this}fps(e){return this.param(e,"fps","fps",(e=>$t(e)?e:Array.isArray(e)?e.join("-"):e))}height(e){return this.param(e,"height","h",(()=>this.getValue("crop")||this.getValue("overlay")||this.getValue("underlay")?F.normalize(e):null))}htmlHeight(e){return this.param(e,"html_height"),this}htmlWidth(e){return this.param(e,"html_width"),this}if(e=""){var t,i,s,n,r;switch(e){case"else":return this.chain(),this.param(e,"if","if");case"end":for(this.chain(),t=s=this.chained.length-1;s>=0&&"end"!==(i=this.chained[t].getValue("if"))&&(null==i||(n=ri.new().if(i),this.chained[t].remove("if"),r=this.chained[t],this.chained[t]=ri.new().transformation([n,r]),"else"===i));t=s+=-1);return this.param(e,"if","if");case"":return q.new().setParent(this);default:return this.param(e,"if","if",(e=>q.new(e).toString()))}}keyframeInterval(e){return this.param(e,"keyframe_interval","ki"),this}ocr(e){return this.param(e,"ocr","ocr"),this}offset(e){var t,i;if([i,t]=Vt(null!=e?e.split:void 0)?e.split(".."):Array.isArray(e)?e:[null,null],null!=i&&this.startOffset(i),null!=t)return this.endOffset(t)}opacity(e){return this.param(e,"opacity","o",F.normalize),this}overlay(e){return this.layerParam(e,"overlay","l"),this}page(e){return this.param(e,"page","pg"),this}poster(e){return this.param(e,"poster"),this}prefix(e){return this.param(e,"prefix","p"),this}quality(e){return this.param(e,"quality","q",F.normalize),this}radius(e){return this.arrayParam(e,"radius","r",":",F.normalize),this}rawTransformation(e){return this.rawParam(e,"raw_transformation"),this}size(e){let t,i;if(Vt(null!=e?e.split:void 0))return[i,t]=e.split("x"),this.width(i),this.height(t)}sourceTypes(e){return this.param(e,"source_types"),this}sourceTransformation(e){return this.param(e,"source_transformation")}startOffset(e){return this.rangeParam(e,"start_offset","so"),this}streamingProfile(e){return this.param(e,"streaming_profile","sp"),this}transformation(e){return this.transformationParam(e,"transformation","t"),this}underlay(e){return this.layerParam(e,"underlay","u"),this}variable(e,t){return this.param(t,e,e),this}variables(e){return this.arrayParam(e,"variables"),this}videoCodec(e){return this.param(e,"video_codec","vc",Gt.process_video_params),this}videoSampling(e){return this.param(e,"video_sampling","vs"),this}width(e){return this.param(e,"width","w",(()=>this.getValue("crop")||this.getValue("overlay")||this.getValue("underlay")?F.normalize(e):null)),this}x(e){return this.param(e,"x","x",F.normalize),this}y(e){return this.param(e,"y","y",F.normalize),this}zoom(e){return this.param(e,"zoom","z",F.normalize),this}}const ai=["angle","audioCodec","audioFrequency","aspectRatio","background","bitRate","border","color","colorSpace","crop","customFunction","customPreFunction","defaultImage","delay","density","duration","dpr","effect","else","endIf","endOffset","fallbackContent","fetchFormat","format","flags","gravity","fps","height","htmlHeight","htmlWidth","if","keyframeInterval","ocr","offset","opacity","overlay","page","poster","prefix","quality","radius","rawTransformation","size","sourceTypes","sourceTransformation","startOffset","streamingProfile","transformation","underlay","variable","variables","videoCodec","videoSampling","width","x","y","zoom"],oi=ai.map(w).concat(["api_key","api_secret","callback","cdn_subdomain","cloud_name","cname","private_cdn","protocol","resource_type","responsive","responsive_class","responsive_use_breakpoints","responsive_width","round_dpr","secure","secure_cdn_subdomain","secure_distribution","shorten","type","upload_preset","url_suffix","use_root_path","version","externalLibraries","max_timeout_ms"]),li=ri;function ci(e){if("string"==typeof e)return e;if(e instanceof li)return e.toString();if(Array.isArray(e))return e.map((e=>ci(e))).filter((e=>e)).join("/");let t,i;const s=e.size,n=e.overlay||e.underlay,r=e.crop,a=L(e.angle).join("."),o=(e.background||"").replace(/^#/,"rgb:"),l=(e.color||"").replace(/^#/,"rgb:"),c=L(e.flags||[]).join("."),u=void 0===e.dpr?e.dpr:function(e){let t=e.toString();return(null!=t?t.match(/^\d+$/):void 0)?t+".0":F.normalize(t)}(e.dpr),h=P(e.overlay),d=function(e){let t=e;if(!t)return t;if(Array.isArray(t)||(t=[t]),0===t.length||t.length>4)throw new Error("Radius array should contain between 1 and 4 values");if(t.findIndex((e=>null===e))>=0)throw new Error("Corner: Cannot be null");return t.map(O).join(":")}(e.radius),f=P(e.underlay),m=function(e){return e?"if_"+O(e):e}(e.if),g=D(e.custom_function),y=function(e){const t=D(e);return"string"==typeof t?`pre:${t}`:null}(e.custom_pre_function);let v=e.fps,_=[],b=L(e.transformation||[]),T=e.effect;const S=n||a||"fit"===r||"limit"===r;if(s){const[e,n]=s.split("x");t=e,i=n}else t=e.width,i=e.height;t&&(0===t.toString().indexOf("auto")||S||parseFloat(t.toString())<1)&&delete e.width,i&&(S||parseFloat(i.toString())<1)&&delete e.height;const w=b.some((e=>"object"==typeof e));w?b=b.map((e=>p(e)?ci(e):ci({transformation:e}))).filter((e=>e)):(_=b.join("."),b=[]),Array.isArray(T)?T=T.join(":"):p(T)&&(T=Object.entries(T).map((([e,t])=>`${e}:${t}`)));let E=e.border;p(E)?E=`${null!=E.width?E.width:2}px_solid_${(null!=E.color?E.color:"black").replace(/^#/,"rgb:")}`:/^\d+$/.exec(E)&&(e.border=E,E=void 0),Array.isArray(v)&&(v=v.join("-"));const C={a:O(a),ar:O(e.aspect_ratio),b:o,bo:E,c:r,co:l,dpr:O(u),e:O(T),fl:c,fn:g||y,fps:v,h:O(i),ki:O(e.keyframe_interval),l:h,o:O(e.opacity),q:O(e.quality),r:d,t:_,u:f,w:O(t),x:O(e.x),y:O(e.y),z:O(e.zoom),ac:e.audio_codec,af:e.audio_frequency,br:e.bit_rate,cs:e.color_space,d:e.default_image,dl:e.delay,dn:e.density,du:N(e.duration),eo:N(e.end_offset||k(e.end_offset)?e.end_offset:R(e.offset)[1]),f:e.fetch_format,g:e.gravity,pg:e.page,p:e.prefix,so:N(e.start_offset||k(e.start_offset)?e.start_offset:R(e.offset)[0]),sp:e.streaming_profile,vc:M(e.video_codec),vs:e.video_sampling},x=[m,Object.entries(e).filter((([e,t])=>e.startsWith("$"))).map((([e,t])=>`${e}_${O(t)}`)).sort().concat((e.variables||[]).map((([e,t])=>`${e}_${O(t)}`))).join(","),Object.entries(C).filter((([e,t])=>!(null==t||"string"==typeof t&&0===t.length||Array.isArray(t)&&0===t.length))).map((([e,t])=>`${e}_${t}`)).sort().join(","),e.raw_transformation].filter((e=>e)).join(",");return x&&b.push(x),b.join("/")}const ui=function(e,t){let{tolerateMissingId:i=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(c()(e)){const s=Object.assign({},e);if(e=(0,o.sliceAndUnsetProperties)(s,"publicId").publicId,!h()(e)&&!i)throw new Error("Source is missing 'publicId'.");t&&(t=Object.assign({},s,t))}return{publicId:e,options:t}},hi=e=>d.P8.test(e),di=(e,t)=>{let i=e,s=t;return"object"==typeof e&&(i=e.src),"object"==typeof t&&(s=t.src),/^\/\//.test(i)&&(s=s.slice(s.indexOf("//"))),/^\/\//.test(s)&&(i=i.slice(i.indexOf("//"))),i===s},pi=(e,t)=>Object.assign(e,t),fi=(e,t)=>function(e,t){let i;"fetch"===t.type&&null==t.fetch_format&&(t.fetch_format=t.format);let s=t.type,n=t.resource_type||"image",r=t.version;const a="boolean"!=typeof t.force_version||t.force_version,o=(t.long_url_signature,t.format),l=t.cloud_name;if(!l)throw"cloud_name must be provided in the configuration";const c=t.private_cdn,u=t.secure_distribution,h=t.secure,d=(t.cdn_subdomain,t.secure_cdn_subdomain,t.cname),p=t.shorten,f=t.sign_url,m=(t.api_secret,t.url_suffix),y=t.use_root_path,v=t.auth_token,_=/^(image|raw)\/([a-z0-9_]+)\/v(\d+)\/([^#]+)$/.exec(e);_&&(n=_[1],s=_[2],r=_[3],e=_[4]);const b=e;if(null==e)return b;if(e=e.toString(),null===s&&e.match(/^https?:\//i))return b;[n,s]=function(e,t,i,s,n){if(null==t&&(t="upload"),null!=i)if("image"===e&&"upload"===t)e="images",t=null;else if("image"===e&&"private"===t)e="private_images",t=null;else if("image"===e&&"authenticated"===t)e="authenticated_images",t=null;else if("raw"===e&&"upload"===t)e="files",t=null;else{if("video"!==e||"upload"!==t)throw new Error("URL Suffix only supported for image/upload, image/private, image/authenticated, video/upload and raw/upload");e="videos",t=null}if(s){if(!("image"===e&&"upload"===t||"images"===e&&null==t))throw new Error("Root path only supported for image/upload");e=null,t=null}return n&&"image"===e&&"upload"===t&&(e="iu",t=null),[e,t]}(n,s,m,y,p),[e,i]=function(e,t,i){let s;if((e=e.replace(/([^:])\/\//g,"$1/")).match(/^https?:\//i))s=e=S(e);else{if(s=e=encodeURIComponent(decodeURIComponent(e)).replace(/%3A/g,":").replace(/%2F/g,"/"),i){if(i.match(/[\.\/]/))throw new Error("url_suffix should not include . or /");e=e+"/"+i}null!=t&&(e=e+"."+t,s=s+"."+t)}return[e,s]}(e,o,m),null==r&&a&&i.indexOf("/")>=0&&!i.match(/^v[0-9]+/)&&!i.match(/^https?:\//)&&(r=1),r=null!=r?`v${r}`:null;const T=ci(kt(t)).replace(/([^:])\/\//g,"$1/");if(f&&!v){let e=[T,i].filter((function(e){return null!=e&&""!==e})).join("/");try{for(let t=0;e!==decodeURIComponent(e)&&t<10;t++)e=decodeURIComponent(e)}catch(e){}}return[function(e,t,i,s,n,r,a,o){let l;if(0===t.indexOf("/"))return"/res"+t;let c=!i;return a?(null!=o&&"cloudinary-a.akamaihd.net"!==o||(o=i?t+"-res.cloudinary.com":g),null==c&&(c=o===g),l="https://"+o):l=r?"http://"+r:"http://"+[i?t+"-":"","res",".cloudinary.com"].join(""),c&&(l+="/"+t),l}(0,l,c,0,0,d,h,u),n,s,T,r,e].filter((function(e){return null!=e&&""!==e})).join("/").replace(" ","%20")}(e,a()(t,["chainTarget"])),mi=(e,t)=>{const i=(e=>"Transformation"===e.constructor.name&&e.toOptions)(e)?e.toOptions():e;return new li(i).fromOptions(t).toOptions()},gi={NO_SUPPORTED_MEDIA:6,CUSTOM:10,UNKNOWN_CUSTOMER:11,RESOURCE_NOT_FOUND:12,PRIVATE_RESOURCE:13,UNAUTHENTICATED:14},yi=e=>{let{errorMsg:t,publicId:i,cloudName:s,statusCode:n}=e;const r="Video cannot be played";let a={code:gi.CUSTOM,message:"".concat(r).concat(t?"- "+t:""),statusCode:n},o=t.toLowerCase();return o.startsWith("unknown customer")&&(a.code=gi.UNKNOWN_CUSTOMER,a.message="".concat(r," Unknown cloud-name ").concat(s)),o.startsWith("resource not found")&&(a.code=gi.RESOURCE_NOT_FOUND,a.message="".concat(r," Public ID ").concat(i," not found")),o.startsWith("private resource")&&(a.code=gi.PRIVATE_RESOURCE,a.message="".concat(r," Private video")),o.startsWith("unauthenticated access")&&(a.message="".concat(r," Requires authentication"),a.code=gi.UNAUTHENTICATED),a},vi={VP9:"vp9",HEV1:"hev1",H265:"h265",H264:"h264"},_i=()=>{n().use("video/auto",(()=>({async setSource(e,t){const{headers:i}=await fetch(e.src,{method:"HEAD",credentials:e.withCredentials?"include":"omit"});return t(null,{src:e.src,type:i.get("content-type")})}})))}},6770:(e,t,i)=>{i.d(t,{A:()=>a});var s=i(8033),n=i(5871),r=i(7311);const a=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,r,a,o;i=this,a=null,(r="symbol"==typeof(o=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var s=i.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r="_transformation"))?o:o+"")in i?Object.defineProperty(i,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):i[r]=a;const{publicId:l,options:c}=(0,s.a5)(e,t),{cloudinaryConfig:u}=(0,n.sliceAndUnsetProperties)(c,"cloudinaryConfig"),{transformation:h}=(0,n.sliceAndUnsetProperties)(c,"transformation"),{queryParams:d}=(0,n.sliceAndUnsetProperties)(c,"queryParams");if(!u)throw new Error('Source is missing "cloudinaryConfig".');this.publicId=()=>l,this.cloudinaryConfig=()=>u,this.resourceConfig=()=>c,this.queryParams=()=>d,this.getType=()=>this._type,this.transformation(h)}transformation(e){return e&&(this._transformation=e),this._transformation}config(){const e=this.cloudinaryConfig();return{cloud_name:e.cloudName,url:(t,i)=>{if((0,s.iT)(t))return t;const n=(0,s.N7)(this.resourceConfig(),i);return(0,s.KA)(t,{...e,...n})}}}url(){let{transformation:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=this.config().url(this.publicId(),{transformation:e||this.transformation()}),i=this.queryParams()?(0,r.y)(this.queryParams()):"";return"".concat(t).concat(i)}}},4650:(e,t,i)=>{i.d(t,{A:()=>l});var s=i(6770),n=i(8033);const r=RegExp("\\.(".concat(["jpg","png","gif","webp"].join("|"),")$$")),a={resource_type:"image",type:"upload",transformation:[]};class o extends s.A{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};({publicId:e,options:t}=(0,n.a5)(e,t)),e=e.replace(r,""),t=Object.assign({},a,t),super(e,t),this._type="ImageSource"}}const l=o},5226:(e,t,i)=>{i.d(t,{IH:()=>c,P8:()=>a,Tf:()=>n,XY:()=>o,cE:()=>r,uf:()=>l,vD:()=>s});const s={format:"jpg",resource_type:"video"},n={resource_type:"video",type:"upload",transformation:[],sourceTransformation:{},sourceTypes:["auto"],recommendations:null,info:{},interactionAreas:{},chapters:{}},r=RegExp("\\.(".concat(["3g2","3gp","avi","flv","m3u8","ts","m2ts","mts","mov","mkv","mp4","mpeg","mpd","mxf","ogv","webm","wmv"].join("|"),")$$")),a=RegExp("https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)"),o={hls:"application/x-mpegURL",dash:"application/dash+xml",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"},l=["hls","dash","mpd","m3u8"],c={hls:"m3u8",dash:"mpd"}},5381:(e,t,i)=>{i.d(t,{A:()=>v});var s=i(5871),n=i(7311),r=i(2160),a=i.n(r),o=i(1104),l=i(5226),c=i(8033),u=i(7571),h=i.n(u),d=i(5004);const p=e=>{var t,i;return!!e&&(h()(e)?(i=e)&&Object.values(c.dC).some((e=>i.includes(e))):!!(e=>["video_codec","streaming_profile"].some((t=>(0,d.isKeyInTransformation)(e,t))))(e)||!(null===(t=e.some)||void 0===t||!t.call(e,(e=>p(e)))))};var f=i(6770),m=i(4650);let g=0;class y extends f.A{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=(0,c.iT)(e);let{publicId:n,options:r}=(0,c.a5)(e,t);i||(n=n.replace(l.cE,"")),r=Object.assign({},l.Tf,r),r.poster||(r.poster=Object.assign({publicId:n},l.vD));const{poster:a,sourceTypes:u,sourceTransformation:h,info:d,recommendations:p,textTracks:f,withCredentials:m,interactionAreas:y,chapters:v}=(0,s.sliceAndUnsetProperties)(r,"poster","sourceTypes","sourceTransformation","info","recommendations","textTracks","withCredentials","interactionAreas","chapters");super(n,r),this._sourceTypes=null,this._recommendations=null,this._textTracks=null,this._poster=null,this._info=null,this._sourceTransformation=null,this._interactionAreas=null,this._chapters=null,this._type=o.x.VIDEO,this.isRawUrl=i,this._rawTransformation=r.raw_transformation,this.withCredentials=!!m,this.getInitOptions=()=>t,this.poster(a),this.sourceTypes(u),this.sourceTransformation(h),this.info(d),this.interactionAreas(y),this.chapters(v),this.recommendations(p),this.textTracks(f),this.objectId=g++}textTracks(e){return void 0===e?this._textTracks:(this._textTracks=e,this)}recommendations(e){return void 0===e?this._recommendations:(this._recommendations=e,this)}sourceTypes(e){return e?(this._sourceTypes=e,this):this._sourceTypes}info(e){return e?(this._info=e,this):this._info}interactionAreas(e){return e?(this._interactionAreas=e,this):this._interactionAreas}chapters(e){return e?(this._chapters=e,this):this._chapters}sourceTransformation(e){return e?(this._sourceTransformation=e,this):this._sourceTransformation}poster(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e?e instanceof m.A?(this._poster=e,this):(({publicId:e,options:t}=(0,c.a5)(e,t,{tolerateMissingId:!0})),!e&&this.isRawUrl?null:(e||(e=this.publicId(),t=Object.assign({},t,l.vD)),t.cloudinaryConfig=t.cloudinaryConfig||this.cloudinaryConfig(),this._poster=new m.A(e,t),this)):this._poster}contains(e){return this.generateSources().some((t=>(0,c.Nl)(t,e)))}generateSources(){if(this.isRawUrl){const e="auto"===this.sourceTypes()[0]?null:this.sourceTypes()[0];return[this.generateRawSource(this.publicId(),e)]}return this.sourceTypes().map((e=>{const t=this.sourceTransformation()[e]||this.transformation(),i=function(e){e=e.toLowerCase().split("/").shift();let t=l.IH[e];return t||(t=e.split("/").shift()),t}(e),s=l.uf.includes(i),r={};t&&(r.transformation=a()(t)),Object.assign(r,{resource_type:"video",format:i});const[o,u]=function(e){const[t,i]=e.toLowerCase().split("/"),s=l.XY[t]||"video/".concat(t);let n=[s];return i&&(n=[s,{video_codec:i}]),n}(e);!u||p(r.transformation)||p(this._rawTransformation)||(r.transformation=(0,c.N7)(r.transformation,u)),"auto"===r.format&&(delete r.format,r.transformation=(0,c.N7)(r.transformation,{fetch_format:"auto:video"})),s&&(JSON.stringify(r.transformation||{}).includes('"streaming_profile":')||(r.transformation=(0,c.N7)(r.transformation,{streaming_profile:"auto"})));const h=this.queryParams()?(0,n.y)(this.queryParams()):"",d=this.config().url(this.publicId(),r),f=d.indexOf("?")>-1?h.replace("?","&"):h;return{type:o,src:d+f,cldSrc:this,isAdaptive:s,withCredentials:this.withCredentials}}))}generateRawSource(e,t){t=t||e.split(".").pop();const i=l.uf.includes(t);return{type:t=l.XY[t]?l.XY[t]:t?"video/".concat(t):null,src:e,cldSrc:this,isAdaptive:i,withCredentials:this.withCredentials}}getInteractionAreas(){return this._interactionAreas}}const v=y},4500:(e,t,i)=>{i.d(t,{A:()=>l,w:()=>a});var s=i(3066),n=i(8838);const r={colorsDark:{base:"#000000",accent:"#0D9AFF",text:"#FFFFFF"},colorsLight:{base:"#FFFFFF",accent:"#0D9AFF",text:"#000000"}},a=e=>(0,n.T4)(e)?r.colorsLight:r.colorsDark;class o{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.player=e;const i=a(this.player.options_);t.colors=Object.assign({},i,t.colors),this.init=()=>{n(o("\n .PLAYER-CLASS-PREFIX {\n --color-accent: --accent-color;\n --color-base: --base-color;\n --color-text: --text-color;\n\n color: --text-color;\n }\n\n .PLAYER-CLASS-PREFIX .vjs-time-tooltip,\n .PLAYER-CLASS-PREFIX .vjs-mouse-display:after,\n .PLAYER-CLASS-PREFIX .vjs-play-progress:after {\n color: --text-color;\n background-color: --base-color;\n }\n\n .PLAYER-CLASS-PREFIX .vjs-slider {\n background-color: rgba(--text-color, 0.2);\n }\n\n .PLAYER-CLASS-PREFIX .vjs-load-progress {\n background: rgba(--text-color, 0.3);\n }\n\n .PLAYER-CLASS-PREFIX .vjs-volume-level {\n background: --text-color;\n }\n\n .PLAYER-CLASS-PREFIX .vjs-play-progress {\n background: --accent-color;\n }\n\n .PLAYER-CLASS-PREFIX .vjs-volume-vertical {\n background-color: rgba(--base-color, 0.7);\n }\n\n .PLAYER-CLASS-PREFIX .vjs-volume-panel-horizontal .vjs-control:before {\n border-color: transparent transparent rgba(--accent-color, 0.4) transparent;\n }\n\n .PLAYER-CLASS-PREFIX .vjs-volume-panel-horizontal .vjs-volume-level:before {\n border-color: transparent transparent --accent-color transparent;\n }\n\n .PLAYER-CLASS-PREFIX .vjs-progress-control:before {\n color: --base-color;\n }\n\n .PLAYER-CLASS-PREFIX .vjs-highlights-graph-display {\n color: rgba(--text-color, 0.3);\n }\n\n .PLAYER-CLASS-PREFIX .vjs-title-bar {\n color: --text-color;\n background-image: linear-gradient(rgba(--base-color, 0.4), rgba(255, 255, 255, 0) 100%);\n }\n\n .PLAYER-CLASS-PREFIX .vjs-recommendations-overlay {\n color: --text-color;\n background-color: rgba(--base-color, 0.4);\n }\n\n .PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item {\n box-shadow: 0 0.5em 1.2em 0px --base-color;\n color: --text-color;\n border: 1px solid --text-color !important;\n position: relative;\n }\n\n .PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item:active,\n .PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item:hover {\n border: 1px solid --accent-color !important;\n }\n\n .PLAYER-CLASS-PREFIX .vjs-menu-content .vjs-menu-item:active,\n .PLAYER-CLASS-PREFIX .vjs-menu-content .vjs-menu-item:focus,\n .PLAYER-CLASS-PREFIX .vjs-menu-content .vjs-menu-item:hover {\n color: --text-color;\n background-color: rgba(--text-color, 0.2);\n }\n\n .PLAYER-CLASS-PREFIX.vjs-ad-playing .vjs-progress-control .vjs-play-progress {\n background: --base-color;\n }\n\n .PLAYER-CLASS-PREFIX.cld-plw-layout {\n background-color: --base-color;\n }\n\n .PLAYER-CLASS-PREFIX .cld-plw-item-info-wrap {\n color: --text-color;\n }\n\n .PLAYER-CLASS-PREFIX .cld-video-player-floater-close polygon {\n fill: --base-color;\n }\n\n .PLAYER-CLASS-PREFIX .cld-spbl-product-hotspot:after {\n background: --base-color;\n box-shadow: 0 0 0 4px --accent-color, 0 0 0 8px rgba(--text-color, 0.24);\n }\n\n .PLAYER-CLASS-PREFIX .cld-spbl-product-tooltip {\n color: --base-color;\n background: --text-color;\n }\n\n .PLAYER-CLASS-PREFIX .base-color-semi-bg {\n background: rgba(--base-color, 0.7);\n }\n\n .PLAYER-CLASS-PREFIX .text-color-semi-bg {\n background: rgba(--text-color, 0.7);\n }\n\n .PLAYER-CLASS-PREFIX .text-color-text {\n color: --text-color;\n }\n\n .PLAYER-CLASS-PREFIX .base-color-text {\n color: --base-color;\n }\n\n .PLAYER-CLASS-PREFIX .accent-color-text {\n color: --accent-color;\n }\n")),"light"===this.player.options_.skin?n(o("\n .PLAYER-CLASS-PREFIX.cld-video-player-skin-light .base-color-bg,\n .PLAYER-CLASS-PREFIX.cld-video-player-skin-light .vjs-control-bar,\n .PLAYER-CLASS-PREFIX.cld-video-player-skin-light .vjs-big-play-button,\n .PLAYER-CLASS-PREFIX.cld-video-player-skin-light .vjs-menu-button .vjs-menu-content {\n background-color: rgba(--base-color, 0.8);\n }\n\n .PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item.vjs-recommendations-overlay-item-primary .vjs-recommendations-overlay-item-primary-content {\n background-color: --base-color;\n }\n\n .PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item.vjs-recommendations-overlay-item-primary:active .vjs-recommendations-overlay-item-primary-content,\n .PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item.vjs-recommendations-overlay-item-primary:hover .vjs-recommendations-overlay-item-primary-content {\n color: --base-color;\n background-color: rgba(--accent-color, 0.8);\n }\n\n .PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item.vjs-recommendations-overlay-item-secondary:active div,\n .PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item.vjs-recommendations-overlay-item-secondary:hover div {\n color: --base-color;\n background-color: rgba(--accent-color, 0.8);\n }\n\n .PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item.vjs-recommendations-overlay-item-secondary div {\n background: --base-color;\n }\n\n .PLAYER-CLASS-PREFIX .vjs-upcoming-video {\n border: 1px solid --text-color;\n }\n\n .PLAYER-CLASS-PREFIX .vjs-upcoming-video .vjs-upcoming-video-bar {\n background-color: --base-color;\n }\n\n .PLAYER-CLASS-PREFIX .vjs-context-menu-ui .vjs-menu-content {\n background-color: --base-color;\n }\n\n .PLAYER-CLASS-PREFIX .cld-plw-item-info-wrap {\n color: --text-color;\n }\n\n @media only screen and (max-width: 768px) {\n .PLAYER-CLASS-PREFIX.cld-plw-vertical .cld-plw-item-info-wrap {\n color: --accent-color;\n }\n }\n")):n(o("\n .PLAYER-CLASS-PREFIX.cld-video-player-skin-dark .base-color-bg,\n .PLAYER-CLASS-PREFIX.cld-video-player-skin-dark .vjs-control-bar,\n .PLAYER-CLASS-PREFIX.cld-video-player-skin-dark .vjs-big-play-button,\n .PLAYER-CLASS-PREFIX.cld-video-player-skin-dark .vjs-menu-button .vjs-menu-content {\n background-color: rgba(--base-color, 0.6);\n }\n\n .PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item.vjs-recommendations-overlay-item-primary .vjs-recommendations-overlay-item-primary-content {\n background-color: rgba(--base-color, 0.6);\n }\n\n .PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item.vjs-recommendations-overlay-item-secondary div {\n background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent 80%);\n }\n\n .PLAYER-CLASS-PREFIX .vjs-upcoming-video {\n border: 1px solid rgba(--text-color, 0.5);\n }\n\n .PLAYER-CLASS-PREFIX .vjs-upcoming-video .vjs-upcoming-video-bar {\n background-color: rgba(--base-color, 0.6);\n }\n\n .PLAYER-CLASS-PREFIX .vjs-context-menu-ui .vjs-menu-content {\n background-color: rgba(--base-color, 0.6);\n }\n"))};const n=e=>{const t=document.createElement("style");t.innerHTML=e,this.player.el_.appendChild(t)},r=e=>{e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(e,t,i,s){return t+t+i+i+s+s}));const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?parseInt(t[1],16)+", "+parseInt(t[2],16)+", "+parseInt(t[3],16):null},o=e=>e.replace(/PLAYER\-CLASS\-PREFIX/g,(0,s.playerClassPrefix)(this.player)).replace(/rgba\(\-\-base\-color/g,"rgba("+r(t.colors.base)).replace(/rgba\(\-\-accent\-color/g,"rgba("+r(t.colors.accent)).replace(/rgba\(\-\-text\-color/g,"rgba("+r(t.colors.text)).replace(/\-\-base\-color/g,t.colors.base).replace(/\-\-accent\-color/g,t.colors.accent).replace(/\-\-text\-color/g,t.colors.text)}}function l(){new o(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).init()}},5004:(e,t,i)=>{i.r(t),i.d(t,{addTextTracks:()=>c,handleCldError:()=>o,isKeyInTransformation:()=>l});var s=i(8033),n=i(9339);const r={method:"head"},a={method:"get",credentials:"include",headers:{"Content-Range":"bytes=0-0"}},o=(e,t)=>{const i=t.fetchErrorUsingGet?a:r,n=e.videojs.cloudinary.getCurrentSources();n.length>0?Promise.all(n.map((e=>fetch(e.src,i)))).then((t=>{const i=(e=>e.reduce(((e,t)=>{if(t.status>=200&&t.status<399&&""!==t.url){const i=new URL(t.url);e.push(i.host+i.pathname)}return e}),[]))(t),r=t[0];if(i.length){const r=((e,t)=>e.filter((e=>{const i=new URL(e.src);return-1!==t.indexOf(i.host+i.pathname)&&!0!==e.try})))(n,i);r&&r.length?((e,t)=>{e.options.playerOptions.debug&&console.log("Trying sources: ",t),t.forEach((e=>{e.try=!0})),e.videojs.autoplay(e.videojs.autoplay()||e.playWasCalled),e.videojs.src(t)})(e,r):e.videojs.error({code:s.bo.NO_SUPPORTED_MEDIA,message:"No supported media sources",statusCode:t.status})}else((e,t)=>{e.videojs.error((0,s.ww)({errorMsg:t.headers.get("x-cld-error")||"",publicId:e.currentPublicId(),cloudName:e.cloudinaryConfig().cloud_name,error:t,statusCode:t.status}))})(e,r)})).catch((t=>{e.videojs.error({code:7,message:t&&t.message?t.message:"Failed to test sources"})})):e.videojs.error({code:s.bo.NO_SUPPORTED_MEDIA,message:"No supported media sources"})},l=(e,t)=>!!(e&&t&&(Array.isArray(e)?(0,n.I)(e,(e=>l(e,t))):e.getValue?e.getValue(t):e[t])),c=(e,t)=>{e.forEach((e=>{(e.maxWords||e.wordHighlight)&&t.pacedTranscript?t.pacedTranscript(e):e.src&&fetch(e.src,r).then((i=>{i.status>=200&&i.status<=399&&t.addRemoteTextTrack(e,!0)}))}))}},1104:(e,t,i)=>{i.d(t,{f:()=>s,x:()=>n});const s={READY:"ready",PLAY:"play",PLAYING:"playing",PAUSE:"pause",SEEK:"seek",SEEKING:"seeking",MUTE:"mute",UNMUTE:"unmute",PAUSE_NO_SEEK:"pausenoseek",ERROR:"error",TIME_UPDATE:"timeupdate",RETRY_PLAYLIST:"retryplaylist",CAN_PLAY_THROUGH:"canplaythrough",CLD_SOURCE_CHANGED:"cldsourcechanged",SOURCE_CHANGED:"sourcechanged",LOADED_METADATA:"loadedmetadata",LOADED_DATA:"loadeddata",REFRESH_TEXT_TRACKS:"refreshTextTracks",PLAYLIST_CREATED:"playlistcreated",UP_COMING_VIDEO_SHOW:"upcomingvideoshow",UP_COMING_VIDEO_HIDE:"upcomingvideohide",PLAYLIST_ITEM_CHANGED:"playlistitemchanged",VOLUME_CHANGE:"volumechange",FLUID:"fluid",PLAYLIST_PANEL:"PlaylistPanel",ENDED:"ended",RESIZE:"resize",START:"start",VIDEO_LOAD:"videoload",PRODUCT_BAR_MIN:"productBarMin",SHOW_PRODUCTS_OVERLAY:"showProductsOverlay",SHOPPABLE_ITEM_CHANGED:"shoppableitemchanged",FULL_SCREEN_CHANGE:"fullscreenchange",PERCENTS_PLAYED:"percentsplayed",TIME_PLAYED:"timeplayed",PLAYER_LOAD:"playerload",DISPOSE:"dispose",QUALITY_CHANGED:"qualitychanged"},n={AUDIO:"AudioSource",VIDEO:"VideoSource"}},3066:(e,t,i)=>{i.r(t),i.d(t,{CLASS_PREFIX:()=>r,playerClassPrefix:()=>o,setSkinClassPrefix:()=>u,skinClass:()=>l,skinClassPrefix:()=>c});var s=i(7668),n=i(9339);const r="cld-video-player",a="".concat(r,"-skin-"),o=e=>"".concat(r,"-").concat(e.id_),l=e=>"".concat(a).concat(e),c=e=>(0,n.I)(e.el().classList,(e=>e.startsWith(a))),u=(e,t)=>{const i=c(e),n=!!t&&t.replace(a,"");let r="";r=n?l(n):e.options_.skin?l(e.options_.skin):l(s.A.skin),r!==i&&(i&&e.removeClass(i),e.addClass(r)),n&&e.options_.skin!==n&&(e.options_.skin=n)}},7134:(e,t,i)=>{i.d(t,{It:()=>u,cu:()=>c,n:()=>o,q2:()=>h});var s=i(2160),n=i.n(s),r=i(9040),a=i.n(r);const o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;const s=document.createElement(e);for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&s.setAttribute(e,t[e]);return n()(i).forEach((e=>l(e,s))),s},l=(e,t)=>{if(a()(e))t.appendChild(e);else if(e&&"object"!=typeof e){const i=document.createTextNode(e);t.appendChild(i)}},c=(e,t)=>{for(let i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e.style[i]=t[i]);return e},u=e=>{const t=Array.isArray(e.children)?e.children.map(u):e.children,i=a()(e)?e:o(e.tag,e.attr,t);return e.onClick&&(e.event={name:"click",callback:e.onClick}),e.event&&i.addEventListener(e.event.name,e.event.callback,!1),e.style&&c(i,e.style),i},h=(e,t,i)=>(e.addEventListener(t,i,!1),()=>{e.removeEventListener(t,i,!1)})},9339:(e,t,i)=>{function s(e,t){return Array.prototype.find&&Array.isArray(e)?e.find(t):function(e,t){for(let i=0;i<e.length;i++){const s=e[i];if(t(s,i,e))return[s,i]}return[void 0,-1]}(e,t)[0]}i.d(t,{I:()=>s})},7588:(e,t,i)=>{i.r(t),i.d(t,{fontFace:()=>r});var s=i(5303),n=i.n(s);const r=(e,t)=>{void 0===t&&(t="Inter"),t&&"inherit"!==t?(n().load({google:{families:[t]}}),e.style.fontFamily=t):"inherit"===t&&(e.style.fontFamily="inherit")}},5104:(e,t,i)=>{i.d(t,{A:()=>y});var s={};i.r(s),i.d(s,{mixin:()=>l});var n={};i.r(n),i.d(n,{normalizeAttributes:()=>g});var r=i(5871),a=i(3171),o=i(5004);function l(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return t.reduce(((e,t)=>t(e)),class{})}var c=i(7588),u=i(3066),h=i(3686),d=i.n(h);const p=/^(data-cld-)(\w+)/,f={},m=e=>function(e){let t=null;if(""===e)return!0;try{t=JSON.parse(e)}catch(e){}return t||(t=Number(e),t||e)}(e),g=e=>{const t={};if(e&&e.attributes&&e.attributes.length>0){const i=e.attributes;for(let s=i.length-1;s>=0;s--){let n=i[s].name,r=i[s].value;n.match(p)&&(n=d()(n.replace(p,"$2"))),r="boolean"==typeof e[n]?null!==r:(f[n]||m)(r),t[n]=r}}return t},y=Object.assign({},r,a,o,c,s,u,n)},3171:(e,t,i)=>{function s(e){const t=e.getBoundingClientRect(),i=document.body,s=document.documentElement,n=window.pageYOffset||s.scrollTop||i.scrollTop,r=window.pageXOffset||s.scrollLeft||i.scrollLeft,a=s.clientTop||i.clientTop||0,o=s.clientLeft||i.clientLeft||0,l=t.top+n-a,c=t.left+r-o;return{top:Math.round(l),left:Math.round(c)}}function n(e,t){const i={},n=s(e),r=e.offsetWidth,a=e.offsetHeight,o=n.top,l=n.left;let c=t.pageY,u=t.pageX;return t.changedTouches&&(u=t.changedTouches[0].pageX,c=t.changedTouches[0].pageY),i.y=Math.max(0,Math.min(1,(o-c+a)/a)),i.x=Math.max(0,Math.min(1,(u-l)/r)),i}function r(e,t){let{fraction:i}=t;const n=s(e),r=n.left,a=n.top,o=e.offsetHeight,l=e.offsetWidth,c=r+l,u=a+o;return Math.max(0,Math.min(l,window.pageXOffset+window.innerWidth-r,c-window.pageXOffset))*Math.max(0,Math.min(l,window.pageYOffset+window.innerHeight-a,u-window.pageYOffset))/(l*o)>i}function a(e,t,i){e.style.left="".concat(t,"px"),e.style.top="".concat(i,"px")}i.r(t),i.d(t,{getPointerPosition:()=>n,isElementInViewport:()=>r,setPosition:()=>a})},7311:(e,t,i)=>{i.d(t,{y:()=>s});const s=e=>{const t=Object.keys(e);if(!t.length)return"";const i=t.map((t=>"".concat(t,"=").concat(e[t]))).join("&");return"?".concat(i)}},5871:(e,t,i)=>{function s(e,t){for(var i=arguments.length,s=new Array(i>2?i-2:0),n=2;n<i;n++)s[n-2]=arguments[n];return s.reduce(((i,s)=>(Object.prototype.hasOwnProperty.call(e,s)&&(i[s]=e[s],t&&delete e[s]),i)),{})}function n(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return s(e,!1,...i)}function r(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return s(e,!0,...i)}i.r(t),i.d(t,{sliceAndUnsetProperties:()=>r,sliceProperties:()=>n})},5779:(e,t,i)=>{i.d(t,{I6:()=>u,Is:()=>h,O6:()=>o,QF:()=>l});var s=i(8446),n=i.n(s),r=i(8953),a=i.n(r);const o=e=>n()(e)?e():e,l=(e,t,i)=>{const s=o(e),n=s.value(t);return n||console.error("cloudinary video player: ".concat(s.message(i))),n},c=(e,t)=>{if(a()(t))for(let i in e)if(Object.prototype.hasOwnProperty.call(t,i)){const s=e[i],n=t[i],r=a()(s);if(r&&!c(s,n))return!1;if(!r&&!l(n,s,i))return!1}return!0},u=async e=>i.e(40).then(i.bind(i,9754)).then((t=>{let{playerValidators:i}=t;return c(e,i)})),h=e=>i.e(40).then(i.bind(i,9754)).then((t=>{let{sourceValidators:i}=t;return c(e,i)}))},608:(e,t,i)=>{i.d(t,{Am:()=>p,HJ:()=>u,KE:()=>d,_V:()=>o,gi:()=>c,jK:()=>a,jV:()=>l,rT:()=>h,uy:()=>r});var s=i(7938),n=i.n(s);const r=["cloudinaryConfig","transformation","sourceTypes","sourceTransformation","posterOptions","autoShowRecommendations","fontFace","secure"],a=r.concat(["debug","publicId","source","autoplayMode","playedEventPercents","playedEventTimes","analytics","cloudinaryAnalytics","allowUsageReport","fluid","ima","playlistWidget","hideContextMenu","colors","floatingWhenNotVisible","ads","showJumpControls","chaptersButton","pictureInPictureToggle","textTracks","qualitySelector","fetchErrorUsingGet","withCredentials","seekThumbnails","aiHighlightsGraph","chapters","queryParams"]),o=["cloud_name","secure","private_cdn","secure_distribution","cdn_subdomain","secure_cdn_subdomain","cname","shorten","sign_url","api_secret","url_suffix","use_root_path","auth_token"],l={html5:{handlePartialData:!1,vhs:{overrideNative:!n()||!n().browser||!n().browser.IS_IOS&&!n().browser.IS_SAFARI}}},c="cld-fluid",u={ALWAYS:"always",ON_SCROLL:"on-scroll",NEVER:"never"},h={LEFT:"left",RIGHT:"right",NONE:"none"},d={FIRST_VIDEO:"first-video",EVERY_VIDEO:"every-video"},p={AUTO:"auto",METADATA:"metadata",NONE:"none"}},8838:(e,t,i)=>{i.d(t,{T4:()=>p,Wi:()=>m,eo:()=>d,go:()=>g,iG:()=>f});var s=i(7938),n=i.n(s),r=i(5104),a=i(7668),o=i(608),l=i(7571),c=i.n(l),u=i(3337),h=i.n(u);const d=(e,t)=>e.addRemoteTextTrack({kind:"metadata",srclang:"en",src:t,default:!0},!0).track,p=e=>e.class.indexOf("cld-video-player-skin-light")>-1||"light"===e.skin,f=e=>{if(c()(e)){let t=e;0===t.indexOf("#")&&(t=t.slice(1));try{e=document.querySelector("#".concat(h()(t)))||n().getPlayer(t)}catch(t){e=null}if(!e)throw new Error("Could not find element with id ".concat(t))}if(!e.tagName)throw new Error("Must specify either an element or an element id.");if("VIDEO"!==e.tagName)throw new Error("Element is not a video tag.");return e},m=(e,t)=>{const i=r.A.normalizeAttributes(e);(n().dom.hasClass(e,o.gi)||n().dom.hasClass(e,"vjs-fluid"))&&(t.fluid=!0),(e=>{const t=e.autoplayMode;if(t)switch(t){case o.HJ.ALWAYS:e.autoplay=!0;break;case o.HJ.ON_SCROLL:case o.HJ.NEVER:default:e.autoplay=!1}})(t=Object.assign({},o.jV,a.A,i,t));const s=r.A.sliceAndUnsetProperties(t,...o.jK);return s.cloudinary=r.A.sliceAndUnsetProperties(s,...o.uy),t.videojs&&(Object.assign(t,t.videojs),delete t.videojs),{playerOptions:s,videojsOptions:t}},g=()=>{let e=n().getComponent("Player").prototype.options_.children;e.push("titleBar");const t=n().getComponent("ControlBar");t&&(e=t.prototype.options_.children,e.splice(e.indexOf("progressControl"),0,"spacer","progressControlEventsBlocker"),e.splice(e.indexOf("playToggle"),1,"playToggle","JumpBackButton","JumpForwardButton"),e.push("logoButton"),e.splice(e.indexOf("skipForward"),1),e.splice(e.indexOf("skipBackward"),1));const i=n().getComponent("SeekBar");i&&!i.prototype.options_.children.includes("mouseTimeDisplay")&&i.prototype.options_.children.splice(1,0,"mouseTimeDisplay")}},4138:e=>{self,e.exports=(()=>{var e={d:(t,i)=>{for(var s in i)e.o(i,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:i[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};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)}e.r(t),e.d(t,{connectCloudinaryAnalytics:()=>U});var s="pause",n=function(e,t){var i=function(){t("play",{})};return e.addEventListener("play",i),function(){e.removeEventListener("play",i)}},r=function(e,t){var i=function(){t(s,{})};e.addEventListener("pause",i);var n=function(){t(s,{})};return e.addEventListener("emptied",n),function(){e.removeEventListener("play",i),e.removeEventListener("emptied",n)}},a=function(e,t){var i=function(){var i=function(e){var t=e.duration,i=Number.isNaN(t)?null:t;return{videoDuration:Number.POSITIVE_INFINITY===i?"Infinity":i}}(e);t("loadMetadata",{videoDuration:i.videoDuration})};return e.addEventListener("loadedmetadata",i),e.addEventListener("loadedmetadata_after_init",i),function(){e.removeEventListener("loadedmetadata",i),e.removeEventListener("loadedmetadata_after_init",i)}},o=function(e,t){return{eventName:e,eventTime:Date.now(),eventDetails:t}};function l(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?c(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,s=new Array(t);i<t;i++)s[i]=e[i];return s}const u={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let h;const d=new Uint8Array(16);function p(){if(!h&&(h="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!h))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return h(d)}const f=[];for(let e=0;e<256;++e)f.push((e+256).toString(16).slice(1));const m=function(e,t,i){if(u.randomUUID&&!t&&!e)return u.randomUUID();const s=(e=e||{}).random||(e.rng||p)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t){i=i||0;for(let e=0;e<16;++e)t[i+e]=s[e];return t}return function(e,t=0){return(f[e[t+0]]+f[e[t+1]]+f[e[t+2]]+f[e[t+3]]+"-"+f[e[t+4]]+f[e[t+5]]+"-"+f[e[t+6]]+f[e[t+7]]+"-"+f[e[t+8]]+f[e[t+9]]+"-"+f[e[t+10]]+f[e[t+11]]+f[e[t+12]]+f[e[t+13]]+f[e[t+14]]+f[e[t+15]]).toLowerCase()}(s)};var g=function(){return m().replace(/-/g,"")},y="cld-analytics-user-id",v=function(){var e=window.localStorage.getItem(y);if(e)return e;var t=m().replace(/-/g,"");return window.localStorage.setItem(y,t),t};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)}var b=["string","number","boolean"],T=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,S="native",w=[S,"cloudinary video player"];function E(e){return E="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(e)}function C(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,s)}return i}function x(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?C(Object(i),!0).forEach((function(t){k(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):C(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function k(e,t,i){return(t=function(e){var t=function(e,t){if("object"!==E(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var s=i.call(e,"string");if("object"!==E(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===E(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var A=function(e,t,i){var s,n,r,a=function(e){if("object"===_(e)&&null!==e&&!Array.isArray(e)){var t=Object.keys(e).reduce((function(t,i){return(b.includes(_(e[i]))||null===e[i])&&(t[i]=e[i]),t}),{});return Object.keys(t).length>0?t:null}return null}(null==i?void 0:i.providedData),l=function(e){return null!==e&&JSON.stringify(e).length<=1e3}(a),c=null!=i&&i.customVideoUrlFallback?function(e,t){try{var i=t(e);return{cloudName:i.cloudName,publicId:i.publicId}}catch(e){return null}}(e,i.customVideoUrlFallback):null,u=null!==(s=c)&&"object"===_(s)&&"string"==typeof s.cloudName&&s.cloudName&&"string"==typeof s.publicId&&s.publicId?{cloudName:s.cloudName,publicId:s.publicId}:null;return o("viewStart",x(x({videoUrl:e,analyticsModuleVersion:"1.4.3",videoPlayer:{type:(r=null==i?void 0:i.videoPlayerType,w.includes(r)?r:S),version:(n=null==i?void 0:i.videoPlayerVersion,"string"==typeof n&&T.test(n)?n:null)}},t),{},{customerData:x(x({},l?{providedData:a}:{}),u?{videoData:u}:{})}))};function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,s=new Array(t);i<t;i++)s[i]=e[i];return s}var P=function(e){var t=function(e){return function(e){if(Array.isArray(e))return I(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return I(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?I(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e);return t.push(o("viewEnd",{})),JSON.stringify(t)};function O(e){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},O(e)}function L(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,s)}return i}function D(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?L(Object(i),!0).forEach((function(t){R(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):L(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function R(e,t,i){return(t=function(e){var t=function(e,t){if("object"!==O(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var s=i.call(e,"string");if("object"!==O(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===O(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var N=function(e,t,i){var s=function(){var s=t(),n=P(s);i(D(D({},e),{},{events:n}))};return window.addEventListener("beforeunload",s,{once:!0}),function(){window.removeEventListener("beforeunload",s),s()}},M=function(e){return e.currentSrc};function j(e){return j="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},j(e)}var U=function(e){var t=null,s=function(e){var t={},i={};return function(s,c){t[s]=[],i[s]=[c];var u=t[s],h=i[s],d=function(e,t){return h.push(o(e,t))},p=[n(e,d),r(e,d),a(e,d)];return function(e){if(e.readyState>0){var t=new CustomEvent("loadedmetadata_after_init");e.dispatchEvent(t)}}(e),{flushEvents:function(){var e=h.splice(0,h.length);return u.splice.apply(u,[u.length,0].concat(l(e))),e},getAllEvents:function(){return u},destroy:function(){p.forEach((function(e){return e()}))}}}}(e),c=function(e){return function(e,t){var i=Object.keys(t).reduce((function(e,i){return e.append(i,t[i]),e}),new FormData);return"function"!=typeof window.navigator.sendBeacon?window.fetch(e,{method:"POST",mode:"no-cors",body:i,keepalive:!0}):window.navigator.sendBeacon(e,i)}("https://video-analytics-api.cloudinary.com/v1/video-analytics",e)},u=function(){t&&(t.clear(),t=null)};return{startManualTracking:function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=function(e){return"object"!==i(e)?{isValid:!1,errorMessage:"Metadata param needs to be an object"}:"string"!=typeof e.cloudName?{isValid:!1,errorMessage:"You need to provide proper cloud name of your Cloudinary account [cloudName: string]"}:"string"!=typeof e.publicId?{isValid:!1,errorMessage:"You need to provide proper video public ID of your video on your Cloudinary cloud [videoPublicId: string]"}:{isValid:!0}}(n);if(!a.isValid)throw"Cloudinary video analytics tracking called without necessary data (".concat(a.errorMessage,")");if(r&&"object"!==j(r))throw"Options property must be an object";r.customVideoUrlFallback=function(){return n},u();var o=g(),l=M(e),h=A(l,{trackingType:"manual"},r),d=s(o,h),p=N({userId:v(),viewId:o},d.flushEvents,c);t={viewId:o,clear:function(){d.destroy(),p()}}},stopManualTracking:u,startAutoTracking:function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t)throw"Cloudinary video analytics tracking is already connected with this HTML Video Element";if(i&&"object"!==j(i))throw"Options property must be an object";var n=function(){var n=M(e);if(n===window.location.href||!n)return null;var r=g(),a=A(n,{trackingType:"auto"},i),o=s(r,a),l=N({userId:v(),viewId:r},o.flushEvents,c);t={viewId:r,clear:function(){o.destroy(),l()}}};e.addEventListener("loadstart",(function(){t||n()})),e.addEventListener("emptied",(function(){u()})),n()}}};return t})()},3337:function(e,t,i){var s;s=void 0!==i.g?i.g:this,e.exports=function(e){if(e.CSS&&e.CSS.escape)return e.CSS.escape;var t=function(e){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var t,i=String(e),s=i.length,n=-1,r="",a=i.charCodeAt(0);++n<s;)0!=(t=i.charCodeAt(n))?r+=t>=1&&t<=31||127==t||0==n&&t>=48&&t<=57||1==n&&t>=48&&t<=57&&45==a?"\\"+t.toString(16)+" ":0==n&&1==s&&45==t||!(t>=128||45==t||95==t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122)?"\\"+i.charAt(n):i.charAt(n):r+="�";return r};return e.CSS||(e.CSS={}),e.CSS.escape=t,t}(s)},6827:e=>{var t,i="object"==typeof Reflect?Reflect:null,s=i&&"function"==typeof i.apply?i.apply:function(e,t,i){return Function.prototype.apply.call(e,t,i)};t=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var n=Number.isNaN||function(e){return e!=e};function r(){r.init.call(this)}e.exports=r,e.exports.once=function(e,t){return new Promise((function(i,s){function n(i){e.removeListener(t,r),s(i)}function r(){"function"==typeof e.removeListener&&e.removeListener("error",n),i([].slice.call(arguments))}m(e,t,r,{once:!0}),"error"!==t&&function(e,t,i){"function"==typeof e.on&&m(e,"error",t,{once:!0})}(e,n)}))},r.EventEmitter=r,r.prototype._events=void 0,r.prototype._eventsCount=0,r.prototype._maxListeners=void 0;var a=10;function o(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?r.defaultMaxListeners:e._maxListeners}function c(e,t,i,s){var n,r,a,c;if(o(i),void 0===(r=e._events)?(r=e._events=Object.create(null),e._eventsCount=0):(void 0!==r.newListener&&(e.emit("newListener",t,i.listener?i.listener:i),r=e._events),a=r[t]),void 0===a)a=r[t]=i,++e._eventsCount;else if("function"==typeof a?a=r[t]=s?[i,a]:[a,i]:s?a.unshift(i):a.push(i),(n=l(e))>0&&a.length>n&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,c=u,console&&console.warn&&console.warn(c)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,i){var s={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},n=u.bind(s);return n.listener=i,s.wrapFn=n,n}function d(e,t,i){var s=e._events;if(void 0===s)return[];var n=s[t];return void 0===n?[]:"function"==typeof n?i?[n.listener||n]:[n]:i?function(e){for(var t=new Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t}(n):f(n,n.length)}function p(e){var t=this._events;if(void 0!==t){var i=t[e];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function f(e,t){for(var i=new Array(t),s=0;s<t;++s)i[s]=e[s];return i}function m(e,t,i,s){if("function"==typeof e.on)s.once?e.once(t,i):e.on(t,i);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function n(r){s.once&&e.removeEventListener(t,n),i(r)}))}}Object.defineProperty(r,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||n(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),r.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},r.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||n(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},r.prototype.getMaxListeners=function(){return l(this)},r.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t.push(arguments[i]);var n="error"===e,r=this._events;if(void 0!==r)n=n&&void 0===r.error;else if(!n)return!1;if(n){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var l=r[e];if(void 0===l)return!1;if("function"==typeof l)s(l,this,t);else{var c=l.length,u=f(l,c);for(i=0;i<c;++i)s(u[i],this,t)}return!0},r.prototype.addListener=function(e,t){return c(this,e,t,!1)},r.prototype.on=r.prototype.addListener,r.prototype.prependListener=function(e,t){return c(this,e,t,!0)},r.prototype.once=function(e,t){return o(t),this.on(e,h(this,e,t)),this},r.prototype.prependOnceListener=function(e,t){return o(t),this.prependListener(e,h(this,e,t)),this},r.prototype.removeListener=function(e,t){var i,s,n,r,a;if(o(t),void 0===(s=this._events))return this;if(void 0===(i=s[e]))return this;if(i===t||i.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete s[e],s.removeListener&&this.emit("removeListener",e,i.listener||t));else if("function"!=typeof i){for(n=-1,r=i.length-1;r>=0;r--)if(i[r]===t||i[r].listener===t){a=i[r].listener,n=r;break}if(n<0)return this;0===n?i.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(i,n),1===i.length&&(s[e]=i[0]),void 0!==s.removeListener&&this.emit("removeListener",e,a||t)}return this},r.prototype.off=r.prototype.removeListener,r.prototype.removeAllListeners=function(e){var t,i,s;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete i[e]),this;if(0===arguments.length){var n,r=Object.keys(i);for(s=0;s<r.length;++s)"removeListener"!==(n=r[s])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=i[e]))this.removeListener(e,t);else if(void 0!==t)for(s=t.length-1;s>=0;s--)this.removeListener(e,t[s]);return this},r.prototype.listeners=function(e){return d(this,e,!0)},r.prototype.rawListeners=function(e){return d(this,e,!1)},r.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},r.prototype.listenerCount=p,r.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},7938:(e,t,i)=>{var s=i(6914);i(8364).videojs=s,e.exports=s},8364:(e,t,i)=>{e.exports=function(){if("object"==typeof globalThis)return globalThis;var e;try{e=this||new Function("return this")()}catch(e){if("object"==typeof window)return window;if("object"==typeof self)return self;if(void 0!==i.g)return i.g}return e}()},7509:(e,t,i)=>{var s,n=void 0!==i.g?i.g:"undefined"!=typeof window?window:{},r=i(4626);"undefined"!=typeof document?s=document:(s=n["__GLOBAL_DOCUMENT_CACHE@4"])||(s=n["__GLOBAL_DOCUMENT_CACHE@4"]=r),e.exports=s},5204:(e,t,i)=>{var s;s="undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},e.exports=s},8716:e=>{e.exports=function(e){if(!e)return!1;var i=t.call(e);return"[object Function]"===i||"function"==typeof e&&"[object RegExp]"!==i||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)};var t=Object.prototype.toString},8261:(e,t)=>{function i(e){if(e&&"object"==typeof e){var t=e.which||e.keyCode||e.charCode;t&&(e=t)}if("number"==typeof e)return a[e];var i,r=String(e);return(i=s[r.toLowerCase()])?i:(i=n[r.toLowerCase()])||(1===r.length?r.charCodeAt(0):void 0)}i.isEventKey=function(e,t){if(e&&"object"==typeof e){var i=e.which||e.keyCode||e.charCode;if(null==i)return!1;if("string"==typeof t){var r;if(r=s[t.toLowerCase()])return r===i;if(r=n[t.toLowerCase()])return r===i}else if("number"==typeof t)return t===i;return!1}};var s=(t=e.exports=i).code=t.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},n=t.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(r=97;r<123;r++)s[String.fromCharCode(r)]=r-32;for(var r=48;r<58;r++)s[r-48]=r;for(r=1;r<13;r++)s["f"+r]=r+111;for(r=0;r<10;r++)s["numpad "+r]=r+96;var a=t.names=t.title={};for(r in s)a[s[r]]=r;for(var o in n)s[o]=n[o]},1416:(e,t,i)=>{var s=i(9138)(i(1433),"DataView");e.exports=s},9073:(e,t,i)=>{var s=i(2316),n=i(6458),r=i(2149),a=i(4297),o=i(3121);function l(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var s=e[t];this.set(s[0],s[1])}}l.prototype.clear=s,l.prototype.delete=n,l.prototype.get=r,l.prototype.has=a,l.prototype.set=o,e.exports=l},2707:(e,t,i)=>{var s=i(9714),n=i(3812),r=i(4727),a=i(8379),o=i(8291);function l(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var s=e[t];this.set(s[0],s[1])}}l.prototype.clear=s,l.prototype.delete=n,l.prototype.get=r,l.prototype.has=a,l.prototype.set=o,e.exports=l},1955:(e,t,i)=>{var s=i(9138)(i(1433),"Map");e.exports=s},369:(e,t,i)=>{var s=i(2092),n=i(9626),r=i(9925),a=i(6809),o=i(4385);function l(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var s=e[t];this.set(s[0],s[1])}}l.prototype.clear=s,l.prototype.delete=n,l.prototype.get=r,l.prototype.has=a,l.prototype.set=o,e.exports=l},2616:(e,t,i)=>{var s=i(9138)(i(1433),"Promise");e.exports=s},157:(e,t,i)=>{var s=i(9138)(i(1433),"Set");e.exports=s},6469:(e,t,i)=>{var s=i(2707),n=i(1848),r=i(7406),a=i(8569),o=i(3109),l=i(3389);function c(e){var t=this.__data__=new s(e);this.size=t.size}c.prototype.clear=n,c.prototype.delete=r,c.prototype.get=a,c.prototype.has=o,c.prototype.set=l,e.exports=c},2781:(e,t,i)=>{var s=i(1433).Symbol;e.exports=s},8944:(e,t,i)=>{var s=i(1433).Uint8Array;e.exports=s},8499:(e,t,i)=>{var s=i(9138)(i(1433),"WeakMap");e.exports=s},6701:e=>{e.exports=function(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}},149:e=>{e.exports=function(e,t){for(var i=-1,s=null==e?0:e.length;++i<s&&!1!==t(e[i],i,e););return e}},1414:e=>{e.exports=function(e,t){for(var i=-1,s=null==e?0:e.length,n=0,r=[];++i<s;){var a=e[i];t(a,i,e)&&(r[n++]=a)}return r}},1163:(e,t,i)=>{var s=i(6204),n=i(1256),r=i(6397),a=i(492),o=i(2845),l=i(7995),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var i=r(e),u=!i&&n(e),h=!i&&!u&&a(e),d=!i&&!u&&!h&&l(e),p=i||u||h||d,f=p?s(e.length,String):[],m=f.length;for(var g in e)!t&&!c.call(e,g)||p&&("length"==g||h&&("offset"==g||"parent"==g)||d&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||o(g,m))||f.push(g);return f}},4272:e=>{e.exports=function(e,t){for(var i=-1,s=null==e?0:e.length,n=Array(s);++i<s;)n[i]=t(e[i],i,e);return n}},8740:e=>{e.exports=function(e,t){for(var i=-1,s=t.length,n=e.length;++i<s;)e[n+i]=t[i];return e}},2814:e=>{e.exports=function(e,t,i,s){var n=-1,r=null==e?0:e.length;for(s&&r&&(i=e[++n]);++n<r;)i=t(i,e[n],n,e);return i}},9174:e=>{e.exports=function(e){return e.split("")}},8273:e=>{var t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;e.exports=function(e){return e.match(t)||[]}},2863:(e,t,i)=>{var s=i(4772),n=i(9316),r=Object.prototype.hasOwnProperty;e.exports=function(e,t,i){var a=e[t];r.call(e,t)&&n(a,i)&&(void 0!==i||t in e)||s(e,t,i)}},8301:(e,t,i)=>{var s=i(9316);e.exports=function(e,t){for(var i=e.length;i--;)if(s(e[i][0],t))return i;return-1}},1145:(e,t,i)=>{var s=i(2083),n=i(1178);e.exports=function(e,t){return e&&s(t,n(t),e)}},4306:(e,t,i)=>{var s=i(2083),n=i(5405);e.exports=function(e,t){return e&&s(t,n(t),e)}},4772:(e,t,i)=>{var s=i(8559);e.exports=function(e,t,i){"__proto__"==t&&s?s(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}},2931:(e,t,i)=>{var s=i(6469),n=i(149),r=i(2863),a=i(1145),o=i(4306),l=i(7030),c=i(8835),u=i(859),h=i(6728),d=i(966),p=i(9697),f=i(1201),m=i(6785),g=i(3283),y=i(9181),v=i(6397),_=i(492),b=i(422),T=i(8953),S=i(3764),w=i(1178),E=i(5405),C="[object Arguments]",x="[object Function]",k="[object Object]",A={};A[C]=A["[object Array]"]=A["[object ArrayBuffer]"]=A["[object DataView]"]=A["[object Boolean]"]=A["[object Date]"]=A["[object Float32Array]"]=A["[object Float64Array]"]=A["[object Int8Array]"]=A["[object Int16Array]"]=A["[object Int32Array]"]=A["[object Map]"]=A["[object Number]"]=A[k]=A["[object RegExp]"]=A["[object Set]"]=A["[object String]"]=A["[object Symbol]"]=A["[object Uint8Array]"]=A["[object Uint8ClampedArray]"]=A["[object Uint16Array]"]=A["[object Uint32Array]"]=!0,A["[object Error]"]=A[x]=A["[object WeakMap]"]=!1,e.exports=function e(t,i,I,P,O,L){var D,R=1&i,N=2&i,M=4&i;if(I&&(D=O?I(t,P,O,L):I(t)),void 0!==D)return D;if(!T(t))return t;var j=v(t);if(j){if(D=m(t),!R)return c(t,D)}else{var U=f(t),B=U==x||"[object GeneratorFunction]"==U;if(_(t))return l(t,R);if(U==k||U==C||B&&!O){if(D=N||B?{}:y(t),!R)return N?h(t,o(D,t)):u(t,a(D,t))}else{if(!A[U])return O?t:{};D=g(t,U,R)}}L||(L=new s);var F=L.get(t);if(F)return F;L.set(t,D),S(t)?t.forEach((function(s){D.add(e(s,i,I,s,t,L))})):b(t)&&t.forEach((function(s,n){D.set(n,e(s,i,I,n,t,L))}));var q=j?void 0:(M?N?p:d:N?E:w)(t);return n(q||t,(function(s,n){q&&(s=t[n=s]),r(D,n,e(s,i,I,n,t,L))})),D}},3508:(e,t,i)=>{var s=i(8953),n=Object.create,r=function(){function e(){}return function(t){if(!s(t))return{};if(n)return n(t);e.prototype=t;var i=new e;return e.prototype=void 0,i}}();e.exports=r},1044:(e,t,i)=>{var s=i(8740),n=i(8031);e.exports=function e(t,i,r,a,o){var l=-1,c=t.length;for(r||(r=n),o||(o=[]);++l<c;){var u=t[l];i>0&&r(u)?i>1?e(u,i-1,r,a,o):s(o,u):a||(o[o.length]=u)}return o}},7722:(e,t,i)=>{var s=i(7181),n=i(6729);e.exports=function(e,t){for(var i=0,r=(t=s(t,e)).length;null!=e&&i<r;)e=e[n(t[i++])];return i&&i==r?e:void 0}},4403:(e,t,i)=>{var s=i(8740),n=i(6397);e.exports=function(e,t,i){var r=t(e);return n(e)?r:s(r,i(e))}},7148:(e,t,i)=>{var s=i(2781),n=i(7903),r=i(1738),a=s?s.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?n(e):r(e)}},809:e=>{e.exports=function(e,t){return null!=e&&t in Object(e)}},9250:(e,t,i)=>{var s=i(7148),n=i(2934);e.exports=function(e){return n(e)&&"[object Arguments]"==s(e)}},4800:(e,t,i)=>{var s=i(1201),n=i(2934);e.exports=function(e){return n(e)&&"[object Map]"==s(e)}},6567:(e,t,i)=>{var s=i(8446),n=i(8092),r=i(8953),a=i(1485),o=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,u=l.toString,h=c.hasOwnProperty,d=RegExp("^"+u.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!r(e)||n(e))&&(s(e)?d:o).test(a(e))}},7866:(e,t,i)=>{var s=i(1201),n=i(2934);e.exports=function(e){return n(e)&&"[object Set]"==s(e)}},7129:(e,t,i)=>{var s=i(7148),n=i(3330),r=i(2934),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return r(e)&&n(e.length)&&!!a[s(e)]}},1452:(e,t,i)=>{var s=i(7499),n=i(9566),r=Object.prototype.hasOwnProperty;e.exports=function(e){if(!s(e))return n(e);var t=[];for(var i in Object(e))r.call(e,i)&&"constructor"!=i&&t.push(i);return t}},1491:(e,t,i)=>{var s=i(8953),n=i(7499),r=i(8201),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!s(e))return r(e);var t=n(e),i=[];for(var o in e)("constructor"!=o||!t&&a.call(e,o))&&i.push(o);return i}},6733:(e,t,i)=>{var s=i(5576),n=i(8235);e.exports=function(e,t){return s(e,t,(function(t,i){return n(e,i)}))}},5576:(e,t,i)=>{var s=i(7722),n=i(8230),r=i(7181);e.exports=function(e,t,i){for(var a=-1,o=t.length,l={};++a<o;){var c=t[a],u=s(e,c);i(u,c)&&n(l,r(c,e),u)}return l}},6764:e=>{e.exports=function(e){return function(t){return null==e?void 0:e[t]}}},8230:(e,t,i)=>{var s=i(2863),n=i(7181),r=i(2845),a=i(8953),o=i(6729);e.exports=function(e,t,i,l){if(!a(e))return e;for(var c=-1,u=(t=n(t,e)).length,h=u-1,d=e;null!=d&&++c<u;){var p=o(t[c]),f=i;if("__proto__"===p||"constructor"===p||"prototype"===p)return e;if(c!=h){var m=d[p];void 0===(f=l?l(m,p,d):void 0)&&(f=a(m)?m:r(t[c+1])?[]:{})}s(d,p,f),d=d[p]}return e}},7310:(e,t,i)=>{var s=i(3122),n=i(8559),r=i(4796),a=n?function(e,t){return n(e,"toString",{configurable:!0,enumerable:!1,value:s(t),writable:!0})}:r;e.exports=a},9772:e=>{e.exports=function(e,t,i){var s=-1,n=e.length;t<0&&(t=-t>n?0:n+t),(i=i>n?n:i)<0&&(i+=n),n=t>i?0:i-t>>>0,t>>>=0;for(var r=Array(n);++s<n;)r[s]=e[s+t];return r}},6204:e=>{e.exports=function(e,t){for(var i=-1,s=Array(e);++i<e;)s[i]=t(i);return s}},6584:(e,t,i)=>{var s=i(2781),n=i(4272),r=i(6397),a=i(5414),o=s?s.prototype:void 0,l=o?o.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(r(t))return n(t,e)+"";if(a(t))return l?l.call(t):"";var i=t+"";return"0"==i&&1/t==-1/0?"-0":i}},41:e=>{e.exports=function(e){return function(t){return e(t)}}},5263:(e,t,i)=>{var s=i(7181),n=i(5342),r=i(8549),a=i(6729);e.exports=function(e,t){return t=s(t,e),null==(e=r(e,t))||delete e[a(n(t))]}},7181:(e,t,i)=>{var s=i(6397),n=i(3726),r=i(3614),a=i(3506);e.exports=function(e,t){return s(e)?e:n(e,t)?[e]:r(a(e))}},9270:(e,t,i)=>{var s=i(9772);e.exports=function(e,t,i){var n=e.length;return i=void 0===i?n:i,!t&&i>=n?e:s(e,t,i)}},7177:(e,t,i)=>{var s=i(8944);e.exports=function(e){var t=new e.constructor(e.byteLength);return new s(t).set(new s(e)),t}},7030:(e,t,i)=>{e=i.nmd(e);var s=i(1433),n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,a=r&&r.exports===n?s.Buffer:void 0,o=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var i=e.length,s=o?o(i):new e.constructor(i);return e.copy(s),s}},4893:(e,t,i)=>{var s=i(7177);e.exports=function(e,t){var i=t?s(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)}},4021:e=>{var t=/\w*$/;e.exports=function(e){var i=new e.constructor(e.source,t.exec(e));return i.lastIndex=e.lastIndex,i}},1548:(e,t,i)=>{var s=i(2781),n=s?s.prototype:void 0,r=n?n.valueOf:void 0;e.exports=function(e){return r?Object(r.call(e)):{}}},9114:(e,t,i)=>{var s=i(7177);e.exports=function(e,t){var i=t?s(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}},8835:e=>{e.exports=function(e,t){var i=-1,s=e.length;for(t||(t=Array(s));++i<s;)t[i]=e[i];return t}},2083:(e,t,i)=>{var s=i(2863),n=i(4772);e.exports=function(e,t,i,r){var a=!i;i||(i={});for(var o=-1,l=t.length;++o<l;){var c=t[o],u=r?r(i[c],e[c],c,i,e):void 0;void 0===u&&(u=e[c]),a?n(i,c,u):s(i,c,u)}return i}},859:(e,t,i)=>{var s=i(2083),n=i(8876);e.exports=function(e,t){return s(e,n(e),t)}},6728:(e,t,i)=>{var s=i(2083),n=i(8355);e.exports=function(e,t){return s(e,n(e),t)}},8109:(e,t,i)=>{var s=i(1433)["__core-js_shared__"];e.exports=s},7383:(e,t,i)=>{var s=i(9270),n=i(654),r=i(4092),a=i(3506);e.exports=function(e){return function(t){t=a(t);var i=n(t)?r(t):void 0,o=i?i[0]:t.charAt(0),l=i?s(i,1).join(""):t.slice(1);return o[e]()+l}}},6983:(e,t,i)=>{var s=i(2814),n=i(3768),r=i(7385),a=RegExp("['’]","g");e.exports=function(e){return function(t){return s(r(n(t).replace(a,"")),e,"")}}},7222:(e,t,i)=>{var s=i(4679);e.exports=function(e){return s(e)?void 0:e}},8795:(e,t,i)=>{var s=i(6764)({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"});e.exports=s},8559:(e,t,i)=>{var s=i(9138),n=function(){try{var e=s(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=n},9820:(e,t,i)=>{var s=i(3406),n=i(5265),r=i(6805);e.exports=function(e){return r(n(e,void 0,s),e+"")}},5380:(e,t,i)=>{var s="object"==typeof i.g&&i.g&&i.g.Object===Object&&i.g;e.exports=s},966:(e,t,i)=>{var s=i(4403),n=i(8876),r=i(1178);e.exports=function(e){return s(e,r,n)}},9697:(e,t,i)=>{var s=i(4403),n=i(8355),r=i(5405);e.exports=function(e){return s(e,r,n)}},5535:(e,t,i)=>{var s=i(5662);e.exports=function(e,t){var i=e.__data__;return s(t)?i["string"==typeof t?"string":"hash"]:i.map}},9138:(e,t,i)=>{var s=i(6567),n=i(6772);e.exports=function(e,t){var i=n(e,t);return s(i)?i:void 0}},3347:(e,t,i)=>{var s=i(1019)(Object.getPrototypeOf,Object);e.exports=s},7903:(e,t,i)=>{var s=i(2781),n=Object.prototype,r=n.hasOwnProperty,a=n.toString,o=s?s.toStringTag:void 0;e.exports=function(e){var t=r.call(e,o),i=e[o];try{e[o]=void 0;var s=!0}catch(e){}var n=a.call(e);return s&&(t?e[o]=i:delete e[o]),n}},8876:(e,t,i)=>{var s=i(1414),n=i(3629),r=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,o=a?function(e){return null==e?[]:(e=Object(e),s(a(e),(function(t){return r.call(e,t)})))}:n;e.exports=o},8355:(e,t,i)=>{var s=i(8740),n=i(3347),r=i(8876),a=i(3629),o=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)s(t,r(e)),e=n(e);return t}:a;e.exports=o},1201:(e,t,i)=>{var s=i(1416),n=i(1955),r=i(2616),a=i(157),o=i(8499),l=i(7148),c=i(1485),u="[object Map]",h="[object Promise]",d="[object Set]",p="[object WeakMap]",f="[object DataView]",m=c(s),g=c(n),y=c(r),v=c(a),_=c(o),b=l;(s&&b(new s(new ArrayBuffer(1)))!=f||n&&b(new n)!=u||r&&b(r.resolve())!=h||a&&b(new a)!=d||o&&b(new o)!=p)&&(b=function(e){var t=l(e),i="[object Object]"==t?e.constructor:void 0,s=i?c(i):"";if(s)switch(s){case m:return f;case g:return u;case y:return h;case v:return d;case _:return p}return t}),e.exports=b},6772:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},6866:(e,t,i)=>{var s=i(7181),n=i(1256),r=i(6397),a=i(2845),o=i(3330),l=i(6729);e.exports=function(e,t,i){for(var c=-1,u=(t=s(t,e)).length,h=!1;++c<u;){var d=l(t[c]);if(!(h=null!=e&&i(e,d)))break;e=e[d]}return h||++c!=u?h:!!(u=null==e?0:e.length)&&o(u)&&a(d,u)&&(r(e)||n(e))}},654:e=>{var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},5854:e=>{var t=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;e.exports=function(e){return t.test(e)}},2316:(e,t,i)=>{var s=i(4558);e.exports=function(){this.__data__=s?s(null):{},this.size=0}},6458:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},2149:(e,t,i)=>{var s=i(4558),n=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(s){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return n.call(t,e)?t[e]:void 0}},4297:(e,t,i)=>{var s=i(4558),n=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return s?void 0!==t[e]:n.call(t,e)}},3121:(e,t,i)=>{var s=i(4558);e.exports=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=s&&void 0===t?"__lodash_hash_undefined__":t,this}},6785:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var i=e.length,s=new e.constructor(i);return i&&"string"==typeof e[0]&&t.call(e,"index")&&(s.index=e.index,s.input=e.input),s}},3283:(e,t,i)=>{var s=i(7177),n=i(4893),r=i(4021),a=i(1548),o=i(9114);e.exports=function(e,t,i){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return s(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return n(e,i);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return o(e,i);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(e);case"[object RegExp]":return r(e);case"[object Symbol]":return a(e)}}},9181:(e,t,i)=>{var s=i(3508),n=i(3347),r=i(7499);e.exports=function(e){return"function"!=typeof e.constructor||r(e)?{}:s(n(e))}},8031:(e,t,i)=>{var s=i(2781),n=i(1256),r=i(6397),a=s?s.isConcatSpreadable:void 0;e.exports=function(e){return r(e)||n(e)||!!(a&&e&&e[a])}},2845:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,i){var s=typeof e;return!!(i=null==i?9007199254740991:i)&&("number"==s||"symbol"!=s&&t.test(e))&&e>-1&&e%1==0&&e<i}},3726:(e,t,i)=>{var s=i(6397),n=i(5414),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(s(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!n(e))||a.test(e)||!r.test(e)||null!=t&&e in Object(t)}},5662:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},8092:(e,t,i)=>{var s,n=i(8109),r=(s=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||""))?"Symbol(src)_1."+s:"";e.exports=function(e){return!!r&&r in e}},7499:e=>{var t=Object.prototype;e.exports=function(e){var i=e&&e.constructor;return e===("function"==typeof i&&i.prototype||t)}},9714:e=>{e.exports=function(){this.__data__=[],this.size=0}},3812:(e,t,i)=>{var s=i(8301),n=Array.prototype.splice;e.exports=function(e){var t=this.__data__,i=s(t,e);return!(i<0||(i==t.length-1?t.pop():n.call(t,i,1),--this.size,0))}},4727:(e,t,i)=>{var s=i(8301);e.exports=function(e){var t=this.__data__,i=s(t,e);return i<0?void 0:t[i][1]}},8379:(e,t,i)=>{var s=i(8301);e.exports=function(e){return s(this.__data__,e)>-1}},8291:(e,t,i)=>{var s=i(8301);e.exports=function(e,t){var i=this.__data__,n=s(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this}},2092:(e,t,i)=>{var s=i(9073),n=i(2707),r=i(1955);e.exports=function(){this.size=0,this.__data__={hash:new s,map:new(r||n),string:new s}}},9626:(e,t,i)=>{var s=i(5535);e.exports=function(e){var t=s(this,e).delete(e);return this.size-=t?1:0,t}},9925:(e,t,i)=>{var s=i(5535);e.exports=function(e){return s(this,e).get(e)}},6809:(e,t,i)=>{var s=i(5535);e.exports=function(e){return s(this,e).has(e)}},4385:(e,t,i)=>{var s=i(5535);e.exports=function(e,t){var i=s(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this}},9268:(e,t,i)=>{var s=i(4556);e.exports=function(e){var t=s(e,(function(e){return 500===i.size&&i.clear(),e})),i=t.cache;return t}},4558:(e,t,i)=>{var s=i(9138)(Object,"create");e.exports=s},9566:(e,t,i)=>{var s=i(1019)(Object.keys,Object);e.exports=s},8201:e=>{e.exports=function(e){var t=[];if(null!=e)for(var i in Object(e))t.push(i);return t}},3685:(e,t,i)=>{e=i.nmd(e);var s=i(5380),n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,a=r&&r.exports===n&&s.process,o=function(){try{return r&&r.require&&r.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=o},1738:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},1019:e=>{e.exports=function(e,t){return function(i){return e(t(i))}}},5265:(e,t,i)=>{var s=i(6701),n=Math.max;e.exports=function(e,t,i){return t=n(void 0===t?e.length-1:t,0),function(){for(var r=arguments,a=-1,o=n(r.length-t,0),l=Array(o);++a<o;)l[a]=r[t+a];a=-1;for(var c=Array(t+1);++a<t;)c[a]=r[a];return c[t]=i(l),s(e,this,c)}}},8549:(e,t,i)=>{var s=i(7722),n=i(9772);e.exports=function(e,t){return t.length<2?e:s(e,n(t,0,-1))}},1433:(e,t,i)=>{var s=i(5380),n="object"==typeof self&&self&&self.Object===Object&&self,r=s||n||Function("return this")();e.exports=r},6805:(e,t,i)=>{var s=i(7310),n=i(3983)(s);e.exports=n},3983:e=>{var t=Date.now;e.exports=function(e){var i=0,s=0;return function(){var n=t(),r=16-(n-s);if(s=n,r>0){if(++i>=800)return arguments[0]}else i=0;return e.apply(void 0,arguments)}}},1848:(e,t,i)=>{var s=i(2707);e.exports=function(){this.__data__=new s,this.size=0}},7406:e=>{e.exports=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i}},8569:e=>{e.exports=function(e){return this.__data__.get(e)}},3109:e=>{e.exports=function(e){return this.__data__.has(e)}},3389:(e,t,i)=>{var s=i(2707),n=i(1955),r=i(369);e.exports=function(e,t){var i=this.__data__;if(i instanceof s){var a=i.__data__;if(!n||a.length<199)return a.push([e,t]),this.size=++i.size,this;i=this.__data__=new r(a)}return i.set(e,t),this.size=i.size,this}},4092:(e,t,i)=>{var s=i(9174),n=i(654),r=i(4082);e.exports=function(e){return n(e)?r(e):s(e)}},3614:(e,t,i)=>{var s=i(9268),n=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,a=s((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(n,(function(e,i,s,n){t.push(s?n.replace(r,"$1"):i||e)})),t}));e.exports=a},6729:(e,t,i)=>{var s=i(5414);e.exports=function(e){if("string"==typeof e||s(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},1485:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},4082:e=>{var t="\\ud800-\\udfff",i="["+t+"]",s="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",n="\\ud83c[\\udffb-\\udfff]",r="[^"+t+"]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",o="[\\ud800-\\udbff][\\udc00-\\udfff]",l="(?:"+s+"|"+n+")?",c="[\\ufe0e\\ufe0f]?",u=c+l+"(?:\\u200d(?:"+[r,a,o].join("|")+")"+c+l+")*",h="(?:"+[r+s+"?",s,a,o,i].join("|")+")",d=RegExp(n+"(?="+n+")|"+h+u,"g");e.exports=function(e){return e.match(d)||[]}},5701:e=>{var t="\\ud800-\\udfff",i="\\u2700-\\u27bf",s="a-z\\xdf-\\xf6\\xf8-\\xff",n="A-Z\\xc0-\\xd6\\xd8-\\xde",r="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",a="["+r+"]",o="\\d+",l="["+i+"]",c="["+s+"]",u="[^"+t+r+o+i+s+n+"]",h="(?:\\ud83c[\\udde6-\\uddff]){2}",d="[\\ud800-\\udbff][\\udc00-\\udfff]",p="["+n+"]",f="(?:"+c+"|"+u+")",m="(?:"+p+"|"+u+")",g="(?:['’](?:d|ll|m|re|s|t|ve))?",y="(?:['’](?:D|LL|M|RE|S|T|VE))?",v="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",_="[\\ufe0e\\ufe0f]?",b=_+v+"(?:\\u200d(?:"+["[^"+t+"]",h,d].join("|")+")"+_+v+")*",T="(?:"+[l,h,d].join("|")+")"+b,S=RegExp([p+"?"+c+"+"+g+"(?="+[a,p,"$"].join("|")+")",m+"+"+y+"(?="+[a,p+f,"$"].join("|")+")",p+"?"+f+"+"+g,p+"+"+y,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",o,T].join("|"),"g");e.exports=function(e){return e.match(S)||[]}},3686:(e,t,i)=>{var s=i(8756),n=i(6983)((function(e,t,i){return t=t.toLowerCase(),e+(i?s(t):t)}));e.exports=n},8756:(e,t,i)=>{var s=i(3506),n=i(8580);e.exports=function(e){return n(s(e).toLowerCase())}},2160:(e,t,i)=>{var s=i(6397);e.exports=function(){if(!arguments.length)return[];var e=arguments[0];return s(e)?e:[e]}},3122:e=>{e.exports=function(e){return function(){return e}}},3768:(e,t,i)=>{var s=i(8795),n=i(3506),r=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,a=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");e.exports=function(e){return(e=n(e))&&e.replace(r,s).replace(a,"")}},9316:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},3406:(e,t,i)=>{var s=i(1044);e.exports=function(e){return null!=e&&e.length?s(e,1):[]}},2832:(e,t,i)=>{var s=i(7722);e.exports=function(e,t,i){var n=null==e?void 0:s(e,t);return void 0===n?i:n}},8235:(e,t,i)=>{var s=i(809),n=i(6866);e.exports=function(e,t){return null!=e&&n(e,t,s)}},4796:e=>{e.exports=function(e){return e}},1256:(e,t,i)=>{var s=i(9250),n=i(2934),r=Object.prototype,a=r.hasOwnProperty,o=r.propertyIsEnumerable,l=s(function(){return arguments}())?s:function(e){return n(e)&&a.call(e,"callee")&&!o.call(e,"callee")};e.exports=l},6397:e=>{var t=Array.isArray;e.exports=t},8330:(e,t,i)=>{var s=i(8446),n=i(3330);e.exports=function(e){return null!=e&&n(e.length)&&!s(e)}},492:(e,t,i)=>{e=i.nmd(e);var s=i(1433),n=i(659),r=t&&!t.nodeType&&t,a=r&&e&&!e.nodeType&&e,o=a&&a.exports===r?s.Buffer:void 0,l=(o?o.isBuffer:void 0)||n;e.exports=l},9040:(e,t,i)=>{var s=i(2934),n=i(4679);e.exports=function(e){return s(e)&&1===e.nodeType&&!n(e)}},5685:(e,t,i)=>{var s=i(1452),n=i(1201),r=i(1256),a=i(6397),o=i(8330),l=i(492),c=i(7499),u=i(7995),h=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(o(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||l(e)||u(e)||r(e)))return!e.length;var t=n(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(c(e))return!s(e).length;for(var i in e)if(h.call(e,i))return!1;return!0}},8446:(e,t,i)=>{var s=i(7148),n=i(8953);e.exports=function(e){if(!n(e))return!1;var t=s(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},3330:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},422:(e,t,i)=>{var s=i(4800),n=i(41),r=i(3685),a=r&&r.isMap,o=a?n(a):s;e.exports=o},8953:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},2934:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},4679:(e,t,i)=>{var s=i(7148),n=i(3347),r=i(2934),a=Function.prototype,o=Object.prototype,l=a.toString,c=o.hasOwnProperty,u=l.call(Object);e.exports=function(e){if(!r(e)||"[object Object]"!=s(e))return!1;var t=n(e);if(null===t)return!0;var i=c.call(t,"constructor")&&t.constructor;return"function"==typeof i&&i instanceof i&&l.call(i)==u}},3764:(e,t,i)=>{var s=i(7866),n=i(41),r=i(3685),a=r&&r.isSet,o=a?n(a):s;e.exports=o},7571:(e,t,i)=>{var s=i(7148),n=i(6397),r=i(2934);e.exports=function(e){return"string"==typeof e||!n(e)&&r(e)&&"[object String]"==s(e)}},5414:(e,t,i)=>{var s=i(7148),n=i(2934);e.exports=function(e){return"symbol"==typeof e||n(e)&&"[object Symbol]"==s(e)}},7995:(e,t,i)=>{var s=i(7129),n=i(41),r=i(3685),a=r&&r.isTypedArray,o=a?n(a):s;e.exports=o},1178:(e,t,i)=>{var s=i(1163),n=i(1452),r=i(8330);e.exports=function(e){return r(e)?s(e):n(e)}},5405:(e,t,i)=>{var s=i(1163),n=i(1491),r=i(8330);e.exports=function(e){return r(e)?s(e,!0):n(e)}},5342:e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},4556:(e,t,i)=>{var s=i(369);function n(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var i=function(){var s=arguments,n=t?t.apply(this,s):s[0],r=i.cache;if(r.has(n))return r.get(n);var a=e.apply(this,s);return i.cache=r.set(n,a)||r,a};return i.cache=new(n.Cache||s),i}n.Cache=s,e.exports=n},4319:(e,t,i)=>{var s=i(4272),n=i(2931),r=i(5263),a=i(7181),o=i(2083),l=i(7222),c=i(9820),u=i(9697),h=c((function(e,t){var i={};if(null==e)return i;var c=!1;t=s(t,(function(t){return t=a(t,e),c||(c=t.length>1),t})),o(e,u(e),i),c&&(i=n(i,7,l));for(var h=t.length;h--;)r(i,t[h]);return i}));e.exports=h},7171:(e,t,i)=>{var s=i(6733),n=i(9820)((function(e,t){return null==e?{}:s(e,t)}));e.exports=n},5072:(e,t,i)=>{var s=i(6983)((function(e,t,i){return e+(i?"_":"")+t.toLowerCase()}));e.exports=s},3629:e=>{e.exports=function(){return[]}},659:e=>{e.exports=function(){return!1}},3506:(e,t,i)=>{var s=i(6584);e.exports=function(e){return null==e?"":s(e)}},8580:(e,t,i)=>{var s=i(7383)("toUpperCase");e.exports=s},7385:(e,t,i)=>{var s=i(8273),n=i(5854),r=i(3506),a=i(5701);e.exports=function(e,t,i){return e=r(e),void 0===(t=i?void 0:t)?n(e)?a(e):s(e):e.match(t)||[]}},9910:(e,t,i)=>{var s=i(4390).getUint64;e.exports=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8)},n=12;0===i.version?(i.earliestPresentationTime=t.getUint32(n),i.firstOffset=t.getUint32(n+4),n+=8):(i.earliestPresentationTime=s(e.subarray(n)),i.firstOffset=s(e.subarray(n+8)),n+=16),n+=2;var r=t.getUint16(n);for(n+=2;r>0;n+=12,r--)i.references.push({referenceType:(128&e[n])>>>7,referencedSize:2147483647&t.getUint32(n),subsegmentDuration:t.getUint32(n+4),startsWithSap:!!(128&e[n+8]),sapType:(112&e[n+8])>>>4,sapDeltaTime:268435455&t.getUint32(n+8)});return i}},6946:e=>{var t,i,s,n,r,a,o,l=9e4;t=function(e){return e*l},i=function(e,t){return e*t},s=function(e){return e/l},n=function(e,t){return e/t},r=function(e,i){return t(n(e,i))},a=function(e,t){return i(s(e),t)},o=function(e,t,i){return s(i?e:e-t)},e.exports={ONE_SECOND_IN_TS:l,secondsToVideoTs:t,secondsToAudioTs:i,videoTsToSeconds:s,audioTsToSeconds:n,audioTsToVideoTs:r,videoTsToAudioTs:a,metadataTsToSeconds:o}},4390:e=>{var t=Math.pow(2,32);e.exports={getUint64:function(e){var i,s=new DataView(e.buffer,e.byteOffset,e.byteLength);return s.getBigUint64?(i=s.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(i):i:s.getUint32(0)*t+s.getUint32(4)},MAX_UINT32:t}},613:e=>{e.exports=function(e,t){var i,s=null;try{i=JSON.parse(e,t)}catch(e){s=e}return[s,i]}},8726:function(e){var t,i,s,n,r;t=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,s=/(?:\/|^)\.(?=\/)/g,n=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,r={buildAbsoluteURL:function(e,t,s){if(s=s||{},e=e.trim(),!(t=t.trim())){if(!s.alwaysNormalize)return e;var n=r.parseURL(e);if(!n)throw new Error("Error trying to parse base URL.");return n.path=r.normalizePath(n.path),r.buildURLFromParts(n)}var a=r.parseURL(t);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return s.alwaysNormalize?(a.path=r.normalizePath(a.path),r.buildURLFromParts(a)):t;var o=r.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var l=i.exec(o.path);o.netLoc=l[1],o.path=l[2]}o.netLoc&&!o.path&&(o.path="/");var c={scheme:o.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(c.netLoc=o.netLoc,"/"!==a.path[0]))if(a.path){var u=o.path,h=u.substring(0,u.lastIndexOf("/")+1)+a.path;c.path=r.normalizePath(h)}else c.path=o.path,a.params||(c.params=o.params,a.query||(c.query=o.query));return null===c.path&&(c.path=s.alwaysNormalize?r.normalizePath(a.path):a.path),r.buildURLFromParts(c)},parseURL:function(e){var i=t.exec(e);return i?{scheme:i[1]||"",netLoc:i[2]||"",path:i[3]||"",params:i[4]||"",query:i[5]||"",fragment:i[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(s,"");e.length!==(e=e.replace(n,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=r},6914:(e,t,i)=>{i.r(t),i.d(t,{default:()=>va});var s=i(5204),n=i.n(s),r=i(7509),a=i.n(r),o=i(8261),l=i.n(o),c=i(613),u=i.n(c),h=i(6e3),d=i.n(h),p=i(52),f=i.n(p);function m(){return m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},m.apply(this,arguments)}var g=i(8726),y=i.n(g);const v=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=n().location&&n().location.href||"");var i="function"==typeof n().URL,s=/^\/\//.test(e),r=!n().location&&!/\/\//i.test(e);if(i?e=new(n().URL)(e,n().location||"http://example.com"):/\/\//i.test(e)||(e=y().buildAbsoluteURL(n().location&&n().location.href||"",e)),i){var a=new URL(t,e);return r?a.href.slice(18):s?a.href.slice(a.protocol.length):a.href}return y().buildAbsoluteURL(e,t)};var _=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(i,1),i>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,s=0;s<i;++s)t[s].call(this,arguments[1]);else for(var n=Array.prototype.slice.call(arguments,1),r=t.length,a=0;a<r;++a)t[a].apply(this,n)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}();function b(e){for(var t,i=(t=e,n().atob?n().atob(t):Buffer.from(t,"base64").toString("binary")),s=new Uint8Array(i.length),r=0;r<i.length;r++)s[r]=i.charCodeAt(r);return s}class T extends _{constructor(){super(),this.buffer=""}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf("\n");t>-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const S=String.fromCharCode(9),w=function(e){const t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),i={};return t[1]&&(i.length=parseInt(t[1],10)),t[2]&&(i.offset=parseInt(t[2],10)),i},E=function(e){const t={};if(!e)return t;const i=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))'));let s,n=i.length;for(;n--;)""!==i[n]&&(s=/([^=]*)=(.*)/.exec(i[n]).slice(1),s[0]=s[0].replace(/^\s+|\s+$/g,""),s[1]=s[1].replace(/^\s+|\s+$/g,""),s[1]=s[1].replace(/^['"](.*)['"]$/g,"$1"),t[s[0]]=s[1]);return t};class C extends _{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,i;0!==(e=e.trim()).length&&("#"===e[0]?this.tagMappers.reduce(((t,i)=>{const s=i(e);return s===e?t:t.concat([s])}),[e]).forEach((e=>{for(let t=0;t<this.customParsers.length;t++)if(this.customParsers[t].call(this,e))return;if(0===e.indexOf("#EXT"))if(e=e.replace("\r",""),t=/^#EXTM3U/.exec(e),t)this.trigger("data",{type:"tag",tagType:"m3u"});else{if(t=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(e),t)return i={type:"tag",tagType:"inf"},t[1]&&(i.duration=parseFloat(t[1])),t[2]&&(i.title=t[2]),void this.trigger("data",i);if(t=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"targetduration"},t[1]&&(i.duration=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-VERSION:([0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"version"},t[1]&&(i.version=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"media-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(e),t)return i={type:"tag",tagType:"playlist-type"},t[1]&&(i.playlistType=t[1]),void this.trigger("data",i);if(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(e),t)return i=m(w(t[1]),{type:"tag",tagType:"byterange"}),void this.trigger("data",i);if(t=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(e),t)return i={type:"tag",tagType:"allow-cache"},t[1]&&(i.allowed=!/NO/.test(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-MAP:(.*)$/.exec(e),t){if(i={type:"tag",tagType:"map"},t[1]){const e=E(t[1]);e.URI&&(i.uri=e.URI),e.BYTERANGE&&(i.byterange=w(e.BYTERANGE))}this.trigger("data",i)}else if(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(e),t){if(i={type:"tag",tagType:"stream-inf"},t[1]){if(i.attributes=E(t[1]),i.attributes.RESOLUTION){const e=i.attributes.RESOLUTION.split("x"),t={};e[0]&&(t.width=parseInt(e[0],10)),e[1]&&(t.height=parseInt(e[1],10)),i.attributes.RESOLUTION=t}i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes["FRAME-RATE"]&&(i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])),i.attributes["PROGRAM-ID"]&&(i.attributes["PROGRAM-ID"]=parseInt(i.attributes["PROGRAM-ID"],10))}this.trigger("data",i)}else{if(t=/^#EXT-X-MEDIA:(.*)$/.exec(e),t)return i={type:"tag",tagType:"media"},t[1]&&(i.attributes=E(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-ENDLIST/.exec(e),t)this.trigger("data",{type:"tag",tagType:"endlist"});else if(t=/^#EXT-X-DISCONTINUITY/.exec(e),t)this.trigger("data",{type:"tag",tagType:"discontinuity"});else{if(t=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(e),t)return i={type:"tag",tagType:"program-date-time"},t[1]&&(i.dateTimeString=t[1],i.dateTimeObject=new Date(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-KEY:(.*)$/.exec(e),t)return i={type:"tag",tagType:"key"},t[1]&&(i.attributes=E(t[1]),i.attributes.IV&&("0x"===i.attributes.IV.substring(0,2).toLowerCase()&&(i.attributes.IV=i.attributes.IV.substring(2)),i.attributes.IV=i.attributes.IV.match(/.{8}/g),i.attributes.IV[0]=parseInt(i.attributes.IV[0],16),i.attributes.IV[1]=parseInt(i.attributes.IV[1],16),i.attributes.IV[2]=parseInt(i.attributes.IV[2],16),i.attributes.IV[3]=parseInt(i.attributes.IV[3],16),i.attributes.IV=new Uint32Array(i.attributes.IV))),void this.trigger("data",i);if(t=/^#EXT-X-START:(.*)$/.exec(e),t)return i={type:"tag",tagType:"start"},t[1]&&(i.attributes=E(t[1]),i.attributes["TIME-OFFSET"]=parseFloat(i.attributes["TIME-OFFSET"]),i.attributes.PRECISE=/YES/.test(i.attributes.PRECISE)),void this.trigger("data",i);if(t=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(e),t)return i={type:"tag",tagType:"cue-out-cont"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);if(t=/^#EXT-X-CUE-OUT:(.*)?$/.exec(e),t)return i={type:"tag",tagType:"cue-out"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);if(t=/^#EXT-X-CUE-IN:(.*)?$/.exec(e),t)return i={type:"tag",tagType:"cue-in"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);if(t=/^#EXT-X-SKIP:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"skip"},i.attributes=E(t[1]),i.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(i.attributes["SKIPPED-SEGMENTS"]=parseInt(i.attributes["SKIPPED-SEGMENTS"],10)),i.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(i.attributes["RECENTLY-REMOVED-DATERANGES"]=i.attributes["RECENTLY-REMOVED-DATERANGES"].split(S)),void this.trigger("data",i);if(t=/^#EXT-X-PART:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"part"},i.attributes=E(t[1]),["DURATION"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))})),["INDEPENDENT","GAP"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/.test(i.attributes[e]))})),i.attributes.hasOwnProperty("BYTERANGE")&&(i.attributes.byterange=w(i.attributes.BYTERANGE)),void this.trigger("data",i);if(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"server-control"},i.attributes=E(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))})),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/.test(i.attributes[e]))})),void this.trigger("data",i);if(t=/^#EXT-X-PART-INF:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"part-inf"},i.attributes=E(t[1]),["PART-TARGET"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))})),void this.trigger("data",i);if(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"preload-hint"},i.attributes=E(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach((function(e){if(i.attributes.hasOwnProperty(e)){i.attributes[e]=parseInt(i.attributes[e],10);const t="BYTERANGE-LENGTH"===e?"length":"offset";i.attributes.byterange=i.attributes.byterange||{},i.attributes.byterange[t]=i.attributes[e],delete i.attributes[e]}})),void this.trigger("data",i);if(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"rendition-report"},i.attributes=E(t[1]),["LAST-MSN","LAST-PART"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseInt(i.attributes[e],10))})),void this.trigger("data",i);if(t=/^#EXT-X-DATERANGE:(.*)$/.exec(e),t&&t[1]){i={type:"tag",tagType:"daterange"},i.attributes=E(t[1]),["ID","CLASS"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=String(i.attributes[e]))})),["START-DATE","END-DATE"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=new Date(i.attributes[e]))})),["DURATION","PLANNED-DURATION"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))})),["END-ON-NEXT"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/i.test(i.attributes[e]))})),["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=i.attributes[e].toString(16))}));const e=/^X-([A-Z]+-)+[A-Z]+$/;for(const t in i.attributes){if(!e.test(t))continue;const s=/[0-9A-Fa-f]{6}/g.test(i.attributes[t]),n=/^\d+(\.\d+)?$/.test(i.attributes[t]);i.attributes[t]=s?i.attributes[t].toString(16):n?parseFloat(i.attributes[t]):String(i.attributes[t])}this.trigger("data",i)}else if(t=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(e),t)this.trigger("data",{type:"tag",tagType:"independent-segments"});else{if(t=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(e),t)return i={type:"tag",tagType:"content-steering"},i.attributes=E(t[1]),void this.trigger("data",i);this.trigger("data",{type:"tag",data:e.slice(4)})}}}}else this.trigger("data",{type:"comment",text:e.slice(1)})})):this.trigger("data",{type:"uri",uri:e}))}addParser({expression:e,customType:t,dataParser:i,segment:s}){"function"!=typeof i&&(i=e=>e),this.customParsers.push((n=>{if(e.exec(n))return this.trigger("data",{type:"custom",data:i(n),customType:t,segment:s}),!0}))}addTagMapper({expression:e,map:t}){this.tagMappers.push((i=>e.test(i)?t(i):i))}}const x=function(e){const t={};return Object.keys(e).forEach((function(i){var s;t[(s=i,s.toLowerCase().replace(/-(\w)/g,(e=>e[1].toUpperCase())))]=e[i]})),t},k=function(e){const{serverControl:t,targetDuration:i,partTargetDuration:s}=e;if(!t)return;const n="#EXT-X-SERVER-CONTROL",r="holdBack",a="partHoldBack",o=i&&3*i,l=s&&2*s;i&&!t.hasOwnProperty(r)&&(t[r]=o,this.trigger("info",{message:`${n} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})),o&&t[r]<o&&(this.trigger("warn",{message:`${n} clamping HOLD-BACK (${t[r]}) to targetDuration * 3 (${o})`}),t[r]=o),s&&!t.hasOwnProperty(a)&&(t[a]=3*s,this.trigger("info",{message:`${n} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${t[a]}).`})),s&&t[a]<l&&(this.trigger("warn",{message:`${n} clamping PART-HOLD-BACK (${t[a]}) to partTargetDuration * 2 (${l}).`}),t[a]=l)};class A extends _{constructor(){super(),this.lineStream=new T,this.parseStream=new C,this.lineStream.pipe(this.parseStream),this.lastProgramDateTime=null;const e=this,t=[];let i,s,n={},r=!1;const a=function(){},o={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}};let l=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],segments:[]};let c=0,u=0;const h={};this.on("end",(()=>{n.uri||!n.parts&&!n.preloadHints||(!n.map&&i&&(n.map=i),!n.key&&s&&(n.key=s),n.timeline||"number"!=typeof l||(n.timeline=l),this.manifest.preloadSegment=n)})),this.parseStream.on("data",(function(d){let p,f;({tag(){({version(){d.version&&(this.manifest.version=d.version)},"allow-cache"(){this.manifest.allowCache=d.allowed,"allowed"in d||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const e={};"length"in d&&(n.byterange=e,e.length=d.length,"offset"in d||(d.offset=c)),"offset"in d&&(n.byterange=e,e.offset=d.offset),c=e.offset+e.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),d.title&&(n.title=d.title),d.duration>0&&(n.duration=d.duration),0===d.duration&&(n.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=t},key(){if(d.attributes)if("NONE"!==d.attributes.METHOD)if(d.attributes.URI){if("com.apple.streamingkeydelivery"===d.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:d.attributes});if("com.microsoft.playready"===d.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.microsoft.playready"]={uri:d.attributes.URI});if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===d.attributes.KEYFORMAT)return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(d.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===d.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==d.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):d.attributes.KEYID&&"0x"===d.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:d.attributes.KEYFORMAT,keyId:d.attributes.KEYID.substring(2)},pssh:b(d.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}));d.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),s={method:d.attributes.METHOD||"AES-128",uri:d.attributes.URI},void 0!==d.attributes.IV&&(s.iv=d.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else s=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence"(){isFinite(d.number)?this.manifest.mediaSequence=d.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+d.number})},"discontinuity-sequence"(){isFinite(d.number)?(this.manifest.discontinuitySequence=d.number,l=d.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+d.number})},"playlist-type"(){/VOD|EVENT/.test(d.playlistType)?this.manifest.playlistType=d.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+d.playlist})},map(){i={},d.uri&&(i.uri=d.uri),d.byterange&&(i.byterange=d.byterange),s&&(i.key=s)},"stream-inf"(){this.manifest.playlists=t,this.manifest.mediaGroups=this.manifest.mediaGroups||o,d.attributes?(n.attributes||(n.attributes={}),m(n.attributes,d.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||o,!(d.attributes&&d.attributes.TYPE&&d.attributes["GROUP-ID"]&&d.attributes.NAME))return void this.trigger("warn",{message:"ignoring incomplete or missing media group"});const e=this.manifest.mediaGroups[d.attributes.TYPE];e[d.attributes["GROUP-ID"]]=e[d.attributes["GROUP-ID"]]||{},p=e[d.attributes["GROUP-ID"]],f={default:/yes/i.test(d.attributes.DEFAULT)},f.default?f.autoselect=!0:f.autoselect=/yes/i.test(d.attributes.AUTOSELECT),d.attributes.LANGUAGE&&(f.language=d.attributes.LANGUAGE),d.attributes.URI&&(f.uri=d.attributes.URI),d.attributes["INSTREAM-ID"]&&(f.instreamId=d.attributes["INSTREAM-ID"]),d.attributes.CHARACTERISTICS&&(f.characteristics=d.attributes.CHARACTERISTICS),d.attributes.FORCED&&(f.forced=/yes/i.test(d.attributes.FORCED)),p[d.attributes.NAME]=f},discontinuity(){l+=1,n.discontinuity=!0,this.manifest.discontinuityStarts.push(t.length)},"program-date-time"(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=d.dateTimeString,this.manifest.dateTimeObject=d.dateTimeObject),n.dateTimeString=d.dateTimeString,n.dateTimeObject=d.dateTimeObject;const{lastProgramDateTime:e}=this;this.lastProgramDateTime=new Date(d.dateTimeString).getTime(),null===e&&this.manifest.segments.reduceRight(((e,t)=>(t.programDateTime=e-1e3*t.duration,t.programDateTime)),this.lastProgramDateTime)},targetduration(){!isFinite(d.duration)||d.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+d.duration}):(this.manifest.targetDuration=d.duration,k.call(this,this.manifest))},start(){d.attributes&&!isNaN(d.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:d.attributes["TIME-OFFSET"],precise:d.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out"(){n.cueOut=d.data},"cue-out-cont"(){n.cueOutCont=d.data},"cue-in"(){n.cueIn=d.data},skip(){this.manifest.skip=x(d.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",d.attributes,["SKIPPED-SEGMENTS"])},part(){r=!0;const e=this.manifest.segments.length,t=x(d.attributes);n.parts=n.parts||[],n.parts.push(t),t.byterange&&(t.byterange.hasOwnProperty("offset")||(t.byterange.offset=u),u=t.byterange.offset+t.byterange.length);const i=n.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${i} for segment #${e}`,d.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(((e,t)=>{e.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${t} lacks required attribute(s): LAST-PART`})}))},"server-control"(){const e=this.manifest.serverControl=x(d.attributes);e.hasOwnProperty("canBlockReload")||(e.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),k.call(this,this.manifest),e.canSkipDateranges&&!e.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const e=this.manifest.segments.length,t=x(d.attributes),i=t.type&&"PART"===t.type;n.preloadHints=n.preloadHints||[],n.preloadHints.push(t),t.byterange&&(t.byterange.hasOwnProperty("offset")||(t.byterange.offset=i?u:0,i&&(u=t.byterange.offset+t.byterange.length)));const s=n.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${s} for segment #${e}`,d.attributes,["TYPE","URI"]),t.type)for(let i=0;i<n.preloadHints.length-1;i++){const r=n.preloadHints[i];r.type&&r.type===t.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${s} for segment #${e} has the same TYPE ${t.type} as preload hint #${i}`})}},"rendition-report"(){const e=x(d.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(e);const t=this.manifest.renditionReports.length-1,i=["LAST-MSN","URI"];r&&i.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${t}`,d.attributes,i)},"part-inf"(){this.manifest.partInf=x(d.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",d.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),k.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(x(d.attributes));const e=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${e}`,d.attributes,["ID","START-DATE"]);const t=this.manifest.dateRanges[e];t.endDate&&t.startDate&&new Date(t.endDate)<new Date(t.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),t.duration&&t.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),t.plannedDuration&&t.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});const i=!!t.endOnNext;if(i&&!t.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute"}),i&&(t.duration||t.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),t.duration&&t.endDate){const i=t.startDate.getTime()+1e3*t.duration;this.manifest.dateRanges[e].endDate=new Date(i)}if(h[t.id]){for(const e in h[t.id])if(t[e]&&JSON.stringify(h[t.id][e])!==JSON.stringify(t[e])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}const e=this.manifest.dateRanges.findIndex((e=>e.id===t.id));this.manifest.dateRanges[e]=m(this.manifest.dateRanges[e],t),h[t.id]=m(h[t.id],t),this.manifest.dateRanges.pop()}else h[t.id]=t},"independent-segments"(){this.manifest.independentSegments=!0},"content-steering"(){this.manifest.contentSteering=x(d.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",d.attributes,["SERVER-URI"])}}[d.tagType]||a).call(e)},uri(){n.uri=d.uri,t.push(n),this.manifest.targetDuration&&!("duration"in n)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),n.duration=this.manifest.targetDuration),s&&(n.key=s),n.timeline=l,i&&(n.map=i),u=0,null!==this.lastProgramDateTime&&(n.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=1e3*n.duration),n={}},comment(){},custom(){d.segment?(n.custom=n.custom||{},n.custom[d.customType]=d.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[d.customType]=d.data)}})[d.type].call(e)}))}warnOnMissingAttributes_(e,t,i){const s=[];i.forEach((function(e){t.hasOwnProperty(e)||s.push(e)})),s.length&&this.trigger("warn",{message:`${e} lacks required attribute(s): ${s.join(", ")}`})}push(e){this.lineStream.push(e)}end(){this.lineStream.push("\n"),this.manifest.dateRanges.length&&null===this.lastProgramDateTime&&this.trigger("warn",{message:"A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"}),this.lastProgramDateTime=null,this.trigger("end")}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}}var I,P,O={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^/},L=["video","audio","text"],D=["Video","Audio","Text"],R=function(e){return e?e.replace(/avc1\.(\d+)\.(\d+)/i,(function(e,t,i){return"avc1."+("00"+Number(t).toString(16)).slice(-2)+"00"+("00"+Number(i).toString(16)).slice(-2)})):e},N=function(e){void 0===e&&(e="");var t=e.split(","),i=[];return t.forEach((function(e){var t;e=e.trim(),L.forEach((function(s){var n=O[s].exec(e.toLowerCase());if(n&&!(n.length<=1)){t=s;var r=e.substring(0,n[1].length),a=e.replace(r,"");i.push({type:r,details:a,mediaType:s})}})),t||i.push({type:e,details:"",mediaType:"unknown"})})),i},M=function(e){return void 0===e&&(e=""),O.audio.test(e.trim().toLowerCase())},j=function(e){if(e&&"string"==typeof e){var t,i=e.toLowerCase().split(",").map((function(e){return R(e.trim())})),s="video";1===i.length&&M(i[0])?s="audio":1===i.length&&(void 0===(t=i[0])&&(t=""),O.text.test(t.trim().toLowerCase()))&&(s="application");var n="mp4";return i.every((function(e){return O.mp4.test(e)}))?n="mp4":i.every((function(e){return O.webm.test(e)}))?n="webm":i.every((function(e){return O.ogg.test(e)}))&&(n="ogg"),s+"/"+n+';codecs="'+e+'"'}},U=function(e){return void 0===e&&(e=""),n().MediaSource&&n().MediaSource.isTypeSupported&&n().MediaSource.isTypeSupported(j(e))||!1},B=function(e){return void 0===e&&(e=""),e.toLowerCase().split(",").every((function(e){e=e.trim();for(var t=0;t<D.length;t++)if(O["muxer"+D[t]].test(e))return!0;return!1}))},F="mp4a.40.2",q=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,$=/^application\/dash\+xml/i,H=function(e){return q.test(e)?"hls":$.test(e)?"dash":"application/vnd.videojs.vhs+json"===e?"vhs-json":null},V=function(e){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},z=function(e){return e instanceof Uint8Array?e:(Array.isArray(e)||V(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))},W=n().BigInt||Number,G=[W("0x1"),W("0x100"),W("0x10000"),W("0x1000000"),W("0x100000000"),W("0x10000000000"),W("0x1000000000000"),W("0x100000000000000"),W("0x10000000000000000")],X=(I=new Uint16Array([65484]),255===(P=new Uint8Array(I.buffer,I.byteOffset,I.byteLength))[0]||P[0],function(e,t){var i=void 0===t?{}:t,s=i.signed,n=void 0!==s&&s,r=i.le,a=void 0!==r&&r;e=z(e);var o=a?"reduce":"reduceRight",l=(e[o]?e[o]:Array.prototype[o]).call(e,(function(t,i,s){var n=a?s:Math.abs(s+1-e.length);return t+W(i)*G[n]}),W(0));if(n){var c=G[e.length]/W(2)-W(1);(l=W(l))>c&&(l-=c,l-=c,l-=W(2))}return Number(l)}),Y=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 i=new Uint8Array(e.length),s=0;s<e.length;s++)i[s]=e.charCodeAt(s);return i},K=function(e,t,i){var s=void 0===i?{}:i,n=s.offset,r=void 0===n?0:n,a=s.mask,o=void 0===a?[]:a;e=z(e);var l=(t=z(t)).every?t.every:Array.prototype.every;return t.length&&e.length-r>=t.length&&l.call(t,(function(t,i){return t===(o[i]?o[i]&e[r+i]:e[r+i])}))};var Q=i(2854);const J=e=>!!e&&"object"==typeof e,Z=(...e)=>e.reduce(((e,t)=>("object"!=typeof t||Object.keys(t).forEach((i=>{Array.isArray(e[i])&&Array.isArray(t[i])?e[i]=e[i].concat(t[i]):J(e[i])&&J(t[i])?e[i]=Z(e[i],t[i]):e[i]=t[i]})),e)),{}),ee=e=>Object.keys(e).map((t=>e[t])),te=e=>e.reduce(((e,t)=>e.concat(t)),[]),ie=e=>{if(!e.length)return[];const t=[];for(let i=0;i<e.length;i++)t.push(e[i]);return t};const se=({baseUrl:e="",source:t="",range:i="",indexRange:s=""})=>{const r={uri:t,resolvedUri:v(e||"",t)};if(i||s){const e=(i||s).split("-");let t,a=n().BigInt?n().BigInt(e[0]):parseInt(e[0],10),o=n().BigInt?n().BigInt(e[1]):parseInt(e[1],10);a<Number.MAX_SAFE_INTEGER&&"bigint"==typeof a&&(a=Number(a)),o<Number.MAX_SAFE_INTEGER&&"bigint"==typeof o&&(o=Number(o)),t="bigint"==typeof o||"bigint"==typeof a?n().BigInt(o)-n().BigInt(a)+n().BigInt(1):o-a+1,"bigint"==typeof t&&t<Number.MAX_SAFE_INTEGER&&(t=Number(t)),r.byterange={length:t,offset:a}}return r},ne=e=>(e&&"number"!=typeof e&&(e=parseInt(e,10)),isNaN(e)?null:e),re={static(e){const{duration:t,timescale:i=1,sourceDuration:s,periodDuration:n}=e,r=ne(e.endNumber),a=t/i;return"number"==typeof r?{start:0,end:r}:"number"==typeof n?{start:0,end:n/a}:{start:0,end:s/a}},dynamic(e){const{NOW:t,clientOffset:i,availabilityStartTime:s,timescale:n=1,duration:r,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:l=1/0}=e,c=ne(e.endNumber),u=(t+i)/1e3,h=s+a,d=u+o-h,p=Math.ceil(d*n/r),f=Math.floor((u-h-l)*n/r),m=Math.floor((u-h)*n/r);return{start:Math.max(0,f),end:"number"==typeof c?c:Math.min(p,m)}}},ae=e=>{const{type:t,duration:i,timescale:s=1,periodDuration:n,sourceDuration:r}=e,{start:a,end:o}=re[t](e),l=((e,t)=>{const i=[];for(let s=e;s<t;s++)i.push(s);return i})(a,o).map((e=>t=>{const{duration:i,timescale:s=1,periodStart:n,startNumber:r=1}=e;return{number:r+t,duration:i/s,timeline:n,time:t*i}})(e));if("static"===t){const e=l.length-1,t="number"==typeof n?n:r;l[e].duration=t-i/s*e}return l},oe=e=>{const{baseUrl:t,initialization:i={},sourceDuration:s,indexRange:n="",periodStart:r,presentationTime:a,number:o=0,duration:l}=e;if(!t)throw new Error("NO_BASE_URL");const c=se({baseUrl:t,source:i.sourceURL,range:i.range}),u=se({baseUrl:t,source:t,indexRange:n});if(u.map=c,l){const t=ae(e);t.length&&(u.duration=t[0].duration,u.timeline=t[0].timeline)}else s&&(u.duration=s,u.timeline=r);return u.presentationTime=a||r,u.number=o,[u]},le=(e,t,i)=>{const s=e.sidx.map?e.sidx.map:null,r=e.sidx.duration,a=e.timeline||0,o=e.sidx.byterange,l=o.offset+o.length,c=t.timescale,u=t.references.filter((e=>1!==e.referenceType)),h=[],d=e.endList?"static":"dynamic",p=e.sidx.timeline;let f,m=p,g=e.mediaSequence||0;f="bigint"==typeof t.firstOffset?n().BigInt(l)+t.firstOffset:l+t.firstOffset;for(let e=0;e<u.length;e++){const o=t.references[e],l=o.referencedSize,u=o.subsegmentDuration;let y;y="bigint"==typeof f?f+n().BigInt(l)-n().BigInt(1):f+l-1;const v=oe({baseUrl:i,timescale:c,timeline:a,periodStart:p,presentationTime:m,number:g,duration:u,sourceDuration:r,indexRange:`${f}-${y}`,type:d})[0];s&&(v.map=s),h.push(v),f+="bigint"==typeof f?n().BigInt(l):l,m+=u/c,g++}return e.segments=h,e},ce=["AUDIO","SUBTITLES"],ue=1/60,he=e=>{return(t=e,i=({timeline:e})=>e,ee(t.reduce(((e,t)=>(t.forEach((t=>{e[i(t)]=t})),e)),{}))).sort(((e,t)=>e.timeline>t.timeline?1:-1));var t,i},de=e=>{let t=[];var i,s;return i=e,s=(e,i,s,n)=>{t=t.concat(e.playlists||[])},ce.forEach((function(e){for(var t in i.mediaGroups[e])for(var n in i.mediaGroups[e][t]){var r=i.mediaGroups[e][t][n];s(r)}})),t},pe=({playlist:e,mediaSequence:t})=>{e.mediaSequence=t,e.segments.forEach(((t,i)=>{t.number=e.mediaSequence+i}))},fe=e=>e&&e.uri+"-"+(e=>{let t;return t="bigint"==typeof e.offset||"bigint"==typeof e.length?n().BigInt(e.offset)+n().BigInt(e.length)-n().BigInt(1):e.offset+e.length-1,`${e.offset}-${t}`})(e.byterange),me=e=>{const t=e.reduce((function(e,t){return e[t.attributes.baseUrl]||(e[t.attributes.baseUrl]=[]),e[t.attributes.baseUrl].push(t),e}),{});let i=[];return Object.values(t).forEach((e=>{const t=ee(e.reduce(((e,t)=>{const i=t.attributes.id+(t.attributes.lang||"");return e[i]?(t.segments&&(t.segments[0]&&(t.segments[0].discontinuity=!0),e[i].segments.push(...t.segments)),t.attributes.contentProtection&&(e[i].attributes.contentProtection=t.attributes.contentProtection)):(e[i]=t,e[i].attributes.timelineStarts=[]),e[i].attributes.timelineStarts.push({start:t.attributes.periodStart,timeline:t.attributes.periodStart}),e}),{}));i=i.concat(t)})),i.map((e=>{var t;return e.discontinuityStarts=(t=e.segments||[],"discontinuity",t.reduce(((e,t,i)=>(t.discontinuity&&e.push(i),e)),[])),e}))},ge=(e,t)=>{const i=fe(e.sidx),s=i&&t[i]&&t[i].sidx;return s&&le(e,s,e.sidx.resolvedUri),e},ye=(e,t={})=>{if(!Object.keys(t).length)return e;for(const i in e)e[i]=ge(e[i],t);return e},ve=({attributes:e,segments:t,sidx:i,discontinuityStarts:s})=>{const n={attributes:{NAME:e.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:e.width,height:e.height},CODECS:e.codecs,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1},uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuityStarts:s,timelineStarts:e.timelineStarts,segments:t};return e.frameRate&&(n.attributes["FRAME-RATE"]=e.frameRate),e.contentProtection&&(n.contentProtection=e.contentProtection),e.serviceLocation&&(n.attributes.serviceLocation=e.serviceLocation),i&&(n.sidx=i),n},_e=({attributes:e})=>"video/mp4"===e.mimeType||"video/webm"===e.mimeType||"video"===e.contentType,be=({attributes:e})=>"audio/mp4"===e.mimeType||"audio/webm"===e.mimeType||"audio"===e.contentType,Te=({attributes:e})=>"text/vtt"===e.mimeType||"text"===e.contentType,Se=e=>e?Object.keys(e).reduce(((t,i)=>{const s=e[i];return t.concat(s.playlists)}),[]):[],we=({dashPlaylists:e,locations:t,contentSteering:i,sidxMapping:s={},previousManifest:n,eventStream:r})=>{if(!e.length)return{};const{sourceDuration:a,type:o,suggestedPresentationDelay:l,minimumUpdatePeriod:c}=e[0].attributes,u=me(e.filter(_e)).map(ve),h=me(e.filter(be)),d=me(e.filter(Te)),p=e.map((e=>e.attributes.captionServices)).filter(Boolean),f={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:ye(u,s)};c>=0&&(f.minimumUpdatePeriod=1e3*c),t&&(f.locations=t),i&&(f.contentSteering=i),"dynamic"===o&&(f.suggestedPresentationDelay=l),r&&r.length>0&&(f.eventStream=r);const m=0===f.playlists.length,g=h.length?((e,t={},i=!1)=>{let s;const n=e.reduce(((e,n)=>{const r=n.attributes.role&&n.attributes.role.value||"",a=n.attributes.lang||"";let o=n.attributes.label||"main";if(a&&!n.attributes.label){const e=r?` (${r})`:"";o=`${n.attributes.lang}${e}`}e[o]||(e[o]={language:a,autoselect:!0,default:"main"===r,playlists:[],uri:""});const l=ge((({attributes:e,segments:t,sidx:i,mediaSequence:s,discontinuitySequence:n,discontinuityStarts:r},a)=>{const o={attributes:{NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs,"PROGRAM-ID":1},uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuitySequence:n,discontinuityStarts:r,timelineStarts:e.timelineStarts,mediaSequence:s,segments:t};return e.contentProtection&&(o.contentProtection=e.contentProtection),e.serviceLocation&&(o.attributes.serviceLocation=e.serviceLocation),i&&(o.sidx=i),a&&(o.attributes.AUDIO="audio",o.attributes.SUBTITLES="subs"),o})(n,i),t);return e[o].playlists.push(l),void 0===s&&"main"===r&&(s=n,s.default=!0),e}),{});return s||(n[Object.keys(n)[0]].default=!0),n})(h,s,m):null,y=d.length?((e,t={})=>e.reduce(((e,i)=>{const s=i.attributes.label||i.attributes.lang||"text";return e[s]||(e[s]={language:s,default:!1,autoselect:!1,playlists:[],uri:""}),e[s].playlists.push(ge((({attributes:e,segments:t,mediaSequence:i,discontinuityStarts:s,discontinuitySequence:n})=>{void 0===t&&(t=[{uri:e.baseUrl,timeline:e.periodStart,resolvedUri:e.baseUrl||"",duration:e.sourceDuration,number:0}],e.duration=e.sourceDuration);const r={NAME:e.id,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1};e.codecs&&(r.CODECS=e.codecs);const a={attributes:r,uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,timelineStarts:e.timelineStarts,discontinuityStarts:s,discontinuitySequence:n,mediaSequence:i,segments:t};return e.serviceLocation&&(a.attributes.serviceLocation=e.serviceLocation),a})(i),t)),e}),{}))(d,s):null,v=u.concat(Se(g),Se(y)),_=v.map((({timelineStarts:e})=>e));var b,T;return f.timelineStarts=he(_),b=v,T=f.timelineStarts,b.forEach((e=>{e.mediaSequence=0,e.discontinuitySequence=T.findIndex((function({timeline:t}){return t===e.timeline})),e.segments&&e.segments.forEach(((e,t)=>{e.number=t}))})),g&&(f.mediaGroups.AUDIO.audio=g),y&&(f.mediaGroups.SUBTITLES.subs=y),p.length&&(f.mediaGroups["CLOSED-CAPTIONS"].cc=p.reduce(((e,t)=>t?(t.forEach((t=>{const{channel:i,language:s}=t;e[s]={autoselect:!1,default:!1,instreamId:i,language:s},t.hasOwnProperty("aspectRatio")&&(e[s].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[s].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[s]["3D"]=t["3D"])})),e):e),{})),n?(({oldManifest:e,newManifest:t})=>{const i=e.playlists.concat(de(e)),s=t.playlists.concat(de(t));return t.timelineStarts=he([e.timelineStarts,t.timelineStarts]),(({oldPlaylists:e,newPlaylists:t,timelineStarts:i})=>{t.forEach((t=>{t.discontinuitySequence=i.findIndex((function({timeline:e}){return e===t.timeline}));const s=((e,t)=>{for(let i=0;i<e.length;i++)if(e[i].attributes.NAME===t)return e[i];return null})(e,t.attributes.NAME);if(!s)return;if(t.sidx)return;const n=t.segments[0],r=s.segments.findIndex((function(e){return Math.abs(e.presentationTime-n.presentationTime)<ue}));if(-1===r)return pe({playlist:t,mediaSequence:s.mediaSequence+s.segments.length}),t.segments[0].discontinuity=!0,t.discontinuityStarts.unshift(0),void((!s.segments.length&&t.timeline>s.timeline||s.segments.length&&t.timeline>s.segments[s.segments.length-1].timeline)&&t.discontinuitySequence--);s.segments[r].discontinuity&&!n.discontinuity&&(n.discontinuity=!0,t.discontinuityStarts.unshift(0),t.discontinuitySequence--),pe({playlist:t,mediaSequence:s.segments[r].number})}))})({oldPlaylists:i,newPlaylists:s,timelineStarts:t.timelineStarts}),t})({oldManifest:n,newManifest:f}):f},Ee=(e,t,i)=>{const{NOW:s,clientOffset:n,availabilityStartTime:r,timescale:a=1,periodStart:o=0,minimumUpdatePeriod:l=0}=e,c=(s+n)/1e3+l-(r+o);return Math.ceil((c*a-t)/i)},Ce=(e,t)=>{const{type:i,minimumUpdatePeriod:s=0,media:n="",sourceDuration:r,timescale:a=1,startNumber:o=1,periodStart:l}=e,c=[];let u=-1;for(let h=0;h<t.length;h++){const d=t[h],p=d.d,f=d.r||0,m=d.t||0;let g;if(u<0&&(u=m),m&&m>u&&(u=m),f<0){const o=h+1;g=o===t.length?"dynamic"===i&&s>0&&n.indexOf("$Number$")>0?Ee(e,u,p):(r*a-u)/p:(t[o].t-u)/p}else g=f+1;const y=o+c.length+g;let v=o+c.length;for(;v<y;)c.push({number:v,duration:p/a,time:u,timeline:l}),u+=p,v++}return c},xe=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,ke=(e,t)=>e.replace(xe,(e=>(t,i,s,n)=>{if("$$"===t)return"$";if(void 0===e[i])return t;const r=""+e[i];return"RepresentationID"===i?r:(n=s?parseInt(n,10):1,r.length>=n?r:`${new Array(n-r.length+1).join("0")}${r}`)})(t)),Ae=(e,t)=>{const i={RepresentationID:e.id,Bandwidth:e.bandwidth||0},{initialization:s={sourceURL:"",range:""}}=e,n=se({baseUrl:e.baseUrl,source:ke(s.sourceURL,i),range:s.range}),r=((e,t)=>e.duration||t?e.duration?ae(e):Ce(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}])(e,t);return r.map((t=>{i.Number=t.number,i.Time=t.time;const s=ke(e.media||"",i),r=e.timescale||1,a=e.presentationTimeOffset||0,o=e.periodStart+(t.time-a)/r;return{uri:s,timeline:t.timeline,duration:t.duration,resolvedUri:v(e.baseUrl||"",s),map:n,number:t.number,presentationTime:o}}))},Ie=(e,t)=>{const{duration:i,segmentUrls:s=[],periodStart:n}=e;if(!i&&!t||i&&t)throw new Error("SEGMENT_TIME_UNSPECIFIED");const r=s.map((t=>((e,t)=>{const{baseUrl:i,initialization:s={}}=e,n=se({baseUrl:i,source:s.sourceURL,range:s.range}),r=se({baseUrl:i,source:t.media,range:t.mediaRange});return r.map=n,r})(e,t)));let a;return i&&(a=ae(e)),t&&(a=Ce(e,t)),a.map(((t,i)=>{if(r[i]){const s=r[i],a=e.timescale||1,o=e.presentationTimeOffset||0;return s.timeline=t.timeline,s.duration=t.duration,s.number=t.number,s.presentationTime=n+(t.time-o)/a,s}})).filter((e=>e))},Pe=({attributes:e,segmentInfo:t})=>{let i,s;t.template?(s=Ae,i=Z(e,t.template)):t.base?(s=oe,i=Z(e,t.base)):t.list&&(s=Ie,i=Z(e,t.list));const n={attributes:e};if(!s)return n;const r=s(i,t.segmentTimeline);if(i.duration){const{duration:e,timescale:t=1}=i;i.duration=e/t}else r.length?i.duration=r.reduce(((e,t)=>Math.max(e,Math.ceil(t.duration))),0):i.duration=0;return n.attributes=i,n.segments=r,t.base&&i.indexRange&&(n.sidx=r[0],n.segments=[]),n},Oe=(e,t)=>ie(e.childNodes).filter((({tagName:e})=>e===t)),Le=e=>e.textContent.trim(),De=e=>{const t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t)return 0;const[i,s,n,r,a,o]=t.slice(1);return 31536e3*parseFloat(i||0)+2592e3*parseFloat(s||0)+86400*parseFloat(n||0)+3600*parseFloat(r||0)+60*parseFloat(a||0)+parseFloat(o||0)},Re={mediaPresentationDuration:e=>De(e),availabilityStartTime(e){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t=e)&&(t+="Z"),Date.parse(t)/1e3;var t},minimumUpdatePeriod:e=>De(e),suggestedPresentationDelay:e=>De(e),type:e=>e,timeShiftBufferDepth:e=>De(e),start:e=>De(e),width:e=>parseInt(e,10),height:e=>parseInt(e,10),bandwidth:e=>parseInt(e,10),frameRate:e=>(e=>parseFloat(e.split("/").reduce(((e,t)=>e/t))))(e),startNumber:e=>parseInt(e,10),timescale:e=>parseInt(e,10),presentationTimeOffset:e=>parseInt(e,10),duration(e){const t=parseInt(e,10);return isNaN(t)?De(e):t},d:e=>parseInt(e,10),t:e=>parseInt(e,10),r:e=>parseInt(e,10),presentationTime:e=>parseInt(e,10),DEFAULT:e=>e},Ne=e=>e&&e.attributes?ie(e.attributes).reduce(((e,t)=>{const i=Re[t.name]||Re.DEFAULT;return e[t.name]=i(t.value),e}),{}):{},Me={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},je=(e,t)=>t.length?te(e.map((function(e){return t.map((function(t){const i=Le(t),s=v(e.baseUrl,i),n=Z(Ne(t),{baseUrl:s});return s!==i&&!n.serviceLocation&&e.serviceLocation&&(n.serviceLocation=e.serviceLocation),n}))}))):e,Ue=e=>{const t=Oe(e,"SegmentTemplate")[0],i=Oe(e,"SegmentList")[0],s=i&&Oe(i,"SegmentURL").map((e=>Z({tag:"SegmentURL"},Ne(e)))),n=Oe(e,"SegmentBase")[0],r=i||t,a=r&&Oe(r,"SegmentTimeline")[0],o=i||n||t,l=o&&Oe(o,"Initialization")[0],c=t&&Ne(t);c&&l?c.initialization=l&&Ne(l):c&&c.initialization&&(c.initialization={sourceURL:c.initialization});const u={template:c,segmentTimeline:a&&Oe(a,"S").map((e=>Ne(e))),list:i&&Z(Ne(i),{segmentUrls:s,initialization:Ne(l)}),base:n&&Z(Ne(n),{initialization:Ne(l)})};return Object.keys(u).forEach((e=>{u[e]||delete u[e]})),u},Be=e=>te(Oe(e.node,"EventStream").map((t=>{const i=Ne(t),s=i.schemeIdUri;return Oe(t,"Event").map((t=>{const n=Ne(t),r=n.presentationTime||0,a=i.timescale||1,o=n.duration||0,l=r/a+e.attributes.start;return{schemeIdUri:s,value:i.value,id:n.id,start:l,end:l+o/a,messageData:Le(t)||n.messageData,contentEncoding:i.contentEncoding,presentationTimeOffset:i.presentationTimeOffset||0}}))}))),Fe=(e,t,i)=>s=>{const r=Ne(s),a=je(t,Oe(s,"BaseURL")),o=Oe(s,"Role")[0],l={role:Ne(o)};let c=Z(e,r,l);const u=Oe(s,"Accessibility")[0],h="urn:scte:dash:cc:cea-608:2015"===(d=Ne(u)).schemeIdUri?("string"!=typeof d.value?[]:d.value.split(";")).map((e=>{let t,i;return i=e,/^CC\d=/.test(e)?[t,i]=e.split("="):/^CC\d$/.test(e)&&(t=e),{channel:t,language:i}})):"urn:scte:dash:cc:cea-708:2015"===d.schemeIdUri?("string"!=typeof d.value?[]:d.value.split(";")).map((e=>{const t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){const[i,s=""]=e.split("=");t.channel=i,t.language=e,s.split(",").forEach((e=>{const[i,s]=e.split(":");"lang"===i?t.language=s:"er"===i?t.easyReader=Number(s):"war"===i?t.aspectRatio=Number(s):"3D"===i&&(t["3D"]=Number(s))}))}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t})):void 0;var d;h&&(c=Z(c,{captionServices:h}));const p=Oe(s,"Label")[0];if(p&&p.childNodes.length){const e=p.childNodes[0].nodeValue.trim();c=Z(c,{label:e})}const f=Oe(s,"ContentProtection").reduce(((e,t)=>{const i=Ne(t);i.schemeIdUri&&(i.schemeIdUri=i.schemeIdUri.toLowerCase());const s=Me[i.schemeIdUri];if(s){e[s]={attributes:i};const r=Oe(t,"cenc:pssh")[0];if(r){const t=Le(r);e[s].pssh=t&&function(e){for(var t,i=(t=e,n().atob?n().atob(t):Buffer.from(t,"base64").toString("binary")),s=new Uint8Array(i.length),r=0;r<i.length;r++)s[r]=i.charCodeAt(r);return s}(t)}}return e}),{});Object.keys(f).length&&(c=Z(c,{contentProtection:f}));const m=Ue(s),g=Oe(s,"Representation"),y=Z(i,m);return te(g.map(((e,t,i)=>s=>{const n=Oe(s,"BaseURL"),r=je(t,n),a=Z(e,Ne(s)),o=Ue(s);return r.map((e=>({segmentInfo:Z(i,o),attributes:Z(a,e)})))})(c,a,y)))},qe=(e,t)=>(i,s)=>{const n=je(t,Oe(i.node,"BaseURL")),r=Z(e,{periodStart:i.attributes.start});"number"==typeof i.attributes.duration&&(r.periodDuration=i.attributes.duration);const a=Oe(i.node,"AdaptationSet"),o=Ue(i.node);return te(a.map(Fe(r,n,o)))},$e=(e,t)=>{if(e.length>1&&t({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!e.length)return null;const i=Z({serverURL:Le(e[0])},Ne(e[0]));return i.queryBeforeStart="true"===i.queryBeforeStart,i},He=e=>{if(""===e)throw new Error("DASH_EMPTY_MANIFEST");const t=new Q.DOMParser;let i,s;try{i=t.parseFromString(e,"application/xml"),s=i&&"MPD"===i.documentElement.tagName?i.documentElement:null}catch(e){}if(!s||s&&s.getElementsByTagName("parsererror").length>0)throw new Error("DASH_INVALID_XML");return s};var Ve,ze=i(9910),We=i.n(ze),Ge=z([73,68,51]),Xe=function e(t,i){return void 0===i&&(i=0),(t=z(t)).length-i<10||!K(t,Ge,{offset:i})?i:(i+=function(e,t){void 0===t&&(t=0);var i=(e=z(e))[t+5],s=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&i)>>4?s+20:s+10}(t,i),e(t,i))},Ye=(new Uint8Array([79,112,117,115,72,101,97,100]),function(e){return"string"==typeof e?Y(e):e}),Ke=function(e){e=z(e);for(var t=[],i=0;e.length>i;){var s=e[i],n=0,r=0,a=e[++r];for(r++;128&a;)n=(127&a)<<7,a=e[r],r++;n+=127&a;for(var o=0;o<Ve.length;o++){var l=Ve[o],c=l.id,u=l.parser;if(s===c){t.push(u(e.subarray(r,r+n)));break}}i+=n+r}return t};Ve=[{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 i=e[t.size];t.url=function(e){if(!e)return"";e=Array.prototype.slice.call(e);var t=String.fromCharCode.apply(null,z(e));try{return decodeURIComponent(escape(t))}catch(e){}return t}(e.subarray(t.size+1,t.size+1+i)),t.size+=i}return 32&t.flags&&(t.ocrEsId=e[t.size]<<8|e[t.size+1],t.size+=2),t.descriptors=Ke(e.subarray(t.size))||[],t}},{id:4,parser:function(e){return{tag:4,oti:e[0],streamType:e[1],bufferSize:e[2]<<16|e[3]<<8|e[4],maxBitrate:e[5]<<24|e[6]<<16|e[7]<<8|e[8],avgBitrate:e[9]<<24|e[10]<<16|e[11]<<8|e[12],descriptors:Ke(e.subarray(13))}}},{id:5,parser:function(e){return{tag:5,bytes:e}}},{id:6,parser:function(e){return{tag:6,bytes:e}}}];var Qe=function e(t,i,s){void 0===s&&(s=!1),i=function(e){return Array.isArray(e)?e.map((function(e){return Ye(e)})):[Ye(e)]}(i),t=z(t);var n=[];if(!i.length)return n;for(var r=0;r<t.length;){var a=(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3])>>>0,o=t.subarray(r+4,r+8);if(0===a)break;var l=r+a;if(l>t.length){if(s)break;l=t.length}var c=t.subarray(r+8,l);K(o,i[0])&&(1===i.length?n.push(c):n.push.apply(n,e(c,i.slice(1),s))),r=l}return n},Je={EBML:z([26,69,223,163]),DocType:z([66,130]),Segment:z([24,83,128,103]),SegmentInfo:z([21,73,169,102]),Tracks:z([22,84,174,107]),Track:z([174]),TrackNumber:z([215]),DefaultDuration:z([35,227,131]),TrackEntry:z([174]),TrackType:z([131]),FlagDefault:z([136]),CodecID:z([134]),CodecPrivate:z([99,162]),VideoTrack:z([224]),AudioTrack:z([225]),Cluster:z([31,67,182,117]),Timestamp:z([231]),TimestampScale:z([42,215,177]),BlockGroup:z([160]),BlockDuration:z([155]),Block:z([161]),SimpleBlock:z([163])},Ze=[128,64,32,16,8,4,2,1],et=function(e,t,i,s){void 0===i&&(i=!0),void 0===s&&(s=!1);var n=function(e){for(var t=1,i=0;i<Ze.length&&!(e&Ze[i]);i++)t++;return t}(e[t]),r=e.subarray(t,t+n);return i&&((r=Array.prototype.slice.call(e,t,t+n))[0]^=Ze[n-1]),{length:n,value:X(r,{signed:s}),bytes:r}},tt=function e(t){return"string"==typeof t?t.match(/.{1,2}/g).map((function(t){return e(t)})):"number"==typeof t?function(e,t){var i=(void 0===t?{}:t).le,s=void 0!==i&&i;("bigint"!=typeof e&&"number"!=typeof e||"number"==typeof e&&e!=e)&&(e=0);for(var n,r=(n=e=W(e),Math.ceil(function(e){return e.toString(2).length}(n)/8)),a=new Uint8Array(new ArrayBuffer(r)),o=0;o<r;o++){var l=s?o:Math.abs(o+1-a.length);a[l]=Number(e/G[o]&W(255)),e<0&&(a[l]=Math.abs(~a[l]),a[l]-=0===o?1:2)}return a}(t):t},it=function e(t,i,s){if(s>=i.length)return i.length;var n=et(i,s,!1);if(K(t.bytes,n.bytes))return s;var r=et(i,s+n.length);return e(t,i,s+r.length+r.value+n.length)},st=function e(t,i){i=function(e){return Array.isArray(e)?e.map((function(e){return tt(e)})):[tt(e)]}(i),t=z(t);var s=[];if(!i.length)return s;for(var n=0;n<t.length;){var r=et(t,n,!1),a=et(t,n+r.length),o=n+r.length+a.length;127===a.value&&(a.value=it(r,t,o),a.value!==t.length&&(a.value-=o));var l=o+a.value>t.length?t.length:o+a.value,c=t.subarray(o,l);K(i[0],r.bytes)&&(1===i.length?s.push(c):s=s.concat(e(c,i.slice(1)))),n+=r.length+a.length+c.length}return s},nt=z([0,0,0,1]),rt=z([0,0,1]),at=z([0,0,3]),ot=function(e){for(var t=[],i=1;i<e.length-2;)K(e.subarray(i,i+3),at)&&(t.push(i+2),i++),i++;if(0===t.length)return e;var s=e.length-t.length,n=new Uint8Array(s),r=0;for(i=0;i<s;r++,i++)r===t[0]&&(r++,t.shift()),n[i]=e[r];return n},lt=function(e,t,i,s){void 0===s&&(s=1/0),e=z(e),i=[].concat(i);for(var n,r=0,a=0;r<e.length&&(a<s||n);){var o=void 0;if(K(e.subarray(r),nt)?o=4:K(e.subarray(r),rt)&&(o=3),o){if(a++,n)return ot(e.subarray(n,r));var l=void 0;"h264"===t?l=31&e[r+o]:"h265"===t&&(l=e[r+o]>>1&63),-1!==i.indexOf(l)&&(n=r+o),r+=o+("h264"===t?1:2)}else r++}return e.subarray(0,0)},ct={webm:z([119,101,98,109]),matroska:z([109,97,116,114,111,115,107,97]),flac:z([102,76,97,67]),ogg:z([79,103,103,83]),ac3:z([11,119]),riff:z([82,73,70,70]),avi:z([65,86,73]),wav:z([87,65,86,69]),"3gp":z([102,116,121,112,51,103]),mp4:z([102,116,121,112]),fmp4:z([115,116,121,112]),mov:z([102,116,121,112,113,116]),moov:z([109,111,111,118]),moof:z([109,111,111,102])},ut={aac:function(e){var t=Xe(e);return K(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Xe(e);return K(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=st(e,[Je.EBML,Je.DocType])[0];return K(t,ct.webm)},mkv:function(e){var t=st(e,[Je.EBML,Je.DocType])[0];return K(t,ct.matroska)},mp4:function(e){return!ut["3gp"](e)&&!ut.mov(e)&&(!(!K(e,ct.mp4,{offset:4})&&!K(e,ct.fmp4,{offset:4}))||!(!K(e,ct.moof,{offset:4})&&!K(e,ct.moov,{offset:4}))||void 0)},mov:function(e){return K(e,ct.mov,{offset:4})},"3gp":function(e){return K(e,ct["3gp"],{offset:4})},ac3:function(e){var t=Xe(e);return K(e,ct.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return 71===e[0];for(var t=0;t+188<e.length&&t<188;){if(71===e[t]&&71===e[t+188])return!0;t+=1}return!1},flac:function(e){var t=Xe(e);return K(e,ct.flac,{offset:t})},ogg:function(e){return K(e,ct.ogg)},avi:function(e){return K(e,ct.riff)&&K(e,ct.avi,{offset:8})},wav:function(e){return K(e,ct.riff)&&K(e,ct.wav,{offset:8})},h264:function(e){return function(e,t,i){return lt(e,"h264",7,3)}(e).length},h265:function(e){return function(e,t,i){return lt(e,"h265",[32,33],3)}(e).length}},ht=Object.keys(ut).filter((function(e){return"ts"!==e&&"h264"!==e&&"h265"!==e})).concat(["ts","h264","h265"]);ht.forEach((function(e){var t=ut[e];ut[e]=function(e){return t(z(e))}}));var dt=ut,pt=function(e){e=z(e);for(var t=0;t<ht.length;t++){var i=ht[t];if(dt[i](e))return i}return""},ft=i(6946),mt="8.11.8";const gt={},yt=function(e,t){return gt[e]=gt[e]||[],t&&(gt[e]=gt[e].concat(t)),gt[e]},vt=function(e,t){const i=yt(e).indexOf(t);return!(i<=-1||(gt[e]=gt[e].slice(),gt[e].splice(i,1),0))},_t={prefixed:!0},bt=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],Tt=bt[0];let St;for(let e=0;e<bt.length;e++)if(bt[e][1]in a()){St=bt[e];break}if(St){for(let e=0;e<St.length;e++)_t[Tt[e]]=St[e];_t.prefixed=St[0]!==Tt[0]}let wt=[];const Et=function e(t,i=":",s=""){let r,a="info";const o=function(...e){r("log",a,e)};return r=((e,t,i)=>(s,r,a)=>{const o=t.levels[r],l=new RegExp(`^(${o})$`);let c=e;if("log"!==s&&a.unshift(s.toUpperCase()+":"),i&&(c=`%c${e}`,a.unshift(i)),a.unshift(c+":"),wt){wt.push([].concat(a));const e=wt.length-1e3;wt.splice(0,e>0?e:0)}if(!n().console)return;let u=n().console[s];u||"debug"!==s||(u=n().console.info||n().console.log),u&&o&&l.test(s)&&u[Array.isArray(a)?"apply":"call"](n().console,a)})(t,o,s),o.createLogger=(n,r,a)=>{const o=void 0!==r?r:i;return e(`${t} ${o} ${n}`,o,void 0!==a?a:s)},o.createNewLogger=(t,i,s)=>e(t,i,s),o.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:a},o.level=e=>{if("string"==typeof e){if(!o.levels.hasOwnProperty(e))throw new Error(`"${e}" in not a valid log level`);a=e}return a},(o.history=()=>wt?[].concat(wt):[]).filter=e=>(wt||[]).filter((t=>new RegExp(`.*${e}.*`).test(t[0]))),o.history.clear=()=>{wt&&(wt.length=0)},o.history.disable=()=>{null!==wt&&(wt.length=0,wt=null)},o.history.enable=()=>{null===wt&&(wt=[])},o.error=(...e)=>r("error",a,e),o.warn=(...e)=>r("warn",a,e),o.debug=(...e)=>r("debug",a,e),o}("VIDEOJS"),Ct=Et.createLogger,xt=Object.prototype.toString,kt=function(e){return Pt(e)?Object.keys(e):[]};function At(e,t){kt(e).forEach((i=>t(e[i],i)))}function It(e,t,i=0){return kt(e).reduce(((i,s)=>t(i,e[s],s)),i)}function Pt(e){return!!e&&"object"==typeof e}function Ot(e){return Pt(e)&&"[object Object]"===xt.call(e)&&e.constructor===Object}function Lt(...e){const t={};return e.forEach((e=>{e&&At(e,((e,i)=>{Ot(e)?(Ot(t[i])||(t[i]={}),t[i]=Lt(t[i],e)):t[i]=e}))})),t}function Dt(e={}){const t=[];for(const i in e)if(e.hasOwnProperty(i)){const s=e[i];t.push(s)}return t}function Rt(e,t,i,s=!0){const n=i=>Object.defineProperty(e,t,{value:i,enumerable:!0,writable:!0}),r={configurable:!0,enumerable:!0,get(){const e=i();return n(e),e}};return s&&(r.set=n),Object.defineProperty(e,t,r)}var Nt=Object.freeze({__proto__:null,each:At,reduce:It,isObject:Pt,isPlain:Ot,merge:Lt,values:Dt,defineLazyProperty:Rt});let Mt,jt=!1,Ut=null,Bt=!1,Ft=!1,qt=!1,$t=!1,Ht=!1,Vt=null,zt=null,Wt=null,Gt=!1,Xt=!1,Yt=!1,Kt=!1,Qt=!1,Jt=!1;const Zt=Boolean(ri()&&("ontouchstart"in n()||n().navigator.maxTouchPoints||n().DocumentTouch&&n().document instanceof n().DocumentTouch)),ei=n().navigator&&n().navigator.userAgentData;if(ei&&ei.platform&&ei.brands&&(Bt="Android"===ei.platform,qt=Boolean(ei.brands.find((e=>"Microsoft Edge"===e.brand))),$t=Boolean(ei.brands.find((e=>"Chromium"===e.brand))),Ht=!qt&&$t,Vt=zt=(ei.brands.find((e=>"Chromium"===e.brand))||{}).version||null,Xt="Windows"===ei.platform),!$t){const e=n().navigator&&n().navigator.userAgent||"";jt=/iPod/i.test(e),Ut=function(){const t=e.match(/OS (\d+)_/i);return t&&t[1]?t[1]:null}(),Bt=/Android/i.test(e),Mt=function(){const t=e.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!t)return null;const i=t[1]&&parseFloat(t[1]),s=t[2]&&parseFloat(t[2]);return i&&s?parseFloat(t[1]+"."+t[2]):i||null}(),Ft=/Firefox/i.test(e),qt=/Edg/i.test(e),$t=/Chrome/i.test(e)||/CriOS/i.test(e),Ht=!qt&&$t,Vt=zt=function(){const t=e.match(/(Chrome|CriOS)\/(\d+)/);return t&&t[2]?parseFloat(t[2]):null}(),Wt=function(){const t=/MSIE\s(\d+)\.\d/.exec(e);let i=t&&parseFloat(t[1]);return!i&&/Trident\/7.0/i.test(e)&&/rv:11.0/.test(e)&&(i=11),i}(),Qt=/Tizen/i.test(e),Jt=/Web0S/i.test(e),Gt=/Safari/i.test(e)&&!Ht&&!Bt&&!qt&&!Qt&&!Jt,Xt=/Windows/i.test(e),Yt=/iPad/i.test(e)||Gt&&Zt&&!/iPhone/i.test(e),Kt=/iPhone/i.test(e)&&!Yt}const ti=Kt||Yt||jt,ii=(Gt||ti)&&!Ht;var si=Object.freeze({__proto__:null,get IS_IPOD(){return jt},get IOS_VERSION(){return Ut},get IS_ANDROID(){return Bt},get ANDROID_VERSION(){return Mt},get IS_FIREFOX(){return Ft},get IS_EDGE(){return qt},get IS_CHROMIUM(){return $t},get IS_CHROME(){return Ht},get CHROMIUM_VERSION(){return Vt},get CHROME_VERSION(){return zt},get IE_VERSION(){return Wt},get IS_SAFARI(){return Gt},get IS_WINDOWS(){return Xt},get IS_IPAD(){return Yt},get IS_IPHONE(){return Kt},get IS_TIZEN(){return Qt},get IS_WEBOS(){return Jt},TOUCH_ENABLED:Zt,IS_IOS:ti,IS_ANY_SAFARI:ii});function ni(e){return"string"==typeof e&&Boolean(e.trim())}function ri(){return a()===n().document}function ai(e){return Pt(e)&&1===e.nodeType}function oi(){try{return n().parent!==n().self}catch(e){return!0}}function li(e){return function(t,i){if(!ni(t))return a()[e](null);ni(i)&&(i=a().querySelector(i));const s=ai(i)?i:a();return s[e]&&s[e](t)}}function ci(e="div",t={},i={},s){const n=a().createElement(e);return Object.getOwnPropertyNames(t).forEach((function(e){const i=t[e];"textContent"===e?ui(n,i):n[e]===i&&"tabIndex"!==e||(n[e]=i)})),Object.getOwnPropertyNames(i).forEach((function(e){n.setAttribute(e,i[e])})),s&&Ii(n,s),n}function ui(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function hi(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function di(e,t){return function(e){if(e.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}(t),e.classList.contains(t)}function pi(e,...t){return e.classList.add(...t.reduce(((e,t)=>e.concat(t.split(/\s+/))),[])),e}function fi(e,...t){return e?(e.classList.remove(...t.reduce(((e,t)=>e.concat(t.split(/\s+/))),[])),e):(Et.warn("removeClass was called with an element that doesn't exist"),null)}function mi(e,t,i){return"function"==typeof i&&(i=i(e,t)),"boolean"!=typeof i&&(i=void 0),t.split(/\s+/).forEach((t=>e.classList.toggle(t,i))),e}function gi(e,t){Object.getOwnPropertyNames(t).forEach((function(i){const s=t[i];null==s||!1===s?e.removeAttribute(i):e.setAttribute(i,!0===s?"":s)}))}function yi(e){const t={},i=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(e&&e.attributes&&e.attributes.length>0){const s=e.attributes;for(let e=s.length-1;e>=0;e--){const n=s[e].name;let r=s[e].value;i.includes(n)&&(r=null!==r),t[n]=r}}return t}function vi(e,t){return e.getAttribute(t)}function _i(e,t,i){e.setAttribute(t,i)}function bi(e,t){e.removeAttribute(t)}function Ti(){a().body.focus(),a().onselectstart=function(){return!1}}function Si(){a().onselectstart=function(){return!0}}function wi(e){if(e&&e.getBoundingClientRect&&e.parentNode){const t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach((e=>{void 0!==t[e]&&(i[e]=t[e])})),i.height||(i.height=parseFloat(Ri(e,"height"))),i.width||(i.width=parseFloat(Ri(e,"width"))),i}}function Ei(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};const t=e.offsetWidth,i=e.offsetHeight;let s=0,n=0;for(;e.offsetParent&&e!==a()[_t.fullscreenElement];)s+=e.offsetLeft,n+=e.offsetTop,e=e.offsetParent;return{left:s,top:n,width:t,height:i}}function Ci(e,t){const i={x:0,y:0};if(ti){let t=e;for(;t&&"html"!==t.nodeName.toLowerCase();){const e=Ri(t,"transform");if(/^matrix/.test(e)){const t=e.slice(7,-1).split(/,\s/).map(Number);i.x+=t[4],i.y+=t[5]}else if(/^matrix3d/.test(e)){const t=e.slice(9,-1).split(/,\s/).map(Number);i.x+=t[12],i.y+=t[13]}t=t.parentNode}}const s={},n=Ei(t.target),r=Ei(e),a=r.width,o=r.height;let l=t.offsetY-(r.top-n.top),c=t.offsetX-(r.left-n.left);return t.changedTouches&&(c=t.changedTouches[0].pageX-r.left,l=t.changedTouches[0].pageY+r.top,ti&&(c-=i.x,l-=i.y)),s.y=1-Math.max(0,Math.min(1,l/o)),s.x=Math.max(0,Math.min(1,c/a)),s}function xi(e){return Pt(e)&&3===e.nodeType}function ki(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function Ai(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map((e=>("function"==typeof e&&(e=e()),ai(e)||xi(e)?e:"string"==typeof e&&/\S/.test(e)?a().createTextNode(e):void 0))).filter((e=>e))}function Ii(e,t){return Ai(t).forEach((t=>e.appendChild(t))),e}function Pi(e,t){return Ii(ki(e),t)}function Oi(e){return void 0===e.button&&void 0===e.buttons||0===e.button&&void 0===e.buttons||"mouseup"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons}const Li=li("querySelector"),Di=li("querySelectorAll");function Ri(e,t){if(!e||!t)return"";if("function"==typeof n().getComputedStyle){let i;try{i=n().getComputedStyle(e)}catch(e){return""}return i?i.getPropertyValue(t)||i[t]:""}return""}function Ni(e){[...a().styleSheets].forEach((t=>{try{const i=[...t.cssRules].map((e=>e.cssText)).join(""),s=a().createElement("style");s.textContent=i,e.document.head.appendChild(s)}catch(i){const s=a().createElement("link");s.rel="stylesheet",s.type=t.type,s.media=t.media.mediaText,s.href=t.href,e.document.head.appendChild(s)}}))}var Mi=Object.freeze({__proto__:null,isReal:ri,isEl:ai,isInFrame:oi,createEl:ci,textContent:ui,prependTo:hi,hasClass:di,addClass:pi,removeClass:fi,toggleClass:mi,setAttributes:gi,getAttributes:yi,getAttribute:vi,setAttribute:_i,removeAttribute:bi,blockTextSelection:Ti,unblockTextSelection:Si,getBoundingClientRect:wi,findPosition:Ei,getPointerPosition:Ci,isTextNode:xi,emptyEl:ki,normalizeContent:Ai,appendContent:Ii,insertContent:Pi,isSingleLeftClick:Oi,$:Li,$$:Di,computedStyle:Ri,copyStyleSheetsToWindow:Ni});let ji,Ui=!1;const Bi=function(){if(!1===ji.options.autoSetup)return;const e=Array.prototype.slice.call(a().getElementsByTagName("video")),t=Array.prototype.slice.call(a().getElementsByTagName("audio")),i=Array.prototype.slice.call(a().getElementsByTagName("video-js")),s=e.concat(t,i);if(s&&s.length>0)for(let e=0,t=s.length;e<t;e++){const t=s[e];if(!t||!t.getAttribute){Fi(1);break}void 0===t.player&&null!==t.getAttribute("data-setup")&&ji(t)}else Ui||Fi(1)};function Fi(e,t){ri()&&(t&&(ji=t),n().setTimeout(Bi,e))}function qi(){Ui=!0,n().removeEventListener("load",qi)}ri()&&("complete"===a().readyState?qi():n().addEventListener("load",qi));const $i=function(e){const t=a().createElement("style");return t.className=e,t},Hi=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t};var Vi=new WeakMap;let zi,Wi=3;function Gi(){return Wi++}function Xi(e,t){if(!Vi.has(e))return;const i=Vi.get(e);0===i.handlers[t].length&&(delete i.handlers[t],e.removeEventListener?e.removeEventListener(t,i.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,i.dispatcher)),Object.getOwnPropertyNames(i.handlers).length<=0&&(delete i.handlers,delete i.dispatcher,delete i.disabled),0===Object.getOwnPropertyNames(i).length&&Vi.delete(e)}function Yi(e,t,i,s){i.forEach((function(i){e(t,i,s)}))}function Ki(e){if(e.fixed_)return e;function t(){return!0}function i(){return!1}if(!e||!e.isPropagationStopped||!e.isImmediatePropagationStopped){const s=e||n().event;e={};for(const t in s)"layerX"!==t&&"layerY"!==t&&"keyLocation"!==t&&"webkitMovementX"!==t&&"webkitMovementY"!==t&&"path"!==t&&("returnValue"===t&&s.preventDefault||(e[t]=s[t]));if(e.target||(e.target=e.srcElement||a()),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){s.preventDefault&&s.preventDefault(),e.returnValue=!1,s.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){s.stopPropagation&&s.stopPropagation(),e.cancelBubble=!0,s.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=i,e.stopImmediatePropagation=function(){s.stopImmediatePropagation&&s.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=i,null!==e.clientX&&void 0!==e.clientX){const t=a().documentElement,i=a().body;e.pageX=e.clientX+(t&&t.scrollLeft||i&&i.scrollLeft||0)-(t&&t.clientLeft||i&&i.clientLeft||0),e.pageY=e.clientY+(t&&t.scrollTop||i&&i.scrollTop||0)-(t&&t.clientTop||i&&i.clientTop||0)}e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e.fixed_=!0,e}const Qi=function(){if("boolean"!=typeof zi){zi=!1;try{const e=Object.defineProperty({},"passive",{get(){zi=!0}});n().addEventListener("test",null,e),n().removeEventListener("test",null,e)}catch(e){}}return zi},Ji=["touchstart","touchmove"];function Zi(e,t,i){if(Array.isArray(t))return Yi(Zi,e,t,i);Vi.has(e)||Vi.set(e,{});const s=Vi.get(e);if(s.handlers||(s.handlers={}),s.handlers[t]||(s.handlers[t]=[]),i.guid||(i.guid=Gi()),s.handlers[t].push(i),s.dispatcher||(s.disabled=!1,s.dispatcher=function(t,i){if(s.disabled)return;t=Ki(t);const n=s.handlers[t.type];if(n){const s=n.slice(0);for(let n=0,r=s.length;n<r&&!t.isImmediatePropagationStopped();n++)try{s[n].call(e,t,i)}catch(e){Et.error(e)}}}),1===s.handlers[t].length)if(e.addEventListener){let i=!1;Qi()&&Ji.indexOf(t)>-1&&(i={passive:!0}),e.addEventListener(t,s.dispatcher,i)}else e.attachEvent&&e.attachEvent("on"+t,s.dispatcher)}function es(e,t,i){if(!Vi.has(e))return;const s=Vi.get(e);if(!s.handlers)return;if(Array.isArray(t))return Yi(es,e,t,i);const n=function(e,t){s.handlers[t]=[],Xi(e,t)};if(void 0===t){for(const t in s.handlers)Object.prototype.hasOwnProperty.call(s.handlers||{},t)&&n(e,t);return}const r=s.handlers[t];if(r)if(i){if(i.guid)for(let e=0;e<r.length;e++)r[e].guid===i.guid&&r.splice(e--,1);Xi(e,t)}else n(e,t)}function ts(e,t,i){const s=Vi.has(e)?Vi.get(e):{},n=e.parentNode||e.ownerDocument;if("string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=Ki(t),s.dispatcher&&s.dispatcher.call(e,t,i),n&&!t.isPropagationStopped()&&!0===t.bubbles)ts.call(null,n,t,i);else if(!n&&!t.defaultPrevented&&t.target&&t.target[t.type]){Vi.has(t.target)||Vi.set(t.target,{});const e=Vi.get(t.target);t.target[t.type]&&(e.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),e.disabled=!1)}return!t.defaultPrevented}function is(e,t,i){if(Array.isArray(t))return Yi(is,e,t,i);const s=function(){es(e,t,s),i.apply(this,arguments)};s.guid=i.guid=i.guid||Gi(),Zi(e,t,s)}function ss(e,t,i){const s=function(){es(e,t,s),i.apply(this,arguments)};s.guid=i.guid=i.guid||Gi(),Zi(e,t,s)}var ns=Object.freeze({__proto__:null,fixEvent:Ki,on:Zi,off:es,trigger:ts,one:is,any:ss});const rs=30,as=function(e,t,i){t.guid||(t.guid=Gi());const s=t.bind(e);return s.guid=i?i+"_"+t.guid:t.guid,s},os=function(e,t){let i=n().performance.now();return function(...s){const r=n().performance.now();r-i>=t&&(e(...s),i=r)}},ls=function(e,t,i,s=n()){let r;const a=function(){const n=this,a=arguments;let o=function(){r=null,o=null,i||e.apply(n,a)};!r&&i&&e.apply(n,a),s.clearTimeout(r),r=s.setTimeout(o,t)};return a.cancel=()=>{s.clearTimeout(r),r=null},a};var cs=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:rs,bind_:as,throttle:os,debounce:ls});let us;class hs{on(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Zi(this,e,t),this.addEventListener=i}off(e,t){es(this,e,t)}one(e,t){const i=this.addEventListener;this.addEventListener=()=>{},is(this,e,t),this.addEventListener=i}any(e,t){const i=this.addEventListener;this.addEventListener=()=>{},ss(this,e,t),this.addEventListener=i}trigger(e){const t=e.type||e;"string"==typeof e&&(e={type:t}),e=Ki(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),ts(this,e)}queueTrigger(e){us||(us=new Map);const t=e.type||e;let i=us.get(this);i||(i=new Map,us.set(this,i));const s=i.get(t);i.delete(t),n().clearTimeout(s);const r=n().setTimeout((()=>{i.delete(t),0===i.size&&(i=null,us.delete(this)),this.trigger(e)}),0);i.set(t,r)}}hs.prototype.allowedEvents_={},hs.prototype.addEventListener=hs.prototype.on,hs.prototype.removeEventListener=hs.prototype.off,hs.prototype.dispatchEvent=hs.prototype.trigger;const ds=e=>"function"==typeof e.name?e.name():"string"==typeof e.name?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e,ps=e=>e instanceof hs||!!e.eventBusEl_&&["on","one","off","trigger"].every((t=>"function"==typeof e[t])),fs=e=>"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length,ms=(e,t,i)=>{if(!e||!e.nodeName&&!ps(e))throw new Error(`Invalid target for ${ds(t)}#${i}; must be a DOM node or evented object.`)},gs=(e,t,i)=>{if(!fs(e))throw new Error(`Invalid event type for ${ds(t)}#${i}; must be a non-empty string or array.`)},ys=(e,t,i)=>{if("function"!=typeof e)throw new Error(`Invalid listener for ${ds(t)}#${i}; must be a function.`)},vs=(e,t,i)=>{const s=t.length<3||t[0]===e||t[0]===e.eventBusEl_;let n,r,a;return s?(n=e.eventBusEl_,t.length>=3&&t.shift(),[r,a]=t):[n,r,a]=t,ms(n,e,i),gs(r,e,i),ys(a,e,i),a=as(e,a),{isTargetingSelf:s,target:n,type:r,listener:a}},_s=(e,t,i,s)=>{ms(e,e,t),e.nodeName?ns[t](e,i,s):e[t](i,s)},bs={on(...e){const{isTargetingSelf:t,target:i,type:s,listener:n}=vs(this,e,"on");if(_s(i,"on",s,n),!t){const e=()=>this.off(i,s,n);e.guid=n.guid;const t=()=>this.off("dispose",e);t.guid=n.guid,_s(this,"on","dispose",e),_s(i,"on","dispose",t)}},one(...e){const{isTargetingSelf:t,target:i,type:s,listener:n}=vs(this,e,"one");if(t)_s(i,"one",s,n);else{const e=(...t)=>{this.off(i,s,e),n.apply(null,t)};e.guid=n.guid,_s(i,"one",s,e)}},any(...e){const{isTargetingSelf:t,target:i,type:s,listener:n}=vs(this,e,"any");if(t)_s(i,"any",s,n);else{const e=(...t)=>{this.off(i,s,e),n.apply(null,t)};e.guid=n.guid,_s(i,"any",s,e)}},off(e,t,i){if(!e||fs(e))es(this.eventBusEl_,e,t);else{const s=e,n=t;ms(s,this,"off"),gs(n,this,"off"),ys(i,this,"off"),i=as(this,i),this.off("dispose",i),s.nodeName?(es(s,n,i),es(s,"dispose",i)):ps(s)&&(s.off(n,i),s.off("dispose",i))}},trigger(e,t){ms(this.eventBusEl_,this,"trigger");const i=e&&"string"!=typeof e?e.type:e;if(!fs(i))throw new Error(`Invalid event type for ${ds(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return ts(this.eventBusEl_,e,t)}};function Ts(e,t={}){const{eventBusKey:i}=t;if(i){if(!e[i].nodeName)throw new Error(`The eventBusKey "${i}" does not refer to an element.`);e.eventBusEl_=e[i]}else e.eventBusEl_=ci("span",{className:"vjs-event-bus"});return Object.assign(e,bs),e.eventedCallbacks&&e.eventedCallbacks.forEach((e=>{e()})),e.on("dispose",(()=>{e.off(),[e,e.el_,e.eventBusEl_].forEach((function(e){e&&Vi.has(e)&&Vi.delete(e)})),n().setTimeout((()=>{e.eventBusEl_=null}),0)})),e}const Ss={state:{},setState(e){let t;return"function"==typeof e&&(e=e()),At(e,((e,i)=>{this.state[i]!==e&&(t=t||{},t[i]={from:this.state[i],to:e}),this.state[i]=e})),t&&ps(this)&&this.trigger({changes:t,type:"statechanged"}),t}};function ws(e,t){return Object.assign(e,Ss),e.state=Object.assign({},e.state,t),"function"==typeof e.handleStateChanged&&ps(e)&&e.on("statechanged",e.handleStateChanged),e}const Es=function(e){return"string"!=typeof e?e:e.replace(/./,(e=>e.toLowerCase()))},Cs=function(e){return"string"!=typeof e?e:e.replace(/./,(e=>e.toUpperCase()))},xs=function(e,t){return Cs(e)===Cs(t)};var ks=Object.freeze({__proto__:null,toLowerCase:Es,toTitleCase:Cs,titleCaseEquals:xs});class As{constructor(e,t,i){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=Lt({},this.options_),t=this.options_=Lt(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const t=e&&e.id&&e.id()||"no_player";this.id_=`${t}_component_${Gi()}`}this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach((e=>this.addClass(e))),["on","off","one","any","trigger"].forEach((e=>{this[e]=void 0})),!1!==t.evented&&(Ts(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),ws(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,!1!==t.initChildren&&this.initChildren(),this.ready(i),!1!==t.reportTouchActivity&&this.enableTouchActivity()}on(e,t){}off(e,t){}one(e,t){}any(e,t){}trigger(e,t){}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let e=this.children_.length-1;e>=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return Boolean(this.isDisposed_)}player(){return this.player_}options(e){return e?(this.options_=Lt(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,i){return ci(e,t,i)}localize(e,t,i=e){const s=this.player_.language&&this.player_.language(),n=this.player_.languages&&this.player_.languages(),r=n&&n[s],a=s&&s.split("-")[0],o=n&&n[a];let l=i;return r&&r[e]?l=r[e]:o&&o[e]&&(l=o[e]),t&&(l=l.replace(/\{(\d+)\}/g,(function(e,i){const s=t[i-1];let n=s;return void 0===s&&(n=e),n}))),l}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce(((e,t)=>e.concat(t)),[]);let t=this;for(let i=0;i<e.length;i++)if(t=t.getChild(e[i]),!t||!t.getChild)return;return t}setIcon(e,t=this.el()){if(!this.player_.options_.experimentalSvgIcons)return;const i="http://www.w3.org/2000/svg",s=ci("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),n=a().createElementNS(i,"svg");n.setAttributeNS(null,"viewBox","0 0 512 512");const r=a().createElementNS(i,"use");return n.appendChild(r),r.setAttributeNS(null,"href",`#vjs-icon-${e}`),s.appendChild(n),this.iconIsSet_?t.replaceChild(s,t.querySelector(".vjs-icon-placeholder")):t.appendChild(s),this.iconIsSet_=!0,s}addChild(e,t={},i=this.children_.length){let s,n;if("string"==typeof e){n=Cs(e);const i=t.componentClass||n;t.name=n;const r=As.getComponent(i);if(!r)throw new Error(`Component ${i} does not exist`);if("function"!=typeof r)return null;s=new r(this.player_||this,t)}else s=e;if(s.parentComponent_&&s.parentComponent_.removeChild(s),this.children_.splice(i,0,s),s.parentComponent_=this,"function"==typeof s.id&&(this.childIndex_[s.id()]=s),n=n||s.name&&Cs(s.name()),n&&(this.childNameIndex_[n]=s,this.childNameIndex_[Es(n)]=s),"function"==typeof s.el&&s.el()){let e=null;this.children_[i+1]&&(this.children_[i+1].el_?e=this.children_[i+1].el_:ai(this.children_[i+1])&&(e=this.children_[i+1])),this.contentEl().insertBefore(s.el(),e)}return s}removeChild(e){if("string"==typeof e&&(e=this.getChild(e)),!e||!this.children_)return;let t=!1;for(let i=this.children_.length-1;i>=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[Cs(e.name())]=null,this.childNameIndex_[Es(e.name())]=null;const i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,i=e=>{const i=e.name;let s=e.opts;if(void 0!==t[i]&&(s=t[i]),!1===s)return;!0===s&&(s={}),s.playerOptions=this.options_.playerOptions;const n=this.addChild(i,s);n&&(this[i]=n)};let s;const n=As.getComponent("Tech");s=Array.isArray(e)?e:Object.keys(e),s.concat(Object.keys(this.options_).filter((function(e){return!s.some((function(t){return"string"==typeof t?e===t:e===t.name}))}))).map((t=>{let i,s;return"string"==typeof t?(i=t,s=e[i]||this.options_[i]||{}):(i=t.name,s=t),{name:i,opts:s}})).filter((e=>{const t=As.getComponent(e.opts.componentClass||Cs(e.name));return t&&!n.isTech(t)})).forEach(i)}}buildCSSClass(){return""}ready(e,t=!1){if(e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))}triggerReady(){this.isReady_=!0,this.setTimeout((function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach((function(e){e.call(this)}),this),this.trigger("ready")}),1)}$(e,t){return Li(e,t||this.contentEl())}$$(e,t){return Di(e,t||this.contentEl())}hasClass(e){return di(this.el_,e)}addClass(...e){pi(this.el_,...e)}removeClass(...e){fi(this.el_,...e)}toggleClass(e,t){mi(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return vi(this.el_,e)}setAttribute(e,t){_i(this.el_,e,t)}removeAttribute(e){bi(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,i){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(i||this.trigger("componentresize"));if(!this.el_)return 0;const s=this.el_.style[e],n=s.indexOf("px");return-1!==n?parseInt(s.slice(0,n),10):parseInt(this.el_["offset"+Cs(e)],10)}currentDimension(e){let t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if(t=Ri(this.el_,e),t=parseFloat(t),0===t||isNaN(t)){const i=`offset${Cs(e)}`;t=this.el_[i]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(l().isEventKey(e,"Tab")||e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e,t=0,i=null;this.on("touchstart",(function(s){1===s.touches.length&&(i={pageX:s.touches[0].pageX,pageY:s.touches[0].pageY},t=n().performance.now(),e=!0)})),this.on("touchmove",(function(t){if(t.touches.length>1)e=!1;else if(i){const s=t.touches[0].pageX-i.pageX,n=t.touches[0].pageY-i.pageY;Math.sqrt(s*s+n*n)>10&&(e=!1)}}));const s=function(){e=!1};this.on("touchleave",s),this.on("touchcancel",s),this.on("touchend",(function(s){i=null,!0===e&&n().performance.now()-t<200&&(s.preventDefault(),this.trigger("tap"))}))}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const e=as(this.player(),this.player().reportUserActivity);let t;this.on("touchstart",(function(){e(),this.clearInterval(t),t=this.setInterval(e,250)}));const i=function(i){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",i),this.on("touchcancel",i)}setTimeout(e,t){var i;return e=as(this,e),this.clearTimersOnDispose_(),i=n().setTimeout((()=>{this.setTimeoutIds_.has(i)&&this.setTimeoutIds_.delete(i),e()}),t),this.setTimeoutIds_.add(i),i}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),n().clearTimeout(e)),e}setInterval(e,t){e=as(this,e),this.clearTimersOnDispose_();const i=n().setInterval(e,t);return this.setIntervalIds_.add(i),i}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),n().clearInterval(e)),e}requestAnimationFrame(e){var t;return this.clearTimersOnDispose_(),e=as(this,e),t=n().requestAnimationFrame((()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()})),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){if(this.namedRafs_.has(e))return;this.clearTimersOnDispose_(),t=as(this,t);const i=this.requestAnimationFrame((()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)}));return this.namedRafs_.set(e,i),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),n().cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",(()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach((([e,t])=>{this[e].forEach(((e,i)=>this[t](i)))})),this.clearingTimersOnDispose_=!1})))}static registerComponent(e,t){if("string"!=typeof e||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const i=As.getComponent("Tech"),s=i&&i.isTech(t),n=As===t||As.prototype.isPrototypeOf(t.prototype);if(s||!n){let t;throw t=s?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error(`Illegal component, "${e}"; ${t}.`)}e=Cs(e),As.components_||(As.components_={});const r=As.getComponent("Player");if("Player"===e&&r&&r.players){const e=r.players,t=Object.keys(e);if(e&&t.length>0&&t.map((t=>e[t])).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return As.components_[e]=t,As.components_[Es(e)]=t,t}static getComponent(e){if(e&&As.components_)return As.components_[e]}}function Is(e,t,i,s){return function(e,t,i){if("number"!=typeof t||t<0||t>i)throw new Error(`Failed to execute '${e}' on 'TimeRanges': The index provided (${t}) is non-numeric or out of bounds (0-${i}).`)}(e,s,i.length-1),i[s][t]}function Ps(e){let t;return t=void 0===e||0===e.length?{length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:Is.bind(null,"start",0,e),end:Is.bind(null,"end",1,e)},n().Symbol&&n().Symbol.iterator&&(t[n().Symbol.iterator]=()=>(e||[]).values()),t}function Os(e,t){return Array.isArray(e)?Ps(e):void 0===e||void 0===t?Ps():Ps([[e,t]])}As.registerComponent("Component",As);const Ls=function(e,t){e=e<0?0:e;let i=Math.floor(e%60),s=Math.floor(e/60%60),n=Math.floor(e/3600);const r=Math.floor(t/60%60),a=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(n=s=i="-"),n=n>0||a>0?n+":":"",s=((n||r>=10)&&s<10?"0"+s:s)+":",i=i<10?"0"+i:i,n+s+i};let Ds=Ls;function Rs(e){Ds=e}function Ns(){Ds=Ls}function Ms(e,t=e){return Ds(e,t)}var js=Object.freeze({__proto__:null,createTimeRanges:Os,createTimeRange:Os,setFormatTime:Rs,resetFormatTime:Ns,formatTime:Ms});function Us(e,t){let i,s,n=0;if(!t)return 0;e&&e.length||(e=Os(0,0));for(let r=0;r<e.length;r++)i=e.start(r),s=e.end(r),s>t&&(s=t),n+=s-i;return n/t}function Bs(e){if(e instanceof Bs)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:Pt(e)&&("number"==typeof e.code&&(this.code=e.code),Object.assign(this,e)),this.message||(this.message=Bs.defaultMessages[this.code]||"")}function Fs(e){return null!=e&&"function"==typeof e.then}function qs(e){Fs(e)&&e.then(null,(e=>{}))}Bs.prototype.code=0,Bs.prototype.message="",Bs.prototype.status=null,Bs.prototype.metadata=null,Bs.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Bs.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."},Bs.MEDIA_ERR_CUSTOM=0,Bs.prototype.MEDIA_ERR_CUSTOM=0,Bs.MEDIA_ERR_ABORTED=1,Bs.prototype.MEDIA_ERR_ABORTED=1,Bs.MEDIA_ERR_NETWORK=2,Bs.prototype.MEDIA_ERR_NETWORK=2,Bs.MEDIA_ERR_DECODE=3,Bs.prototype.MEDIA_ERR_DECODE=3,Bs.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Bs.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Bs.MEDIA_ERR_ENCRYPTED=5,Bs.prototype.MEDIA_ERR_ENCRYPTED=5;const $s=function(e){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(((t,i,s)=>(e[i]&&(t[i]=e[i]),t)),{cues:e.cues&&Array.prototype.map.call(e.cues,(function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}}))})};const Hs="vjs-modal-dialog";class Vs extends As{constructor(e,t){super(e,t),this.handleKeyDown_=e=>this.handleKeyDown(e),this.close_=e=>this.close(e),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=ci("div",{className:`${Hs}-content`},{role:"document"}),this.descEl_=ci("p",{className:`${Hs}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),ui(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${Hs} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_)return void(this.options_.fillAlways&&this.fill());const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return"boolean"==typeof e&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if("boolean"==typeof e){const t=this.closeable_=!!e;let i=this.getChild("closeButton");if(t&&!i){const e=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=e,this.on(i,"close",this.close_)}!t&&i&&(this.off(i,"close",this.close_),this.removeChild(i),i.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),i=t.parentNode,s=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),Pi(t,e),this.trigger("modalfill"),s?i.insertBefore(t,s):i.appendChild(t);const n=this.getChild("closeButton");n&&i.appendChild(n.el_)}empty(){this.trigger("beforemodalempty"),ki(this.contentEl()),this.trigger("modalempty")}content(e){return void 0!==e&&(this.content_=e),this.content_}conditionalFocus_(){const e=a().activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(e.stopPropagation(),l().isEventKey(e,"Escape")&&this.closeable())return e.preventDefault(),void this.close();if(!l().isEventKey(e,"Tab"))return;const t=this.focusableEls_(),i=this.el_.querySelector(":focus");let s;for(let e=0;e<t.length;e++)if(i===t[e]){s=e;break}a().activeElement===this.el_&&(s=0),e.shiftKey&&0===s?(t[t.length-1].focus(),e.preventDefault()):e.shiftKey||s!==t.length-1||(t[0].focus(),e.preventDefault())}focusableEls_(){const e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,(e=>(e instanceof n().HTMLAnchorElement||e instanceof n().HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof n().HTMLInputElement||e instanceof n().HTMLSelectElement||e instanceof n().HTMLTextAreaElement||e instanceof n().HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof n().HTMLIFrameElement||e instanceof n().HTMLObjectElement||e instanceof n().HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable")))}}Vs.prototype.options_={pauseOnOpen:!0,temporary:!0},As.registerComponent("ModalDialog",Vs);class zs extends hs{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t<e.length;t++)this.addTrack(e[t])}addTrack(e){const t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.tracks_[t]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=()=>{this.trigger({track:e,type:"labelchange",target:this})},ps(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let i=0,s=this.length;i<s;i++)if(this[i]===e){t=this[i],t.off&&t.off(),this.tracks_.splice(i,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})}getTrackById(e){let t=null;for(let i=0,s=this.length;i<s;i++){const s=this[i];if(s.id===e){t=s;break}}return t}}zs.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const e in zs.prototype.allowedEvents_)zs.prototype["on"+e]=null;const Ws=function(e,t){for(let i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].enabled=!1)},Gs=function(e,t){for(let i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].selected=!1)};class Xs extends zs{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),-1===["metadata","chapters"].indexOf(e.kind)&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}}class Ys{constructor(e){Ys.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){const t=this.length||0;let i=0;const s=e.length;this.cues_=e,this.length_=e.length;const n=function(e){""+e in this||Object.defineProperty(this,""+e,{get(){return this.cues_[e]}})};if(t<s)for(i=t;i<s;i++)n.call(this,i)}getCueById(e){let t=null;for(let i=0,s=this.length;i<s;i++){const s=this[i];if(s.id===e){t=s;break}}return t}}const Ks={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},Qs={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},Js={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Zs={disabled:"disabled",hidden:"hidden",showing:"showing"};class en extends hs{constructor(e={}){super();const t={id:e.id||"vjs_track_"+Gi(),kind:e.kind||"",language:e.language||""};let i=e.label||"";for(const e in t)Object.defineProperty(this,e,{get:()=>t[e],set(){}});Object.defineProperty(this,"label",{get:()=>i,set(e){e!==i&&(i=e,this.trigger("labelchange"))}})}}const tn=function(e){const t=["protocol","hostname","port","pathname","search","hash","host"],i=a().createElement("a");i.href=e;const s={};for(let e=0;e<t.length;e++)s[t[e]]=i[t[e]];return"http:"===s.protocol&&(s.host=s.host.replace(/:80$/,"")),"https:"===s.protocol&&(s.host=s.host.replace(/:443$/,"")),s.protocol||(s.protocol=n().location.protocol),s.host||(s.host=n().location.host),s},sn=function(e){if(!e.match(/^https?:\/\//)){const t=a().createElement("a");t.href=e,e=t.href}return e},nn=function(e){if("string"==typeof e){const t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e);if(t)return t.pop().toLowerCase()}return""},rn=function(e,t=n().location){const i=tn(e);return(":"===i.protocol?t.protocol:i.protocol)+i.host!==t.protocol+t.host};var an=Object.freeze({__proto__:null,parseUrl:tn,getAbsoluteURL:sn,getFileExtension:nn,isCrossOrigin:rn});const on=function(e,t){const i=new(n().WebVTT.Parser)(n(),n().vttjs,n().WebVTT.StringDecoder()),s=[];i.oncue=function(e){t.addCue(e)},i.onparsingerror=function(e){s.push(e)},i.onflush=function(){t.trigger({type:"loadeddata",target:t})},i.parse(e),s.length>0&&(n().console&&n().console.groupCollapsed&&n().console.groupCollapsed(`Text Track parsing errors for ${t.src}`),s.forEach((e=>Et.error(e))),n().console&&n().console.groupEnd&&n().console.groupEnd()),i.flush()},ln=function(e,t){const i={uri:e},s=rn(e);s&&(i.cors=s);const r="use-credentials"===t.tech_.crossOrigin();r&&(i.withCredentials=r),d()(i,as(this,(function(e,i,s){if(e)return Et.error(e,i);t.loaded_=!0,"function"!=typeof n().WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],(e=>{if("vttjserror"!==e.type)return on(s,t);Et.error(`vttjs failed to load, stopping trying to process ${t.src}`)})):on(s,t)})))};class cn extends en{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=Lt(e,{kind:Js[e.kind]||"subtitles",language:e.language||e.srclang||""});let i=Zs[t.mode]||"disabled";const s=t.default;"metadata"!==t.kind&&"chapters"!==t.kind||(i="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=!1!==this.tech_.preloadTextTracks;const n=new Ys(this.cues_),r=new Ys(this.activeCues_);let a=!1;this.timeupdateHandler=as(this,(function(e={}){this.tech_.isDisposed()||(this.tech_.isReady_?(this.activeCues=this.activeCues,a&&(this.trigger("cuechange"),a=!1),"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))):"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)))})),this.tech_.one("dispose",(()=>{this.stopTracking()})),"disabled"!==i&&this.startTracking(),Object.defineProperties(this,{default:{get:()=>s,set(){}},mode:{get:()=>i,set(e){Zs[e]&&i!==e&&(i=e,this.preload_||"disabled"===i||0!==this.cues.length||ln(this.src,this),this.stopTracking(),"disabled"!==i&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?n:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(0===this.cues.length)return r;const e=this.tech_.currentTime(),t=[];for(let i=0,s=this.cues.length;i<s;i++){const s=this.cues[i];s.startTime<=e&&s.endTime>=e&&t.push(s)}if(a=!1,t.length!==this.activeCues_.length)a=!0;else for(let e=0;e<t.length;e++)-1===this.activeCues_.indexOf(t[e])&&(a=!0);return this.activeCues_=t,r.setCues_(this.activeCues_),r},set(){}}}),t.src?(this.src=t.src,this.preload_||(this.loaded_=!0),(this.preload_||"subtitles"!==t.kind&&"captions"!==t.kind)&&ln(this.src,this)):this.loaded_=!0}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)}stopTracking(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)}addCue(e){let t=e;if(!("getCueAsHTML"in t)){t=new(n().vttjs.VTTCue)(e.startTime,e.endTime,e.text);for(const i in e)i in t||(t[i]=e[i]);t.id=e.id,t.originalCue_=e}const i=this.tech_.textTracks();for(let e=0;e<i.length;e++)i[e]!==this&&i[e].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}removeCue(e){let t=this.cues_.length;for(;t--;){const i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}}cn.prototype.allowedEvents_={cuechange:"cuechange"};class un extends en{constructor(e={}){const t=Lt(e,{kind:Qs[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"enabled",{get:()=>i,set(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}}class hn extends en{constructor(e={}){const t=Lt(e,{kind:Ks[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"selected",{get:()=>i,set(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}}class dn extends hs{constructor(e={}){let t;super();const i=new cn(e);this.kind=i.kind,this.src=i.src,this.srclang=i.language,this.label=i.label,this.default=i.default,Object.defineProperties(this,{readyState:{get:()=>t},track:{get:()=>i}}),t=dn.NONE,i.addEventListener("loadeddata",(()=>{t=dn.LOADED,this.trigger({type:"load",target:this})}))}}dn.prototype.allowedEvents_={load:"load"},dn.NONE=0,dn.LOADING=1,dn.LOADED=2,dn.ERROR=3;const pn={audio:{ListClass:class extends zs{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){Ws(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&Ws(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,Ws(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}},TrackClass:un,capitalName:"Audio"},video:{ListClass:class extends zs{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){Gs(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set(){}})}addTrack(e){e.selected&&Gs(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,Gs(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}},TrackClass:hn,capitalName:"Video"},text:{ListClass:Xs,TrackClass:cn,capitalName:"Text"}};Object.keys(pn).forEach((function(e){pn[e].getterName=`${e}Tracks`,pn[e].privateName=`${e}Tracks_`}));const fn={remoteText:{ListClass:Xs,TrackClass:cn,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:class{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,i=e.length;t<i;t++)this.addTrackElement_(e[t])}addTrackElement_(e){const t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.trackElements_[t]}}),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)}getTrackElementByTrack_(e){let t;for(let i=0,s=this.trackElements_.length;i<s;i++)if(e===this.trackElements_[i].track){t=this.trackElements_[i];break}return t}removeTrackElement_(e){for(let t=0,i=this.trackElements_.length;t<i;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&"function"==typeof this.trackElements_[t].track.off&&this.trackElements_[t].track.off(),"function"==typeof this.trackElements_[t].off&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}}},TrackClass:dn,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},mn=Object.assign({},pn,fn);fn.names=Object.keys(fn),pn.names=Object.keys(pn),mn.names=[].concat(fn.names).concat(pn.names);class gn extends As{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=e=>this.onDurationChange(e),this.trackProgress_=e=>this.trackProgress(e),this.trackCurrentTime_=e=>this.trackCurrentTime(e),this.stopTrackingCurrentTime_=e=>this.stopTrackingCurrentTime(e),this.disposeSourceHandler_=e=>this.disposeSourceHandler(e),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",(function(){this.hasStarted_=!0})),this.on("loadstart",(function(){this.hasStarted_=!1})),mn.names.forEach((t=>{const i=mn[t];e&&e[i.getterName]&&(this[i.privateName]=e[i.getterName])})),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach((t=>{!1===e[`native${t}Tracks`]&&(this[`featuresNative${t}Tracks`]=!1)})),!1===e.nativeCaptions||!1===e.nativeTextTracks?this.featuresNativeTextTracks=!1:!0!==e.nativeCaptions&&!0!==e.nativeTextTracks||(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=!1!==e.preloadTextTracks,this.autoRemoteTextTracks_=new mn.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",(()=>this.setTimeout((()=>this.triggerSourceset(e)),1))),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(as(this,(function(){const e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()})),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return Os(0,0)}bufferedPercent(){return Us(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval((function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}),250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(pn.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){(e=[].concat(e)).forEach((e=>{const t=this[`${e}Tracks`]()||[];let i=t.length;for(;i--;){const s=t[i];"text"===e&&this.removeRemoteTextTrack(s),t.removeTrack(s)}}))}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const i=e[t];this.removeRemoteTextTrack(i)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return void 0!==e&&(this.error_=new Bs(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?Os(0,0):Os()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){pn.names.forEach((e=>{const t=pn[e],i=()=>{this.trigger(`${e}trackchange`)},s=this[t.getterName]();s.addEventListener("removetrack",i),s.addEventListener("addtrack",i),this.on("dispose",(()=>{s.removeEventListener("removetrack",i),s.removeEventListener("addtrack",i)}))}))}addWebVttScript_(){if(!n().WebVTT)if(a().body.contains(this.el())){if(!this.options_["vtt.js"]&&Ot(f())&&Object.keys(f()).length>0)return void this.trigger("vttjsloaded");const e=a().createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",(()=>{e.onload=null,e.onerror=null})),n().WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),i=t=>e.addTrack(t.track),s=t=>e.removeTrack(t.track);t.on("addtrack",i),t.on("removetrack",s),this.addWebVttScript_();const n=()=>this.trigger("texttrackchange"),r=()=>{n();for(let t=0;t<e.length;t++){const i=e[t];i.removeEventListener("cuechange",n),"showing"===i.mode&&i.addEventListener("cuechange",n)}};r(),e.addEventListener("change",r),e.addEventListener("addtrack",r),e.addEventListener("removetrack",r),this.on("dispose",(function(){t.off("addtrack",i),t.off("removetrack",s),e.removeEventListener("change",r),e.removeEventListener("addtrack",r),e.removeEventListener("removetrack",r);for(let t=0;t<e.length;t++)e[t].removeEventListener("cuechange",n)}))}addTextTrack(e,t,i){if(!e)throw new Error("TextTrack kind is required but was not provided");return function(e,t,i,s,n={}){const r=e.textTracks();n.kind=t,i&&(n.label=i),s&&(n.language=s),n.tech=e;const a=new mn.text.TrackClass(n);return r.addTrack(a),a}(this,e,t,i)}createRemoteTextTrack(e){const t=Lt(e,{tech:this});return new fn.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){const i=this.createRemoteTextTrack(e);return"boolean"!=typeof t&&(t=!1),this.remoteTextTrackEls().addTrackElement_(i),this.remoteTextTracks().addTrack(i.track),!1===t&&this.ready((()=>this.autoRemoteTextTracks_.addTrack(i.track))),i}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=Gi();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",(()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())}))):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return gn.canPlayType(e.type)}static isTech(e){return e.prototype instanceof gn||e instanceof gn||e===gn}static registerTech(e,t){if(gn.techs_||(gn.techs_={}),!gn.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!gn.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!gn.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=Cs(e),gn.techs_[e]=t,gn.techs_[Es(e)]=t,"Tech"!==e&&gn.defaultTechOrder_.push(e),t}static getTech(e){if(e)return gn.techs_&&gn.techs_[e]?gn.techs_[e]:(e=Cs(e),n()&&n().videojs&&n().videojs[e]?(Et.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),n().videojs[e]):void 0)}}mn.names.forEach((function(e){const t=mn[e];gn.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}})),gn.prototype.featuresVolumeControl=!0,gn.prototype.featuresMuteControl=!0,gn.prototype.featuresFullscreenResize=!1,gn.prototype.featuresPlaybackRate=!1,gn.prototype.featuresProgressEvents=!1,gn.prototype.featuresSourceset=!1,gn.prototype.featuresTimeupdateEvents=!1,gn.prototype.featuresNativeTextTracks=!1,gn.prototype.featuresVideoFrameCallback=!1,gn.withSourceHandlers=function(e){e.registerSourceHandler=function(t,i){let s=e.sourceHandlers;s||(s=e.sourceHandlers=[]),void 0===i&&(i=s.length),s.splice(i,0,t)},e.canPlayType=function(t){const i=e.sourceHandlers||[];let s;for(let e=0;e<i.length;e++)if(s=i[e].canPlayType(t),s)return s;return""},e.selectSourceHandler=function(t,i){const s=e.sourceHandlers||[];let n;for(let e=0;e<s.length;e++)if(n=s[e].canHandleSource(t,i),n)return s[e];return null},e.canPlaySource=function(t,i){const s=e.selectSourceHandler(t,i);return s?s.canHandleSource(t,i):""},["seekable","seeking","duration"].forEach((function(e){const t=this[e];"function"==typeof t&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})}),e.prototype),e.prototype.setSource=function(t){let i=e.selectSourceHandler(t,this.options_);i||(e.nativeSourceHandler?i=e.nativeSourceHandler:Et.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),i!==e.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=i.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)}},As.registerComponent("Tech",gn),gn.registerTech("Tech",gn),gn.defaultTechOrder_=[];const yn={},vn={},_n={};function bn(e,t,i){e.setTimeout((()=>xn(t,yn[t.type],i,e)),1)}function Tn(e,t,i,s=null){const n="call"+Cs(i),r=e.reduce(Cn(n),s),a=r===_n,o=a?null:t[i](r);return function(e,t,i,s){for(let n=e.length-1;n>=0;n--){const r=e[n];r[t]&&r[t](s,i)}}(e,i,o,a),o}const Sn={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},wn={setCurrentTime:1,setMuted:1,setVolume:1},En={play:1,pause:1};function Cn(e){return(t,i)=>t===_n?_n:i[e]?i[e](t):t}function xn(e={},t=[],i,s,n=[],r=!1){const[a,...o]=t;if("string"==typeof a)xn(e,yn[a],i,s,n,r);else if(a){const t=function(e,t){const i=vn[e.id()];let s=null;if(null==i)return s=t(e),vn[e.id()]=[[t,s]],s;for(let e=0;e<i.length;e++){const[n,r]=i[e];n===t&&(s=r)}return null===s&&(s=t(e),i.push([t,s])),s}(s,a);if(!t.setSource)return n.push(t),xn(e,o,i,s,n,r);t.setSource(Object.assign({},e),(function(a,l){if(a)return xn(e,o,i,s,n,r);n.push(t),xn(l,e.type===l.type?o:yn[l.type],i,s,n,r)}))}else o.length?xn(e,o,i,s,n,r):r?i(e,n):xn(e,yn["*"],i,s,n,!0)}const kn={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"},An=function(e=""){const t=nn(e);return kn[t.toLowerCase()]||""},In=function(e){if(Array.isArray(e)){let t=[];e.forEach((function(e){e=In(e),Array.isArray(e)?t=t.concat(e):Pt(e)&&t.push(e)})),e=t}else e="string"==typeof e&&e.trim()?[Pn({src:e})]:Pt(e)&&"string"==typeof e.src&&e.src&&e.src.trim()?[Pn(e)]:[];return e};function Pn(e){if(!e.type){const t=An(e.src);t&&(e.type=t)}return e}As.registerComponent("MediaLoader",class extends As{constructor(e,t,i){if(super(e,Lt({createEl:!1},t),i),t.playerOptions.sources&&0!==t.playerOptions.sources.length)e.src(t.playerOptions.sources);else for(let i=0,s=t.playerOptions.techOrder;i<s.length;i++){const t=Cs(s[i]);let n=gn.getTech(t);if(t||(n=As.getComponent(t)),n&&n.isSupported()){e.loadTech_(t);break}}}});class On extends As{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=e=>this.handleMouseOver(e),this.handleMouseOut_=e=>this.handleMouseOut(e),this.handleClick_=e=>this.handleClick(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.emitTapEvents(),this.enable()}createEl(e="div",t={},i={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),"button"===e&&Et.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),i=Object.assign({role:"button"},i),this.tabIndex_=t.tabIndex;const s=ci(e,t,i);return this.player_.options_.experimentalSvgIcons||s.appendChild(ci("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(s),s}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=ci("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(void 0===e)return this.controlText_||"Need Text";const i=this.localize(e);this.controlText_=e,ui(this.controlTextEl_,i),this.nonIconControl||this.player_.options_.noUITitleAttributes||t.setAttribute("title",i)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){l().isEventKey(e,"Space")||l().isEventKey(e,"Enter")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}As.registerComponent("ClickableComponent",On);class Ln extends On{constructor(e,t){super(e,t),this.update(),this.update_=e=>this.update(e),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return ci("div",{className:"vjs-poster"})}crossOrigin(e){if(void 0===e)return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;null===e||"anonymous"===e||"use-credentials"===e?this.$("img")&&(this.$("img").crossOrigin=e):this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){e?(this.$("img")||this.el_.appendChild(ci("picture",{className:"vjs-poster",tabIndex:-1},{},ci("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e):this.el_.textContent=""}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?qs(this.player_.play()):this.player_.pause())}}Ln.prototype.crossorigin=Ln.prototype.crossOrigin,As.registerComponent("PosterImage",Ln);const Dn="#222",Rn="#ccc",Nn={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Mn(e,t){let i;if(4===e.length)i=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.");i=e.slice(1)}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function jn(e,t,i){try{e.style[t]=i}catch(e){return}}function Un(e){return e?`${e}px`:""}As.registerComponent("TextTrackDisplay",class extends As{constructor(e,t,i){super(e,t,i);const s=e=>{this.updateDisplayOverlay(),this.updateDisplay(e)};e.on("loadstart",(e=>this.toggleDisplay(e))),e.on("texttrackchange",(e=>this.updateDisplay(e))),e.on("loadedmetadata",(e=>{this.updateDisplayOverlay(),this.preselectTrack(e)})),e.ready(as(this,(function(){if(e.tech_&&e.tech_.featuresNativeTextTracks)return void this.hide();e.on("fullscreenchange",s),e.on("playerresize",s);const t=n().screen.orientation||n(),i=n().screen.orientation?"change":"orientationchange";t.addEventListener(i,s),e.on("dispose",(()=>t.removeEventListener(i,s)));const r=this.options_.playerOptions.tracks||[];for(let e=0;e<r.length;e++)this.player_.addRemoteTextTrack(r[e],!0);this.preselectTrack()})))}preselectTrack(){const e={captions:1,subtitles:1},t=this.player_.textTracks(),i=this.player_.cache_.selectedLanguage;let s,n,r;for(let a=0;a<t.length;a++){const o=t[a];i&&i.enabled&&i.language&&i.language===o.language&&o.kind in e?o.kind===i.kind?r=o:r||(r=o):i&&!i.enabled?(r=null,s=null,n=null):o.default&&("descriptions"!==o.kind||s?o.kind in e&&!n&&(n=o):s=o)}r?r.mode="showing":n?n.mode="showing":s&&(s.mode="showing")}toggleDisplay(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()}createEl(){return super.createEl("div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})}clearDisplay(){"function"==typeof n().WebVTT&&n().WebVTT.processCues(n(),[],this.el_)}updateDisplay(){const e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){const t=[];for(let i=0;i<e.length;++i){const s=e[i];"showing"===s.mode&&t.push(s)}return void this.updateForTrack(t)}let i=null,s=null,n=e.length;for(;n--;){const t=e[n];"showing"===t.mode&&("descriptions"===t.kind?i=t:s=t)}s?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(s)):i&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(i))}updateDisplayOverlay(){if(!this.player_.videoHeight()||!n().CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),i=e/t,s=this.player_.videoWidth()/this.player_.videoHeight();let r=0,a=0;Math.abs(i-s)>.1&&(i>s?r=Math.round((e-t*s)/2):a=Math.round((t-e/s)/2)),jn(this.el_,"insetInline",Un(r)),jn(this.el_,"insetBlock",Un(a))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),i=e.activeCues;let s=i.length;for(;s--;){const e=i[s];if(!e)continue;const r=e.displayState;if(t.color&&(r.firstChild.style.color=t.color),t.textOpacity&&jn(r.firstChild,"color",Mn(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(r.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&jn(r.firstChild,"backgroundColor",Mn(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?jn(r,"backgroundColor",Mn(t.windowColor,t.windowOpacity)):r.style.backgroundColor=t.windowColor),t.edgeStyle&&("dropshadow"===t.edgeStyle?r.firstChild.style.textShadow=`2px 2px 3px ${Dn}, 2px 2px 4px ${Dn}, 2px 2px 5px ${Dn}`:"raised"===t.edgeStyle?r.firstChild.style.textShadow=`1px 1px ${Dn}, 2px 2px ${Dn}, 3px 3px ${Dn}`:"depressed"===t.edgeStyle?r.firstChild.style.textShadow=`1px 1px ${Rn}, 0 1px ${Rn}, -1px -1px ${Dn}, 0 -1px ${Dn}`:"uniform"===t.edgeStyle&&(r.firstChild.style.textShadow=`0 0 4px ${Dn}, 0 0 4px ${Dn}, 0 0 4px ${Dn}, 0 0 4px ${Dn}`)),t.fontPercent&&1!==t.fontPercent){const e=n().parseFloat(r.style.fontSize);r.style.fontSize=e*t.fontPercent+"px",r.style.height="auto",r.style.top="auto"}t.fontFamily&&"default"!==t.fontFamily&&("small-caps"===t.fontFamily?r.firstChild.style.fontVariant="small-caps":r.firstChild.style.fontFamily=Nn[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),"function"!=typeof n().WebVTT||e.every((e=>!e.activeCues)))return;const t=[];for(let i=0;i<e.length;++i){const s=e[i];for(let e=0;e<s.activeCues.length;++e)t.push(s.activeCues[e])}n().WebVTT.processCues(n(),t,this.el_);for(let t=0;t<e.length;++t){const i=e[t];for(let e=0;e<i.activeCues.length;++e){const s=i.activeCues[e].displayState;pi(s,"vjs-text-track-cue","vjs-text-track-cue-"+(i.language?i.language:t)),i.language&&_i(s,"lang",i.language)}this.player_.textTrackSettings&&this.updateDisplayState(i)}}}),As.registerComponent("LoadingSpinner",class extends As{createEl(){const e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"Video Player"),i=ci("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])}),s=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});return s.appendChild(i),s}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}});class Bn extends On{createEl(e,t={},i={}){const s=ci("button",t=Object.assign({className:this.buildCSSClass()},t),i=Object.assign({type:"button"},i));return this.player_.options_.experimentalSvgIcons||s.appendChild(ci("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(s),s}addChild(e,t={}){const i=this.constructor.name;return Et.warn(`Adding an actionable (user controllable) child to a Button (${i}) is not supported; use a ClickableComponent instead.`),As.prototype.addChild.call(this,e,t)}enable(){super.enable(),this.el_.removeAttribute("disabled")}disable(){super.disable(),this.el_.setAttribute("disabled","disabled")}handleKeyDown(e){l().isEventKey(e,"Space")||l().isEventKey(e,"Enter")?e.stopPropagation():super.handleKeyDown(e)}}As.registerComponent("Button",Bn);class Fn extends Bn{constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon("play"),this.on("mousedown",(e=>this.handleMouseDown(e)))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(this.mouseused_&&"clientX"in e&&"clientY"in e)return qs(t),void(this.player_.tech(!0)&&this.player_.tech(!0).focus());const i=this.player_.getChild("controlBar"),s=i&&i.getChild("playToggle");if(!s)return void this.player_.tech(!0).focus();const n=()=>s.focus();Fs(t)?t.then(n,(()=>{})):this.setTimeout(n,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}Fn.prototype.controlText_="Play Video",As.registerComponent("BigPlayButton",Fn),As.registerComponent("CloseButton",class extends Bn{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){l().isEventKey(e,"Esc")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}});class qn extends Bn{constructor(e,t={}){super(e,t),t.replay=void 0===t.replay||t.replay,this.setIcon("play"),this.on(e,"play",(e=>this.handlePlay(e))),this.on(e,"pause",(e=>this.handlePause(e))),t.replay&&this.on(e,"ended",(e=>this.handleEnded(e)))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?qs(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",(e=>this.handleSeeked(e)))}}qn.prototype.controlText_="Play",As.registerComponent("PlayToggle",qn);class $n extends As{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],(e=>this.update(e))),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),i=ci("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return t.appendChild(i),this.contentEl_=ci("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){(this.player_.options_.enableSmoothSeeking||"seeking"!==e.type)&&this.updateContent(e)}updateTextNode_(e=0){e=Ms(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",(()=>{if(!this.contentEl_)return;let e=this.textNode_;e&&this.contentEl_.firstChild!==e&&(e=null,Et.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=a().createTextNode(this.formattedTime_),this.textNode_&&(e?this.contentEl_.replaceChild(this.textNode_,e):this.contentEl_.appendChild(this.textNode_))})))}updateContent(e){}}$n.prototype.labelText_="Time",$n.prototype.controlText_="Time",As.registerComponent("TimeDisplay",$n);class Hn extends $n{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;t=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}Hn.prototype.labelText_="Current Time",Hn.prototype.controlText_="Current Time",As.registerComponent("CurrentTimeDisplay",Hn);class Vn extends $n{constructor(e,t){super(e,t);const i=e=>this.updateContent(e);this.on(e,"durationchange",i),this.on(e,"loadstart",i),this.on(e,"loadedmetadata",i)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}Vn.prototype.labelText_="Duration",Vn.prototype.controlText_="Duration",As.registerComponent("DurationDisplay",Vn),As.registerComponent("TimeDivider",class extends As{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),i=super.createEl("span",{textContent:"/"});return t.appendChild(i),e.appendChild(t),e}});class zn extends $n{constructor(e,t){super(e,t),this.on(e,"durationchange",(e=>this.updateContent(e)))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return!1!==this.options_.displayNegative&&e.insertBefore(ci("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if("number"!=typeof this.player_.duration())return;let t;t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t)}}zn.prototype.labelText_="Remaining Time",zn.prototype.controlText_="Remaining Time",As.registerComponent("RemainingTimeDisplay",zn),As.registerComponent("LiveDisplay",class extends As{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",(e=>this.updateShowing(e)))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=ci("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(ci("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(a().createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}});class Wn extends Bn{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=e=>this.updateLiveEdgeStatus(e),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=ci("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}function Gn(e,t,i){return e=Number(e),Math.min(i,Math.max(t,isNaN(e)?t:e))}Wn.prototype.controlText_="Seek to live, currently playing live",As.registerComponent("SeekToLive",Wn);var Xn=Object.freeze({__proto__:null,clamp:Gn});class Yn extends As{constructor(e,t){super(e,t),this.handleMouseDown_=e=>this.handleMouseDown(e),this.handleMouseUp_=e=>this.handleMouseUp(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.handleClick_=e=>this.handleClick(e),this.handleMouseMove_=e=>this.handleMouseMove(e),this.update_=e=>this.update(e),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},i={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),i=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},i),super.createEl(e,t,i)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||Ht||e.preventDefault(),Ti(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;Si(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",(()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(100*e).toFixed(2)+"%"}))),e}getProgress(){return Number(Gn(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=Ci(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){l().isEventKey(e,"Left")||l().isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepBack()):l().isEventKey(e,"Right")||l().isEventKey(e,"Up")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}As.registerComponent("Slider",Yn);const Kn=(e,t)=>Gn(e/t*100,0,100).toFixed(2)+"%";As.registerComponent("LoadProgressBar",class extends As{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",(e=>this.update(e)))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=ci("span",{className:"vjs-control-text"}),i=ci("span",{textContent:this.localize("Loaded")}),s=a().createTextNode(": ");return this.percentageEl_=ci("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(i),t.appendChild(s),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",(()=>{const e=this.player_.liveTracker,t=this.player_.buffered(),i=e&&e.isLive()?e.seekableEnd():this.player_.duration(),s=this.player_.bufferedEnd(),n=this.partEls_,r=Kn(s,i);this.percent_!==r&&(this.el_.style.width=r,ui(this.percentageEl_,r),this.percent_=r);for(let e=0;e<t.length;e++){const i=t.start(e),r=t.end(e);let a=n[e];a||(a=this.el_.appendChild(ci()),n[e]=a),a.dataset.start===i&&a.dataset.end===r||(a.dataset.start=i,a.dataset.end=r,a.style.left=Kn(i,s),a.style.width=Kn(r-i,s))}for(let e=n.length;e>t.length;e--)this.el_.removeChild(n[e-1]);n.length=t.length}))}}),As.registerComponent("TimeTooltip",class extends As{constructor(e,t){super(e,t),this.update=os(as(this,this.update),rs)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,i){const s=Ei(this.el_),n=wi(this.player_.el()),r=e.width*t;if(!n||!s)return;const a=e.left-n.left+r,o=e.width-r+(n.right-e.right);let l=s.width/2;a<l?l+=l-a:o<l&&(l=o),l<0?l=0:l>s.width&&(l=s.width),l=Math.round(l),this.el_.style.right=`-${l}px`,this.write(i)}write(e){ui(this.el_,e)}updateTime(e,t,i,s){this.requestNamedAnimationFrame("TimeTooltip#updateTime",(()=>{let n;const r=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const e=this.player_.liveTracker.liveWindow(),i=e-t*e;n=(i<1?"":"-")+Ms(i,e)}else n=Ms(i,r);this.update(e,t,n),s&&s()}))}});class Qn extends As{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=os(as(this,this.update),rs)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){const i=this.getChild("timeTooltip");if(!i)return;const s=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,t,s)}}Qn.prototype.options_={children:[]},ti||Bt||Qn.prototype.options_.children.push("timeTooltip"),As.registerComponent("PlayProgressBar",Qn);class Jn extends As{constructor(e,t){super(e,t),this.update=os(as(this,this.update),rs)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,(()=>{this.el_.style.left=e.width*t+"px"}))}}Jn.prototype.options_={children:["timeTooltip"]},As.registerComponent("MouseTimeDisplay",Jn);class Zn extends Yn{constructor(e,t){super(e,t),this.setEventHandlers_()}setEventHandlers_(){this.update_=as(this,this.update),this.update=os(this.update_,rs),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in a()&&"visibilityState"in a()&&this.on(a(),"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){"hidden"===a().visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,rs))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if("hidden"===a().visibilityState)return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",(()=>{const e=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),i=this.player_.liveTracker;let s=this.player_.duration();i&&i.isLive()&&(s=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.percent_=t),this.currentTime_===e&&this.duration_===s||(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[Ms(e,s),Ms(s,s)],"{1} of {2}")),this.currentTime_=e,this.duration_=s),this.bar&&this.bar.update(wi(this.el()),this.getProgress())})),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){const e=this.getCurrentTime_();let t;const i=this.player_.liveTracker;return i&&i.isLive()?(t=(e-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){Oi(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!Oi(e)||isNaN(this.player_.duration()))return;let i;t||this.player_.scrubbing()||this.player_.scrubbing(!0);const s=this.calculateDistance(e),n=this.player_.liveTracker;if(n&&n.isLive()){if(s>=.99)return void n.seekToLiveEdge();const e=n.seekableStart(),t=n.liveCurrentTime();if(i=e+s*n.liveWindow(),i>=t&&(i=t),i<=e&&(i=e+.1),i===1/0)return}else i=s*this.player_.duration(),i===this.player_.duration()&&(i-=.1);this.userSeek_(i),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?qs(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+5)}stepBack(){this.userSeek_(this.player_.currentTime()-5)}handleAction(e){this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(l().isEventKey(e,"Space")||l().isEventKey(e,"Enter"))e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(l().isEventKey(e,"Home"))e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(l().isEventKey(e,"End"))e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(l()(e))){e.preventDefault(),e.stopPropagation();const i=10*(l().codes[l()(e)]-l().codes[0])/100;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*i):this.userSeek_(this.player_.duration()*i)}else l().isEventKey(e,"PgDn")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):l().isEventKey(e,"PgUp")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in a()&&"visibilityState"in a()&&this.off(a(),"visibilitychange",this.toggleVisibility_),super.dispose()}}Zn.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},ti||Bt||Zn.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),As.registerComponent("SeekBar",Zn);class er extends As{constructor(e,t){super(e,t),this.handleMouseMove=os(as(this,this.handleMouseMove),rs),this.throttledHandleMouseSeek=os(as(this,this.handleMouseSeek),rs),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.handleMouseDownHandler_=e=>this.handleMouseDown(e),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const i=t.getChild("playProgressBar"),s=t.getChild("mouseTimeDisplay");if(!i&&!s)return;const n=t.el(),r=Ei(n);let a=Ci(n,e).x;a=Gn(a,0,1),s&&s.update(r,a),i&&i.update(r,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach((e=>e.disable&&e.disable())),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&qs(this.player_.play())}}enable(){this.children().forEach((e=>e.enable&&e.enable())),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}er.prototype.options_={children:["seekBar"]},As.registerComponent("ProgressControl",er);class tr extends Bn{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],(e=>this.handlePictureInPictureChange(e))),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],(e=>this.handlePictureInPictureEnabledChange(e))),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],(()=>this.handlePictureInPictureAudioModeChange())),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){"audio"===this.player_.currentType().substring(0,5)||this.player_.audioPosterMode()||this.player_.audioOnlyMode()?(this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()):this.show()}handlePictureInPictureEnabledChange(){a().pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in n()?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){"function"==typeof a().exitPictureInPicture&&super.show()}}tr.prototype.controlText_="Picture-in-Picture",As.registerComponent("PictureInPictureToggle",tr);class ir extends Bn{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",(e=>this.handleFullscreenChange(e))),!1===a()[e.fsApi_.fullscreenEnabled]&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}ir.prototype.controlText_="Fullscreen",As.registerComponent("FullscreenToggle",ir),As.registerComponent("VolumeLevel",class extends As{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}),As.registerComponent("VolumeLevelTooltip",class extends As{constructor(e,t){super(e,t),this.update=os(as(this,this.update),rs)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,i,s){if(!i){const i=wi(this.el_),s=wi(this.player_.el()),n=e.width*t;if(!s||!i)return;const r=e.left-s.left+n,a=e.width-n+(s.right-e.right);let o=i.width/2;r<o?o+=o-r:a<o&&(o=a),o<0?o=0:o>i.width&&(o=i.width),this.el_.style.right=`-${o}px`}this.write(`${s}%`)}write(e){ui(this.el_,e)}updateVolume(e,t,i,s,n){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",(()=>{this.update(e,t,i,s.toFixed(0)),n&&n()}))}});class sr extends As{constructor(e,t){super(e,t),this.update=os(as(this,this.update),rs)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,i){const s=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,s,(()=>{i?this.el_.style.bottom=e.height*t+"px":this.el_.style.left=e.width*t+"px"}))}}sr.prototype.options_={children:["volumeLevelTooltip"]},As.registerComponent("MouseVolumeLevelDisplay",sr);class nr extends Yn{constructor(e,t){super(e,t),this.on("slideractive",(e=>this.updateLastVolume_(e))),this.on(e,"volumechange",(e=>this.updateARIAAttributes(e))),e.ready((()=>this.updateARIAAttributes()))}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){Oi(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const i=this.el(),s=wi(i),n=this.vertical();let r=Ci(i,e);r=n?r.y:r.x,r=Gn(r,0,1),t.update(s,r,n)}Oi(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(100*this.player_.volume())}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",(()=>{0===this.player_.volume()&&this.player_.lastVolume_(e)}))}}nr.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},ti||Bt||nr.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),nr.prototype.playerEvent="volumechange",As.registerComponent("VolumeBar",nr);class rr extends As{constructor(e,t={}){t.vertical=t.vertical||!1,(void 0===t.volumeBar||Ot(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))}(this,e),this.throttledHandleMouseMove=os(as(this,this.handleMouseMove),rs),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.on("mousedown",(e=>this.handleMouseDown(e))),this.on("touchstart",(e=>this.handleMouseDown(e))),this.on("mousemove",(e=>this.handleMouseMove(e))),this.on(this.volumeBar,["focus","slideractive"],(()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")})),this.on(this.volumeBar,["blur","sliderinactive"],(()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")}))}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}rr.prototype.options_={children:["volumeBar"]},As.registerComponent("VolumeControl",rr);class ar extends Bn{constructor(e,t){super(e,t),function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))}(this,e),this.on(e,["loadstart","volumechange"],(e=>this.update(e)))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),i=this.player_.lastVolume_();if(0===t){const e=i<.1?.1:i;this.player_.volume(e),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high"),ti&&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),fi(this.el_,[0,1,2,3].reduce(((e,t)=>e+`${t?" ":""}vjs-vol-${t}`),"")),pi(this.el_,`vjs-vol-${t}`)}updateControlText_(){const e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)}}ar.prototype.controlText_="Mute",As.registerComponent("MuteToggle",ar);class or extends As{constructor(e,t={}){void 0!==t.inline?t.inline=t.inline:t.inline=!0,(void 0===t.volumeControl||Ot(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=e=>this.handleKeyPress(e),this.on(e,["loadstart"],(e=>this.volumePanelState_(e))),this.on(this.muteToggle,"keyup",(e=>this.handleKeyPress(e))),this.on(this.volumeControl,"keyup",(e=>this.handleVolumeControlKeyUp(e))),this.on("keydown",(e=>this.handleKeyPress(e))),this.on("mouseover",(e=>this.handleMouseOver(e))),this.on("mouseout",(e=>this.handleMouseOut(e))),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){l().isEventKey(e,"Esc")&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),Zi(a(),"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),es(a(),"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){l().isEventKey(e,"Esc")&&this.handleMouseOut()}}or.prototype.options_={children:["muteToggle","volumeControl"]},As.registerComponent("VolumePanel",or);class lr extends Bn{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const t=this.player_.currentTime(),i=this.player_.liveTracker,s=i&&i.isLive()?i.seekableEnd():this.player_.duration();let n;n=t+this.skipTime<=s?t+this.skipTime:s,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}lr.prototype.controlText_="Skip Forward",As.registerComponent("SkipForward",lr);class cr extends Bn{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime(),i=this.player_.liveTracker,s=i&&i.isLive()&&i.seekableStart();let n;n=s&&t-this.skipTime<=s?s:t>=this.skipTime?t-this.skipTime:0,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}cr.prototype.controlText_="Skip Backward",As.registerComponent("SkipBackward",cr);class ur extends As{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",(e=>this.handleKeyDown(e))),this.boundHandleBlur_=e=>this.handleBlur(e),this.boundHandleTapClick_=e=>this.handleTapClick(e)}addEventListenerForItem(e){e instanceof As&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof As&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){"string"==typeof e&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=ci(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),Zi(t,"click",(function(e){e.preventDefault(),e.stopImmediatePropagation()})),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||a().activeElement;if(!this.children().some((e=>e.el()===t))){const e=this.menuButton_;e&&e.buttonPressed_&&t!==e.el().firstChild&&e.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const i=t.filter((t=>t.el()===e.target))[0];if(!i)return;"CaptionSettingsMenuItem"!==i.name()&&this.menuButton_.focus()}}handleKeyDown(e){l().isEventKey(e,"Left")||l().isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(l().isEventKey(e,"Right")||l().isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}As.registerComponent("Menu",ur);class hr extends As{constructor(e,t={}){super(e,t),this.menuButton_=new Bn(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const i=Bn.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+i,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const s=e=>this.handleClick(e);this.handleMenuKeyUp_=e=>this.handleMenuKeyUp(e),this.on(this.menuButton_,"tap",s),this.on(this.menuButton_,"click",s),this.on(this.menuButton_,"keydown",(e=>this.handleKeyDown(e))),this.on(this.menuButton_,"mouseenter",(()=>{this.addClass("vjs-hover"),this.menu.show(),Zi(a(),"keyup",this.handleMenuKeyUp_)})),this.on("mouseleave",(e=>this.handleMouseLeave(e))),this.on("keydown",(e=>this.handleSubmenuKeyDown(e)))}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new ur(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=ci("li",{className:"vjs-menu-title",textContent:Cs(this.options_.title),tabIndex:-1}),i=new As(this.player_,{el:t});e.addItem(i)}if(this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}createItems(){}createEl(){return super.createEl("div",{className:this.buildWrapperCSSClass()},{})}setIcon(e){super.setIcon(e,this.menuButton_.el_)}buildWrapperCSSClass(){let e="vjs-menu-button";return!0===this.options_.inline?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${Bn.prototype.buildCSSClass()} ${super.buildCSSClass()}`}buildCSSClass(){let e="vjs-menu-button";return!0===this.options_.inline?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${super.buildCSSClass()}`}controlText(e,t=this.menuButton_.el()){return this.menuButton_.controlText(e,t)}dispose(){this.handleMouseLeave(),super.dispose()}handleClick(e){this.buttonPressed_?this.unpressButton():this.pressButton()}handleMouseLeave(e){this.removeClass("vjs-hover"),es(a(),"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(e){l().isEventKey(e,"Esc")||l().isEventKey(e,"Tab")?(this.buttonPressed_&&this.unpressButton(),l().isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus())):(l().isEventKey(e,"Up")||l().isEventKey(e,"Down"))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))}handleMenuKeyUp(e){(l().isEventKey(e,"Esc")||l().isEventKey(e,"Tab"))&&this.removeClass("vjs-hover")}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e)}handleSubmenuKeyDown(e){(l().isEventKey(e,"Esc")||l().isEventKey(e,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),l().isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus()))}pressButton(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),ti&&oi())return;this.menu.focus()}}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))}disable(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()}enable(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()}}As.registerComponent("MenuButton",hr);class dr extends hr{constructor(e,t){const i=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),!i)return;const s=as(this,this.update);i.addEventListener("removetrack",s),i.addEventListener("addtrack",s),i.addEventListener("labelchange",s),this.player_.on("ready",s),this.player_.on("dispose",(function(){i.removeEventListener("removetrack",s),i.removeEventListener("addtrack",s),i.removeEventListener("labelchange",s)}))}}As.registerComponent("TrackButton",dr);const pr=["Tab","Esc","Up","Down","Right","Left"];class fr extends On{constructor(e,t){super(e,t),this.selectable=t.selectable,this.isSelected_=t.selected||!1,this.multiSelectable=t.multiSelectable,this.selected(this.isSelected_),this.selectable?this.multiSelectable?this.el_.setAttribute("role","menuitemcheckbox"):this.el_.setAttribute("role","menuitemradio"):this.el_.setAttribute("role","menuitem")}createEl(e,t,i){this.nonIconControl=!0;const s=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),i),n=ci("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?s.appendChild(n):s.replaceChild(n,s.querySelector(".vjs-icon-placeholder")),s}handleKeyDown(e){pr.some((t=>l().isEventKey(e,t)))||super.handleKeyDown(e)}handleClick(e){this.selected(!0)}selected(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))}}As.registerComponent("MenuItem",fr);class mr extends fr{constructor(e,t){const i=t.track,s=e.textTracks();t.label=i.label||i.language||"Unknown",t.selected="showing"===i.mode,super(e,t),this.track=i,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);const r=(...e)=>{this.handleTracksChange.apply(this,e)},o=(...e)=>{this.handleSelectedLanguageChange.apply(this,e)};if(e.on(["loadstart","texttrackchange"],r),s.addEventListener("change",r),s.addEventListener("selectedlanguagechange",o),this.on("dispose",(function(){e.off(["loadstart","texttrackchange"],r),s.removeEventListener("change",r),s.removeEventListener("selectedlanguagechange",o)})),void 0===s.onchange){let e;this.on(["tap","click"],(function(){if("object"!=typeof n().Event)try{e=new(n().Event)("change")}catch(e){}e||(e=a().createEvent("Event"),e.initEvent("change",!0,!0)),s.dispatchEvent(e)}))}this.handleTracksChange()}handleClick(e){const t=this.track,i=this.player_.textTracks();if(super.handleClick(e),i)for(let e=0;e<i.length;e++){const s=i[e];-1!==this.kinds.indexOf(s.kind)&&(s===t?"showing"!==s.mode&&(s.mode="showing"):"disabled"!==s.mode&&(s.mode="disabled"))}}handleTracksChange(e){const t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)}handleSelectedLanguageChange(e){if("showing"===this.track.mode){const e=this.player_.cache_.selectedLanguage;if(e&&e.enabled&&e.language===this.track.language&&e.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}}dispose(){this.track=null,super.dispose()}}As.registerComponent("TextTrackMenuItem",mr);class gr extends mr{constructor(e,t){t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:"disabled"},t.kinds||(t.kinds=[t.kind]),t.label?t.track.label=t.label:t.track.label=t.kinds.join(" and ")+" off",t.selectable=!0,t.multiSelectable=!1,super(e,t)}handleTracksChange(e){const t=this.player().textTracks();let i=!0;for(let e=0,s=t.length;e<s;e++){const s=t[e];if(this.options_.kinds.indexOf(s.kind)>-1&&"showing"===s.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let i=!0;for(let e=0,s=t.length;e<s;e++){const s=t[e];if(["captions","descriptions","subtitles"].indexOf(s.kind)>-1&&"showing"===s.mode){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}As.registerComponent("OffTextTrackMenuItem",gr);class yr extends dr{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=mr){let i;this.label_&&(i=`${this.label_} off`),e.push(new gr(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;const s=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let i=0;i<s.length;i++){const n=s[i];if(this.kinds_.indexOf(n.kind)>-1){const i=new t(this.player_,{track:n,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});i.addClass(`vjs-${n.kind}-menu-item`),e.push(i)}}return e}}As.registerComponent("TextTrackButton",yr);class vr extends fr{constructor(e,t){const i=t.track,s=t.cue,n=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=s.text,t.selected=s.startTime<=n&&n<s.endTime,super(e,t),this.track=i,this.cue=s}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}}As.registerComponent("ChaptersTrackMenuItem",vr);class _r extends yr{constructor(e,t,i){super(e,t,i),this.setIcon("chapters"),this.selectCurrentItem_=()=>{this.items.forEach((e=>{e.selected(this.track_.activeCues[0]===e.cue)}))}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&"chapters"!==e.track.kind)return;const t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){const i=e[t];if(i.kind===this.kind_)return i}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(Cs(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let i=0,s=t.length;i<s;i++){const s=t[i],n=new vr(this.player_,{track:this.track_,cue:s});e.push(n)}return e}}_r.prototype.kind_="chapters",_r.prototype.controlText_="Chapters",As.registerComponent("ChaptersButton",_r);class br extends yr{constructor(e,t,i){super(e,t,i),this.setIcon("audio-description");const s=e.textTracks(),n=as(this,this.handleTracksChange);s.addEventListener("change",n),this.on("dispose",(function(){s.removeEventListener("change",n)}))}handleTracksChange(e){const t=this.player().textTracks();let i=!1;for(let e=0,s=t.length;e<s;e++){const s=t[e];if(s.kind!==this.kind_&&"showing"===s.mode){i=!0;break}}i?this.disable():this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}}br.prototype.kind_="descriptions",br.prototype.controlText_="Descriptions",As.registerComponent("DescriptionsButton",br);class Tr extends yr{constructor(e,t,i){super(e,t,i),this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}}Tr.prototype.kind_="subtitles",Tr.prototype.controlText_="Subtitles",As.registerComponent("SubtitlesButton",Tr);class Sr extends mr{constructor(e,t){t.track={player:e,kind:t.kind,label:t.kind+" settings",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="CaptionSettingsMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.controlText(", opens "+t.kind+" settings dialog")}handleClick(e){this.player().getChild("textTrackSettings").open()}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.kind+" settings"),super.handleLanguagechange()}}As.registerComponent("CaptionSettingsMenuItem",Sr);class wr extends yr{constructor(e,t,i){super(e,t,i),this.setIcon("captions")}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){const e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new Sr(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}}wr.prototype.kind_="captions",wr.prototype.controlText_="Captions",As.registerComponent("CaptionsButton",wr);class Er extends mr{createEl(e,t,i){const s=super.createEl(e,t,i),n=s.querySelector(".vjs-menu-item-text");return"captions"===this.options_.track.kind&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",s):n.appendChild(ci("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(ci("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))),s}}As.registerComponent("SubsCapsMenuItem",Er);class Cr extends yr{constructor(e,t={}){super(e,t),this.label_="subtitles",this.setIcon("subtitles"),["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)>-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(Cs(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new Sr(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,Er),e}}Cr.prototype.kinds_=["captions","subtitles"],Cr.prototype.controlText_="Subtitles",As.registerComponent("SubsCapsButton",Cr);class xr extends fr{constructor(e,t){const i=t.track,s=e.audioTracks();t.label=i.label||i.language||"Unknown",t.selected=i.enabled,super(e,t),this.track=i,this.addClass(`vjs-${i.kind}-menu-item`);const n=(...e)=>{this.handleTracksChange.apply(this,e)};s.addEventListener("change",n),this.on("dispose",(()=>{s.removeEventListener("change",n)}))}createEl(e,t,i){const s=super.createEl(e,t,i),n=s.querySelector(".vjs-menu-item-text");return["main-desc","description"].indexOf(this.options_.track.kind)>=0&&(n.appendChild(ci("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(ci("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),s}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const e=this.player_.audioTracks();for(let t=0;t<e.length;t++){const i=e[t];i!==this.track&&(i.enabled=i===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}}As.registerComponent("AudioTrackMenuItem",xr);class kr extends dr{constructor(e,t={}){t.tracks=e.audioTracks(),super(e,t),this.setIcon("audio")}buildCSSClass(){return`vjs-audio-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-audio-button ${super.buildWrapperCSSClass()}`}createItems(e=[]){this.hideThreshold_=1;const t=this.player_.audioTracks();for(let i=0;i<t.length;i++){const s=t[i];e.push(new xr(this.player_,{track:s,selectable:!0,multiSelectable:!1}))}return e}}kr.prototype.controlText_="Audio Track",As.registerComponent("AudioTrackButton",kr);class Ar extends fr{constructor(e,t){const i=t.rate,s=parseFloat(i,10);t.label=i,t.selected=s===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=i,this.rate=s,this.on(e,"ratechange",(e=>this.update(e)))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}Ar.prototype.contentElType="button",As.registerComponent("PlaybackRateMenuItem",Ar);class Ir extends hr{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",(e=>this.updateVisibility(e))),this.on(e,"ratechange",(e=>this.updateLabel(e))),this.on(e,"playbackrateschange",(e=>this.handlePlaybackRateschange(e)))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=ci("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),t=[];for(let i=e.length-1;i>=0;i--)t.push(new Ar(this.player(),{rate:e[i]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}Ir.prototype.controlText_="Playback Rate",As.registerComponent("PlaybackRateMenuButton",Ir);class Pr extends As{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},i={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,i)}}As.registerComponent("Spacer",Pr),As.registerComponent("CustomControlSpacer",class extends Pr{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}});class Or extends As{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}Or.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]},As.registerComponent("ControlBar",Or);class Lr extends Vs{constructor(e,t){super(e,t),this.on(e,"error",(e=>{this.open(e)}))}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}Lr.prototype.options_=Object.assign({},Vs.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),As.registerComponent("ErrorDisplay",Lr);const Dr="vjs-text-track-settings",Rr=["#000","Black"],Nr=["#00F","Blue"],Mr=["#0FF","Cyan"],jr=["#0F0","Green"],Ur=["#F0F","Magenta"],Br=["#F00","Red"],Fr=["#FFF","White"],qr=["#FF0","Yellow"],$r=["1","Opaque"],Hr=["0.5","Semi-Transparent"],Vr=["0","Transparent"],zr={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Rr,Fr,Br,jr,Nr,qr,Ur,Mr]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[$r,Hr,Vr]},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Fr,Rr,Br,jr,Nr,qr,Ur,Mr]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:e=>"1.00"===e?null:Number(e)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[$r,Hr]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[Vr,Hr,$r]}};function Wr(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}zr.windowColor.options=zr.backgroundColor.options,As.registerComponent("TextTrackSettings",class extends Vs{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.endDialog=ci("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),void 0===t.persistTextTrackSettings&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.on(this.$(".vjs-done-button"),"click",(()=>{this.saveSettings(),this.close()})),this.on(this.$(".vjs-default-button"),"click",(()=>{this.setDefaults(),this.updateDisplay()})),At(zr,(e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})),this.options_.persistTextTrackSettings&&this.restoreSettings()}dispose(){this.endDialog=null,super.dispose()}createElSelect_(e,t="",i="label"){const s=zr[e],n=s.id.replace("%s",this.id_),r=[t,n].join(" ").trim(),a=`vjs_select_${Gi()}`;return[`<${i} id="${n}"${"label"===i?` for="${a}" class="vjs-label"`:""}>`,this.localize(s.label),`</${i}>`,`<select aria-labelledby="${r}" id="${a}">`].concat(s.options.map((e=>{const t=n+"-"+e[1].replace(/\W+/g,"");return[`<option id="${t}" value="${e[0]}" `,`aria-labelledby="${r} ${t}">`,this.localize(e[1]),"</option>"].join("")}))).concat("</select>").join("")}createElFgColor_(){const e=`captions-text-legend-${this.id_}`;return['<fieldset class="vjs-fg vjs-track-setting">',`<legend id="${e}">`,this.localize("Text"),"</legend>",'<span class="vjs-text-color">',this.createElSelect_("color",e),"</span>",'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",e),"</span>","</fieldset>"].join("")}createElBgColor_(){const e=`captions-background-${this.id_}`;return['<fieldset class="vjs-bg vjs-track-setting">',`<legend id="${e}">`,this.localize("Text Background"),"</legend>",'<span class="vjs-bg-color">',this.createElSelect_("backgroundColor",e),"</span>",'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",e),"</span>","</fieldset>"].join("")}createElWinColor_(){const e=`captions-window-${this.id_}`;return['<fieldset class="vjs-window vjs-track-setting">',`<legend id="${e}">`,this.localize("Caption Area Background"),"</legend>",'<span class="vjs-window-color">',this.createElSelect_("windowColor",e),"</span>",'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",e),"</span>","</fieldset>"].join("")}createElColors_(){return ci("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})}createElFont_(){return ci("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})}createElControls_(){const e=this.localize("restore all settings to the default values");return ci("div",{className:"vjs-track-settings-controls",innerHTML:[`<button type="button" class="vjs-default-button" title="${e}">`,this.localize("Reset"),`<span class="vjs-control-text"> ${e}</span>`,"</button>",`<button type="button" class="vjs-done-button">${this.localize("Done")}</button>`].join("")})}content(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return It(zr,((e,t,i)=>{const s=(n=this.$(t.selector),r=t.parser,Wr(n.options[n.options.selectedIndex].value,r));var n,r;return void 0!==s&&(e[i]=s),e}),{})}setValues(e){At(zr,((t,i)=>{!function(e,t,i){if(t)for(let s=0;s<e.options.length;s++)if(Wr(e.options[s].value,i)===t){e.selectedIndex=s;break}}(this.$(t.selector),e[i],t.parser)}))}setDefaults(){At(zr,(e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t}))}restoreSettings(){let e;try{e=JSON.parse(n().localStorage.getItem(Dr))}catch(e){Et.warn(e)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?n().localStorage.setItem(Dr,JSON.stringify(e)):n().localStorage.removeItem(Dr)}catch(e){Et.warn(e)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}conditionalBlur_(){this.previouslyActiveEl_=null;const e=this.player_.controlBar,t=e&&e.subsCapsButton,i=e&&e.captionsButton;t?t.focus():i&&i.focus()}handleLanguagechange(){this.fill()}}),As.registerComponent("ResizeManager",class extends As{constructor(e,t){let i=t.ResizeObserver||n().ResizeObserver;null===t.ResizeObserver&&(i=!1),super(e,Lt({createEl:!i,reportTouchActivity:!1},t)),this.ResizeObserver=t.ResizeObserver||n().ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=ls((()=>{this.resizeHandler()}),100,!1,this),i?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const e=this.debouncedHandler_;let t=this.unloadListener_=function(){es(this,"resize",e),es(this,"unload",t),t=null};Zi(this.el_.contentWindow,"unload",t),Zi(this.el_.contentWindow,"resize",e)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}});const Gr={trackingThreshold:20,liveTolerance:15};As.registerComponent("LiveTracker",class extends As{constructor(e,t){super(e,Lt(Gr,t,{createEl:!1})),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=e=>this.handlePlay(e),this.handleFirstTimeupdate_=e=>this.handleFirstTimeupdate(e),this.handleSeeked_=e=>this.handleSeeked(e),this.seekToLiveEdge_=e=>this.seekToLiveEdge(e),this.reset_(),this.on(this.player_,"durationchange",(e=>this.handleDurationchange(e))),this.on(this.player_,"canplay",(()=>this.toggleTracking()))}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(n().performance.now().toFixed(4)),i=-1===this.lastTime_?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+i;const s=this.liveCurrentTime(),r=this.player_.currentTime();let a=this.player_.paused()||this.seekedBehindLive_||Math.abs(s-r)>this.options_.liveTolerance;this.timeupdateSeen_&&s!==1/0||(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,rs),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return-1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return"number"==typeof this.trackingInterval_}seekToLiveEdge(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}),As.registerComponent("TitleBar",class extends As{constructor(e,t){super(e,t),this.on("statechanged",(e=>this.updateDom_())),this.updateDom_()}createEl(){return this.els={title:ci("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${Gi()}`}),description:ci("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${Gi()}`})},ci("div",{className:"vjs-title-bar"},{},Dt(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,i={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach((e=>{const s=this.state[e],n=this.els[e],r=i[e];ki(n),s&&ui(n,s),t&&(t.removeAttribute(r),s&&t.setAttribute(r,n.id))})),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}});const Xr=e=>{const t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;const i=e.$$("source"),s=[];let n="";if(!i.length)return!1;for(let e=0;e<i.length;e++){const t=i[e].src;t&&-1===s.indexOf(t)&&s.push(t)}return!!s.length&&(1===s.length&&(n=s[0]),e.triggerSourceset(n),!0)},Yr=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(e){const t=a().createElement(this.nodeName.toLowerCase());t.innerHTML=e;const i=a().createDocumentFragment();for(;t.childNodes.length;)i.appendChild(t.childNodes[0]);return this.innerText="",n().Element.prototype.appendChild.call(this,i),this.innerHTML}}),Kr=(e,t)=>{let i={};for(let s=0;s<e.length&&(i=Object.getOwnPropertyDescriptor(e[s],t),!(i&&i.set&&i.get));s++);return i.enumerable=!0,i.configurable=!0,i},Qr=function(e){const t=e.el();if(t.resetSourceWatch_)return;const i={},s=(e=>Kr([e.el(),n().HTMLMediaElement.prototype,n().Element.prototype,Yr],"innerHTML"))(e),r=i=>(...s)=>{const n=i.apply(t,s);return Xr(e),n};["append","appendChild","insertAdjacentHTML"].forEach((e=>{t[e]&&(i[e]=t[e],t[e]=r(i[e]))})),Object.defineProperty(t,"innerHTML",Lt(s,{set:r(s.set)})),t.resetSourceWatch_=()=>{t.resetSourceWatch_=null,Object.keys(i).forEach((e=>{t[e]=i[e]})),Object.defineProperty(t,"innerHTML",s)},e.one("sourceset",t.resetSourceWatch_)},Jr=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?sn(n().Element.prototype.getAttribute.call(this,"src")):""},set(e){return n().Element.prototype.setAttribute.call(this,"src",e),e}});class Zr extends gn{constructor(e,t){super(e,t);const i=e.source;let s=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&"VIDEO"===this.el_.tagName,i&&(this.el_.currentSrc!==i.src||e.tag&&3===e.tag.initNetworkState_)?this.setSource(i):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const e=this.el_.childNodes;let t=e.length;const i=[];for(;t--;){const n=e[t];"track"===n.nodeName.toLowerCase()&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(n),this.remoteTextTracks().addTrack(n.track),this.textTracks().addTrack(n.track),s||this.el_.hasAttribute("crossorigin")||!rn(n.src)||(s=!0)):i.push(n))}for(let e=0;e<i.length;e++)this.el_.removeChild(i[e])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&s&&Et.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading."),this.restoreMetadataTracksInIOSNativePlayer_(),(Zt||Kt)&&!0===e.nativeControlsForTouch&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),Zr.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){!function(e){if(!e.featuresSourceset)return;const t=e.el();if(t.resetSourceset_)return;const i=(e=>Kr([e.el(),n().HTMLMediaElement.prototype,Jr],"src"))(e),s=t.setAttribute,r=t.load;Object.defineProperty(t,"src",Lt(i,{set:s=>{const n=i.set.call(t,s);return e.triggerSourceset(t.src),n}})),t.setAttribute=(i,n)=>{const r=s.call(t,i,n);return/src/i.test(i)&&e.triggerSourceset(t.src),r},t.load=()=>{const i=r.call(t);return Xr(e)||(e.triggerSourceset(""),Qr(e)),i},t.currentSrc?e.triggerSourceset(t.currentSrc):Xr(e)||Qr(e),t.resetSourceset_=()=>{t.resetSourceset_=null,t.load=r,t.setAttribute=s,Object.defineProperty(t,"src",i),t.resetSourceWatch_&&t.resetSourceWatch_()}}(this)}restoreMetadataTracksInIOSNativePlayer_(){const e=this.textTracks();let t;const i=()=>{t=[];for(let i=0;i<e.length;i++){const s=e[i];"metadata"===s.kind&&t.push({track:s,storedMode:s.mode})}};i(),e.addEventListener("change",i),this.on("dispose",(()=>e.removeEventListener("change",i)));const s=()=>{for(let e=0;e<t.length;e++){const i=t[e];"disabled"===i.track.mode&&i.track.mode!==i.storedMode&&(i.track.mode=i.storedMode)}e.removeEventListener("change",s)};this.on("webkitbeginfullscreen",(()=>{e.removeEventListener("change",i),e.removeEventListener("change",s),e.addEventListener("change",s)})),this.on("webkitendfullscreen",(()=>{e.removeEventListener("change",i),e.addEventListener("change",i),e.removeEventListener("change",s)}))}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const i=e.toLowerCase();this[`${i}TracksListeners_`]&&Object.keys(this[`${i}TracksListeners_`]).forEach((e=>{this.el()[`${i}Tracks`].removeEventListener(e,this[`${i}TracksListeners_`][e])})),this[`featuresNative${e}Tracks`]=!t,this[`${i}TracksListeners_`]=null,this.proxyNativeTracksForType_(i)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=pn[e],i=this.el()[t.getterName],s=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!i||!i.addEventListener)return;const n={change:t=>{const i={type:"change",target:s,currentTarget:s,srcElement:s};s.trigger(i),"text"===e&&this[fn.remoteText.getterName]().trigger(i)},addtrack(e){s.addTrack(e.track)},removetrack(e){s.removeTrack(e.track)}},r=function(){const e=[];for(let t=0;t<s.length;t++){let n=!1;for(let e=0;e<i.length;e++)if(i[e]===s[t]){n=!0;break}n||e.push(s[t])}for(;e.length;)s.removeTrack(e.shift())};this[t.getterName+"Listeners_"]=n,Object.keys(n).forEach((e=>{const t=n[e];i.addEventListener(e,t),this.on("dispose",(s=>i.removeEventListener(e,t)))})),this.on("loadstart",r),this.on("dispose",(e=>this.off("loadstart",r)))}proxyNativeTracks_(){pn.names.forEach((e=>{this.proxyNativeTracksForType_(e)}))}createEl(){let e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){const t=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(t,e),Zr.disposeMediaElement(e),e=t}else{e=a().createElement("video");const t=Lt({},this.options_.tag&&yi(this.options_.tag));Zt&&!0===this.options_.nativeControlsForTouch||delete t.controls,gi(e,Object.assign(t,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}void 0!==this.options_.preload&&_i(e,"preload",this.options_.preload),void 0!==this.options_.disablePictureInPicture&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let i=0;i<t.length;i++){const s=t[i],n=this.options_[s];void 0!==n&&(n?_i(e,s,s):bi(e,s),e[s]=n)}return e}handleLateInit_(e){if(0===e.networkState||3===e.networkState)return;if(0===e.readyState){let e=!1;const t=function(){e=!0};this.on("loadstart",t);const i=function(){e||this.trigger("loadstart")};return this.on("loadedmetadata",i),void this.ready((function(){this.off("loadstart",t),this.off("loadedmetadata",i),e||this.trigger("loadstart")}))}const t=["loadstart"];t.push("loadedmetadata"),e.readyState>=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready((function(){t.forEach((function(e){this.trigger(e)}),this)}))}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&ii?this.el_.fastSeek(e):this.el_.currentTime=e}catch(e){Et(e,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&Bt&&Ht&&0===this.el_.currentTime){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",(()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)}))}supportsFullScreen(){return"function"==typeof this.el_.webkitEnterFullScreen}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)qs(this.el_.play()),this.setTimeout((function(){e.pause();try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}}),0);else try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}}exitFullScreen(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(void 0===e)return this.el_.src;this.setSrc(e)}reset(){Zr.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,i):super.addTextTrack(e,t,i)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=a().createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){const i=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(i),i}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let i=t.length;for(;i--;)e!==t[i]&&e!==t[i].track||this.el().removeChild(t[i])}}getVideoPlaybackQuality(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();const e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),n().performance&&(e.creationTime=n().performance.now()),e}}Rt(Zr,"TEST_VID",(function(){if(!ri())return;const e=a().createElement("video"),t=a().createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e})),Zr.isSupported=function(){try{Zr.TEST_VID.volume=.5}catch(e){return!1}return!(!Zr.TEST_VID||!Zr.TEST_VID.canPlayType)},Zr.canPlayType=function(e){return Zr.TEST_VID.canPlayType(e)},Zr.canPlaySource=function(e,t){return Zr.canPlayType(e.type)},Zr.canControlVolume=function(){try{const e=Zr.TEST_VID.volume;Zr.TEST_VID.volume=e/2+.1;const t=e!==Zr.TEST_VID.volume;return t&&ti?(n().setTimeout((()=>{Zr&&Zr.prototype&&(Zr.prototype.featuresVolumeControl=e!==Zr.TEST_VID.volume)})),!1):t}catch(e){return!1}},Zr.canMuteVolume=function(){try{const e=Zr.TEST_VID.muted;return Zr.TEST_VID.muted=!e,Zr.TEST_VID.muted?_i(Zr.TEST_VID,"muted","muted"):bi(Zr.TEST_VID,"muted"),e!==Zr.TEST_VID.muted}catch(e){return!1}},Zr.canControlPlaybackRate=function(){if(Bt&&Ht&&zt<58)return!1;try{const e=Zr.TEST_VID.playbackRate;return Zr.TEST_VID.playbackRate=e/2+.1,e!==Zr.TEST_VID.playbackRate}catch(e){return!1}},Zr.canOverrideAttributes=function(){try{const e=()=>{};Object.defineProperty(a().createElement("video"),"src",{get:e,set:e}),Object.defineProperty(a().createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(a().createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(a().createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return!1}return!0},Zr.supportsNativeTextTracks=function(){return ii||ti&&Ht},Zr.supportsNativeVideoTracks=function(){return!(!Zr.TEST_VID||!Zr.TEST_VID.videoTracks)},Zr.supportsNativeAudioTracks=function(){return!(!Zr.TEST_VID||!Zr.TEST_VID.audioTracks)},Zr.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach((function([e,t]){Rt(Zr.prototype,e,(()=>Zr[t]()),!0)})),Zr.prototype.featuresVolumeControl=Zr.canControlVolume(),Zr.prototype.movingMediaElementInDOM=!ti,Zr.prototype.featuresFullscreenResize=!0,Zr.prototype.featuresProgressEvents=!0,Zr.prototype.featuresTimeupdateEvents=!0,Zr.prototype.featuresVideoFrameCallback=!(!Zr.TEST_VID||!Zr.TEST_VID.requestVideoFrameCallback),Zr.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){}}()}},Zr.resetMediaElement=function(e){if(!e)return;const t=e.querySelectorAll("source");let i=t.length;for(;i--;)e.removeChild(t[i]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach((function(e){Zr.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}})),["muted","defaultMuted","autoplay","loop","playsinline"].forEach((function(e){Zr.prototype["set"+Cs(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){Zr.prototype[e]=function(){return this.el_[e]}})),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach((function(e){Zr.prototype["set"+Cs(e)]=function(t){this.el_[e]=t}})),["pause","load","play"].forEach((function(e){Zr.prototype[e]=function(){return this.el_[e]()}})),gn.withSourceHandlers(Zr),Zr.nativeSourceHandler={},Zr.nativeSourceHandler.canPlayType=function(e){try{return Zr.TEST_VID.canPlayType(e)}catch(e){return""}},Zr.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return Zr.nativeSourceHandler.canPlayType(e.type);if(e.src){const t=nn(e.src);return Zr.nativeSourceHandler.canPlayType(`video/${t}`)}return""},Zr.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)},Zr.nativeSourceHandler.dispose=function(){},Zr.registerSourceHandler(Zr.nativeSourceHandler),gn.registerTech("Html5",Zr);const ea=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],ta={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},ia=["tiny","xsmall","small","medium","large","xlarge","huge"],sa={};ia.forEach((e=>{const t="x"===e.charAt(0)?`x-${e.substring(1)}`:e;sa[e]=`vjs-layout-${t}`}));const na={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class ra extends As{constructor(e,t,i){if(e.id=e.id||t.id||`vjs_video_${Gi()}`,(t=Object.assign(ra.getTagSettings(e),t)).initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const i=e.closest("[lang]");i&&(t.language=i.getAttribute("lang"))}if(super(null,t,i),this.boundDocumentFullscreenChange_=e=>this.documentFullscreenChange_(e),this.boundFullWindowOnEscKey_=e=>this.fullWindowOnEscKey(e),this.boundUpdateStyleEl_=e=>this.updateStyleEl_(e),this.boundApplyInitTime_=e=>this.applyInitTime_(e),this.boundUpdateCurrentBreakpoint_=e=>this.updateCurrentBreakpoint_(e),this.boundHandleTechClick_=e=>this.handleTechClick_(e),this.boundHandleTechDoubleClick_=e=>this.handleTechDoubleClick_(e),this.boundHandleTechTouchStart_=e=>this.handleTechTouchStart_(e),this.boundHandleTechTouchMove_=e=>this.handleTechTouchMove_(e),this.boundHandleTechTouchEnd_=e=>this.handleTechTouchEnd_(e),this.boundHandleTechTap_=e=>this.handleTechTap_(e),this.isFullscreen_=!1,this.log=Ct(this.id_),this.fsApi_=_t,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&yi(e),this.language(this.options_.language),t.languages){const e={};Object.getOwnPropertyNames(t.languages).forEach((function(i){e[i.toLowerCase()]=t.languages[i]})),this.languages_=e}else this.languages_=ra.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach((e=>{if("function"!=typeof this[e])throw new Error(`plugin "${e}" does not exist`)})),this.scrubbing_=!1,this.el_=this.createEl(),Ts(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(Zi(a(),this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const s=Lt(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach((e=>{this[e](t.plugins[e])})),t.debug&&this.debug(!0),this.options_.playerOptions=s,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const e=(new(n().DOMParser)).parseFromString('<svg xmlns="http://www.w3.org/2000/svg">\n <defs>\n <symbol viewBox="0 0 48 48" id="vjs-icon-play">\n <path d="M16 10v28l22-14z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-pause">\n <path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-audio">\n <path d="M24 2C14.06 2 6 10.06 6 20v14c0 3.31 2.69 6 6 6h6V24h-8v-4c0-7.73 6.27-14 14-14s14 6.27 14 14v4h-8v16h6c3.31 0 6-2.69 6-6V20c0-9.94-8.06-18-18-18z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-captions">\n <path d="M38 8H10c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM22 22h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2zm14 0h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-subtitles">\n <path d="M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-enter">\n <path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-exit">\n <path d="M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-play-circle">\n <path d="M20 33l12-9-12-9v18zm4-29C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-mute">\n <path d="M33 24c0-3.53-2.04-6.58-5-8.05v4.42l4.91 4.91c.06-.42.09-.85.09-1.28zm5 0c0 1.88-.41 3.65-1.08 5.28l3.03 3.03C41.25 29.82 42 27 42 24c0-8.56-5.99-15.72-14-17.54v4.13c5.78 1.72 10 7.07 10 13.41zM8.55 6L6 8.55 15.45 18H6v12h8l10 10V26.55l8.51 8.51c-1.34 1.03-2.85 1.86-4.51 2.36v4.13a17.94 17.94 0 0 0 7.37-3.62L39.45 42 42 39.45l-18-18L8.55 6zM24 8l-4.18 4.18L24 16.36V8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-low">\n <path d="M14 18v12h8l10 10V8L22 18h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-medium">\n <path d="M37 24c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zm-27-6v12h8l10 10V8L18 18h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-high">\n <path d="M6 18v12h8l10 10V8L14 18H6zm27 6c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zM28 6.46v4.13c5.78 1.72 10 7.07 10 13.41s-4.22 11.69-10 13.41v4.13c8.01-1.82 14-8.97 14-17.54S36.01 8.28 28 6.46z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-spinner">\n <path d="M18.8 21l9.53-16.51C26.94 4.18 25.49 4 24 4c-4.8 0-9.19 1.69-12.64 4.51l7.33 12.69.11-.2zm24.28-3c-1.84-5.85-6.3-10.52-11.99-12.68L23.77 18h19.31zm.52 2H28.62l.58 1 9.53 16.5C41.99 33.94 44 29.21 44 24c0-1.37-.14-2.71-.4-4zm-26.53 4l-7.8-13.5C6.01 14.06 4 18.79 4 24c0 1.37.14 2.71.4 4h14.98l-2.31-4zM4.92 30c1.84 5.85 6.3 10.52 11.99 12.68L24.23 30H4.92zm22.54 0l-7.8 13.51c1.4.31 2.85.49 4.34.49 4.8 0 9.19-1.69 12.64-4.51L29.31 26.8 27.46 30z"></path>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-hd">\n <path d="M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12H9.5v-2h-2v2H6V9h1.5v2.5h2V9H11v6zm2-6h4c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1h-4V9zm1.5 4.5h2v-3h-2v3z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-chapters">\n <path d="M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"></path>\n </symbol>\n <symbol viewBox="0 0 40 40" id="vjs-icon-downloading">\n <path d="M18.208 36.875q-3.208-.292-5.979-1.729-2.771-1.438-4.812-3.729-2.042-2.292-3.188-5.229-1.146-2.938-1.146-6.23 0-6.583 4.334-11.416 4.333-4.834 10.833-5.5v3.166q-5.167.75-8.583 4.646Q6.25 14.75 6.25 19.958q0 5.209 3.396 9.104 3.396 3.896 8.562 4.646zM20 28.417L11.542 20l2.083-2.083 4.917 4.916v-11.25h2.916v11.25l4.875-4.916L28.417 20zm1.792 8.458v-3.167q1.833-.25 3.541-.958 1.709-.708 3.167-1.875l2.333 2.292q-1.958 1.583-4.25 2.541-2.291.959-4.791 1.167zm6.791-27.792q-1.541-1.125-3.25-1.854-1.708-.729-3.541-1.021V3.042q2.5.25 4.77 1.208 2.271.958 4.271 2.5zm4.584 21.584l-2.25-2.25q1.166-1.5 1.854-3.209.687-1.708.937-3.541h3.209q-.292 2.5-1.229 4.791-.938 2.292-2.521 4.209zm.541-12.417q-.291-1.833-.958-3.562-.667-1.73-1.833-3.188l2.375-2.208q1.541 1.916 2.458 4.208.917 2.292 1.167 4.75z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download">\n <path d="M10.8 40.55q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h26.35v-7.7h3.4v7.7q0 1.4-1 2.4t-2.4 1zM24 32.1L13.9 22.05l2.45-2.45 5.95 5.95V7.15h3.4v18.4l5.95-5.95 2.45 2.45z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-done">\n <path d="M9.8 40.5v-3.45h28.4v3.45zm9.2-9.05L7.4 19.85l2.45-2.35L19 26.65l19.2-19.2 2.4 2.4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-off">\n <path d="M4.9 4.75L43.25 43.1 41 45.3l-4.75-4.75q-.05.05-.075.025-.025-.025-.075-.025H10.8q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h22.05l-7-7-1.85 1.8L13.9 21.9l1.85-1.85L2.7 7zm26.75 14.7l2.45 2.45-3.75 3.8-2.45-2.5zM25.7 7.15V21.1l-3.4-3.45V7.15z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-share">\n <path d="M36 32.17c-1.52 0-2.89.59-3.93 1.54L17.82 25.4c.11-.45.18-.92.18-1.4s-.07-.95-.18-1.4l14.1-8.23c1.07 1 2.5 1.62 4.08 1.62 3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6c0 .48.07.95.18 1.4l-14.1 8.23c-1.07-1-2.5-1.62-4.08-1.62-3.31 0-6 2.69-6 6s2.69 6 6 6c1.58 0 3.01-.62 4.08-1.62l14.25 8.31c-.1.42-.16.86-.16 1.31A5.83 5.83 0 1 0 36 32.17z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cog">\n <path d="M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97L29 4.84c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3a14.8 14.8 0 0 0-3.38 1.97L9.9 10.1a1 1 0 0 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31C9.06 22.69 9 23.34 9 24s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3a14.8 14.8 0 0 0 3.38-1.97l4.98 2.01a1 1 0 0 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zM24 31c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-square">\n <path d="M36 8H12c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h24c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zm0 28H12V12h24v24z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle">\n <circle cx="24" cy="24" r="20"></circle>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle-outline">\n <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle-inner-circle">\n <path d="M24 4C12.97 4 4 12.97 4 24s8.97 20 20 20 20-8.97 20-20S35.03 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16zm6-16c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6 6 2.69 6 6z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cancel">\n <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm10 27.17L31.17 34 24 26.83 16.83 34 14 31.17 21.17 24 14 16.83 16.83 14 24 21.17 31.17 14 34 16.83 26.83 24 34 31.17z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-replay">\n <path d="M24 10V2L14 12l10 10v-8c6.63 0 12 5.37 12 12s-5.37 12-12 12-12-5.37-12-12H8c0 8.84 7.16 16 16 16s16-7.16 16-16-7.16-16-16-16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-repeat">\n <path d="M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-5">\n <path d="M17.689 98l-8.697 8.696 8.697 8.697 2.486-2.485-4.32-4.319h1.302c4.93 0 9.071 1.722 12.424 5.165 3.352 3.443 5.029 7.638 5.029 12.584h3.55c0-2.958-.553-5.73-1.658-8.313-1.104-2.583-2.622-4.841-4.555-6.774-1.932-1.932-4.19-3.45-6.773-4.555-2.584-1.104-5.355-1.657-8.313-1.657H15.5l4.615-4.615zm-8.08 21.659v13.861h11.357v5.008H9.609V143h12.7c.834 0 1.55-.298 2.146-.894.596-.597.895-1.31.895-2.145v-7.781c0-.835-.299-1.55-.895-2.147a2.929 2.929 0 0 0-2.147-.894h-8.227v-5.096H25.35v-4.384z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-10">\n <path d="M42.315 125.63c0-4.997-1.694-9.235-5.08-12.713-3.388-3.479-7.571-5.218-12.552-5.218h-1.315l4.363 4.363-2.51 2.51-8.787-8.786L25.221 97l2.45 2.45-4.662 4.663h1.375c2.988 0 5.788.557 8.397 1.673 2.61 1.116 4.892 2.65 6.844 4.602 1.953 1.953 3.487 4.234 4.602 6.844 1.116 2.61 1.674 5.41 1.674 8.398zM8.183 142v-19.657H3.176V117.8h9.643V142zm13.63 0c-1.156 0-2.127-.393-2.912-1.178-.778-.778-1.168-1.746-1.168-2.902v-16.04c0-1.156.393-2.127 1.178-2.912.779-.779 1.746-1.168 2.902-1.168h7.696c1.156 0 2.126.392 2.911 1.177.779.78 1.168 1.747 1.168 2.903v16.04c0 1.156-.392 2.127-1.177 2.912-.779.779-1.746 1.168-2.902 1.168zm.556-4.636h6.583v-15.02H22.37z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-30">\n <path d="M26.047 97l-8.733 8.732 8.733 8.733 2.496-2.494-4.336-4.338h1.307c4.95 0 9.108 1.73 12.474 5.187 3.367 3.458 5.051 7.668 5.051 12.635h3.565c0-2.97-.556-5.751-1.665-8.346-1.109-2.594-2.633-4.862-4.574-6.802-1.94-1.941-4.208-3.466-6.803-4.575-2.594-1.109-5.375-1.664-8.345-1.664H23.85l4.634-4.634zM2.555 117.531v4.688h10.297v5.25H5.873v4.687h6.979v5.156H2.555V142H13.36c1.061 0 1.95-.395 2.668-1.186.718-.79 1.076-1.772 1.076-2.94v-16.218c0-1.168-.358-2.149-1.076-2.94-.717-.79-1.607-1.185-2.668-1.185zm22.482.14c-1.149 0-2.11.39-2.885 1.165-.78.78-1.172 1.744-1.172 2.893v15.943c0 1.149.388 2.11 1.163 2.885.78.78 1.745 1.172 2.894 1.172h7.649c1.148 0 2.11-.388 2.884-1.163.78-.78 1.17-1.745 1.17-2.894v-15.943c0-1.15-.386-2.111-1.16-2.885-.78-.78-1.746-1.172-2.894-1.172zm.553 4.518h6.545v14.93H25.59z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-5">\n <path d="M29.508 97l-2.431 2.43 4.625 4.625h-1.364c-2.965 0-5.742.554-8.332 1.66-2.589 1.107-4.851 2.629-6.788 4.566-1.937 1.937-3.458 4.2-4.565 6.788-1.107 2.59-1.66 5.367-1.66 8.331h3.557c0-4.957 1.68-9.16 5.04-12.611 3.36-3.45 7.51-5.177 12.451-5.177h1.304l-4.326 4.33 2.49 2.49 8.715-8.716zm-9.783 21.61v13.89h11.382v5.018H19.725V142h12.727a2.93 2.93 0 0 0 2.15-.896 2.93 2.93 0 0 0 .896-2.15v-7.798c0-.837-.299-1.554-.896-2.152a2.93 2.93 0 0 0-2.15-.896h-8.245V123h11.29v-4.392z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-10">\n <path d="M23.119 97l-2.386 2.383 4.538 4.538h-1.339c-2.908 0-5.633.543-8.173 1.63-2.54 1.085-4.76 2.577-6.66 4.478-1.9 1.9-3.392 4.12-4.478 6.66-1.085 2.54-1.629 5.264-1.629 8.172h3.49c0-4.863 1.648-8.986 4.944-12.372 3.297-3.385 7.368-5.078 12.216-5.078h1.279l-4.245 4.247 2.443 2.442 8.55-8.55zm-9.52 21.45v4.42h4.871V142h4.513v-23.55zm18.136 0c-1.125 0-2.066.377-2.824 1.135-.764.764-1.148 1.709-1.148 2.834v15.612c0 1.124.38 2.066 1.139 2.824.764.764 1.708 1.145 2.833 1.145h7.489c1.125 0 2.066-.378 2.824-1.136.764-.764 1.145-1.709 1.145-2.833v-15.612c0-1.125-.378-2.067-1.136-2.825-.764-.764-1.708-1.145-2.833-1.145zm.54 4.42h6.408v14.617h-6.407z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-30">\n <path d="M25.549 97l-2.437 2.434 4.634 4.635H26.38c-2.97 0-5.753.555-8.347 1.664-2.594 1.109-4.861 2.633-6.802 4.574-1.94 1.94-3.465 4.207-4.574 6.802-1.109 2.594-1.664 5.377-1.664 8.347h3.565c0-4.967 1.683-9.178 5.05-12.636 3.366-3.458 7.525-5.187 12.475-5.187h1.307l-4.335 4.338 2.495 2.494 8.732-8.732zm-11.553 20.53v4.689h10.297v5.249h-6.978v4.688h6.978v5.156H13.996V142h10.808c1.06 0 1.948-.395 2.666-1.186.718-.79 1.077-1.771 1.077-2.94v-16.217c0-1.169-.36-2.15-1.077-2.94-.718-.79-1.605-1.186-2.666-1.186zm21.174.168c-1.149 0-2.11.389-2.884 1.163-.78.78-1.172 1.745-1.172 2.894v15.942c0 1.15.388 2.11 1.162 2.885.78.78 1.745 1.17 2.894 1.17h7.649c1.149 0 2.11-.386 2.885-1.16.78-.78 1.17-1.746 1.17-2.895v-15.942c0-1.15-.387-2.11-1.161-2.885-.78-.78-1.745-1.172-2.894-1.172zm.552 4.516h6.542v14.931h-6.542z"></path>\n </symbol>\n <symbol viewBox="0 0 512 512" id="vjs-icon-audio-description">\n <g fill-rule="evenodd"><path d="M227.29 381.351V162.993c50.38-1.017 89.108-3.028 117.631 17.126 27.374 19.342 48.734 56.965 44.89 105.325-4.067 51.155-41.335 94.139-89.776 98.475-24.085 2.155-71.972 0-71.972 0s-.84-1.352-.773-2.568m48.755-54.804c31.43 1.26 53.208-16.633 56.495-45.386 4.403-38.51-21.188-63.552-58.041-60.796v103.612c-.036 1.466.575 2.22 1.546 2.57"></path><path d="M383.78 381.328c13.336 3.71 17.387-11.06 23.215-21.408 12.722-22.571 22.294-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.226 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M425.154 381.328c13.336 3.71 17.384-11.061 23.215-21.408 12.721-22.571 22.291-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.511c-.586 3.874 2.226 7.315 3.866 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M466.26 381.328c13.337 3.71 17.385-11.061 23.216-21.408 12.722-22.571 22.292-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.225 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894M4.477 383.005H72.58l18.573-28.484 64.169-.135s.065 19.413.065 28.62h48.756V160.307h-58.816c-5.653 9.537-140.85 222.697-140.85 222.697zm152.667-145.282v71.158l-40.453-.27 40.453-70.888z"></path></g>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-next-item">\n <path d="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-previous-item">\n <path d="M12 12h4v24h-4zm7 12l17 12V12z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-shuffle">\n <path d="M21.17 18.34L10.83 8 8 10.83l10.34 10.34 2.83-2.83zM29 8l4.09 4.09L8 37.17 10.83 40l25.09-25.09L40 19V8H29zm.66 18.83l-2.83 2.83 6.26 6.26L29 40h11V29l-4.09 4.09-6.25-6.26z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cast">\n <path d="M42 6H6c-2.21 0-4 1.79-4 4v6h4v-6h36v28H28v4h14c2.21 0 4-1.79 4-4V10c0-2.21-1.79-4-4-4zM2 36v6h6c0-3.31-2.69-6-6-6zm0-8v4c5.52 0 10 4.48 10 10h4c0-7.73-6.27-14-14-14zm0-8v4c9.94 0 18 8.06 18 18h4c0-12.15-9.85-22-22-22z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-picture-in-picture-enter">\n <path d="M38 22H22v11.99h16V22zm8 16V9.96C46 7.76 44.2 6 42 6H6C3.8 6 2 7.76 2 9.96V38c0 2.2 1.8 4 4 4h36c2.2 0 4-1.8 4-4zm-4 .04H6V9.94h36v28.1z"></path>\n </symbol>\n <symbol viewBox="0 0 22 18" id="vjs-icon-picture-in-picture-exit">\n <path d="M18 4H4v10h14V4zm4 12V1.98C22 .88 21.1 0 20 0H2C.9 0 0 .88 0 1.98V16c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H2V1.97h18v14.05z"></path>\n <path fill="none" d="M-1-3h24v24H-1z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-facebook">\n <path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-linkedin">\n <path d="M477 625v991H147V625h330zm21-306q1 73-50.5 122T312 490h-2q-82 0-132-49t-50-122q0-74 51.5-122.5T314 148t133 48.5T498 319zm1166 729v568h-329v-530q0-105-40.5-164.5T1168 862q-63 0-105.5 34.5T999 982q-11 30-11 81v553H659q2-399 2-647t-1-296l-1-48h329v144h-2q20-32 41-56t56.5-52 87-43.5T1285 602q171 0 275 113.5t104 332.5z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-twitter">\n <path d="M1684 408q-67 98-162 167 1 14 1 42 0 130-38 259.5T1369.5 1125 1185 1335.5t-258 146-323 54.5q-271 0-496-145 35 4 78 4 225 0 401-138-105-2-188-64.5T285 1033q33 5 61 5 43 0 85-11-112-23-185.5-111.5T172 710v-4q68 38 146 41-66-44-105-115t-39-154q0-88 44-163 121 149 294.5 238.5T884 653q-8-38-8-74 0-134 94.5-228.5T1199 256q140 0 236 102 109-21 205-78-37 115-142 178 93-10 186-50z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-tumblr">\n <path d="M1328 1329l80 237q-23 35-111 66t-177 32q-104 2-190.5-26T787 1564t-95-106-55.5-120-16.5-118V676H452V461q72-26 129-69.5t91-90 58-102 34-99T779 12q1-5 4.5-8.5T791 0h244v424h333v252h-334v518q0 30 6.5 56t22.5 52.5 49.5 41.5 81.5 14q78-2 134-29z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-pinterest">\n <path d="M1664 896q0 209-103 385.5T1281.5 1561 896 1664q-111 0-218-32 59-93 78-164 9-34 54-211 20 39 73 67.5t114 28.5q121 0 216-68.5t147-188.5 52-270q0-114-59.5-214T1180 449t-255-63q-105 0-196 29t-154.5 77-109 110.5-67 129.5T377 866q0 104 40 183t117 111q30 12 38-20 2-7 8-31t8-30q6-23-11-43-51-61-51-151 0-151 104.5-259.5T904 517q151 0 235.5 82t84.5 213q0 170-68.5 289T980 1220q-61 0-98-43.5T859 1072q8-35 26.5-93.5t30-103T927 800q0-50-27-83t-77-33q-62 0-105 57t-43 142q0 73 25 122l-99 418q-17 70-13 177-206-91-333-281T128 896q0-209 103-385.5T510.5 231 896 128t385.5 103T1561 510.5 1664 896z"></path>\n </symbol>\n </defs>\n</svg>',"image/svg+xml");if(e.querySelector("parsererror"))Et.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const t=e.documentElement;t.style.display="none",this.el_.appendChild(t),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio("audio"===e.nodeName.toLowerCase()),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),Zt&&this.addClass("vjs-touch-enabled"),ti||this.addClass("vjs-workinghover"),ra.players[this.id_]=this;const r=mt.split(".")[0];this.addClass(`vjs-v${r}`),this.userActive(!0),this.reportUserActivity(),this.one("play",(e=>this.listenForUserActivity_(e))),this.on("keydown",(e=>this.handleKeyDown(e))),this.on("languagechange",(e=>this.handleLanguagechange(e))),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",(()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)}))}dispose(){this.trigger("dispose"),this.off("dispose"),es(a(),this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),es(a(),"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),ra.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),vn[this.id()]=null,mn.names.forEach((e=>{const t=this[mn[e].getterName]();t&&t.off&&t.off()})),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e,t=this.tag,i=this.playerElIngest_=t.parentNode&&t.parentNode.hasAttribute&&t.parentNode.hasAttribute("data-vjs-player");const s="video-js"===this.tag.tagName.toLowerCase();i?e=this.el_=t.parentNode:s||(e=this.el_=super.createEl("div"));const r=yi(t);if(s){for(e=this.el_=t,t=this.tag=a().createElement("video");e.children.length;)t.appendChild(e.firstChild);di(e,"video-js")||pi(e,"video-js"),e.appendChild(t),i=this.playerElIngest_=e,Object.keys(e).forEach((i=>{try{t[i]=e[i]}catch(e){}}))}if(t.setAttribute("tabindex","-1"),r.tabindex="-1",Ht&&Xt&&(t.setAttribute("role","application"),r.role="application"),t.removeAttribute("width"),t.removeAttribute("height"),"width"in r&&delete r.width,"height"in r&&delete r.height,Object.getOwnPropertyNames(r).forEach((function(i){s&&"class"===i||e.setAttribute(i,r[i]),s&&t.setAttribute(i,r[i])})),t.playerId=t.id,t.id+="_html5_api",t.className="vjs-tech",t.player=e.player=this,this.addClass("vjs-paused"),!0!==n().VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=$i("vjs-styles-dimensions");const e=Li(".vjs-styles-defaults"),t=Li("head");t.insertBefore(this.styleEl_,e?e.nextSibling:t.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const o=t.getElementsByTagName("a");for(let e=0;e<o.length;e++){const t=o.item(e);pi(t,"vjs-hidden"),t.setAttribute("hidden","hidden")}return t.initNetworkState_=t.networkState,t.parentNode&&!i&&t.parentNode.insertBefore(e,t),hi(t,e),this.children_.unshift(t),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=e,e}crossOrigin(e){if(void 0===e)return this.techGet_("crossOrigin");null===e||"anonymous"===e||"use-credentials"===e?(this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e)):Et.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`)}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){const i=e+"_";if(void 0===t)return this[i]||0;if(""===t||"auto"===t)return this[i]=void 0,void this.updateStyleEl_();const s=parseFloat(t);isNaN(s)?Et.error(`Improper value "${t}" supplied for for ${e}`):(this[i]=s,this.updateStyleEl_())}fluid(e){if(void 0===e)return!!this.fluid_;var t,i;this.fluid_=!!e,ps(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),i=()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)},ps(t=this)?i():(t.eventedCallbacks||(t.eventedCallbacks=[]),t.eventedCallbacks.push(i))):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(void 0===e)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(!0===n().VIDEOJS_NO_DYNAMIC_STYLE){const e="number"==typeof this.width_?this.width_:this.options_.width,t="number"==typeof this.height_?this.height_:this.options_.height,i=this.tech_&&this.tech_.el();return void(i&&(e>=0&&(i.width=e),t>=0&&(i.height=t)))}let e,t,i,s;i=void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9";const r=i.split(":"),a=r[1]/r[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/a:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*a,s=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(s),Hi(this.styleEl_,`\n .${s} {\n width: ${e}px;\n height: ${t}px;\n }\n\n .${s}.vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: ${100*a}%;\n }\n `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const i=Cs(e),s=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==i&&this.tag&&(gn.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=i,this.isReady_=!1;let n=this.autoplay();("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(n=!1);const r={source:t,autoplay:n,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${s}_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};mn.names.forEach((e=>{const t=mn[e];r[t.getterName]=this[t.privateName]})),Object.assign(r,this.options_[i]),Object.assign(r,this.options_[s]),Object.assign(r,this.options_[e.toLowerCase()]),this.tag&&(r.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(r.startTime=this.cache_.currentTime);const a=gn.getTech(e);if(!a)throw new Error(`No Tech named '${i}' exists! '${i}' should be registered using videojs.registerTech()'`);var o,l;this.tech_=new a(r),this.tech_.ready(as(this,this.handleTechReady_),!0),o=this.textTracksJson_||[],l=this.tech_,o.forEach((function(e){const t=l.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach((e=>t.addCue(e)))})),l.textTracks(),ea.forEach((e=>{this.on(this.tech_,e,(t=>this[`handleTech${Cs(e)}_`](t)))})),Object.keys(ta).forEach((e=>{this.on(this.tech_,e,(t=>{0===this.tech_.playbackRate()&&this.tech_.seeking()?this.queuedCallbacks_.push({callback:this[`handleTech${ta[e]}_`].bind(this),event:t}):this[`handleTech${ta[e]}_`](t)}))})),this.on(this.tech_,"loadstart",(e=>this.handleTechLoadStart_(e))),this.on(this.tech_,"sourceset",(e=>this.handleTechSourceset_(e))),this.on(this.tech_,"waiting",(e=>this.handleTechWaiting_(e))),this.on(this.tech_,"ended",(e=>this.handleTechEnded_(e))),this.on(this.tech_,"seeking",(e=>this.handleTechSeeking_(e))),this.on(this.tech_,"play",(e=>this.handleTechPlay_(e))),this.on(this.tech_,"pause",(e=>this.handleTechPause_(e))),this.on(this.tech_,"durationchange",(e=>this.handleTechDurationChange_(e))),this.on(this.tech_,"fullscreenchange",((e,t)=>this.handleTechFullscreenChange_(e,t))),this.on(this.tech_,"fullscreenerror",((e,t)=>this.handleTechFullscreenError_(e,t))),this.on(this.tech_,"enterpictureinpicture",(e=>this.handleTechEnterPictureInPicture_(e))),this.on(this.tech_,"leavepictureinpicture",(e=>this.handleTechLeavePictureInPicture_(e))),this.on(this.tech_,"error",(e=>this.handleTechError_(e))),this.on(this.tech_,"posterchange",(e=>this.handleTechPosterChange_(e))),this.on(this.tech_,"textdata",(e=>this.handleTechTextData_(e))),this.on(this.tech_,"ratechange",(e=>this.handleTechRateChange_(e))),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===i&&this.tag||hi(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){mn.names.forEach((e=>{const t=mn[e];this[t.privateName]=this[t.getterName]()})),this.textTracksJson_=function(e){const t=e.$$("track"),i=Array.prototype.map.call(t,(e=>e.track));return Array.prototype.map.call(t,(function(e){const t=$s(e.track);return e.src&&(t.src=e.src),t})).concat(Array.prototype.filter.call(e.textTracks(),(function(e){return-1===i.indexOf(e)})).map($s))}(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return void 0===e&&Et.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_}version(){return{"video.js":mt}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||"string"!=typeof e)return;const t=()=>{const e=this.muted();this.muted(!0);const t=()=>{this.muted(e)};this.playTerminatedQueue_.push(t);const i=this.play();if(Fs(i))return i.catch((e=>{throw t(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${e||""}`)}))};let i;return"any"!==e||this.muted()?i="muted"!==e||this.muted()?this.play():t():(i=this.play(),Fs(i)&&(i=i.catch(t))),Fs(i)?i.then((()=>{this.trigger({type:"autoplay-success",autoplay:e})})).catch((()=>{this.trigger({type:"autoplay-failure",autoplay:e})})):void 0}updateSourceCaches_(e=""){let t=e,i="";"string"!=typeof t&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=((e,t)=>{if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;const i=e.cache_.sources.filter((e=>e.src===t));if(i.length)return i[0].type;const s=e.$$("source");for(let e=0;e<s.length;e++){const i=s[e];if(i.type&&i.src&&i.src===t)return i.type}return An(t)})(this,t)),this.cache_.source=Lt({},e,{src:t,type:i});const s=this.cache_.sources.filter((e=>e.src&&e.src===t)),n=[],r=this.$$("source"),a=[];for(let e=0;e<r.length;e++){const i=yi(r[e]);n.push(i),i.src&&i.src===t&&a.push(i.src)}a.length&&!s.length?this.cache_.sources=n:s.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=e=>this.updateSourceCaches_(e);const i=this.currentSource().src,s=e.src;i&&!/^blob:/.test(i)&&/^blob:/.test(s)&&(!this.lastSource_||this.lastSource_.tech!==s&&this.lastSource_.player!==i)&&(t=()=>{}),t(s),e.src||this.tech_.any(["sourceset","loadstart"],(e=>{if("sourceset"===e.type)return;const t=this.techGet_("currentSrc");this.lastSource_.tech=t,this.updateSourceCaches_(t)}))}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(void 0===e)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach((e=>e.callback(e.event))),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.click&&!1===this.options_.userActions.click||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.click?this.options_.userActions.click.call(this,e):this.paused()?qs(this.play()):this.pause()))}handleTechDoubleClick_(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),(t=>t.contains(e.target)))||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this)return;const i=this.el();let s=a()[this.fsApi_.fullscreenElement]===i;!s&&i.matches&&(s=i.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(s)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",(()=>{this.removeClass("vjs-ios-native-fs")}))),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready((function(){if(e in wn)return function(e,t,i,s){return t[i](e.reduce(Cn(i),s))}(this.middleware_,this.tech_,e,t);if(e in En)return Tn(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(e){throw Et(e),e}}),!0)}techGet_(e){if(this.tech_&&this.tech_.isReady_){if(e in Sn)return function(e,t,i){return e.reduceRight(Cn(i),t[i]())}(this.middleware_,this.tech_,e);if(e in En)return Tn(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw Et(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t;if("TypeError"===t.name)throw Et(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t;throw Et(t),t}}}play(){return new Promise((e=>{this.play_(e)}))}play_(e=qs){this.playCallbacks_.push(e);const t=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc())),i=Boolean(ii||ti);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t)return this.waitToPlay_=e=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(!t&&i&&this.load());const s=this.techGet_("play");i&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),null===s?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(s)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach((function(e){e()}))}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach((function(t){t(e)}))}pause(){this.techCall_("pause")}paused(){return!1!==this.techGet_("paused")}played(){return this.techGet_("played")||Os(0,0)}scrubbing(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){return void 0===e?(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime):(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),this.cache_.initTime=0,void(isFinite(e)&&(this.cache_.currentTime=Number(e)))):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_)))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return e&&e.length||(e=Os(0,0)),e}seekable(){let e=this.techGet_("seekable");return e&&e.length||(e=Os(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return Us(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let i=e.end(e.length-1);return i>t&&(i=t),i}volume(e){let t;return void 0!==e?(t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)}muted(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)}defaultMuted(e){return void 0!==e&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(void 0!==e){const t=this.isFullscreen_;return this.isFullscreen_=Boolean(e),this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise(((i,s)=>{function n(){t.off("fullscreenerror",a),t.off("fullscreenchange",r)}function r(){n(),i()}function a(e,t){n(),s(t)}t.one("fullscreenchange",r),t.one("fullscreenerror",a);const o=t.requestFullscreenHelper_(e);o&&(o.then(n,n),o.then(i,s))}))}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(t=e)),this.fsApi_.requestFullscreen){const e=this.el_[this.fsApi_.requestFullscreen](t);return e&&e.then((()=>this.isFullscreen(!0)),(()=>this.isFullscreen(!1))),e}this.tech_.supportsFullScreen()&&1==!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise(((t,i)=>{function s(){e.off("fullscreenerror",r),e.off("fullscreenchange",n)}function n(){s(),t()}function r(e,t){s(),i(t)}e.one("fullscreenchange",n),e.one("fullscreenerror",r);const a=e.exitFullscreenHelper_();a&&(a.then(s,s),a.then(t,i))}))}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=a()[this.fsApi_.exitFullscreen]();return e&&qs(e.then((()=>this.isFullscreen(!1)))),e}this.tech_.supportsFullScreen()&&1==!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=a().documentElement.style.overflow,Zi(a(),"keydown",this.boundFullWindowOnEscKey_),a().documentElement.style.overflow="hidden",pi(a().body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){l().isEventKey(e,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,es(a(),"keydown",this.boundFullWindowOnEscKey_),a().documentElement.style.overflow=this.docOrigOverflow,fi(a().body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){return void 0!==e?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&n().documentPictureInPicture){const e=a().createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(ci("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),n().documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then((t=>(Ni(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:t}),t.addEventListener("pagehide",(t=>{const i=t.target.querySelector(".video-js");e.parentNode.replaceChild(i,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")})),t)))}return"pictureInPictureEnabled"in a()&&!1===this.disablePictureInPicture()?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){return n().documentPictureInPicture&&n().documentPictureInPicture.window?(n().documentPictureInPicture.window.close(),Promise.resolve()):"pictureInPictureEnabled"in a()?a().exitPictureInPicture():void 0}handleKeyDown(e){const{userActions:t}=this.options_;t&&t.hotkeys&&((e=>{const t=e.tagName.toLowerCase();return!!e.isContentEditable||("input"===t?-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(e.type):-1!==["textarea"].indexOf(t))})(this.el_.ownerDocument.activeElement)||("function"==typeof t.hotkeys?t.hotkeys.call(this,e):this.handleHotkeys(e)))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:i=(e=>l().isEventKey(e,"f")),muteKey:s=(e=>l().isEventKey(e,"m")),playPauseKey:n=(e=>l().isEventKey(e,"k")||l().isEventKey(e,"Space"))}=t;if(i.call(this,e)){e.preventDefault(),e.stopPropagation();const t=As.getComponent("FullscreenToggle");!1!==a()[this.fsApi_.fullscreenEnabled]&&t.prototype.handleClick.call(this,e)}else s.call(this,e)?(e.preventDefault(),e.stopPropagation(),As.getComponent("MuteToggle").prototype.handleClick.call(this,e)):n.call(this,e)&&(e.preventDefault(),e.stopPropagation(),As.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let i=0,s=this.options_.techOrder;i<s.length;i++){const n=s[i];let r=gn.getTech(n);if(r||(r=As.getComponent(n)),r){if(r.isSupported()&&(t=r.canPlayType(e),t))return t}else Et.error(`The "${n}" tech is undefined. Skipped browser support check for that tech.`)}return""}selectSource(e){const t=this.options_.techOrder.map((e=>[e,gn.getTech(e)])).filter((([e,t])=>t?t.isSupported():(Et.error(`The "${e}" tech is undefined. Skipped browser support check for that tech.`),!1))),i=function(e,t,i){let s;return e.some((e=>t.some((t=>{if(s=i(e,t),s)return!0})))),s};let s;const n=([e,t],i)=>{if(t.canPlaySource(i,this.options_[e.toLowerCase()]))return{source:i,tech:e}};var r;return s=this.options_.sourceOrder?i(e,t,(r=n,(e,t)=>r(t,e))):i(t,e,n),s||!1}handleSrc_(e,t){if(void 0===e)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const i=In(e);if(i.length){if(this.changingSrc_=!0,t||(this.cache_.sources=i),this.updateSourceCaches_(i[0]),bn(this,i[0],((e,s)=>{if(this.middleware_=s,t||(this.cache_.sources=i),this.updateSourceCaches_(e),this.src_(e))return i.length>1?this.handleSrc_(i.slice(1)):(this.changingSrc_=!1,this.setTimeout((function(){this.error({code:4,message:this.options_.notSupportedMessage})}),0),void this.triggerReady());var n,r;n=s,r=this.tech_,n.forEach((e=>e.setTech&&e.setTech(r)))})),i.length>1){const e=()=>{this.error(null),this.handleSrc_(i.slice(1),!0)},t=()=>{this.off("error",e)};this.one("error",e),this.one("playing",t),this.resetRetryOnError_=()=>{this.off("error",e),this.off("playing",t)}}}else this.setTimeout((function(){this.error({code:4,message:this.options_.notSupportedMessage})}),0)}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return!t||(xs(t.tech,this.techName_)?(this.ready((function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1}),!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready((()=>{this.changingSrc_=!1})),!1))}load(){this.tech_&&this.tech_.vhs?this.src(this.currentSource()):this.techCall_("load")}reset(){this.paused()?this.doReset_():qs(this.play().then((()=>this.doReset_())))}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),ps(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:i,remainingTimeDisplay:s}=this.controlBar||{},{seekBar:n}=i||{};e&&e.updateContent(),t&&t.updateContent(),s&&s.updateContent(),n&&(n.update(),n.loadProgressBar&&n.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")}autoplay(e){if(void 0===e)return this.options_.autoplay||!1;let t;"string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"==typeof e?e:"play"),t=!1):this.options_.autoplay=!!e,t=void 0===t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return void 0!==e&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")}poster(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(void 0===e)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(void 0===e)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(void 0===e)return this.error_||null;if(yt("beforeerror").forEach((t=>{const i=t(this,e);Pt(i)&&!Array.isArray(i)||"string"==typeof i||"number"==typeof i||null===i?e=i:this.log.error("please return a value that MediaError expects in beforeerror hooks")})),this.options_.suppressNotSupportedError&&e&&4===e.code){const t=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),void this.one("loadstart",(function(){this.off(["click","touchstart"],t)}))}if(null===e)return this.error_=null,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new Bs(e),this.addClass("vjs-error"),Et.error(`(CODE:${this.error_.code} ${Bs.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),yt("error").forEach((e=>e(this,this.error_)))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",(function(e){e.stopPropagation(),e.preventDefault()})),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,i;const s=as(this,this.reportUserActivity),n=function(t){s(),this.clearInterval(e)};this.on("mousedown",(function(){s(),this.clearInterval(e),e=this.setInterval(s,250)})),this.on("mousemove",(function(e){e.screenX===t&&e.screenY===i||(t=e.screenX,i=e.screenY,s())})),this.on("mouseup",n),this.on("mouseleave",n);const r=this.getChild("controlBar");let a;!r||ti||Bt||(r.on("mouseenter",(function(e){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0})),r.on("mouseleave",(function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout}))),this.on("keydown",s),this.on("keyup",s),this.setInterval((function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(a);const e=this.options_.inactivityTimeout;e<=0||(a=this.setTimeout((function(){this.userActivity_||this.userActive(!1)}),e))}),250)}playbackRate(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)}defaultPlaybackRate(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),i=t&&t.currentHeight();e.forEach((e=>{e!==t&&e.el_&&!e.hasClass("vjs-hidden")&&(e.hide(),this.audioOnlyCache_.hiddenChildren.push(e))})),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(i),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.audioOnlyCache_.hiddenChildren.forEach((e=>e.show())),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if("boolean"!=typeof e||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const e=[];return this.isInPictureInPicture()&&e.push(this.exitPictureInPicture()),this.isFullscreen()&&e.push(this.exitFullscreen()),this.audioPosterMode()&&e.push(this.audioPosterMode(!1)),Promise.all(e).then((()=>this.enableAudioOnlyUI_()))}return Promise.resolve().then((()=>this.disableAudioOnlyUI_()))}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return"boolean"!=typeof e||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then((()=>{this.enablePosterModeUI_()})):Promise.resolve().then((()=>{this.enablePosterModeUI_()})):Promise.resolve().then((()=>{this.disablePosterModeUI_()})))}addTextTrack(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),ps(this)&&this.trigger("languagechange"))}languages(){return Lt(ra.prototype.options_.languages,this.languages_)}toJSON(){const e=Lt(this.options_),t=e.tracks;e.tracks=[];for(let i=0;i<t.length;i++){let s=t[i];s=Lt(s),s.player=void 0,e.tracks[i]=s}return e}createModal(e,t){(t=t||{}).content=e||"";const i=new Vs(this,t);return this.addChild(i),i.on("dispose",(()=>{this.removeChild(i)})),i.open(),i}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let i=0;i<ia.length;i++){const s=ia[i];if(t<=this.breakpoints_[s]){if(e===s)return;e&&this.removeClass(sa[e]),this.addClass(sa[s]),this.breakpoint_=s;break}}}removeCurrentBreakpoint_(){const e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)}breakpoints(e){return void 0===e||(this.breakpoint_="",this.breakpoints_=Object.assign({},na,e),this.updateCurrentBreakpoint_()),Object.assign(this.breakpoints_)}responsive(e){return void 0===e?this.responsive_:(e=Boolean(e))!==this.responsive_?(this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return sa[this.breakpoint_]||""}loadMedia(e,t){if(!e||"object"!=typeof e)return;const i=this.crossOrigin();this.reset(),this.cache_.media=Lt(e);const{artist:s,artwork:n,description:r,poster:a,src:o,textTracks:l,title:c}=this.cache_.media;!n&&a&&(this.cache_.media.artwork=[{src:a,type:An(a)}]),i&&this.crossOrigin(i),o&&this.src(o),a&&this.poster(a),Array.isArray(l)&&l.forEach((e=>this.addRemoteTextTrack(e,!1))),this.titleBar&&this.titleBar.update({title:c,description:r||s||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),(e=>({kind:e.kind,label:e.label,language:e.language,src:e.src})))};return e&&(t.poster=e,t.artwork=[{src:t.poster,type:An(t.poster)}]),t}return Lt(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},i=yi(e),s=i["data-setup"];if(di(e,"vjs-fill")&&(i.fill=!0),di(e,"vjs-fluid")&&(i.fluid=!0),null!==s){const[e,t]=u()(s||"{}");e&&Et.error(e),Object.assign(i,t)}if(Object.assign(t,i),e.hasChildNodes()){const i=e.childNodes;for(let e=0,s=i.length;e<s;e++){const s=i[e],n=s.nodeName.toLowerCase();"source"===n?t.sources.push(yi(s)):"track"===n&&t.tracks.push(yi(s))}}return t}debug(e){if(void 0===e)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)}playbackRates(e){if(void 0===e)return this.cache_.playbackRates;Array.isArray(e)&&e.every((e=>"number"==typeof e))&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}}mn.names.forEach((function(e){const t=mn[e];ra.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}})),ra.prototype.crossorigin=ra.prototype.crossOrigin,ra.players={};const aa=n().navigator;ra.prototype.options_={techOrder:gn.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:aa&&(aa.languages&&aa.languages[0]||aa.userLanguage||aa.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,enableSmoothSeeking:!1},ea.forEach((function(e){ra.prototype[`handleTech${Cs(e)}_`]=function(){return this.trigger(e)}})),As.registerComponent("Player",ra);const oa="plugin",la="activePlugins_",ca={},ua=e=>ca.hasOwnProperty(e),ha=e=>ua(e)?ca[e]:void 0,da=(e,t)=>{e[la]=e[la]||{},e[la][t]=!0},pa=(e,t,i)=>{const s=(i?"before":"")+"pluginsetup";e.trigger(s,t),e.trigger(s+":"+t.name,t)},fa=(e,t)=>(t.prototype.name=e,function(...i){pa(this,{name:e,plugin:t,instance:null},!0);const s=new t(...[this,...i]);return this[e]=()=>s,pa(this,s.getEventHash()),s});class ma{constructor(e){if(this.constructor===ma)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),Ts(this),delete this.trigger,ws(this,this.constructor.defaultState),da(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return ts(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[la][e]=!1,this.player=this.state=null,t[e]=fa(e,ca[e])}static isBasic(e){const t="string"==typeof e?ha(e):e;return"function"==typeof t&&!ma.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if("string"!=typeof e)throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(ua(e))Et.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(ra.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if("function"!=typeof t)throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return ca[e]=t,e!==oa&&(ma.isBasic(t)?ra.prototype[e]=function(e,t){const i=function(){pa(this,{name:e,plugin:t,instance:null},!0);const i=t.apply(this,arguments);return da(this,e),pa(this,{name:e,plugin:t,instance:i}),i};return Object.keys(t).forEach((function(e){i[e]=t[e]})),i}(e,t):ra.prototype[e]=fa(e,t)),t}static deregisterPlugin(e){if(e===oa)throw new Error("Cannot de-register base plugin.");ua(e)&&(delete ca[e],delete ra.prototype[e])}static getPlugins(e=Object.keys(ca)){let t;return e.forEach((e=>{const i=ha(e);i&&(t=t||{},t[e]=i)})),t}static getPluginVersion(e){const t=ha(e);return t&&t.VERSION||""}}function ga(e,t,i,s){return function(e,t){let i=!1;return function(...s){return i||Et.warn(e),i=!0,t.apply(this,s)}}(`${t} is deprecated and will be removed in ${e}.0; please use ${i} instead.`,s)}ma.getPlugin=ha,ma.BASE_PLUGIN_NAME=oa,ma.registerPlugin(oa,ma),ra.prototype.usingPlugin=function(e){return!!this[la]&&!0===this[la][e]},ra.prototype.hasPlugin=function(e){return!!ua(e)};const ya=e=>0===e.indexOf("#")?e.slice(1):e;function va(e,t,i){let s=va.getPlayer(e);if(s)return t&&Et.warn(`Player "${e}" is already initialised. Options will not be applied.`),i&&s.ready(i),s;const r="string"==typeof e?Li("#"+ya(e)):e;if(!ai(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");const a="getRootNode"in r&&r.getRootNode()instanceof n().ShadowRoot?r.getRootNode():r.ownerDocument.body;r.ownerDocument.defaultView&&a.contains(r)||Et.warn("The element supplied is not included in the DOM"),!0===(t=t||{}).restoreEl&&(t.restoreEl=(r.parentNode&&r.parentNode.hasAttribute("data-vjs-player")?r.parentNode:r).cloneNode(!0)),yt("beforesetup").forEach((e=>{const i=e(r,Lt(t));Pt(i)&&!Array.isArray(i)?t=Lt(t,i):Et.error("please return an object in beforesetup hooks")}));const o=As.getComponent("Player");return s=new o(r,t,i),yt("setup").forEach((e=>e(s))),s}if(va.hooks_=gt,va.hooks=yt,va.hook=function(e,t){yt(e,t)},va.hookOnce=function(e,t){yt(e,[].concat(t).map((t=>{const i=(...s)=>(vt(e,i),t(...s));return i})))},va.removeHook=vt,!0!==n().VIDEOJS_NO_DYNAMIC_STYLE&&ri()){let e=Li(".vjs-styles-defaults");if(!e){e=$i("vjs-styles-defaults");const t=Li("head");t&&t.insertBefore(e,t.firstChild),Hi(e,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: 56.25%\n }\n ")}}Fi(1,va),va.VERSION=mt,va.options=ra.prototype.options_,va.getPlayers=()=>ra.players,va.getPlayer=e=>{const t=ra.players;let i;if("string"==typeof e){const s=ya(e),n=t[s];if(n)return n;i=Li("#"+s)}else i=e;if(ai(i)){const{player:e,playerId:s}=i;if(e||t[s])return e||t[s]}},va.getAllPlayers=()=>Object.keys(ra.players).map((e=>ra.players[e])).filter(Boolean),va.players=ra.players,va.getComponent=As.getComponent,va.registerComponent=(e,t)=>(gn.isTech(t)&&Et.warn(`The ${e} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),As.registerComponent.call(As,e,t)),va.getTech=gn.getTech,va.registerTech=gn.registerTech,va.use=function(e,t){yn[e]=yn[e]||[],yn[e].push(t)},Object.defineProperty(va,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(va.middleware,"TERMINATOR",{value:_n,writeable:!1,enumerable:!0}),va.browser=si,va.obj=Nt,va.mergeOptions=ga(9,"videojs.mergeOptions","videojs.obj.merge",Lt),va.defineLazyProperty=ga(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",Rt),va.bind=ga(9,"videojs.bind","native Function.prototype.bind",as),va.registerPlugin=ma.registerPlugin,va.deregisterPlugin=ma.deregisterPlugin,va.plugin=(e,t)=>(Et.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),ma.registerPlugin(e,t)),va.getPlugins=ma.getPlugins,va.getPlugin=ma.getPlugin,va.getPluginVersion=ma.getPluginVersion,va.addLanguage=function(e,t){return e=(""+e).toLowerCase(),va.options.languages=Lt(va.options.languages,{[e]:t}),va.options.languages[e]},va.log=Et,va.createLogger=Ct,va.time=js,va.createTimeRange=ga(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Os),va.createTimeRanges=ga(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Os),va.formatTime=ga(9,"videojs.formatTime","videojs.time.formatTime",Ms),va.setFormatTime=ga(9,"videojs.setFormatTime","videojs.time.setFormatTime",Rs),va.resetFormatTime=ga(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",Ns),va.parseUrl=ga(9,"videojs.parseUrl","videojs.url.parseUrl",tn),va.isCrossOrigin=ga(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",rn),va.EventTarget=hs,va.any=ss,va.on=Zi,va.one=is,va.off=es,va.trigger=ts,va.xhr=d(),va.TextTrack=cn,va.AudioTrack=un,va.VideoTrack=hn,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach((e=>{va[e]=function(){return Et.warn(`videojs.${e}() is deprecated; use videojs.dom.${e}() instead`),Mi[e].apply(null,arguments)}})),va.computedStyle=ga(9,"videojs.computedStyle","videojs.dom.computedStyle",Ri),va.dom=Mi,va.fn=cs,va.num=Xn,va.str=ks,va.url=an,va.Error={UnsupportedSidxContainer:"unsupported-sidx-container-error",DashManifestSidxParsingError:"dash-manifest-sidx-parsing-error",HlsPlaylistRequestError:"hls-playlist-request-error",SegmentUnsupportedMediaFormat:"segment-unsupported-media-format-error",UnsupportedMediaInitialization:"unsupported-media-initialization-error",SegmentSwitchError:"segment-switch-error",SegmentExceedsSourceBufferQuota:"segment-exceeds-source-buffer-quota-error",SegmentAppendError:"segment-append-error",VttLoadError:"vtt-load-error",VttCueParsingError:"vtt-cue-parsing-error",AdsBeforePrerollError:"ads-before-preroll-error",AdsPrerollError:"ads-preroll-error",AdsMidrollError:"ads-midroll-error",AdsPostrollError:"ads-postroll-error",AdsMacroReplacementFailed:"ads-macro-replacement-failed",AdsResumeContentFailed:"ads-resume-content-failed",EMEEncryptedError:"eme-encrypted-error",MSKeyError:"ms-key-error",WebkitKeyError:"webkit-key-error",EMEFailedToRequestMediaKeySystemAccess:"eme-failed-request-media-key-system-access",EMEFailedToCreateMediaKeys:"eme-failed-create-media-keys",EMEFailedToAttachMediaKeysToVideoElement:"eme-failed-attach-media-keys-to-video",EMEFailedToCreateMediaKeySession:"eme-failed-create-media-key-session",EMEFailedToSetServerCertificate:"eme-failed-set-server-certificate",EMEFailedToGenerateLicenseRequest:"eme-failed-generate-license-request",EMEFailedToUpdateSessionWithReceivedLicenseKeys:"eme-failed-update-session",EMEFailedToCloseSession:"eme-failed-close-session"};class _a{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get:()=>t.enabled_(),set(e){t.enabled_(e)}}),t}}class ba extends va.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get:()=>e.selectedIndex_}),Object.defineProperty(e,"length",{get:()=>e.levels_.length}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const i=this.levels_.length;return t=new _a(e),""+i in this||Object.defineProperty(this,i,{get(){return this.levels_[i]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let i=0,s=this.length;i<s;i++)if(this[i]===e){t=this.levels_.splice(i,1)[0],this.selectedIndex_===i?this.selectedIndex_=-1:this.selectedIndex_>i&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,i=this.length;t<i;t++){const i=this[t];if(i.id===e)return i}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}}ba.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const e in ba.prototype.allowedEvents_)ba.prototype["on"+e]=null;var Ta="4.1.0";const Sa=function(e){return function(e,t){const i=e.qualityLevels,s=new ba,n=function(){s.dispose(),e.qualityLevels=i,e.off("dispose",n)};return e.on("dispose",n),e.qualityLevels=()=>s,e.qualityLevels.VERSION=Ta,s}(this,va.obj.merge({},e))};va.registerPlugin("qualityLevels",Sa),Sa.VERSION=Ta;const wa=v,Ea=(e,t)=>t&&t.responseURL&&e!==t.responseURL?t.responseURL:e,Ca=e=>va.log.debug?va.log.debug.bind(va,"VHS:",`${e} >`):function(){};function xa(...e){const t=va.obj||va;return(t.merge||t.mergeOptions).apply(t,e)}function ka(...e){const t=va.time||va;return(t.createTimeRanges||t.createTimeRanges).apply(t,e)}const Aa=1/30,Ia=.1,Pa=function(e,t){const i=[];let s;if(e&&e.length)for(s=0;s<e.length;s++)t(e.start(s),e.end(s))&&i.push([e.start(s),e.end(s)]);return ka(i)},Oa=function(e,t){return Pa(e,(function(e,i){return e-Ia<=t&&i+Ia>=t}))},La=function(e,t){return Pa(e,(function(e){return e-Aa>=t}))},Da=e=>{const t=[];if(!e||!e.length)return"";for(let i=0;i<e.length;i++)t.push(e.start(i)+" => "+e.end(i));return t.join(", ")},Ra=e=>{const t=[];for(let i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t},Na=function(e){if(e&&e.length&&e.end)return e.end(e.length-1)},Ma=function(e,t){let i=0;if(!e||!e.length)return i;for(let s=0;s<e.length;s++){const n=e.start(s),r=e.end(s);t>r||(i+=t>n&&t<=r?r-t:r-n)}return i},ja=(e,t)=>{if(!t.preload)return t.duration;let i=0;return(t.parts||[]).forEach((function(e){i+=e.duration})),(t.preloadHints||[]).forEach((function(t){"PART"===t.type&&(i+=e.partTargetDuration)})),i},Ua=e=>(e.segments||[]).reduce(((e,t,i)=>(t.parts?t.parts.forEach((function(s,n){e.push({duration:s.duration,segmentIndex:i,partIndex:n,part:s,segment:t})})):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e)),[]),Ba=e=>{const t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},Fa=({preloadSegment:e})=>{if(!e)return;const{parts:t,preloadHints:i}=e;let s=(i||[]).reduce(((e,t)=>e+("PART"===t.type?1:0)),0);return s+=t&&t.length?t.length:0,s},qa=(e,t)=>{if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;const i=Ba(t).length>0;return i&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:i&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},$a=function(e,t,i){if(void 0===t&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;const s=function(e,t){let i=0,s=t-e.mediaSequence,n=e.segments[s];if(n){if(void 0!==n.start)return{result:n.start,precise:!0};if(void 0!==n.end)return{result:n.end-n.duration,precise:!0}}for(;s--;){if(n=e.segments[s],void 0!==n.end)return{result:i+n.end,precise:!0};if(i+=ja(e,n),void 0!==n.start)return{result:i+n.start,precise:!0}}return{result:i,precise:!1}}(e,t);if(s.precise)return s.result;const n=function(e,t){let i,s=0,n=t-e.mediaSequence;for(;n<e.segments.length;n++){if(i=e.segments[n],void 0!==i.start)return{result:i.start-s,precise:!0};if(s+=ja(e,i),void 0!==i.end)return{result:i.end-s,precise:!0}}return{result:-1,precise:!1}}(e,t);return n.precise?n.result:s.result+i},Ha=function(e,t,i){if(!e)return 0;if("number"!=typeof i&&(i=0),void 0===t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return n()[1/0]}return $a(e,t,i)},Va=function({defaultDuration:e,durationList:t,startIndex:i,endIndex:s}){let n=0;if(i>s&&([i,s]=[s,i]),i<0){for(let t=i;t<Math.min(0,s);t++)n+=e;i=0}for(let e=i;e<s;e++)n+=t[e].duration;return n},za=function(e,t,i,s){if(!e||!e.segments)return null;if(e.endList)return Ha(e);if(null===t)return null;t=t||0;let n=$a(e,e.mediaSequence+e.segments.length,t);return i&&(n-=s="number"==typeof s?s:qa(null,e)),Math.max(0,n)},Wa=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},Ga=function(e){return e.excludeUntil&&e.excludeUntil===1/0},Xa=function(e){const t=Wa(e);return!e.disabled&&!t},Ya=function(e,t){return t.attributes&&t.attributes[e]},Ka=(e,t)=>{if(1===e.playlists.length)return!0;const i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter((e=>!!Xa(e)&&(e.attributes.BANDWIDTH||0)<i)).length},Qa=(e,t)=>!(!e&&!t||!e&&t||e&&!t||e!==t&&(!e.id||!t.id||e.id!==t.id)&&(!e.resolvedUri||!t.resolvedUri||e.resolvedUri!==t.resolvedUri)&&(!e.uri||!t.uri||e.uri!==t.uri)),Ja=function(e,t){const i=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{};let s=!1;for(const e in i){for(const n in i[e])if(s=t(i[e][n]),s)break;if(s)break}return!!s},Za=e=>{if(!e||!e.playlists||!e.playlists.length)return Ja(e,(e=>e.playlists&&e.playlists.length||e.uri));for(let t=0;t<e.playlists.length;t++){const i=e.playlists[t],s=i.attributes&&i.attributes.CODECS;if((!s||!s.split(",").every((e=>M(e))))&&!Ja(e,(e=>Qa(i,e))))return!1}return!0};var eo={liveEdgeDelay:qa,duration:Ha,seekable:function(e,t,i){const s=t||0;let n=za(e,t,!0,i);return null===n?ka():(n<s&&(n=s),ka(s,n))},getMediaInfoForTime:function({playlist:e,currentTime:t,startingSegmentIndex:i,startingPartIndex:s,startTime:n,exactManifestTimings:r}){let a=t-n;const o=Ua(e);let l=0;for(let e=0;e<o.length;e++){const t=o[e];if(i===t.segmentIndex&&("number"!=typeof s||"number"!=typeof t.partIndex||s===t.partIndex)){l=e;break}}if(a<0){if(l>0)for(let t=l-1;t>=0;t--){const i=o[t];if(a+=i.duration,r){if(a<0)continue}else if(a+Aa<=0)continue;return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:n-Va({defaultDuration:e.targetDuration,durationList:o,startIndex:l,endIndex:t})}}return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t}}if(l<0){for(let i=l;i<0;i++)if(a-=e.targetDuration,a<0)return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t};l=0}for(let t=l;t<o.length;t++){const i=o[t];a-=i.duration;const s=i.duration>Aa;if(0!==a&&!(s&&a+Aa>=0)||t===o.length-1){if(r){if(a>0)continue}else if(a-Aa>=0)continue;return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:n+Va({defaultDuration:e.targetDuration,durationList:o,startIndex:l,endIndex:t})}}}return{segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:t}},isEnabled:Xa,isDisabled:function(e){return e.disabled},isExcluded:Wa,isIncompatible:Ga,playlistEnd:za,isAes:function(e){for(let t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},hasAttribute:Ya,estimateSegmentRequestTime:function(e,t,i,s=0){return Ya("BANDWIDTH",i)?(e*i.attributes.BANDWIDTH-8*s)/t:NaN},isLowestEnabledRendition:Ka,isAudioOnly:Za,playlistMatch:Qa,segmentDurationWithParts:ja};const{log:to}=va,io=(e,t)=>`${e}-${t}`,so=(e,t,i)=>`placeholder-uri-${e}-${t}-${i}`,no=(e,t)=>{e.mediaGroups&&["AUDIO","SUBTITLES"].forEach((i=>{if(e.mediaGroups[i])for(const s in e.mediaGroups[i])for(const n in e.mediaGroups[i][s]){const r=e.mediaGroups[i][s][n];t(r,i,s,n)}}))},ro=({playlist:e,uri:t,id:i})=>{e.id=i,e.playlistErrors_=0,t&&(e.uri=t),e.attributes=e.attributes||{}},ao=(e,t,i=so)=>{e.uri=t;for(let t=0;t<e.playlists.length;t++)if(!e.playlists[t].uri){const i=`placeholder-uri-${t}`;e.playlists[t].uri=i}const s=Za(e);no(e,((t,n,r,a)=>{if(!t.playlists||!t.playlists.length){if(s&&"AUDIO"===n&&!t.uri)for(let t=0;t<e.playlists.length;t++){const i=e.playlists[t];if(i.attributes&&i.attributes.AUDIO&&i.attributes.AUDIO===r)return}t.playlists=[m({},t)]}t.playlists.forEach((function(t,s){const o=i(n,r,a,t),l=io(s,o);t.uri?t.resolvedUri=t.resolvedUri||wa(e.uri,t.uri):(t.uri=0===s?o:l,t.resolvedUri=t.uri),t.id=t.id||l,t.attributes=t.attributes||{},e.playlists[t.id]=t,e.playlists[t.uri]=t}))})),(e=>{let t=e.playlists.length;for(;t--;){const i=e.playlists[t];ro({playlist:i,id:io(t,i.uri)}),i.resolvedUri=wa(e.uri,i.uri),e.playlists[i.id]=i,e.playlists[i.uri]=i,i.attributes.BANDWIDTH||to.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}})(e),(e=>{no(e,(t=>{t.uri&&(t.resolvedUri=wa(e.uri,t.uri))}))})(e)};class oo{constructor(){this.offset_=null,this.pendingDateRanges_=new Map,this.processedDateRanges_=new Map}setOffset(e=[]){if(null!==this.offset_)return;if(!e.length)return;const[t]=e;void 0!==t.programDateTime&&(this.offset_=t.programDateTime/1e3)}setPendingDateRanges(e=[]){if(!e.length)return;const[t]=e,i=t.startDate.getTime();this.trimProcessedDateRanges_(i),this.pendingDateRanges_=e.reduce(((e,t)=>(e.set(t.id,t),e)),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(null===this.offset_)return[];const e={},t=[];this.pendingDateRanges_.forEach(((i,s)=>{if(!this.processedDateRanges_.has(s)&&(i.startTime=i.startDate.getTime()/1e3-this.offset_,i.processDateRange=()=>this.processDateRange(i),t.push(i),i.class))if(e[i.class]){const t=e[i.class].push(i);i.classListIndex=t-1}else e[i.class]=[i],i.classListIndex=0}));for(const i of t){const t=e[i.class]||[];i.endDate?i.endTime=i.endDate.getTime()/1e3-this.offset_:i.endOnNext&&t[i.classListIndex+1]?i.endTime=t[i.classListIndex+1].startTime:i.duration?i.endTime=i.startTime+i.duration:i.plannedDuration?i.endTime=i.startTime+i.plannedDuration:i.endTime=i.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach(((t,i)=>{t.startDate.getTime()<e&&this.processedDateRanges_.delete(i)}))}}const{EventTarget:lo}=va,co=(e,t)=>{if(!e)return t;const i=xa(e,t);if(e.preloadHints&&!t.preloadHints&&delete i.preloadHints,e.parts&&!t.parts)delete i.parts;else if(e.parts&&t.parts)for(let s=0;s<t.parts.length;s++)e.parts&&e.parts[s]&&(i.parts[s]=xa(e.parts[s],t.parts[s]));return!e.skipped&&t.skipped&&(i.skipped=!1),e.preload&&!t.preload&&(i.preload=!1),i},uo=(e,t)=>{!e.resolvedUri&&e.uri&&(e.resolvedUri=wa(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=wa(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=wa(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=wa(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach((e=>{e.resolvedUri||(e.resolvedUri=wa(t,e.uri))})),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach((e=>{e.resolvedUri||(e.resolvedUri=wa(t,e.uri))}))},ho=function(e){const t=e.segments||[],i=e.preloadSegment;if(i&&i.parts&&i.parts.length){if(i.preloadHints)for(let e=0;e<i.preloadHints.length;e++)if("MAP"===i.preloadHints[e].type)return t;i.duration=e.targetDuration,i.preload=!0,t.push(i)}return t},po=(e,t)=>e===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence&&e.preloadSegment===t.preloadSegment,fo=(e,t,i=po)=>{const s=xa(e,{}),n=s.playlists[t.id];if(!n)return null;if(i(n,t))return null;t.segments=ho(t);const r=xa(n,t);if(r.preloadSegment&&!t.preloadSegment&&delete r.preloadSegment,n.segments){if(t.skip){t.segments=t.segments||[];for(let e=0;e<t.skip.skippedSegments;e++)t.segments.unshift({skipped:!0})}r.segments=((e,t,i)=>{const s=e.slice(),n=t.slice();i=i||0;const r=[];let a;for(let e=0;e<n.length;e++){const t=s[e+i],o=n[e];t?(a=t.map||a,r.push(co(t,o))):(a&&!o.map&&(o.map=a),r.push(o))}return r})(n.segments,t.segments,t.mediaSequence-n.mediaSequence)}r.segments.forEach((e=>{uo(e,r.resolvedUri)}));for(let e=0;e<s.playlists.length;e++)s.playlists[e].id===t.id&&(s.playlists[e]=r);return s.playlists[t.id]=r,s.playlists[t.uri]=r,no(e,((e,i,s,n)=>{if(e.playlists)for(let i=0;i<e.playlists.length;i++)t.id===e.playlists[i].id&&(e.playlists[i]=r)})),s},mo=(e,t)=>{const i=e.segments||[],s=i[i.length-1],n=s&&s.parts&&s.parts[s.parts.length-1],r=n&&n.duration||s&&s.duration;return t&&r?1e3*r:500*(e.partTargetDuration||e.targetDuration||10)};class go extends lo{constructor(e,t,i={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=Ca("PlaylistLoader");const{withCredentials:s=!1}=i;this.src=e,this.vhs_=t,this.withCredentials=s,this.addDateRangesToTextTrack_=i.addDateRangesToTextTrack;const n=t.options_;this.customTagParsers=n&&n.customTagParsers||[],this.customTagMappers=n&&n.customTagMappers||[],this.llhls=n&&n.llhls,this.dateRangesStorage_=new oo,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();t.length&&this.addDateRangesToTextTrack_&&this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if("HAVE_METADATA"!==this.state)return;const e=this.media();let t=wa(this.main.uri,e.uri);this.llhls&&(t=((e,t)=>{if(t.endList||!t.serverControl)return e;const i={};if(t.serverControl.canBlockReload){const{preloadSegment:e}=t;let s=t.mediaSequence+t.segments.length;if(e){const n=e.parts||[],r=Fa(t)-1;r>-1&&r!==n.length-1&&(i._HLS_part=r),(r>-1||n.length)&&s--}i._HLS_msn=s}if(t.serverControl&&t.serverControl.canSkipUntil&&(i._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(i).length){const t=new(n().URL)(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach((function(e){i.hasOwnProperty(e)&&t.searchParams.set(e,i[e])})),e=t.toString()}return e})(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},((e,t)=>{if(this.request)return e?this.playlistRequestError(this.request,this.media(),"HAVE_METADATA"):void this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}))}playlistRequestError(e,t,i){const{uri:s,id:n}=t;this.request=null,i&&(this.state=i),this.error={playlist:this.main.playlists[n],status:e.status,message:`HLS playlist request error at URL: ${s}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:{errorType:va.Error.HlsPlaylistRequestError}},this.trigger("error")}parseManifest_({url:e,manifestString:t}){return(({onwarn:e,oninfo:t,manifestString:i,customTagParsers:s=[],customTagMappers:n=[],llhls:r})=>{const a=new A;e&&a.on("warn",e),t&&a.on("info",t),s.forEach((e=>a.addParser(e))),n.forEach((e=>a.addTagMapper(e))),a.push(i),a.end();const o=a.manifest;if(r||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach((function(e){o.hasOwnProperty(e)&&delete o[e]})),o.segments&&o.segments.forEach((function(e){["parts","preloadHints"].forEach((function(t){e.hasOwnProperty(t)&&delete e[t]}))}))),!o.targetDuration){let t=10;o.segments&&o.segments.length&&(t=o.segments.reduce(((e,t)=>Math.max(e,t.duration)),0)),e&&e({message:`manifest has no targetDuration defaulting to ${t}`}),o.targetDuration=t}const l=Ba(o);if(l.length&&!o.partTargetDuration){const t=l.reduce(((e,t)=>Math.max(e,t.duration)),0);e&&(e({message:`manifest has no partTargetDuration defaulting to ${t}`}),to.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),o.partTargetDuration=t}return o})({onwarn:({message:t})=>this.logger_(`m3u8-parser warn for ${e}: ${t}`),oninfo:({message:t})=>this.logger_(`m3u8-parser info for ${e}: ${t}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls})}haveMetadata({playlistString:e,playlistObject:t,url:i,id:s}){this.request=null,this.state="HAVE_METADATA";const n=t||this.parseManifest_({url:i,manifestString:e});n.lastRequest=Date.now(),ro({playlist:n,uri:i,id:s});const r=fo(this.main,n);this.targetDuration=n.partTargetDuration||n.targetDuration,this.pendingMedia_=null,r?(this.main=r,this.media_=this.main.playlists[s]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(mo(this.media(),!!r)),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),n().clearTimeout(this.mediaUpdateTimeout),n().clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new oo,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"==typeof e){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(n().clearTimeout(this.finalRenditionTimeout),t){const t=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;return void(this.finalRenditionTimeout=n().setTimeout(this.media.bind(this,e,!1),t))}const i=this.state,s=!this.media_||e.id!==this.media_.id,r=this.main.playlists[e.id];if(r&&r.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(s&&(this.trigger("mediachanging"),"HAVE_MAIN_MANIFEST"===i?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(mo(e,!0)),s){if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},((t,s)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=Ea(e.resolvedUri,s),t)return this.playlistRequestError(this.request,e,i);this.haveMetadata({playlistString:s.responseText,url:e.uri,id:e.id}),"HAVE_MAIN_MANIFEST"===i?this.trigger("loadedmetadata"):this.trigger("mediachange")}}))}}pause(){this.mediaUpdateTimeout&&(n().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(n().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const e=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=n().setTimeout((()=>{this.mediaUpdateTimeout=null,this.load()}),e)}else this.started?t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(n().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=n().setTimeout((()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)}),e))}start(){if(this.started=!0,"object"==typeof this.src)return this.src.uri||(this.src.uri=n().location.href),this.src.resolvedUri=this.src.uri,void setTimeout((()=>{this.setupInitialPlaylist(this.src)}),0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},((e,t)=>{if(!this.request)return;if(this.request=null,e)return this.error={status:t.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:t.responseText,code:2,metadata:{errorType:va.Error.HlsPlaylistRequestError}},"HAVE_NOTHING"===this.state&&(this.started=!1),this.trigger("error");this.src=Ea(this.src,t);const i=this.parseManifest_({manifestString:t.responseText,url:this.src});this.setupInitialPlaylist(i)}))}srcUri(){return"string"==typeof this.src?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists)return this.main=e,ao(this.main,this.srcUri()),e.playlists.forEach((e=>{e.segments=ho(e),e.segments.forEach((t=>{uo(t,e.resolvedUri)}))})),this.trigger("loadedplaylist"),void(this.request||this.media(this.main.playlists[0]));const t=this.srcUri()||n().location.href;this.main=((e,t)=>{const i=io(0,t),s={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:n().location.href,resolvedUri:n().location.href,playlists:[{uri:t,id:i,resolvedUri:t,attributes:{}}]};return s.playlists[i]=s.playlists[0],s.playlists[t]=s.playlists[0],s})(0,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const i=this.main,s=e.ID;let n=i.playlists.length;for(;n--;){const r=i.playlists[n];if(r.attributes["PATHWAY-ID"]===s){const a=r.resolvedUri,o=r.id;if(t){const t=this.createCloneURI_(r.resolvedUri,e),a=io(s,t),o=this.createCloneAttributes_(s,r.attributes),l=this.createClonePlaylist_(r,a,e,o);i.playlists[n]=l,i.playlists[a]=l,i.playlists[t]=l}else i.playlists.splice(n,1);delete i.playlists[o],delete i.playlists[a]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const i=this.main,s=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((e=>{if(i.mediaGroups[e]&&i.mediaGroups[e][s])for(const t in i.mediaGroups[e])if(t===s){for(const s in i.mediaGroups[e][t])i.mediaGroups[e][t][s].playlists.forEach(((e,t)=>{const s=i.playlists[e.id],n=s.id,r=s.resolvedUri;delete i.playlists[n],delete i.playlists[r]}));delete i.mediaGroups[e][t]}})),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const i=this.main,s=i.playlists.length,n=this.createCloneURI_(t.resolvedUri,e),r=io(e.ID,n),a=this.createCloneAttributes_(e.ID,t.attributes),o=this.createClonePlaylist_(t,r,e,a);i.playlists[s]=o,i.playlists[r]=o,i.playlists[n]=o,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,i=e["BASE-ID"],s=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((n=>{if(s.mediaGroups[n]&&!s.mediaGroups[n][t])for(const r in s.mediaGroups[n])if(r===i){s.mediaGroups[n][t]={};for(const i in s.mediaGroups[n][r]){const a=s.mediaGroups[n][r][i];s.mediaGroups[n][t][i]=m({},a);const o=s.mediaGroups[n][t][i],l=this.createCloneURI_(a.resolvedUri,e);o.resolvedUri=l,o.uri=l,o.playlists=[],a.playlists.forEach(((r,a)=>{const l=s.playlists[r.id],c=so(n,t,i),u=io(t,c);if(l&&!s.playlists[u]){const t=this.createClonePlaylist_(l,u,e),i=t.resolvedUri;s.playlists[u]=t,s.playlists[i]=t}o.playlists[a]=this.createClonePlaylist_(r,u,e)}))}}}))}createClonePlaylist_(e,t,i,s){const n=this.createCloneURI_(e.resolvedUri,i),r={resolvedUri:n,uri:n,id:t};return e.segments&&(r.segments=[]),s&&(r.attributes=s),xa(e,r)}createCloneURI_(e,t){const i=new URL(e);i.hostname=t["URI-REPLACEMENT"].HOST;const s=t["URI-REPLACEMENT"].PARAMS;for(const e of Object.keys(s))i.searchParams.set(e,s[e]);return i.href}createCloneAttributes_(e,t){const i={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((s=>{t[s]&&(i[s]=e)})),i}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const s=e.contentProtection[i].attributes.keyId;s&&t.add(s.toLowerCase())}return t}}}const yo=function(e,t,i,s){const n="arraybuffer"===e.responseType?e.response:e.responseText;!t&&n&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=n.byteLength||n.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),i.headers&&(e.responseHeaders=i.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),t||e.aborted||200===i.statusCode||206===i.statusCode||0===i.statusCode||(t=new Error("XHR Failed with a response of: "+(e&&(n||e.responseText)))),s(t,e)},vo=function(){const e=function e(t,i){t=xa({timeout:45e3},t);const s=e.beforeRequest||va.Vhs.xhr.beforeRequest,n=e._requestCallbackSet||va.Vhs.xhr._requestCallbackSet||new Set,r=e._responseCallbackSet||va.Vhs.xhr._responseCallbackSet;s&&"function"==typeof s&&(va.log.warn("beforeRequest is deprecated, use onRequest instead."),n.add(s));const a=!0===va.Vhs.xhr.original?va.xhr:va.Vhs.xhr,o=((e,t)=>{if(!e||!e.size)return;let i=t;return e.forEach((e=>{i=e(i)})),i})(n,t);n.delete(s);const l=a(o||t,(function(e,t){return((e,t,i,s)=>{e&&e.size&&e.forEach((e=>{e(t,i,s)}))})(r,l,e,t),yo(l,e,t,i)})),c=l.abort;return l.abort=function(){return l.aborted=!0,c.apply(l,arguments)},l.uri=t.uri,l.requestTime=Date.now(),l};return e.original=!0,e},_o=function(e){const t={};return e.byterange&&(t.Range=function(e){let t;const i=e.offset;return t="bigint"==typeof e.offset||"bigint"==typeof e.length?n().BigInt(e.offset)+n().BigInt(e.length)-n().BigInt(1):e.offset+e.length-1,"bytes="+i+"-"+t}(e.byterange)),t},bo=function(e,t){return e.start(t)+"-"+e.end(t)},To=function(e,t){const i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")},So=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},wo=function(e){const t={};return Object.keys(e).forEach((i=>{const s=e[i];V(s)?t[i]={bytes:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength}:t[i]=s})),t},Eo=function(e){const t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},Co=function(e){return e.resolvedUri},xo=e=>{const t=Array.prototype.slice.call(e),i=16;let s,n,r="";for(let e=0;e<t.length/i;e++)s=t.slice(e*i,e*i+i).map(To).join(""),n=t.slice(e*i,e*i+i).map(So).join(""),r+=s+" "+n+"\n";return r};var ko=Object.freeze({__proto__:null,createTransferableMessage:wo,initSegmentId:Eo,segmentKeyId:Co,hexDump:xo,tagDump:({bytes:e})=>xo(e),textRanges:e=>{let t,i="";for(t=0;t<e.length;t++)i+=bo(e,t)+" ";return i}});const Ao=({programTime:e,playlist:t,retryCount:i=2,seekTo:s,pauseAfterSeek:n=!0,tech:r,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if(void 0===e||!t||!s)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!t.endList&&!r.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!(e=>{if(!e.segments||0===e.segments.length)return!1;for(let t=0;t<e.segments.length;t++)if(!e.segments[t].dateTimeObject)return!1;return!0})(t))return a({message:"programDateTime tags must be provided in the manifest "+t.resolvedUri});const o=((e,t)=>{let i;try{i=new Date(e)}catch(e){return null}if(!t||!t.segments||0===t.segments.length)return null;let s=t.segments[0];if(i<new Date(s.dateTimeObject))return null;for(let e=0;e<t.segments.length-1&&(s=t.segments[e],!(i<new Date(t.segments[e+1].dateTimeObject)));e++);const n=t.segments[t.segments.length-1],r=n.dateTimeObject,a=n.videoTimingInfo?(o=n.videoTimingInfo).transmuxedPresentationEnd-o.transmuxedPresentationStart-o.transmuxerPrependedSeconds:n.duration+.25*n.duration;var o;return i>new Date(r.getTime()+1e3*a)?null:(i>new Date(r)&&(s=n),{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:eo.duration(t,t.mediaSequence+t.segments.indexOf(s)),type:s.videoTimingInfo?"accurate":"estimate"})})(e,t);if(!o)return a({message:`${e} was not found in the stream`});const l=o.segment,c=((e,t)=>{let i,s;try{i=new Date(e),s=new Date(t)}catch(e){}const n=i.getTime();return(s.getTime()-n)/1e3})(l.dateTimeObject,e);if("estimate"===o.type)return 0===i?a({message:`${e} is not buffered yet. Try again`}):(s(o.estimatedStart+c),void r.one("seeked",(()=>{Ao({programTime:e,playlist:t,retryCount:i-1,seekTo:s,pauseAfterSeek:n,tech:r,callback:a})})));const u=l.start+c;r.one("seeked",(()=>a(null,r.currentTime()))),n&&r.pause(),s(u)},Io=(e,t)=>{if(4===e.readyState)return t()},{EventTarget:Po}=va,Oo=function(e,t){if(!po(e,t))return!1;if(e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length))return!1;if(!e.sidx&&t.sidx||e.sidx&&!t.sidx)return!1;if(e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(let i=0;i<e.segments.length;i++){const s=e.segments[i],n=t.segments[i];if(s.uri!==n.uri)return!1;if(!s.byterange&&!n.byterange)continue;const r=s.byterange,a=n.byterange;if(r&&!a||!r&&a)return!1;if(r.offset!==a.offset||r.length!==a.length)return!1}return!0},Lo=(e,t,i,s)=>`placeholder-uri-${e}-${t}-${s.attributes.NAME||i}`,Do=(e,t)=>(Boolean(!e.map&&!t.map)||Boolean(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length))&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length,Ro=(e,t)=>{const i={};for(const s in e){const n=e[s].sidx;if(n){const e=fe(n);if(!t[e])break;const s=t[e].sidxInfo;Do(s,n)&&(i[e]=t[e])}}return i};class No extends Po{constructor(e,t,i={},s){super(),this.mainPlaylistLoader_=s||this,s||(this.isMain_=!0);const{withCredentials:n=!1}=i;if(this.vhs_=t,this.withCredentials=n,this.addMetadataToTextTrack=i.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",(()=>{this.refreshXml_()})),this.on("mediaupdatetimeout",(()=>{this.refreshMedia_(this.media().id)})),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=Ca("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}requestErrored_(e,t,i){return!this.request||(this.request=null,e?(this.error="object"!=typeof e||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata}:e,i&&(this.state=i),this.trigger("error"),!0):void 0)}addSidxSegments_(e,t,i){const s=e.sidx&&fe(e.sidx);if(!e.sidx||!s||this.mainPlaylistLoader_.sidxMapping_[s])return void(this.mediaRequest_=n().setTimeout((()=>i(!1)),0));const r=Ea(e.sidx.resolvedUri),a=(n,r)=>{if(this.requestErrored_(n,r,t))return;const a=this.mainPlaylistLoader_.sidxMapping_;let o;try{o=We()(z(r.response).subarray(8))}catch(e){return e.metadata={errorType:va.Error.DashManifestSidxParsingError},void this.requestErrored_(e,r,t)}return a[s]={sidxInfo:e.sidx,sidx:o},le(e,o,e.sidx.resolvedUri),i(!0)};this.request=((e,t,i)=>{let s,n=[],r=!1;const a=function(e,t,s,n){return t.abort(),r=!0,i(e,t,s,n)},o=function(e,t){if(r)return;if(e)return a(e,t,"",n);const i=t.responseText.substring(n&&n.byteLength||0,t.responseText.length);if(n=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];if(t=t.filter((function(e){return e&&(e.byteLength||e.length)&&"string"!=typeof e})),t.length<=1)return z(t[0]);var s=t.reduce((function(e,t,i){return e+(t.byteLength||t.length)}),0),n=new Uint8Array(s),r=0;return t.forEach((function(e){e=z(e),n.set(e,r),r+=e.byteLength})),n}(n,Y(i,!0)),s=s||Xe(n),n.length<10||s&&n.length<s+2)return Io(t,(()=>a(e,t,"",n)));const o=pt(n);return"ts"===o&&n.length<188||!o&&n.length<376?Io(t,(()=>a(e,t,"",n))):a(null,t,o,n)},l={uri:e,beforeSend(e){e.overrideMimeType("text/plain; charset=x-user-defined"),e.addEventListener("progress",(function({total:t,loaded:i}){return yo(e,null,{statusCode:e.status},o)}))}},c=t(l,(function(e,t){return yo(c,e,t,o)}));return c})(r,this.vhs_.xhr,((t,i,s,n)=>{if(t)return a(t,i);if(!s||"mp4"!==s){const t=s||"unknown";return a({status:i.status,message:`Unsupported ${t} container type for sidx segment at URL: ${r}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2,metadata:{errorType:va.Error.UnsupportedSidxContainer,sidxContainer:t}},i)}const{offset:o,length:l}=e.sidx.byterange;if(n.length>=l+o)return a(t,{response:n.subarray(o,o+l),status:i.status,uri:i.uri});this.request=this.vhs_.xhr({uri:r,responseType:"arraybuffer",headers:_o({byterange:e.sidx.byterange})},a)}))}dispose(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},n().clearTimeout(this.minimumUpdatePeriodTimeout_),n().clearTimeout(this.mediaRequest_),n().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if("string"==typeof e){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const 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,t,(i=>{this.haveMetadata({startingState:t,playlist:e})})))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,this.mediaRequest_=null,this.refreshMedia_(t.id),"HAVE_MAIN_MANIFEST"===e?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),n().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(n().clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)}load(e){n().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const e=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=n().setTimeout((()=>this.load()),e)}else this.started?t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()}start(){this.started=!0,this.isMain_?this.requestMain_(((e,t)=>{this.haveMain_(),this.hasPendingRequest()||this.media_||this.media(this.mainPlaylistLoader_.main.playlists[0])})):this.mediaRequest_=n().setTimeout((()=>this.haveMain_()),0)}requestMain_(e){this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},((t,i)=>{if(this.requestErrored_(t,i))return void("HAVE_NOTHING"===this.state&&(this.started=!1));const s=i.responseText!==this.mainPlaylistLoader_.mainXml_;return this.mainPlaylistLoader_.mainXml_=i.responseText,i.responseHeaders&&i.responseHeaders.date?this.mainLoaded_=Date.parse(i.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=Ea(this.mainPlaylistLoader_.srcUrl,i),s?(this.handleMain_(),void this.syncClientServerClock_((()=>e(i,s)))):e(i,s)}))}syncClientServerClock_(e){const t=(i=this.mainPlaylistLoader_.mainXml_,(e=>{const t=Oe(e,"UTCTiming")[0];if(!t)return null;const i=Ne(t);switch(i.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":i.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":i.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":i.method="DIRECT",i.value=Date.parse(i.value);break;default:throw new Error("UNSUPPORTED_UTC_TIMING_SCHEME")}return i})(He(i)));var i;return null===t?(this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()):"DIRECT"===t.method?(this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:wa(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},((i,s)=>{if(!this.request)return;if(i)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();let n;n="HEAD"===t.method?s.responseHeaders&&s.responseHeaders.date?Date.parse(s.responseHeaders.date):this.mainLoaded_:Date.parse(s.responseText),this.mainPlaylistLoader_.clientOffset_=n-Date.now(),e()})))}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main;let t=(({mainXml:e,srcUrl:t,clientOffset:i,sidxMapping:s,previousManifest:n})=>{const r=((e,t={})=>{const i=((e,t={})=>{const{manifestUri:i="",NOW:s=Date.now(),clientOffset:n=0,eventHandler:r=function(){}}=t,a=Oe(e,"Period");if(!a.length)throw new Error("INVALID_NUMBER_OF_PERIOD");const o=Oe(e,"Location"),l=Ne(e),c=je([{baseUrl:i}],Oe(e,"BaseURL")),u=Oe(e,"ContentSteering");l.type=l.type||"static",l.sourceDuration=l.mediaPresentationDuration||0,l.NOW=s,l.clientOffset=n,o.length&&(l.locations=o.map(Le));const h=[];return a.forEach(((e,t)=>{const i=Ne(e),s=h[t-1];i.start=(({attributes:e,priorPeriodAttributes:t,mpdType:i})=>"number"==typeof e.start?e.start:t&&"number"==typeof t.start&&"number"==typeof t.duration?t.start+t.duration:t||"static"!==i?null:0)({attributes:i,priorPeriodAttributes:s?s.attributes:null,mpdType:l.type}),h.push({node:e,attributes:i})})),{locations:l.locations,contentSteeringInfo:$e(u,r),representationInfo:te(h.map(qe(l,c))),eventStream:te(h.map(Be))}})(He(e),t),s=i.representationInfo.map(Pe);return we({dashPlaylists:s,locations:i.locations,contentSteering:i.contentSteeringInfo,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest,eventStream:i.eventStream})})(e,{manifestUri:t,clientOffset:i,sidxMapping:s,previousManifest:n});return ao(r,t,Lo),r})({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e});e&&(t=((e,t,i)=>{let s=!0,n=xa(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts});for(let e=0;e<t.playlists.length;e++){const r=t.playlists[e];if(r.sidx){const e=fe(r.sidx);i&&i[e]&&i[e].sidx&&le(r,i[e].sidx,r.sidx.resolvedUri)}const a=fo(n,r,Oo);a&&(n=a,s=!1)}return no(t,((e,t,i,r)=>{if(e.playlists&&e.playlists.length){const a=e.playlists[0].id,o=fo(n,e.playlists[0],Oo);o&&(n=o,r in n.mediaGroups[t][i]||(n.mediaGroups[t][i][r]=e),n.mediaGroups[t][i][r].playlists[0]=n.playlists[a],s=!1)}})),((e,t)=>{no(e,((i,s,n,r)=>{r in t.mediaGroups[s][n]||delete e.mediaGroups[s][n][r]}))})(n,t),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(s=!1),s?null:n})(e,t,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=t||e;const i=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];return i&&i!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=i),(!e||t&&t.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(t),Boolean(t)}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(n().clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;0===t&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),"number"!=typeof t||t<=0?t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`):this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=n().setTimeout((()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)}),e)}refreshXml_(){this.requestMain_(((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=((e,t)=>{let i=Ro(e.playlists,t);return no(e,((e,s,n,r)=>{if(e.playlists&&e.playlists.length){const s=e.playlists;i=xa(i,Ro(s,t))}})),i})(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,(e=>{this.refreshMedia_(this.media().id)})))}))}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,i=!this.media_||this.media_!==t[e];if(i?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const e=()=>{this.media().endList||(this.mediaUpdateTimeout=n().setTimeout((()=>{this.trigger("mediaupdatetimeout"),e()}),mo(this.media(),Boolean(i))))};e()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const e=this.mainPlaylistLoader_.main.eventStream.map((e=>({cueTime:e.start,frames:[{data:e.messageData}]})));this.addMetadataToTextTrack("EventStream",e,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const s=e.contentProtection[i].attributes["cenc:default_KID"];s&&t.add(s.replace(/-/g,"").toLowerCase())}return t}}}var Mo={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const jo=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},Uo=function(e){return function(){const t=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch(t){const i=new BlobBuilder;return i.append(e),URL.createObjectURL(i.getBlob())}}(e),i=jo(new Worker(t));i.objURL=t;const s=i.terminate;return i.on=i.addEventListener,i.off=i.removeEventListener,i.terminate=function(){return URL.revokeObjectURL(t),s.call(this)},i}},Bo=function(e){return`var browserWorkerPolyFill = ${jo.toString()};\nbrowserWorkerPolyFill(self);\n`+e},Fo=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)},qo=Bo(Fo((function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},t=function(){this.init=function(){var e={};this.on=function(t,i){e[t]||(e[t]=[]),e[t]=e[t].concat(i)},this.off=function(t,i){var s;return!!e[t]&&(s=e[t].indexOf(i),e[t]=e[t].slice(),e[t].splice(s,1),s>-1)},this.trigger=function(t){var i,s,n,r;if(i=e[t])if(2===arguments.length)for(n=i.length,s=0;s<n;++s)i[s].call(this,arguments[1]);else{for(r=[],s=arguments.length,s=1;s<arguments.length;++s)r.push(arguments[s]);for(n=i.length,s=0;s<n;++s)i[s].apply(this,r)}},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 s,n,r,a,o,l,c,u,h,d,p,f,m,g,y,v,_,b,T,S,w,E,C,x,k,A,I,P,O,L,D,R,N,M,j,U,B,F,q,$,H=t,V=Math.pow(2,32),z={getUint64:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.getBigUint64?(t=i.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(t):t:i.getUint32(0)*V+i.getUint32(4)},MAX_UINT32:V},W=z.MAX_UINT32;!function(){var e;if(E={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 E)E.hasOwnProperty(e)&&(E[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);C=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),k=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),x=new Uint8Array([0,0,0,1]),A=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]),I=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]),P={video:A,audio:I},D=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]),N=R,M=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),j=R,O=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),s=function(e){var t,i,s=[],n=0;for(t=1;t<arguments.length;t++)s.push(arguments[t]);for(t=s.length;t--;)n+=s[t].byteLength;for(i=new Uint8Array(n+8),new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,i.byteLength),i.set(e,4),t=0,n=8;t<s.length;t++)i.set(s[t],n),n+=s[t].byteLength;return i},n=function(){return s(E.dinf,s(E.dref,D))},r=function(e){return s(E.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,e.audioobjecttype<<3|e.samplingfrequencyindex>>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},y=function(e){return s(E.hdlr,P[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),s(E.mdhd,t)},m=function(e){return s(E.mdia,g(e),y(e.type),l(e))},o=function(e){return s(E.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},l=function(e){return s(E.minf,"video"===e.type?s(E.vmhd,O):s(E.smhd,L),n(),_(e))},c=function(e,t){for(var i=[],n=t.length;n--;)i[n]=T(t[n]);return s.apply(null,[E.moof,o(e)].concat(i))},u=function(e){for(var t=e.length,i=[];t--;)i[t]=p(e[t]);return s.apply(null,[E.moov,d(4294967295)].concat(i).concat(h(e)))},h=function(e){for(var t=e.length,i=[];t--;)i[t]=S(e[t]);return s.apply(null,[E.mvex].concat(i))},d=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 s(E.mvhd,t)},v=function(e){var t,i,n=e.samples||[],r=new Uint8Array(4+n.length);for(i=0;i<n.length;i++)t=n[i].flags,r[i+4]=t.dependsOn<<4|t.isDependedOn<<2|t.hasRedundancy;return s(E.sdtp,r)},_=function(e){return s(E.stbl,b(e),s(E.stts,j),s(E.stsc,N),s(E.stsz,M),s(E.stco,R))},b=function(e){return s(E.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===e.type?U(e):B(e))},U=function(e){var t,i,n=e.sps||[],r=e.pps||[],a=[],o=[];for(t=0;t<n.length;t++)a.push((65280&n[t].byteLength)>>>8),a.push(255&n[t].byteLength),a=a.concat(Array.prototype.slice.call(n[t]));for(t=0;t<r.length;t++)o.push((65280&r[t].byteLength)>>>8),o.push(255&r[t].byteLength),o=o.concat(Array.prototype.slice.call(r[t]));if(i=[E.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]),s(E.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([n.length],a,[r.length],o))),s(E.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var l=e.sarRatio[0],c=e.sarRatio[1];i.push(s(E.pasp,new Uint8Array([(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l,(4278190080&c)>>24,(16711680&c)>>16,(65280&c)>>8,255&c])))}return s.apply(null,i)},B=function(e){return s(E.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]),r(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 s(E.tkhd,t)},T=function(e){var t,i,n,r,a,o;return t=s(E.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])),a=Math.floor(e.baseMediaDecodeTime/W),o=Math.floor(e.baseMediaDecodeTime%W),i=s(E.tfdt,new Uint8Array([1,0,0,0,a>>>24&255,a>>>16&255,a>>>8&255,255&a,o>>>24&255,o>>>16&255,o>>>8&255,255&o])),"audio"===e.type?(n=w(e,92),s(E.traf,t,i,n)):(r=v(e),n=w(e,r.length+92),s(E.traf,t,i,n,r))},p=function(e){return e.duration=e.duration||4294967295,s(E.trak,f(e),m(e))},S=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),s(E.trex,t)},$=function(e,t){var i=0,s=0,n=0,r=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(s=2),void 0!==e[0].flags&&(n=4),void 0!==e[0].compositionTimeOffset&&(r=8)),[0,0,i|s|n|r,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},q=function(e,t){var i,n,r,a,o,l;for(t+=20+16*(a=e.samples||[]).length,r=$(a,t),(n=new Uint8Array(r.length+16*a.length)).set(r),i=r.length,l=0;l<a.length;l++)o=a[l],n[i++]=(4278190080&o.duration)>>>24,n[i++]=(16711680&o.duration)>>>16,n[i++]=(65280&o.duration)>>>8,n[i++]=255&o.duration,n[i++]=(4278190080&o.size)>>>24,n[i++]=(16711680&o.size)>>>16,n[i++]=(65280&o.size)>>>8,n[i++]=255&o.size,n[i++]=o.flags.isLeading<<2|o.flags.dependsOn,n[i++]=o.flags.isDependedOn<<6|o.flags.hasRedundancy<<4|o.flags.paddingValue<<1|o.flags.isNonSyncSample,n[i++]=61440&o.flags.degradationPriority,n[i++]=15&o.flags.degradationPriority,n[i++]=(4278190080&o.compositionTimeOffset)>>>24,n[i++]=(16711680&o.compositionTimeOffset)>>>16,n[i++]=(65280&o.compositionTimeOffset)>>>8,n[i++]=255&o.compositionTimeOffset;return s(E.trun,n)},F=function(e,t){var i,n,r,a,o,l;for(t+=20+8*(a=e.samples||[]).length,r=$(a,t),(i=new Uint8Array(r.length+8*a.length)).set(r),n=r.length,l=0;l<a.length;l++)o=a[l],i[n++]=(4278190080&o.duration)>>>24,i[n++]=(16711680&o.duration)>>>16,i[n++]=(65280&o.duration)>>>8,i[n++]=255&o.duration,i[n++]=(4278190080&o.size)>>>24,i[n++]=(16711680&o.size)>>>16,i[n++]=(65280&o.size)>>>8,i[n++]=255&o.size;return s(E.trun,i)},w=function(e,t){return"audio"===e.type?F(e,t):q(e,t)};var G,X,Y,K,Q,J,Z,ee,te={ftyp:a=function(){return s(E.ftyp,C,x,C,k)},mdat:function(e){return s(E.mdat,e)},moof:c,moov:u,initSegment:function(e){var t,i=a(),s=u(e);return(t=new Uint8Array(i.byteLength+s.byteLength)).set(i),t.set(s,i.byteLength),t}},ie=function(e,t){var i={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return i.dataOffset=t,i.compositionTimeOffset=e.pts-e.dts,i.duration=e.duration,i.size=4*e.length,i.size+=e.byteLength,e.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i},se={groupNalsIntoFrames:function(e){var t,i,s=[],n=[];for(n.byteLength=0,n.nalCount=0,n.duration=0,s.byteLength=0,t=0;t<e.length;t++)"access_unit_delimiter_rbsp"===(i=e[t]).nalUnitType?(s.length&&(s.duration=i.dts-s.dts,n.byteLength+=s.byteLength,n.nalCount+=s.length,n.duration+=s.duration,n.push(s)),(s=[i]).byteLength=i.data.byteLength,s.pts=i.pts,s.dts=i.dts):("slice_layer_without_partitioning_rbsp_idr"===i.nalUnitType&&(s.keyFrame=!0),s.duration=i.dts-s.dts,s.byteLength+=i.data.byteLength,s.push(i));return n.length&&(!s.duration||s.duration<=0)&&(s.duration=n[n.length-1].duration),n.byteLength+=s.byteLength,n.nalCount+=s.length,n.duration+=s.duration,n.push(s),n},groupFramesIntoGops:function(e){var t,i,s=[],n=[];for(s.byteLength=0,s.nalCount=0,s.duration=0,s.pts=e[0].pts,s.dts=e[0].dts,n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=e[0].pts,n.dts=e[0].dts,t=0;t<e.length;t++)(i=e[t]).keyFrame?(s.length&&(n.push(s),n.byteLength+=s.byteLength,n.nalCount+=s.nalCount,n.duration+=s.duration),(s=[i]).nalCount=i.length,s.byteLength=i.byteLength,s.pts=i.pts,s.dts=i.dts,s.duration=i.duration):(s.duration+=i.duration,s.nalCount+=i.length,s.byteLength+=i.byteLength,s.push(i));return n.length&&s.duration<=0&&(s.duration=n[n.length-1].duration),n.byteLength+=s.byteLength,n.nalCount+=s.nalCount,n.duration+=s.duration,n.push(s),n},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 i,s,n,r,a,o=t||0,l=[];for(i=0;i<e.length;i++)for(r=e[i],s=0;s<r.length;s++)a=r[s],o+=(n=ie(a,o)).size,l.push(n);return l},concatenateNalData:function(e){var t,i,s,n,r,a,o=0,l=e.byteLength,c=e.nalCount,u=new Uint8Array(l+4*c),h=new DataView(u.buffer);for(t=0;t<e.length;t++)for(n=e[t],i=0;i<n.length;i++)for(r=n[i],s=0;s<r.length;s++)a=r[s],h.setUint32(o,a.data.byteLength),o+=4,u.set(a.data,o),o+=a.data.byteLength;return u},generateSampleTableForFrame:function(e,t){var i,s=[];return i=ie(e,t||0),s.push(i),s},concatenateNalDataForFrame:function(e){var t,i,s=0,n=e.byteLength,r=e.length,a=new Uint8Array(n+4*r),o=new DataView(a.buffer);for(t=0;t<e.length;t++)i=e[t],o.setUint32(s,i.data.byteLength),s+=4,a.set(i.data,s),s+=i.data.byteLength;return a}},ne=[33,16,5,32,164,27],re=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],ae=function(e){for(var t=[];e--;)t.push(0);return t},oe=9e4;J=function(e,t){return X(Q(e,t))},Z=function(e,t){return Y(K(e),t)},ee=function(e,t,i){return K(i?e:e-t)};var le={ONE_SECOND_IN_TS:oe,secondsToVideoTs:X=function(e){return e*oe},secondsToAudioTs:Y=function(e,t){return e*t},videoTsToSeconds:K=function(e){return e/oe},audioTsToSeconds:Q=function(e,t){return e/t},audioTsToVideoTs:J,videoTsToAudioTs:Z,metadataTsToSeconds:ee},ce=le,ue={prefixWithSilence:function(e,t,i,s){var n,r,a,o,l,c=0,u=0,h=0;if(t.length&&(n=ce.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),r=Math.ceil(ce.ONE_SECOND_IN_TS/(e.samplerate/1024)),i&&s&&(c=n-Math.max(i,s),h=(u=Math.floor(c/r))*r),!(u<1||h>ce.ONE_SECOND_IN_TS/2))){for((a=function(){if(!G){var e={96e3:[ne,[227,64],ae(154),[56]],88200:[ne,[231],ae(170),[56]],64e3:[ne,[248,192],ae(240),[56]],48e3:[ne,[255,192],ae(268),[55,148,128],ae(54),[112]],44100:[ne,[255,192],ae(268),[55,163,128],ae(84),[112]],32e3:[ne,[255,192],ae(268),[55,234],ae(226),[112]],24e3:[ne,[255,192],ae(268),[55,255,128],ae(268),[111,112],ae(126),[224]],16e3:[ne,[255,192],ae(268),[55,255,128],ae(268),[111,255],ae(269),[223,108],ae(195),[1,192]],12e3:[re,ae(268),[3,127,248],ae(268),[6,255,240],ae(268),[13,255,224],ae(268),[27,253,128],ae(259),[56]],11025:[re,ae(268),[3,127,248],ae(268),[6,255,240],ae(268),[13,255,224],ae(268),[27,255,192],ae(268),[55,175,128],ae(108),[112]],8e3:[re,ae(268),[3,121,16],ae(47),[7]]};t=e,G=Object.keys(t).reduce((function(e,i){return e[i]=new Uint8Array(t[i].reduce((function(e,t){return e.concat(t)}),[])),e}),{})}var t;return G}()[e.samplerate])||(a=t[0].data),o=0;o<u;o++)l=t[0],t.splice(0,0,{data:a,dts:l.dts-r,pts:l.pts-r});return e.baseMediaDecodeTime-=Math.floor(ce.videoTsToAudioTs(h,e.samplerate)),h}},trimAdtsFramesByEarliestDts:function(e,t,i){return t.minSegmentDts>=i?e:(t.minSegmentDts=1/0,e.filter((function(e){return e.dts>=i&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)})))},generateSampleTable:function(e){var t,i,s=[];for(t=0;t<e.length;t++)i=e[t],s.push({size:i.data.byteLength,duration:1024});return s},concatenateFrameData:function(e){var t,i,s=0,n=new Uint8Array(function(e){var t,i=0;for(t=0;t<e.length;t++)i+=e[t].data.byteLength;return i}(e));for(t=0;t<e.length;t++)i=e[t],n.set(i.data,s),s+=i.data.byteLength;return n}},he=le.ONE_SECOND_IN_TS,de={clearDtsInfo:function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},calculateTrackBaseMediaDecodeTime:function(e,t){var i,s=e.minSegmentDts;return t||(s-=e.timelineStartInfo.dts),i=e.timelineStartInfo.baseMediaDecodeTime,i+=s,i=Math.max(0,i),"audio"===e.type&&(i*=e.samplerate/he,i=Math.floor(i)),i},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))}},pe={parseSei:function(e){for(var t=0,i={payloadType:-1,payloadSize:0},s=0,n=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)s+=255,t++;for(s+=e[t++];255===e[t];)n+=255,t++;if(n+=e[t++],!i.payload&&4===s){if("GA94"===String.fromCharCode(e[t+3],e[t+4],e[t+5],e[t+6])){i.payloadType=s,i.payloadSize=n,i.payload=e.subarray(t,t+n);break}i.payload=void 0}t+=n,s=0,n=0}return i},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 i,s,n,r,a=[];if(!(64&t[0]))return a;for(s=31&t[0],i=0;i<s;i++)r={type:3&t[2+(n=3*i)],pts:e},4&t[n+2]&&(r.ccData=t[n+3]<<8|t[n+4],a.push(r));return a},discardEmulationPreventionBytes:function(e){for(var t,i,s=e.byteLength,n=[],r=1;r<s-2;)0===e[r]&&0===e[r+1]&&3===e[r+2]?(n.push(r+2),r+=2):r++;if(0===n.length)return e;t=s-n.length,i=new Uint8Array(t);var a=0;for(r=0;r<t;a++,r++)a===n[0]&&(a++,n.shift()),i[r]=e[a];return i},USER_DATA_REGISTERED_ITU_T_T35:4},fe=H,me=pe,ge=function(e){e=e||{},ge.prototype.init.call(this),this.parse708captions_="boolean"!=typeof e.parse708captions||e.parse708captions,this.captionPackets_=[],this.ccStreams_=[new xe(0,0),new xe(0,1),new xe(1,0),new xe(1,1)],this.parse708captions_&&(this.cc708Stream_=new Te({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")))};ge.prototype=new fe,ge.prototype.push=function(e){var t,i,s;if("sei_rbsp"===e.nalUnitType&&(t=me.parseSei(e.escapedRBSP)).payload&&t.payloadType===me.USER_DATA_REGISTERED_ITU_T_T35&&(i=me.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));s=me.parseCaptionPackets(e.pts,i),this.captionPackets_=this.captionPackets_.concat(s),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},ge.prototype.flushCCStreams=function(e){this.ccStreams_.forEach((function(t){return"flush"===e?t.flush():t.partialFlush()}),this)},ge.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)},ge.prototype.flush=function(){return this.flushStream("flush")},ge.prototype.partialFlush=function(){return this.flushStream("partialFlush")},ge.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach((function(e){e.reset()}))},ge.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)},ge.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},ge.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)},ge.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData)},ge.prototype.dispatchCea708Packet=function(e){this.parse708captions_&&this.cc708Stream_.push(e)};var ye={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},ve=function(e){return 32<=e&&e<=127||160<=e&&e<=255},_e=function(e){this.windowNum=e,this.reset()};_e.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},_e.prototype.getText=function(){return this.rows.join("\n")},_e.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},_e.prototype.newLine=function(e){for(this.rows.length>=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},_e.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},_e.prototype.addText=function(e){this.rows[this.rowIdx]+=e},_e.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var be=function(e,t,i){this.serviceNum=e,this.text="",this.currentWindow=new _e(-1),this.windows=[],this.stream=i,"string"==typeof t&&this.createTextDecoder(t)};be.prototype.init=function(e,t){this.startPts=e;for(var i=0;i<8;i++)this.windows[i]=new _e(i),"function"==typeof t&&(this.windows[i].beforeRowOverflow=t)},be.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]},be.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 Te=function(e){e=e||{},Te.prototype.init.call(this);var t,i=this,s=e.captionServices||{},n={};Object.keys(s).forEach((e=>{t=s[e],/^SERVICE/.test(e)&&(n[e]=t.encoding)})),this.serviceEncodings=n,this.current708Packet=null,this.services={},this.push=function(e){3===e.type?(i.new708Packet(),i.add708Bytes(e)):(null===i.current708Packet&&i.new708Packet(),i.add708Bytes(e))}};Te.prototype=new fe,Te.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},Te.prototype.add708Bytes=function(e){var t=e.ccData,i=t>>>8,s=255&t;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(i),this.current708Packet.data.push(s)},Te.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,i=null,s=null,n=0,r=t[n++];for(e.seq=r>>6,e.sizeCode=63&r;n<t.length;n++)s=31&(r=t[n++]),7==(i=r>>5)&&s>0&&(i=r=t[n++]),this.pushServiceBlock(i,n,s),s>0&&(n+=s-1)},Te.prototype.pushServiceBlock=function(e,t,i){var s,n=t,r=this.current708Packet.data,a=this.services[e];for(a||(a=this.initService(e,n));n<t+i&&n<r.length;n++)s=r[n],ve(s)?n=this.handleText(n,a):24===s?n=this.multiByteCharacter(n,a):16===s?n=this.extendedCommands(n,a):128<=s&&s<=135?n=this.setCurrentWindow(n,a):152<=s&&s<=159?n=this.defineWindow(n,a):136===s?n=this.clearWindows(n,a):140===s?n=this.deleteWindows(n,a):137===s?n=this.displayWindows(n,a):138===s?n=this.hideWindows(n,a):139===s?n=this.toggleWindows(n,a):151===s?n=this.setWindowAttributes(n,a):144===s?n=this.setPenAttributes(n,a):145===s?n=this.setPenColor(n,a):146===s?n=this.setPenLocation(n,a):143===s?a=this.reset(n,a):8===s?a.currentWindow.backspace():12===s?a.currentWindow.clearText():13===s?a.currentWindow.pendingNewLine=!0:14===s?a.currentWindow.clearText():141===s&&n++},Te.prototype.extendedCommands=function(e,t){var i=this.current708Packet.data[++e];return ve(i)&&(e=this.handleText(e,t,{isExtended:!0})),e},Te.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)]},Te.prototype.initService=function(e,t){var i,s,n=this;return(i="SERVICE"+e)in this.serviceEncodings&&(s=this.serviceEncodings[i]),this.services[e]=new be(e,s,n),this.services[e].init(this.getPts(t),(function(t){n.flushDisplayed(t,n.services[e])})),this.services[e]},Te.prototype.handleText=function(e,t,i){var s,n,r,a,o=i&&i.isExtended,l=i&&i.isMultiByte,c=this.current708Packet.data,u=o?4096:0,h=c[e],d=c[e+1],p=t.currentWindow;if(l?(n=[h,d],e++):n=[h],t.textDecoder_&&!o)s=t.textDecoder_.decode(new Uint8Array(n));else if(l){const e=n.map((e=>("0"+(255&e).toString(16)).slice(-2))).join("");s=String.fromCharCode(parseInt(e,16))}else a=ye[r=u|h]||r,s=4096&r&&r===a?"":String.fromCharCode(a);return p.pendingNewLine&&!p.isEmpty()&&p.newLine(this.getPts(e)),p.pendingNewLine=!1,p.addText(s),e},Te.prototype.multiByteCharacter=function(e,t){var i=this.current708Packet.data,s=i[e+1],n=i[e+2];return ve(s)&&ve(n)&&(e=this.handleText(++e,t,{isMultiByte:!0})),e},Te.prototype.setCurrentWindow=function(e,t){var i=7&this.current708Packet.data[e];return t.setCurrentWindow(i),e},Te.prototype.defineWindow=function(e,t){var i=this.current708Packet.data,s=i[e],n=7&s;t.setCurrentWindow(n);var r=t.currentWindow;return s=i[++e],r.visible=(32&s)>>5,r.rowLock=(16&s)>>4,r.columnLock=(8&s)>>3,r.priority=7&s,s=i[++e],r.relativePositioning=(128&s)>>7,r.anchorVertical=127&s,s=i[++e],r.anchorHorizontal=s,s=i[++e],r.anchorPoint=(240&s)>>4,r.rowCount=15&s,s=i[++e],r.columnCount=63&s,s=i[++e],r.windowStyle=(56&s)>>3,r.penStyle=7&s,r.virtualRowCount=r.rowCount+1,e},Te.prototype.setWindowAttributes=function(e,t){var i=this.current708Packet.data,s=i[e],n=t.currentWindow.winAttr;return s=i[++e],n.fillOpacity=(192&s)>>6,n.fillRed=(48&s)>>4,n.fillGreen=(12&s)>>2,n.fillBlue=3&s,s=i[++e],n.borderType=(192&s)>>6,n.borderRed=(48&s)>>4,n.borderGreen=(12&s)>>2,n.borderBlue=3&s,s=i[++e],n.borderType+=(128&s)>>5,n.wordWrap=(64&s)>>6,n.printDirection=(48&s)>>4,n.scrollDirection=(12&s)>>2,n.justify=3&s,s=i[++e],n.effectSpeed=(240&s)>>4,n.effectDirection=(12&s)>>2,n.displayEffect=3&s,e},Te.prototype.flushDisplayed=function(e,t){for(var i=[],s=0;s<8;s++)t.windows[s].visible&&!t.windows[s].isEmpty()&&i.push(t.windows[s].getText());t.endPts=e,t.text=i.join("\n\n"),this.pushCaption(t),t.startPts=e},Te.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts)},Te.prototype.displayWindows=function(e,t){var i=this.current708Packet.data[++e],s=this.getPts(e);this.flushDisplayed(s,t);for(var n=0;n<8;n++)i&1<<n&&(t.windows[n].visible=1);return e},Te.prototype.hideWindows=function(e,t){var i=this.current708Packet.data[++e],s=this.getPts(e);this.flushDisplayed(s,t);for(var n=0;n<8;n++)i&1<<n&&(t.windows[n].visible=0);return e},Te.prototype.toggleWindows=function(e,t){var i=this.current708Packet.data[++e],s=this.getPts(e);this.flushDisplayed(s,t);for(var n=0;n<8;n++)i&1<<n&&(t.windows[n].visible^=1);return e},Te.prototype.clearWindows=function(e,t){var i=this.current708Packet.data[++e],s=this.getPts(e);this.flushDisplayed(s,t);for(var n=0;n<8;n++)i&1<<n&&t.windows[n].clearText();return e},Te.prototype.deleteWindows=function(e,t){var i=this.current708Packet.data[++e],s=this.getPts(e);this.flushDisplayed(s,t);for(var n=0;n<8;n++)i&1<<n&&t.windows[n].reset();return e},Te.prototype.setPenAttributes=function(e,t){var i=this.current708Packet.data,s=i[e],n=t.currentWindow.penAttr;return s=i[++e],n.textTag=(240&s)>>4,n.offset=(12&s)>>2,n.penSize=3&s,s=i[++e],n.italics=(128&s)>>7,n.underline=(64&s)>>6,n.edgeType=(56&s)>>3,n.fontStyle=7&s,e},Te.prototype.setPenColor=function(e,t){var i=this.current708Packet.data,s=i[e],n=t.currentWindow.penColor;return s=i[++e],n.fgOpacity=(192&s)>>6,n.fgRed=(48&s)>>4,n.fgGreen=(12&s)>>2,n.fgBlue=3&s,s=i[++e],n.bgOpacity=(192&s)>>6,n.bgRed=(48&s)>>4,n.bgGreen=(12&s)>>2,n.bgBlue=3&s,s=i[++e],n.edgeRed=(48&s)>>4,n.edgeGreen=(12&s)>>2,n.edgeBlue=3&s,e},Te.prototype.setPenLocation=function(e,t){var i=this.current708Packet.data,s=i[e],n=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,s=i[++e],n.row=15&s,s=i[++e],n.column=63&s,e},Te.prototype.reset=function(e,t){var i=this.getPts(e);return this.flushDisplayed(i,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},xe=function(e,t){xe.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,i,s,n,r;if((t=32639&e.ccData)!==this.lastControlCode_){if(4096==(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),s=t>>>8,n=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),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,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()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(s,n))r=we((s=(3&s)<<8)|n),this[this.mode_](e.pts,r),this.column_++;else if(this.isExtCharacter(s,n))"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),r=we((s=(3&s)<<8)|n),this[this.mode_](e.pts,r),this.column_++;else if(this.isMidRowCode(s,n))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14&~n||this.addFormatting(e.pts,["i"]),1&~n||this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(s,n)){const e=3&n;this.nonDisplayed_[this.row_].offset=e,this.column_+=e}else if(this.isPAC(s,n)){var a=Ee.indexOf(7968&t);if("rollUp"===this.mode_&&(a-this.rollUpRows_+1<0&&(a=this.rollUpRows_-1),this.setRollUp(e.pts,a)),a!==this.row_&&a>=0&&a<=14&&(this.clearFormatting(e.pts),this.row_=a),1&n&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),!(16&~t)){const e=(14&t)>>1;this.column_=4*e,this.nonDisplayed_[this.row_].indent+=e}this.isColorPAC(n)&&(14&~n||this.addFormatting(e.pts,["i"]))}else this.isNormalChar(s)&&(0===n&&(n=null),r=we(s),r+=we(n),this[this.mode_](e.pts,r),this.column_+=r.length)}else this.lastControlCode_=null}};xe.prototype=new fe,xe.prototype.flushDisplayed=function(e){const t=e=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+e+"."})},i=[];this.displayed_.forEach(((e,s)=>{if(e&&e.text&&e.text.length){try{e.text=e.text.trim()}catch(e){t(s)}e.text.length&&i.push({text:e.text,line:s+1,position:10+Math.min(70,10*e.indent)+2.5*e.offset})}else null==e&&t(s)})),i.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,content:i,stream:this.name_})},xe.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_=[]},xe.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_},xe.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},xe.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},xe.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},xe.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},xe.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},xe.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},xe.prototype.isNormalChar=function(e){return e>=32&&e<=127},xe.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 i=0;i<this.rollUpRows_;i++)this.displayed_[t-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]={text:"",indent:0,offset:0};void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},xe.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var i=t.reduce((function(e,t){return e+"<"+t+">"}),"");this[this.mode_](e,i)},xe.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)}},xe.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_].text;i+=t,this.nonDisplayed_[this.row_].text=i},xe.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_].text;i+=t,this.displayed_[this.row_].text=i},xe.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}},xe.prototype.paintOn=function(e,t){var i=this.displayed_[this.row_].text;i+=t,this.displayed_[this.row_].text=i};var ke={CaptionStream:ge,Cea608Stream:xe,Cea708Stream:Te},Ae={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Ie=H,Pe="shared",Oe=function(e,t){var i=1;for(e>t&&(i=-1);Math.abs(t-e)>4294967296;)e+=8589934592*i;return e},Le=function(e){var t,i;Le.prototype.init.call(this),this.type_=e||Pe,this.push=function(e){"metadata"!==e.type?this.type_!==Pe&&e.type!==this.type_||(void 0===i&&(i=e.dts),e.dts=Oe(e.dts,i),e.pts=Oe(e.pts,i),t=e.dts,this.trigger("data",e)):this.trigger("data",e)},this.flush=function(){i=t,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){i=void 0,t=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Le.prototype=new Ie;var De,Re={TimestampRolloverStream:Le,handleRollover:Oe},Ne=(e,t,i)=>{if(!e)return-1;for(var s=i;s<e.length;s++)if(e[s]===t)return s;return-1},Me=function(e,t,i){var s,n="";for(s=t;s<i;s++)n+="%"+("00"+e[s].toString(16)).slice(-2);return n},je=function(e,t,i){return decodeURIComponent(Me(e,t,i))},Ue=function(e,t,i){return unescape(Me(e,t,i))},Be=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},Fe={APIC:function(e){var t,i,s=1;3===e.data[0]&&((t=Ne(e.data,0,s))<0||(e.mimeType=Ue(e.data,s,t),s=t+1,e.pictureType=e.data[s],s++,(i=Ne(e.data,0,s))<0||(e.description=je(e.data,s,i),s=i+1,"--\x3e"===e.mimeType?e.url=Ue(e.data,s,e.data.length):e.pictureData=e.data.subarray(s,e.data.length))))},"T*":function(e){3===e.data[0]&&(e.value=je(e.data,1,e.data.length).replace(/\0*$/,""),e.values=e.value.split("\0"))},TXXX:function(e){var t;3===e.data[0]&&-1!==(t=Ne(e.data,0,1))&&(e.description=je(e.data,1,t),e.value=je(e.data,t+1,e.data.length).replace(/\0*$/,""),e.data=e.value)},"W*":function(e){e.url=Ue(e.data,0,e.data.length).replace(/\0.*$/,"")},WXXX:function(e){var t;3===e.data[0]&&-1!==(t=Ne(e.data,0,1))&&(e.description=je(e.data,1,t),e.url=Ue(e.data,t+1,e.data.length).replace(/\0.*$/,""))},PRIV:function(e){var t;for(t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=Ue(e.data,0,t);break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}},qe={parseId3Frames:function(e){var t,i=10,s=0,n=[];if(!(e.length<10||e[0]!=="I".charCodeAt(0)||e[1]!=="D".charCodeAt(0)||e[2]!=="3".charCodeAt(0))){s=Be(e.subarray(6,10)),s+=10,64&e[5]&&(i+=4,i+=Be(e.subarray(10,14)),s-=Be(e.subarray(16,20)));do{if((t=Be(e.subarray(i+4,i+8)))<1)break;var r={id:String.fromCharCode(e[i],e[i+1],e[i+2],e[i+3]),data:e.subarray(i+10,i+t+10)};r.key=r.id,Fe[r.id]?Fe[r.id](r):"T"===r.id[0]?Fe["T*"](r):"W"===r.id[0]&&Fe["W*"](r),n.push(r),i+=10,i+=t}while(i<s);return n}},parseSyncSafeInteger:Be,frameParsers:Fe},$e=Ae,He=qe;(De=function(e){var t,i={descriptor:e&&e.descriptor},s=0,n=[],r=0;if(De.prototype.init.call(this),this.dispatchType=$e.METADATA_STREAM_TYPE.toString(16),i.descriptor)for(t=0;t<i.descriptor.length;t++)this.dispatchType+=("00"+i.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,i,a,o,l;if("timed-metadata"===e.type)if(e.dataAlignmentIndicator&&(r=0,n.length=0),0===n.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(n.push(e),r+=e.data.byteLength,1===n.length&&(s=He.parseSyncSafeInteger(e.data.subarray(6,10)),s+=10),!(r<s)){for(t={data:new Uint8Array(s),frames:[],pts:n[0].pts,dts:n[0].dts},l=0;l<s;)t.data.set(n[0].data.subarray(0,s-l),l),l+=n[0].data.byteLength,r-=n[0].data.byteLength,n.shift();i=10,64&t.data[5]&&(i+=4,i+=He.parseSyncSafeInteger(t.data.subarray(10,14)),s-=He.parseSyncSafeInteger(t.data.subarray(16,20)));do{if((a=He.parseSyncSafeInteger(t.data.subarray(i+4,i+8)))<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if((o={id:String.fromCharCode(t.data[i],t.data[i+1],t.data[i+2],t.data[i+3]),data:t.data.subarray(i+10,i+a+10)}).key=o.id,He.frameParsers[o.id]?He.frameParsers[o.id](o):"T"===o.id[0]?He.frameParsers["T*"](o):"W"===o.id[0]&&He.frameParsers["W*"](o),"com.apple.streaming.transportStreamTimestamp"===o.owner){var c=o.data,u=(1&c[3])<<30|c[4]<<22|c[5]<<14|c[6]<<6|c[7]>>>2;u*=4,u+=3&c[7],o.timeStamp=u,void 0===t.pts&&void 0===t.dts&&(t.pts=o.timeStamp,t.dts=o.timeStamp),this.trigger("timestamp",o)}t.frames.push(o),i+=10,i+=a}while(i<s);this.trigger("data",t)}}}).prototype=new H;var Ve,ze,We,Ge=De,Xe=H,Ye=ke,Ke=Ae,Qe=Re.TimestampRolloverStream,Je=188;(Ve=function(){var e=new Uint8Array(Je),t=0;Ve.prototype.init.call(this),this.push=function(i){var s,n=0,r=Je;for(t?((s=new Uint8Array(i.byteLength+t)).set(e.subarray(0,t)),s.set(i,t),t=0):s=i;r<s.byteLength;)71!==s[n]||71!==s[r]?(n++,r++):(this.trigger("data",s.subarray(n,r)),n+=Je,r+=Je);n<s.byteLength&&(e.set(s.subarray(n),0),t=s.byteLength-n)},this.flush=function(){t===Je&&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 Xe,(ze=function(){var e,t,i,s;ze.prototype.init.call(this),s=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,s){var n=0;s.payloadUnitStartIndicator&&(n+=e[n]+1),"pat"===s.type?t(e.subarray(n),s):i(e.subarray(n),s)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],s.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=s.pmtPid},i=function(e,t){var i,n;if(1&e[5]){for(s.programMapTable={video:null,audio:null,"timed-metadata":{}},i=3+((15&e[1])<<8|e[2])-4,n=12+((15&e[10])<<8|e[11]);n<i;){var r=e[n],a=(31&e[n+1])<<8|e[n+2];r===Ke.H264_STREAM_TYPE&&null===s.programMapTable.video?s.programMapTable.video=a:r===Ke.ADTS_STREAM_TYPE&&null===s.programMapTable.audio?s.programMapTable.audio=a:r===Ke.METADATA_STREAM_TYPE&&(s.programMapTable["timed-metadata"][a]=r),n+=5+((15&e[n+3])<<8|e[n+4])}t.programMapTable=s.programMapTable}},this.push=function(t){var i={},s=4;if(i.payloadUnitStartIndicator=!!(64&t[1]),i.pid=31&t[1],i.pid<<=8,i.pid|=t[2],(48&t[3])>>>4>1&&(s+=t[s]+1),0===i.pid)i.type="pat",e(t.subarray(s),i),this.trigger("data",i);else if(i.pid===this.pmtPid)for(i.type="pmt",e(t.subarray(s),i),this.trigger("data",i);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,s,i]):this.processPes_(t,s,i)},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=Ke.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=Ke.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}}).prototype=new Xe,ze.STREAM_TYPES={h264:27,adts:15},We=function(){var e,t=this,i=!1,s={data:[],size:0},n={data:[],size:0},r={data:[],size:0},a=function(e,i,s){var n,r,a=new Uint8Array(e.size),o={type:i},l=0,c=0;if(e.data.length&&!(e.size<9)){for(o.trackId=e.data[0].pid,l=0;l<e.data.length;l++)r=e.data[l],a.set(r.data,c),c+=r.data.byteLength;!function(e,t){var i;const s=e[0]<<16|e[1]<<8|e[2];t.data=new Uint8Array,1===s&&(t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=!!(4&e[6]),192&(i=e[7])&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&i&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1)),t.data=e.subarray(9+e[8]))}(a,o),n="video"===i||o.packetLength<=e.size,(s||n)&&(e.size=0,e.data.length=0),n&&t.trigger("data",o)}};We.prototype.init.call(this),this.push=function(o){({pat:function(){},pes:function(){var e,t;switch(o.streamType){case Ke.H264_STREAM_TYPE:e=s,t="video";break;case Ke.ADTS_STREAM_TYPE:e=n,t="audio";break;case Ke.METADATA_STREAM_TYPE:e=r,t="timed-metadata";break;default:return}o.payloadUnitStartIndicator&&a(e,t,!0),e.data.push(o),e.size+=o.data.byteLength},pmt:function(){var s={type:"metadata",tracks:[]};null!==(e=o.programMapTable).video&&s.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&s.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),i=!0,t.trigger("data",s)}})[o.type]()},this.reset=function(){s.size=0,s.data.length=0,n.size=0,n.data.length=0,this.trigger("reset")},this.flushStreams_=function(){a(s,"video"),a(n,"audio"),a(r,"timed-metadata")},this.flush=function(){if(!i&&e){var s={type:"metadata",tracks:[]};null!==e.video&&s.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&s.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),t.trigger("data",s)}i=!1,this.flushStreams_(),this.trigger("done")}},We.prototype=new Xe;var Ze={PAT_PID:0,MP2T_PACKET_LENGTH:Je,TransportPacketStream:Ve,TransportParseStream:ze,ElementaryStream:We,TimestampRolloverStream:Qe,CaptionStream:Ye.CaptionStream,Cea608Stream:Ye.Cea608Stream,Cea708Stream:Ye.Cea708Stream,MetadataStream:Ge};for(var et in Ke)Ke.hasOwnProperty(et)&&(Ze[et]=Ke[et]);var tt,it=Ze,st=le.ONE_SECOND_IN_TS,nt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];(tt=function(e){var t,i=0;tt.prototype.init.call(this),this.skipWarn_=function(e,t){this.trigger("log",{level:"warn",message:`adts skiping bytes ${e} to ${t} in frame ${i} outside syncword`})},this.push=function(s){var n,r,a,o,l,c=0;if(e||(i=0),"audio"===s.type){var u;for(t&&t.length?(a=t,(t=new Uint8Array(a.byteLength+s.data.byteLength)).set(a),t.set(s.data,a.byteLength)):t=s.data;c+7<t.length;)if(255===t[c]&&240==(246&t[c+1])){if("number"==typeof u&&(this.skipWarn_(u,c),u=null),r=2*(1&~t[c+1]),n=(3&t[c+3])<<11|t[c+4]<<3|(224&t[c+5])>>5,l=(o=1024*(1+(3&t[c+6])))*st/nt[(60&t[c+2])>>>2],t.byteLength-c<n)break;this.trigger("data",{pts:s.pts+i*l,dts:s.dts+i*l,sampleCount:o,audioobjecttype:1+(t[c+2]>>>6&3),channelcount:(1&t[c+2])<<2|(192&t[c+3])>>>6,samplerate:nt[(60&t[c+2])>>>2],samplingfrequencyindex:(60&t[c+2])>>>2,samplesize:16,data:t.subarray(c+7+r,c+n)}),i++,c+=n}else"number"!=typeof u&&(u=c),c++;"number"==typeof u&&(this.skipWarn_(u,c),u=null),t=t.subarray(c)}},this.flush=function(){i=0,this.trigger("done")},this.reset=function(){t=void 0,this.trigger("reset")},this.endTimeline=function(){t=void 0,this.trigger("endedtimeline")}}).prototype=new H;var rt,at,ot,lt=tt,ct=H,ut=function(e){var t=e.byteLength,i=0,s=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+s},this.loadWord=function(){var n=e.byteLength-t,r=new Uint8Array(4),a=Math.min(4,t);if(0===a)throw new Error("no bytes available");r.set(e.subarray(n,n+a)),i=new DataView(r.buffer).getUint32(0),s=8*a,t-=a},this.skipBits=function(e){var n;s>e?(i<<=e,s-=e):(e-=s,e-=8*(n=Math.floor(e/8)),t-=n,this.loadWord(),i<<=e,s-=e)},this.readBits=function(e){var n=Math.min(s,e),r=i>>>32-n;return(s-=n)>0?i<<=n:t>0&&this.loadWord(),(n=e-n)>0?r<<n|this.readBits(n):r},this.skipLeadingZeros=function(){var e;for(e=0;e<s;++e)if(i&2147483648>>>e)return i<<=e,s-=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()};(at=function(){var e,t,i=0;at.prototype.init.call(this),this.push=function(s){var n;t?((n=new Uint8Array(t.byteLength+s.data.byteLength)).set(t),n.set(s.data,t.byteLength),t=n):t=s.data;for(var r=t.byteLength;i<r-3;i++)if(1===t[i+2]){e=i+5;break}for(;e<r;)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}i+3!==e-2&&this.trigger("data",t.subarray(i+3,e-2));do{e++}while(1!==t[e]&&e<r);i=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(i+3,e-2)),i=e-2,e+=3;break;default:e+=3}t=t.subarray(i),e-=i,i=0},this.reset=function(){t=null,i=0,this.trigger("reset")},this.flush=function(){t&&t.byteLength>3&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}}).prototype=new ct,ot={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},rt=function(){var e,t,i,s,n,r,a,o=new at;rt.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,s=e.dts,o.push(e))},o.on("data",(function(a){var o={trackId:t,pts:i,dts:s,data:a,nalUnitTypeCode:31&a[0]};switch(o.nalUnitTypeCode){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=n(a.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=n(a.subarray(1)),o.config=r(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()},a=function(e,t){var i,s=8,n=8;for(i=0;i<e;i++)0!==n&&(n=(s+t.readExpGolomb()+256)%256),s=0===n?s:n},n=function(e){for(var t,i,s=e.byteLength,n=[],r=1;r<s-2;)0===e[r]&&0===e[r+1]&&3===e[r+2]?(n.push(r+2),r+=2):r++;if(0===n.length)return e;t=s-n.length,i=new Uint8Array(t);var a=0;for(r=0;r<t;a++,r++)a===n[0]&&(a++,n.shift()),i[r]=e[a];return i},r=function(e){var t,i,s,n,r,o,l,c,u,h,d,p,f=0,m=0,g=0,y=0,v=[1,1];if(i=(t=new ut(e)).readUnsignedByte(),n=t.readUnsignedByte(),s=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),ot[i]&&(3===(r=t.readUnsignedExpGolomb())&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(d=3!==r?8:12,p=0;p<d;p++)t.readBoolean()&&a(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(),l=t.readUnsignedExpGolomb(),p=0;p<l;p++)t.skipExpGolomb();if(t.skipUnsignedExpGolomb(),t.skipBits(1),c=t.readUnsignedExpGolomb(),u=t.readUnsignedExpGolomb(),0===(h=t.readBits(1))&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(f=t.readUnsignedExpGolomb(),m=t.readUnsignedExpGolomb(),g=t.readUnsignedExpGolomb(),y=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(t.readUnsignedByte()){case 1:v=[1,1];break;case 2:v=[12,11];break;case 3:v=[10,11];break;case 4:v=[16,11];break;case 5:v=[40,33];break;case 6:v=[24,11];break;case 7:v=[20,11];break;case 8:v=[32,11];break;case 9:v=[80,33];break;case 10:v=[18,11];break;case 11:v=[15,11];break;case 12:v=[64,33];break;case 13:v=[160,99];break;case 14:v=[4,3];break;case 15:v=[3,2];break;case 16:v=[2,1];break;case 255:v=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()]}v&&(v[0],v[1])}return{profileIdc:i,levelIdc:s,profileCompatibility:n,width:16*(c+1)-2*f-2*m,height:(2-h)*(u+1)*16-2*g-2*y,sarRatio:v}}},rt.prototype=new ct;var ht,dt={H264Stream:rt,NalByteStream:at},pt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],ft=function(e,t){var i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return i=i>=0?i:0,(16&e[t+5])>>4?i+20:i+10},mt=function(e,t){return e.length-t<10||e[t]!=="I".charCodeAt(0)||e[t+1]!=="D".charCodeAt(0)||e[t+2]!=="3".charCodeAt(0)?t:(t+=ft(e,t),mt(e,t))},gt=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},yt={isLikelyAacData:function(e){var t=mt(e,0);return e.length>=t+2&&!(255&~e[t])&&!(240&~e[t+1])&&16==(22&e[t+1])},parseId3TagSize:ft,parseAdtsSize:function(e,t){var i=(224&e[t+5])>>5,s=e[t+4]<<3;return 6144&e[t+3]|s|i},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 pt[(60&e[t+2])>>>2];t++}return null},parseAacTimestamp:function(e){var t,i,s;t=10,64&e[5]&&(t+=4,t+=gt(e.subarray(10,14)));do{if((i=gt(e.subarray(t+4,t+8)))<1)return null;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){s=e.subarray(t+10,t+i+10);for(var n=0;n<s.byteLength;n++)if(0===s[n]){var r=unescape(function(e,t,i){var s,n="";for(s=0;s<i;s++)n+="%"+("00"+e[s].toString(16)).slice(-2);return n}(s,0,n));if("com.apple.streaming.transportStreamTimestamp"===r){var a=s.subarray(n+1),o=(1&a[3])<<30|a[4]<<22|a[5]<<14|a[6]<<6|a[7]>>>2;return(o*=4)+(3&a[7])}break}}t+=10,t+=i}while(t<e.byteLength);return null}},vt=yt;(ht=function(){var e=new Uint8Array,t=0;ht.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(i){var s,n,r,a,o=0,l=0;for(e.length?(a=e.length,(e=new Uint8Array(i.byteLength+a)).set(e.subarray(0,a)),e.set(i,a)):e=i;e.length-l>=3;)if(e[l]!=="I".charCodeAt(0)||e[l+1]!=="D".charCodeAt(0)||e[l+2]!=="3".charCodeAt(0))if(255&~e[l]||240&~e[l+1])l++;else{if(e.length-l<7)break;if(l+(o=vt.parseAdtsSize(e,l))>e.length)break;r={type:"audio",data:e.subarray(l,l+o),pts:t,dts:t},this.trigger("data",r),l+=o}else{if(e.length-l<10)break;if(l+(o=vt.parseId3TagSize(e,l))>e.length)break;n={type:"timed-metadata",data:e.subarray(l,l+o)},this.trigger("data",n),l+=o}s=e.length-l,e=s>0?e.subarray(l):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){e=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new H;var _t,bt,Tt,St,wt=H,Et=te,Ct=se,xt=ue,kt=de,At=it,It=le,Pt=lt,Ot=dt.H264Stream,Lt=ht,Dt=yt.isLikelyAacData,Rt=le.ONE_SECOND_IN_TS,Nt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Mt=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],jt=function(e,t){t.stream=e,this.trigger("log",t)},Ut=function(e,t){for(var i=Object.keys(t),s=0;s<i.length;s++){var n=i[s];"headOfPipeline"!==n&&t[n].on&&t[n].on("log",jt.bind(e,n))}},Bt=function(e,t){var i;if(e.length!==t.length)return!1;for(i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0},Ft=function(e,t,i,s,n,r){return{start:{dts:e,pts:e+(i-t)},end:{dts:e+(s-t),pts:e+(n-i)},prependedContentDuration:r,baseMediaDecodeTime:e}};bt=function(e,t){var i,s=[],n=0,r=0,a=1/0;i=(t=t||{}).firstSequenceNumber||0,bt.prototype.init.call(this),this.push=function(t){kt.collectDtsInfo(e,t),e&&Nt.forEach((function(i){e[i]=t[i]})),s.push(t)},this.setEarliestDts=function(e){n=e},this.setVideoBaseMediaDecodeTime=function(e){a=e},this.setAudioAppendStart=function(e){r=e},this.flush=function(){var o,l,c,u,h,d,p;0!==s.length?(o=xt.trimAdtsFramesByEarliestDts(s,e,n),e.baseMediaDecodeTime=kt.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),p=xt.prefixWithSilence(e,o,r,a),e.samples=xt.generateSampleTable(o),c=Et.mdat(xt.concatenateFrameData(o)),s=[],l=Et.moof(i,[e]),u=new Uint8Array(l.byteLength+c.byteLength),i++,u.set(l),u.set(c,l.byteLength),kt.clearDtsInfo(e),h=Math.ceil(1024*Rt/e.samplerate),o.length&&(d=o.length*h,this.trigger("segmentTimingInfo",Ft(It.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),o[0].dts,o[0].pts,o[0].dts+d,o[0].pts+d,p||0)),this.trigger("timingInfo",{start:o[0].pts,end:o[0].pts+d})),this.trigger("data",{track:e,boxes:u}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")},this.reset=function(){kt.clearDtsInfo(e),s=[],this.trigger("reset")}},bt.prototype=new wt,_t=function(e,t){var i,s,n,r=[],a=[];i=(t=t||{}).firstSequenceNumber||0,_t.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){kt.collectDtsInfo(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||s||(s=t.config,e.sps=[t.data],Mt.forEach((function(t){e[t]=s[t]}),this)),"pic_parameter_set_rbsp"!==t.nalUnitType||n||(n=t.data,e.pps=[t.data]),r.push(t)},this.flush=function(){for(var s,n,o,l,c,u,h,d,p=0;r.length&&"access_unit_delimiter_rbsp"!==r[0].nalUnitType;)r.shift();if(0===r.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(s=Ct.groupNalsIntoFrames(r),(o=Ct.groupFramesIntoGops(s))[0][0].keyFrame||((n=this.getGopForFusion_(r[0],e))?(p=n.duration,o.unshift(n),o.byteLength+=n.byteLength,o.nalCount+=n.nalCount,o.pts=n.pts,o.dts=n.dts,o.duration+=n.duration):o=Ct.extendFirstKeyFrame(o)),a.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),r=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");kt.clearDtsInfo(e),o=f}kt.collectDtsInfo(e,o),e.samples=Ct.generateSampleTable(o),c=Et.mdat(Ct.concatenateNalData(o)),e.baseMediaDecodeTime=kt.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",o.map((function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}}))),h=o[0],d=o[o.length-1],this.trigger("segmentTimingInfo",Ft(e.baseMediaDecodeTime,h.dts,h.pts,d.dts+d.duration,d.pts+d.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),r=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),l=Et.moof(i,[e]),u=new Uint8Array(l.byteLength+c.byteLength),i++,u.set(l),u.set(c,l.byteLength),this.trigger("data",{track:e,boxes:u}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),r=[],this.gopCache_.length=0,a.length=0,this.trigger("reset")},this.resetStream_=function(){kt.clearDtsInfo(e),s=void 0,n=void 0},this.getGopForFusion_=function(t){var i,s,n,r,a,o=1/0;for(a=0;a<this.gopCache_.length;a++)n=(r=this.gopCache_[a]).gop,e.pps&&Bt(e.pps[0],r.pps[0])&&e.sps&&Bt(e.sps[0],r.sps[0])&&(n.dts<e.timelineStartInfo.dts||(i=t.dts-n.dts-n.duration)>=-1e4&&i<=45e3&&(!s||o>i)&&(s=r,o=i));return s?s.gop:null},this.alignGopsAtStart_=function(e){var t,i,s,n,r,o,l,c;for(r=e.byteLength,o=e.nalCount,l=e.duration,t=i=0;t<a.length&&i<e.length&&(s=a[t],n=e[i],s.pts!==n.pts);)n.pts>s.pts?t++:(i++,r-=n.byteLength,o-=n.nalCount,l-=n.duration);return 0===i?e:i===e.length?null:((c=e.slice(i)).byteLength=r,c.duration=l,c.nalCount=o,c.pts=c[0].pts,c.dts=c[0].dts,c)},this.alignGopsAtEnd_=function(e){var t,i,s,n,r,o,l;for(t=a.length-1,i=e.length-1,r=null,o=!1;t>=0&&i>=0;){if(s=a[t],n=e[i],s.pts===n.pts){o=!0;break}s.pts>n.pts?t--:(t===a.length-1&&(r=i),i--)}if(!o&&null===r)return null;if(0===(l=o?i:r))return e;var c=e.slice(l),u=c.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 c.byteLength=u.byteLength,c.duration=u.duration,c.nalCount=u.nalCount,c.pts=c[0].pts,c.dts=c[0].dts,c},this.alignGopsWith=function(e){a=e}},_t.prototype=new wt,St=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,St.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))))}},St.prototype=new wt,St.prototype.flush=function(e){var t,i,s,n,r=0,a={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,Mt.forEach((function(e){a.info[e]=this.videoTrack[e]}),this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,Nt.forEach((function(e){a.info[e]=this.audioTrack[e]}),this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?a.type=this.pendingTracks[0].type:a.type="combined",this.emittedTracks+=this.pendingTracks.length,s=Et.initSegment(this.pendingTracks),a.initSegment=new Uint8Array(s.byteLength),a.initSegment.set(s),a.data=new Uint8Array(this.pendingBytes),n=0;n<this.pendingBoxes.length;n++)a.data.set(this.pendingBoxes[n],r),r+=this.pendingBoxes[n].byteLength;for(n=0;n<this.pendingCaptions.length;n++)(t=this.pendingCaptions[n]).startTime=It.metadataTsToSeconds(t.startPts,o,this.keepOriginalTimestamps),t.endTime=It.metadataTsToSeconds(t.endPts,o,this.keepOriginalTimestamps),a.captionStreams[t.stream]=!0,a.captions.push(t);for(n=0;n<this.pendingMetadata.length;n++)(i=this.pendingMetadata[n]).cueTime=It.metadataTsToSeconds(i.pts,o,this.keepOriginalTimestamps),a.metadata.push(i);for(a.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",a),n=0;n<a.captions.length;n++)t=a.captions[n],this.trigger("caption",t);for(n=0;n<a.metadata.length;n++)i=a.metadata[n],this.trigger("id3Frame",i)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},St.prototype.setRemux=function(e){this.remuxTracks=e},(Tt=function(e){var t,i,s=this,n=!0;Tt.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var n={};this.transmuxPipeline_=n,n.type="aac",n.metadataStream=new At.MetadataStream,n.aacStream=new Lt,n.audioTimestampRolloverStream=new At.TimestampRolloverStream("audio"),n.timedMetadataTimestampRolloverStream=new At.TimestampRolloverStream("timed-metadata"),n.adtsStream=new Pt,n.coalesceStream=new St(e,n.metadataStream),n.headOfPipeline=n.aacStream,n.aacStream.pipe(n.audioTimestampRolloverStream).pipe(n.adtsStream),n.aacStream.pipe(n.timedMetadataTimestampRolloverStream).pipe(n.metadataStream).pipe(n.coalesceStream),n.metadataStream.on("timestamp",(function(e){n.aacStream.setTimestamp(e.timeStamp)})),n.aacStream.on("data",(function(r){"timed-metadata"!==r.type&&"audio"!==r.type||n.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:s.baseMediaDecodeTime},codec:"adts",type:"audio"},n.coalesceStream.numberOfTracks++,n.audioSegmentStream=new bt(i,e),n.audioSegmentStream.on("log",s.getLogTrigger_("audioSegmentStream")),n.audioSegmentStream.on("timingInfo",s.trigger.bind(s,"audioTimingInfo")),n.adtsStream.pipe(n.audioSegmentStream).pipe(n.coalesceStream),s.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t}))})),n.coalesceStream.on("data",this.trigger.bind(this,"data")),n.coalesceStream.on("done",this.trigger.bind(this,"done")),Ut(this,n)},this.setupTsPipeline=function(){var n={};this.transmuxPipeline_=n,n.type="ts",n.metadataStream=new At.MetadataStream,n.packetStream=new At.TransportPacketStream,n.parseStream=new At.TransportParseStream,n.elementaryStream=new At.ElementaryStream,n.timestampRolloverStream=new At.TimestampRolloverStream,n.adtsStream=new Pt,n.h264Stream=new Ot,n.captionStream=new At.CaptionStream(e),n.coalesceStream=new St(e,n.metadataStream),n.headOfPipeline=n.packetStream,n.packetStream.pipe(n.parseStream).pipe(n.elementaryStream).pipe(n.timestampRolloverStream),n.timestampRolloverStream.pipe(n.h264Stream),n.timestampRolloverStream.pipe(n.adtsStream),n.timestampRolloverStream.pipe(n.metadataStream).pipe(n.coalesceStream),n.h264Stream.pipe(n.captionStream).pipe(n.coalesceStream),n.elementaryStream.on("data",(function(r){var a;if("metadata"===r.type){for(a=r.tracks.length;a--;)t||"video"!==r.tracks[a].type?i||"audio"!==r.tracks[a].type||((i=r.tracks[a]).timelineStartInfo.baseMediaDecodeTime=s.baseMediaDecodeTime):(t=r.tracks[a]).timelineStartInfo.baseMediaDecodeTime=s.baseMediaDecodeTime;t&&!n.videoSegmentStream&&(n.coalesceStream.numberOfTracks++,n.videoSegmentStream=new _t(t,e),n.videoSegmentStream.on("log",s.getLogTrigger_("videoSegmentStream")),n.videoSegmentStream.on("timelineStartInfo",(function(t){i&&!e.keepOriginalTimestamps&&(i.timelineStartInfo=t,n.audioSegmentStream.setEarliestDts(t.dts-s.baseMediaDecodeTime))})),n.videoSegmentStream.on("processedGopsInfo",s.trigger.bind(s,"gopInfo")),n.videoSegmentStream.on("segmentTimingInfo",s.trigger.bind(s,"videoSegmentTimingInfo")),n.videoSegmentStream.on("baseMediaDecodeTime",(function(e){i&&n.audioSegmentStream.setVideoBaseMediaDecodeTime(e)})),n.videoSegmentStream.on("timingInfo",s.trigger.bind(s,"videoTimingInfo")),n.h264Stream.pipe(n.videoSegmentStream).pipe(n.coalesceStream)),i&&!n.audioSegmentStream&&(n.coalesceStream.numberOfTracks++,n.audioSegmentStream=new bt(i,e),n.audioSegmentStream.on("log",s.getLogTrigger_("audioSegmentStream")),n.audioSegmentStream.on("timingInfo",s.trigger.bind(s,"audioTimingInfo")),n.audioSegmentStream.on("segmentTimingInfo",s.trigger.bind(s,"audioSegmentTimingInfo")),n.adtsStream.pipe(n.audioSegmentStream).pipe(n.coalesceStream)),s.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t})}})),n.coalesceStream.on("data",this.trigger.bind(this,"data")),n.coalesceStream.on("id3Frame",(function(e){e.dispatchType=n.metadataStream.dispatchType,s.trigger("id3Frame",e)})),n.coalesceStream.on("caption",this.trigger.bind(this,"caption")),n.coalesceStream.on("done",this.trigger.bind(this,"done")),Ut(this,n)},this.setBaseMediaDecodeTime=function(s){var n=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=s),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,kt.clearDtsInfo(i),n.audioTimestampRolloverStream&&n.audioTimestampRolloverStream.discontinuity()),t&&(n.videoSegmentStream&&(n.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,kt.clearDtsInfo(t),n.captionStream.reset()),n.timestampRolloverStream&&n.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(t){var i=this.transmuxPipeline_;e.remux=t,i&&i.coalesceStream&&i.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(i){i.stream=e,t.trigger("log",i)}},this.push=function(e){if(n){var t=Dt(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),n=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){n=!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 wt;var qt,$t,Ht,Vt,zt={Transmuxer:Tt,VideoSegmentStream:_t,AudioSegmentStream:bt,AUDIO_PROPERTIES:Nt,VIDEO_PROPERTIES:Mt,generateSegmentTimingInfo:Ft},Wt=function(e){return e>>>0},Gt=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),(t+=String.fromCharCode(e[2]))+String.fromCharCode(e[3])},Xt=Wt,Yt=Gt,Kt=function(e,t){var i,s,n,r,a,o=[];if(!t.length)return null;for(i=0;i<e.byteLength;)s=Xt(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]),n=Yt(e.subarray(i+4,i+8)),r=s>1?i+s:e.byteLength,n===t[0]&&(1===t.length?o.push(e.subarray(i+8,r)):(a=Kt(e.subarray(i+8,r),t.slice(1))).length&&(o=o.concat(a))),i=r;return o},Qt=Wt,Jt=z.getUint64,Zt=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};return 1===t.version?t.baseMediaDecodeTime=Jt(e.subarray(4)):t.baseMediaDecodeTime=Qt(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),t},ei=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]}},ti=function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},s=new DataView(e.buffer,e.byteOffset,e.byteLength),n=1&i.flags[2],r=4&i.flags[2],a=1&i.flags[1],o=2&i.flags[1],l=4&i.flags[1],c=8&i.flags[1],u=s.getUint32(4),h=8;for(n&&(i.dataOffset=s.getInt32(h),h+=4),r&&u&&(t={flags:ei(e.subarray(h,h+4))},h+=4,a&&(t.duration=s.getUint32(h),h+=4),o&&(t.size=s.getUint32(h),h+=4),c&&(1===i.version?t.compositionTimeOffset=s.getInt32(h):t.compositionTimeOffset=s.getUint32(h),h+=4),i.samples.push(t),u--);u--;)t={},a&&(t.duration=s.getUint32(h),h+=4),o&&(t.size=s.getUint32(h),h+=4),l&&(t.flags=ei(e.subarray(h,h+4)),h+=4),c&&(1===i.version?t.compositionTimeOffset=s.getInt32(h):t.compositionTimeOffset=s.getUint32(h),h+=4),i.samples.push(t);return i},ii=function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),s={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:i.getUint32(4)},n=1&s.flags[2],r=2&s.flags[2],a=8&s.flags[2],o=16&s.flags[2],l=32&s.flags[2],c=65536&s.flags[0],u=131072&s.flags[0];return t=8,n&&(t+=4,s.baseDataOffset=i.getUint32(12),t+=4),r&&(s.sampleDescriptionIndex=i.getUint32(t),t+=4),a&&(s.defaultSampleDuration=i.getUint32(t),t+=4),o&&(s.defaultSampleSize=i.getUint32(t),t+=4),l&&(s.defaultSampleFlags=i.getUint32(t)),c&&(s.durationIsEmpty=!0),!n&&u&&(s.baseDataOffsetIsMoof=!0),s},si=(qt="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},pe.discardEmulationPreventionBytes),ni=ke.CaptionStream,ri=Kt,ai=Zt,oi=ti,li=ii,ci=qt,ui=function(e,t){for(var i=e,s=0;s<t.length;s++){var n=t[s];if(i<n.size)return n;i-=n.size}return null},hi=function(){var e,t,i,s,n,r,a=!1;this.isInitialized=function(){return a},this.init=function(t){e=new ni,a=!0,r=!!t&&t.isPartial,e.on("data",(function(e){e.startTime=e.startPts/s,e.endTime=e.endPts/s,n.captions.push(e),n.captionStreams[e.stream]=!0})),e.on("log",(function(e){n.logs.push(e)}))},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"==typeof t&&0===Object.keys(t).length||i===e[0]&&s===t[i])},this.parse=function(e,r,a){var o;if(!this.isInitialized())return null;if(!r||!a)return null;if(this.isNewInit(r,a))i=r[0],s=a[i];else if(null===i||!s)return t.push(e),null;for(;t.length>0;){var l=t.shift();this.parse(l,r,a)}return o=function(e,t,i){if(null===t)return null;var s=function(e,t){var i=ri(e,["moof","traf"]),s=ri(e,["mdat"]),n={},r=[];return s.forEach((function(e,t){var s=i[t];r.push({mdat:e,traf:s})})),r.forEach((function(e){var i,s,r=e.mdat,a=e.traf,o=ri(a,["tfhd"]),l=li(o[0]),c=l.trackId,u=ri(a,["tfdt"]),h=u.length>0?ai(u[0]).baseMediaDecodeTime:0,d=ri(a,["trun"]);t===c&&d.length>0&&(i=function(e,t,i){var s=t,n=i.defaultSampleDuration||0,r=i.defaultSampleSize||0,a=i.trackId,o=[];return e.forEach((function(e){var t=oi(e).samples;t.forEach((function(e){void 0===e.duration&&(e.duration=n),void 0===e.size&&(e.size=r),e.trackId=a,e.dts=s,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),"bigint"==typeof s?(e.pts=s+ci.BigInt(e.compositionTimeOffset),s+=ci.BigInt(e.duration)):(e.pts=s+e.compositionTimeOffset,s+=e.duration)})),o=o.concat(t)})),o}(d,h,l),s=function(e,t,i){var s,n,r,a,o=new DataView(e.buffer,e.byteOffset,e.byteLength),l={logs:[],seiNals:[]};for(n=0;n+4<e.length;n+=r)if(r=o.getUint32(n),n+=4,!(r<=0))switch(31&e[n]){case 6:var c=e.subarray(n+1,n+1+r),u=ui(n,t);if(s={nalUnitType:"sei_rbsp",size:r,data:c,escapedRBSP:si(c),trackId:i},u)s.pts=u.pts,s.dts=u.dts,a=u;else{if(!a){l.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+n+" for trackId "+i+". See mux.js#223."});break}s.pts=a.pts,s.dts=a.dts}l.seiNals.push(s)}return l}(r,i,c),n[c]||(n[c]={seiNals:[],logs:[]}),n[c].seiNals=n[c].seiNals.concat(s.seiNals),n[c].logs=n[c].logs.concat(s.logs))})),n}(e,t)[t]||{};return{seiNals:s.seiNals,logs:s.logs,timescale:i}}(e,i,s),o&&o.logs&&(n.logs=n.logs.concat(o.logs)),null!==o&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),n):n.logs.length?{logs:n.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;r?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){n.captions=[],n.captionStreams={},n.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],i=null,s=null,n?this.clearParsedCaptions():n={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},di=function(e){for(var t=0,i=String.fromCharCode(e[t]),s="";"\0"!==i;)s+=i,t++,i=String.fromCharCode(e[t]);return s+i},pi=z.getUint64,fi=function(e){return void 0!==e||null!==e},mi={parseEmsgBox:function(e){var t,i,s,n,r,a,o,l=4,c=e[0];if(0===c)l+=(t=di(e.subarray(l))).length,l+=(i=di(e.subarray(l))).length,s=(u=new DataView(e.buffer)).getUint32(l),l+=4,r=u.getUint32(l),l+=4,a=u.getUint32(l),l+=4,o=u.getUint32(l),l+=4;else if(1===c){var u;s=(u=new DataView(e.buffer)).getUint32(l),l+=4,n=pi(e.subarray(l)),l+=8,a=u.getUint32(l),l+=4,o=u.getUint32(l),l+=4,l+=(t=di(e.subarray(l))).length,l+=(i=di(e.subarray(l))).length}var h={scheme_id_uri:t,value:i,timescale:s||1,presentation_time:n,presentation_time_delta:r,event_duration:a,id:o,message_data:new Uint8Array(e.subarray(l,e.byteLength))};return function(e,t){var i="\0"!==t.scheme_id_uri,s=0===e&&fi(t.presentation_time_delta)&&i,n=1===e&&fi(t.presentation_time)&&i;return!(e>1)&&s||n}(c,h)?h:void 0},scaleTime:function(e,t,i,s){return e||0===e?e/t:s+i/t}},gi=Wt,yi=function(e){return("00"+e.toString(16)).slice(-2)},vi=Kt,_i=Gt,bi=mi,Ti=z.getUint64,Si=qt,wi=qe.parseId3Frames;$t=function(e,t){var i=vi(t,["moof","traf"]).reduce((function(t,i){var s,n=vi(i,["tfhd"])[0],r=gi(n[4]<<24|n[5]<<16|n[6]<<8|n[7]),a=e[r]||9e4,o=vi(i,["tfdt"])[0],l=new DataView(o.buffer,o.byteOffset,o.byteLength);let c;return"bigint"==typeof(s=1===o[0]?Ti(o.subarray(4,12)):l.getUint32(4))?c=s/Si.BigInt(a):"number"!=typeof s||isNaN(s)||(c=s/a),c<Number.MAX_SAFE_INTEGER&&(c=Number(c)),c<t&&(t=c),t}),1/0);return"bigint"==typeof i||isFinite(i)?i:0},Vt=function(e){var t=0===e[0]?12:20;return gi(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])},Ht=function(e){var t=vi(e,["moov","trak"]),i=[];return t.forEach((function(e){var t,s,n={},r=vi(e,["tkhd"])[0];r&&(s=(t=new DataView(r.buffer,r.byteOffset,r.byteLength)).getUint8(0),n.id=0===s?t.getUint32(12):t.getUint32(20));var a=vi(e,["mdia","hdlr"])[0];if(a){var o=_i(a.subarray(8,12));n.type="vide"===o?"video":"soun"===o?"audio":o}var l=vi(e,["mdia","minf","stbl","stsd"])[0];if(l){var c=l.subarray(8);n.codec=_i(c.subarray(4,8));var u,h=vi(c,[n.codec])[0];h&&(/^[asm]vc[1-9]$/i.test(n.codec)?(u=h.subarray(78),"avcC"===_i(u.subarray(4,8))&&u.length>11?(n.codec+=".",n.codec+=yi(u[9]),n.codec+=yi(u[10]),n.codec+=yi(u[11])):n.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(n.codec)?(u=h.subarray(28),"esds"===_i(u.subarray(4,8))&&u.length>20&&0!==u[19]?(n.codec+="."+yi(u[19]),n.codec+="."+yi(u[20]>>>2&63).replace(/^0/,"")):n.codec="mp4a.40.2"):n.codec=n.codec.toLowerCase())}var d=vi(e,["mdia","mdhd"])[0];d&&(n.timescale=Vt(d)),i.push(n)})),i};var Ei=$t,Ci=Ht,xi=function(e,t=0){return vi(e,["emsg"]).map((e=>{var i=bi.parseEmsgBox(new Uint8Array(e)),s=wi(i.message_data);return{cueTime:bi.scaleTime(i.presentation_time,i.timescale,i.presentation_time_delta,t),duration:bi.scaleTime(i.event_duration,i.timescale),frames:s}}))},ki=Ae,Ai=function(e){var t=31&e[1];return(t<<=8)|e[2]},Ii=function(e){return!!(64&e[1])},Pi=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},Oi=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}},Li={parseType:function(e,t){var i=Ai(e);return 0===i?"pat":i===t?"pmt":t?"pes":null},parsePat:function(e){var t=Ii(e),i=4+Pi(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},parsePmt:function(e){var t={},i=Ii(e),s=4+Pi(e);if(i&&(s+=e[s]+1),1&e[s+5]){var n;n=3+((15&e[s+1])<<8|e[s+2])-4;for(var r=12+((15&e[s+10])<<8|e[s+11]);r<n;){var a=s+r;t[(31&e[a+1])<<8|e[a+2]]=e[a],r+=5+((15&e[a+3])<<8|e[a+4])}return t}},parsePayloadUnitStartIndicator:Ii,parsePesType:function(e,t){switch(t[Ai(e)]){case ki.H264_STREAM_TYPE:return"video";case ki.ADTS_STREAM_TYPE:return"audio";case ki.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(e){if(!Ii(e))return null;var t=4+Pi(e);if(t>=e.byteLength)return null;var i,s=null;return 192&(i=e[t+7])&&((s={}).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,s.pts*=4,s.pts+=(6&e[t+13])>>>1,s.dts=s.pts,64&i&&(s.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,s.dts*=4,s.dts+=(6&e[t+18])>>>1)),s},videoPacketContainsKeyFrame:function(e){for(var t=4+Pi(e),i=e.subarray(t),s=0,n=0,r=!1;n<i.byteLength-3;n++)if(1===i[n+2]){s=n+5;break}for(;s<i.byteLength;)switch(i[s]){case 0:if(0!==i[s-1]){s+=2;break}if(0!==i[s-2]){s++;break}n+3!==s-2&&"slice_layer_without_partitioning_rbsp_idr"===Oi(31&i[n+3])&&(r=!0);do{s++}while(1!==i[s]&&s<i.length);n=s-2,s+=3;break;case 1:if(0!==i[s-1]||0!==i[s-2]){s+=3;break}"slice_layer_without_partitioning_rbsp_idr"===Oi(31&i[n+3])&&(r=!0),n=s-2,s+=3;break;default:s+=3}return i=i.subarray(n),s-=n,n=0,i&&i.byteLength>3&&"slice_layer_without_partitioning_rbsp_idr"===Oi(31&i[n+3])&&(r=!0),r}},Di=Ae,Ri=Re.handleRollover,Ni={};Ni.ts=Li,Ni.aac=yt;var Mi=le.ONE_SECOND_IN_TS,ji=188,Ui=71,Bi=function(e,t,i){for(var s,n,r,a,o=0,l=ji,c=!1;l<=e.byteLength;)if(e[o]!==Ui||e[l]!==Ui&&l!==e.byteLength)o++,l++;else{if(s=e.subarray(o,l),"pes"===Ni.ts.parseType(s,t.pid)&&(n=Ni.ts.parsePesType(s,t.table),r=Ni.ts.parsePayloadUnitStartIndicator(s),"audio"===n&&r&&(a=Ni.ts.parsePesTime(s))&&(a.type="audio",i.audio.push(a),c=!0)),c)break;o+=ji,l+=ji}for(o=(l=e.byteLength)-ji,c=!1;o>=0;)if(e[o]!==Ui||e[l]!==Ui&&l!==e.byteLength)o--,l--;else{if(s=e.subarray(o,l),"pes"===Ni.ts.parseType(s,t.pid)&&(n=Ni.ts.parsePesType(s,t.table),r=Ni.ts.parsePayloadUnitStartIndicator(s),"audio"===n&&r&&(a=Ni.ts.parsePesTime(s))&&(a.type="audio",i.audio.push(a),c=!0)),c)break;o-=ji,l-=ji}},Fi=function(e,t,i){for(var s,n,r,a,o,l,c,u=0,h=ji,d=!1,p={data:[],size:0};h<e.byteLength;)if(e[u]!==Ui||e[h]!==Ui)u++,h++;else{if(s=e.subarray(u,h),"pes"===Ni.ts.parseType(s,t.pid)&&(n=Ni.ts.parsePesType(s,t.table),r=Ni.ts.parsePayloadUnitStartIndicator(s),"video"===n&&(r&&!d&&(a=Ni.ts.parsePesTime(s))&&(a.type="video",i.video.push(a),d=!0),!i.firstKeyFrame))){if(r&&0!==p.size){for(o=new Uint8Array(p.size),l=0;p.data.length;)c=p.data.shift(),o.set(c,l),l+=c.byteLength;if(Ni.ts.videoPacketContainsKeyFrame(o)){var f=Ni.ts.parsePesTime(o);f?(i.firstKeyFrame=f,i.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(s),p.size+=s.byteLength}if(d&&i.firstKeyFrame)break;u+=ji,h+=ji}for(u=(h=e.byteLength)-ji,d=!1;u>=0;)if(e[u]!==Ui||e[h]!==Ui)u--,h--;else{if(s=e.subarray(u,h),"pes"===Ni.ts.parseType(s,t.pid)&&(n=Ni.ts.parsePesType(s,t.table),r=Ni.ts.parsePayloadUnitStartIndicator(s),"video"===n&&r&&(a=Ni.ts.parsePesTime(s))&&(a.type="video",i.video.push(a),d=!0)),d)break;u-=ji,h-=ji}},qi=function(e,t){var i;return i=Ni.aac.isLikelyAacData(e)?function(e){for(var t,i=!1,s=0,n=null,r=null,a=0,o=0;e.length-o>=3;){switch(Ni.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10){i=!0;break}if((a=Ni.aac.parseId3TagSize(e,o))>e.length){i=!0;break}null===r&&(t=e.subarray(o,o+a),r=Ni.aac.parseAacTimestamp(t)),o+=a;break;case"audio":if(e.length-o<7){i=!0;break}if((a=Ni.aac.parseAdtsSize(e,o))>e.length){i=!0;break}null===n&&(t=e.subarray(o,o+a),n=Ni.aac.parseSampleRate(t)),s++,o+=a;break;default:o++}if(i)return null}if(null===n||null===r)return null;var l=Mi/n;return{audio:[{type:"audio",dts:r,pts:r},{type:"audio",dts:r+1024*s*l,pts:r+1024*s*l}]}}(e):function(e){var t={pid:null,table:null},i={};for(var s in function(e,t){for(var i,s=0,n=ji;n<e.byteLength;)if(e[s]!==Ui||e[n]!==Ui)s++,n++;else{switch(i=e.subarray(s,n),Ni.ts.parseType(i,t.pid)){case"pat":t.pid=Ni.ts.parsePat(i);break;case"pmt":var r=Ni.ts.parsePmt(i);t.table=t.table||{},Object.keys(r).forEach((function(e){t.table[e]=r[e]}))}s+=ji,n+=ji}}(e,t),t.table)if(t.table.hasOwnProperty(s))switch(t.table[s]){case Di.H264_STREAM_TYPE:i.video=[],Fi(e,t,i),0===i.video.length&&delete i.video;break;case Di.ADTS_STREAM_TYPE:i.audio=[],Bi(e,t,i),0===i.audio.length&&delete i.audio}return i}(e),i&&(i.audio||i.video)?(function(e,t){if(e.audio&&e.audio.length){var i=t;(void 0===i||isNaN(i))&&(i=e.audio[0].dts),e.audio.forEach((function(e){e.dts=Ri(e.dts,i),e.pts=Ri(e.pts,i),e.dtsTime=e.dts/Mi,e.ptsTime=e.pts/Mi}))}if(e.video&&e.video.length){var s=t;if((void 0===s||isNaN(s))&&(s=e.video[0].dts),e.video.forEach((function(e){e.dts=Ri(e.dts,s),e.pts=Ri(e.pts,s),e.dtsTime=e.dts/Mi,e.ptsTime=e.pts/Mi})),e.firstKeyFrame){var n=e.firstKeyFrame;n.dts=Ri(n.dts,s),n.pts=Ri(n.pts,s),n.dtsTime=n.dts/Mi,n.ptsTime=n.pts/Mi}}}(i,t),i):null};class $i{constructor(e,t){this.options=t||{},this.self=e,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new zt.Transmuxer(this.options),function(e,t){t.on("data",(function(t){const i=t.initSegment;t.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength};const s=t.data;t.data=s.buffer,e.postMessage({action:"data",segment:t,byteOffset:s.byteOffset,byteLength:s.byteLength},[t.data])})),t.on("done",(function(t){e.postMessage({action:"done"})})),t.on("gopInfo",(function(t){e.postMessage({action:"gopInfo",gopInfo:t})})),t.on("videoSegmentTimingInfo",(function(t){const i={start:{decode:le.videoTsToSeconds(t.start.dts),presentation:le.videoTsToSeconds(t.start.pts)},end:{decode:le.videoTsToSeconds(t.end.dts),presentation:le.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:le.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=le.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:i})})),t.on("audioSegmentTimingInfo",(function(t){const i={start:{decode:le.videoTsToSeconds(t.start.dts),presentation:le.videoTsToSeconds(t.start.pts)},end:{decode:le.videoTsToSeconds(t.end.dts),presentation:le.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:le.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=le.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:i})})),t.on("id3Frame",(function(t){e.postMessage({action:"id3Frame",id3Frame:t})})),t.on("caption",(function(t){e.postMessage({action:"caption",caption:t})})),t.on("trackinfo",(function(t){e.postMessage({action:"trackinfo",trackInfo:t})})),t.on("audioTimingInfo",(function(t){e.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:le.videoTsToSeconds(t.start),end:le.videoTsToSeconds(t.end)}})})),t.on("videoTimingInfo",(function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:le.videoTsToSeconds(t.start),end:le.videoTsToSeconds(t.end)}})})),t.on("log",(function(t){e.postMessage({action:"log",log:t})}))}(this.self,this.transmuxer)}pushMp4Captions(e){this.captionParser||(this.captionParser=new hi,this.captionParser.init());const t=new Uint8Array(e.data,e.byteOffset,e.byteLength),i=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:i&&i.captions||[],logs:i&&i.logs||[],data:t.buffer},[t.buffer])}probeMp4StartTime({timescales:e,data:t}){const i=Ei(e,t);this.self.postMessage({action:"probeMp4StartTime",startTime:i,data:t},[t.buffer])}probeMp4Tracks({data:e}){const t=Ci(e);this.self.postMessage({action:"probeMp4Tracks",tracks:t,data:e},[e.buffer])}probeEmsgID3({data:e,offset:t}){const i=xi(e,t);this.self.postMessage({action:"probeEmsgID3",id3Frames:i,emsgData:e},[e.buffer])}probeTs({data:e,baseStartTime:t}){const i="number"!=typeof t||isNaN(t)?void 0:t*le.ONE_SECOND_IN_TS,s=qi(e,i);let n=null;s&&(n={hasVideo:s.video&&2===s.video.length||!1,hasAudio:s.audio&&2===s.audio.length||!1},n.hasVideo&&(n.videoStart=s.video[0].ptsTime),n.hasAudio&&(n.audioStart=s.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:n,data:e},[e.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(e){const t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)}reset(){this.transmuxer.reset()}setTimestampOffset(e){const t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(le.secondsToVideoTs(t)))}setAudioAppendStart(e){this.transmuxer.setAudioAppendStart(Math.ceil(le.secondsToVideoTs(e.appendStart)))}setRemux(e){this.transmuxer.setRemux(e.remux)}flush(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())}}self.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new $i(self,e.data.options):(this.messageHandlers||(this.messageHandlers=new $i(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}})));var $o=Uo(qo);const Ho=e=>{const{transmuxer:t,bytes:i,audioAppendStart:s,gopsToAlignWith:n,remux:r,onData:a,onTrackInfo:o,onAudioTimingInfo:l,onVideoTimingInfo:c,onVideoSegmentTimingInfo:u,onAudioSegmentTimingInfo:h,onId3:d,onCaptions:p,onDone:f,onEndedTimeline:m,onTransmuxerLog:g,isEndOfTimeline:y}=e,v={buffer:[]};let _=y;if(t.onmessage=i=>{t.currentTransmux===e&&("data"===i.data.action&&((e,t,i)=>{const{type:s,initSegment:n,captions:r,captionStreams:a,metadata:o,videoFrameDtsTime:l,videoFramePtsTime:c}=e.data.segment;t.buffer.push({captions:r,captionStreams:a,metadata:o});const u=e.data.segment.boxes||{data:e.data.segment.data},h={type:s,data:new Uint8Array(u.data,u.data.byteOffset,u.data.byteLength),initSegment:new Uint8Array(n.data,n.byteOffset,n.byteLength)};void 0!==l&&(h.videoFrameDtsTime=l),void 0!==c&&(h.videoFramePtsTime=c),i(h)})(i,v,a),"trackinfo"===i.data.action&&o(i.data.trackInfo),"gopInfo"===i.data.action&&((e,t)=>{t.gopInfo=e.data.gopInfo})(i,v),"audioTimingInfo"===i.data.action&&l(i.data.audioTimingInfo),"videoTimingInfo"===i.data.action&&c(i.data.videoTimingInfo),"videoSegmentTimingInfo"===i.data.action&&u(i.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===i.data.action&&h(i.data.audioSegmentTimingInfo),"id3Frame"===i.data.action&&d([i.data.id3Frame],i.data.id3Frame.dispatchType),"caption"===i.data.action&&p(i.data.caption),"endedtimeline"===i.data.action&&(_=!1,m()),"log"===i.data.action&&g(i.data.log),"transmuxed"===i.data.type&&(_||(t.onmessage=null,(({transmuxedData:e,callback:t})=>{e.buffer=[],t(e)})({transmuxedData:v,callback:f}),Vo(t))))},s&&t.postMessage({action:"setAudioAppendStart",appendStart:s}),Array.isArray(n)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:n}),void 0!==r&&t.postMessage({action:"setRemux",remux:r}),i.byteLength){const e=i instanceof ArrayBuffer?i:i.buffer,s=i instanceof ArrayBuffer?0:i.byteOffset;t.postMessage({action:"push",data:e,byteOffset:s,byteLength:i.byteLength},[e])}y&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},Vo=e=>{e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():Ho(e.currentTransmux))},zo=(e,t)=>{e.postMessage({action:t}),Vo(e)};var Wo=e=>{((e,t)=>{if(!t.currentTransmux)return t.currentTransmux=e,void zo(t,e);t.transmuxQueue.push(zo.bind(null,t,e))})("reset",e)};const Go=function(e){const t=e.transmuxer,i=e.endAction||e.action,s=e.callback,n=m({},e,{endAction:null,transmuxer:null,callback:null}),r=n=>{n.data.action===i&&(t.removeEventListener("message",r),n.data.data&&(n.data.data=new Uint8Array(n.data.data,e.byteOffset||0,e.byteLength||n.data.data.byteLength),e.data&&(e.data=n.data.data)),s(n.data))};if(t.addEventListener("message",r),e.data){const i=e.data instanceof ArrayBuffer;n.byteOffset=i?0:e.data.byteOffset,n.byteLength=e.data.byteLength;const s=[i?e.data:e.data.buffer];t.postMessage(n,s)}else t.postMessage(n)},Xo=-101,Yo=-102,Ko=e=>{e.forEach((e=>{e.abort()}))},Qo=(e,t)=>t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:Xo,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:Yo,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:2,xhr:t}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:2,xhr:t}:null,Jo=(e,t,i)=>(s,n)=>{const r=n.response,a=Qo(s,n);if(a)return i(a,e);if(16!==r.byteLength)return i({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:2,xhr:n},e);const o=new DataView(r),l=new Uint32Array([o.getUint32(0),o.getUint32(4),o.getUint32(8),o.getUint32(12)]);for(let e=0;e<t.length;e++)t[e].bytes=l;return i(null,e)},Zo=(e,t)=>{const i=pt(e.map.bytes);if("mp4"!==i){const s=e.map.resolvedUri||e.map.uri,n=i||"unknown";return t({internal:!0,message:`Found unsupported ${n} container for initialization segment at URL: ${s}`,code:2,metadata:{errorType:va.Error.UnsupportedMediaInitialization,mediaType:n}})}Go({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:({tracks:i,data:s})=>(e.map.bytes=s,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))})),t(null))})},el=({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:h,onTransmuxerLog:d})=>{const p=e.map&&e.map.tracks||{},f=Boolean(p.audio&&p.video);let m=s.bind(null,e,"audio","start");const g=s.bind(null,e,"audio","end");let y=s.bind(null,e,"video","start");const v=s.bind(null,e,"video","end");Go({action:"probeTs",transmuxer:e.transmuxer,data:t,baseStartTime:e.baseStartTime,callback:s=>{e.bytes=t=s.data;const p=s.result;p&&(i(e,{hasAudio:p.hasAudio,hasVideo:p.hasVideo,isMuxed:f}),i=null),(e=>{if(!e.transmuxer.currentTransmux)return e.transmuxer.currentTransmux=e,void Ho(e);e.transmuxer.transmuxQueue.push(e)})({bytes:t,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,remux:f,onData:t=>{t.type="combined"===t.type?"video":t.type,u(e,t)},onTrackInfo:t=>{i&&(f&&(t.isMuxed=!0),i(e,t))},onAudioTimingInfo:e=>{m&&void 0!==e.start&&(m(e.start),m=null),g&&void 0!==e.end&&g(e.end)},onVideoTimingInfo:e=>{y&&void 0!==e.start&&(y(e.start),y=null),v&&void 0!==e.end&&v(e.end)},onVideoSegmentTimingInfo:e=>{n(e)},onAudioSegmentTimingInfo:e=>{r(e)},onId3:(t,i)=>{a(e,t,i)},onCaptions:t=>{o(e,[t])},isEndOfTimeline:l,onEndedTimeline:()=>{c()},onTransmuxerLog:d,onDone:t=>{h&&(t.type="combined"===t.type?"video":t.type,h(null,e,t))}})}})},tl=({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:h,onTransmuxerLog:d})=>{let p=new Uint8Array(t);if(function(e){return Qe(e,["moof"]).length>0}(p)){e.isFmp4=!0;const{tracks:n}=e.map,r={isFmp4:!0,hasVideo:!!n.video,hasAudio:!!n.audio};n.audio&&n.audio.codec&&"enca"!==n.audio.codec&&(r.audioCodec=n.audio.codec),n.video&&n.video.codec&&"encv"!==n.video.codec&&(r.videoCodec=n.video.codec),n.video&&n.audio&&(r.isMuxed=!0),i(e,r);const l=(t,i)=>{u(e,{data:p,type:r.hasAudio&&!r.isMuxed?"audio":"video"}),i&&i.length&&a(e,i),t&&t.length&&o(e,t),h(null,e,{})};Go({action:"probeMp4StartTime",timescales:e.map.timescales,data:p,transmuxer:e.transmuxer,callback:({data:i,startTime:a})=>{t=i.buffer,e.bytes=p=i,r.hasAudio&&!r.isMuxed&&s(e,"audio","start",a),r.hasVideo&&s(e,"video","start",a),Go({action:"probeEmsgID3",data:p,transmuxer:e.transmuxer,offset:a,callback:({emsgData:i,id3Frames:s})=>{t=i.buffer,e.bytes=p=i,n.video&&i.byteLength&&e.transmuxer?Go({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:e.transmuxer,data:p,timescales:e.map.timescales,trackIds:[n.video.id],callback:i=>{t=i.data.buffer,e.bytes=p=i.data,i.logs.forEach((function(e){d(xa(e,{stream:"mp4CaptionParser"}))})),l(i.captions,s)}}):l(void 0,s)}})}})}else if(e.transmuxer){if(void 0===e.container&&(e.container=pt(p)),"ts"!==e.container&&"aac"!==e.container)return i(e,{hasAudio:!1,hasVideo:!1}),void h(null,e,{});el({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:h,onTransmuxerLog:d})}else h(null,e,{})},il=function({id:e,key:t,encryptedBytes:i,decryptionWorker:s},n){const r=t=>{if(t.data.source===e){s.removeEventListener("message",r);const e=t.data.decrypted;n(new Uint8Array(e.bytes,e.byteOffset,e.byteLength))}};let a;s.addEventListener("message",r),a=t.bytes.slice?t.bytes.slice():new Uint32Array(Array.prototype.slice.call(t.bytes)),s.postMessage(wo({source:e,encrypted:i,key:a,iv:t.iv}),[i.buffer,a.buffer])},sl=({xhr:e,xhrOptions:t,decryptionWorker:i,segment:s,abortFn:n,progressFn:r,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:u,captionsFn:h,isEndOfTimeline:d,endedTimelineFn:p,dataFn:f,doneFn:m,onTransmuxerLog:g})=>{const y=[],v=(({activeXhrs:e,decryptionWorker:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:h,onTransmuxerLog:d})=>{let p=0,f=!1;return(m,g)=>{if(!f){if(m)return f=!0,Ko(e),h(m,g);if(p+=1,p===e.length){const p=function(){if(g.encryptedBytes)return(({decryptionWorker:e,segment:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:h,onTransmuxerLog:d})=>{il({id:t.requestId,key:t.key,encryptedBytes:t.encryptedBytes,decryptionWorker:e},(e=>{t.bytes=e,tl({segment:t,bytes:t.bytes,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:h,onTransmuxerLog:d})}))})({decryptionWorker:t,segment:g,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:h,onTransmuxerLog:d});tl({segment:g,bytes:g.bytes,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:h,onTransmuxerLog:d})};if(g.endOfAllRequests=Date.now(),g.map&&g.map.encryptedBytes&&!g.map.bytes)return il({decryptionWorker:t,id:g.requestId+"-init",encryptedBytes:g.map.encryptedBytes,key:g.map.key},(t=>{g.map.bytes=t,Zo(g,(t=>{if(t)return Ko(e),h(t,g);p()}))}));p()}}}})({activeXhrs:y,decryptionWorker:i,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:u,captionsFn:h,isEndOfTimeline:d,endedTimelineFn:p,dataFn:f,doneFn:m,onTransmuxerLog:g});if(s.key&&!s.key.bytes){const i=[s.key];s.map&&!s.map.bytes&&s.map.key&&s.map.key.resolvedUri===s.key.resolvedUri&&i.push(s.map.key);const n=e(xa(t,{uri:s.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),Jo(s,i,v));y.push(n)}if(s.map&&!s.map.bytes){if(s.map.key&&(!s.key||s.key.resolvedUri!==s.map.key.resolvedUri)){const i=e(xa(t,{uri:s.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),Jo(s,[s.map.key],v));y.push(i)}const i=xa(t,{uri:s.map.resolvedUri,responseType:"arraybuffer",headers:_o(s.map),requestType:"segment-media-initialization"}),n=(({segment:e,finishProcessingFn:t})=>(i,s)=>{const n=Qo(i,s);if(n)return t(n,e);const r=new Uint8Array(s.response);if(e.map.key)return e.map.encryptedBytes=r,t(null,e);e.map.bytes=r,Zo(e,(function(i){if(i)return i.xhr=s,i.status=s.status,t(i,e);t(null,e)}))})({segment:s,finishProcessingFn:v}),r=e(i,n);y.push(r)}const _=xa(t,{uri:s.part&&s.part.resolvedUri||s.resolvedUri,responseType:"arraybuffer",headers:_o(s),requestType:"segment"}),b=e(_,(({segment:e,finishProcessingFn:t,responseType:i})=>(s,n)=>{const r=Qo(s,n);if(r)return t(r,e);const a="arraybuffer"!==i&&n.responseText?(e=>{const t=new Uint8Array(new ArrayBuffer(e.length));for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t.buffer})(n.responseText.substring(e.lastReachedChar||0)):n.response;return e.stats=(e=>({bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}))(n),e.key?e.encryptedBytes=new Uint8Array(a):e.bytes=new Uint8Array(a),t(null,e)})({segment:s,finishProcessingFn:v,responseType:_.responseType}));b.addEventListener("progress",(({segment:e,progressFn:t,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u})=>i=>{if(!i.target.aborted)return e.stats=xa(e.stats,(e=>{const t=e.target,i={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-t.requestTime||0};return i.bytesReceived=e.loaded,i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3),i})(i)),!e.stats.firstBytesReceivedAt&&e.stats.bytesReceived&&(e.stats.firstBytesReceivedAt=Date.now()),t(i,e)})({segment:s,progressFn:r,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:u,captionsFn:h,isEndOfTimeline:d,endedTimelineFn:p,dataFn:f})),y.push(b);const T={};return y.forEach((e=>{e.addEventListener("loadend",(({loadendState:e,abortFn:t})=>i=>{i.target.aborted&&t&&!e.calledAbortFn&&(t(),e.calledAbortFn=!0)})({loadendState:T,abortFn:n}))})),()=>Ko(y)},nl=Ca("CodecUtils"),rl=(e,t)=>{const i=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&i.AUDIO&&e.mediaGroups.AUDIO[i.AUDIO]},al=function(e){const t={};return e.forEach((({mediaType:e,type:i,details:s})=>{t[e]=t[e]||[],t[e].push(R(`${i}${s}`))})),Object.keys(t).forEach((function(e){if(t[e].length>1)return nl(`multiple ${e} codecs found as attributes: ${t[e].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),void(t[e]=null);t[e]=t[e][0]})),t},ol=function(e){let t=0;return e.audio&&t++,e.video&&t++,t},ll=function(e,t){const i=t.attributes||{},s=al(function(e){const t=e.attributes||{};if(t.CODECS)return N(t.CODECS)}(t)||[]);if(rl(e,t)&&!s.audio&&!((e,t)=>{if(!rl(e,t))return!0;const i=t.attributes||{},s=e.mediaGroups.AUDIO[i.AUDIO];for(const e in s)if(!s[e].uri&&!s[e].playlists)return!0;return!1})(e,t)){const t=al(function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var i=e.mediaGroups.AUDIO[t];if(!i)return null;for(var s in i){var n=i[s];if(n.default&&n.playlists)return N(n.playlists[0].attributes.CODECS)}return null}(e,i.AUDIO)||[]);t.audio&&(s.audio=t.audio)}return s},cl=Ca("PlaylistSelector"),ul=function(e){if(!e||!e.playlist)return;const t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})},hl=function(e,t){if(!e)return"";const i=n().getComputedStyle(e);return i?i[t]:""},dl=function(e,t){const i=e.slice();e.sort((function(e,s){const n=t(e,s);return 0===n?i.indexOf(e)-i.indexOf(s):n}))},pl=function(e,t){let i,s;return e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||n().Number.MAX_VALUE,t.attributes.BANDWIDTH&&(s=t.attributes.BANDWIDTH),s=s||n().Number.MAX_VALUE,i-s};let fl=function(e,t,i,s,r,a){if(!e)return;const o={bandwidth:t,width:i,height:s,limitRenditionByPlayerDimensions:r};let l=e.playlists;eo.isAudioOnly(e)&&(l=a.getAudioTrackPlaylists_(),o.audioOnly=!0);let c=l.map((e=>{let t;const i=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,s=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return t=e.attributes&&e.attributes.BANDWIDTH,t=t||n().Number.MAX_VALUE,{bandwidth:t,width:i,height:s,playlist:e}}));dl(c,((e,t)=>e.bandwidth-t.bandwidth)),c=c.filter((e=>!eo.isIncompatible(e.playlist)));let u=c.filter((e=>eo.isEnabled(e.playlist)));u.length||(u=c.filter((e=>!eo.isDisabled(e.playlist))));const h=u.filter((e=>e.bandwidth*Mo.BANDWIDTH_VARIANCE<t));let d=h[h.length-1];const p=h.filter((e=>e.bandwidth===d.bandwidth))[0];if(!1===r){const e=p||u[0]||c[0];if(e&&e.playlist){let t="sortedPlaylistReps";return p&&(t="bandwidthBestRep"),u[0]&&(t="enabledPlaylistReps"),cl(`choosing ${ul(e)} using ${t} with options`,o),e.playlist}return cl("could not choose a playlist with options",o),null}const f=h.filter((e=>e.width&&e.height));dl(f,((e,t)=>e.width-t.width));const m=f.filter((e=>e.width===i&&e.height===s));d=m[m.length-1];const g=m.filter((e=>e.bandwidth===d.bandwidth))[0];let y,v,_,b;if(g||(y=f.filter((e=>e.width>i||e.height>s)),v=y.filter((e=>e.width===y[0].width&&e.height===y[0].height)),d=v[v.length-1],_=v.filter((e=>e.bandwidth===d.bandwidth))[0]),a.leastPixelDiffSelector){const e=f.map((e=>(e.pixelDiff=Math.abs(e.width-i)+Math.abs(e.height-s),e)));dl(e,((e,t)=>e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff)),b=e[0]}const T=b||_||g||p||u[0]||c[0];if(T&&T.playlist){let e="sortedPlaylistReps";return b?e="leastPixelDiffRep":_?e="resolutionPlusOneRep":g?e="resolutionBestRep":p?e="bandwidthBestRep":u[0]&&(e="enabledPlaylistReps"),cl(`choosing ${ul(T)} using ${e} with options`,o),T.playlist}return cl("could not choose a playlist with options",o),null};const ml=function(){let e=this.useDevicePixelRatio&&n().devicePixelRatio||1;return isNaN(this.customPixelRatio)||(e=this.customPixelRatio),fl(this.playlists.main,this.systemBandwidth,parseInt(hl(this.tech_.el(),"width"),10)*e,parseInt(hl(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.playlistController_)};function gl(e){try{return new URL(e).pathname.split("/").slice(-2).join("/")}catch(e){return""}}const yl={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"},vl=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),_l=(e,t,i)=>{e.metadataTrack_||(e.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,va.browser.IS_ANY_SAFARI||(e.metadataTrack_.inBandMetadataTrackDispatchType=t))},bl=function(e,t,i){let s,n;if(i&&i.cues)for(s=i.cues.length;s--;)n=i.cues[s],n.startTime>=e&&n.endTime<=t&&i.removeCue(n)},Tl=e=>"number"==typeof e&&isFinite(e),Sl=1/60,wl=e=>{const{startOfSegment:t,duration:i,segment:s,part:n,playlist:{mediaSequence:r,id:a,segments:o=[]},mediaIndex:l,partIndex:c,timeline:u}=e,h=o.length-1;let d="mediaIndex/partIndex increment";e.getMediaInfoForTime?d=`getMediaInfoForTime (${e.getMediaInfoForTime})`:e.isSyncRequest&&(d="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(d+=` with independent ${e.independent}`);const p="number"==typeof c,f=e.segment.uri?"segment":"pre-segment",m=p?Fa({preloadSegment:s})-1:0;return`${f} [${r+l}/${r+h}]`+(p?` part [${c}/${m}]`:"")+` segment start/end [${s.start} => ${s.end}]`+(p?` part start/end [${n.start} => ${n.end}]`:"")+` startOfSegment [${t}]`+` duration [${i}]`+` timeline [${u}]`+` selected by [${d}]`+` playlist [${a}]`},El=e=>`${e}TimingInfo`,Cl=({timelineChangeController:e,currentTimeline:t,segmentTimeline:i,loaderType:s,audioDisabled:n})=>{if(t===i)return!1;if("audio"===s){const t=e.lastTimelineChange({type:"main"});return!t||t.to!==i}if("main"===s&&n){const t=e.pendingTimelineChange({type:"audio"});return!t||t.to!==i}return!1},xl=({segmentDuration:e,maxDuration:t})=>!!e&&Math.round(e)>t+Aa;class kl extends va.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if("function"!=typeof e.currentTime)throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",(()=>{this.isEndOfStream_()||(this.ended_=!1)})),this.fetchAtBuffer_=!1,this.logger_=Ca(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(e){e!==this.state_&&(this.logger_(`${this.state_} -> ${e}`),this.state_=e,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",(()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_()})),"main"===this.loaderType_&&this.timelineChangeController_.on("pendingtimelinechange",(()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_()})),"audio"===this.loaderType_&&this.timelineChangeController_.on("timelinechange",(()=>{this.hasEnoughInfoToLoad_()&&this.processLoadQueue_(),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}))}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return(e=>{const t=new $o;t.currentTransmux=null,t.transmuxQueue=[];const i=t.terminate;return t.terminate=()=>(t.currentTransmux=null,t.transmuxQueue.length=0,i.call(t)),t.postMessage({action:"init",options:e}),t})({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&n().clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,n().clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)}error(e){return void 0!==e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&Wo(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return ka();if("main"===this.loaderType_){const{hasAudio:t,hasVideo:i,isMuxed:s}=e;if(i&&t&&!this.audioDisabled_&&!s)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const i=Eo(e);let s=this.initSegments_[i];return t&&!s&&e.bytes&&(this.initSegments_[i]=s={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),s||e}segmentKey(e,t=!1){if(!e)return null;const i=Co(e);let s=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!s&&e.bytes&&(this.keyCache_[i]=s={resolvedUri:e.resolvedUri,bytes:e.bytes});const n={resolvedUri:(s||e).resolvedUri};return s&&(n.bytes=s.bytes),n}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),this.playlist_)return"INIT"===this.state&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY"))}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e)return;const i=this.playlist_,s=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));let n=null;if(i&&(i.id?n=i.id:i.uri&&(n=i.uri)),this.logger_(`playlist update [${n} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update:\ncurrentTime: ${this.currentTime_()}\nbufferedEnd: ${Na(this.buffered_())}\n`,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri)return null!==this.mediaIndex&&(e.endList||"number"!=typeof e.partTargetDuration?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");const r=e.mediaSequence-i.mediaSequence;if(this.logger_(`live window shift [${r}]`),null!==this.mediaIndex)if(this.mediaIndex-=r,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const e=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!e.parts||!e.parts.length||!e.parts[this.partIndex])){const e=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=e}}s&&(s.mediaIndex-=r,s.mediaIndex<0?(s.mediaIndex=null,s.partIndex=null):(s.mediaIndex>=0&&(s.segment=e.segments[s.mediaIndex]),s.partIndex>=0&&s.segment.parts&&(s.part=s.segment.parts[s.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e)}pause(){this.checkBufferTimeout_&&(n().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return null===this.checkBufferTimeout_}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&Wo(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,"hls"===this.sourceType_&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,i=(()=>{}),s=!1){if(t===1/0&&(t=this.duration_()),t<=e)return void this.logger_("skipping remove because end ${end} is <= start ${start}");if(!this.sourceUpdater_||!this.getMediaInfo_())return void this.logger_("skipping remove because no source updater or starting media info");let n=1;const r=()=>{n--,0===n&&i()};!s&&this.audioDisabled_||(n++,this.sourceUpdater_.removeAudio(e,t,r)),(s||"main"===this.loaderType_)&&(this.gopBuffer_=((e,t,i,s)=>{const n=Math.ceil((t-s)*ft.ONE_SECOND_IN_TS),r=Math.ceil((i-s)*ft.ONE_SECOND_IN_TS),a=e.slice();let o=e.length;for(;o--&&!(e[o].pts<=r););if(-1===o)return a;let l=o+1;for(;l--&&!(e[l].pts<=n););return l=Math.max(l,0),a.splice(l,o-l+1),a})(this.gopBuffer_,e,t,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(e,t,r));for(const i in this.inbandTextTracks_)bl(e,t,this.inbandTextTracks_[i]);bl(e,t,this.segmentMetadataTrack_),r()}monitorBuffer_(){this.checkBufferTimeout_&&n().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=n().setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&n().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=n().setTimeout(this.monitorBufferTick_.bind(this),500)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();e&&("number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,i=this.partIndex){if(!t||!this.mediaSource_)return!1;const s="number"==typeof e&&t.segments[e],n=e+1===t.segments.length,r=!s||!s.parts||i+1===s.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&n&&r}chooseNextRequest_(){const e=this.buffered_(),t=Na(e)||0,i=Ma(e,this.currentTime_()),s=!this.hasPlayed_()&&i>=1,n=i>=this.goalBufferLength_(),r=this.playlist_.segments;if(!r.length||s||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const a={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(a.isSyncRequest)a.mediaIndex=function(e,t,i){t=t||[];const s=[];let n=0;for(let r=0;r<t.length;r++){const a=t[r];if(e===a.timeline&&(s.push(r),n+=a.duration,n>i))return r}return 0===s.length?0:s[s.length-1]}(this.currentTimeline_,r,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${a.mediaIndex}`);else if(null!==this.mediaIndex){const e=r[this.mediaIndex],i="number"==typeof this.partIndex?this.partIndex:-1;a.startOfSegment=e.end?e.end:t,e.parts&&e.parts[i+1]?(a.mediaIndex=this.mediaIndex,a.partIndex=i+1):a.mediaIndex=this.mediaIndex+1}else{let e,i,s;const n=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch:\nFor TargetTime: ${n}.\nCurrentTime: ${this.currentTime_()}\nBufferedEnd: ${t}\nFetch At Buffer: ${this.fetchAtBuffer_}\n`,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const t=this.getSyncInfoFromMediaSequenceSync_(n);if(!t)return this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null;this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${t.start} --\x3e ${t.end})`),e=t.segmentIndex,i=t.partIndex,s=t.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const t=eo.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:n,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});e=t.segmentIndex,i=t.partIndex,s=t.startTime}a.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${n}`:`currentTime ${n}`,a.mediaIndex=e,a.startOfSegment=s,a.partIndex=i,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${a.mediaIndex} `)}const o=r[a.mediaIndex];let l=o&&"number"==typeof a.partIndex&&o.parts&&o.parts[a.partIndex];if(!o||"number"==typeof a.partIndex&&!l)return null;"number"!=typeof a.partIndex&&o.parts&&(a.partIndex=0,l=o.parts[0]);const c=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!i&&l&&!c&&!l.independent)if(0===a.partIndex){const e=r[a.mediaIndex-1],t=e.parts&&e.parts.length&&e.parts[e.parts.length-1];t&&t.independent&&(a.mediaIndex-=1,a.partIndex=e.parts.length-1,a.independent="previous segment")}else o.parts[a.partIndex-1].independent&&(a.partIndex-=1,a.independent="previous part");const u=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return a.mediaIndex>=r.length-1&&u&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,a.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(a))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);const i=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!i)return null;if(!i.isAppended)return i;const s=this.mediaSequenceSync_.getSyncInfoForTime(i.end);return s?(s.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),s):null}generateSegmentInfo_(e){const{independent:t,playlist:i,mediaIndex:s,startOfSegment:n,isSyncRequest:r,partIndex:a,forceTimestampOffset:o,getMediaInfoForTime:l}=e,c=i.segments[s],u="number"==typeof a&&c.parts[a],h={requestId:"segment-loader-"+Math.random(),uri:u&&u.resolvedUri||c.resolvedUri,mediaIndex:s,partIndex:u?a:null,isSyncRequest:r,startOfSegment:n,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:c.timeline,duration:u&&u.duration||c.duration,segment:c,part:u,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:l,independent:t},d=void 0!==o?o:this.isPendingTimestampOffset_;h.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:c.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:d});const p=Na(this.sourceUpdater_.audioBuffered());return"number"==typeof p&&(h.audioAppendStart=p-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(h.gopsToAlignWith=((e,t,i)=>{if(null==t||!e.length)return[];const s=Math.ceil((t-i+3)*ft.ONE_SECOND_IN_TS);let n;for(n=0;n<e.length&&!(e[n].pts>s);n++);return e.slice(n)})(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),h}timestampOffsetForSegment_(e){return(({segmentTimeline:e,currentTimeline:t,startOfSegment:i,buffered:s,overrideCheck:n})=>n||e!==t?e<t?i:s.length?s.end(s.length-1):i:null)(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)return;if(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),i=e.bandwidth,s=this.pendingSegment_.duration,n=eo.estimateSegmentRequestTime(s,i,this.playlist_,e.bytesReceived),r=function(e,t,i=1){return((e.length?e.end(e.length-1):0)-t)/i}(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=r)return;const a=function(e){const{main:t,currentTime:i,bandwidth:s,duration:n,segmentDuration:r,timeUntilRebuffer:a,currentTimeline:o,syncController:l}=e,c=t.playlists.filter((e=>!eo.isIncompatible(e)));let u=c.filter(eo.isEnabled);u.length||(u=c.filter((e=>!eo.isDisabled(e))));const h=u.filter(eo.hasAttribute.bind(null,"BANDWIDTH")).map((e=>{const t=l.getSyncPoint(e,n,o,i)?1:2;return{playlist:e,rebufferingImpact:eo.estimateSegmentRequestTime(r,s,e)*t-a}})),d=h.filter((e=>e.rebufferingImpact<=0));return dl(d,((e,t)=>pl(t.playlist,e.playlist))),d.length?d[0]:(dl(h,((e,t)=>e.rebufferingImpact-t.rebufferingImpact)),h[0]||null)}({main:this.vhs_.playlists.main,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:s,timeUntilRebuffer:r,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!a)return;const o=n-r-a.rebufferingImpact;let l=.5;r<=Aa&&(l=1),!a.playlist||a.playlist.uri===this.playlist_.uri||o<l||(this.bandwidth=a.playlist.attributes.BANDWIDTH*Mo.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${wl(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId)||this.trigger("progress")}handleTrackInfo_(e,t){this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||this.checkForIllegalMediaSwitch(t)||(t=t||{},function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;const i=Object.keys(e).sort(),s=Object.keys(t).sort();if(i.length!==s.length)return!1;for(let n=0;n<i.length;n++){const r=i[n];if(r!==s[n])return!1;if(e[r]!==t[r])return!1}return!0}(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),this.checkForAbort_(e.requestId)||(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()&&this.processCallQueue_()))}handleTimingInfo_(e,t,i,s){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const n=this.pendingSegment_,r=El(t);n[r]=n[r]||{},n[r][i]=s,this.logger_(`timinginfo: ${t} - ${i} - ${s}`),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(0===t.length)return void this.logger_("SegmentLoader received no captions from a caption event");if(!this.pendingSegment_.hasAppendedData_)return void this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));const i=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),s={};t.forEach((e=>{s[e.stream]=s[e.stream]||{startTime:1/0,captions:[],endTime:0};const t=s[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(s).forEach((e=>{const{startTime:t,endTime:r,captions:a}=s[e],o=this.inbandTextTracks_;this.logger_(`adding cues from ${t} -> ${r} for ${e}`),function(e,t,i){if(!e[i]){t.trigger({type:"usage",name:"vhs-608"});let s=i;/^cc708_/.test(i)&&(s="SERVICE"+i.split("_")[1]);const n=t.textTracks().getTrackById(s);if(n)e[i]=n;else{let n=i,r=i,a=!1;const o=(t.options_.vhs&&t.options_.vhs.captionServices||{})[s];o&&(n=o.label,r=o.language,a=o.default),e[i]=t.addRemoteTextTrack({kind:"captions",id:s,default:a,label:n,language:r},!1).track}}}(o,this.vhs_.tech_,e),bl(t,r,o[e]),function({inbandTextTracks:e,captionArray:t,timestampOffset:i}){if(!t)return;const s=n().WebKitDataCue||n().VTTCue;t.forEach((t=>{const n=t.stream;t.content?t.content.forEach((r=>{const a=new s(t.startTime+i,t.endTime+i,r.text);a.line=r.line,a.align="left",a.position=r.position,a.positionAlign="line-left",e[n].addCue(a)})):e[n].addCue(new s(t.startTime+i,t.endTime+i,t.text))}))}({captionArray:a,inbandTextTracks:o,timestampOffset:i})})),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,i){this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||(this.pendingSegment_.hasAppendedData_?this.addMetadataToTextTrack(i,t,this.duration_()):this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i)))}processMetadataQueue_(){this.metadataQueue_.id3.forEach((e=>e())),this.metadataQueue_.caption.forEach((e=>e())),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach((e=>e()))}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach((e=>e()))}hasEnoughInfoToLoad_(){if("audio"!==this.loaderType_)return!0;const e=this.pendingSegment_;return!(!e||this.getCurrentMediaInfo_()&&Cl({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready())return!1;if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:i,hasVideo:s,isMuxed:n}=t;return!(s&&!e.videoTimingInfo||i&&!this.audioDisabled_&&!n&&!e.audioTimingInfo||Cl({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_())return void this.callQueue_.push(this.handleData_.bind(this,e,t));const i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.part||i.segment),"closed"!==this.mediaSource_.readyState){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),i.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[El(t.type)].start;else{const e=this.getCurrentMediaInfo_(),t="main"===this.loaderType_&&e&&e.hasVideo;let s;t&&(s=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:t,firstVideoFrameTimeForData:s,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:"main"===this.loaderType_});const e=this.chooseNextRequest_();if(e.mediaIndex!==i.mediaIndex||e.partIndex!==i.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,t)}}updateAppendInitSegmentStatus(e,t){"main"!==this.loaderType_||"number"!=typeof e.timestampOffset||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:i,playlist:s}){if(i){const e=Eo(i);if(this.activeInitSegmentId_===e)return null;t=this.initSegmentForMap(i,!0).bytes,this.activeInitSegmentId_=e}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=s,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i},s){const r=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();r.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Ra(r).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Ra(a).join(", "));const o=r.length?r.start(0):0,l=r.length?r.end(r.length-1):0,c=a.length?a.start(0):0,u=a.length?a.end(a.length-1):0;if(l-o<=1&&u-c<=1)return this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${i.byteLength}, audio buffer: ${Ra(r).join(", ")}, video buffer: ${Ra(a).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0,metadata:{errorType:va.Error.SegmentExceedsSourceBufferQuota}}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:i}));const h=this.currentTime_()-1;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${h}`),this.remove(0,h,(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=n().setTimeout((()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()}),1e3)}),!0)}handleAppendError_({segmentInfo:e,type:t,bytes:i},s){s&&(22!==s.code?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",s),this.error({message:`${t} append of ${i.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:va.Error.SegmentAppendError}}),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i}))}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:i,data:s,bytes:n}){if(!n){const e=[s];let t=s.byteLength;i&&(e.unshift(i),t+=i.byteLength),n=(e=>{let t,i=0;return e.bytes&&(t=new Uint8Array(e.bytes),e.segments.forEach((e=>{t.set(e,i),i+=e.byteLength}))),t})({bytes:t,segments:e})}this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:n}))}handleSegmentTimingInfo_(e,t,i){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const s=this.pendingSegment_.segment,n=`${e}TimingInfo`;s[n]||(s[n]={}),s[n].transmuxerPrependedSeconds=i.prependedContentDuration||0,s[n].transmuxedPresentationStart=i.start.presentation,s[n].transmuxedDecodeStart=i.start.decode,s[n].transmuxedPresentationEnd=i.end.presentation,s[n].transmuxedDecodeEnd=i.end.decode,s[n].baseMediaDecodeTime=i.baseMediaDecodeTime}appendData_(e,t){const{type:i,data:s}=t;if(!s||!s.byteLength)return;if("audio"===i&&this.audioDisabled_)return;const n=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:n,data:s})}loadSegment_(e){this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(e):this.loadQueue_.push((()=>{const t=m({},e,{forceTimestampOffset:!0});m(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)}))}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),i=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),s=null!==this.mediaIndex,n=e.timeline!==this.currentTimeline_&&e.timeline>0,r=i||s&&n;this.logger_(`Requesting\n${gl(e.uri)}\n${wl(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=sl({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:r,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:t,level:i,stream:s})=>{this.logger_(`${wl(e)} logged from transmuxer stream ${s} as a ${i}: ${t}`)}})}trimBackBuffer_(e){const t=((e,t,i)=>{let s=t-Mo.BACK_BUFFER_LENGTH;e.length&&(s=Math.max(s,e.start(0)));const n=t-i;return Math.min(n,s)})(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,i=e.part,s={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},n=e.playlist.segments[e.mediaIndex-1];if(n&&n.timeline===t.timeline&&(n.videoTimingInfo?s.baseStartTime=n.videoTimingInfo.transmuxedDecodeEnd:n.audioTimingInfo&&(s.baseStartTime=n.audioTimingInfo.transmuxedDecodeEnd)),t.key){const i=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);s.key=this.segmentKey(t.key),s.key.iv=i}return t.map&&(s.map=this.initSegmentForMap(t.map)),s}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){this.pendingSegment_.byteLength=t.bytesReceived,e<Sl?this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record 0.016666666666666666`):(this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime)}handleTimeout_(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")}segmentRequestFinished_(e,t,i){if(this.callQueue_.length)return void this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,i));if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return;if(t.requestId!==this.pendingSegment_.requestId)return;if(e){if(this.pendingSegment_=null,this.state="READY",e.code===Yo)return;return this.pause(),e.code===Xo?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error"))}const s=this.pendingSegment_;this.saveBandwidthRelatedStats_(s.duration,t.stats),s.endOfAllRequests=t.endOfAllRequests,i.gopInfo&&(this.gopBuffer_=((e,t,i)=>{if(!t.length)return e;if(i)return t.slice();const s=t[0].pts;let n=0;for(;n<e.length&&!(e[n].pts>=s);n++);return e.slice(0,n).concat(t)})(this.gopBuffer_,i.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(s)}setTimeMapping_(e){const t=this.syncController_.mappingForTimeline(e);null!==t&&(this.timeMapping_=t)}updateMediaSecondsLoaded_(e){"number"==typeof e.start&&"number"==typeof e.end?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration}shouldUpdateTransmuxerTimestampOffset_(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())}trueSegmentStart_({currentStart:e,playlist:t,mediaIndex:i,firstVideoFrameTimeForData:s,currentVideoTimestampOffset:n,useVideoTimingInfo:r,videoTimingInfo:a,audioTimingInfo:o}){if(void 0!==e)return e;if(!r)return o.start;const l=t.segments[i-1];return 0!==i&&l&&void 0!==l.start&&l.end===s+n?a.start:s}waitForAppendsToComplete_(e){const t=this.getCurrentMediaInfo_(e);if(!t)return this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0,metadata:{errorType:va.Error.SegmentUnsupportedMediaFormat}}),void this.trigger("error");const{hasAudio:i,hasVideo:s,isMuxed:n}=t,r="main"===this.loaderType_&&s,a=!this.audioDisabled_&&i&&!n;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);r&&e.waitingOnAppends++,a&&e.waitingOnAppends++,r&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),a&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=((e,t,i)=>"main"===e&&t&&i?i.hasAudio||i.hasVideo?t.hasVideo&&!i.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&&i.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,metadata:{errorType:va.Error.SegmentSwitchError}}),this.trigger("error"),!0)}updateSourceBufferTimestampOffset_(e){if(null===e.timestampOffset||"number"!=typeof e.timingInfo.start||e.changedTimestampOffset||"main"!==this.loaderType_)return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:i}){return this.useDtsForTimestampOffset_?e&&"number"==typeof e.transmuxedDecodeStart?e.transmuxedDecodeStart:t&&"number"==typeof t.transmuxedDecodeStart?t.transmuxedDecodeStart:i.start:i.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),i="main"===this.loaderType_&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;i&&(e.timingInfo.end="number"==typeof i.end?i.end:i.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());const e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});const t=((e,t)=>{if("hls"!==t)return null;const i=(e=>{let t=0;return["video","audio"].forEach((function(i){const s=e[`${i}TimingInfo`];if(!s)return;const{start:r,end:a}=s;let o;"bigint"==typeof r||"bigint"==typeof a?o=n().BigInt(a)-n().BigInt(r):"number"==typeof r&&"number"==typeof a&&(o=a-r),void 0!==o&&o>t&&(t=o)})),"bigint"==typeof t&&t<Number.MAX_SAFE_INTEGER&&(t=Number(t)),t})({audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo});if(!i)return null;const s=e.playlist.targetDuration,r=xl({segmentDuration:i,maxDuration:2*s}),a=xl({segmentDuration:i,maxDuration:s}),o=`Segment with index ${e.mediaIndex} from playlist ${e.playlist.id} has a duration of ${i} when the reported duration is ${e.duration} and the target duration is ${s}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return r||a?{severity:r?"warn":"info",message:o}:null})(e,this.sourceType_);if(t&&("warn"===t.severity?va.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_))return void this.logger_(`Throwing away un-appended sync request ${wl(e)}`);this.logger_(`Appended ${wl(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),"main"!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const i=e.segment,s=e.part,r=i.end&&this.currentTime_()-i.end>3*e.playlist.targetDuration,a=s&&s.end&&this.currentTime_()-s.end>3*e.playlist.partTargetDuration;if(r||a)return this.logger_(`bad ${r?"segment":"part"} ${wl(e)}`),void this.resetEverything();null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duration<Sl)return void this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record 0.016666666666666666`);const t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,s=Math.floor(e.byteLength/i*8*1e3);this.throughput.rate+=(s-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;const t=e.segment,i=t.start,s=t.end;if(!Tl(i)||!Tl(s))return;bl(i,s,this.segmentMetadataTrack_);const r=n().WebKitDataCue||n().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.uri,timeline:e.timeline,playlist:e.playlist.id,start:i,end:s},o=new r(i,s,JSON.stringify(a));o.value=a,this.segmentMetadataTrack_.addCue(o)}}function Al(){}const Il=function(e){return"string"!=typeof e?e:e.replace(/./,(e=>e.toUpperCase()))},Pl=["video","audio"],Ol=(e,t)=>{const i=t[`${e}Buffer`];return i&&i.updating||t.queuePending[e]},Ll=(e,t)=>{if(0===t.queue.length)return;let i=0,s=t.queue[i];if("mediaSource"!==s.type){if("mediaSource"!==e&&t.ready()&&"closed"!==t.mediaSource.readyState&&!Ol(e,t)){if(s.type!==e){if(i=((e,t)=>{for(let i=0;i<t.length;i++){const s=t[i];if("mediaSource"===s.type)return null;if(s.type===e)return i}return null})(e,t.queue),null===i)return;s=t.queue[i]}return t.queue.splice(i,1),t.queuePending[e]=s,s.action(e,t),s.doneFn?void 0:(t.queuePending[e]=null,void Ll(e,t))}}else t.updating()||"closed"===t.mediaSource.readyState||(t.queue.shift(),s.action(t),s.doneFn&&s.doneFn(),Ll("audio",t),Ll("video",t))},Dl=(e,t)=>{const i=t[`${e}Buffer`],s=Il(e);i&&(i.removeEventListener("updateend",t[`on${s}UpdateEnd_`]),i.removeEventListener("error",t[`on${s}Error_`]),t.codecs[e]=null,t[`${e}Buffer`]=null)},Rl=(e,t)=>e&&t&&-1!==Array.prototype.indexOf.call(e.sourceBuffers,t),Nl=(e,t,i)=>(s,n)=>{const r=n[`${s}Buffer`];if(Rl(n.mediaSource,r)){n.logger_(`Appending segment ${t.mediaIndex}'s ${e.length} bytes to ${s}Buffer`);try{r.appendBuffer(e)}catch(e){n.logger_(`Error with code ${e.code} `+(22===e.code?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${t.mediaIndex} to ${s}Buffer`),n.queuePending[s]=null,i(e)}}},Ml=(e,t)=>(i,s)=>{const n=s[`${i}Buffer`];if(Rl(s.mediaSource,n)){s.logger_(`Removing ${e} to ${t} from ${i}Buffer`);try{n.remove(e,t)}catch(n){s.logger_(`Remove ${e} to ${t} from ${i}Buffer failed`)}}},jl=e=>(t,i)=>{const s=i[`${t}Buffer`];Rl(i.mediaSource,s)&&(i.logger_(`Setting ${t}timestampOffset to ${e}`),s.timestampOffset=e)},Ul=e=>(t,i)=>{e()},Bl=e=>t=>{if("open"===t.mediaSource.readyState){t.logger_(`Calling mediaSource endOfStream(${e||""})`);try{t.mediaSource.endOfStream(e)}catch(e){va.log.warn("Failed to call media source endOfStream",e)}}},Fl=e=>t=>{t.logger_(`Setting mediaSource duration to ${e}`);try{t.mediaSource.duration=e}catch(e){va.log.warn("Failed to set media source duration",e)}},ql=(e,t)=>i=>{const s=Il(e),n=j(t);i.logger_(`Adding ${e}Buffer with codec ${t} to mediaSource`);const r=i.mediaSource.addSourceBuffer(n);r.addEventListener("updateend",i[`on${s}UpdateEnd_`]),r.addEventListener("error",i[`on${s}Error_`]),i.codecs[e]=t,i[`${e}Buffer`]=r},$l=e=>t=>{const i=t[`${e}Buffer`];if(Dl(e,t),Rl(t.mediaSource,i)){t.logger_(`Removing ${e}Buffer with codec ${t.codecs[e]} from mediaSource`);try{t.mediaSource.removeSourceBuffer(i)}catch(t){va.log.warn(`Failed to removeSourceBuffer ${e}Buffer`,t)}}},Hl=e=>(t,i)=>{const s=i[`${t}Buffer`],n=j(e);if(!Rl(i.mediaSource,s))return;const r=e.substring(0,e.indexOf(".")),a=i.codecs[t];if(a.substring(0,a.indexOf("."))!==r){i.logger_(`changing ${t}Buffer codec from ${i.codecs[t]} to ${e}`);try{s.changeType(n),i.codecs[t]=e}catch(e){va.log.warn(`Failed to changeType on ${t}Buffer`,e)}}},Vl=({type:e,sourceUpdater:t,action:i,doneFn:s,name:n})=>{t.queue.push({type:e,action:i,doneFn:s,name:n}),Ll(e,t)},zl=(e,t)=>i=>{const s=function(e){if(0===e.length)return"Buffered Ranges are empty";let t="Buffered Ranges: \n";for(let i=0;i<e.length;i++){const s=e.start(i),n=e.end(i);t+=`${s} --\x3e ${n}. Duration (${n-s})\n`}return t}(t[`${e}Buffered`]());if(t.logger_(`received "updateend" event for ${e} Source Buffer: `,s),t.queuePending[e]){const i=t.queuePending[e].doneFn;t.queuePending[e]=null,i&&i(t[`${e}Error_`])}Ll(e,t)};class Wl extends va.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>Ll("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=Ca("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=zl("video",this),this.onAudioUpdateEnd_=zl("audio",this),this.onVideoError_=e=>{this.videoError_=e},this.onAudioError_=e=>{this.audioError_=e},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){Vl({type:"mediaSource",sourceUpdater:this,action:ql(e,t),name:"addSourceBuffer"})}abort(e){Vl({type:e,sourceUpdater:this,action:(e,t)=>{if("open"!==t.mediaSource.readyState)return;const i=t[`${e}Buffer`];if(Rl(t.mediaSource,i)){t.logger_(`calling abort on ${e}Buffer`);try{i.abort()}catch(t){va.log.warn(`Failed to abort on ${e}Buffer`,t)}}},name:"abort"})}removeSourceBuffer(e){this.canRemoveSourceBuffer()?Vl({type:"mediaSource",sourceUpdater:this,action:$l(e),name:"removeSourceBuffer"}):va.log.error("removeSourceBuffer is not supported!")}canRemoveSourceBuffer(){return!va.browser.IS_FIREFOX&&n().MediaSource&&n().MediaSource.prototype&&"function"==typeof n().MediaSource.prototype.removeSourceBuffer}static canChangeType(){return n().SourceBuffer&&n().SourceBuffer.prototype&&"function"==typeof n().SourceBuffer.prototype.changeType}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){this.canChangeType()?Vl({type:e,sourceUpdater:this,action:Hl(t),name:"changeType"}):va.log.error("changeType is not supported!")}addOrChangeSourceBuffers(e){if(!e||"object"!=typeof e||0===Object.keys(e).length)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach((t=>{const i=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,i);this.canChangeType()&&this.changeType(t,i)}))}appendBuffer(e,t){const{segmentInfo:i,type:s,bytes:n}=e;if(this.processedAppend_=!0,"audio"===s&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([e,t]),void this.logger_(`delayed audio append of ${n.length} until video append`);if(Vl({type:s,sourceUpdater:this,action:Nl(n,i||{mediaIndex:-1},t),doneFn:t,name:"appendBuffer"}),"video"===s){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const e=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${e.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,e.forEach((e=>{this.appendBuffer.apply(this,e)}))}}audioBuffered(){return Rl(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:ka()}videoBuffered(){return Rl(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:ka()}buffered(){const e=Rl(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=Rl(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():function(e,t){let i=null,s=null,n=0;const r=[],a=[];if(!(e&&e.length&&t&&t.length))return ka();let o=e.length;for(;o--;)r.push({time:e.start(o),type:"start"}),r.push({time:e.end(o),type:"end"});for(o=t.length;o--;)r.push({time:t.start(o),type:"start"}),r.push({time:t.end(o),type:"end"});for(r.sort((function(e,t){return e.time-t.time})),o=0;o<r.length;o++)"start"===r[o].type?(n++,2===n&&(i=r[o].time)):"end"===r[o].type&&(n--,1===n&&(s=r[o].time)),null!==i&&null!==s&&(a.push([i,s]),i=null,s=null);return ka(a)}(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=Al){Vl({type:"mediaSource",sourceUpdater:this,action:Fl(e),name:"duration",doneFn:t})}endOfStream(e=null,t=Al){"string"!=typeof e&&(e=void 0),Vl({type:"mediaSource",sourceUpdater:this,action:Bl(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,i=Al){this.audioBuffered().length&&0!==this.audioBuffered().end(0)?Vl({type:"audio",sourceUpdater:this,action:Ml(e,t),doneFn:i,name:"remove"}):i()}removeVideo(e,t,i=Al){this.videoBuffered().length&&0!==this.videoBuffered().end(0)?Vl({type:"video",sourceUpdater:this,action:Ml(e,t),doneFn:i,name:"remove"}):i()}updating(){return!(!Ol("audio",this)&&!Ol("video",this))}audioTimestampOffset(e){return void 0!==e&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(Vl({type:"audio",sourceUpdater:this,action:jl(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return void 0!==e&&this.videoBuffer&&this.videoTimestampOffset!==e&&(Vl({type:"video",sourceUpdater:this,action:jl(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&Vl({type:"audio",sourceUpdater:this,action:Ul(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&Vl({type:"video",sourceUpdater:this,action:Ul(e),name:"callback"})}dispose(){this.trigger("dispose"),Pl.forEach((e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`]((()=>Dl(e,this)))})),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const Gl=e=>decodeURIComponent(escape(String.fromCharCode.apply(null,e))),Xl=new Uint8Array("\n\n".split("").map((e=>e.charCodeAt(0))));class Yl extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class Kl extends kl{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}createTransmuxer_(){return null}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return ka();const e=this.subtitlesTrack_.cues;return ka([[e[0].startTime,e[e.length-1].startTime]])}initSegmentForMap(e,t=!1){if(!e)return null;const i=Eo(e);let s=this.initSegments_[i];if(t&&!s&&e.bytes){const t=Xl.byteLength+e.bytes.byteLength,n=new Uint8Array(t);n.set(e.bytes),n.set(Xl,e.bytes.byteLength),this.initSegments_[i]=s={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:n}}return s||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return void 0===e||(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_}remove(e,t){bl(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(null===this.syncController_.timestampOffsetForTimeline(e.timeline)){const e=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};return this.syncController_.one("timestampoffset",e),void(this.state="WAITING_ON_TIMELINE")}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,i){if(!this.subtitlesTrack_)return void(this.state="READY");if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===Xo&&this.handleTimeout_(),e.code===Yo?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);const s=this.pendingSegment_;this.saveBandwidthRelatedStats_(s.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const r=s.segment;if(r.map&&(r.map.bytes=t.map.bytes),s.bytes=t.bytes,"function"!=typeof n().WebVTT&&"function"==typeof this.loadVttJs)return this.state="WAITING_ON_VTTJS",void this.loadVttJs().then((()=>this.segmentRequestFinished_(e,t,i)),(()=>this.stopForError({message:"Error loading vtt.js",metadata:{errorType:va.Error.VttLoadError}})));r.requested=!0;try{this.parseVTTCues_(s)}catch(e){return void this.stopForError({message:e.message,metadata:{errorType:va.Error.VttCueParsingError}})}if(this.updateTimeMapping_(s,this.syncController_.timelines[s.timeline],this.playlist_),s.cues.length?s.timingInfo={start:s.cues[0].startTime,end:s.cues[s.cues.length-1].endTime}:s.timingInfo={start:s.startOfSegment,end:s.startOfSegment+s.duration},s.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");s.byteLength=s.bytes.byteLength,this.mediaSecondsLoaded+=r.duration,s.cues.forEach((e=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new(n().VTTCue)(e.startTime,e.endTime,e.text):e)})),function(e){const t=e.cues;if(!t)return;const i={};for(let s=t.length-1;s>=0;s--){const n=t[s],r=`${n.startTime}-${n.endTime}-${n.text}`;i[r]?e.removeCue(n):i[r]=n}}(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(e){let t,i=!1;if("function"!=typeof n().WebVTT)throw new Yl;"function"==typeof n().TextDecoder?t=new(n().TextDecoder)("utf8"):(t=n().WebVTT.StringDecoder(),i=!0);const s=new(n().WebVTT.Parser)(n(),n().vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},s.oncue=e.cues.push.bind(e.cues),s.ontimestampmap=t=>{e.timestampmap=t},s.onparsingerror=e=>{va.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){let t=e.segment.map.bytes;i&&(t=Gl(t)),s.parse(t)}let r=e.bytes;i&&(r=Gl(r)),s.parse(r),s.flush()}updateTimeMapping_(e,t,i){const s=e.segment;if(!t)return;if(!e.cues.length)return void(s.empty=!0);const{MPEGTS:n,LOCAL:r}=e.timestampmap,a=n/ft.ONE_SECOND_IN_TS-r+t.mapping;if(e.cues.forEach((e=>{const i=e.endTime-e.startTime,s=0===n?e.startTime+a:this.handleRollover_(e.startTime+a,t.time);e.startTime=Math.max(s,0),e.endTime=Math.max(s+i,0)})),!i.syncInfo){const t=e.cues[0].startTime,n=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(t,n-s.duration)}}}handleRollover_(e,t){if(null===t)return e;let i=e*ft.ONE_SECOND_IN_TS;const s=t*ft.ONE_SECOND_IN_TS;let n;for(n=s<i?-8589934592:8589934592;Math.abs(i-s)>4294967296;)i+=n;return i/ft.ONE_SECOND_IN_TS}}const Ql=function(e,t){const i=e.cues;for(let e=0;e<i.length;e++){const s=i[e];if(t>=s.adStartTime&&t<=s.adEndTime)return s}return null};class Jl{constructor({start:e,end:t,segmentIndex:i,partIndex:s=null,appended:n=!1}){this.start_=e,this.end_=t,this.segmentIndex_=i,this.partIndex_=s,this.appended_=n}isInRange(e){return e>=this.start&&e<this.end}markAppended(){this.appended_=!0}resetAppendedStatus(){this.appended_=!1}get isAppended(){return this.appended_}get start(){return this.start_}get end(){return this.end_}get segmentIndex(){return this.segmentIndex_}get partIndex(){return this.partIndex_}}class Zl{constructor(e,t=[]){this.segmentSyncInfo_=e,this.partsSyncInfo_=t}get segmentSyncInfo(){return this.segmentSyncInfo_}get partsSyncInfo(){return this.partsSyncInfo_}get hasPartsSyncInfo(){return this.partsSyncInfo_.length>0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach((e=>e.resetAppendedStatus()))}}class ec{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach((e=>e.resetAppendStatus()))}update(e,t){const{mediaSequence:i,segments:s}=e;if(this.isReliable_=this.isReliablePlaylist_(i,s),this.isReliable_)return this.updateStorage_(s,i,this.calculateBaseTime_(i,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:i}of this.storage_.values())if(i.length){for(const t of i)if(t.isInRange(e))return t}else if(t.isInRange(e))return t;return null}updateStorage_(e,t,i){const s=new Map;let n="\n",r=i,a=t;this.start_=r,e.forEach(((e,t)=>{const i=this.storage_.get(a),o=r,l=o+e.duration,c=Boolean(i&&i.segmentSyncInfo&&i.segmentSyncInfo.isAppended),u=new Jl({start:o,end:l,appended:c,segmentIndex:t});e.syncInfo=u;let h=r;const d=(e.parts||[]).map(((e,s)=>{const r=h,o=h+e.duration,l=Boolean(i&&i.partsSyncInfo&&i.partsSyncInfo[s]&&i.partsSyncInfo[s].isAppended),c=new Jl({start:r,end:o,appended:l,segmentIndex:t,partIndex:s});return h=o,n+=`Media Sequence: ${a}.${s} | Range: ${r} --\x3e ${o} | Appended: ${l}\n`,e.syncInfo=c,c}));s.set(a,new Zl(u,d)),n+=`${gl(e.resolvedUri)} | Media Sequence: ${a} | Range: ${o} --\x3e ${l} | Appended: ${c}\n`,a++,r=l})),this.end_=r,this.storage_=s,this.diagnostics_=n}calculateBaseTime_(e,t){return this.storage_.size?this.storage_.has(e)?this.storage_.get(e).segmentSyncInfo.start:t:0}isReliablePlaylist_(e,t){return null!=e&&Array.isArray(t)&&t.length}}const tc=[{name:"VOD",run:(e,t,i,s,n)=>i!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(e,t,i,s,n,r)=>{const a=e.getMediaSequenceSync(r);if(!a)return null;if(!a.isReliable)return null;const o=a.getSyncInfoForTime(n);return o?{time:o.start,partIndex:o.partIndex,segmentIndex:o.segmentIndex}:null}},{name:"ProgramDateTime",run:(e,t,i,s,n)=>{if(!Object.keys(e.timelineToDatetimeMappings).length)return null;let r=null,a=null;const o=Ua(t);n=n||0;for(let i=0;i<o.length;i++){const s=o[t.endList||0===n?i:o.length-(i+1)],l=s.segment,c=e.timelineToDatetimeMappings[l.timeline];if(!c||!l.dateTimeObject)continue;let u=l.dateTimeObject.getTime()/1e3+c;if(l.parts&&"number"==typeof s.partIndex)for(let e=0;e<s.partIndex;e++)u+=l.parts[e].duration;const h=Math.abs(n-u);if(null!==a&&(0===h||a<h))break;a=h,r={time:u,segmentIndex:s.segmentIndex,partIndex:s.partIndex}}return r}},{name:"Segment",run:(e,t,i,s,n)=>{let r=null,a=null;n=n||0;const o=Ua(t);for(let e=0;e<o.length;e++){const i=o[t.endList||0===n?e:o.length-(e+1)],l=i.segment,c=i.part&&i.part.start||l&&l.start;if(l.timeline===s&&void 0!==c){const e=Math.abs(n-c);if(null!==a&&a<e)break;(!r||null===a||a>=e)&&(a=e,r={time:c,segmentIndex:i.segmentIndex,partIndex:i.partIndex})}}return r}},{name:"Discontinuity",run:(e,t,i,s,n)=>{let r=null;if(n=n||0,t.discontinuityStarts&&t.discontinuityStarts.length){let i=null;for(let s=0;s<t.discontinuityStarts.length;s++){const a=t.discontinuityStarts[s],o=t.discontinuitySequence+s+1,l=e.discontinuities[o];if(l){const e=Math.abs(n-l.time);if(null!==i&&i<e)break;(!r||null===i||i>=e)&&(i=e,r={time:l.time,segmentIndex:a,partIndex:null})}}}return r}},{name:"Playlist",run:(e,t,i,s,n)=>t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}];class ic extends va.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={},this.mediaSequenceStorage_={main:new ec,audio:new ec,vtt:new ec},this.logger_=Ca("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,i,s,n){if(t!==1/0)return tc.find((({name:e})=>"VOD"===e)).run(this,e,t);const r=this.runStrategies_(e,t,i,s,n);if(!r.length)return null;for(const t of r){const{syncPoint:i,strategy:n}=t,{segmentIndex:r,time:a}=i;if(r<0)continue;const o=a,l=o+e.segments[r].duration;if(this.logger_(`Strategy: ${n}. Current time: ${s}. selected segment: ${r}. Time: [${o} -> ${l}]}`),s>=o&&s<l)return this.logger_("Found sync point with exact match: ",i),i}return this.selectSyncPoint_(r,{key:"time",value:s})}getExpiredTime(e,t){if(!e||!e.segments)return null;const i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length)return null;const s=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});return s.segmentIndex>0&&(s.time*=-1),Math.abs(s.time+Va({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:s.segmentIndex,endIndex:0}))}runStrategies_(e,t,i,s,n){const r=[];for(let a=0;a<tc.length;a++){const o=tc[a],l=o.run(this,e,t,i,s,n);l&&(l.strategy=o.name,r.push({strategy:o.name,syncPoint:l}))}return r}selectSyncPoint_(e,t){let i=e[0].syncPoint,s=Math.abs(e[0].syncPoint[t.key]-t.value),n=e[0].strategy;for(let r=1;r<e.length;r++){const a=Math.abs(e[r].syncPoint[t.key]-t.value);a<s&&(s=a,i=e[r].syncPoint,n=e[r].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${n}]: [time:${i.time}, segmentIndex:${i.segmentIndex}`+("number"==typeof i.partIndex?`,partIndex:${i.partIndex}`:"")+"]"),i}saveExpiredSegmentInfo(e,t){const i=t.mediaSequence-e.mediaSequence;if(i>86400)va.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);else for(let s=i-1;s>=0;s--){const i=e.segments[s];if(i&&void 0!==i.start){t.syncInfo={mediaSequence:e.mediaSequence+s,time:i.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const i=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),s=e.segment;i&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:s.start}));const n=s.dateTimeObject;s.discontinuity&&t&&n&&(this.timelineToDatetimeMappings[s.timeline]=-n.getTime()/1e3)}timestampOffsetForTimeline(e){return void 0===this.timelines[e]?null:this.timelines[e].time}mappingForTimeline(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,i){const s=e.segment,n=e.part;let r,a,o=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)o={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=o,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${o.time}] [mapping: ${o.mapping}]`)),r=e.startOfSegment,a=t.end+o.mapping;else{if(!o)return!1;r=t.start+o.mapping,a=t.end+o.mapping}return n&&(n.start=r,n.end=a),(!s.start||r<s.start)&&(s.start=r),s.end=a,!0}saveDiscontinuitySyncInfo_(e){const t=e.playlist,i=e.segment;if(i.discontinuity)this.discontinuities[i.timeline]={time:i.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(let s=0;s<t.discontinuityStarts.length;s++){const n=t.discontinuityStarts[s],r=t.discontinuitySequence+s+1,a=n-e.mediaIndex,o=Math.abs(a);if(!this.discontinuities[r]||this.discontinuities[r].accuracy>o){let s;s=a<0?i.start-Va({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:n}):i.end+Va({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:n}),this.discontinuities[r]={time:s,accuracy:o}}}}dispose(){this.trigger("dispose"),this.off()}}class sc extends va.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:i}){return"number"==typeof t&&"number"==typeof i&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:i},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:i}){return"number"==typeof t&&"number"==typeof i&&(this.lastTimelineChanges_[e]={type:e,from:t,to:i},delete this.pendingTimelineChanges_[e],this.trigger("timelinechange")),this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const nc=Bo(Fo((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 i=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(i,1),i>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,s=0;s<i;++s)t[s].call(this,arguments[1]);else for(var n=Array.prototype.slice.call(arguments,1),r=t.length,a=0;a<r;++a)t[a].apply(this,n)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}();let t=null;class s{constructor(e){let i,s,n;t||(t=function(){const e=[[[],[],[],[],[]],[[],[],[],[],[]]],t=e[0],i=e[1],s=t[4],n=i[4];let r,a,o;const l=[],c=[];let u,h,d,p,f,m;for(r=0;r<256;r++)c[(l[r]=r<<1^283*(r>>7))^r]=r;for(a=o=0;!s[a];a^=u||1,o=c[o]||1)for(p=o^o<<1^o<<2^o<<3^o<<4,p=p>>8^255&p^99,s[a]=p,n[p]=a,d=l[h=l[u=l[a]]],m=16843009*d^65537*h^257*u^16843008*a,f=257*l[p]^16843008*p,r=0;r<4;r++)t[r][a]=f=f<<24^f>>>8,i[r][p]=m=m<<24^m>>>8;for(r=0;r<5;r++)t[r]=t[r].slice(0),i[r]=i[r].slice(0);return e}()),this._tables=[[t[0][0].slice(),t[0][1].slice(),t[0][2].slice(),t[0][3].slice(),t[0][4].slice()],[t[1][0].slice(),t[1][1].slice(),t[1][2].slice(),t[1][3].slice(),t[1][4].slice()]];const r=this._tables[0][4],a=this._tables[1],o=e.length;let l=1;if(4!==o&&6!==o&&8!==o)throw new Error("Invalid aes key size");const c=e.slice(0),u=[];for(this._key=[c,u],i=o;i<4*o+28;i++)n=c[i-1],(i%o==0||8===o&&i%o==4)&&(n=r[n>>>24]<<24^r[n>>16&255]<<16^r[n>>8&255]<<8^r[255&n],i%o==0&&(n=n<<8^n>>>24^l<<24,l=l<<1^283*(l>>7))),c[i]=c[i-o]^n;for(s=0;i;s++,i--)n=c[3&s?i:i-4],u[s]=i<=4||s<4?n:a[0][r[n>>>24]]^a[1][r[n>>16&255]]^a[2][r[n>>8&255]]^a[3][r[255&n]]}decrypt(e,t,i,s,n,r){const a=this._key[1];let o,l,c,u=e^a[0],h=s^a[1],d=i^a[2],p=t^a[3];const f=a.length/4-2;let m,g=4;const y=this._tables[1],v=y[0],_=y[1],b=y[2],T=y[3],S=y[4];for(m=0;m<f;m++)o=v[u>>>24]^_[h>>16&255]^b[d>>8&255]^T[255&p]^a[g],l=v[h>>>24]^_[d>>16&255]^b[p>>8&255]^T[255&u]^a[g+1],c=v[d>>>24]^_[p>>16&255]^b[u>>8&255]^T[255&h]^a[g+2],p=v[p>>>24]^_[u>>16&255]^b[h>>8&255]^T[255&d]^a[g+3],g+=4,u=o,h=l,d=c;for(m=0;m<4;m++)n[(3&-m)+r]=S[u>>>24]<<24^S[h>>16&255]<<16^S[d>>8&255]<<8^S[255&p]^a[g++],o=u,u=h,h=d,d=p,p=o}}class n extends e{constructor(){super(e),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const r=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24};class a{constructor(e,t,i,s){const o=a.STEP,l=new Int32Array(e.buffer),c=new Uint8Array(e.byteLength);let u=0;for(this.asyncStream_=new n,this.asyncStream_.push(this.decryptChunk_(l.subarray(u,u+o),t,i,c)),u=o;u<l.length;u+=o)i=new Uint32Array([r(l[u-4]),r(l[u-3]),r(l[u-2]),r(l[u-1])]),this.asyncStream_.push(this.decryptChunk_(l.subarray(u,u+o),t,i,c));this.asyncStream_.push((function(){var e;s(null,(e=c).subarray(0,e.byteLength-e[e.byteLength-1]))}))}static get STEP(){return 32e3}decryptChunk_(e,t,i,n){return function(){const a=function(e,t,i){const n=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),a=new s(Array.prototype.slice.call(t)),o=new Uint8Array(e.byteLength),l=new Int32Array(o.buffer);let c,u,h,d,p,f,m,g,y;for(c=i[0],u=i[1],h=i[2],d=i[3],y=0;y<n.length;y+=4)p=r(n[y]),f=r(n[y+1]),m=r(n[y+2]),g=r(n[y+3]),a.decrypt(p,f,m,g,l,y),l[y]=r(l[y]^c),l[y+1]=r(l[y+1]^u),l[y+2]=r(l[y+2]^h),l[y+3]=r(l[y+3]^d),c=p,u=f,h=m,d=g;return o}(e,t,i);n.set(a,e.byteOffset)}}}var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},l=("undefined"!=typeof window?window:void 0!==o?o:"undefined"!=typeof self?self:{}).BigInt||Number;l("0x1"),l("0x100"),l("0x10000"),l("0x1000000"),l("0x100000000"),l("0x10000000000"),l("0x1000000000000"),l("0x100000000000000"),l("0x10000000000000000"),function(){var e=new Uint16Array([65484]),t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);255===t[0]||t[0]}();self.onmessage=function(e){const t=e.data,i=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),s=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),n=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new a(i,s,n,(function(e,i){self.postMessage(function(e){const t={};return Object.keys(e).forEach((i=>{const s=e[i];var n;n=s,("function"===ArrayBuffer.isView?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer)?t[i]={bytes:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength}:t[i]=s})),t}({source:t.source,decrypted:i}),[i.buffer])}))}})));var rc=Uo(nc);const ac=e=>{let t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},oc=(e,t)=>{e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},lc=(e,t)=>{t.activePlaylistLoader=e,e.load()},cc={AUDIO:(e,t)=>()=>{const{mediaTypes:{[e]:i},excludePlaylist:s}=t,n=i.activeTrack(),r=i.activeGroup(),a=(r.filter((e=>e.default))[0]||r[0]).id,o=i.tracks[a];if(n!==o){va.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const e in i.tracks)i.tracks[e].enabled=i.tracks[e]===o;i.onTrackChanged()}else s({error:{message:"Problem encountered loading the default audio track."}})},SUBTITLES:(e,t)=>()=>{const{mediaTypes:{[e]:i}}=t;va.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const s=i.activeTrack();s&&(s.mode="disabled"),i.onTrackChanged()}},uc={AUDIO:(e,t,i)=>{if(!t)return;const{tech:s,requestOptions:n,segmentLoaders:{[e]:r}}=i;t.on("loadedmetadata",(()=>{const e=t.media();r.playlist(e,n),(!s.paused()||e.endList&&"none"!==s.preload())&&r.load()})),t.on("loadedplaylist",(()=>{r.playlist(t.media(),n),s.paused()||r.load()})),t.on("error",cc[e](e,i))},SUBTITLES:(e,t,i)=>{const{tech:s,requestOptions:n,segmentLoaders:{[e]:r},mediaTypes:{[e]:a}}=i;t.on("loadedmetadata",(()=>{const e=t.media();r.playlist(e,n),r.track(a.activeTrack()),(!s.paused()||e.endList&&"none"!==s.preload())&&r.load()})),t.on("loadedplaylist",(()=>{r.playlist(t.media(),n),s.paused()||r.load()})),t.on("error",cc[e](e,i))}},hc={AUDIO:(e,t)=>{const{vhs:i,sourceType:s,segmentLoaders:{[e]:n},requestOptions:r,main:{mediaGroups:a},mediaTypes:{[e]:{groups:o,tracks:l,logger_:c}},mainPlaylistLoader:u}=t,h=Za(u.main);a[e]&&0!==Object.keys(a[e]).length||(a[e]={main:{default:{default:!0}}},h&&(a[e].main.default.playlists=u.main.playlists));for(const n in a[e]){o[n]||(o[n]=[]);for(const d in a[e][n]){let p,f=a[e][n][d];if(h?(c(`AUDIO group '${n}' label '${d}' is a main playlist`),f.isMainPlaylist=!0,p=null):p="vhs-json"===s&&f.playlists?new go(f.playlists[0],i,r):f.resolvedUri?new go(f.resolvedUri,i,r):f.playlists&&"dash"===s?new No(f.playlists[0],i,r,u):null,f=xa({id:d,playlistLoader:p},f),uc[e](e,f.playlistLoader,t),o[n].push(f),void 0===l[d]){const e=new va.AudioTrack({id:d,kind:ac(f),enabled:!1,language:f.language,default:f.default,label:d});l[d]=e}}}n.on("error",cc[e](e,t))},SUBTITLES:(e,t)=>{const{tech:i,vhs:s,sourceType:n,segmentLoaders:{[e]:r},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[e]:{groups:l,tracks:c}},mainPlaylistLoader:u}=t;for(const r in o[e]){l[r]||(l[r]=[]);for(const h in o[e][r]){if(!s.options_.useForcedSubtitles&&o[e][r][h].forced)continue;let d,p=o[e][r][h];if("hls"===n)d=new go(p.resolvedUri,s,a);else if("dash"===n){if(!p.playlists.filter((e=>e.excludeUntil!==1/0)).length)return;d=new No(p.playlists[0],s,a,u)}else"vhs-json"===n&&(d=new go(p.playlists?p.playlists[0]:p.resolvedUri,s,a));if(p=xa({id:h,playlistLoader:d},p),uc[e](e,p.playlistLoader,t),l[r].push(p),void 0===c[h]){const e=i.addRemoteTextTrack({id:h,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:h},!1).track;c[h]=e}}}r.on("error",cc[e](e,t))},"CLOSED-CAPTIONS":(e,t)=>{const{tech:i,main:{mediaGroups:s},mediaTypes:{[e]:{groups:n,tracks:r}}}=t;for(const t in s[e]){n[t]||(n[t]=[]);for(const a in s[e][t]){const o=s[e][t][a];if(!/^(?:CC|SERVICE)/.test(o.instreamId))continue;const l=i.options_.vhs&&i.options_.vhs.captionServices||{};let c={label:a,language:o.language,instreamId:o.instreamId,default:o.default&&o.autoselect};if(l[c.instreamId]&&(c=xa(c,l[c.instreamId])),void 0===c.default&&delete c.default,n[t].push(xa({id:a},o)),void 0===r[a]){const e=i.addRemoteTextTrack({id:c.instreamId,kind:"captions",default:c.default,language:c.language,label:c.label},!1).track;r[a]=e}}}}},dc=(e,t)=>{for(let i=0;i<e.length;i++){if(Qa(t,e[i]))return!0;if(e[i].playlists&&dc(e[i].playlists,t))return!0}return!1},pc={AUDIO:(e,t)=>()=>{const{mediaTypes:{[e]:{tracks:i}}}=t;for(const e in i)if(i[e].enabled)return i[e];return null},SUBTITLES:(e,t)=>()=>{const{mediaTypes:{[e]:{tracks:i}}}=t;for(const e in i)if("showing"===i[e].mode||"hidden"===i[e].mode)return i[e];return null}};class fc{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){1===e&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=wa(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map((e=>[e.ID,e]))))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class mc extends va.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new fc,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=Ca("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const i=t.serverUri||t.serverURL;if(!i)return this.logger_(`steering manifest URL is ${i}, cannot request steering manifest.`),void this.trigger("error");i.startsWith("data:")?this.decodeDataUriManifest_(i.substring(i.indexOf(",")+1)):(this.steeringManifest.reloadUri=wa(e,i),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering"))}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t)return;const i=e?t:this.getRequestURI(t);if(!i)return this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),void this.dispose();this.request_=this.xhr_({uri:i,requestType:"content-steering-manifest"},((e,t)=>{if(e){if(410===t.status)return this.logger_(`manifest request 410 ${e}.`),this.logger_(`There will be no more content steering requests to ${i} this session.`),void this.excludedSteeringManifestURLs.add(i);if(429===t.status){const i=t.responseHeaders["retry-after"];return this.logger_(`manifest request 429 ${e}.`),this.logger_(`content steering will retry in ${i} seconds.`),void this.startTTLTimeout_(parseInt(i,10))}return this.logger_(`manifest failed to load ${e}.`),void this.startTTLTimeout_()}const s=JSON.parse(this.request_.responseText);this.assignSteeringProperties_(s),this.startTTLTimeout_()}))}setProxyServerUrl_(e){const t=new(n().URL)(e),i=new(n().URL)(this.proxyServerUrl_);return i.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(i.toString())}decodeDataUriManifest_(e){const t=JSON.parse(n().atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new(n().URL)(e),i=this.getPathway(),s=this.getBandwidth_();if(i){const e=`_${this.manifestType_}_pathway`;t.searchParams.set(e,i)}if(s){const e=`_${this.manifestType_}_throughput`;t.searchParams.set(e,s)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version)return this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),void this.trigger("error");this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const t=(e=>{for(const t of e)if(this.availablePathways_.has(t))return t;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==t&&(this.currentPathway=t,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=e=>this.excludedSteeringManifestURLs.has(e);if(this.proxyServerUrl_){const i=this.setProxyServerUrl_(e);if(!t(i))return i}const i=this.setSteeringParams_(e);return t(i)?null:i}startTTLTimeout_(e=this.steeringManifest.ttl){const t=1e3*e;this.ttlTimeout_=n().setTimeout((()=>{this.requestSteeringManifest()}),t)}clearTTLTimeout_(){n().clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new fc}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(wa(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}let gc;const yc=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],vc=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]};class _c extends va.EventTarget{constructor(e){super();const{src:t,withCredentials:i,tech:s,bandwidth:r,externVhs:a,useCueTags:o,playlistExclusionDuration:l,enableLowInitialPlaylist:c,sourceType:u,cacheEncryptionKeys:h,bufferBasedABR:d,leastPixelDiffSelector:p,captionServices:f}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:m}=e;null==m&&(m=1/0),gc=a,this.bufferBasedABR=Boolean(d),this.leastPixelDiffSelector=Boolean(p),this.withCredentials=i,this.tech_=s,this.vhs_=s.vhs,this.sourceType_=u,this.useCueTags_=o,this.playlistExclusionDuration=l,this.maxPlaylistRetries=m,this.enableLowInitialPlaylist=c,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:i,maxPlaylistRetries:m,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=(()=>{const e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((t=>{e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Al,activeTrack:Al,getActiveGroup:Al,onGroupChanged:Al,onTrackChanged:Al,lastTrack_:null,logger_:Ca(`MediaGroups[${t}]`)}})),e})(),this.mediaSource=new(n().MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.seekable_=ka(),this.hasPlayed_=!1,this.syncController_=new ic(e),this.segmentMetadataTrack_=s.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new rc,this.sourceUpdater_=new Wl(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new sc,this.keyStatusMap_=new Map;const g={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:f,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:r,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:h,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_="dash"===this.sourceType_?new No(t,this.vhs_,xa(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new go(t,this.vhs_,xa(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new kl(xa(g,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new kl(xa(g,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new Kl(xa(g,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise(((e,t)=>{function i(){s.off("vttjserror",n),e()}function n(){s.off("vttjsloaded",i),t()}s.one("vttjsloaded",i),s.one("vttjserror",n),s.addWebVttScript_()}))}),e),this.contentSteeringController_=new mc(this.vhs_.xhr,(()=>this.mainSegmentLoader_.bandwidth)),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",(()=>this.startABRTimer_())),this.tech_.on("pause",(()=>this.stopABRTimer_())),this.tech_.on("play",(()=>this.startABRTimer_()))),yc.forEach((e=>{this[e+"_"]=vc.bind(this,e)})),this.logger_=Ca("pc"),this.triggeredFmp4Usage=!1,"none"===this.tech_.preload()?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const y="none"===this.tech_.preload()?"play":"loadstart";this.tech_.one(y,(()=>{const e=Date.now();this.tech_.one("loadeddata",(()=>{this.timeToLoadedData__=Date.now()-e,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends}))}))}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return-1===e||-1===t?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,i){const s=this.media(),n=s&&(s.id||s.uri),r=e&&(e.id||e.uri);n&&n!==r&&(this.logger_(`switch media ${n} -> ${r} from ${t}`),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})),this.mainPlaylistLoader_.media(e,i)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((e=>{const t=this.mediaTypes_[e],i=t?t.activeGroup():null,s=this.contentSteeringController_.getPathway();if(i&&s){const t=(i.length?i[0].playlists:i.playlists).filter((e=>e.attributes.serviceLocation===s));t.length&&this.mediaTypes_[e].activePlaylistLoader.media(t[0])}}))}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=n().setInterval((()=>this.checkABR_()),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(n().clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const i=e.mediaGroups.AUDIO,s=Object.keys(i);let n;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else{const e=i.main||s.length&&i[s[0]];for(const t in e)if(e[t].default){n={label:t};break}}if(!n)return t;const r=[];for(const t in i)if(i[t][n.label]){const s=i[t][n.label];if(s.playlists&&s.playlists.length)r.push.apply(r,s.playlists);else if(s.uri)r.push(s);else if(e.playlists.length)for(let i=0;i<e.playlists.length;i++){const s=e.playlists[i];s.attributes&&s.attributes.AUDIO&&s.attributes.AUDIO===t&&r.push(s)}}return r.length?r:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",(()=>{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;Ka(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,e.endList&&"none"!==this.tech_.preload()&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),(e=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((t=>{hc[t](t,e)}));const{mediaTypes:t,mainPlaylistLoader:i,tech:s,vhs:n,segmentLoaders:{AUDIO:r,main:a}}=e;["AUDIO","SUBTITLES"].forEach((i=>{t[i].activeGroup=((e,t)=>i=>{const{mainPlaylistLoader:s,mediaTypes:{[e]:{groups:n}}}=t,r=s.media();if(!r)return null;let a=null;r.attributes[e]&&(a=n[r.attributes[e]]);const o=Object.keys(n);if(!a)if("AUDIO"===e&&o.length>1&&Za(t.main))for(let e=0;e<o.length;e++){const t=n[o[e]];if(dc(t,r)){a=t;break}}else n.main?a=n.main:1===o.length&&(a=n[o[0]]);return void 0===i?a:null!==i&&a&&a.filter((e=>e.id===i.id))[0]||null})(i,e),t[i].activeTrack=pc[i](i,e),t[i].onGroupChanged=((e,t)=>()=>{const{segmentLoaders:{[e]:i,main:s},mediaTypes:{[e]:n}}=t,r=n.activeTrack(),a=n.getActiveGroup(),o=n.activePlaylistLoader,l=n.lastGroup_;a&&l&&a.id===l.id||(n.lastGroup_=a,n.lastTrack_=r,oc(i,n),a&&!a.isMainPlaylist&&(a.playlistLoader?(i.resyncLoader(),lc(a.playlistLoader,n)):o&&s.resetEverything()))})(i,e),t[i].onGroupChanging=((e,t)=>()=>{const{segmentLoaders:{[e]:i},mediaTypes:{[e]:s}}=t;s.lastGroup_=null,i.abort(),i.pause()})(i,e),t[i].onTrackChanged=((e,t)=>()=>{const{mainPlaylistLoader:i,segmentLoaders:{[e]:s,main:n},mediaTypes:{[e]:r}}=t,a=r.activeTrack(),o=r.getActiveGroup(),l=r.activePlaylistLoader,c=r.lastTrack_;if((!c||!a||c.id!==a.id)&&(r.lastGroup_=o,r.lastTrack_=a,oc(s,r),o)){if(o.isMainPlaylist){if(!a||!c||a.id===c.id)return;const e=t.vhs.playlistController_,s=e.selectPlaylist();if(e.media()===s)return;return r.logger_(`track change. Switching main audio from ${c.id} to ${a.id}`),i.pause(),n.resetEverything(),void e.fastQualityChange_(s)}if("AUDIO"===e){if(!o.playlistLoader)return n.setAudio(!0),void n.resetEverything();s.setAudio(!0),n.setAudio(!1)}l!==o.playlistLoader?(s.track&&s.track(a),s.resetEverything(),lc(o.playlistLoader,r)):lc(o.playlistLoader,r)}})(i,e),t[i].getActiveGroup=((e,{mediaTypes:t})=>()=>{const i=t[e].activeTrack();return i?t[e].activeGroup(i):null})(i,e)}));const o=t.AUDIO.activeGroup();if(o){const e=(o.filter((e=>e.default))[0]||o[0]).id;t.AUDIO.tracks[e].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged(),t.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),r.setAudio(!0)):a.setAudio(!0)}i.on("mediachange",(()=>{["AUDIO","SUBTITLES"].forEach((e=>t[e].onGroupChanged()))})),i.on("mediachanging",(()=>{["AUDIO","SUBTITLES"].forEach((e=>t[e].onGroupChanging()))}));const l=()=>{t.AUDIO.onTrackChanged(),s.trigger({type:"usage",name:"vhs-audio-change"})};s.audioTracks().addEventListener("change",l),s.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),n.on("dispose",(()=>{s.audioTracks().removeEventListener("change",l),s.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)})),s.clearTracks("audio");for(const e in t.AUDIO.tracks)s.audioTracks().addTrack(t.AUDIO.tracks[e])})({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),e),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",(()=>{this.trigger("selectedinitialmedia")}))})),this.mainPlaylistLoader_.on("loadedplaylist",(()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let e=this.mainPlaylistLoader_.media();if(!e){let t;if(this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_(),this.enableLowInitialPlaylist&&(t=this.selectInitialPlaylist()),t||(t=this.selectPlaylist()),!t||!this.shouldSwitchToMedia_(t))return;if(this.initialMedia_=t,this.switchMedia_(this.initialMedia_,"initial"),"vhs-json"!==this.sourceType_||!this.initialMedia_.segments)return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)})),this.mainPlaylistLoader_.on("error",(()=>{const e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})})),this.mainPlaylistLoader_.on("mediachanging",(()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()})),this.mainPlaylistLoader_.on("mediachange",(()=>{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;Ka(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,"dash"===this.sourceType_&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})})),this.mainPlaylistLoader_.on("playlistunchanged",(()=>{const e=this.mainPlaylistLoader_.media();"playlist-unchanged"!==e.lastExcludeReason_&&this.stuckAtPlaylistEnd_(e)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))})),this.mainPlaylistLoader_.on("renditiondisabled",(()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})})),this.mainPlaylistLoader_.on("renditionenabled",(()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}))}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const i=e.mediaGroups||{};let s=!0;const n=Object.keys(i.AUDIO);for(const e in i.AUDIO)for(const t in i.AUDIO[e])i.AUDIO[e][t].uri||(s=!1);s&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),gc.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),n.length&&Object.keys(i.AUDIO[n[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,i=this.tech_.currentTime(),s=this.bufferLowWaterLine(),n=this.bufferHighWaterLine();return function({currentPlaylist:e,buffered:t,currentTime:i,nextPlaylist:s,bufferLowWaterLine:n,bufferHighWaterLine:r,duration:a,bufferBasedABR:o,log:l}){if(!s)return va.log.warn("We received no playlist to switch to. Please check your stream."),!1;const c=`allowing switch ${e&&e.id||"null"} -> ${s.id}`;if(!e)return l(`${c} as current playlist is not set`),!0;if(s.id===e.id)return!1;const u=Boolean(Oa(t,i).length);if(!e.endList)return u||"number"!=typeof e.partTargetDuration?(l(`${c} as current playlist is live`),!0):(l(`not ${c} as current playlist is live llhls, but currentTime isn't in buffered.`),!1);const h=Ma(t,i),d=o?Mo.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Mo.MAX_BUFFER_LOW_WATER_LINE;if(a<d)return l(`${c} as duration < max low water line (${a} < ${d})`),!0;const p=s.attributes.BANDWIDTH,f=e.attributes.BANDWIDTH;if(p<f&&(!o||h<r)){let e=`${c} as next bandwidth < current bandwidth (${p} < ${f})`;return o&&(e+=` and forwardBuffer < bufferHighWaterLine (${h} < ${r})`),l(e),!0}if((!o||p>f)&&h>=n){let e=`${c} as forwardBuffer >= bufferLowWaterLine (${h} >= ${n})`;return o&&(e+=` and next bandwidth > current bandwidth (${p} > ${f})`),l(e),!0}return l(`not ${c} as no switching criteria met`),!1}({buffered:this.tech_.buffered(),currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:s,bufferHighWaterLine:n,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",(()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")})),this.mainSegmentLoader_.on("timeout",(()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()})),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",(()=>{this.trigger("progress")})),this.mainSegmentLoader_.on("error",(()=>{const e=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:e.playlist,error:e})})),this.mainSegmentLoader_.on("appenderror",(()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")})),this.mainSegmentLoader_.on("syncinfoupdate",(()=>{this.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("timestampoffset",(()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})})),this.audioSegmentLoader_.on("syncinfoupdate",(()=>{this.onSyncInfoUpdate_()})),this.audioSegmentLoader_.on("appenderror",(()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")})),this.mainSegmentLoader_.on("ended",(()=>{this.logger_("main segment loader ended"),this.onEndOfStream()})),this.mainSegmentLoader_.on("earlyabort",(e=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:10}))}));const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const e=this.getCodecsOrExclude_();e&&this.sourceUpdater_.addOrChangeSourceBuffers(e)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",(()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("fmp4",(()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("ended",(()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}))}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}fastQualityChange_(e=this.selectPlaylist()){e&&e===this.mainPlaylistLoader_.media()?this.logger_("skipping fastQualityChange because new media is same as old"):(this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0)}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything((()=>{this.tech_.setCurrentTime(this.tech_.currentTime())}))}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0)?this.tech_.setCurrentTime(e.end(e.length-1)):void 0}setupFirstPlay(){const e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList||e.start){const t=this.seekable();if(!t.length)return!1;const i=t.end(0);let s=i;if(e.start){const n=e.start.timeOffset;s=n<0?Math.max(i+n,t.start(0)):Math.min(i,n)}this.trigger("firstplay"),this.tech_.setCurrentTime(s)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){const e=this.tech_.play();void 0!==e&&"function"==typeof e.then&&e.then(null,(e=>{}))}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();e=!t||t.hasVideo?e&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const t=this.syncController_.getExpiredTime(e,this.duration());if(null===t)return!1;const i=gc.Playlist.playlistEnd(e,t),s=this.tech_.currentTime(),n=this.tech_.buffered();if(!n.length)return i-s<=Ia;const r=n.end(n.length-1);return r-s<=Ia&&i-r<=Ia}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:i}){if(e=e||this.mainPlaylistLoader_.media(),i=i||t.playlistExclusionDuration||this.playlistExclusionDuration,!e)return this.error=t,void("open"!==this.mediaSource.readyState?this.trigger("error"):this.sourceUpdater_.endOfStream("network"));e.playlistErrors_++;const s=this.mainPlaylistLoader_.main.playlists,n=s.filter(Xa),r=1===n.length&&n[0]===e;if(1===s.length&&i!==1/0)return va.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(r);if(r){if(this.main().contentSteering){const t=this.pathwayAttribute_(e),i=1e3*this.contentSteeringController_.steeringManifest.ttl;return this.contentSteeringController_.excludePathway(t),this.excludeThenChangePathway_(),void setTimeout((()=>{this.contentSteeringController_.addAvailablePathway(t)}),i)}let t=!1;s.forEach((i=>{if(i===e)return;const s=i.excludeUntil;void 0!==s&&s!==1/0&&(t=!0,delete i.excludeUntil)})),t&&(va.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let a;a=e.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*i,e.excludeUntil=a,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const o=this.selectPlaylist();if(!o)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");const l=t.internal?this.logger_:va.log.warn,c=t.message?" "+t.message:"";l(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${c} Switching to playlist ${o.id}.`),o.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),o.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const u=o.targetDuration/2*1e3||5e3,h="number"==typeof o.lastRequest&&Date.now()-o.lastRequest<=u;return this.switchMedia_(o,"exclude",r||h)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const i=[],s="all"===e;(s||"main"===e)&&i.push(this.mainPlaylistLoader_);const n=[];(s||"audio"===e)&&n.push("AUDIO"),(s||"subtitle"===e)&&(n.push("CLOSED-CAPTIONS"),n.push("SUBTITLES")),n.forEach((e=>{const t=this.mediaTypes_[e]&&this.mediaTypes_[e].activePlaylistLoader;t&&i.push(t)})),["main","audio","subtitle"].forEach((t=>{const s=this[`${t}SegmentLoader_`];!s||e!==t&&"all"!==e||i.push(s)})),i.forEach((e=>t.forEach((t=>{"function"==typeof e[t]&&e[t]()}))))}setCurrentTime(e){const t=Oa(this.tech_.buffered(),e);return this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media()&&this.mainPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),void this.load()):0}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:gc.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}onSyncInfoUpdate_(){let e;if(!this.mainPlaylistLoader_)return;let t=this.mainPlaylistLoader_.media();if(!t)return;let i=this.syncController_.getExpiredTime(t,this.duration());if(null===i)return;const s=this.mainPlaylistLoader_.main,n=gc.Playlist.seekable(t,i,gc.Playlist.liveEdgeDelay(s,t));if(0===n.length)return;if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),i=this.syncController_.getExpiredTime(t,this.duration()),null===i)return;if(e=gc.Playlist.seekable(t,i,gc.Playlist.liveEdgeDelay(s,t)),0===e.length)return}let r,a;this.seekable_&&this.seekable_.length&&(r=this.seekable_.end(0),a=this.seekable_.start(0)),e?e.start(0)>n.end(0)||n.start(0)>e.end(0)?this.seekable_=n:this.seekable_=ka([[e.start(0)>n.start(0)?e.start(0):n.start(0),e.end(0)<n.end(0)?e.end(0):n.end(0)]]):this.seekable_=n,this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===r&&this.seekable_.start(0)===a||(this.logger_(`seekable updated [${Da(this.seekable_)}]`),this.tech_.trigger("seekablechanged"))}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),"open"!==this.mediaSource.readyState)return this.updateDuration_=this.updateDuration.bind(this,e),void this.mediaSource.addEventListener("sourceopen",this.updateDuration_);if(e){const e=this.seekable();if(!e.length)return;return void((isNaN(this.mediaSource.duration)||this.mediaSource.duration<e.end(e.length-1))&&this.sourceUpdater_.setDuration(e.end(e.length-1)))}const t=this.tech_.buffered();let i=gc.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(i=Math.max(i,t.end(t.length-1))),this.mediaSource.duration!==i&&this.sourceUpdater_.setDuration(i)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach((e=>{const t=this.mediaTypes_[e].groups;for(const e in t)t[e].forEach((e=>{e.playlistLoader&&e.playlistLoader.dispose()}))})),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!i)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const i=ll(this.main(),t),s={},n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(s.video=i.video||e.main.videoCodec||"avc1.4d400d"),e.main.isMuxed&&(s.video+=`,${i.audio||e.main.audioCodec||F}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||n)&&(s.audio=i.audio||e.main.audioCodec||e.audio.audioCodec||F,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!s.audio&&!s.video)return void this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});const r={};let a;if(["video","audio"].forEach((function(t){if(s.hasOwnProperty(t)&&(i=e[t].isFmp4,n=s[t],!(i?U(n):B(n)))){const i=e[t].isFmp4?"browser":"muxer";r[i]=r[i]||[],r[i].push(s[t]),"audio"===t&&(a=i)}var i,n})),n&&a&&t.attributes.AUDIO){const e=t.attributes.AUDIO;this.main().playlists.forEach((i=>{(i.attributes&&i.attributes.AUDIO)===e&&i!==t&&(i.excludeUntil=1/0)})),this.logger_(`excluding audio group ${e} as ${a} does not support codec(s): "${s.audio}"`)}if(!Object.keys(r).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const e=[];if(["video","audio"].forEach((t=>{const i=(N(this.sourceUpdater_.codecs[t]||"")[0]||{}).type,n=(N(s[t]||"")[0]||{}).type;i&&n&&i.toLowerCase()!==n.toLowerCase()&&e.push(`"${this.sourceUpdater_.codecs[t]}" -> "${s[t]}"`)})),e.length)return void this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${e.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0})}return s}{const e=Object.keys(r).reduce(((e,t)=>(e&&(e+=", "),e+`${t} does not support codec(s): "${r[t].join(",")}"`)),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:e},playlistExclusionDuration:1/0})}}tryToCreateSourceBuffers_(){if("open"!==this.mediaSource.readyState||this.sourceUpdater_.hasCreatedSourceBuffers())return;if(!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach((i=>{const s=e[i];if(-1!==t.indexOf(s.id))return;t.push(s.id);const n=ll(this.main,s),r=[];!n.audio||B(n.audio)||U(n.audio)||r.push(`audio codec ${n.audio}`),!n.video||B(n.video)||U(n.video)||r.push(`video codec ${n.video}`),n.text&&"stpp.ttml.im1t"===n.text&&r.push(`text codec ${n.text}`),r.length&&(s.excludeUntil=1/0,this.logger_(`excluding ${s.id} for unsupported: ${r.join(", ")}`))}))}excludeIncompatibleVariants_(e){const t=[],i=this.main().playlists,s=al(N(e)),n=ol(s),r=s.video&&N(s.video)[0]||null,a=s.audio&&N(s.audio)[0]||null;Object.keys(i).forEach((e=>{const s=i[e];if(-1!==t.indexOf(s.id)||s.excludeUntil===1/0)return;t.push(s.id);const o=[],l=ll(this.mainPlaylistLoader_.main,s),c=ol(l);if(l.audio||l.video){if(c!==n&&o.push(`codec count "${c}" !== "${n}"`),!this.sourceUpdater_.canChangeType()){const e=l.video&&N(l.video)[0]||null,t=l.audio&&N(l.audio)[0]||null;e&&r&&e.type.toLowerCase()!==r.type.toLowerCase()&&o.push(`video codec "${e.type}" !== "${r.type}"`),t&&a&&t.type.toLowerCase()!==a.type.toLowerCase()&&o.push(`audio codec "${t.type}" !== "${a.type}"`)}o.length&&(s.excludeUntil=1/0,this.logger_(`excluding ${s.id}: ${o.join(" && ")}`))}}))}updateAdCues_(e){let t=0;const i=this.seekable();i.length&&(t=i.start(0)),function(e,t,i=0){if(!e.segments)return;let s,r=i;for(let i=0;i<e.segments.length;i++){const a=e.segments[i];if(s||(s=Ql(t,r+a.duration/2)),s){if("cueIn"in a){s.endTime=r,s.adEndTime=r,r+=a.duration,s=null;continue}if(r<s.endTime){r+=a.duration;continue}s.endTime+=a.duration}else if("cueOut"in a&&(s=new(n().VTTCue)(r,r+a.duration,a.cueOut),s.adStartTime=r,s.adEndTime=r+parseFloat(a.cueOut),t.addCue(s)),"cueOutCont"in a){const[e,i]=a.cueOutCont.split("/").map(parseFloat);s=new(n().VTTCue)(r,r+a.duration,""),s.adStartTime=r-e,s.adEndTime=s.adStartTime+i,t.addCue(s)}r+=a.duration}}(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=Mo.GOAL_BUFFER_LENGTH,i=Mo.GOAL_BUFFER_LENGTH_RATE,s=Math.max(t,Mo.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,s)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=Mo.BUFFER_LOW_WATER_LINE,i=Mo.BUFFER_LOW_WATER_LINE_RATE,s=Math.max(t,Mo.MAX_BUFFER_LOW_WATER_LINE),n=Math.max(t,Mo.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?n:s)}bufferHighWaterLine(){return Mo.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){_l(this.inbandTextTracks_,"com.apple.streaming",this.tech_),(({inbandTextTracks:e,dateRanges:t})=>{const i=e.metadataTrack_;if(!i)return;const s=n().WebKitDataCue||n().VTTCue;t.forEach((e=>{for(const t of Object.keys(e)){if(vl.has(t))continue;const n=new s(e.startTime,e.endTime,"");n.id=e.id,n.type="com.apple.quicktime.HLS",n.value={key:yl[t],data:e[t]},"scte35Out"!==t&&"scte35In"!==t||(n.value.data=new Uint8Array(n.value.data.match(/[\da-f]{2}/gi)).buffer),i.addCue(n)}e.processDateRange()}))})({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,i){const s=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();_l(this.inbandTextTracks_,e,this.tech_),(({inbandTextTracks:e,metadataArray:t,timestampOffset:i,videoDuration:s})=>{if(!t)return;const r=n().WebKitDataCue||n().VTTCue,a=e.metadataTrack_;if(!a)return;if(t.forEach((e=>{const t=e.cueTime+i;!("number"!=typeof t||n().isNaN(t)||t<0)&&t<1/0&&e.frames&&e.frames.length&&e.frames.forEach((e=>{const i=new r(t,t,e.value||e.url||e.data||"");i.frame=e,i.value=e,function(e){Object.defineProperties(e.frame,{id:{get:()=>(va.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key)},value:{get:()=>(va.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data)},privateData:{get:()=>(va.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data)}})}(i),a.addCue(i)}))})),!a.cues||!a.cues.length)return;const o=a.cues,l=[];for(let e=0;e<o.length;e++)o[e]&&l.push(o[e]);const c=l.reduce(((e,t)=>{const i=e[t.startTime]||[];return i.push(t),e[t.startTime]=i,e}),{}),u=Object.keys(c).sort(((e,t)=>Number(e)-Number(t)));u.forEach(((e,t)=>{const i=c[e],n=isFinite(s)?s:e,r=Number(u[t+1])||n;i.forEach((e=>{e.endTime=r}))}))})({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:s,videoDuration:i})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart?this.contentSteeringController_.requestSteeringManifest(!0):this.tech_.one("canplay",(()=>{this.contentSteeringController_.requestSteeringManifest()}))}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),"dash"===this.sourceType_&&this.mainPlaylistLoader_.on("loadedplaylist",(()=>{const e=this.main();(this.contentSteeringController_.didDASHTagChange(e.uri,e.contentSteering)||(()=>{const t=this.contentSteeringController_.getAvailablePathways(),i=[];for(const s of e.playlists){const e=s.attributes.serviceLocation;if(e&&(i.push(e),!t.has(e)))return!0}return!(i.length||!t.size)})())&&this.resetContentSteeringController_()}))}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const t=this.main().playlists,i=new Set;let s=!1;Object.keys(t).forEach((n=>{const r=t[n],a=this.pathwayAttribute_(r),o=a&&e!==a;r.excludeUntil===1/0&&"content-steering"===r.lastExcludeReason_&&!o&&(delete r.excludeUntil,delete r.lastExcludeReason_,s=!0);const l=!r.excludeUntil&&r.excludeUntil!==1/0;!i.has(r.id)&&o&&l&&(i.add(r.id),r.excludeUntil=1/0,r.lastExcludeReason_="content-steering",this.logger_(`excluding ${r.id} for ${r.lastExcludeReason_}`))})),"DASH"===this.contentSteeringController_.manifestType_&&Object.keys(this.mediaTypes_).forEach((t=>{const i=this.mediaTypes_[t];if(i.activePlaylistLoader){const t=i.activePlaylistLoader.media_;t&&t.attributes.serviceLocation!==e&&(s=!0)}})),s&&this.changeSegmentPathway_()}handlePathwayClones_(){const e=this.main().playlists,t=this.contentSteeringController_.currentPathwayClones,i=this.contentSteeringController_.nextPathwayClones;if(t&&t.size||i&&i.size){for(const[e,s]of t.entries())i.get(e)||(this.mainPlaylistLoader_.updateOrDeleteClone(s),this.contentSteeringController_.excludePathway(e));for(const[s,n]of i.entries()){const i=t.get(s);i?this.equalPathwayClones_(i,n)||(this.mainPlaylistLoader_.updateOrDeleteClone(n,!0),this.contentSteeringController_.addAvailablePathway(s)):(e.filter((e=>e.attributes["PATHWAY-ID"]===n["BASE-ID"])).forEach((e=>{this.mainPlaylistLoader_.addClonePathway(n,e)})),this.contentSteeringController_.addAvailablePathway(s))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...i])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;const i=e["URI-REPLACEMENT"].PARAMS,s=t["URI-REPLACEMENT"].PARAMS;for(const e in i)if(i[e]!==s[e])return!1;for(const e in s)if(i[e]!==s[e])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),"DASH"===this.contentSteeringController_.manifestType_&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach((i=>{const s=this.mainPlaylistLoader_.getKeyIdSet(i);s&&s.size&&s.forEach((s=>{const n="usable",r=this.keyStatusMap_.has(s)&&this.keyStatusMap_.get(s)===n,a=i.lastExcludeReason_===t&&i.excludeUntil===1/0;r?r&&a&&(delete i.excludeUntil,delete i.lastExcludeReason_,this.logger_(`enabling playlist ${i.id} because key ID ${s} is ${n}`)):(i.excludeUntil!==1/0&&i.lastExcludeReason_!==t&&(i.excludeUntil=1/0,i.lastExcludeReason_=t,this.logger_(`excluding playlist ${i.id} because the key ID ${s} doesn't exist in the keyStatusMap or is not ${n}`)),e++)}))})),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach((e=>{const i=e&&e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height<720,s=e.excludeUntil===1/0&&e.lastExcludeReason_===t;i&&s&&(delete e.excludeUntil,va.log.warn(`enabling non-HD playlist ${e.id} because all playlists were excluded due to ${t} key IDs`))}))}addKeyStatus_(e,t){const i=("string"==typeof e?e:(e=>{const t=new Uint8Array(e);return Array.from(t).map((e=>e.toString(16).padStart(2,"0"))).join("")})(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${i} added to the keyStatusMap`),this.keyStatusMap_.set(i,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}class bc{constructor(e,t,i){const{playlistController_:s}=e,n=s.fastQualityChange_.bind(s);if(t.attributes){const e=t.attributes.RESOLUTION;this.width=e&&e.width,this.height=e&&e.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}var r,a,o;this.codecs=ll(s.main(),t),this.playlist=t,this.id=i,this.enabled=(r=e.playlists,a=t.id,o=n,e=>{const t=r.main.playlists[a],i=Ga(t),s=Xa(t);return void 0===e?s:(e?delete t.disabled:t.disabled=!0,e===s||i||(o(),e?r.trigger("renditionenabled"):r.trigger("renditiondisabled")),e)})}}const Tc=["seeking","seeked","pause","playing","error"];class Sc{constructor(e){this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=Ca("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),i=()=>this.monitorCurrentTime_(),s=()=>this.techWaiting_(),r=()=>this.resetTimeUpdate_(),a=this.playlistController_,o=["main","subtitle","audio"],l={};o.forEach((e=>{l[e]={reset:()=>this.resetSegmentDownloads_(e),updateend:()=>this.checkSegmentDownloads_(e)},a[`${e}SegmentLoader_`].on("appendsdone",l[e].updateend),a[`${e}SegmentLoader_`].on("playlistupdate",l[e].reset),this.tech_.on(["seeked","seeking"],l[e].reset)}));const c=e=>{["main","audio"].forEach((t=>{a[`${t}SegmentLoader_`][e]("appended",this.seekingAppendCheck_)}))};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),c("off"))},this.clearSeekingAppendCheck_=()=>c("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),c("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",s),this.tech_.on(Tc,r),this.tech_.on("canplay",i),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",s),this.tech_.off(Tc,r),this.tech_.off("canplay",i),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),o.forEach((e=>{a[`${e}SegmentLoader_`].off("appendsdone",l[e].updateend),a[`${e}SegmentLoader_`].off("playlistupdate",l[e].reset),this.tech_.off(["seeked","seeking"],l[e].reset)})),this.checkCurrentTimeTimeout_&&n().clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&n().clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=n().setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,i=t[`${e}SegmentLoader_`],s=i.buffered_(),n=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e)return!0;if(e.length!==t.length)return!0;for(let i=0;i<e.length;i++)if(e.start(i)!==t.start(i)||e.end(i)!==t.end(i))return!0;return!1}(this[`${e}Buffered_`],s);this[`${e}Buffered_`]=s,n?this.resetSegmentDownloads_(e):(this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:Ra(s)}),this[`${e}StalledDownloads_`]<10||(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),"subtitle"!==e&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0})))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Ia>=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const e=this.seekable(),t=this.tech_.currentTime();let i;if(this.afterSeekableWindow_(e,t,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(i=e.end(e.length-1)),this.beforeSeekableWindow_(e,t)){const t=e.start(0);i=t+(t===e.end(0)?0:Ia)}if(void 0!==i)return this.logger_(`Trying to seek outside of seekable at time ${t} with seekable range ${Da(e)}. Seeking to ${i}.`),this.tech_.setCurrentTime(i),!0;const s=this.playlistController_.sourceUpdater_,n=this.tech_.buffered(),r=s.audioBuffer?s.audioBuffered():null,a=s.videoBuffer?s.videoBuffered():null,o=this.media(),l=o.partTargetDuration?o.partTargetDuration:2*(o.targetDuration-Aa),c=[r,a];for(let e=0;e<c.length;e++)if(c[e]&&Ma(c[e],t)<l)return!1;const u=La(n,t);return 0!==u.length&&(i=u.start(0)+Ia,this.logger_(`Buffered region starts (${u.start(0)}) just beyond seek point (${t}). Seeking to ${i}.`),this.tech_.setCurrentTime(i),!0)}waiting_(){if(this.techWaiting_())return;const e=this.tech_.currentTime(),t=this.tech_.buffered(),i=Oa(t,e);return i.length&&e+3<=i.end(0)?(this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${i.start(0)} -> ${i.end(0)}]. Attempting to resume playback by seeking to the current time.`),void this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"})):void 0}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const i=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${i}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const i=this.tech_.vhs.playlistController_.sourceUpdater_,s=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;const n=La(s,t);return n.length>0&&(this.logger_(`Stopped at ${t} and seeking to ${n.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0)}afterSeekableWindow_(e,t,i,s=!1){if(!e.length)return!1;let n=e.end(e.length-1)+Ia;const r=!i.endList,a="number"==typeof i.partTargetDuration;return r&&(a||s)&&(n=e.end(e.length-1)+3*i.targetDuration),t>n}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:i}){if(!e)return;let s;if(e.length&&t.length){const n=Oa(e,i-3),r=Oa(e,i),a=Oa(t,i);a.length&&!r.length&&n.length&&(s={start:n.end(0),end:a.end(0)})}else La(e,i).length||(s=this.gapFromVideoUnderflow_(e,i));return!!s&&(this.logger_(`Encountered a gap in video from ${s.start} to ${s.end}. Seeking to current time ${i}`),!0)}skipTheGap_(e){const t=this.tech_.buffered(),i=this.tech_.currentTime(),s=La(t,i);this.resetTimeUpdate_(),0!==s.length&&i===e&&(this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",s.start(0)),this.tech_.setCurrentTime(s.start(0)+Aa),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}))}gapFromVideoUnderflow_(e,t){const i=function(e){if(e.length<2)return ka();const t=[];for(let i=1;i<e.length;i++){const s=e.end(i-1),n=e.start(i);t.push([s,n])}return ka(t)}(e);for(let e=0;e<i.length;e++){const s=i.start(e),n=i.end(e);if(t-s<4&&t-s>2)return{start:s,end:n}}return null}}const wc={errorInterval:30,getSource(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},Ec=function(e,t){let i=0,s=0;const n=xa(wc,t);e.ready((()=>{e.trigger({type:"usage",name:"vhs-error-reload-initialized"})}));const r=function(){s&&e.currentTime(s)},a=function(t){null!=t&&(s=e.duration()!==1/0&&e.currentTime()||0,e.one("loadedmetadata",r),e.src(t),e.trigger({type:"usage",name:"vhs-error-reload"}),e.play())},o=function(){if(Date.now()-i<1e3*n.errorInterval)e.trigger({type:"usage",name:"vhs-error-reload-canceled"});else{if(n.getSource&&"function"==typeof n.getSource)return i=Date.now(),n.getSource.call(e,a);va.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}},l=function(){e.off("loadedmetadata",r),e.off("error",o),e.off("dispose",l)};e.on("error",o),e.on("dispose",l),e.reloadSourceOnError=function(t){l(),Ec(e,t)}};var Cc="3.12.0";const xc={PlaylistLoader:go,Playlist:eo,utils:ko,STANDARD_PLAYLIST_SELECTOR:ml,INITIAL_PLAYLIST_SELECTOR:function(){const e=this.playlists.main.playlists.filter(eo.isEnabled);return dl(e,((e,t)=>pl(e,t))),e.filter((e=>!!ll(this.playlists.main,e).video))[0]||null},lastBandwidthSelector:ml,movingAverageBandwidthSelector:function(e){let t=-1,i=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let s=this.useDevicePixelRatio&&n().devicePixelRatio||1;return isNaN(this.customPixelRatio)||(s=this.customPixelRatio),t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),fl(this.playlists.main,t,parseInt(hl(this.tech_.el(),"width"),10)*s,parseInt(hl(this.tech_.el(),"height"),10)*s,this.limitRenditionByPlayerDimensions,this.playlistController_)}},comparePlaylistBandwidth:pl,comparePlaylistResolution:function(e,t){let i,s;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||n().Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(s=t.attributes.RESOLUTION.width),s=s||n().Number.MAX_VALUE,i===s&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-s},xhr:vo()};Object.keys(Mo).forEach((e=>{Object.defineProperty(xc,e,{get:()=>(va.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),Mo[e]),set(t){va.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),"number"!=typeof t||t<0?va.log.warn(`value of Vhs.${e} must be greater than or equal to 0`):Mo[e]=t}})}));const kc="videojs-vhs",Ac=function(e,t){const i=t.media();let s=-1;for(let t=0;t<e.length;t++)if(e[t].id===i.id){s=t;break}e.selectedIndex_=s,e.trigger({selectedIndex:s,type:"change"})};xc.canPlaySource=function(){return va.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const Ic=()=>{if(!n().localStorage)return null;const e=n().localStorage.getItem(kc);if(!e)return null;try{return JSON.parse(e)}catch(e){return null}},Pc=(e,t)=>{e._requestCallbackSet||(e._requestCallbackSet=new Set),e._requestCallbackSet.add(t)},Oc=(e,t)=>{e._responseCallbackSet||(e._responseCallbackSet=new Set),e._responseCallbackSet.add(t)},Lc=(e,t)=>{e._requestCallbackSet&&(e._requestCallbackSet.delete(t),e._requestCallbackSet.size||delete e._requestCallbackSet)},Dc=(e,t)=>{e._responseCallbackSet&&(e._responseCallbackSet.delete(t),e._responseCallbackSet.size||delete e._responseCallbackSet)};xc.supportsNativeHls=function(){if(!a()||!a().createElement)return!1;const e=a().createElement("video");return!!va.getTech("Html5").isSupported()&&["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some((function(t){return/maybe|probably/i.test(e.canPlayType(t))}))}(),xc.supportsNativeDash=!!(a()&&a().createElement&&va.getTech("Html5").isSupported())&&/maybe|probably/i.test(a().createElement("video").canPlayType("application/dash+xml")),xc.supportsTypeNatively=e=>"hls"===e?xc.supportsNativeHls:"dash"===e&&xc.supportsNativeDash,xc.isSupported=function(){return va.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},xc.xhr.onRequest=function(e){Pc(xc.xhr,e)},xc.xhr.onResponse=function(e){Oc(xc.xhr,e)},xc.xhr.offRequest=function(e){Lc(xc.xhr,e)},xc.xhr.offResponse=function(e){Dc(xc.xhr,e)};const Rc=va.getComponent("Component");class Nc extends Rc{constructor(e,t,i){if(super(t,i.vhs),"number"==typeof i.initialBandwidth&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=Ca("VhsHandler"),t.options_&&t.options_.playerId){const e=va.getPlayer(t.options_.playerId);this.player_=e}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(a(),["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],(e=>{const t=a().fullscreenElement||a().webkitFullscreenElement||a().mozFullScreenElement||a().msFullscreenElement;t&&t.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()})),this.on(this.tech_,"seeking",(function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())})),this.on(this.tech_,"error",(function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()})),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=xa(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage=void 0!==this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=!1!==this.options_.llhls,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,"number"!=typeof this.options_.playlistExclusionDuration&&(this.options_.playlistExclusionDuration=60),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){const e=Ic();e&&e.bandwidth&&(this.options_.bandwidth=e.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),e&&e.throughput&&(this.options_.throughput=e.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}"number"!=typeof this.options_.bandwidth&&(this.options_.bandwidth=Mo.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Mo.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach((e=>{void 0!==this.source_[e]&&(this.options_[e]=this.source_[e])})),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio;const t=this.options_.customPixelRatio;"number"==typeof t&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;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=xc,this.options_.sourceType=H(t),this.options_.seekTo=e=>{this.tech_.setCurrentTime(e)},this.playlistController_=new _c(this.options_);const s=xa({liveRangeSafeTimeDelta:Ia},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new Sc(s),this.playlistController_.on("error",(()=>{const e=va.players[this.tech_.options_.playerId];let t=this.playlistController_.error;"object"!=typeof t||t.code?"string"==typeof t&&(t={message:t,code:3}):t.code=3,e.error(t)}));const r=this.options_.bufferBasedABR?xc.movingAverageBandwidthSelector(.55):xc.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=xc.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(e){this.playlistController_.selectPlaylist=e.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(e){this.playlistController_.mainSegmentLoader_.throughput.rate=e,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let e=this.playlistController_.mainSegmentLoader_.bandwidth;const t=n().navigator.connection||n().navigator.mozConnection||n().navigator.webkitConnection,i=1e7;if(this.options_.useNetworkInformationApi&&t){const s=1e3*t.downlink*1e3;e=s>=i&&e>=i?Math.max(e,s):s}return e},set(e){this.playlistController_.mainSegmentLoader_.bandwidth=e,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const e=1/(this.bandwidth||1);let t;return t=this.throughput>0?1/this.throughput:0,Math.floor(1/(e+t))},set(){va.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>Ra(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>Ra(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",(()=>{this.options_.useBandwidthFromLocalStorage&&(e=>{if(!n().localStorage)return!1;let t=Ic();t=t?xa(t,e):e;try{n().localStorage.setItem(kc,JSON.stringify(t))}catch(e){return!1}})({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})})),this.playlistController_.on("selectedinitialmedia",(()=>{var e;(e=this).representations=()=>{const t=e.playlistController_.main(),i=Za(t)?e.playlistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter((e=>!Ga(e))).map(((t,i)=>new bc(e,t,t.id))):[]}})),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",(()=>{this.setupEme_()})),this.on(this.playlistController_,"progress",(function(){this.tech_.trigger("progress")})),this.on(this.playlistController_,"firstplay",(function(){this.ignoreNextSeekingEvent_=!0})),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=n().URL.createObjectURL(this.playlistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),(({player:e,sourceKeySystems:t,audioMedia:i,mainPlaylists:s})=>{if(!e.eme.initializeMediaKeys)return Promise.resolve();const n=(o=i?s.concat([i]):s,l=Object.keys(t),o.reduce(((e,t)=>{if(!t.contentProtection)return e;const i=l.reduce(((e,i)=>{const s=t.contentProtection[i];return s&&s.pssh&&(e[i]={pssh:s.pssh}),e}),{});return Object.keys(i).length&&e.push(i),e}),[])),r=[],a=[];var o,l;return n.forEach((t=>{a.push(new Promise(((t,i)=>{e.tech_.one("keysessioncreated",t)}))),r.push(new Promise(((i,s)=>{e.eme.initializeMediaKeys({keySystems:t},(e=>{e?s(e):i()}))})))})),Promise.race([Promise.all(r),Promise.race(a)])})({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then((()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()})).catch((e=>{this.logger_("error while creating EME key session",e),this.player_.error({message:"Failed to initialize media keys for EME",code:3,metadata:{errorType:va.Error.EMEKeySessionCreationError}})}))}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=(({player:e,sourceKeySystems:t,media:i,audioMedia:s})=>{const n=((e,t,i)=>{if(!e)return e;let s={};t&&t.attributes&&t.attributes.CODECS&&(s=al(N(t.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(s.audio=i.attributes.CODECS);const n=j(s.video),r=j(s.audio),a={};for(const i in e)a[i]={},r&&(a[i].audioContentType=r),n&&(a[i].videoContentType=n),t.contentProtection&&t.contentProtection[i]&&t.contentProtection[i].pssh&&(a[i].pssh=t.contentProtection[i].pssh),"string"==typeof e[i]&&(a[i].url=e[i]);return xa(e,a)})(t,i,s);return!(!n||(e.currentSource().keySystems=n,n&&!e.eme&&(va.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),1)))})({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});this.player_.tech_.on("keystatuschange",(e=>{this.playlistController_.updatePlaylistByKeyStatus(e.keyId,e.status)})),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),t?this.createKeySessions_():this.playlistController_.sourceUpdater_.initializedEme()}setupQualityLevels_(){const e=va.players[this.tech_.options_.playerId];e&&e.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",(()=>{!function(e,t){t.representations().forEach((t=>{e.addQualityLevel(t)})),Ac(e,t.playlists)}(this.qualityLevels_,this)})),this.playlists.on("mediachange",(()=>{Ac(this.qualityLevels_,this.playlists)})))}static version(){return{"@videojs/http-streaming":Cc,"mux.js":"7.0.3","mpd-parser":"1.3.0","m3u8-parser":"7.1.0","aes-decrypter":"4.0.1"}}version(){return this.constructor.version()}canChangeType(){return Wl.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&n().URL.revokeObjectURL&&(n().URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return(({playlist:e,time:t,callback:i})=>{if(!i)throw new Error("getProgramTime: callback must be provided");if(!e||void 0===t)return i({message:"getProgramTime: playlist and time must be provided"});const s=((e,t)=>{if(!t||!t.segments||0===t.segments.length)return null;let i,s=0;for(let n=0;n<t.segments.length&&(i=t.segments[n],s=i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationEnd:s+i.duration,!(e<=s));n++);const n=t.segments[t.segments.length-1];if(n.videoTimingInfo&&n.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>s){if(e>s+.25*n.duration)return null;i=n}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:s-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}})(t,e);if(!s)return i({message:"valid programTime was not found"});if("estimate"===s.type)return i({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:s.estimatedStart});const n={mediaSeconds:t},r=((e,t)=>{if(!t.dateTimeObject)return null;const i=t.videoTimingInfo.transmuxerPrependedSeconds,s=e-(t.videoTimingInfo.transmuxedPresentationStart+i);return new Date(t.dateTimeObject.getTime()+1e3*s)})(t,s.segment);return r&&(n.programDateTime=r.toISOString()),i(null,n)})({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=!0,s=2){return Ao({programTime:e,playlist:this.playlistController_.media(),retryCount:s,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{Pc(this.xhr,e)},this.xhr.onResponse=e=>{Oc(this.xhr,e)},this.xhr.offRequest=e=>{Lc(this.xhr,e)},this.xhr.offResponse=e=>{Dc(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}}const Mc={name:"videojs-http-streaming",VERSION:Cc,canHandleSource(e,t={}){const i=xa(va.options,t);return Mc.canPlayType(e.type,i)},handleSource(e,t,i={}){const s=xa(va.options,i);return t.vhs=new Nc(e,t,s),t.vhs.xhr=vo(),t.vhs.setupXhrHooks_(),t.vhs.src(e.src,e.type),t.vhs},canPlayType(e,t){const i=H(e);if(!i)return"";const s=Mc.getOverrideNative(t);return!xc.supportsTypeNatively(i)||s?"maybe":""},getOverrideNative(e={}){const{vhs:t={}}=e,i=!(va.browser.IS_ANY_SAFARI||va.browser.IS_IOS),{overrideNative:s=i}=t;return s}};U("avc1.4d400d,mp4a.40.2")&&va.getTech("Html5").registerSourceHandler(Mc,0),va.VhsHandler=Nc,va.VhsSourceHandler=Mc,va.Vhs=xc,va.use||va.registerComponent("Vhs",xc),va.options.vhs=va.options.vhs||{},va.getPlugin&&va.getPlugin("reloadSourceOnError")||va.registerPlugin("reloadSourceOnError",(function(e){Ec(this,e)}))},52:(e,t,i)=>{var s=i(5204),n=e.exports={WebVTT:i(5483),VTTCue:i(2980),VTTRegion:i(6791)};s.vttjs=n,s.WebVTT=n.WebVTT;var r=n.VTTCue,a=n.VTTRegion,o=s.VTTCue,l=s.VTTRegion;n.shim=function(){s.VTTCue=r,s.VTTRegion=a},n.restore=function(){s.VTTCue=o,s.VTTRegion=l},s.VTTCue||n.shim()},5483:(e,t,i)=>{var s=i(7509),n=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 r(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function a(e){function t(e,t,i,s){return 3600*(0|e)+60*(0|t)+(0|i)+(0|s)/1e3}var i=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return i?i[3]?t(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function o(){this.values=n(null)}function l(e,t,i,s){var n=s?e.split(s):[e];for(var r in n)if("string"==typeof n[r]){var a=n[r].split(i);2===a.length&&t(a[0].trim(),a[1].trim())}}function c(e,t,i){var s=e;function n(){var t=a(e);if(null===t)throw new r(r.Errors.BadTimeStamp,"Malformed timestamp: "+s);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function c(){e=e.replace(/^\s+/,"")}if(c(),t.startTime=n(),c(),"--\x3e"!==e.substr(0,3))throw new r(r.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+s);e=e.substr(3),c(),t.endTime=n(),c(),function(e,t){var s=new o;l(e,(function(e,t){switch(e){case"region":for(var n=i.length-1;n>=0;n--)if(i[n].id===t){s.set(e,i[n].region);break}break;case"vertical":s.alt(e,t,["rl","lr"]);break;case"line":var r=t.split(","),a=r[0];s.integer(e,a),s.percent(e,a)&&s.set("snapToLines",!1),s.alt(e,a,["auto"]),2===r.length&&s.alt("lineAlign",r[1],["start","center","end"]);break;case"position":r=t.split(","),s.percent(e,r[0]),2===r.length&&s.alt("positionAlign",r[1],["start","center","end"]);break;case"size":s.percent(e,t);break;case"align":s.alt(e,t,["start","center","end","left","right"])}}),/:/,/\s/),t.region=s.get("region",null),t.vertical=s.get("vertical","");try{t.line=s.get("line","auto")}catch(e){}t.lineAlign=s.get("lineAlign","start"),t.snapToLines=s.get("snapToLines",!0),t.size=s.get("size",100);try{t.align=s.get("align","center")}catch(e){t.align=s.get("align","middle")}try{t.position=s.get("position","auto")}catch(e){t.position=s.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=s.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}(e,t)}r.prototype=n(Error.prototype),r.prototype.constructor=r,r.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,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var s=0;s<i.length;++s)if(t===i[s]){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 u=s.createElement&&s.createElement("textarea"),h={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},d={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 i(){if(!t)return null;var e,i=t.match(/^([^<]*)(<[^>]*>?)?/);return e=i[1]?i[1]:i[2],t=t.substr(e.length),e}function s(e,t){return!f[t.localName]||f[t.localName]===e.localName}function n(t,i){var s=h[t];if(!s)return null;var n=e.document.createElement(s),r=p[t];return r&&i&&(n[r]=i.trim()),n}for(var r,o,l=e.document.createElement("div"),c=l,m=[];null!==(r=i());)if("<"!==r[0])c.appendChild(e.document.createTextNode((o=r,u.innerHTML=o,o=u.textContent,u.textContent="",o)));else{if("/"===r[1]){m.length&&m[m.length-1]===r.substr(2).replace(">","")&&(m.pop(),c=c.parentNode);continue}var g,y=a(r.substr(1,r.length-2));if(y){g=e.document.createProcessingInstruction("timestamp",y),c.appendChild(g);continue}var v=r.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!v)continue;if(!(g=n(v[1],v[3])))continue;if(!s(c,g))continue;if(v[2]){var _=v[2].split(".");_.forEach((function(e){var t=/^bg_/.test(e),i=t?e.slice(3):e;if(d.hasOwnProperty(i)){var s=t?"background-color":"color",n=d[i];g.style[s]=n}})),g.className=_.join(" ")}m.push(v[1]),c.appendChild(g),c=g}return l}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],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function y(e){for(var t=0;t<g.length;t++){var i=g[t];if(e>=i[0]&&e<=i[1])return!0}return!1}function v(e){var t=[],i="";if(!e||!e.childNodes)return"ltr";function s(e,t){for(var i=t.childNodes.length-1;i>=0;i--)e.push(t.childNodes[i])}function n(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textContent||t.innerText;if(i){var r=i.match(/^.*(\n|\r)/);return r?(e.length=0,r[0]):i}return"ruby"===t.tagName?n(e):t.childNodes?(s(e,t),n(e)):void 0}for(s(t,e);i=n(t);)for(var r=0;r<i.length;r++)if(y(i.charCodeAt(r)))return"rtl";return"ltr"}function _(){}function b(e,t,i){_.call(this),this.cue=t,this.cueDiv=m(e,t.text);var s={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(s,this.cueDiv),this.div=e.document.createElement("div"),s={direction:v(this.cueDiv),writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:"middle"===t.align?"center":t.align,font:i.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(s),this.div.appendChild(this.cueDiv);var n=0;switch(t.positionAlign){case"start":case"line-left":n=t.position;break;case"center":n=t.position-t.size/2;break;case"end":case"line-right":n=t.position-t.size}""===t.vertical?this.applyStyles({left:this.formatStyle(n,"%"),width:this.formatStyle(t.size,"%")}):this.applyStyles({top:this.formatStyle(n,"%"),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,i,s,n;if(e.div){i=e.div.offsetHeight,s=e.div.offsetWidth,n=e.div.offsetTop;var r=(r=e.div.childNodes)&&(r=r[0])&&r.getClientRects&&r.getClientRects();e=e.div.getBoundingClientRect(),t=r?Math.max(r[0]&&r[0].height||0,e.height/r.length):0}this.left=e.left,this.right=e.right,this.top=e.top||n,this.height=e.height||i,this.bottom=e.bottom||n+(e.height||i),this.width=e.width||s,this.lineHeight=void 0!==t?t:e.lineHeight}function S(e,t,i,s){var n=new T(t),r=t.cue,a=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,i=t.textTrackList,s=0,n=0;n<i.length&&i[n]!==t;n++)"showing"===i[n].mode&&s++;return-1*++s}(r),o=[];if(r.snapToLines){var l;switch(r.vertical){case"":o=["+y","-y"],l="height";break;case"rl":o=["+x","-x"],l="width";break;case"lr":o=["-x","+x"],l="width"}var c=n.lineHeight,u=c*Math.round(a),h=i[l]+c,d=o[0];Math.abs(u)>h&&(u=u<0?-1:1,u*=Math.ceil(h/c)*c),a<0&&(u+=""===r.vertical?i.height:i.width,o=o.reverse()),n.move(d,u)}else{var p=n.lineHeight/i.height*100;switch(r.lineAlign){case"center":a-=p/2;break;case"end":a-=p}switch(r.vertical){case"":t.applyStyles({top:t.formatStyle(a,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(a,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(a,"%")})}o=["+y","-x","+x","-y"],n=new T(t)}var f=function(e,t){for(var n,r=new T(e),a=1,o=0;o<t.length;o++){for(;e.overlapsOppositeAxis(i,t[o])||e.within(i)&&e.overlapsAny(s);)e.move(t[o]);if(e.within(i))return e;var l=e.intersectPercentage(i);a>l&&(n=new T(e),a=l),e=new T(r)}return n||r}(n,o);t.move(f.toCSSCompatValues(i))}function w(){}_.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},_.prototype.formatStyle=function(e,t){return 0===e?0:e+t},b.prototype=n(_.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,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,s=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||s,height:e.height||t,bottom:e.bottom||s+(e.height||t),width:e.width||i}},w.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},w.convertCueToDOMTree=function(e,t){return e&&t?m(e,t):null},w.processCues=function(e,t,i){if(!e||!t||!i)return null;for(;i.firstChild;)i.removeChild(i.firstChild);var s=e.document.createElement("div");if(s.style.position="absolute",s.style.left="0",s.style.right="0",s.style.top="0",s.style.bottom="0",s.style.margin="1.5%",i.appendChild(s),function(e){for(var t=0;t<e.length;t++)if(e[t].hasBeenReset||!e[t].displayState)return!0;return!1}(t)){var n=[],r=T.getSimpleBoxPosition(s),a={font:Math.round(.05*r.height*100)/100+"px sans-serif"};!function(){for(var i,o,l=0;l<t.length;l++)o=t[l],i=new b(e,o,a),s.appendChild(i.div),S(0,i,r,n),o.displayState=i.div,n.push(T.getSimpleBoxPosition(i))}()}else for(var o=0;o<t.length;o++)s.appendChild(t[o].displayState)},w.Parser=function(e,t,i){i||(i=t,t={}),t||(t={}),this.window=e,this.vttjs=t,this.state="INITIAL",this.buffer="",this.decoder=i||new TextDecoder("utf8"),this.regionList=[]},w.Parser.prototype={reportOrThrowError:function(e){if(!(e instanceof r))throw e;this.onparsingerror&&this.onparsingerror(e)},parse:function(e){var t,i=this;function s(){for(var e=i.buffer,t=0;t<e.length&&"\r"!==e[t]&&"\n"!==e[t];)++t;var s=e.substr(0,t);return"\r"===e[t]&&++t,"\n"===e[t]&&++t,i.buffer=e.substr(t),s}e&&(i.buffer+=i.decoder.decode(e,{stream:!0}));try{var n;if("INITIAL"===i.state){if(!/\r\n|\n/.test(i.buffer))return this;var u=(n=s()).match(/^WEBVTT([ \t].*)?$/);if(!u||!u[0])throw new r(r.Errors.BadSignature);i.state="HEADER"}for(var h=!1;i.buffer;){if(!/\r\n|\n/.test(i.buffer))return this;switch(h?h=!1:n=s(),i.state){case"HEADER":/:/.test(n)?(t=n).match(/X-TIMESTAMP-MAP/)?l(t,(function(e,t){"X-TIMESTAMP-MAP"===e&&function(e){var t=new o;l(e,(function(e,i){switch(e){case"MPEGT":t.integer(e+"S",i);break;case"LOCA":t.set(e+"L",a(i))}}),/[^\d]:/,/,/),i.ontimestampmap&&i.ontimestampmap({MPEGTS:t.get("MPEGTS"),LOCAL:t.get("LOCAL")})}(t)}),/=/):l(t,(function(e,t){"Region"===e&&function(e){var t=new o;if(l(e,(function(e,i){switch(e){case"id":t.set(e,i);break;case"width":t.percent(e,i);break;case"lines":t.integer(e,i);break;case"regionanchor":case"viewportanchor":var s=i.split(",");if(2!==s.length)break;var n=new o;if(n.percent("x",s[0]),n.percent("y",s[1]),!n.has("x")||!n.has("y"))break;t.set(e+"X",n.get("x")),t.set(e+"Y",n.get("y"));break;case"scroll":t.alt(e,i,["up"])}}),/=/,/\s/),t.has("id")){var s=new(i.vttjs.VTTRegion||i.window.VTTRegion);s.width=t.get("width",100),s.lines=t.get("lines",3),s.regionAnchorX=t.get("regionanchorX",0),s.regionAnchorY=t.get("regionanchorY",100),s.viewportAnchorX=t.get("viewportanchorX",0),s.viewportAnchorY=t.get("viewportanchorY",100),s.scroll=t.get("scroll",""),i.onregion&&i.onregion(s),i.regionList.push({id:t.get("id"),region:s})}}(t)}),/:/):n||(i.state="ID");continue;case"NOTE":n||(i.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(n)){i.state="NOTE";break}if(!n)continue;i.cue=new(i.vttjs.VTTCue||i.window.VTTCue)(0,0,"");try{i.cue.align="center"}catch(e){i.cue.align="middle"}if(i.state="CUE",-1===n.indexOf("--\x3e")){i.cue.id=n;continue}case"CUE":try{c(n,i.cue,i.regionList)}catch(e){i.reportOrThrowError(e),i.cue=null,i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":var d=-1!==n.indexOf("--\x3e");if(!n||d&&(h=!0)){i.oncue&&i.oncue(i.cue),i.cue=null,i.state="ID";continue}i.cue.text&&(i.cue.text+="\n"),i.cue.text+=n.replace(/\u2028/g,"\n").replace(/u2029/g,"\n");continue;case"BADCUE":n||(i.state="ID");continue}}}catch(e){i.reportOrThrowError(e),"CUETEXT"===i.state&&i.cue&&i.oncue&&i.oncue(i.cue),i.cue=null,i.state="INITIAL"===i.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 r(r.Errors.BadSignature)}catch(t){e.reportOrThrowError(t)}return e.onflush&&e.onflush(),this}},e.exports=w},2980:e=>{var t={"":1,lr:1,rl:1},i={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function s(e){return"string"==typeof e&&!!i[e.toLowerCase()]&&e.toLowerCase()}function n(e,i,n){this.hasBeenReset=!1;var r="",a=!1,o=e,l=i,c=n,u=null,h="",d=!0,p="auto",f="start",m="auto",g="auto",y=100,v="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return r},set:function(e){r=""+e}},pauseOnExit:{enumerable:!0,get:function(){return a},set:function(e){a=!!e}},startTime:{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");o=e,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return l},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");l=e,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return c},set:function(e){c=""+e,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return u},set:function(e){u=e,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return h},set:function(e){var i=function(e){return"string"==typeof e&&!!t[e.toLowerCase()]&&e.toLowerCase()}(e);if(!1===i)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");h=i,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return d},set:function(e){d=!!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=s(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=s(e);t?(g=t,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return y},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");y=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return v},set:function(e){var t=s(e);if(!t)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");v=t,this.hasBeenReset=!0}}}),this.displayState=void 0}n.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},e.exports=n},6791:e=>{var t={"":!0,up:!0};function i(e){return"number"==typeof e&&e>=0&&e<=100}e.exports=function(){var e=100,s=3,n=0,r=100,a=0,o=100,l="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!i(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");s=e}},regionAnchorY:{enumerable:!0,get:function(){return r},set:function(e){if(!i(e))throw new Error("RegionAnchorX must be between 0 and 100.");r=e}},regionAnchorX:{enumerable:!0,get:function(){return n},set:function(e){if(!i(e))throw new Error("RegionAnchorY must be between 0 and 100.");n=e}},viewportAnchorY:{enumerable:!0,get:function(){return o},set:function(e){if(!i(e))throw new Error("ViewportAnchorY must be between 0 and 100.");o=e}},viewportAnchorX:{enumerable:!0,get:function(){return a},set:function(e){if(!i(e))throw new Error("ViewportAnchorX must be between 0 and 100.");a=e}},scroll:{enumerable:!0,get:function(){return l},set:function(e){var i=function(e){return"string"==typeof e&&!!t[e.toLowerCase()]&&e.toLowerCase()}(e);!1===i?console.warn("Scroll: an invalid or illegal string was specified."):l=i}}})}},5303:(e,t,i)=>{var s;!function(){function n(e,t,i){return e.call.apply(e.bind,arguments)}function r(e,t,i){if(!e)throw Error();if(2<arguments.length){var s=Array.prototype.slice.call(arguments,2);return function(){var i=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(i,s),e.apply(t,i)}}return function(){return e.apply(t,arguments)}}function a(e,t,i){return(a=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?n:r).apply(null,arguments)}var o=Date.now||function(){return+new Date};function l(e,t){this.a=e,this.o=t||e,this.c=this.o.document}var c=!!window.FontFace;function u(e,t,i,s){if(t=e.c.createElement(t),i)for(var n in i)i.hasOwnProperty(n)&&("style"==n?t.style.cssText=i[n]:t.setAttribute(n,i[n]));return s&&t.appendChild(e.c.createTextNode(s)),t}function h(e,t,i){(e=e.c.getElementsByTagName(t)[0])||(e=document.documentElement),e.insertBefore(i,e.lastChild)}function d(e){e.parentNode&&e.parentNode.removeChild(e)}function p(e,t,i){t=t||[],i=i||[];for(var s=e.className.split(/\s+/),n=0;n<t.length;n+=1){for(var r=!1,a=0;a<s.length;a+=1)if(t[n]===s[a]){r=!0;break}r||s.push(t[n])}for(t=[],n=0;n<s.length;n+=1){for(r=!1,a=0;a<i.length;a+=1)if(s[n]===i[a]){r=!0;break}r||t.push(s[n])}e.className=t.join(" ").replace(/\s+/g," ").replace(/^\s+|\s+$/,"")}function f(e,t){for(var i=e.className.split(/\s+/),s=0,n=i.length;s<n;s++)if(i[s]==t)return!0;return!1}function m(e,t,i){function s(){o&&n&&r&&(o(a),o=null)}t=u(e,"link",{rel:"stylesheet",href:t,media:"all"});var n=!1,r=!0,a=null,o=i||null;c?(t.onload=function(){n=!0,s()},t.onerror=function(){n=!0,a=Error("Stylesheet failed to load"),s()}):setTimeout((function(){n=!0,s()}),0),h(e,"head",t)}function g(e,t,i,s){var n=e.c.getElementsByTagName("head")[0];if(n){var r=u(e,"script",{src:t}),a=!1;return r.onload=r.onreadystatechange=function(){a||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(a=!0,i&&i(null),r.onload=r.onreadystatechange=null,"HEAD"==r.parentNode.tagName&&n.removeChild(r))},n.appendChild(r),setTimeout((function(){a||(a=!0,i&&i(Error("Script load timeout")))}),s||5e3),r}return null}function y(){this.a=0,this.c=null}function v(e){return e.a++,function(){e.a--,b(e)}}function _(e,t){e.c=t,b(e)}function b(e){0==e.a&&e.c&&(e.c(),e.c=null)}function T(e){this.a=e||"-"}function S(e,t){this.c=e,this.f=4,this.a="n";var i=(t||"n4").match(/^([nio])([1-9])$/i);i&&(this.a=i[1],this.f=parseInt(i[2],10))}function w(e){var t=[];e=e.split(/,\s*/);for(var i=0;i<e.length;i++){var s=e[i].replace(/['"]/g,"");-1!=s.indexOf(" ")||/^\d/.test(s)?t.push("'"+s+"'"):t.push(s)}return t.join(",")}function E(e){return e.a+e.f}function C(e){var t="normal";return"o"===e.a?t="oblique":"i"===e.a&&(t="italic"),t}function x(e){var t=4,i="n",s=null;return e&&((s=e.match(/(normal|oblique|italic)/i))&&s[1]&&(i=s[1].substr(0,1).toLowerCase()),(s=e.match(/([1-9]00|normal|bold)/i))&&s[1]&&(/bold/i.test(s[1])?t=7:/[1-9]00/.test(s[1])&&(t=parseInt(s[1].substr(0,1),10)))),i+t}function k(e,t){this.c=e,this.f=e.o.document.documentElement,this.h=t,this.a=new T("-"),this.j=!1!==t.events,this.g=!1!==t.classes}function A(e){if(e.g){var t=f(e.f,e.a.c("wf","active")),i=[],s=[e.a.c("wf","loading")];t||i.push(e.a.c("wf","inactive")),p(e.f,i,s)}I(e,"inactive")}function I(e,t,i){e.j&&e.h[t]&&(i?e.h[t](i.c,E(i)):e.h[t]())}function P(){this.c={}}function O(e,t){this.c=e,this.f=t,this.a=u(this.c,"span",{"aria-hidden":"true"},this.f)}function L(e){h(e.c,"body",e.a)}function D(e){return"display:block;position:absolute;top:-9999px;left:-9999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;white-space:nowrap;font-family:"+w(e.c)+";font-style:"+C(e)+";font-weight:"+e.f+"00;"}function R(e,t,i,s,n,r){this.g=e,this.j=t,this.a=s,this.c=i,this.f=n||3e3,this.h=r||void 0}function N(e,t,i,s,n,r,a){this.v=e,this.B=t,this.c=i,this.a=s,this.s=a||"BESbswy",this.f={},this.w=n||3e3,this.u=r||null,this.m=this.j=this.h=this.g=null,this.g=new O(this.c,this.s),this.h=new O(this.c,this.s),this.j=new O(this.c,this.s),this.m=new O(this.c,this.s),e=D(e=new S(this.a.c+",serif",E(this.a))),this.g.a.style.cssText=e,e=D(e=new S(this.a.c+",sans-serif",E(this.a))),this.h.a.style.cssText=e,e=D(e=new S("serif",E(this.a))),this.j.a.style.cssText=e,e=D(e=new S("sans-serif",E(this.a))),this.m.a.style.cssText=e,L(this.g),L(this.h),L(this.j),L(this.m)}T.prototype.c=function(e){for(var t=[],i=0;i<arguments.length;i++)t.push(arguments[i].replace(/[\W_]+/g,"").toLowerCase());return t.join(this.a)},R.prototype.start=function(){var e=this.c.o.document,t=this,i=o(),s=new Promise((function(s,n){!function r(){o()-i>=t.f?n():e.fonts.load(function(e){return C(e)+" "+e.f+"00 300px "+w(e.c)}(t.a),t.h).then((function(e){1<=e.length?s():setTimeout(r,25)}),(function(){n()}))}()})),n=null,r=new Promise((function(e,i){n=setTimeout(i,t.f)}));Promise.race([r,s]).then((function(){n&&(clearTimeout(n),n=null),t.g(t.a)}),(function(){t.j(t.a)}))};var M={D:"serif",C:"sans-serif"},j=null;function U(){if(null===j){var e=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);j=!!e&&(536>parseInt(e[1],10)||536===parseInt(e[1],10)&&11>=parseInt(e[2],10))}return j}function B(e,t,i){for(var s in M)if(M.hasOwnProperty(s)&&t===e.f[M[s]]&&i===e.f[M[s]])return!0;return!1}function F(e){var t,i=e.g.a.offsetWidth,s=e.h.a.offsetWidth;(t=i===e.f.serif&&s===e.f["sans-serif"])||(t=U()&&B(e,i,s)),t?o()-e.A>=e.w?U()&&B(e,i,s)&&(null===e.u||e.u.hasOwnProperty(e.a.c))?q(e,e.v):q(e,e.B):function(e){setTimeout(a((function(){F(this)}),e),50)}(e):q(e,e.v)}function q(e,t){setTimeout(a((function(){d(this.g.a),d(this.h.a),d(this.j.a),d(this.m.a),t(this.a)}),e),0)}function $(e,t,i){this.c=e,this.a=t,this.f=0,this.m=this.j=!1,this.s=i}N.prototype.start=function(){this.f.serif=this.j.a.offsetWidth,this.f["sans-serif"]=this.m.a.offsetWidth,this.A=o(),F(this)};var H=null;function V(e){0==--e.f&&e.j&&(e.m?((e=e.a).g&&p(e.f,[e.a.c("wf","active")],[e.a.c("wf","loading"),e.a.c("wf","inactive")]),I(e,"active")):A(e.a))}function z(e){this.j=e,this.a=new P,this.h=0,this.f=this.g=!0}function W(e,t,i,s,n){var r=0==--e.h;(e.f||e.g)&&setTimeout((function(){var e=n||null,o=s||{};if(0===i.length&&r)A(t.a);else{t.f+=i.length,r&&(t.j=r);var l,c=[];for(l=0;l<i.length;l++){var u=i[l],h=o[u.c],d=t.a,f=u;if(d.g&&p(d.f,[d.a.c("wf",f.c,E(f).toString(),"loading")]),I(d,"fontloading",f),d=null,null===H)if(window.FontFace){f=/Gecko.*Firefox\/(\d+)/.exec(window.navigator.userAgent);var m=/OS X.*Version\/10\..*Safari/.exec(window.navigator.userAgent)&&/Apple/.exec(window.navigator.vendor);H=f?42<parseInt(f[1],10):!m}else H=!1;d=H?new R(a(t.g,t),a(t.h,t),t.c,u,t.s,h):new N(a(t.g,t),a(t.h,t),t.c,u,t.s,e,h),c.push(d)}for(l=0;l<c.length;l++)c[l].start()}}),0)}function G(e,t){this.c=e,this.a=t}function X(e,t){this.c=e,this.a=t}function Y(e,t){this.c=e||K,this.a=[],this.f=[],this.g=t||""}$.prototype.g=function(e){var t=this.a;t.g&&p(t.f,[t.a.c("wf",e.c,E(e).toString(),"active")],[t.a.c("wf",e.c,E(e).toString(),"loading"),t.a.c("wf",e.c,E(e).toString(),"inactive")]),I(t,"fontactive",e),this.m=!0,V(this)},$.prototype.h=function(e){var t=this.a;if(t.g){var i=f(t.f,t.a.c("wf",e.c,E(e).toString(),"active")),s=[],n=[t.a.c("wf",e.c,E(e).toString(),"loading")];i||s.push(t.a.c("wf",e.c,E(e).toString(),"inactive")),p(t.f,s,n)}I(t,"fontinactive",e),V(this)},z.prototype.load=function(e){this.c=new l(this.j,e.context||this.j),this.g=!1!==e.events,this.f=!1!==e.classes,function(e,t,i){var s=[],n=i.timeout;!function(e){e.g&&p(e.f,[e.a.c("wf","loading")]),I(e,"loading")}(t),s=function(e,t,i){var s,n=[];for(s in t)if(t.hasOwnProperty(s)){var r=e.c[s];r&&n.push(r(t[s],i))}return n}(e.a,i,e.c);var r=new $(e.c,t,n);for(e.h=s.length,t=0,i=s.length;t<i;t++)s[t].load((function(t,i,s){W(e,r,t,i,s)}))}(this,new k(this.c,e),e)},G.prototype.load=function(e){function t(){if(r["__mti_fntLst"+s]){var i,n=r["__mti_fntLst"+s](),a=[];if(n)for(var o=0;o<n.length;o++){var l=n[o].fontfamily;null!=n[o].fontStyle&&null!=n[o].fontWeight?(i=n[o].fontStyle+n[o].fontWeight,a.push(new S(l,i))):a.push(new S(l))}e(a)}else setTimeout((function(){t()}),50)}var i=this,s=i.a.projectId,n=i.a.version;if(s){var r=i.c.o;g(this.c,(i.a.api||"https://fast.fonts.net/jsapi")+"/"+s+".js"+(n?"?v="+n:""),(function(n){n?e([]):(r["__MonotypeConfiguration__"+s]=function(){return i.a},t())})).id="__MonotypeAPIScript__"+s}else e([])},X.prototype.load=function(e){var t,i,s=this.a.urls||[],n=this.a.families||[],r=this.a.testStrings||{},a=new y;for(t=0,i=s.length;t<i;t++)m(this.c,s[t],v(a));var o=[];for(t=0,i=n.length;t<i;t++)if((s=n[t].split(":"))[1])for(var l=s[1].split(","),c=0;c<l.length;c+=1)o.push(new S(s[0],l[c]));else o.push(new S(s[0]));_(a,(function(){e(o,r)}))};var K="https://fonts.googleapis.com/css";function Q(e){this.f=e,this.a=[],this.c={}}var J={latin:"BESbswy","latin-ext":"çöüğş",cyrillic:"йяЖ",greek:"αβΣ",khmer:"កខគ",Hanuman:"កខគ"},Z={thin:"1",extralight:"2","extra-light":"2",ultralight:"2","ultra-light":"2",light:"3",regular:"4",book:"4",medium:"5","semi-bold":"6",semibold:"6","demi-bold":"6",demibold:"6",bold:"7","extra-bold":"8",extrabold:"8","ultra-bold":"8",ultrabold:"8",black:"9",heavy:"9",l:"3",r:"4",b:"7"},ee={i:"i",italic:"i",n:"n",normal:"n"},te=/^(thin|(?:(?:extra|ultra)-?)?light|regular|book|medium|(?:(?:semi|demi|extra|ultra)-?)?bold|black|heavy|l|r|b|[1-9]00)?(n|i|normal|italic)?$/;function ie(e,t){this.c=e,this.a=t}var se={Arimo:!0,Cousine:!0,Tinos:!0};function ne(e,t){this.c=e,this.a=t}function re(e,t){this.c=e,this.f=t,this.a=[]}ie.prototype.load=function(e){var t=new y,i=this.c,s=new Y(this.a.api,this.a.text),n=this.a.families;!function(e,t){for(var i=t.length,s=0;s<i;s++){var n=t[s].split(":");3==n.length&&e.f.push(n.pop());var r="";2==n.length&&""!=n[1]&&(r=":"),e.a.push(n.join(r))}}(s,n);var r=new Q(n);!function(e){for(var t=e.f.length,i=0;i<t;i++){var s=e.f[i].split(":"),n=s[0].replace(/\+/g," "),r=["n4"];if(2<=s.length){var a;if(a=[],o=s[1])for(var o,l=(o=o.split(",")).length,c=0;c<l;c++){var u;if((u=o[c]).match(/^[\w-]+$/))if(null==(h=te.exec(u.toLowerCase())))u="";else{if(u=null==(u=h[2])||""==u?"n":ee[u],null==(h=h[1])||""==h)h="4";else var h=Z[h]||(isNaN(h)?"4":h.substr(0,1));u=[u,h].join("")}else u="";u&&a.push(u)}0<a.length&&(r=a),3==s.length&&(a=[],0<(s=(s=s[2])?s.split(","):a).length&&(s=J[s[0]])&&(e.c[n]=s))}for(e.c[n]||(s=J[n])&&(e.c[n]=s),s=0;s<r.length;s+=1)e.a.push(new S(n,r[s]))}}(r),m(i,function(e){if(0==e.a.length)throw Error("No fonts to load!");if(-1!=e.c.indexOf("kit="))return e.c;for(var t=e.a.length,i=[],s=0;s<t;s++)i.push(e.a[s].replace(/ /g,"+"));return t=e.c+"?family="+i.join("%7C"),0<e.f.length&&(t+="&subset="+e.f.join(",")),0<e.g.length&&(t+="&text="+encodeURIComponent(e.g)),t}(s),v(t)),_(t,(function(){e(r.a,r.c,se)}))},ne.prototype.load=function(e){var t=this.a.id,i=this.c.o;t?g(this.c,(this.a.api||"https://use.typekit.net")+"/"+t+".js",(function(t){if(t)e([]);else if(i.Typekit&&i.Typekit.config&&i.Typekit.config.fn){t=i.Typekit.config.fn;for(var s=[],n=0;n<t.length;n+=2)for(var r=t[n],a=t[n+1],o=0;o<a.length;o++)s.push(new S(r,a[o]));try{i.Typekit.load({events:!1,classes:!1,async:!0})}catch(e){}e(s)}}),2e3):e([])},re.prototype.load=function(e){var t=this.f.id,i=this.c.o,s=this;t?(i.__webfontfontdeckmodule__||(i.__webfontfontdeckmodule__={}),i.__webfontfontdeckmodule__[t]=function(t,i){for(var n=0,r=i.fonts.length;n<r;++n){var a=i.fonts[n];s.a.push(new S(a.name,x("font-weight:"+a.weight+";font-style:"+a.style)))}e(s.a)},g(this.c,(this.f.api||"https://f.fontdeck.com/s/css/js/")+function(e){return e.o.location.hostname||e.a.location.hostname}(this.c)+"/"+t+".js",(function(t){t&&e([])}))):e([])};var ae=new z(window);ae.a.c.custom=function(e,t){return new X(t,e)},ae.a.c.fontdeck=function(e,t){return new re(t,e)},ae.a.c.monotype=function(e,t){return new G(t,e)},ae.a.c.typekit=function(e,t){return new ne(t,e)},ae.a.c.google=function(e,t){return new ie(t,e)};var oe={load:a(ae.load,ae)};void 0===(s=function(){return oe}.call(t,i,t,e))||(e.exports=s)}()},4626:()=>{},8304:e=>{function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(this,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}},s={};function n(e){var t=s[e];if(void 0!==t)return t.exports;var r=s[e]={id:e,loaded:!1,exports:{}};return i[e].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}n.m=i,e=[],n.O=(t,i,s,r)=>{if(!i){var a=1/0;for(u=0;u<e.length;u++){for(var[i,s,r]=e[u],o=!0,l=0;l<i.length;l++)(!1&r||a>=r)&&Object.keys(n.O).every((e=>n.O[e](i[l])))?i.splice(l--,1):(o=!1,r<a&&(a=r));if(o){e.splice(u--,1);var c=s();void 0!==c&&(t=c)}}return t}r=r||0;for(var u=e.length;u>0&&e[u-1][2]>r;u--)e[u]=e[u-1];e[u]=[i,s,r]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,i)=>(n.f[i](e,t),t)),[])),n.u=e=>({33:"playlist",40:"debug",330:"ima",367:"dash",404:"interaction-areas",410:"recommendations-overlay",525:"shoppable",625:"chapters"}[e]+".js"),n.miniCssF=e=>{},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},n.l=(e,i,s,r)=>{if(t[e])t[e].push(i);else{var a,o;if(void 0!==s)for(var l=document.getElementsByTagName("script"),c=0;c<l.length;c++){var u=l[c];if(u.getAttribute("src")==e){a=u;break}}a||(o=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",a.timeout=120,n.nc&&a.setAttribute("nonce",n.nc),a.src=e),t[e]=[i];var h=(i,s)=>{a.onerror=a.onload=null,clearTimeout(d);var n=t[e];if(delete t[e],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach((e=>e(s))),i)return i(s)},d=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),o&&document.head.appendChild(a)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n.p="",(()=>{var e={278:0,869:0};n.f.j=(t,i)=>{var s=n.o(e,t)?e[t]:void 0;if(0!==s)if(s)i.push(s[2]);else if(869!=t){var r=new Promise(((i,n)=>s=e[t]=[i,n]));i.push(s[2]=r);var a=n.p+n.u(t),o=new Error;n.l(a,(i=>{if(n.o(e,t)&&(0!==(s=e[t])&&(e[t]=void 0),s)){var r=i&&("load"===i.type?"missing":i.type),a=i&&i.target&&i.target.src;o.message="Loading chunk "+t+" failed.\n("+r+": "+a+")",o.name="ChunkLoadError",o.type=r,o.request=a,s[1](o)}}),"chunk-"+t,t)}else e[t]=0},n.O.j=t=>0===e[t];var t=(t,i)=>{var s,r,[a,o,l]=i,c=0;if(a.some((t=>0!==e[t]))){for(s in o)n.o(o,s)&&(n.m[s]=o[s]);if(l)var u=l(n)}for(t&&t(i);c<a.length;c++)r=a[c],n.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return n.O(u)},i=self.cloudinaryVideoPlayerChunkLoading=self.cloudinaryVideoPlayerChunkLoading||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var r=n.O(void 0,[869],(()=>n(9911))),a=(r=n.O(r)).Ay,o=r.xY,l=r.GF,c=r.Iy;export{a as default,o as videoPlayer,l as videoPlayerWithProfile,c as videoPlayers};
|
|
2
|
+
var e,t,i={1555:(e,t,i)=>{var n=i(5204);e.exports=function(e,t){return void 0===t&&(t=!1),function(i,s,r){if(i)e(i);else if(s.statusCode>=400&&s.statusCode<=599){var a=r;if(t)if(n.TextDecoder){var o=(void 0===(l=s.headers&&s.headers["content-type"])&&(l=""),l.toLowerCase().split(";").reduce((function(e,t){var i=t.split("="),n=i[0],s=i[1];return"charset"===n.trim()?s.trim():e}),"utf-8"));try{a=new TextDecoder(o).decode(r)}catch(e){}}else a=String.fromCharCode.apply(null,new Uint8Array(r));e({cause:a})}else e(null,r);var l}}},6e3:(e,t,i)=>{var n=i(5204),s=i(8304),r=i(8716);l.httpHandler=i(1555);var a=function(e){var t={};return e?(e.trim().split("\n").forEach((function(e){var i=e.indexOf(":"),n=e.slice(0,i).trim().toLowerCase(),s=e.slice(i+1).trim();void 0===t[n]?t[n]=s:Array.isArray(t[n])?t[n].push(s):t[n]=[t[n],s]})),t):t};function o(e,t,i){var n=e;return r(t)?(i=t,"string"==typeof e&&(n={uri:e})):n=s({},t,{uri:e}),n.callback=i,n}function l(e,t,i){return c(t=o(e,t,i))}function c(e){if(void 0===e.callback)throw new Error("callback argument missing");var t=!1,i=function(i,n,s){t||(t=!0,e.callback(i,n,s))};function n(){var e=void 0;if(e=u.response?u.response:u.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}(u),y)try{e=JSON.parse(e)}catch(e){}return e}function s(e){return clearTimeout(h),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,i(e,v)}function r(){if(!c){var t;clearTimeout(h),t=e.useXDR&&void 0===u.status?200:1223===u.status?204:u.status;var s=v,r=null;return 0!==t?(s={body:n(),statusCode:t,method:p,headers:{},url:d,rawRequest:u},u.getAllResponseHeaders&&(s.headers=a(u.getAllResponseHeaders()))):r=new Error("Internal XMLHttpRequest Error"),i(r,s,s.body)}}var o,c,u=e.xhr||null;u||(u=e.cors||e.useXDR?new l.XDomainRequest:new l.XMLHttpRequest);var h,d=u.url=e.uri||e.url,p=u.method=e.method||"GET",f=e.body||e.data,m=u.headers=e.headers||{},g=!!e.sync,y=!1,v={body:void 0,headers:{},statusCode:0,method:p,url:d,rawRequest:u};if("json"in e&&!1!==e.json&&(y=!0,m.accept||m.Accept||(m.Accept="application/json"),"GET"!==p&&"HEAD"!==p&&(m["content-type"]||m["Content-Type"]||(m["Content-Type"]="application/json"),f=JSON.stringify(!0===e.json?f:e.json))),u.onreadystatechange=function(){4===u.readyState&&setTimeout(r,0)},u.onload=r,u.onerror=s,u.onprogress=function(){},u.onabort=function(){c=!0},u.ontimeout=s,u.open(p,d,!g,e.username,e.password),g||(u.withCredentials=!!e.withCredentials),!g&&e.timeout>0&&(h=setTimeout((function(){if(!c){c=!0,u.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",s(e)}}),e.timeout)),u.setRequestHeader)for(o in m)m.hasOwnProperty(o)&&u.setRequestHeader(o,m[o]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(u.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(u),u.send(f||null),u}e.exports=l,e.exports.default=l,l.XMLHttpRequest=n.XMLHttpRequest||function(){},l.XDomainRequest="withCredentials"in new l.XMLHttpRequest?l.XMLHttpRequest:n.XDomainRequest,function(e,t){for(var i=0;i<e.length;i++)t(e[i])}(["get","put","post","patch","head","delete"],(function(e){l["delete"===e?"del":e]=function(t,i,n){return(i=o(t,i,n)).method=e.toUpperCase(),c(i)}}))},3314:(e,t)=>{function i(e,t){return void 0===t&&(t=Object),t&&"function"==typeof t.freeze?t.freeze(e):e}var n=i({HTML:"text/html",isHTML:function(e){return e===n.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),s=i({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===s.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});t.assign=function(e,t){if(null===e||"object"!=typeof e)throw new TypeError("target is not an object");for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.find=function(e,t,i){if(void 0===i&&(i=Array.prototype),e&&"function"==typeof i.find)return i.find.call(e,t);for(var n=0;n<e.length;n++)if(Object.prototype.hasOwnProperty.call(e,n)){var s=e[n];if(t.call(void 0,s,n,e))return s}},t.freeze=i,t.MIME_TYPE=n,t.NAMESPACE=s},6404:(e,t,i)=>{var n=i(3314),s=i(6278),r=i(251),a=i(8654),o=s.DOMImplementation,l=n.NAMESPACE,c=a.ParseError,u=a.XMLReader;function h(e){return e.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function d(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,i){return"string"==typeof e?e.substr(t,i):e.length>=t+i||t?new java.lang.String(e,t,i)+"":e}function y(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}d.prototype.parseFromString=function(e,t){var i=this.options,n=new u,s=i.domBuilder||new p,a=i.errorHandler,o=i.locator,c=i.xmlns||{},d=/\/x?html?$/.test(t),f=d?r.HTML_ENTITIES:r.XML_ENTITIES;o&&s.setDocumentLocator(o),n.errorHandler=function(e,t,i){if(!e){if(t instanceof p)return t;e=t}var n={},s=e instanceof Function;function r(t){var r=e[t];!r&&s&&(r=2==e.length?function(i){e(t,i)}:e),n[t]=r&&function(e){r("[xmldom "+t+"]\t"+e+m(i))}||function(){}}return i=i||{},r("warning"),r("error"),r("fatalError"),n}(a,s,o),n.domBuilder=i.domBuilder||s,d&&(c[""]=l.HTML),c.xml=c.xml||l.XML;var g=i.normalizeLineEndings||h;return e&&"string"==typeof e?n.parse(g(e),c,f):n.errorHandler.error("invalid doc source"),s.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,i,n){var s=this.doc,r=s.createElementNS(e,i||t),a=n.length;y(this,r),this.currentElement=r,this.locator&&f(this.locator,r);for(var o=0;o<a;o++){e=n.getURI(o);var l=n.getValue(o),c=(i=n.getQName(o),s.createAttributeNS(e,i));this.locator&&f(n.getLocator(o),c),c.value=c.nodeValue=l,r.setAttributeNode(c)}},endElement:function(e,t,i){var n=this.currentElement;n.tagName,this.currentElement=n.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var i=this.doc.createProcessingInstruction(e,t);this.locator&&f(this.locator,i),y(this,i)},ignorableWhitespace:function(e,t,i){},characters:function(e,t,i){if(e=g.apply(this,arguments)){if(this.cdata)var n=this.doc.createCDATASection(e);else n=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(e)&&this.doc.appendChild(n),this.locator&&f(this.locator,n)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,i){e=g.apply(this,arguments);var n=this.doc.createComment(e);this.locator&&f(this.locator,n),y(this,n)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,i){var n=this.doc.implementation;if(n&&n.createDocumentType){var s=n.createDocumentType(e,t,i);this.locator&&f(this.locator,s),y(this,s),this.doc.doctype=s}},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 c(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=d},6278:(e,t,i)=>{var n=i(3314),s=n.find,r=n.NAMESPACE;function a(e){return""!==e}function o(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function l(e){if(!e)return[];var t=function(e){return e?e.split(/[\t\n\f\r ]+/).filter(a):[]}(e);return Object.keys(t.reduce(o,{}))}function c(e,t){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}function u(e,t){var i=e.prototype;if(!(i instanceof t)){function n(){}n.prototype=t.prototype,c(i,n=new n),e.prototype=i=n}i.constructor!=e&&("function"!=typeof e&&console.error("unknown Class:"+e),i.constructor=e)}var h={},d=h.ELEMENT_NODE=1,p=h.ATTRIBUTE_NODE=2,f=h.TEXT_NODE=3,m=h.CDATA_SECTION_NODE=4,g=h.ENTITY_REFERENCE_NODE=5,y=h.ENTITY_NODE=6,v=h.PROCESSING_INSTRUCTION_NODE=7,_=h.COMMENT_NODE=8,b=h.DOCUMENT_NODE=9,T=h.DOCUMENT_TYPE_NODE=10,S=h.DOCUMENT_FRAGMENT_NODE=11,w=h.NOTATION_NODE=12,E={},C={},x=(E.INDEX_SIZE_ERR=(C[1]="Index size error",1),E.DOMSTRING_SIZE_ERR=(C[2]="DOMString size error",2),E.HIERARCHY_REQUEST_ERR=(C[3]="Hierarchy request error",3)),k=(E.WRONG_DOCUMENT_ERR=(C[4]="Wrong document",4),E.INVALID_CHARACTER_ERR=(C[5]="Invalid character",5),E.NO_DATA_ALLOWED_ERR=(C[6]="No data allowed",6),E.NO_MODIFICATION_ALLOWED_ERR=(C[7]="No modification allowed",7),E.NOT_FOUND_ERR=(C[8]="Not found",8)),A=(E.NOT_SUPPORTED_ERR=(C[9]="Not supported",9),E.INUSE_ATTRIBUTE_ERR=(C[10]="Attribute in use",10));function I(e,t){if(t instanceof Error)var i=t;else i=this,Error.call(this,C[e]),this.message=C[e],Error.captureStackTrace&&Error.captureStackTrace(this,I);return i.code=e,t&&(this.message=this.message+": "+t),i}function P(){}function O(e,t){this._node=e,this._refresh=t,L(this)}function L(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var i=e._refresh(e._node);if(ve(e,"length",i.length),!e.$$length||i.length<e.$$length)for(var n=i.length;n in e;n++)Object.prototype.hasOwnProperty.call(e,n)&&delete e[n];c(i,e),e._inc=t}}function D(){}function R(e,t){for(var i=e.length;i--;)if(e[i]===t)return i}function N(e,t,i,n){if(n?t[R(t,n)]=i:t[t.length++]=i,e){i.ownerElement=e;var s=e.ownerDocument;s&&(n&&$(s,e,n),function(e,t,i){e&&e._inc++,i.namespaceURI===r.XMLNS&&(t._nsMap[i.prefix?i.localName:""]=i.value)}(s,e,i))}}function M(e,t,i){var n=R(t,i);if(!(n>=0))throw new I(k,new Error(e.tagName+"@"+i));for(var s=t.length-1;n<s;)t[n]=t[++n];if(t.length=s,e){var r=e.ownerDocument;r&&($(r,e,i),i.ownerElement=null)}}function j(){}function U(){}function B(e){return("<"==e?"<":">"==e&&">")||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function F(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(F(e,t))return!0}while(e=e.nextSibling)}function q(){this.ownerDocument=this}function $(e,t,i,n){e&&e._inc++,i.namespaceURI===r.XMLNS&&delete t._nsMap[i.prefix?i.localName:""]}function H(e,t,i){if(e&&e._inc){e._inc++;var n=t.childNodes;if(i)n[n.length++]=i;else{for(var s=t.firstChild,r=0;s;)n[r++]=s,s=s.nextSibling;n.length=r,delete n[n.length]}}}function V(e,t){var i=t.previousSibling,n=t.nextSibling;return i?i.nextSibling=n:e.firstChild=n,n?n.previousSibling=i:e.lastChild=i,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,H(e.ownerDocument,e),t}function z(e){return e&&e.nodeType===U.DOCUMENT_TYPE_NODE}function W(e){return e&&e.nodeType===U.ELEMENT_NODE}function G(e){return e&&e.nodeType===U.TEXT_NODE}function X(e,t){var i=e.childNodes||[];if(s(i,W)||z(t))return!1;var n=s(i,z);return!(t&&n&&i.indexOf(n)>i.indexOf(t))}function Y(e,t){var i=e.childNodes||[];if(s(i,(function(e){return W(e)&&e!==t})))return!1;var n=s(i,z);return!(t&&n&&i.indexOf(n)>i.indexOf(t))}function K(e,t,i){var n=e.childNodes||[],r=t.childNodes||[];if(t.nodeType===U.DOCUMENT_FRAGMENT_NODE){var a=r.filter(W);if(a.length>1||s(r,G))throw new I(x,"More than one element or text in fragment");if(1===a.length&&!X(e,i))throw new I(x,"Element in fragment can not be inserted before doctype")}if(W(t)&&!X(e,i))throw new I(x,"Only one element can be added and only after doctype");if(z(t)){if(s(n,z))throw new I(x,"Only one doctype is allowed");var o=s(n,W);if(i&&n.indexOf(o)<n.indexOf(i))throw new I(x,"Doctype can only be inserted before an element");if(!i&&o)throw new I(x,"Doctype can not be appended since element is present")}}function Q(e,t,i){var n=e.childNodes||[],r=t.childNodes||[];if(t.nodeType===U.DOCUMENT_FRAGMENT_NODE){var a=r.filter(W);if(a.length>1||s(r,G))throw new I(x,"More than one element or text in fragment");if(1===a.length&&!Y(e,i))throw new I(x,"Element in fragment can not be inserted before doctype")}if(W(t)&&!Y(e,i))throw new I(x,"Only one element can be added and only after doctype");if(z(t)){function l(e){return z(e)&&e!==i}if(s(n,l))throw new I(x,"Only one doctype is allowed");var o=s(n,W);if(i&&n.indexOf(o)<n.indexOf(i))throw new I(x,"Doctype can only be inserted before an element")}}function J(e,t,i,n){(function(e,t,i){if(!function(e){return e&&(e.nodeType===U.DOCUMENT_NODE||e.nodeType===U.DOCUMENT_FRAGMENT_NODE||e.nodeType===U.ELEMENT_NODE)}(e))throw new I(x,"Unexpected parent node type "+e.nodeType);if(i&&i.parentNode!==e)throw new I(k,"child not in parent");if(!function(e){return e&&(W(e)||G(e)||z(e)||e.nodeType===U.DOCUMENT_FRAGMENT_NODE||e.nodeType===U.COMMENT_NODE||e.nodeType===U.PROCESSING_INSTRUCTION_NODE)}(t)||z(t)&&e.nodeType!==U.DOCUMENT_NODE)throw new I(x,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)})(e,t,i),e.nodeType===U.DOCUMENT_NODE&&(n||K)(e,t,i);var s=t.parentNode;if(s&&s.removeChild(t),t.nodeType===S){var r=t.firstChild;if(null==r)return t;var a=t.lastChild}else r=a=t;var o=i?i.previousSibling:e.lastChild;r.previousSibling=o,a.nextSibling=i,o?o.nextSibling=r:e.firstChild=r,null==i?e.lastChild=a:i.previousSibling=a;do{r.parentNode=e}while(r!==a&&(r=r.nextSibling));return H(e.ownerDocument||e,e),t.nodeType==S&&(t.firstChild=t.lastChild=null),t}function Z(){this._nsMap={}}function ee(){}function te(){}function ie(){}function ne(){}function se(){}function re(){}function ae(){}function oe(){}function le(){}function ce(){}function ue(){}function he(){}function de(e,t){var i=[],n=9==this.nodeType&&this.documentElement||this,s=n.prefix,r=n.namespaceURI;if(r&&null==s&&null==(s=n.lookupPrefix(r)))var a=[{namespace:r,prefix:null}];return me(this,i,e,t,a),i.join("")}function pe(e,t,i){var n=e.prefix||"",s=e.namespaceURI;if(!s)return!1;if("xml"===n&&s===r.XML||s===r.XMLNS)return!1;for(var a=i.length;a--;){var o=i[a];if(o.prefix===n)return o.namespace!==s}return!0}function fe(e,t,i){e.push(" ",t,'="',i.replace(/[<>&"\t\n\r]/g,B),'"')}function me(e,t,i,n,s){if(s||(s=[]),n){if(!(e=n(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case d:var a=e.attributes,o=a.length,l=e.firstChild,c=e.tagName,u=c;if(!(i=r.isHTML(e.namespaceURI)||i)&&!e.prefix&&e.namespaceURI){for(var h,y=0;y<a.length;y++)if("xmlns"===a.item(y).name){h=a.item(y).value;break}if(!h)for(var w=s.length-1;w>=0;w--)if(""===(E=s[w]).prefix&&E.namespace===e.namespaceURI){h=E.namespace;break}if(h!==e.namespaceURI)for(w=s.length-1;w>=0;w--){var E;if((E=s[w]).namespace===e.namespaceURI){E.prefix&&(u=E.prefix+":"+c);break}}}t.push("<",u);for(var C=0;C<o;C++)"xmlns"==(x=a.item(C)).prefix?s.push({prefix:x.localName,namespace:x.value}):"xmlns"==x.nodeName&&s.push({prefix:"",namespace:x.value});for(C=0;C<o;C++){var x,k,A;pe(x=a.item(C),0,s)&&(fe(t,(k=x.prefix||"")?"xmlns:"+k:"xmlns",A=x.namespaceURI),s.push({prefix:k,namespace:A})),me(x,t,i,n,s)}if(c===u&&pe(e,0,s)&&(fe(t,(k=e.prefix||"")?"xmlns:"+k:"xmlns",A=e.namespaceURI),s.push({prefix:k,namespace:A})),l||i&&!/^(?:meta|link|img|br|hr|input)$/i.test(c)){if(t.push(">"),i&&/^script$/i.test(c))for(;l;)l.data?t.push(l.data):me(l,t,i,n,s.slice()),l=l.nextSibling;else for(;l;)me(l,t,i,n,s.slice()),l=l.nextSibling;t.push("</",u,">")}else t.push("/>");return;case b:case S:for(l=e.firstChild;l;)me(l,t,i,n,s.slice()),l=l.nextSibling;return;case p:return fe(t,e.name,e.value);case f:return t.push(e.data.replace(/[<&>]/g,B));case m:return t.push("<![CDATA[",e.data,"]]>");case _:return t.push("\x3c!--",e.data,"--\x3e");case T:var I=e.publicId,P=e.systemId;if(t.push("<!DOCTYPE ",e.name),I)t.push(" PUBLIC ",I),P&&"."!=P&&t.push(" ",P),t.push(">");else if(P&&"."!=P)t.push(" SYSTEM ",P,">");else{var O=e.internalSubset;O&&t.push(" [",O,"]"),t.push(">")}return;case v:return t.push("<?",e.target," ",e.data,"?>");case g:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function ge(e,t,i){var n;switch(t.nodeType){case d:(n=t.cloneNode(!1)).ownerDocument=e;case S:break;case p:i=!0}if(n||(n=t.cloneNode(!1)),n.ownerDocument=e,n.parentNode=null,i)for(var s=t.firstChild;s;)n.appendChild(ge(e,s,i)),s=s.nextSibling;return n}function ye(e,t,i){var n=new t.constructor;for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)){var r=t[s];"object"!=typeof r&&r!=n[s]&&(n[s]=r)}switch(t.childNodes&&(n.childNodes=new P),n.ownerDocument=e,n.nodeType){case d:var a=t.attributes,o=n.attributes=new D,l=a.length;o._ownerElement=n;for(var c=0;c<l;c++)n.setAttributeNode(ye(e,a.item(c),!0));break;case p:i=!0}if(i)for(var u=t.firstChild;u;)n.appendChild(ye(e,u,i)),u=u.nextSibling;return n}function ve(e,t,i){e[t]=i}E.INVALID_STATE_ERR=(C[11]="Invalid state",11),E.SYNTAX_ERR=(C[12]="Syntax error",12),E.INVALID_MODIFICATION_ERR=(C[13]="Invalid modification",13),E.NAMESPACE_ERR=(C[14]="Invalid namespace",14),E.INVALID_ACCESS_ERR=(C[15]="Invalid access",15),I.prototype=Error.prototype,c(E,I),P.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e,t){for(var i=[],n=0;n<this.length;n++)me(this[n],i,e,t);return i.join("")},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}},O.prototype.item=function(e){return L(this),this[e]||null},u(O,P),D.prototype={length:0,item:P.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var i=this[t];if(i.nodeName==e)return i}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new I(A);var i=this.getNamedItem(e.nodeName);return N(this._ownerElement,this,e,i),i},setNamedItemNS:function(e){var t,i=e.ownerElement;if(i&&i!=this._ownerElement)throw new I(A);return t=this.getNamedItemNS(e.namespaceURI,e.localName),N(this._ownerElement,this,e,t),t},removeNamedItem:function(e){var t=this.getNamedItem(e);return M(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var i=this.getNamedItemNS(e,t);return M(this._ownerElement,this,i),i},getNamedItemNS:function(e,t){for(var i=this.length;i--;){var n=this[i];if(n.localName==t&&n.namespaceURI==e)return n}return null}},j.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,i){var n=new q;if(n.implementation=this,n.childNodes=new P,n.doctype=i||null,i&&n.appendChild(i),t){var s=n.createElementNS(e,t);n.appendChild(s)}return n},createDocumentType:function(e,t,i){var n=new re;return n.name=e,n.nodeName=e,n.publicId=t||"",n.systemId=i||"",n}},U.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return J(this,e,t)},replaceChild:function(e,t){J(this,e,t,Q),t&&this.removeChild(t)},removeChild:function(e){return V(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return ye(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;t&&t.nodeType==f&&e.nodeType==f?(this.removeChild(t),e.appendData(t.data)):(e.normalize(),e=t)}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){for(var t=this;t;){var i=t._nsMap;if(i)for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&i[n]===e)return n;t=t.nodeType==p?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var i=t._nsMap;if(i&&Object.prototype.hasOwnProperty.call(i,e))return i[e];t=t.nodeType==p?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},c(h,U),c(h,U.prototype),q.prototype={nodeName:"#document",nodeType:b,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==S){for(var i=e.firstChild;i;){var n=i.nextSibling;this.insertBefore(i,t),i=n}return e}return J(this,e,t),e.ownerDocument=this,null===this.documentElement&&e.nodeType===d&&(this.documentElement=e),e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),V(this,e)},replaceChild:function(e,t){J(this,e,t,Q),e.ownerDocument=this,t&&this.removeChild(t),W(e)&&(this.documentElement=e)},importNode:function(e,t){return ge(this,e,t)},getElementById:function(e){var t=null;return F(this.documentElement,(function(i){if(i.nodeType==d&&i.getAttribute("id")==e)return t=i,!0})),t},getElementsByClassName:function(e){var t=l(e);return new O(this,(function(i){var n=[];return t.length>0&&F(i.documentElement,(function(s){if(s!==i&&s.nodeType===d){var r=s.getAttribute("class");if(r){var a=e===r;if(!a){var o=l(r);a=t.every((c=o,function(e){return c&&-1!==c.indexOf(e)}))}a&&n.push(s)}}var c})),n}))},createElement:function(e){var t=new Z;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new P,(t.attributes=new D)._ownerElement=t,t},createDocumentFragment:function(){var e=new ce;return e.ownerDocument=this,e.childNodes=new P,e},createTextNode:function(e){var t=new ie;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new ne;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new se;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var i=new ue;return i.ownerDocument=this,i.tagName=i.nodeName=i.target=e,i.nodeValue=i.data=t,i},createAttribute:function(e){var t=new ee;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new le;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var i=new Z,n=t.split(":"),s=i.attributes=new D;return i.childNodes=new P,i.ownerDocument=this,i.nodeName=t,i.tagName=t,i.namespaceURI=e,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,s._ownerElement=i,i},createAttributeNS:function(e,t){var i=new ee,n=t.split(":");return i.ownerDocument=this,i.nodeName=t,i.name=t,i.namespaceURI=e,i.specified=!0,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,i}},u(q,U),Z.prototype={nodeType:d,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 i=this.ownerDocument.createAttribute(e);i.value=i.nodeValue=""+t,this.setAttributeNode(i)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===S?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,H(e.ownerDocument,e,t),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);i&&this.removeAttributeNode(i)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);return i&&i.value||""},setAttributeNS:function(e,t,i){var n=this.ownerDocument.createAttributeNS(e,t);n.value=n.nodeValue=""+i,this.setAttributeNode(n)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new O(this,(function(t){var i=[];return F(t,(function(n){n===t||n.nodeType!=d||"*"!==e&&n.tagName!=e||i.push(n)})),i}))},getElementsByTagNameNS:function(e,t){return new O(this,(function(i){var n=[];return F(i,(function(s){s===i||s.nodeType!==d||"*"!==e&&s.namespaceURI!==e||"*"!==t&&s.localName!=t||n.push(s)})),n}))}},q.prototype.getElementsByTagName=Z.prototype.getElementsByTagName,q.prototype.getElementsByTagNameNS=Z.prototype.getElementsByTagNameNS,u(Z,U),ee.prototype.nodeType=p,u(ee,U),te.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(C[x])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,i){i=this.data.substring(0,e)+i+this.data.substring(e+t),this.nodeValue=this.data=i,this.length=i.length}},u(te,U),ie.prototype={nodeName:"#text",nodeType:f,splitText:function(e){var t=this.data,i=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var n=this.ownerDocument.createTextNode(i);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}},u(ie,te),ne.prototype={nodeName:"#comment",nodeType:_},u(ne,te),se.prototype={nodeName:"#cdata-section",nodeType:m},u(se,te),re.prototype.nodeType=T,u(re,U),ae.prototype.nodeType=w,u(ae,U),oe.prototype.nodeType=y,u(oe,U),le.prototype.nodeType=g,u(le,U),ce.prototype.nodeName="#document-fragment",ce.prototype.nodeType=S,u(ce,U),ue.prototype.nodeType=v,u(ue,U),he.prototype.serializeToString=function(e,t,i){return de.call(e,t,i)},U.prototype.toString=de;try{if(Object.defineProperty){function _e(e){switch(e.nodeType){case d:case S:var t=[];for(e=e.firstChild;e;)7!==e.nodeType&&8!==e.nodeType&&t.push(_e(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}}Object.defineProperty(O.prototype,"length",{get:function(){return L(this),this.$$length}}),Object.defineProperty(U.prototype,"textContent",{get:function(){return _e(this)},set:function(e){switch(this.nodeType){case d:case S:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),ve=function(e,t,i){e["$$"+t]=i}}}catch(be){}t.DocumentType=re,t.DOMException=I,t.DOMImplementation=j,t.Element=Z,t.Node=U,t.NodeList=P,t.XMLSerializer=he},251:(e,t,i)=>{var n=i(3314).freeze;t.XML_ENTITIES=n({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),t.HTML_ENTITIES=n({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},2854:(e,t,i)=>{var n=i(6278);n.DOMImplementation,n.XMLSerializer,t.DOMParser=i(6404).DOMParser},8654:(e,t,i)=>{var n=i(3314).NAMESPACE,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]/,r=new RegExp("[\\-\\.0-9"+s.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),a=new RegExp("^"+s.source+r.source+"*(?::"+s.source+r.source+"*)?$");function o(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,o)}function l(){}function c(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function u(e,t,i,s,r,a){function o(e,t,n){i.attributeNames.hasOwnProperty(e)&&a.fatalError("Attribute "+e+" redefined"),i.addValue(e,t.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,r),n)}for(var l,c=++t,u=0;;){var h=e.charAt(c);switch(h){case"=":if(1===u)l=e.slice(t,c),u=3;else{if(2!==u)throw new Error("attribute equal must after attrName");u=3}break;case"'":case'"':if(3===u||1===u){if(1===u&&(a.warning('attribute value must after "="'),l=e.slice(t,c)),t=c+1,!((c=e.indexOf(h,t))>0))throw new Error("attribute value no end '"+h+"' match");o(l,d=e.slice(t,c),t-1),u=5}else{if(4!=u)throw new Error('attribute value must after "="');o(l,d=e.slice(t,c),t),a.warning('attribute "'+l+'" missed start quot('+h+")!!"),t=c+1,u=5}break;case"/":switch(u){case 0:i.setTagName(e.slice(t,c));case 5:case 6:case 7:u=7,i.closed=!0;case 4:case 1:break;case 2:i.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return a.error("unexpected end of input"),0==u&&i.setTagName(e.slice(t,c)),c;case">":switch(u){case 0:i.setTagName(e.slice(t,c));case 5:case 6:case 7:break;case 4:case 1:"/"===(d=e.slice(t,c)).slice(-1)&&(i.closed=!0,d=d.slice(0,-1));case 2:2===u&&(d=l),4==u?(a.warning('attribute "'+d+'" missed quot(")!'),o(l,d,t)):(n.isHTML(s[""])&&d.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+d+'" missed value!! "'+d+'" instead!!'),o(d,d,t));break;case 3:throw new Error("attribute value missed!!")}return c;case"":h=" ";default:if(h<=" ")switch(u){case 0:i.setTagName(e.slice(t,c)),u=6;break;case 1:l=e.slice(t,c),u=2;break;case 4:var d=e.slice(t,c);a.warning('attribute "'+d+'" missed quot(")!!'),o(l,d,t);case 5:u=6}else switch(u){case 2:i.tagName,n.isHTML(s[""])&&l.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+l+'" missed value!! "'+l+'" instead2!!'),o(l,l,t),t=c,u=1;break;case 5:a.warning('attribute space is required"'+l+'"!!');case 6:u=1,t=c;break;case 3:u=4,t=c;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function h(e,t,i){for(var s=e.tagName,r=null,a=e.length;a--;){var o=e[a],l=o.qName,c=o.value;if((p=l.indexOf(":"))>0)var u=o.prefix=l.slice(0,p),h=l.slice(p+1),d="xmlns"===u&&h;else h=l,u=null,d="xmlns"===l&&"";o.localName=h,!1!==d&&(null==r&&(r={},f(i,i={})),i[d]=r[d]=c,o.uri=n.XMLNS,t.startPrefixMapping(d,c))}for(a=e.length;a--;)(u=(o=e[a]).prefix)&&("xml"===u&&(o.uri=n.XML),"xmlns"!==u&&(o.uri=i[u||""]));var p;(p=s.indexOf(":"))>0?(u=e.prefix=s.slice(0,p),h=e.localName=s.slice(p+1)):(u=null,h=e.localName=s);var m=e.uri=i[u||""];if(t.startElement(m,h,s,e),!e.closed)return e.currentNSMap=i,e.localNSMap=r,!0;if(t.endElement(m,h,s),r)for(u in r)Object.prototype.hasOwnProperty.call(r,u)&&t.endPrefixMapping(u)}function d(e,t,i,n,s){if(/^(?:script|textarea)$/i.test(i)){var r=e.indexOf("</"+i+">",t),a=e.substring(t+1,r);if(/[&<]/.test(a))return/^script$/i.test(i)?(s.characters(a,0,a.length),r):(a=a.replace(/&#?\w+;/g,n),s.characters(a,0,a.length),r)}return t+1}function p(e,t,i,n){var s=n[i];return null==s&&((s=e.lastIndexOf("</"+i+">"))<t&&(s=e.lastIndexOf("</"+i)),n[i]=s),s<t}function f(e,t){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}function m(e,t,i,n){if("-"===e.charAt(t+2))return"-"===e.charAt(t+3)?(s=e.indexOf("--\x3e",t+4))>t?(i.comment(e,t+4,s-t-4),s+3):(n.error("Unclosed comment"),-1):-1;if("CDATA["==e.substr(t+3,6)){var s=e.indexOf("]]>",t+9);return i.startCDATA(),i.characters(e,t+9,s-t-9),i.endCDATA(),s+3}var r=function(e,t){var i,n=[],s=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(s.lastIndex=t,s.exec(e);i=s.exec(e);)if(n.push(i),i[1])return n}(e,t),a=r.length;if(a>1&&/!doctype/i.test(r[0][0])){var o=r[1][0],l=!1,c=!1;a>3&&(/^public$/i.test(r[2][0])?(l=r[3][0],c=a>4&&r[4][0]):/^system$/i.test(r[2][0])&&(c=r[3][0]));var u=r[a-1];return i.startDTD(o,l,c),i.endDTD(),u.index+u[0].length}return-1}function g(e,t,i){var n=e.indexOf("?>",t);if(n){var s=e.substring(t,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return s?(s[0].length,i.processingInstruction(s[1],s[2]),n+2):-1}return-1}function y(){this.attributeNames={}}o.prototype=new Error,o.prototype.name=o.name,l.prototype={parse:function(e,t,i){var s=this.domBuilder;s.startDocument(),f(t,t={}),function(e,t,i,s,r){function a(e){var t=e.slice(1,-1);return Object.hasOwnProperty.call(i,t)?i[t]:"#"===t.charAt(0)?function(e){if(e>65535){var t=55296+((e-=65536)>>10),i=56320+(1023&e);return String.fromCharCode(t,i)}return String.fromCharCode(e)}(parseInt(t.substr(1).replace("x","0x"))):(r.error("entity not found:"+e),e)}function l(t){if(t>E){var i=e.substring(E,t).replace(/&#?\w+;/g,a);T&&f(E),s.characters(i,0,t-E),E=t}}function f(t,i){for(;t>=_&&(i=b.exec(e));)v=i.index,_=v+i[0].length,T.lineNumber++;T.columnNumber=t-v+1}for(var v=0,_=0,b=/.*(?:\r\n?|\n)|.*$/g,T=s.locator,S=[{currentNSMap:t}],w={},E=0;;){try{var C=e.indexOf("<",E);if(C<0){if(!e.substr(E).match(/^\s*$/)){var x=s.doc,k=x.createTextNode(e.substr(E));x.appendChild(k),s.currentElement=k}return}switch(C>E&&l(C),e.charAt(C+1)){case"/":var A=e.indexOf(">",C+3),I=e.substring(C+2,A).replace(/[ \t\n\r]+$/g,""),P=S.pop();A<0?(I=e.substring(C+2).replace(/[\s<].*/,""),r.error("end tag name: "+I+" is not complete:"+P.tagName),A=C+1+I.length):I.match(/\s</)&&(I=I.replace(/[\s<].*/,""),r.error("end tag name: "+I+" maybe not complete"),A=C+1+I.length);var O=P.localNSMap,L=P.tagName==I;if(L||P.tagName&&P.tagName.toLowerCase()==I.toLowerCase()){if(s.endElement(P.uri,P.localName,I),O)for(var D in O)Object.prototype.hasOwnProperty.call(O,D)&&s.endPrefixMapping(D);L||r.fatalError("end tag name: "+I+" is not match the current start tagName:"+P.tagName)}else S.push(P);A++;break;case"?":T&&f(C),A=g(e,C,s);break;case"!":T&&f(C),A=m(e,C,s,r);break;default:T&&f(C);var R=new y,N=S[S.length-1].currentNSMap,M=(A=u(e,C,R,N,a,r),R.length);if(!R.closed&&p(e,A,R.tagName,w)&&(R.closed=!0,i.nbsp||r.warning("unclosed xml attribute")),T&&M){for(var j=c(T,{}),U=0;U<M;U++){var B=R[U];f(B.offset),B.locator=c(T,{})}s.locator=j,h(R,s,N)&&S.push(R),s.locator=T}else h(R,s,N)&&S.push(R);n.isHTML(R.uri)&&!R.closed?A=d(e,A,R.tagName,a,s):A++}}catch(e){if(e instanceof o)throw e;r.error("element parse error: "+e),A=-1}A>E?E=A:l(Math.max(C,E)+1)}}(e,t,i,s,this.errorHandler),s.endDocument()}},y.prototype={setTagName:function(e){if(!a.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,i){if(!a.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:i}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},t.XMLReader=l,t.ParseError=o},7878:e=>{const t=e=>{e.style.display="none"},i=e=>{e.style.display=""};e.exports={hide:t,show:i,setText:(e,n)=>{if(!n||n.length<=0)return e.innerText="",void t(e);e.innerText=n,i(e)}}},7668:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(7938),s=i.n(n);var r=i(608);const a={logoOnclickUrl:"https://cloudinary.com/",showLogo:!0,showJumpControls:!1,playsinline:s().browser.IS_IOS,skin:"dark",controls:!1,chaptersButton:!1,pictureInPictureToggle:!1,seekThumbnails:!0,aiHighlightsGraph:!1,preload:r.Am.AUTO,textTrackSettings:!1,loop:!1,muted:!1,posterOptions:{},sourceTypes:["auto"],contextMenu:{content:e=>{const t=e.loop(),i=e.paused(),n=e.muted(),s=e.isFullscreen(),r={class:"player-version",label:"Cloudinary Player v2.0.3-edge.0"};return e.controls()?[{label:t?"Unloop":"Loop",listener:()=>{e.loop(!t)}},{label:i?"Play":"Pause",listener:()=>{i?e.play():e.pause()}},{label:n?"Unmute":"Mute",listener:()=>{e.muted(!n)}},{label:s?"Exit Fullscreen":"Fullscreen",listener:()=>{s?e.exitFullscreen():e.requestFullscreen()}},r]:[r]}},floatingWhenNotVisible:r.rT.NONE,hideContextMenu:!1,analytics:!1,cloudinaryAnalytics:!0,allowUsageReport:!0,playedEventPercents:[25,50,75,100]}},9911:(e,t,i)=>{i.d(t,{Ay:()=>At,xY:()=>Ct,GF:()=>kt,Iy:()=>xt});var n=i(7171),s=i.n(n),r=i(7938),a=i.n(r);const o={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let l;const c=new Uint8Array(16);function u(){if(!l&&(l="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!l))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return l(c)}const h=[];for(let e=0;e<256;++e)h.push((e+256).toString(16).slice(1));const d=function(e,t,i){if(o.randomUUID&&!t&&!e)return o.randomUUID();const n=(e=e||{}).random||(e.rng||u)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){i=i||0;for(let e=0;e<16;++e)t[i+e]=n[e];return t}return function(e,t=0){return h[e[t+0]]+h[e[t+1]]+h[e[t+2]]+h[e[t+3]]+"-"+h[e[t+4]]+h[e[t+5]]+"-"+h[e[t+6]]+h[e[t+7]]+"-"+h[e[t+8]]+h[e[t+9]]+"-"+h[e[t+10]]+h[e[t+11]]+h[e[t+12]]+h[e[t+13]]+h[e[t+14]]+h[e[t+15]]}(n)};var p=i(5685),f=i.n(p),m=i(2832),g=i.n(m),y=i(8446),v=i.n(y),_=i(7571),b=i.n(_);const T=a().getComponent("ClickableComponent");a().registerComponent("JumpForwardButton",class extends T{handleClick(e){super.handleClick(e),this.player().currentTime(this.player().currentTime()+10)}createEl(){return a().dom.createEl("button",{className:"vjs-control vjs-icon-skip-10-plus vjs-icon-forward-10 vjs-button",ariaLabel:"Jump forward 10 seconds"})}});const S=a().getComponent("ClickableComponent");a().registerComponent("JumpBackButton",class extends S{handleClick(e){super.handleClick(e),this.player().currentTime(this.player().currentTime()-10)}createEl(){return a().dom.createEl("button",{className:"vjs-control vjs-icon-skip-10-min vjs-icon-replay-10 vjs-button",ariaLabel:"Jump back 10 seconds"})}});const w=a().getComponent("ClickableComponent");a().registerComponent("logoButton",class extends w{createEl(){const e=this.options_.playerOptions,t=e.showLogo?"block":"none",i=e.logoImageUrl?"background-image: url(".concat(e.logoImageUrl,")"):"";return a().dom.createEl("a",{},{class:"vjs-control vjs-cloudinary-button vjs-button",href:e.logoOnclickUrl,target:"_blank",style:"display: ".concat(t,"; ").concat(i),"aria-label":"Logo link"})}});const E=a().getComponent("Component");a().registerComponent("progressControlEventsBlocker",class extends E{constructor(e){super(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}createEl(){return super.createEl("div",{className:"vjs-progress-control-events-blocker"})}});var C=i(7878),x=i.n(C);const k=a().dom||a(),A=a().getComponent("Component");a().registerComponent("titleBar",class extends A{constructor(e){super(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),this.on(e,"cldsourcechanged",((e,t)=>{let{source:i}=t;return this.setItem(i)}))}setItem(e){if(!e)return this.setTitle(""),void this.setSubtitle("");const t=e.info();this.setTitle(t.title),this.setSubtitle(t.subtitle)}setTitle(e){return x().setText(this.titleEl,e),this.refresh(),e}setSubtitle(e){return x().setText(this.subtitleEl,e),this.refresh(),e}refresh(){(()=>this.titleEl.innerText)()||(()=>this.subtitleEl.innerText)()?this.show():this.hide()}createEl(){this.titleEl=k.createEl("div",{className:"vjs-title-bar-title"}),this.subtitleEl=k.createEl("div",{className:"vjs-title-bar-subtitle"});const e=super.createEl("div",{append:this.titleEl,className:"vjs-title-bar"});return e.appendChild(this.titleEl),e.appendChild(this.subtitleEl),e}});var I="3.0.1";const P=a().getTech("Html5"),O=a().registerPlugin||a().plugin,L=["abort","emptied","loadstart","play"],D=["abort","emptied"],R=["ad-playback","ads-ready?","postroll?","preroll?"];let N=0;const M=function(){const e=[];let t,i,n=!1,s=!0;const r=t=>function(i,n){if(this.perSourceBehaviors.disabled())return;const s=2===arguments.length,r=this.currentSrc(),a=[i],o=arguments[arguments.length-1],l=s?this:i,c=o.bind(l),u=(...e)=>{const i=this.currentSrc()!==r;this.perSourceBehaviors.disabled()||((i||t)&&this.off(...a),i||c(...e))};return u.guid=c.guid=o.guid="psb-"+ ++N,s||a.push(n),a.push(u),e.push(a),this.on(...a)};this.perSourceBehaviors={disable:function(){return this.clearTimeout(i),i=null,n=!0,n}.bind(this),disabled:()=>n,enable:()=>(n=!1,n),enabled:()=>!n,isSrcStable:()=>s,VERSION:I},this.onPerSrc=r(),this.onePerSrc=r(!0),this.on("dispose",(()=>{e.length=0})),this.on(L,(n=>{if(this.perSourceBehaviors.disabled()||i||((e,t)=>{return!!e.usingPlugin("ads")&&((e=>e.usingPlugin("ads")&&"function"==typeof e.ads.inAdBreak)(e)?e.ads.isInAdMode()&&"loadstart"!==t.type:(i=e.ads.state,R.indexOf(i)>-1));var i})(this,n))return;s&&D.indexOf(n.type)>-1&&(s=!1,this.trigger("sourceunstable"));const r=[],a=e=>r.push({time:Date.now(),event:e});a(n),this.on(P.Events,a),i=this.setTimeout((()=>{const n=this.currentSrc();s=!0,i=null,this.off(P.Events,a),n&&n!==t&&(e.forEach((e=>this.off(...e))),e.length=0,this.trigger("sourcechanged",{interimEvents:r,from:t,to:n}),t=n)}),1)}))};M.VERSION=I,O("perSourceBehaviors",M);const j=a().getComponent("MenuItem"),U=a().getComponent("Component");class B extends j{constructor(e,t){t.selectable=!0,t.multiSelectable=!1,super(e,t)}handleClick(){const e=this.options_;super.handleClick();const t=[...this.player_.qualityLevels().levels_];for(const[i,n]of t.entries())n.enabled=e.index===t.length||e.index===i}update(){const e=this.player_.qualityLevels().selectedIndex;this.selected(this.options_.index===e)}}U.registerComponent("SourceMenuItem",B);const F=B,q=a().getComponent("MenuButton"),$=class extends q{constructor(e,t){super(e,t);const i=this.player_.qualityLevels();if(t&&t.default)if("low"===t.default)for(const[e,t]of i.entries())t.enabled=0===e;else if("high"===t.default)for(let e=0;e<i.length;e++)i[e].enabled=e===i.length-1;this.player_.qualityLevels().on(["change","addqualitylevel","removequalitylevel"],a().bind(this,this.update))}createEl(){return a().dom.createEl("div",{className:"vjs-http-source-selector vjs-menu-button vjs-menu-button-popup vjs-control vjs-button"})}buildCSSClass(){return q.prototype.buildCSSClass.call(this)}update(){return q.prototype.update.call(this)}createItems(){const e=[],t=this.player_.qualityLevels(),i=[];for(let n=t.length-1;n>=0;n--){const s=n===t.selectedIndex;let r="".concat(n),a=n;const o=t[n];o.height?(r="".concat(o.height,"p"),a=Number.parseInt(o.height,10)):o.bitrate&&(r="".concat(Math.floor(o.bitrate/1e3)," kbps"),a=Number.parseInt(o.bitrate,10)),i.includes(r)||(i.push(r),e.push(new F(this.player_,{label:r,index:n,selected:s,sortValue:a})))}return t.length>1&&e.push(new F(this.player_,{label:"Auto",index:t.length,selected:!1,sortValue:999999})),e.sort((function(e,t){return t.options_.sortValue-e.options_.sortValue})),e}},H={},V=a().getPlugin("plugin");(0,a().registerPlugin)("httpSourceSelector",class extends V{constructor(e,t){a().registerComponent("SourceMenuButton",$),a().registerComponent("SourceMenuItem",F);const i=(a().obj&&a().obj.merge||a().mergeOptions)(H,t);super(e,i),this.options_=i,this.player_=e,this.on(e,"ready",(()=>{this.reset(),this.init()}))}init(){this.player_.addClass("vjs-http-source-selector"),this.player_.videojsHTTPSouceSelectorInitialized=!0,"Html5"===this.player_.techName_?this.on(this.player_,"loadedmetadata",(()=>{this.metadataLoaded()})):(console.error(this.player_.techName_+" tech is not supported"),this.reset())}reset(){this.player_.removeClass("vjs-http-source-selector"),!0===this.player_.videojsHTTPSouceSelectorInitialized&&(this.player_.controlBar.getChild("SourceMenuButton")||this.player_.controlBar.removeChild("SourceMenuButton",{}),this.player_.videojsHTTPSouceSelectorInitialized=!1)}metadataLoaded(){const e=this.player_.controlBar,t=e.getChild("fullscreenToggle");e.getChild("SourceMenuButton")||(t?e.el().insertBefore(e.addChild("SourceMenuButton").el(),t.el()):e.el().append(e.addChild("SourceMenuButton").el()))}});let z={};const W=function(){function e(e,t){return this.player=e,this.options=t,this.initializeHighlightsGraph(),this}return e.prototype.src=function(e){this.resetPlugin(),this.options.src=e,this.initializeHighlightsGraph()},e.prototype.detach=function(){this.resetPlugin()},e.prototype.resetPlugin=function(){this.graphHolder&&this.graphHolder.parentNode.removeChild(this.graphHolder),delete this.progressBar,delete this.graphHolder,delete this.lastStyle},e.prototype.initializeHighlightsGraph=function(){this.options.src&&fetch(this.options.src).then((e=>e.json())).then((e=>{this.setupHighlightsGraphElement(),this.graphHolder&&this.createHighlightsGraph(e)}))},e.prototype.setupHighlightsGraphElement=function(){if(this.progressBar=this.player.$(".vjs-progress-control"),!this.progressBar)return;const e=this.player.$(".vjs-highlights-graph-display")||document.createElement("div");e.setAttribute("class","vjs-highlights-graph-display"),this.progressBar.appendChild(e),this.graphHolder=e},e.prototype.createPath=function(e,t,i){const n=t/(e.length-1),s=e.map(((e,t)=>({x:t*n,y:i-e*i}))),r=document.createElementNS("http://www.w3.org/2000/svg","path");r.setAttribute("fill","lightblue");let a="M ".concat(s[0].x,",").concat(s[0].y);for(let e=0;e<s.length-1;e++){const t=(s[e].x+s[e+1].x)/2,i=(s[e].y+s[e+1].y)/2;a+=" Q ".concat(s[e].x,",").concat(s[e].y," ").concat(t,",").concat(i)}return a+=" Q ".concat(s[s.length-1].x,",").concat(s[s.length-1].y," ").concat(s[s.length-1].x,",").concat(s[s.length-1].y),a+=" L ".concat(s[s.length-1].x,",").concat(i," L ").concat(s[0].x,",").concat(i," Z"),r.setAttribute("d",a),r},e.prototype.createHighlightsGraph=function(e){const t=e.data,i=this.player.$(".vjs-highlights-graph-display > svg")||document.createElementNS("http://www.w3.org/2000/svg","svg");i.setAttribute("viewBox","0 0 ".concat(600," ").concat(20)),i.setAttribute("preserveAspectRatio","none"),i.setAttribute("width",600),i.setAttribute("height",20),i.innerHTML="";const n=this.createPath(t,600,20);i.appendChild(n),this.graphHolder.appendChild(i)},e}();var G=i(5871),X=i(6827),Y=i.n(X),K=i(8953),Q=i.n(K),J=i(1104);const Z={percentsplayed:{percents:[25,50,75,100]}},ee={events:[J.f.PERCENTS_PLAYED,J.f.PAUSE_NO_SEEK,J.f.SEEK,J.f.MUTE,J.f.UNMUTE,J.f.QUALITY_CHANGED]};class te extends(Y()){constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this.player=e;const i=a().obj.merge(ee,t);let n={lastState:void 0},s=0,r=0,o=!1,l=[],c=[],u=null,h=!1;const d=()=>{l=[],c=[]};this.events=ie(i.events,Z),n={lastState:void 0},s=r=0,o=!1,d(),this.player.on(J.f.PLAY,(()=>{h&&(this.player.trigger("replay"),h=!1)}).bind(this)),this.player.on(J.f.ENDED,(()=>{h=!0}).bind(this)),(this.events.percentsplayed||this.events.timeplayed||this.events.seek||this.events.totaltimeplayed)&&this.player.on(J.f.TIME_UPDATE,(e=>{const t=this.player.currentTime(),i=this.player.duration(),n=(t,i)=>{i.originalType="timeupdate",this.emit(t,e,i)};if(this.events.percentsplayed&&this.events.percentsplayed.percents.forEach((e=>{ne(t,i,e)&&-1===l.indexOf(e)&&(l.push(e),n(J.f.PERCENTS_PLAYED,{percent:e}))})),this.events.timeplayed){const e=this.events.timeplayed;(e.interval?[Math.floor(t/e.interval)*e.interval]:e.times).forEach((e=>{se(t,e)&&-1===c.indexOf(e)&&(c.push(e),n(J.f.TIME_PLAYED,{time:e}))}))}this.events.seek&&(s=r,r=t,Math.abs(s-r)>1&&(o=!0,d(),n(J.f.SEEK,{seekStart:s,seekEnd:r})))}).bind(this)),(this.events.mute||this.events.unmute)&&this.player.on(J.f.VOLUME_CHANGE,(e=>{this.player.muted()&&"muted"!==n.lastState?(n.lastState="muted",this.emit(J.f.MUTE,e)):this.player.muted()||"unmuted"===n.lastState||(n.lastState="unmuted",this.emit(J.f.UNMUTE,e))}).bind(this)),this.events.pausenoseek&&(this.player.on(J.f.PAUSE,(e=>{Math.round(this.player.currentTime())===Math.round(this.player.duration())||o||this.emit(J.f.PAUSE_NO_SEEK,e)}).bind(this)),this.player.on(J.f.PLAY,(()=>{o=!1}).bind(this))),this.player.on(J.f.LOADED_METADATA,(()=>{this.player.currentSource().src!==u&&(d(),u=this.player.currentSource().src)}).bind(this)),this.player.on(J.f.LOADED_DATA,(e=>{let t=this,i=this.player.textTracks(),n=null;for(let e=0;e<i.length;e++)"segment-metadata"===i[e].label&&(n=i[e]);let s=null;n&&n.on("cuechange",(function(){let i=n.activeCues[0];if(i){let n=i.value.resolution;if(s!==n){let i={from:s,to:n};t.emit(J.f.QUALITY_CHANGED,e,i)}s=n}}))}).bind(this))}}const ie=(e,t)=>{let i=e;return"Array"===e.constructor.name&&(i=e.reduce(((e,i)=>{const n=t[i]||{};return Q()(i)?e[i.type]=Object.assign({},n,i):e[i]=n,e}),{})),i},ne=function(e,t,i){return se(e,t*i/100,arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5)},se=function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.5;return e<=t+i&&e>=t-i},re=te,ae=[J.f.PLAY,J.f.PAUSE,J.f.ENDED,J.f.VOLUME_CHANGE,J.f.RESIZE,J.f.ERROR,J.f.FULL_SCREEN_CHANGE,J.f.START,J.f.VIDEO_LOAD,J.f.PERCENTS_PLAYED,J.f.SEEK,J.f.PLAYER_LOAD],oe={percentsplayed:{percents:[25,50,75,100]}},le={events:ae,category:"Video",defaultLabel:e=>e.cloudinary&&e.cloudinary.currentPublicId()||e.currentSource().src};class ce{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.player=e,this.options=a().obj.merge(le,t),this.events=ie(this.options.events,oe);const i=(0,G.sliceProperties)(this.events,J.f.PERCENTS_PLAYED,J.f.TIME_PLAYED,J.f.PAUSE,J.f.SEEK);i.pause&&(delete i.pause,i.pausenoseek={}),this._extendedEvents=new re(e,{events:i}),this._currentSource=null,this._startTracked=null,this._endTracked=null,this.resetState()}init(){this.events.shoppable&&(this.player.on("productHover",((e,t)=>{this.track({action:"productHover",label:t.productName})}).bind(this)),this.player.on("productClick",((e,t)=>{this.track({action:"productClick",label:t.productName})}).bind(this)),this.player.on("productHoverPost",((e,t)=>{this.track({action:"productHoverPostPlay",label:t.productName})}).bind(this)),this.player.on("productClickPost",((e,t)=>{this.track({action:"productClickPostPlay",label:t.productName})}).bind(this)),this.player.on("productBarMin",(()=>{this.track({action:"shoppableBar",label:"closed"})}).bind(this)),this.player.on("productBarMax",(()=>{this.track({action:"shoppableBar",label:"opened"})}).bind(this)),this.player.on("replay",(()=>{this.track({action:"replay"})}).bind(this))),this.events.play&&this.player.on(J.f.PLAY,(()=>{this.track({action:"Play"})}).bind(this)),this.events.ended&&this.player.on(J.f.ENDED,(()=>{this._endTracked||(this.track({action:"Ended",nonInteraction:!0}),this._endTracked=!0)}).bind(this)),this.events.volumechange&&this.player.on(J.f.VOLUME_CHANGE,(()=>{const e=this.player.muted()?0:this.player.volume();this.track({action:"Volume Change",value:e})}).bind(this)),this.events.resize&&this.player.on(J.f.RESIZE,(()=>{const e="Resize - ".concat(this.player.width(),"x").concat(this.player.height(),"}");this.track({action:e})}).bind(this)),this.events.error&&this.player.on(J.f.ERROR,(()=>{this.track({action:"Error",nonInteraction:!0})}).bind(this)),this.events.start&&this.player.on(J.f.PLAYING,(()=>{this._startTracked&&(this.track({action:"Start"}),this._startTracked=!0)}).bind(this)),this.events.fullscreenchange&&this.player.on(J.f.FULL_SCREEN_CHANGE,(()=>{const e=this.player.isFullscreen()?"Enter Fullscreen":"Exit Fullscreen";this.track({action:e})}).bind(this)),this.events.percentsplayed&&this._extendedEvents.on(J.f.PERCENTS_PLAYED,((e,t)=>{const{percent:i}=t;this.track({action:"".concat(i," Percents Played"),nonInteraction:!0})}).bind(this)),this.events.timeplayed&&this._extendedEvents.on(J.f.TIME_PLAYED,((e,t)=>{const{time:i}=t;this.track({action:"".concat(i," Seconds Played"),value:i,nonInteraction:!0})}).bind(this)),this.events.pause&&this._extendedEvents.on(J.f.PAUSE_NO_SEEK,(()=>{this.track({action:"Pause"})}).bind(this)),this.events.seek&&this._extendedEvents.on(J.f.SEEK,((e,t)=>{const{seekStart:i,seekEnd:n}=t;this.track({action:"Seek Start",value:i}),this.track({action:"Seek End",value:n})}).bind(this)),this.events.playerload&&(()=>{this.track({action:"Player Load",label:window.location.href,nonInteraction:!0})})(),this.player.on(J.f.LOADED_METADATA,this.loadedmetadata.bind(this))}track(e){let{action:t,label:i,value:n=null,nonInteraction:s=!1}=e;const r={eventCategory:this.options.category,eventAction:t,eventLabel:i||this.options.defaultLabel(this.player),eventValue:n||Math.round(this.player.currentTime()),nonInteraction:s};window.ga("send","event",r)}videoload(){this.track({action:"Video Load",nonInteraction:!0})}resetState(){this._currentSource="",this._startTracked=!1,this._endTracked=!1}loadedmetadata(){const e=this.player.currentSource().src;e!==this._currentSource&&(this.resetState(),this._currentSource=e,this.events.videoload&&this.videoload())}}var ue=i(3171);const he={fraction:.5,isMuted:!0};class de{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=Object.assign({},he,t),this.player=e;let i=(0,G.sliceProperties)(t,"fraction"),n=!1,s=!1,r=null,a=null;this.init=()=>{h(),u()};const o=()=>{window.removeEventListener("DOMContentLoaded",u,!1),window.removeEventListener("load",u,!1),window.removeEventListener("scroll",u,!1),window.removeEventListener("resize",u,!1),this.player.off("pause",r),this.player.off("play",a)},l=()=>{n=!0,s=!1,this.player.pause()},c=()=>{n=!1,s=!0,this.player.play()},u=()=>{(0,ue.isElementInViewport)(this.player.el(),{fraction:i.fraction})?this.player.paused()&&c():this.player.paused()||this.player.activePlugins_.floatingPlayer||l()},h=()=>{r=()=>{this.player.waiting||n||o()},a=()=>{s||o()},window.addEventListener("DOMContentLoaded",u,!1),window.addEventListener("load",u,!1),window.addEventListener("scroll",u,!1),window.addEventListener("resize",u,!1),this.player.on("pause",r),this.player.on("play",a)}}}var pe=i(5004),fe=i(8033),me=i(5381);const ge=class{constructor(e){this._emitter=e,this._eventHandlers=[]}on(e,t){this._eventHandlers.push({type:e,handler:t}),this._emitter.on(e,t)}one(e,t){var i=this;this._eventHandlers.push({type:e,handler:t,wrapper:function(){t(...arguments),i.off(e,t)}}),this._emitter.one(e,t)}off(e,t){var i;const n=null===(i=this._eventHandlers)||void 0===i?void 0:i.findIndex((i=>i.type===e&&i.handler===t));if(-1===n)return;const s=this._eventHandlers[n];this._emitter.off(e,s.wrapper||s.handler),this._eventHandlers.splice(n,1)}removeAllListeners(){this._eventHandlers.forEach((e=>{this.off(e)}))}};var ye=i(4650),ve=i(7311);const _e={format:"jpg",resource_type:"video",transformation:{flags:"waveform"}},be=RegExp("\\.(".concat(["mp3","ogg","wav","mp4"].join("|"),")$$")),Te={resource_type:"video",type:"upload",transformation:[]};class Se extends me.A{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};({publicId:e,options:t}=(0,fe.a5)(e,t)),e=e.replace(be,""),t=Object.assign({},Te,t);const{poster:i}=(0,G.sliceAndUnsetProperties)(t,"poster");super(e,t),this._poster=null,this._type=J.x.AUDIO,this.poster(i)}getPoster(){return this._poster}poster(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e?e instanceof ye.A?(this._poster=e,this):(({publicId:e,options:t}=(0,fe.a5)(e,t,{tolerateMissingId:!0})),e||(e=this.publicId(),t=Object.assign({},t,_e)),t.cloudinaryConfig=t.cloudinaryConfig||this.cloudinaryConfig(),this._poster=new ye.A(e,t),this):this._poster}generateSources(){return this.sourceTypes().map((e=>{if("audio"===e){const t="mp3",i={},n=this.sourceTransformation()[e]||[this.transformation()];n&&(i.transformation=n),Object.assign(i,{resource_type:"video",format:t});const s=this.queryParams()?(0,ve.y)(this.queryParams()):"";return{type:"video/mp4",src:"".concat(this.config().url(this.publicId(),i)).concat(s),cldSrc:this,poster:this.getPoster().url()}}return null}),this)}}const we=Se,Ee={transformation:{},sourceTypes:[],sourceTransformation:[],posterOptions:{}},Ce=["cloudinaryConfig","transformation","sourceTypes","sourceTransformation","posterOptions","autoShowRecommendations"];class xe{constructor(e){var t=this;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,fe.M6)(),this.player=e,n=Object.assign({},Ee,n);let s=null,r=null,a=null,o=null,l=null,c=null,u=null,h=null,d=null,p=n.chainTarget,f=null,m=null,g=!1;this.source=function(n){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r=Object.assign({},r),!n)return s;let a=null;if(n instanceof me.A)a=n;else{let{publicId:e,options:i}=(0,fe.a5)(n,r);a=t.buildSource(e,i)}const o=a.recommendations();if(o&&o.length){let t=null,n=!1;r.recommendationOptions&&({disableAutoShow:n,itemBuilder:t}=(0,G.sliceAndUnsetProperties)(r.recommendationOptions,"disableAutoShow","itemBuilder")),async function(e){try{return e.getChild("recommendationsOverlay")||(await Promise.all([i.e(869),i.e(410)]).then(i.bind(i,7604)),e.addChild("recommendationsOverlay")),e}catch(e){console.error("Failed to load plugin:",e)}}(e).then((()=>{y(o,{disableAutoShow:n,itemBuilder:t})}))}else _();return s=a,r.sourceTypes&&r.sourceTypes.some((e=>e.includes("dash")))?i.e(367).then(i.bind(i,6604)).then((()=>{b()})):r.skipRefresh||b(),t.player.trigger("cldsourcechanged",{source:a}),p},this.buildSource=function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null;return({publicId:e,options:i}=(0,fe.a5)(e,i)),i.cloudinaryConfig=(0,fe.lP)(t.cloudinaryConfig(),i.cloudinaryConfig||{}),i.transformation=(0,fe.N7)(t.transformation(),i.transformation||{}),i.sourceTransformation=i.sourceTransformation||t.sourceTransformation(),i.sourceTypes=i.sourceTypes||t.sourceTypes(),i.poster=i.poster||S(),i.queryParams=Object.assign(i.queryParams||{},i.usageReport?{_s:"vp-".concat("2.0.3-edge.0")}:{}),n=i.sourceTypes.indexOf("audio")>-1?new we(e,i):new me.A(e,i),n},this.posterOptions=e=>e?(l=e,p):l,this.disablePoster=e=>{this.player.poster(" "),this.player.posterImage.el().style.backgroundColor=e},this.cloudinaryConfig=e=>e?(c=e,p):c,this.transformation=e=>e?(u=e,p):u,this.sourceTypes=e=>e?(h=e,p):h,this.getCurrentSources=()=>r,this.sourceTransformation=e=>e?(d=e,p):d,this.on=function(){return f.on(...arguments)},this.one=function(){return f.one(...arguments)},this.off=function(){return f.off(...arguments)},this.autoShowRecommendations=e=>void 0===e?g:(g=e,p),this.dispose=()=>{this.playlist&&this.playlist()&&this.disposePlaylist(),_(),s=void 0,f.removeAllListeners()};const y=(e,t)=>{let{disableAutoShow:i=!1,itemBuilder:n=null}=t;if(_(),!Array.isArray(e)&&"function"!=typeof e&&!e.then)throw new Error('"recommendations" must be either an array or a function');m={},n=n||(e=>({source:e instanceof me.A?e:this.buildSource(e),action:()=>this.source(e)})),m.sourceChangedHandler=()=>{const t=e=>{if(void 0!==e&&e.length>0){const t=e.map((e=>n(e)));this.player.trigger("recommendationschanged",{items:t})}else this.player.trigger("recommendationsnoshow");m.sources=e};v()(e)?t(e()):e.then?e.then(t):t(e)},m.sourceChangedHandler(),m.endedHandler=()=>{!i&&this.autoShowRecommendations()&&this.player.trigger("recommendationsshow")},this.on("ended",m.endedHandler)},_=()=>{m&&(this.off("cldsourcechanged",m.sourceChangedHandler),this.off("ended",m.endedHandler),delete m.endedHandler,delete m.sourceChangedHandler),m=null},b=()=>{const e=this.source(),t=Object.assign({},this.player.cloudinary.posterOptions(),e.getInitOptions().poster);t.posterColor?this.disablePoster(t.posterColor):e.poster()&&this.player.poster(e.poster().url()),r=e.generateSources().reduce(((e,t)=>{if(t.isAdaptive)if(t.type.split("; ")[1]&&"MediaSource"in window){const i=t.type.split("; ");let n="video/mp4; ".concat(i[1]||"");T(n)&&e.push(t)}else e.push(t);else e.push(t);return e}),[]),this.player.src(r),a=e,this.playlist&&(o=this.playlist())},T=e=>document.createElement("video").canPlayType(e)||"MediaSource"in window&&MediaSource.isTypeSupported(e),S=()=>{const e=Object.assign({},this.posterOptions());e.transformation=e.transformation||{},!e.transformation.width&&!e.transformation.height||e.transformation.crop||(e.transformation.crop="scale");const t=this.player.el();if(t&&t.clientWidth&&t.clientHeight&&!(0,pe.isKeyInTransformation)(e.transformation,"width")&&!(0,pe.isKeyInTransformation)(e.transformation,"height")){const i=e=>100*Math.ceil(e/100);e.transformation=(0,fe.N7)(e.transformation,{width:i(t.clientWidth),height:i(t.clientHeight),crop:"limit"})}return e};f=new ge(this.player);const w=(0,G.sliceAndUnsetProperties)(n,...Ce);var E,C;E=this,C=w,Object.entries(C).forEach((e=>{let[t,i]=e;E[t]&&"function"==typeof E[t]&&E[t](i)})),this.on("sourcechanged",((e,t)=>{let i=t.to;a&&a.contains(i)?this.source()||(this.playlist&&o&&this.playlist(o),this.source(a,{skipRefresh:!0})):(this.player.trigger("cldsourcechanged",{}),this.dispose())}))}currentSourceType(){return this.source().getType()}currentPublicId(){return this.source()&&this.source().publicId()}currentPoster(){return this.source()&&this.source().poster()}}var ke=i(4138);function Ae(e,t,i){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?n:n+"")in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}class Ie{constructor(e){Ae(this,"getMetadata",(()=>({cloudName:this.player.cloudinary.cloudinaryConfig().cloud_name,publicId:this.player.cloudinary.currentPublicId()}))),Ae(this,"sourceChanged",(()=>{const e=this.getMetadata();e.cloudName&&e.publicId?(this.currentVideMetadata=e,this.cloudinaryAnalytics.startManualTracking(e,{videoPlayerType:"cloudinary video player",videoPlayerVersion:"2.0.3-edge.0"})):this.currentVideMetadata.cloudName===e.cloudName&&this.currentVideMetadata.publicId===e.publicId||this.cloudinaryAnalytics.stopManualTracking()})),this.player=e,this.cloudinaryAnalytics=(0,ke.connectCloudinaryAnalytics)(this.player.videoElement),this.currentVideMetadata={cloudName:null,publicId:null}}init(){this.player.on(J.f.CLD_SOURCE_CHANGED,this.sourceChanged)}}var Pe=i(4500),Oe=i(7134);const Le=a().getComponent("MenuItem"),De=class extends Le{handleClick(){super.handleClick(),this.options_.listener()}createEl(){const e=(0,Oe.n)("span",{class:"vjs-menu-item-text"+(this.options_.class?" ".concat(this.options_.class):"")});return e.appendChild(document.createTextNode(this.localize(this.options_.label))),(0,Oe.n)("li",{class:"vjs-menu-item",tabIndex:-1},e)}},Re=a().getComponent("Menu"),Ne=class extends Re{constructor(e,t){var i;super(e,t),i=this,t.content.forEach((t=>{let n=null;n=v()(t.listener)?t.listener:"string"==typeof t.href?()=>window.open(t.href):()=>!0,this.addItem(new De(e,{label:t.label,class:t.class,listener:function(){n(...arguments),i.dispose()}}))}))}setPosition(e,t){(0,ue.setPosition)(this.el(),e,t)}createEl(){const e=super.createEl();if(a().dom.addClass(e,"vjs-context-menu-ui"),this.options_.position){const{left:e,top:t}=this.options_.position;this.setPosition(e,t)}return e}},Me={cancel:!0,sensitivity:10,wait:500,disabled:!1},je="vjs-contextmenu";function Ue(e,t){if(e.contextmenu.options.disabled)return e;const i={target:e,type:je};return["clientX","clientY","pageX","pageY","screenX","screenY"].forEach((e=>{i[e]=t[e]})),e.trigger(i)}function Be(e){const t=this.contextmenu.current;if(!t)return;const i=this.contextmenu.options.wait;"touchend"===e.type&&(new Date).getTime()-t.time>=i&&Ue(this,e),this.contextmenu.current=null}function Fe(e){const t=this.contextmenu.current;if(!t)return;const i=e.touches[0],n=this.contextmenu.options.sensitivity;(i.screenX-t.screenX>n||i.screenY-t.screenY>n)&&(this.contextmenu.current=null)}function qe(e){if(this.contextmenu.current)return;const t=e.touches[0];this.contextmenu.current={screenX:t.screenX,screenY:t.screenY,time:(new Date).getTime()}}function $e(e){this.contextmenu.options.cancel&&!this.contextmenu.options.disabled&&e.preventDefault(),Ue(this,e),this.off(["touchcancel","touchend"],Be),this.off("touchmove",Fe),this.off("touchstart",qe)}a().registerPlugin("contextmenu",(function(e){this.contextmenu.options=a().obj.merge(Me,e),this.on("contextmenu",$e),this.on(["touchcancel","touchend"],Be),this.on("touchmove",Fe),this.on("touchstart",qe),this.ready((()=>this.addClass(je)))}));const He={showNativeOnRecurringEvent:!1};class Ve{constructor(e,t){if(!Array.isArray(t.content)&&!v()(t.content))throw new Error('"content" required');const i=Object.assign({},He,t);this.player=e;const n=(0,G.sliceProperties)(i,"content","showNativeOnRecurringEvent");this.init=()=>{this.player.contextmenu(),this.player.on("vjs-contextmenu",r),this.player.ready((()=>this.player.addClass("vjs-context-menu")))};const s=e=>{const t=this.menu.el();t.style.visibility="hidden",this.player.el().appendChild(t);const i=t.getBoundingClientRect();this.player.el().removeChild(t),t.style.visibility="visible";const n=(0,ue.getPointerPosition)(this.player.el(),e),s=this.player.el().getBoundingClientRect();let r=s.height-s.height*n.y+1,a=Math.round(s.width*n.x)+1,o=r,l=a;return r+i.height>s.height&&(o=r+i.height-s.height>i.height/2?r-i.height-1:s.height-i.height),a+i.width>s.width&&(l=a+i.width-s.width>i.width/2?a-i.width-1:s.width-i.width),o<r&&l<a&&(o=r-i.height-1,l=a-i.width-1),o=Math.max(0,o),l=Math.max(0,l),{left:l,top:o}},r=e=>{if(this.menu&&(this.menu.dispose(),n.showNativeOnRecurringEvent))return;n.showNativeOnRecurringEvent&&(this.player.contextmenu.options.cancel=!1),e.preventDefault();let t=n.content;v()(t)&&(t=t(this.player)),this.menu=new Ne(this.player,{content:t});const{left:i,top:r}=s(e);this.menu.setPosition(i,r);const o=e=>{("click"!==e.type||3!==e.which&&2!==e.button)&&this.menu.dispose()};this.menu.on("dispose",(()=>{this.player.contextmenu.options.cancel=!0,this.player.removeChild(this.menu),a().off(document,["click","tap"],o),delete this.menu})),this.player.addChild(this.menu),a().on(document,["click","tap"],o)}}}var ze=i(608);const We={fraction:.5,collapsedWidth:300,floatTo:"right"};class Ge{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=Object.assign({},We,t),t.floatTo&&t.floatTo!==ze.rT.LEFT&&t.floatTo!==ze.rT.RIGHT&&(t.floatTo=We.floatTo),this.player=e;const i=this.player.el();let n=(0,G.sliceProperties)(t,"fraction"),s=null,r=!1,a=!1;this.init=()=>{u(),"object"==typeof this.player.ima&&h()};const o=e=>{const t=document.createElement("div");for(e.appendChild(t);e.firstChild!==t;)t.appendChild(e.firstChild);return t},l=()=>{window.removeEventListener("DOMContentLoaded",m,!1),window.removeEventListener("load",m,!1),window.removeEventListener("scroll",m,!1),window.removeEventListener("resize",m,!1)},c=()=>{window.addEventListener("DOMContentLoaded",m,!1),window.addEventListener("load",m,!1),window.addEventListener("scroll",m,!1),window.addEventListener("resize",m,!1)},u=()=>{this.player.on("play",m),this.player.on("play",c),this.player.on("dispose",l)},h=()=>{const e=i.getBoundingClientRect();s=o(i);const t=o(s);t.setAttribute("class","cld-video-player-floater-inner"),t.setAttribute("style","padding-bottom: "+100*e.height/e.width+"%;");const n=document.createElement("button");n.setAttribute("class","cld-video-player-floater-close"),n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><polygon fill-rule="evenodd" points="370 7.41 368.59 6 364 10.59 359.41 6 358 7.41 362.59 12 358 16.59 359.41 18 364 13.41 368.59 18 370 16.59 365.41 12" transform="translate(-358 -6)"/></svg>',n.onclick=()=>{p(),f()},s.appendChild(n)},d=()=>{const{ima:e}=this.player;e&&e.adsActive&&e.getAdsManager().resize(r?s.clientWidth:i.clientWidth,r?s.clientHeight:i.clientHeight)},p=()=>{s.classList.remove("cld-video-player-floating"),r=!1,d()},f=()=>{l(),this.player.off("play",m),this.player.off("play",c)},m=()=>{(0,ue.isElementInViewport)(this.player.el(),{fraction:n.fraction})?r&&p():r||(s||h(),a||(()=>{const e=i.getBoundingClientRect();s.setAttribute("class","cld-video-player-floater cld-video-player-floater-bottom-".concat(t.floatTo)),s.setAttribute("style",["width: "+t.collapsedWidth+"px;","top: "+e.top+"px;","left: "+e.left+"px;","right: "+(document.documentElement.clientWidth-e.right)+"px;","bottom: "+(document.documentElement.clientHeight-e.bottom)+"px;"].join("")),a=!0})(),r=!0,setTimeout((()=>{s.classList.add("cld-video-player-floating"),d()})))}}}let Xe={},Ye={};const Ke=function(){function e(e,t){return this.player=e,this.options=t,this.initializeThumbnails(),this}return e.prototype.src=function(e){this.resetPlugin(),this.options.src=e,this.initializeThumbnails()},e.prototype.detach=function(){this.resetPlugin()},e.prototype.resetPlugin=function(){this.thumbnailHolder&&this.thumbnailHolder.parentNode.removeChild(this.thumbnailHolder),delete this.vttData,delete this.thumbnailHolder,delete this.lastStyle},e.prototype.initializeThumbnails=function(){this.options.src&&fetch(this.options.src).then((e=>e.text())).then((e=>{this.vttData=this.processVtt(e),this.setupThumbnailElement()}))},e.prototype.setupThumbnailElement=function(){if(!this.vttData[0])return;const e=this.player.$(".vjs-progress-holder .vjs-mouse-display");this.thumbnailHolder=this.player.$(".vjs-vtt-thumbnail-display")||a().dom.createEl("div",void 0,{class:"vjs-vtt-thumbnail-display",style:"width: ".concat(this.vttData[0].css.width)}),this.thumbnailHolder.innerHTML="",this.thumbnailHolder.setAttribute("class","vjs-vtt-thumbnail-display"),e.appendChild(this.thumbnailHolder);const t=parseInt(this.vttData[0].css.width,10)/2,i=this.updateThumbnailStyle.bind(this);this.player.getDescendant(["controlBar","progressControl","seekBar","mouseTimeDisplay"]).update=function(e,n){const s=n*this.player_.duration(),r=e.width;i(s),this.getChild("timeTooltip").updateTime(e,n,s,(()=>{e.width*n<t?this.el_.style.left="".concat(t,"px"):e.width*n+t>r?this.el_.style.left="".concat(e.width-t,"px"):this.el_.style.left="".concat(e.width*n,"px")})),this.getChild("timeTooltip").write(a().time.formatTime(s))}},e.prototype.getStyleForTime=function(e){for(let t=0;t<this.vttData.length;++t){let i=this.vttData[t];if(e>=i.start&&e<i.end){if(i.css.url&&!Ye[i.css.url]){let e=new Image;e.src=i.css.url,Ye[i.css.url]=e}return i.css}}},e.prototype.updateThumbnailStyle=function(e){let t=this.getStyleForTime(e);if(t){if(this.thumbnailHolder.style.opacity="1",!this.lastStyle||this.lastStyle!==t){this.lastStyle=t;for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(this.thumbnailHolder.style[e]=t[e])}}else this.thumbnailHolder.style.opacity="0"},e.prototype.processVtt=function(e){let t=[];return e.split(/[\r\n][\r\n]/i).forEach((e=>{if(e.match(/([0-9]{2}:)?([0-9]{2}:)?[0-9]{2}(.[0-9]{3})?( ?--> ?)([0-9]{2}:)?([0-9]{2}:)?[0-9]{2}(.[0-9]{3})?[\r\n]{1}.*/gi)){let i=e.split(/[\r\n]/i),n=i[0].split(/ ?--> ?/i),s=n[0],r=n[1],a=i[1].split("/").pop(),o=this.getVttCss(a);t.push({start:this.getSecondsFromTimestamp(s),end:this.getSecondsFromTimestamp(r),css:o})}})),t},e.prototype.getPropsFromDef=function(e){let t=e.split(/#xywh=/i),i=t[0],n=t[1].match(/[0-9]+/gi);return{x:n[0],y:n[1],w:n[2],h:n[3],image:i}},e.prototype.getVttCss=function(e){let t={};e=[this.options.src.split(/([^\/]*)$/gi).shift().trim(),e.trim()].join("/");let i=this.getPropsFromDef(e);return t.background='url("'+i.image+'") no-repeat -'+i.x+"px -"+i.y+"px",t.width=i.w+"px",t.height=i.h+"px",t.url=i.image,t},e.prototype.getSecondsFromTimestamp=function(e){const[t,i,n]=e.split(":").map(parseFloat);return 60*t*60+60*i+n},e}();var Qe=i(7588),Je=i(3066);const Ze={aiHighlightsGraph:function(e){this.ready((()=>{!function(e,t){e.addClass("vjs-ai-highlights-graph"),e.aiHighlightsGraph=new W(e,t)}(this,a().obj.merge(z,e))}))},analytics:function(){new ce(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).init()},autoplayOnScroll:function(){new de(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).init()},cloudinary:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.chainTarget=e.chainTarget||this,this.cloudinary=new xe(this,e)},cloudinaryAnalytics:function(){new Ie(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).init()},colors:Pe.A,contextMenu:function(){new Ve(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).init()},floatingPlayer:function(){new Ge(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).init()},pacedTranscript:function(e){const t=this,i=t.cloudinary.source(),n={kind:e.kind||"captions",label:e.label||"Captions",default:e.default,srclang:e.srclang||"en",src:e.src||(0,fe.KA)(i.publicId(),(0,fe.lP)(t.cloudinary.cloudinaryConfig(),{resource_type:"raw"}))+".transcript",maxWords:e.maxWords,wordHighlight:e.wordHighlight,timeOffset:e.timeOffset||0};t.textTrackDisplay.el().classList.add("cld-paced-text-tracks");t.one("loadedmetadata",(()=>{(async()=>{try{const e=await fetch(n.src),i=(e=>{const t=[],i=e=>{let{startTime:i,endTime:s,text:r}=e;t.push({startTime:i+n.timeOffset,endTime:s+n.timeOffset,text:r})};return e.forEach((e=>{const s=e.words,r=n.maxWords||s.length;for(let e=0;e<s.length;e+=r)n.wordHighlight?s.slice(e,Math.min(e+r,s.length)).forEach(((t,n)=>{i({startTime:t.start_time,endTime:t.end_time,text:s.slice(e,e+r).map((e=>e===t?"<b>".concat(e.word,"</b>"):e.word)).join(" ")}),s[n+1]&&t.end_time<s[n+1].start_time&&i({startTime:t.end_time,endTime:s[n+1].start_time,text:s.slice(e,e+r).map((e=>e.word)).join(" ")})})):t.push({startTime:s[e].start_time,endTime:s[Math.min(e+r-1,s.length-1)].end_time,text:s.slice(e,e+r).map((e=>e.word)).join(" ")})})),t})(await e.json()),s=t.addRemoteTextTrack({kind:n.kind,label:n.label,srclang:n.srclang,default:n.default,mode:n.default?"showing":"disabled"});await new Promise((e=>setTimeout(e,100))),i.forEach((e=>{s.track.addCue(new VTTCue(e.startTime,e.endTime,e.text))}))}catch(e){console.error("Error loading transcription file:",e)}})()}))},vttThumbnails:function(e){this.ready((()=>{!function(e,t){e.addClass("vjs-vtt-thumbnails"),e.vttThumbnails=new Ke(e,t)}(this,a().obj.merge(Xe,e))}))},chapters:async function(e){const t=this;try{const{default:n}=await Promise.all([i.e(869),i.e(625)]).then(i.bind(i,9234));t.ready((()=>n(e,t)))}catch(e){console.error("Failed to load plugin:",e)}},imaPlugin:async function(e,t){await Promise.all([i.e(869),i.e(330)]).then(i.bind(i,2650));const n=v()(e.ads),s="object"==typeof google&&"object"==typeof google.ima;if(t.ads&&(!n||!s))return n||console.warn("contribAds is not loaded"),s||console.warn("imaSdk is not loaded"),!1;e.ima({id:e.el().id,adTagUrl:t.ads.adTagUrl,disableFlashAds:!0,prerollTimeout:t.ads.prerollTimeout||5e3,postrollTimeout:t.ads.postrollTimeout||5e3,showCountdown:!1!==t.ads.showCountdown,adLabel:t.ads.adLabel||"Advertisement",locale:t.ads.locale||"en",autoPlayAdBreaks:!1!==t.ads.autoPlayAdBreaks,debug:t.ads.denug}),Object.keys(t.ads).length>0&&"object"==typeof e.ima&&("first-video"===t.ads.adsInPlaylist?e.one(J.f.SOURCE_CHANGED,(()=>{e.ima.playAdBreak()})):e.on(J.f.SOURCE_CHANGED,(()=>{e.ima.playAdBreak()})))},playlist:async function(e){const t=this;try{const{default:n}=await Promise.all([i.e(869),i.e(33)]).then(i.bind(i,5826)),s=n(t,e);return t.cloudinary.playlist=s,s}catch(e){console.error("Failed to load plugin:",e)}},shoppable:async function(e,t){const{default:n}=await Promise.all([i.e(869),i.e(525)]).then(i.bind(i,9987));new n(e,t.shoppable).init()},styledTextTracks:async function(e){const t=this;try{t.ready((()=>((e,t)=>{const i={theme:e.theme||"default",fontFace:e.fontFace,fontSize:e.fontSize,gravity:e.gravity||"bottom",box:e.box,style:e.style,wordHighlightStyle:e.wordHighlightStyle},n=document.createElement("style");t.el_.appendChild(n);const s=t.textTrackDisplay.el().classList;s.forEach((e=>{e.startsWith("cld-styled-text-tracks")&&s.remove(e)})),s.add("cld-styled-text-tracks"),s.add("cld-styled-text-tracks-theme-".concat(i.theme)),i.gravity.split("-").forEach((e=>{s.add("cld-styled-text-tracks-gravity-".concat(e))}));const r=(e,t)=>{if(Object.entries(e)){const i=Object.entries(e).reduce(((e,t)=>{let[i,n]=t;return e+"".concat(i,": ").concat(n," !important; ")}),"");n.innerHTML+="".concat(t," { ").concat(i," } ")}},a=e=>{const i="\n .".concat((0,Je.playerClassPrefix)(t)," .vjs-text-track-cue > div,\n .").concat((0,Je.playerClassPrefix)(t)," ::cue\n ");r(e,i)};if(i.fontFace&&((0,Qe.fontFace)(t.textTrackDisplay.el(),i.fontFace),a({"font-family":i.fontFace})),i.box){const{x:e,y:n,width:s,height:a}=i.box;(e=>{const i="\n .".concat((0,Je.playerClassPrefix)(t)," .vjs-text-track-display.cld-styled-text-tracks,\n .").concat((0,Je.playerClassPrefix)(t)," ::-webkit-media-text-track-display\n ");r(e,i)})({translate:"".concat(e||0," ").concat(n||0),...s?{width:s}:void 0,...a?{height:a}:void 0})}i.fontSize&&a({"font-size":i.fontSize}),i.style&&a(i.style),i.wordHighlightStyle&&(r(i.wordHighlightStyle,".".concat((0,Je.playerClassPrefix)(t)," .cld-paced-text-tracks .vjs-text-track-cue b")),r(i.wordHighlightStyle,"video::cue(b)"))})(e,t)))}catch(e){console.error("Failed to load plugin:",e)}},interactionAreas:async function(e,t,n){try{const{interactionAreasService:s}=await Promise.all([i.e(869),i.e(404)]).then(i.bind(i,1066));s(e,t,n)}catch(e){console.error("Failed to load plugin:",e)}}},et=Ze;var tt=i(5104),it=i(7668);const nt=e=>class extends e{constructor(){var e;super(),e=this;const t={data:{},handlers:{}};this.on=function(){for(var i=arguments.length,n=new Array(i),s=0;s<i;s++)n[s]=arguments[s];const r=n.length-1,a=n[r];return t.handlers[a]=function(t){t.Player=e;for(var i=arguments.length,n=new Array(i>1?i-1:0),s=1;s<i;s++)n[s-1]=arguments[s];a(t,...n)},n[r]=t.handlers[a],e.videojs.on(...n)},this.one=function(){for(var i=arguments.length,n=new Array(i),s=0;s<i;s++)n[s]=arguments[s];const r=n.length-1,a=n[r];return t.handlers[a]=function(i){i.Player=e;for(var n=arguments.length,s=new Array(n>1?n-1:0),r=1;r<n;r++)s[r-1]=arguments[r];a(i,...s),delete t.handlers[a]},n[r]=t.handlers[a],e.videojs.one(...n)},this.off=function(){for(var i=arguments.length,n=new Array(i),s=0;s<i;s++)n[s]=arguments[s];const r=n.length-1,a=n[r];n[r]=t.handlers[a];const o=e.videojs.off(...n);return delete t.handlers[a],o},this.trigger=function(){e.videojs.trigger(...arguments)}}};var st=i(8838),rt=i(5779);const at=e=>!f()(e)||null,ot=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{sourceTypes:e.sourceTypes,autoShowRecommendations:e.autoShowRecommendations,fontFace:e.fontFace,posterOptions:at(e.posterOptions),posterOptionsPublicId:e.posterOptions&&at(e.posterOptions.publicId)}},lt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{chapters:e.chapters&&(e.chapters.url?"url":"inline-chapters"),recommendations:e.recommendations&&e.recommendations.length,shoppable:at(e.shoppable),shoppableProductsLength:e.shoppable&&e.shoppable.products&&e.shoppable.products.length,...e.info?{sourceInfoTitle:e.info.title,sourceInfoSubtitle:e.info.subtitle,sourceInfoDescription:e.info.description}:{},...e.textTracks?{textTracks:at(e.textTracks),pacedTextTracks:at(e.textTracks)&&JSON.stringify(e.textTracks||{}).includes('"maxWords":'),wordHighlight:at(e.textTracks)&&JSON.stringify(e.textTracks||{}).includes('"wordHighlight":'),...e.textTracks.options?{styledTextTracksTheme:e.textTracks.options.theme,styledTextTracksFont:e.textTracks.options.fontFace,styledTextTracksFontSize:e.textTracks.options.fontSize,styledTextTracksGravity:e.textTracks.options.gravity,styledTextTracksBox:at(e.textTracks.options.box),styledTextTracksStyle:at(e.textTracks.options.style),styledTextTracksWordHighlightStyle:at(e.textTracks.options.wordHighlightStyle)}:{}}:{}}},ct=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{adsAdTagUrl:e.adTagUrl,adsShowCountdown:e.showCountdown,adsAdLabel:e.adLabel,adsLocale:e.locale,adsPrerollTimeout:e.prerollTimeout,adsPostrollTimeout:e.postrollTimeout,adsAdsInPlaylist:e.adsInPlaylist}},ut=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{playlistWidgetDirection:e.direction,playlistWidgetTotal:e.total}},ht=e=>{if(window.dashjs&&e&&e.qualityLevels&&e.dash&&e.dash.mediaPlayer){const t=dashjs.MediaPlayer;e.dash.qualityLevels=e.qualityLevels(),e.dash.mediaPlayer.getAutoSwitchQualityFor=t=>{const i=e.dash.mediaPlayer.getSettings();return!i||i.streaming.abr.autoSwitchBitrate[t]},e.dash.mediaPlayer.setAutoSwitchQualityFor=(t,i)=>{const n=e.dash.mediaPlayer,s={streaming:{abr:{autoSwitchBitrate:{}}}};s.streaming.abr.autoSwitchBitrate[t]=i,n.updateSettings(s)},e.dash.mediaPlayer.on(t.events.PLAYBACK_METADATA_LOADED,(()=>{const t=e.dash.mediaPlayer.getBitrateInfoListFor("video"),i=e.dash.mediaPlayer.getBitrateInfoListFor("audio");if(t.length>0){const n=t[t.length-1].bitrate;e.dash.audioMapper=t.map((e=>Math.round(e.bitrate/n*(i.length-1)))),t.forEach((t=>{e.dash.qualityLevels.addQualityLevel({id:t.bitrate,width:t.width,height:t.height,bandwidth:t.bitrate,selected:!0,enabled:function(t){if(void 0===t)return void 0===this.selected||this.selected;if(this.selected=t,!0===t){var i;const t=null===(i=e.qualityLevels().levels_)||void 0===i?void 0:i.findIndex((e=>e.id===this.id));e.qualityLevels().selectedIndex_=t,e.qualityLevels().trigger({type:"change",selectedIndex:t})}}})}))}})),e.qualityLevels().on("change",(t=>{1===e.dash.qualityLevels.levels_.filter((e=>e.enabled)).length?(e.dash.mediaPlayer.setQualityFor("video",t.selectedIndex),e.dash.mediaPlayer.setQualityFor("audio",e.dash.audioMapper[t.selectedIndex])):e.dash.mediaPlayer.getAutoSwitchQualityFor("video")||(e.dash.mediaPlayer.setAutoSwitchQualityFor("video",!0),e.dash.mediaPlayer.setAutoSwitchQualityFor("audio",!0))}))}},dt=e=>{const t=e.controlBar.getChild("sourceMenuButton");if(t){const i=e.qualityLevels();if(i&&i.length>1){const e=i.levels_.filter((e=>e.enabled));if(1===e.length){const n=i.levels_.findIndex((t=>t.id===e[0].id));t.children()[1].children()[n].selected(!0)}else t.children()[1].children()[0].selected(!0),t.children()[1].children().forEach(((e,t)=>{t>0&&e.selected(!1)}));t.show()}else t.hide()}};Object.keys(et).forEach((e=>{a().registerPlugin(e,et[e])})),(0,st.go)();class pt extends(tt.A.mixin(nt)){static all(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return[...document.querySelectorAll(e)].map((e=>new pt(e,...i)))}get playerOptions(){return this.options.playerOptions}constructor(e,t,i){var n,s,r,o;super(),n=this,r=()=>{this.videojs.clearTimeout(this.reTryId)},(s="symbol"==typeof(o=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(s="_clearTimeOut"))?o:o+"")in n?Object.defineProperty(n,s,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[s]=r,this.nbCalls=0,this.videoElement=(0,st.iG)(e),this.options=(0,st.Wi)(this.videoElement,t),this._videojsOptions=this.options.videojsOptions,this.videoElement.classList.add("video-js"),tt.A.fontFace(this.videoElement,this.playerOptions.cloudinary.fontFace),"init"===this._videojsOptions.bigPlayButton&&(this.videoElement.classList.add("vjs-big-play-button-init-only"),this._videojsOptions.bigPlayButton=!0),this.videojs=a()(this.videoElement,this._videojsOptions),this._isPlayerConfigValid=!0,this.playerOptions.debug&&(0,rt.I6)(this.options).then((e=>{if(!e)return this._isPlayerConfigValid=!1,void this.videojs.error("invalid player configuration")})),this._videojsOptions.muted&&this.videojs.volume(.4),this.playerOptions.fluid&&this.fluid(this.playerOptions.fluid),this._setCssClasses(),this._initPlugins(),this._initJumpButtons(),this._initPictureInPicture(),this._setVideoJsListeners(i)}getVPInstanceId(){return this.vpInstanceId||(this.vpInstanceId=d()),this.vpInstanceId}_sendInternalAnalytics(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Object.assign({},this.playerOptions,this.options.videojsOptions,e);if(t.allowUsageReport)try{const e=(n={aiHighlightsGraph:(i=t).aiHighlightsGraph,analytics:at(i.analytics),autoplay:i.autoplay,autoplayMode:i.autoplayMode,bigPlayButton:i.bigPlayButton,className:i.class,cloudinaryAnalytics:i.cloudinaryAnalytics,controls:i.controls,floatingWhenNotVisible:i.floatingWhenNotVisible,fluid:i.fluid,height:i.height,hideContextMenu:i.hideContextMenu,logoImageUrl:i.logoImageUrl,logoOnclickUrl:i.logoOnclickUrl,loop:i.loop,maxTries:i.maxTries,muted:i.muted,playbackRates:i.playbackRates,playedEventPercents:i.playedEventPercents,playedEventTimes:i.playedEventTimes,playsinline:i.playsinline,preload:i.preload,videoTimeout:i.videoTimeout,seekThumbnails:i.seekThumbnails,showJumpControls:i.showJumpControls,chaptersButton:i.chaptersButton,pictureInPictureToggle:i.pictureInPictureToggle,showLogo:i.showLogo,skin:i.skin,videoJS:at(i.videoJS),width:i.width,withCredentials:i.withCredentials,debug:i.debug,colors:i.colors&&JSON.stringify(i.colors),controlBar:JSON.stringify(i.controlBar)!==JSON.stringify(it.A.controlBar)&&JSON.stringify(i.controlBar),...ot(i.cloudinary),...lt(i.source),...ct(i.ads),...ut(i.playlistWidget)},Object.entries(n).reduce(((e,t)=>{let[i,n]=t;return n!==it.A[i]&&null!=n&&(e[i]=n),e}),{})),s=new URLSearchParams(e).toString(),r=new URLSearchParams({vpVersion:"2.0.3-edge.0",vpInstanceId:this.getVPInstanceId(),cloudName:t.cloudinary.cloudinaryConfig.cloud_name}).toString();fetch("".concat("https://analytics-api-s.cloudinary.com","/video_player_source?").concat(s,"&").concat(r))}catch(e){}var i,n}_setVideoJsListeners(e){this.videojs.on(J.f.ERROR,(()=>{const e=this.videojs.error();if(e){const t=this._isPlayerConfigValid&&this.videojs.cloudinary.currentSourceType();[3===e.code&&a().browser.IS_SAFARI,4===e.code].includes(!0)&&[J.x.AUDIO,J.x.VIDEO].includes(t)?(this.videojs.error(null),tt.A.handleCldError(this,this.playerOptions)):this._clearTimeOut()}})),this.videojs.tech_.on(J.f.RETRY_PLAYLIST,(()=>{g()(this.videojs,"hls.stats.mediaRequestsErrored",0)>0&&(this._clearTimeOut(),tt.A.handleCldError(this,this.playerOptions))})),this.videojs.on(J.f.PLAY,this._clearTimeOut),this.videojs.on(J.f.CAN_PLAY_THROUGH,this._clearTimeOut),this.videojs.on(J.f.CLD_SOURCE_CHANGED,this._onSourceChange.bind(this)),this.videojs.ready((()=>{this._onReady(),e&&e(this)}))}_initPlugins(){this._initIma(),this._initAutoplay(),this._initContextMenu(),this._initPerSrcBehaviors(),this._initCloudinary(),this._initAnalytics(),this._initCloudinaryAnalytics(),this._initFloatingPlayer(),this._initColors(),this._initTextTracks(),this._initHighlightsGraph(),this._initSeekThumbs(),this._initChapters(),this._initInteractionAreas()}_isFullScreen(){return this.videojs.player().isFullscreen()}_initIma(){this.playerOptions.ads&&0!==Object.keys(this.playerOptions.ads).length&&et.imaPlugin(this.videojs,this.playerOptions)}setTextTracks(e){const t=this.videojs.remoteTextTracks();if(t)for(let e=t.tracks_.length-1;e>=0;e--)this.videojs.removeRemoteTextTrack(t.tracks_[e]);if(e){const t=Object.keys(e),i=[];for(const n of t)if("options"!==n){const t=Array.isArray(e[n])?e[n]:[e[n]];for(const e of t)i.push({...e,kind:n,label:e.label,srclang:e.language,default:!!e.default,src:e.url})}tt.A.addTextTracks(i,this.videojs),e.options&&this.videojs.styledTextTracks&&this.videojs.styledTextTracks(e.options)}}_initSeekThumbs(){this.playerOptions.seekThumbnails&&this.videojs.on(J.f.CLD_SOURCE_CHANGED,((e,t)=>{let{source:i}=t;if(!i||i.getType()===J.x.AUDIO||(0,fe.iT)(i.publicId())||this.videojs.activePlugins_&&this.videojs.activePlugins_.vr)return;const n=i.publicId(),s=Object.assign({},i.transformation());s&&(delete s.streaming_profile,delete s.video_codec),s.flags=s.flags||[],s.flags.push("sprite");const r=i.config().url("".concat(n,".vtt"),{transformation:s}).replace(/\.json$/,"");v()(this.videojs.vttThumbnails)?this.videojs.vttThumbnails({src:r}):this.videojs.vttThumbnails.src(r)}))}_initHighlightsGraph(){this.playerOptions.aiHighlightsGraph&&this.videojs.on(J.f.CLD_SOURCE_CHANGED,((e,t)=>{let{source:i}=t;if(!i||i.getType()===J.x.AUDIO||(0,fe.iT)(i.publicId()))return;const n=i.publicId(),r=s()(i.transformation(),["start_offset","end_offset","duration"]),a=Object.assign({},r);a.effect="preview",a.flags=a.flags||[],a.flags.push("getinfo");const o=i.config().url("".concat(n),{transformation:a}).replace(/\.json$/,"");v()(this.videojs.aiHighlightsGraph)?this.videojs.aiHighlightsGraph({src:o}):this.videojs.aiHighlightsGraph.src(o)}))}_initChapters(){!this.playerOptions.chaptersButton&&this.videojs.controlBar&&this.videojs.controlBar.removeChild("chaptersButton"),this.videojs.on(J.f.CLD_SOURCE_CHANGED,((e,t)=>{let{source:i}=t;f()(i._chapters)&&!0!==i._chapters||!this.videojs.chapters||(v()(this.videojs.chapters)?this.videojs.chapters(i._chapters):this.videojs.chapters.src(i._chapters))}))}_initInteractionAreas(){this.videojs.on(J.f.READY,(async()=>{this.options.videojsOptions.interactionDisplay&&this.videojs.interactionAreas&&this.videojs.interactionAreas(this,this.playerOptions,this._videojsOptions)}))}_initColors(){this.videojs.colors(this.playerOptions.colors?{colors:this.playerOptions.colors}:{})}_initQualitySelector(){this.videojs.controlBar&&!1!==this.playerOptions.qualitySelector&&(this.videojs.httpSourceSelector({default:"auto"}),this.videojs.on(J.f.LOADED_METADATA,(()=>{ht(this.videojs)})),this.videojs.on(J.f.LOADED_DATA,(()=>{dt(this.videojs)})))}_initTextTracks(){this.videojs.on(J.f.CLD_SOURCE_CHANGED,((e,t)=>{let{source:i}=t;this.setTextTracks(i._textTracks)}))}_initPerSrcBehaviors(){this.videojs.perSourceBehaviors&&this.videojs.perSourceBehaviors()}_initJumpButtons(){!this.playerOptions.showJumpControls&&this.videojs.controlBar&&(this.videojs.controlBar.removeChild("JumpForwardButton"),this.videojs.controlBar.removeChild("JumpBackButton"))}_initPictureInPicture(){!this.playerOptions.pictureInPictureToggle&&this.videojs.controlBar&&this.videojs.controlBar.removeChild("pictureInPictureToggle")}_initCloudinary(){const{cloudinaryConfig:e}=this.playerOptions.cloudinary;e.chainTarget=this,!1!==e.secure&&(0,fe.lP)(e,{secure:!0}),this.videojs.cloudinary(this.playerOptions.cloudinary)}_initAnalytics(){const e=this.playerOptions.analytics;if(!window.ga&&e&&this.playerOptions.debug)console.error("Google Analytics script is missing");else if(e){const t="object"==typeof e?e:{};this.videojs.analytics(t)}}_initCloudinaryAnalytics(){this.playerOptions.cloudinaryAnalytics&&(this.videojs.videoElement=this.videoElement,this.videojs.cloudinaryAnalytics())}reTryVideo(e,t){if(!this.isVideoReady())if(this.nbCalls<e)this.nbCalls++,this.reTryId=this.videojs.setTimeout((()=>this.reTryVideo(e,t)),t);else{let e=new Error("Video is not ready please try later");this.videojs.trigger("error",e)}}isVideoReady(){return this.videojs.readyState()>=(/iPad|iPhone|iPod/.test(navigator.userAgent)?1:4)&&(this.nbCalls=0,!0)}_initAutoplay(){"on-scroll"===this.playerOptions.autoplayMode&&this.videojs.autoplayOnScroll()}_initContextMenu(){this.playerOptions.hideContextMenu||this.videojs.contextMenu(it.A.contextMenu)}_initFloatingPlayer(){this.playerOptions.floatingWhenNotVisible!==ze.rT.NONE&&this.videojs.floatingPlayer({floatTo:this.playerOptions.floatingWhenNotVisible})}_setCssClasses(){this.videojs.addClass(tt.A.CLASS_PREFIX),this.videojs.addClass(tt.A.playerClassPrefix(this.videojs)),tt.A.setSkinClassPrefix(this.videojs,tt.A.skinClassPrefix(this.videojs))}_onReady(){this._setExtendedEvents();const e=this.playerOptions.source||this.playerOptions.publicId;e&&this.source(e,this.playerOptions)}_onSourceChange(){this._sendInternalAnalytics(),this._initQualitySelector()}_setExtendedEvents(){const e=[];this.playerOptions.playedEventPercents&&e.push({type:J.f.PERCENTS_PLAYED,percents:this.playerOptions.playedEventPercents}),this.playerOptions.playedEventTimes&&e.push({type:J.f.TIME_PLAYED,times:this.playerOptions.playedEventTimes}),e.push(J.f.SEEK,J.f.MUTE,J.f.UNMUTE,J.f.QUALITY_CHANGED);const t=new re(this.videojs,{events:e});Object.keys(t.events).forEach((e=>{t.on(e,((t,i)=>{this.videojs.trigger({type:e,eventData:i})}))}))}cloudinaryConfig(e){return this.videojs.cloudinary.cloudinaryConfig(e)}currentPublicId(){return this.videojs.cloudinary.currentPublicId()}currentSourceUrl(){return this.videojs.currentSource().src}currentPoster(){return this.videojs.cloudinary.currentPoster()}source(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(({publicId:e,options:t}=(0,fe.a5)(e,t)),!this._isPlayerConfigValid)return;if(this.playerOptions.debug&&(0,rt.Is)(t).then((e=>{e||this.videojs.error("invalid source configuration")})),this._sendInternalAnalytics({source:t}),e instanceof me.A)return this.videojs.cloudinary.source(e,t);t.shoppable&&this.videojs.shoppable&&this.videojs.shoppable(this.videojs,t),this.playerOptions.allowUsageReport&&(t.usageReport=!0),this.playerOptions.withCredentials&&(t.withCredentials=!0),clearTimeout(this.reTryId),this.nbCalls=0;const i=this.videojs.options_.maxTries||3,n=this.videojs.options_.videoTimeout||55e3;return this.reTryVideo(i,n),this.videojs.cloudinary.source(e,t)}posterOptions(e){return this.videojs.cloudinary.posterOptions(e)}skin(e){return void 0!==e&&b()(e)&&tt.A.setSkinClassPrefix(this.videojs,e),tt.A.skinClassPrefix(this.videojs)}playlist(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t=Object.assign({},t,{playlistWidget:this.playerOptions.playlistWidget}),this.videojs.one(J.f.READY,(async()=>{(await this.videojs.playlist(t))(e,t)})),this.videojs.cloudinary.playlist?this.videojs.cloudinary.playlist(e,t):this}playlistByTag(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t=Object.assign({},t,{playlistWidget:this.playerOptions.playlistWidget}),new Promise((i=>{this.videojs.one(J.f.READY,(async()=>{(await this.videojs.playlist(t))(await this.sourcesByTag(e,t),t),i(this)}))}))}sourcesByTag(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.videojs.cloudinary.sourcesByTag(e,t)}fluid(e){return void 0===e?this.videojs.fluid():(e?this.videojs.addClass(ze.gi):this.videojs.removeClass(ze.gi),this.videojs.fluid(e),this.videojs.trigger(J.f.FLUID,e),this)}play(){return this.playWasCalled=!0,this.videojs.play(),this}stop(){return this.pause(),this.currentTime(0),this}playPrevious(){return this.playlist().playPrevious(),this}playNext(){return this.playlist().playNext(),this}transformation(e){return this.videojs.cloudinary.transformation(e)}sourceTypes(e){return this.videojs.cloudinary.sourceTypes(e)}sourceTransformation(e){return this.videojs.cloudinary.sourceTransformation(e)}autoShowRecommendations(e){return this.videojs.cloudinary.autoShowRecommendations(e)}duration(){return this.videojs.duration()}height(e){return e?(this.videojs.height(e),this):this.videojs.height()}width(e){return e?(this.videojs.width(e),this):this.videojs.width()}volume(e){return e?(this.videojs.volume(e),this):this.videojs.volume()}mute(){return this.isMuted()||this.videojs.muted(!0),this}unmute(){return this.isMuted()&&this.videojs.muted(!1),this}isMuted(){return this.videojs.muted()}pause(){return this.videojs.pause(),this}currentTime(e){return e||0===e?(this.videojs.currentTime(e),this):this.videojs.currentTime()}maximize(){return this.isMaximized()||this.videojs.requestFullscreen(),this}exitMaximize(){return this.isMaximized()&&this.videojs.exitFullscreen(),this}isMaximized(){return this.videojs.isFullscreen()}dispose(){this.videojs.dispose()}controls(e){return void 0===e?this.videojs.controls():(this.videojs.controls(e),this)}ima(){return{playAd:this.videojs.ima.playAd}}loop(e){return void 0===e?this.videojs.loop():(this.videojs.loop(e),this)}el(){return this.videojs.el()}}const ft=pt,mt={cldDefault:JSON.parse('{"playerOptions":{},"sourceOptions":{}}'),cldLooping:JSON.parse('{"playerOptions":{"fluid":true,"controls":false,"muted":true,"floatingWhenNotVisible":"none","hideContextMenu":false,"autoplay":true,"loop":true},"sourceOptions":{}}'),cldAdaptiveStream:JSON.parse('{"playerOptions":{"fluid":true,"controls":true,"controlBar":{"fullscreenToggle":false},"showJumpControls":true,"hideContextMenu":false,"floatingWhenNotVisible":"none"},"sourceOptions":{"chapters":true,"sourceTypes":["hls"],"transformation":[{"effect":["volume:auto"]}]}}')};var gt=i(5072),yt=i.n(gt);const vt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;const i=s()((e=>{let t={};for(const i of Object.keys(e))t[yt()(i)]=e[i];return t})(e),ze._V);return Object.assign(e,{cloudinaryConfig:t||i})},_t=e=>(t,i,n)=>new ft(t,vt(i,e),n),bt=e=>(t,i,n)=>ft.all(t,vt(i,e),n),Tt=_t(),St=bt();const wt={...window.cloudinary||{},videoPlayer:Tt,videoPlayers:St,videoPlayerWithProfile:(e,t,i)=>(async(e,t,i)=>{if(!t.profile)throw new Error('VideoPlayerProfile method requires "profile" property');try{const n=await(async(e,t)=>Object.keys(mt).includes(t)?mt[t]:await fetch(t,{method:"GET"}).then((e=>e.json())))(t.cloud_name,t.profile),s=Object.assign({},n.playerOptions,t),r=new ft(e,s,i),a=r.source;return r.source=(e,t)=>{const i=Object.assign({},n.sourceOptions,t);return a.call(r,e,i)},r}catch(i){throw new ft(e,t).videojs.error("Invalid profile"),i}})(e,vt(t,undefined),i),Cloudinary:{new:e=>(console.warn("Cloudinary.new() is deprecated and will be removed. Please use cloudinary.videoPlayer() instead."),{videoPlayer:_t(e),videoPlayers:bt(e)})}};window.cloudinary=wt;const Et=wt,Ct=Et.videoPlayer,xt=Et.videoPlayers,kt=Et.videoPlayerWithProfile,At=Et},8033:(e,t,i)=>{i.d(t,{bo:()=>gi,dC:()=>vi,ww:()=>yi,lP:()=>pi,KA:()=>fi,iT:()=>hi,Nl:()=>di,N7:()=>mi,a5:()=>ui,M6:()=>_i});var n=i(7938),s=i.n(n),r=i(4319),a=i.n(r),o=i(5871),l=i(8953),c=i.n(l),u=i(7571),h=i.n(u),d=i(5226);function p(e){return"object"==typeof e&&null!==e}function f(e){let t="";return t="undefined"!=typeof window?btoa(encodeURI(decodeURI(e))):global.Buffer.from(e).toString("base64"),t.replace(/\+/g,"-").replace(/\//g,"_")}const m={"=":"eq","!=":"ne","<":"lt",">":"gt","<=":"lte",">=":"gte","&&":"and","||":"or","*":"mul","/":"div","+":"add","-":"sub","^":"pow"},g="res.cloudinary.com",y={aspect_ratio:"ar",aspectRatio:"ar",current_page:"cp",currentPage:"cp",duration:"du",face_count:"fc",faceCount:"fc",height:"h",initial_aspect_ratio:"iar",initial_height:"ih",initial_width:"iw",initialAspectRatio:"iar",initialHeight:"ih",initialWidth:"iw",initial_duration:"idu",initialDuration:"idu",page_count:"pc",page_x:"px",page_y:"py",pageCount:"pc",pageX:"px",pageY:"py",tags:"tags",width:"w"},v="(([0-9]*)\\.([0-9]+)|([0-9]+))([%pP])?",_=RegExp(`^${v}$`),b=RegExp(`(${v})\\.\\.(${v})`),T={font_weight:"normal",font_style:"normal",text_decoration:"none",text_align:"",stroke:"none"};function S(e,t=/([^a-zA-Z0-9_.\-\/:]+)/g){return e.replace(t,(function(e){return e.split("").map((function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})).join("")}))}const w=e=>e.replace(/[A-Z]/g,(e=>`_${e.toLowerCase()}`));class E{constructor(e){this.options={},null!=e&&["resourceType","type","publicId","format"].forEach((t=>{var i;return this.options[t]=null!=(i=e[t])?i:e[w(t)]}))}resourceType(e){return this.options.resourceType=e,this}type(e){return this.options.type=e,this}publicId(e){return this.options.publicId=e,this}getPublicId(){var e;return null!=(e=this.options.publicId)?e.replace(/\//g,":"):void 0}getFullPublicId(){return null!=this.options.format?this.getPublicId()+"."+this.options.format:this.getPublicId()}format(e){return this.options.format=e,this}toString(){let e=[];if(null==this.options.publicId)throw"Must supply publicId";return"image"!==this.options.resourceType&&e.push(this.options.resourceType),"upload"!==this.options.type&&e.push(this.options.type),e.push(this.getFullPublicId()),e.filter((e=>!!e)).join(":")}clone(){return new E(this.options)}}const C=E;function x(e){return null==e||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length}const k=function(e){return null!=e&&!isNaN(parseFloat(e))},A=class extends C{constructor(e){let t;super(e),t=["resourceType","resourceType","fontFamily","fontSize","fontWeight","fontStyle","textDecoration","textAlign","stroke","letterSpacing","lineSpacing","fontHinting","fontAntialiasing","text"],null!=e&&t.forEach((t=>{var i;return this.options[t]=null!=(i=e[t])?i:e[w(t)]})),this.options.resourceType="text"}resourceType(e){throw"Cannot modify resourceType for text layers"}type(e){throw"Cannot modify type for text layers"}format(e){throw"Cannot modify format for text layers"}fontFamily(e){return this.options.fontFamily=e,this}fontSize(e){return this.options.fontSize=e,this}fontWeight(e){return this.options.fontWeight=e,this}fontStyle(e){return this.options.fontStyle=e,this}textDecoration(e){return this.options.textDecoration=e,this}textAlign(e){return this.options.textAlign=e,this}stroke(e){return this.options.stroke=e,this}letterSpacing(e){return this.options.letterSpacing=e,this}lineSpacing(e){return this.options.lineSpacing=e,this}fontHinting(e){return this.options.fontHinting=e,this}fontAntialiasing(e){return this.options.fontAntialiasing=e,this}text(e){return this.options.text=e,this}toString(){var e,t,i,n,s,r,a,o,l;if(a=this.textStyleIdentifier(),null!=this.options.publicId&&(i=this.getFullPublicId()),null!=this.options.text){if(e=!x(i),t=!x(a),e&&t||!e&&!t)throw"Must supply either style parameters or a public_id when providing text parameter in a text overlay/underlay, but not both!";for(n=/\$\([a-zA-Z]\w*\)/g,r=0,l=S(this.options.text,/[,\/]/g),o="";s=n.exec(l);)o+=S(l.slice(r,s.index)),o+=s[0],r=s.index+s[0].length;o+=S(l.slice(r))}return[this.options.resourceType,a,i,o].filter((e=>!!e)).join(":")}textStyleIdentifier(){var e;if(e=[],"normal"!==this.options.fontWeight&&e.push(this.options.fontWeight),"normal"!==this.options.fontStyle&&e.push(this.options.fontStyle),"none"!==this.options.textDecoration&&e.push(this.options.textDecoration),e.push(this.options.textAlign),"none"!==this.options.stroke&&e.push(this.options.stroke),x(this.options.letterSpacing)&&!k(this.options.letterSpacing)||e.push("letter_spacing_"+this.options.letterSpacing),x(this.options.lineSpacing)&&!k(this.options.lineSpacing)||e.push("line_spacing_"+this.options.lineSpacing),x(this.options.fontAntialiasing)||e.push("antialias_"+this.options.fontAntialiasing),x(this.options.fontHinting)||e.push("hinting_"+this.options.fontHinting),!x(e.filter((e=>!!e)))){if(x(this.options.fontFamily))throw`Must supply fontFamily. ${e}`;if(x(this.options.fontSize)&&!k(this.options.fontSize))throw"Must supply fontSize."}return e.unshift(this.options.fontFamily,this.options.fontSize),e.filter((e=>!!e)).join("_")}};function I(e){const t=[];let i="";if(Object.keys(T).forEach((i=>{let n=T[i],s=e[i]||n;s!==n&&t.push(s)})),Object.keys(e).forEach((i=>{"letter_spacing"!==i&&"line_spacing"!==i||t.push(`${i}_${e[i]}`),"font_hinting"===i&&t.push(`${i.split("_").pop()}_${e[i]}`),"font_antialiasing"===i&&t.push(`antialias_${e[i]}`)})),e.hasOwnProperty("font_size")||!t||0===t.length){if(!e.font_size)throw"Must supply font_size for text in overlay/underlay";if(!e.font_family)throw"Must supply font_family for text in overlay/underlay";t.unshift(e.font_size),t.unshift(e.font_family),i=t.filter((e=>e)).join("_")}return i}function P(e){if(e instanceof A||e instanceof C)return e.toString();let t="";if(p(e))if("fetch"===e.resource_type||null!=e.url)t=`fetch:${f(e.url)}`;else{let i=e.public_id,n=e.format,s=e.resource_type||"image",r=e.type||"upload",a=e.text,o=null,l=[];const c=!i||0===i.length;if(c||(i=i.replace(new RegExp("/","g"),":"),null!=n&&(i=`${i}.${n}`)),a&&0!==a.length||"text"===s){if(s="text",r=null,o=I(e),a&&a.length>=0){const e=!o;if(!c&&!e||c&&e)throw"Must supply either style parameters or a public_id when providing text parameter in a text overlay/underlay";let t=/\$\([a-zA-Z]\w*\)/g,i=0,n=S(decodeURIComponent(a),/[,\/]/g);a="";for(let e=t.exec(n);e;e=t.exec(n))a+=S(n.slice(i,e.index)),a+=e[0],i=e.index+e[0].length;a+=encodeURIComponent(n.slice(i))}}else{if(c)throw"Must supply public_id for resource_type layer_parameter";"subtitles"===s&&(o=I(e))}"image"!==s&&l.push(s),"upload"!==r&&l.push(r),l.push(o),l.push(i),l.push(a),t=l.filter((e=>e)).join(":")}else t=/^fetch:.+/.test(e)?`fetch:${f(e.substr(6))}`:e;return t}function O(e){if("string"!=typeof e||0===e.length||e.match(/^!.+!$/))return e?e.toString():e;e=String(e);const t=new RegExp("((\\|\\||>=|<=|&&|!=|>|=|<|/|-|\\+|\\*|\\^)(?=[ _]))","g");e=e.replace(t,(e=>m[e]));const i="("+Object.keys(y).join("|")+")",n=new RegExp(`(\\$_*[^_ ]+)|${i}`,"g");return(e=e.replace(n,(e=>y[e]||e))).replace(/[ _]+/g,"_")}function L(e){switch(!0){case null==e:return[];case Array.isArray(e):return e;default:return[e]}}function D(e){if(!p(e))return e;if("remote"===e.function_type){const t=f(e.source).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return[e.function_type,t].join(":")}return[e.function_type,e.source].join(":")}function R(e){switch(e&&e.constructor){case String:return b.test(e)?e.split(".."):e;case Array:return[[e],e[e.length-1]];default:return[null,null]}}function N(e){const t=String(e).match(_);if(t){const e=t[5]?"p":"";return`${t[1]||t[4]}${e}`}return e}function M(e){switch(e&&e.constructor){case Object:{let t="";return"codec"in e&&(t=e.codec,"profile"in e&&(t+=":"+e.profile,"level"in e&&(t+=":"+e.level))),t}case String:return e;default:return null}}class j{constructor(e){this.expressions=[],null!=e&&this.expressions.push(j.normalize(e))}static new(e){return new this(e)}static normalize(e){var t,i,n;return null==e?e:(e=String(e),t=new RegExp("((\\|\\||>=|<=|&&|!=|>|=|<|/|-|\\+|\\*|\\^)(?=[ _]))","g"),e=e.replace(t,(e=>U[e])),i="("+Object.keys(B).join("|")+")",n=new RegExp(i,"g"),(e=e.replace(n,((t,i,n)=>"$"===e[n-1]?t:B[t]))).replace(/[ _]+/g,"_"))}serialize(){return j.normalize(this.expressions.join("_"))}toString(){return this.serialize()}getParent(){return this.parent}setParent(e){return this.parent=e,this}predicate(e,t,i){return null!=U[t]&&(t=U[t]),this.expressions.push(`${e}_${t}_${i}`),this}and(){return this.expressions.push("and"),this}or(){return this.expressions.push("or"),this}then(){return this.getParent().if(this.toString())}height(e,t){return this.predicate("h",e,t)}width(e,t){return this.predicate("w",e,t)}aspectRatio(e,t){return this.predicate("ar",e,t)}pageCount(e,t){return this.predicate("pc",e,t)}faceCount(e,t){return this.predicate("fc",e,t)}value(e){return this.expressions.push(e),this}static variable(e,t){return new this(e).value(t)}static width(){return new this("width")}static height(){return new this("height")}static initialWidth(){return new this("initialWidth")}static initialHeight(){return new this("initialHeight")}static aspectRatio(){return new this("aspectRatio")}static initialAspectRatio(){return new this("initialAspectRatio")}static pageCount(){return new this("pageCount")}static faceCount(){return new this("faceCount")}static currentPage(){return new this("currentPage")}static tags(){return new this("tags")}static pageX(){return new this("pageX")}static pageY(){return new this("pageY")}}const U={"=":"eq","!=":"ne","<":"lt",">":"gt","<=":"lte",">=":"gte","&&":"and","||":"or","*":"mul","/":"div","+":"add","-":"sub","^":"pow"},B={aspect_ratio:"ar",aspectRatio:"ar",current_page:"cp",currentPage:"cp","preview:duration":"preview:duration",duration:"du",face_count:"fc",faceCount:"fc",height:"h",initial_aspect_ratio:"iar",initial_duration:"idu",initial_height:"ih",initial_width:"iw",initialAspectRatio:"iar",initialDuration:"idu",initialHeight:"ih",initialWidth:"iw",page_count:"pc",page_x:"px",page_y:"py",pageCount:"pc",pageX:"px",pageY:"py",tags:"tags",width:"w"},F=j,q=class extends F{constructor(e){super(e)}height(e,t){return this.predicate("h",e,t)}width(e,t){return this.predicate("w",e,t)}aspectRatio(e,t){return this.predicate("ar",e,t)}pageCount(e,t){return this.predicate("pc",e,t)}faceCount(e,t){return this.predicate("fc",e,t)}duration(e,t){return this.predicate("du",e,t)}initialDuration(e,t){return this.predicate("idu",e,t)}};"undefined"!=typeof window&&null!==window&&window.location&&window.location.protocol;var $="__lodash_hash_undefined__",H=9007199254740991,V="[object Arguments]",z="[object Boolean]",W="[object Date]",G="[object Function]",X="[object GeneratorFunction]",Y="[object Map]",K="[object Number]",Q="[object Object]",J="[object Promise]",Z="[object RegExp]",ee="[object Set]",te="[object String]",ie="[object Symbol]",ne="[object WeakMap]",se="[object ArrayBuffer]",re="[object DataView]",ae="[object Float32Array]",oe="[object Float64Array]",le="[object Int8Array]",ce="[object Int16Array]",ue="[object Int32Array]",he="[object Uint8Array]",de="[object Uint8ClampedArray]",pe="[object Uint16Array]",fe="[object Uint32Array]",me=/\w*$/,ge=/^\[object .+?Constructor\]$/,ye=/^(?:0|[1-9]\d*)$/,ve={};ve[V]=ve["[object Array]"]=ve[se]=ve[re]=ve[z]=ve[W]=ve[ae]=ve[oe]=ve[le]=ve[ce]=ve[ue]=ve[Y]=ve[K]=ve[Q]=ve[Z]=ve[ee]=ve[te]=ve[ie]=ve[he]=ve[de]=ve[pe]=ve[fe]=!0,ve["[object Error]"]=ve[G]=ve[ne]=!1;var _e="object"==typeof global&&global&&global.Object===Object&&global,be="object"==typeof self&&self&&self.Object===Object&&self,Te=_e||be||Function("return this")(),Se="object"==typeof exports&&exports&&!exports.nodeType&&exports,we=Se&&"object"==typeof module&&module&&!module.nodeType&&module,Ee=we&&we.exports===Se;function Ce(e,t){return e.set(t[0],t[1]),e}function xe(e,t){return e.add(t),e}function ke(e,t,i,n){var s=-1,r=e?e.length:0;for(n&&r&&(i=e[++s]);++s<r;)i=t(i,e[s],s,e);return i}function Ae(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!`${e}`}catch(e){}return t}function Ie(e){var t=-1,i=Array(e.size);return e.forEach((function(e,n){i[++t]=[n,e]})),i}function Pe(e,t){return function(i){return e(t(i))}}function Oe(e){var t=-1,i=Array(e.size);return e.forEach((function(e){i[++t]=e})),i}var Le,De=Array.prototype,Re=Function.prototype,Ne=Object.prototype,Me=Te["__core-js_shared__"],je=(Le=/[^.]+$/.exec(Me&&Me.keys&&Me.keys.IE_PROTO||""))?`Symbol(src)_1.${Le}`:"",Ue=Re.toString,Be=Ne.hasOwnProperty,Fe=Ne.toString,qe=RegExp(`^${Ue.call(Be).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")}$`),$e=Ee?Te.Buffer:void 0,He=Te.Symbol,Ve=Te.Uint8Array,ze=Pe(Object.getPrototypeOf,Object),We=Object.create,Ge=Ne.propertyIsEnumerable,Xe=De.splice,Ye=Object.getOwnPropertySymbols,Ke=$e?$e.isBuffer:void 0,Qe=Pe(Object.keys,Object),Je=Tt(Te,"DataView"),Ze=Tt(Te,"Map"),et=Tt(Te,"Promise"),tt=Tt(Te,"Set"),it=Tt(Te,"WeakMap"),nt=Tt(Object,"create"),st=xt(Je),rt=xt(Ze),at=xt(et),ot=xt(tt),lt=xt(it),ct=He?He.prototype:void 0,ut=ct?ct.valueOf:void 0;function ht(e){var t=-1,i=e?e.length:0;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function dt(e){var t=-1,i=e?e.length:0;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function pt(e){var t=-1,i=e?e.length:0;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function ft(e){this.__data__=new dt(e)}function mt(e,t,i){var n=e[t];Be.call(e,t)&&At(n,i)&&(void 0!==i||t in e)||(e[t]=i)}function gt(e,t){for(var i=e.length;i--;)if(At(e[i][0],t))return i;return-1}function yt(e,t,i,n,s,r,a){var o;if(n&&(o=r?n(e,s,r,a):n(e)),void 0!==o)return o;if(!Dt(e))return e;var l=It(e);if(l){if(o=function(e){var t=e.length,i=e.constructor(t);return t&&"string"==typeof e[0]&&Be.call(e,"index")&&(i.index=e.index,i.input=e.input),i}(e),!t)return function(e,t){var i=-1,n=e.length;for(t||(t=Array(n));++i<n;)t[i]=e[i];return t}(e,o)}else{var c=wt(e),u=c==G||c==X;if(Ot(e))return function(e,t){if(t)return e.slice();var i=new e.constructor(e.length);return e.copy(i),i}(e,t);if(c==Q||c==V||u&&!r){if(Ae(e))return r?e:{};if(o=function(e){return"function"!=typeof e.constructor||Ct(e)?{}:Dt(t=ze(e))?We(t):{};var t}(u?{}:e),!t)return function(e,t){return _t(e,St(e),t)}(e,function(e,t){return e&&_t(t,Rt(t),e)}(o,e))}else{if(!ve[c])return r?e:{};o=function(e,t,i,n){var s,r=e.constructor;switch(t){case se:return vt(e);case z:case W:return new r(+e);case re:return function(e,t){var i=t?vt(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)}(e,n);case ae:case oe:case le:case ce:case ue:case he:case de:case pe:case fe:return function(e,t){var i=t?vt(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}(e,n);case Y:return function(e,t,i){return ke(t?i(Ie(e),!0):Ie(e),Ce,new e.constructor)}(e,n,i);case K:case te:return new r(e);case Z:return function(e){var t=new e.constructor(e.source,me.exec(e));return t.lastIndex=e.lastIndex,t}(e);case ee:return function(e,t,i){return ke(t?i(Oe(e),!0):Oe(e),xe,new e.constructor)}(e,n,i);case ie:return s=e,ut?Object(ut.call(s)):{}}}(e,c,yt,t)}}a||(a=new ft);var h=a.get(e);if(h)return h;if(a.set(e,o),!l)var d=i?function(e){return function(e,t,i){var n=t(e);return It(e)?n:function(e,t){for(var i=-1,n=t.length,s=e.length;++i<n;)e[s+i]=t[i];return e}(n,i(e))}(e,Rt,St)}(e):Rt(e);return function(e,t){for(var i=-1,n=e?e.length:0;++i<n&&!1!==t(e[i],i););}(d||e,(function(s,r){d&&(s=e[r=s]),mt(o,r,yt(s,t,i,n,r,e,a))})),o}function vt(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t}function _t(e,t,i,n){i||(i={});for(var s=-1,r=t.length;++s<r;){var a=t[s],o=n?n(i[a],e[a],a,i,e):void 0;mt(i,a,void 0===o?e[a]:o)}return i}function bt(e,t){var i,n,s=e.__data__;return("string"==(n=typeof(i=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?s["string"==typeof t?"string":"hash"]:s.map}function Tt(e,t){var i=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Dt(e)||(t=e,je&&je in t))&&(Lt(e)||Ae(e)?qe:ge).test(xt(e));var t}(i)?i:void 0}ht.prototype.clear=function(){this.__data__=nt?nt(null):{}},ht.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},ht.prototype.get=function(e){var t=this.__data__;if(nt){var i=t[e];return i===$?void 0:i}return Be.call(t,e)?t[e]:void 0},ht.prototype.has=function(e){var t=this.__data__;return nt?void 0!==t[e]:Be.call(t,e)},ht.prototype.set=function(e,t){return this.__data__[e]=nt&&void 0===t?$:t,this},dt.prototype.clear=function(){this.__data__=[]},dt.prototype.delete=function(e){var t=this.__data__,i=gt(t,e);return!(i<0||(i==t.length-1?t.pop():Xe.call(t,i,1),0))},dt.prototype.get=function(e){var t=this.__data__,i=gt(t,e);return i<0?void 0:t[i][1]},dt.prototype.has=function(e){return gt(this.__data__,e)>-1},dt.prototype.set=function(e,t){var i=this.__data__,n=gt(i,e);return n<0?i.push([e,t]):i[n][1]=t,this},pt.prototype.clear=function(){this.__data__={hash:new ht,map:new(Ze||dt),string:new ht}},pt.prototype.delete=function(e){return bt(this,e).delete(e)},pt.prototype.get=function(e){return bt(this,e).get(e)},pt.prototype.has=function(e){return bt(this,e).has(e)},pt.prototype.set=function(e,t){return bt(this,e).set(e,t),this},ft.prototype.clear=function(){this.__data__=new dt},ft.prototype.delete=function(e){return this.__data__.delete(e)},ft.prototype.get=function(e){return this.__data__.get(e)},ft.prototype.has=function(e){return this.__data__.has(e)},ft.prototype.set=function(e,t){var i=this.__data__;if(i instanceof dt){var n=i.__data__;if(!Ze||n.length<199)return n.push([e,t]),this;i=this.__data__=new pt(n)}return i.set(e,t),this};var St=Ye?Pe(Ye,Object):function(){return[]},wt=function(e){return Fe.call(e)};function Et(e,t){return!!(t=null==t?H:t)&&("number"==typeof e||ye.test(e))&&e>-1&&e%1==0&&e<t}function Ct(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ne)}function xt(e){if(null!=e){try{return Ue.call(e)}catch(e){}try{return`${e}`}catch(e){}}return""}function kt(e){return yt(e,!0,!0)}function At(e,t){return e===t||e!=e&&t!=t}(Je&&wt(new Je(new ArrayBuffer(1)))!=re||Ze&&wt(new Ze)!=Y||et&&wt(et.resolve())!=J||tt&&wt(new tt)!=ee||it&&wt(new it)!=ne)&&(wt=function(e){var t=Fe.call(e),i=t==Q?e.constructor:void 0,n=i?xt(i):void 0;if(n)switch(n){case st:return re;case rt:return Y;case at:return J;case ot:return ee;case lt:return ne}return t});var It=Array.isArray;function Pt(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=H}(e.length)&&!Lt(e)}var Ot=Ke||function(){return!1};function Lt(e){var t=Dt(e)?Fe.call(e):"";return t==G||t==X}function Dt(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Rt(e){return Pt(e)?function(e,t){var i=It(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Pt(e)}(e)&&Be.call(e,"callee")&&(!Ge.call(e,"callee")||Fe.call(e)==V)}(e)?function(e,t){for(var i=-1,n=Array(e);++i<e;)n[i]=t(i);return n}(e.length,String):[],n=i.length,s=!!n;for(var r in e)!t&&!Be.call(e,r)||s&&("length"==r||Et(r,n))||i.push(r);return i}(e):function(e){if(!Ct(e))return Qe(e);var t=[];for(var i in Object(e))Be.call(e,i)&&"constructor"!=i&&t.push(i);return t}(e)}const Nt=function(e){let t=e.match(Ut);return t=t.map((e=>e.charAt(0).toLocaleUpperCase()+e.slice(1).toLocaleLowerCase())),t[0]=t[0].toLocaleLowerCase(),t.join("")};var Mt,jt,Ut=(jt="[A-Z]",Mt="[a-z]+",RegExp(jt+"+(?="+jt+Mt+")|"+jt+"?"+Mt+"|"+jt+"+|[0-9]+","g"));function Bt(e){return e}function Ft(e,t){for(let i=0;i<e.length;i++)if(e[i]===t)return!0;return!1}const qt=class extends A{constructor(e){super(e),this.options.resourceType="subtitles"}};function $t(e){return"string"==typeof e||e instanceof String}const Ht=class extends C{constructor(e){super(e),$t(e)?this.options.url=e:(null!=e?e.url:void 0)&&(this.options.url=e.url)}url(e){return this.options.url=e,this}toString(){return`fetch:${f(this.options.url)}`}};function Vt(e){return e instanceof Function}const zt=["accessibility","api_secret","auth_token","cdn_subdomain","cloud_name","cname","format","placeholder","private_cdn","resource_type","secure","secure_cdn_subdomain","secure_distribution","shorten","sign_url","signature","ssl_detected","type","url_suffix","use_root_path","version"];function Wt(e,...t){return t.forEach((t=>{Object.keys(t).forEach((i=>{null!=t[i]&&(e[i]=t[i])}))})),e}class Gt{constructor(e,t,i=Bt){this.name=e,this.shortName=t,this.process=i}set(e){return this.origValue=e,this}serialize(){var e,t;return e=this.value(),t=Array.isArray(e)||p(e)||$t(e)?!x(e):null!=e,null!=this.shortName&&t?`${this.shortName}_${e}`:""}value(){return this.process(this.origValue)}static norm_color(e){return null!=e?e.replace(/^#/,"rgb:"):void 0}static build_array(e){return null==e?[]:Array.isArray(e)?e:[e]}static process_video_params(e){var t;switch(e.constructor){case Object:return t="","codec"in e&&(t=e.codec,"profile"in e&&(t+=":"+e.profile,"level"in e&&(t+=":"+e.level))),t;case String:return e;default:return null}}}class Xt extends Gt{constructor(e,t,i=".",n=void 0){super(e,t,n),this.sep=i}serialize(){if(null!=this.shortName){let e=this.value();if(x(e))return"";if($t(e))return`${this.shortName}_${e}`;{let t=e.map((e=>Vt(e.serialize)?e.serialize():e)).join(this.sep);return`${this.shortName}_${t}`}}return""}value(){return Array.isArray(this.origValue)?this.origValue.map((e=>this.process(e))):this.process(this.origValue)}set(e){return null==e||Array.isArray(e)?super.set(e):super.set([e])}}class Yt extends Gt{constructor(e,t="t",i=".",n=void 0){super(e,t,n),this.sep=i}serialize(){let e="";const t=this.value();if(x(t))return e;if((i=t).length&&i.every($t)){const i=t.join(this.sep);x(i)||(e=`${this.shortName}_${i}`)}else e=t.map((e=>$t(e)&&!x(e)?`${this.shortName}_${e}`:Vt(e.serialize)?e.serialize():p(e)&&!x(e)?new ri(e).serialize():void 0)).filter((e=>e));var i;return e}set(e){return this.origValue=e,Array.isArray(this.origValue)?super.set(this.origValue):super.set([this.origValue])}}class Kt extends Gt{constructor(e,t,i=Kt.norm_range_value){super(e,t,i)}static norm_range_value(e){let t=String(e).match(new RegExp("^(([0-9]*)\\.([0-9]+)|([0-9]+))([%pP])?$"));if(t){let i=null!=t[5]?"p":"";e=(t[1]||t[4])+i}return e}}class Qt extends Gt{constructor(e,t,i=Bt){super(e,t,i)}serialize(){return this.value()}}class Jt extends Gt{value(){if(null==this.origValue)return"";let e;if(this.origValue instanceof C)e=this.origValue;else if(p(this.origValue)){let t=function(e,t){var i,n;i={};for(let s in e)n=e[s],t&&(s=t(s)),x(s)||(i[s]=n);return i}(this.origValue,Nt);e="text"===t.resourceType||null!=t.text?new A(t):"subtitles"===t.resourceType?new qt(t):"fetch"===t.resourceType||null!=t.url?new Ht(t):new C(t)}else e=$t(this.origValue)?/^fetch:.+/.test(this.origValue)?new Ht(this.origValue.substr(6)):this.origValue:"";return e.toString()}static textStyle(e){return new A(e).textStyleIdentifier()}}class Zt{constructor(e){let t,i;t=void 0,i={},this.toOptions=e=>{let t={};if(null==e&&(e=!0),Object.keys(i).forEach((e=>t[e]=i[e].origValue)),Wt(t,this.otherOptions),e&&!x(this.chained)){let e=this.chained.map((e=>e.toOptions()));e.push(t),t={},Wt(t,this.otherOptions),t.transformation=e}return t},this.setParent=e=>(t=e,null!=e&&this.fromOptions("function"==typeof e.toOptions?e.toOptions():void 0),this),this.getParent=()=>t,this.param=(e,t,n,s,r)=>(null==r&&(r=Vt(s)?s:Bt),i[t]=new Gt(t,n,r).set(e),this),this.rawParam=function(e,t,n,s,r){return r=ni(arguments),i[t]=new Qt(t,n,r).set(e),this},this.rangeParam=function(e,t,n,s,r){return r=ni(arguments),i[t]=new Kt(t,n,r).set(e),this},this.arrayParam=function(e,t,n,s=":",r=[],a=void 0){return a=ni(arguments),i[t]=new Xt(t,n,s,a).set(e),this},this.transformationParam=function(e,t,n,s=".",r=void 0,a=void 0){return a=ni(arguments),i[t]=new Yt(t,n,s,a).set(e),this},this.layerParam=function(e,t,n){return i[t]=new Jt(t,n).set(e),this},this.getValue=function(e){let t=i[e]&&i[e].value();return null!=t?t:this.otherOptions[e]},this.get=function(e){return i[e]},this.remove=function(e){var t;switch(!1){case null==i[e]:return t=i[e],delete i[e],t.origValue;case null==this.otherOptions[e]:return t=this.otherOptions[e],delete this.otherOptions[e],t;default:return null}},this.keys=function(){var e;return function(){var t;for(e in t=[],i)null!=e&&t.push(e.match(ei)?e:w(e));return t}().sort()},this.toPlainObject=function(){var e,t,n;for(t in e={},i)e[t]=i[t].value(),p(e[t])&&(e[t]=kt(e[t]));return x(this.chained)||((n=this.chained.map((e=>e.toPlainObject()))).push(e),e={transformation:n}),e},this.chain=function(){var e;return 0!==Object.getOwnPropertyNames(i).length&&(e=new this.constructor(this.toOptions(!1)),this.resetTransformations(),this.chained.push(e)),this},this.resetTransformations=function(){return i={},this},this.otherOptions={},this.chained=[],this.fromOptions(e)}fromOptions(e={}){if(e instanceof Zt)this.fromTransformation(e);else{($t(e)||Array.isArray(e))&&(e={transformation:e}),(e=kt(e)).if&&(this.set("if",e.if),delete e.if);for(let t in e){let i=e[t];null!=i&&(t.match(ei)?"$attr"!==t&&this.set("variable",t,i):this.set(t,i))}}return this}fromTransformation(e){return e instanceof Zt&&e.keys().forEach((t=>this.set(t,e.get(t).origValue))),this}set(e,...t){let i;return i=Nt(e),Ft(ai,i)?this[i].apply(this,t):this.otherOptions[e]=t[0],this}hasLayer(){return this.getValue("overlay")||this.getValue("underlay")}serialize(){var e,t,i,n,s,r,a,o,l,c,u,h,d,p,f,m,g,y;for(c=this.chained.map((e=>e.serialize())),n=this.keys(),p=null!=(s=this.get("transformation"))?s.serialize():void 0,e=null!=(r=this.get("if"))?r.serialize():void 0,m=function(e){var t,i,n,s,r;if(Array.isArray(e)){for(s=[],t=0,i=e.length;t<i;t++)[n,r]=e[t],s.push(`${n}_${F.normalize(r)}`);return s}return e}(null!=(a=this.get("variables"))?a.value():void 0),y=["transformation","if","variables"],n=n.filter((e=>!y.includes(e))),g=[],h=[],t=0,i=n.length;t<i;t++)(u=n[t]).match(ei)?g.push(u+"_"+F.normalize(null!=(o=this.get(u))?o.value():void 0)):h.push(null!=(l=this.get(u))?l.serialize():void 0);switch(!1){case!$t(p):h.push(p);break;case!Array.isArray(p):c=c.concat(p)}return h=function(){var e,t,i;for(i=[],e=0,t=h.length;e<t;e++)f=h[e],(Array.isArray(f)&&!x(f)||!Array.isArray(f)&&f)&&i.push(f);return i}(),h=g.sort().concat(m).concat(h.sort()),"if_end"===e?h.push(e):x(e)||h.unshift(e),x(d=h.filter((e=>!!e)).join(ii))||c.push(d),c.filter((e=>!!e)).join(ti)}static listNames(){return ai}toHtmlAttributes(){let e,t,i,n,s,r,a,o;return i={},Object.keys(this.otherOptions).forEach((t=>{r=this.otherOptions[t],o=w(t),Ft(oi,o)||Ft(zt,o)||(e=/^html_/.test(t)?t.slice(5):t,i[e]=r)})),this.keys().forEach((e=>{/^html_/.test(e)&&(i[Nt(e.slice(5))]=this.getValue(e))})),this.hasLayer()||this.getValue("angle")||Ft(["fit","limit","lfill"],this.getValue("crop"))||(a=null!=(n=this.get("width"))?n.origValue:void 0,t=null!=(s=this.get("height"))?s.origValue:void 0,parseFloat(a)>=1&&null==i.width&&(i.width=a),parseFloat(t)>=1&&null==i.height&&(i.height=t)),i}static isValidParamName(e){return ai.indexOf(Nt(e))>=0}toHtml(){var e;return null!=(e=this.getParent())&&"function"==typeof e.toHtml?e.toHtml():void 0}toString(){return this.serialize()}clone(){return new Zt(this.toOptions(!0))}}const ei=/^\$[a-zA-Z0-9]+$/,ti="/",ii=",";function ni(e){var t;return Vt(t=null!=e?e[e.length-1]:void 0)?t:void 0}function si({function_type:e,source:t}){return"remote"===e?[e,btoa(t)].join(":"):"wasm"===e?[e,t].join(":"):void 0}class ri extends Zt{constructor(e){super(e)}static new(e){return new ri(e)}angle(e){return this.arrayParam(e,"angle","a",".",F.normalize),this}audioCodec(e){return this.param(e,"audio_codec","ac"),this}audioFrequency(e){return this.param(e,"audio_frequency","af"),this}aspectRatio(e){return this.param(e,"aspect_ratio","ar",F.normalize),this}background(e){return this.param(e,"background","b",Gt.norm_color),this}bitRate(e){return this.param(e,"bit_rate","br"),this}border(e){return this.param(e,"border","bo",(e=>p(e)?`${(e=Object.assign({},{color:"black",width:2},e)).width}px_solid_${Gt.norm_color(e.color)}`:e))}color(e){return this.param(e,"color","co",Gt.norm_color),this}colorSpace(e){return this.param(e,"color_space","cs"),this}crop(e){return this.param(e,"crop","c"),this}customFunction(e){return this.param(e,"custom_function","fn",(()=>si(e)))}customPreFunction(e){if(!this.get("custom_function"))return this.rawParam(e,"custom_function","",(()=>(e=si(e))?`fn_pre:${e}`:e))}defaultImage(e){return this.param(e,"default_image","d"),this}delay(e){return this.param(e,"delay","dl"),this}density(e){return this.param(e,"density","dn"),this}duration(e){return this.rangeParam(e,"duration","du"),this}dpr(e){return this.param(e,"dpr","dpr",(e=>(null!=(e=e.toString())?e.match(/^\d+$/):void 0)?e+".0":F.normalize(e)))}effect(e){return this.arrayParam(e,"effect","e",":",F.normalize),this}else(){return this.if("else")}endIf(){return this.if("end")}endOffset(e){return this.rangeParam(e,"end_offset","eo"),this}fallbackContent(e){return this.param(e,"fallback_content"),this}fetchFormat(e){return this.param(e,"fetch_format","f"),this}format(e){return this.param(e,"format"),this}flags(e){return this.arrayParam(e,"flags","fl","."),this}gravity(e){return this.param(e,"gravity","g"),this}fps(e){return this.param(e,"fps","fps",(e=>$t(e)?e:Array.isArray(e)?e.join("-"):e))}height(e){return this.param(e,"height","h",(()=>this.getValue("crop")||this.getValue("overlay")||this.getValue("underlay")?F.normalize(e):null))}htmlHeight(e){return this.param(e,"html_height"),this}htmlWidth(e){return this.param(e,"html_width"),this}if(e=""){var t,i,n,s,r;switch(e){case"else":return this.chain(),this.param(e,"if","if");case"end":for(this.chain(),t=n=this.chained.length-1;n>=0&&"end"!==(i=this.chained[t].getValue("if"))&&(null==i||(s=ri.new().if(i),this.chained[t].remove("if"),r=this.chained[t],this.chained[t]=ri.new().transformation([s,r]),"else"===i));t=n+=-1);return this.param(e,"if","if");case"":return q.new().setParent(this);default:return this.param(e,"if","if",(e=>q.new(e).toString()))}}keyframeInterval(e){return this.param(e,"keyframe_interval","ki"),this}ocr(e){return this.param(e,"ocr","ocr"),this}offset(e){var t,i;if([i,t]=Vt(null!=e?e.split:void 0)?e.split(".."):Array.isArray(e)?e:[null,null],null!=i&&this.startOffset(i),null!=t)return this.endOffset(t)}opacity(e){return this.param(e,"opacity","o",F.normalize),this}overlay(e){return this.layerParam(e,"overlay","l"),this}page(e){return this.param(e,"page","pg"),this}poster(e){return this.param(e,"poster"),this}prefix(e){return this.param(e,"prefix","p"),this}quality(e){return this.param(e,"quality","q",F.normalize),this}radius(e){return this.arrayParam(e,"radius","r",":",F.normalize),this}rawTransformation(e){return this.rawParam(e,"raw_transformation"),this}size(e){let t,i;if(Vt(null!=e?e.split:void 0))return[i,t]=e.split("x"),this.width(i),this.height(t)}sourceTypes(e){return this.param(e,"source_types"),this}sourceTransformation(e){return this.param(e,"source_transformation")}startOffset(e){return this.rangeParam(e,"start_offset","so"),this}streamingProfile(e){return this.param(e,"streaming_profile","sp"),this}transformation(e){return this.transformationParam(e,"transformation","t"),this}underlay(e){return this.layerParam(e,"underlay","u"),this}variable(e,t){return this.param(t,e,e),this}variables(e){return this.arrayParam(e,"variables"),this}videoCodec(e){return this.param(e,"video_codec","vc",Gt.process_video_params),this}videoSampling(e){return this.param(e,"video_sampling","vs"),this}width(e){return this.param(e,"width","w",(()=>this.getValue("crop")||this.getValue("overlay")||this.getValue("underlay")?F.normalize(e):null)),this}x(e){return this.param(e,"x","x",F.normalize),this}y(e){return this.param(e,"y","y",F.normalize),this}zoom(e){return this.param(e,"zoom","z",F.normalize),this}}const ai=["angle","audioCodec","audioFrequency","aspectRatio","background","bitRate","border","color","colorSpace","crop","customFunction","customPreFunction","defaultImage","delay","density","duration","dpr","effect","else","endIf","endOffset","fallbackContent","fetchFormat","format","flags","gravity","fps","height","htmlHeight","htmlWidth","if","keyframeInterval","ocr","offset","opacity","overlay","page","poster","prefix","quality","radius","rawTransformation","size","sourceTypes","sourceTransformation","startOffset","streamingProfile","transformation","underlay","variable","variables","videoCodec","videoSampling","width","x","y","zoom"],oi=ai.map(w).concat(["api_key","api_secret","callback","cdn_subdomain","cloud_name","cname","private_cdn","protocol","resource_type","responsive","responsive_class","responsive_use_breakpoints","responsive_width","round_dpr","secure","secure_cdn_subdomain","secure_distribution","shorten","type","upload_preset","url_suffix","use_root_path","version","externalLibraries","max_timeout_ms"]),li=ri;function ci(e){if("string"==typeof e)return e;if(e instanceof li)return e.toString();if(Array.isArray(e))return e.map((e=>ci(e))).filter((e=>e)).join("/");let t,i;const n=e.size,s=e.overlay||e.underlay,r=e.crop,a=L(e.angle).join("."),o=(e.background||"").replace(/^#/,"rgb:"),l=(e.color||"").replace(/^#/,"rgb:"),c=L(e.flags||[]).join("."),u=void 0===e.dpr?e.dpr:function(e){let t=e.toString();return(null!=t?t.match(/^\d+$/):void 0)?t+".0":F.normalize(t)}(e.dpr),h=P(e.overlay),d=function(e){let t=e;if(!t)return t;if(Array.isArray(t)||(t=[t]),0===t.length||t.length>4)throw new Error("Radius array should contain between 1 and 4 values");if(t.findIndex((e=>null===e))>=0)throw new Error("Corner: Cannot be null");return t.map(O).join(":")}(e.radius),f=P(e.underlay),m=function(e){return e?"if_"+O(e):e}(e.if),g=D(e.custom_function),y=function(e){const t=D(e);return"string"==typeof t?`pre:${t}`:null}(e.custom_pre_function);let v=e.fps,_=[],b=L(e.transformation||[]),T=e.effect;const S=s||a||"fit"===r||"limit"===r;if(n){const[e,s]=n.split("x");t=e,i=s}else t=e.width,i=e.height;t&&(0===t.toString().indexOf("auto")||S||parseFloat(t.toString())<1)&&delete e.width,i&&(S||parseFloat(i.toString())<1)&&delete e.height;const w=b.some((e=>"object"==typeof e));w?b=b.map((e=>p(e)?ci(e):ci({transformation:e}))).filter((e=>e)):(_=b.join("."),b=[]),Array.isArray(T)?T=T.join(":"):p(T)&&(T=Object.entries(T).map((([e,t])=>`${e}:${t}`)));let E=e.border;p(E)?E=`${null!=E.width?E.width:2}px_solid_${(null!=E.color?E.color:"black").replace(/^#/,"rgb:")}`:/^\d+$/.exec(E)&&(e.border=E,E=void 0),Array.isArray(v)&&(v=v.join("-"));const C={a:O(a),ar:O(e.aspect_ratio),b:o,bo:E,c:r,co:l,dpr:O(u),e:O(T),fl:c,fn:g||y,fps:v,h:O(i),ki:O(e.keyframe_interval),l:h,o:O(e.opacity),q:O(e.quality),r:d,t:_,u:f,w:O(t),x:O(e.x),y:O(e.y),z:O(e.zoom),ac:e.audio_codec,af:e.audio_frequency,br:e.bit_rate,cs:e.color_space,d:e.default_image,dl:e.delay,dn:e.density,du:N(e.duration),eo:N(e.end_offset||k(e.end_offset)?e.end_offset:R(e.offset)[1]),f:e.fetch_format,g:e.gravity,pg:e.page,p:e.prefix,so:N(e.start_offset||k(e.start_offset)?e.start_offset:R(e.offset)[0]),sp:e.streaming_profile,vc:M(e.video_codec),vs:e.video_sampling},x=[m,Object.entries(e).filter((([e,t])=>e.startsWith("$"))).map((([e,t])=>`${e}_${O(t)}`)).sort().concat((e.variables||[]).map((([e,t])=>`${e}_${O(t)}`))).join(","),Object.entries(C).filter((([e,t])=>!(null==t||"string"==typeof t&&0===t.length||Array.isArray(t)&&0===t.length))).map((([e,t])=>`${e}_${t}`)).sort().join(","),e.raw_transformation].filter((e=>e)).join(",");return x&&b.push(x),b.join("/")}const ui=function(e,t){let{tolerateMissingId:i=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(c()(e)){const n=Object.assign({},e);if(e=(0,o.sliceAndUnsetProperties)(n,"publicId").publicId,!h()(e)&&!i)throw new Error("Source is missing 'publicId'.");t&&(t=Object.assign({},n,t))}return{publicId:e,options:t}},hi=e=>d.P8.test(e),di=(e,t)=>{let i=e,n=t;return"object"==typeof e&&(i=e.src),"object"==typeof t&&(n=t.src),/^\/\//.test(i)&&(n=n.slice(n.indexOf("//"))),/^\/\//.test(n)&&(i=i.slice(i.indexOf("//"))),i===n},pi=(e,t)=>Object.assign(e,t),fi=(e,t)=>function(e,t){let i;"fetch"===t.type&&null==t.fetch_format&&(t.fetch_format=t.format);let n=t.type,s=t.resource_type||"image",r=t.version;const a="boolean"!=typeof t.force_version||t.force_version,o=(t.long_url_signature,t.format),l=t.cloud_name;if(!l)throw"cloud_name must be provided in the configuration";const c=t.private_cdn,u=t.secure_distribution,h=t.secure,d=(t.cdn_subdomain,t.secure_cdn_subdomain,t.cname),p=t.shorten,f=t.sign_url,m=(t.api_secret,t.url_suffix),y=t.use_root_path,v=t.auth_token,_=/^(image|raw)\/([a-z0-9_]+)\/v(\d+)\/([^#]+)$/.exec(e);_&&(s=_[1],n=_[2],r=_[3],e=_[4]);const b=e;if(null==e)return b;if(e=e.toString(),null===n&&e.match(/^https?:\//i))return b;[s,n]=function(e,t,i,n,s){if(null==t&&(t="upload"),null!=i)if("image"===e&&"upload"===t)e="images",t=null;else if("image"===e&&"private"===t)e="private_images",t=null;else if("image"===e&&"authenticated"===t)e="authenticated_images",t=null;else if("raw"===e&&"upload"===t)e="files",t=null;else{if("video"!==e||"upload"!==t)throw new Error("URL Suffix only supported for image/upload, image/private, image/authenticated, video/upload and raw/upload");e="videos",t=null}if(n){if(!("image"===e&&"upload"===t||"images"===e&&null==t))throw new Error("Root path only supported for image/upload");e=null,t=null}return s&&"image"===e&&"upload"===t&&(e="iu",t=null),[e,t]}(s,n,m,y,p),[e,i]=function(e,t,i){let n;if((e=e.replace(/([^:])\/\//g,"$1/")).match(/^https?:\//i))n=e=S(e);else{if(n=e=encodeURIComponent(decodeURIComponent(e)).replace(/%3A/g,":").replace(/%2F/g,"/"),i){if(i.match(/[\.\/]/))throw new Error("url_suffix should not include . or /");e=e+"/"+i}null!=t&&(e=e+"."+t,n=n+"."+t)}return[e,n]}(e,o,m),null==r&&a&&i.indexOf("/")>=0&&!i.match(/^v[0-9]+/)&&!i.match(/^https?:\//)&&(r=1),r=null!=r?`v${r}`:null;const T=ci(kt(t)).replace(/([^:])\/\//g,"$1/");if(f&&!v){let e=[T,i].filter((function(e){return null!=e&&""!==e})).join("/");try{for(let t=0;e!==decodeURIComponent(e)&&t<10;t++)e=decodeURIComponent(e)}catch(e){}}return[function(e,t,i,n,s,r,a,o){let l;if(0===t.indexOf("/"))return"/res"+t;let c=!i;return a?(null!=o&&"cloudinary-a.akamaihd.net"!==o||(o=i?t+"-res.cloudinary.com":g),null==c&&(c=o===g),l="https://"+o):l=r?"http://"+r:"http://"+[i?t+"-":"","res",".cloudinary.com"].join(""),c&&(l+="/"+t),l}(0,l,c,0,0,d,h,u),s,n,T,r,e].filter((function(e){return null!=e&&""!==e})).join("/").replace(" ","%20")}(e,a()(t,["chainTarget"])),mi=(e,t)=>{const i=(e=>"Transformation"===e.constructor.name&&e.toOptions)(e)?e.toOptions():e;return new li(i).fromOptions(t).toOptions()},gi={NO_SUPPORTED_MEDIA:6,CUSTOM:10,UNKNOWN_CUSTOMER:11,RESOURCE_NOT_FOUND:12,PRIVATE_RESOURCE:13,UNAUTHENTICATED:14},yi=e=>{let{errorMsg:t,publicId:i,cloudName:n,statusCode:s}=e;const r="Video cannot be played";let a={code:gi.CUSTOM,message:"".concat(r).concat(t?"- "+t:""),statusCode:s},o=t.toLowerCase();return o.startsWith("unknown customer")&&(a.code=gi.UNKNOWN_CUSTOMER,a.message="".concat(r," Unknown cloud-name ").concat(n)),o.startsWith("resource not found")&&(a.code=gi.RESOURCE_NOT_FOUND,a.message="".concat(r," Public ID ").concat(i," not found")),o.startsWith("private resource")&&(a.code=gi.PRIVATE_RESOURCE,a.message="".concat(r," Private video")),o.startsWith("unauthenticated access")&&(a.message="".concat(r," Requires authentication"),a.code=gi.UNAUTHENTICATED),a},vi={VP9:"vp9",HEV1:"hev1",H265:"h265",H264:"h264"},_i=()=>{s().use("video/auto",(()=>({async setSource(e,t){const{headers:i}=await fetch(e.src,{method:"HEAD",credentials:e.withCredentials?"include":"omit"});return t(null,{src:e.src,type:i.get("content-type")})}})))}},6770:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(8033),s=i(5871),r=i(7311);const a=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,r,a,o;i=this,a=null,(r="symbol"==typeof(o=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r="_transformation"))?o:o+"")in i?Object.defineProperty(i,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):i[r]=a;const{publicId:l,options:c}=(0,n.a5)(e,t),{cloudinaryConfig:u}=(0,s.sliceAndUnsetProperties)(c,"cloudinaryConfig"),{transformation:h}=(0,s.sliceAndUnsetProperties)(c,"transformation"),{queryParams:d}=(0,s.sliceAndUnsetProperties)(c,"queryParams");if(!u)throw new Error('Source is missing "cloudinaryConfig".');this.publicId=()=>l,this.cloudinaryConfig=()=>u,this.resourceConfig=()=>c,this.queryParams=()=>d,this.getType=()=>this._type,this.transformation(h)}transformation(e){return e&&(this._transformation=e),this._transformation}config(){const e=this.cloudinaryConfig();return{cloud_name:e.cloudName,url:(t,i)=>{if((0,n.iT)(t))return t;const s=(0,n.N7)(this.resourceConfig(),i);return(0,n.KA)(t,{...e,...s})}}}url(){let{transformation:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=this.config().url(this.publicId(),{transformation:e||this.transformation()}),i=this.queryParams()?(0,r.y)(this.queryParams()):"";return"".concat(t).concat(i)}}},4650:(e,t,i)=>{i.d(t,{A:()=>l});var n=i(6770),s=i(8033);const r=RegExp("\\.(".concat(["jpg","png","gif","webp"].join("|"),")$$")),a={resource_type:"image",type:"upload",transformation:[]};class o extends n.A{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};({publicId:e,options:t}=(0,s.a5)(e,t)),e=e.replace(r,""),t=Object.assign({},a,t),super(e,t),this._type="ImageSource"}}const l=o},5226:(e,t,i)=>{i.d(t,{IH:()=>c,P8:()=>a,Tf:()=>s,XY:()=>o,cE:()=>r,uf:()=>l,vD:()=>n});const n={format:"jpg",resource_type:"video"},s={resource_type:"video",type:"upload",transformation:[],sourceTransformation:{},sourceTypes:["auto"],recommendations:null,info:{},interactionAreas:{},chapters:{}},r=RegExp("\\.(".concat(["3g2","3gp","avi","flv","m3u8","ts","m2ts","mts","mov","mkv","mp4","mpeg","mpd","mxf","ogv","webm","wmv"].join("|"),")$$")),a=RegExp("https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)"),o={hls:"application/x-mpegURL",dash:"application/dash+xml",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"},l=["hls","dash","mpd","m3u8"],c={hls:"m3u8",dash:"mpd"}},5381:(e,t,i)=>{i.d(t,{A:()=>v});var n=i(5871),s=i(7311),r=i(2160),a=i.n(r),o=i(1104),l=i(5226),c=i(8033),u=i(7571),h=i.n(u),d=i(5004);const p=e=>{var t,i;return!!e&&(h()(e)?(i=e)&&Object.values(c.dC).some((e=>i.includes(e))):!!(e=>["video_codec","streaming_profile"].some((t=>(0,d.isKeyInTransformation)(e,t))))(e)||!(null===(t=e.some)||void 0===t||!t.call(e,(e=>p(e)))))};var f=i(6770),m=i(4650);let g=0;class y extends f.A{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=(0,c.iT)(e);let{publicId:s,options:r}=(0,c.a5)(e,t);i||(s=s.replace(l.cE,"")),r=Object.assign({},l.Tf,r),r.poster||(r.poster=Object.assign({publicId:s},l.vD));const{poster:a,sourceTypes:u,sourceTransformation:h,info:d,recommendations:p,textTracks:f,withCredentials:m,interactionAreas:y,chapters:v}=(0,n.sliceAndUnsetProperties)(r,"poster","sourceTypes","sourceTransformation","info","recommendations","textTracks","withCredentials","interactionAreas","chapters");super(s,r),this._sourceTypes=null,this._recommendations=null,this._textTracks=null,this._poster=null,this._info=null,this._sourceTransformation=null,this._interactionAreas=null,this._chapters=null,this._type=o.x.VIDEO,this.isRawUrl=i,this._rawTransformation=r.raw_transformation,this.withCredentials=!!m,this.getInitOptions=()=>t,this.poster(a),this.sourceTypes(u),this.sourceTransformation(h),this.info(d),this.interactionAreas(y),this.chapters(v),this.recommendations(p),this.textTracks(f),this.objectId=g++}textTracks(e){return void 0===e?this._textTracks:(this._textTracks=e,this)}recommendations(e){return void 0===e?this._recommendations:(this._recommendations=e,this)}sourceTypes(e){return e?(this._sourceTypes=e,this):this._sourceTypes}info(e){return e?(this._info=e,this):this._info}interactionAreas(e){return e?(this._interactionAreas=e,this):this._interactionAreas}chapters(e){return e?(this._chapters=e,this):this._chapters}sourceTransformation(e){return e?(this._sourceTransformation=e,this):this._sourceTransformation}poster(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e?e instanceof m.A?(this._poster=e,this):(({publicId:e,options:t}=(0,c.a5)(e,t,{tolerateMissingId:!0})),!e&&this.isRawUrl?null:(e||(e=this.publicId(),t=Object.assign({},t,l.vD)),t.cloudinaryConfig=t.cloudinaryConfig||this.cloudinaryConfig(),this._poster=new m.A(e,t),this)):this._poster}contains(e){return this.generateSources().some((t=>(0,c.Nl)(t,e)))}generateSources(){if(this.isRawUrl){const e="auto"===this.sourceTypes()[0]?null:this.sourceTypes()[0];return[this.generateRawSource(this.publicId(),e)]}return this.sourceTypes().map((e=>{const t=this.sourceTransformation()[e]||this.transformation(),i=function(e){e=e.toLowerCase().split("/").shift();let t=l.IH[e];return t||(t=e.split("/").shift()),t}(e),n=l.uf.includes(i),r={};t&&(r.transformation=a()(t)),Object.assign(r,{resource_type:"video",format:i});const[o,u]=function(e){const[t,i]=e.toLowerCase().split("/"),n=l.XY[t]||"video/".concat(t);let s=[n];return i&&(s=[n,{video_codec:i}]),s}(e);!u||p(r.transformation)||p(this._rawTransformation)||(r.transformation=(0,c.N7)(r.transformation,u)),"auto"===r.format&&(delete r.format,r.transformation=(0,c.N7)(r.transformation,{fetch_format:"auto:video"})),n&&(JSON.stringify(r.transformation||{}).includes('"streaming_profile":')||(r.transformation=(0,c.N7)(r.transformation,{streaming_profile:"auto"})));const h=this.queryParams()?(0,s.y)(this.queryParams()):"",d=this.config().url(this.publicId(),r),f=d.indexOf("?")>-1?h.replace("?","&"):h;return{type:o,src:d+f,cldSrc:this,isAdaptive:n,withCredentials:this.withCredentials}}))}generateRawSource(e,t){t=t||e.split(".").pop();const i=l.uf.includes(t);return{type:t=l.XY[t]?l.XY[t]:t?"video/".concat(t):null,src:e,cldSrc:this,isAdaptive:i,withCredentials:this.withCredentials}}getInteractionAreas(){return this._interactionAreas}}const v=y},4500:(e,t,i)=>{i.d(t,{A:()=>l,w:()=>a});var n=i(3066),s=i(8838);const r={colorsDark:{base:"#000000",accent:"#0D9AFF",text:"#FFFFFF"},colorsLight:{base:"#FFFFFF",accent:"#0D9AFF",text:"#000000"}},a=e=>(0,s.T4)(e)?r.colorsLight:r.colorsDark;class o{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.player=e;const i=a(this.player.options_);t.colors=Object.assign({},i,t.colors),this.init=()=>{s(o("\n .PLAYER-CLASS-PREFIX {\n --color-accent: --accent-color;\n --color-base: --base-color;\n --color-text: --text-color;\n\n color: --text-color;\n }\n\n .PLAYER-CLASS-PREFIX .vjs-time-tooltip,\n .PLAYER-CLASS-PREFIX .vjs-mouse-display:after,\n .PLAYER-CLASS-PREFIX .vjs-play-progress:after {\n color: --text-color;\n background-color: --base-color;\n }\n\n .PLAYER-CLASS-PREFIX .vjs-slider {\n background-color: rgba(--text-color, 0.2);\n }\n\n .PLAYER-CLASS-PREFIX .vjs-load-progress {\n background: rgba(--text-color, 0.3);\n }\n\n .PLAYER-CLASS-PREFIX .vjs-volume-level {\n background: --text-color;\n }\n\n .PLAYER-CLASS-PREFIX .vjs-play-progress {\n background: --accent-color;\n }\n\n .PLAYER-CLASS-PREFIX .vjs-volume-vertical {\n background-color: rgba(--base-color, 0.7);\n }\n\n .PLAYER-CLASS-PREFIX .vjs-volume-panel-horizontal .vjs-control:before {\n border-color: transparent transparent rgba(--accent-color, 0.4) transparent;\n }\n\n .PLAYER-CLASS-PREFIX .vjs-volume-panel-horizontal .vjs-volume-level:before {\n border-color: transparent transparent --accent-color transparent;\n }\n\n .PLAYER-CLASS-PREFIX .vjs-progress-control:before {\n color: --base-color;\n }\n\n .PLAYER-CLASS-PREFIX .vjs-highlights-graph-display {\n color: rgba(--text-color, 0.3);\n }\n\n .PLAYER-CLASS-PREFIX .vjs-title-bar {\n color: --text-color;\n background-image: linear-gradient(rgba(--base-color, 0.4), rgba(255, 255, 255, 0) 100%);\n }\n\n .PLAYER-CLASS-PREFIX .vjs-recommendations-overlay {\n color: --text-color;\n background-color: rgba(--base-color, 0.4);\n }\n\n .PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item {\n box-shadow: 0 0.5em 1.2em 0px --base-color;\n color: --text-color;\n border: 1px solid --text-color !important;\n position: relative;\n }\n\n .PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item:active,\n .PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item:hover {\n border: 1px solid --accent-color !important;\n }\n\n .PLAYER-CLASS-PREFIX .vjs-menu-content .vjs-menu-item:active,\n .PLAYER-CLASS-PREFIX .vjs-menu-content .vjs-menu-item:focus,\n .PLAYER-CLASS-PREFIX .vjs-menu-content .vjs-menu-item:hover {\n color: --text-color;\n background-color: rgba(--text-color, 0.2);\n }\n\n .PLAYER-CLASS-PREFIX.vjs-ad-playing .vjs-progress-control .vjs-play-progress {\n background: --base-color;\n }\n\n .PLAYER-CLASS-PREFIX.cld-plw-layout {\n background-color: --base-color;\n }\n\n .PLAYER-CLASS-PREFIX .cld-plw-item-info-wrap {\n color: --text-color;\n }\n\n .PLAYER-CLASS-PREFIX .cld-video-player-floater-close polygon {\n fill: --base-color;\n }\n\n .PLAYER-CLASS-PREFIX .cld-spbl-product-hotspot:after {\n background: --base-color;\n box-shadow: 0 0 0 4px --accent-color, 0 0 0 8px rgba(--text-color, 0.24);\n }\n\n .PLAYER-CLASS-PREFIX .cld-spbl-product-tooltip {\n color: --base-color;\n background: --text-color;\n }\n\n .PLAYER-CLASS-PREFIX .base-color-semi-bg {\n background: rgba(--base-color, 0.7);\n }\n\n .PLAYER-CLASS-PREFIX .text-color-semi-bg {\n background: rgba(--text-color, 0.7);\n }\n\n .PLAYER-CLASS-PREFIX .text-color-text {\n color: --text-color;\n }\n\n .PLAYER-CLASS-PREFIX .base-color-text {\n color: --base-color;\n }\n\n .PLAYER-CLASS-PREFIX .accent-color-text {\n color: --accent-color;\n }\n")),"light"===this.player.options_.skin?s(o("\n .PLAYER-CLASS-PREFIX.cld-video-player-skin-light .base-color-bg,\n .PLAYER-CLASS-PREFIX.cld-video-player-skin-light .vjs-control-bar,\n .PLAYER-CLASS-PREFIX.cld-video-player-skin-light .vjs-big-play-button,\n .PLAYER-CLASS-PREFIX.cld-video-player-skin-light .vjs-menu-button .vjs-menu-content {\n background-color: rgba(--base-color, 0.8);\n }\n\n .PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item.vjs-recommendations-overlay-item-primary .vjs-recommendations-overlay-item-primary-content {\n background-color: --base-color;\n }\n\n .PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item.vjs-recommendations-overlay-item-primary:active .vjs-recommendations-overlay-item-primary-content,\n .PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item.vjs-recommendations-overlay-item-primary:hover .vjs-recommendations-overlay-item-primary-content {\n color: --base-color;\n background-color: rgba(--accent-color, 0.8);\n }\n\n .PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item.vjs-recommendations-overlay-item-secondary:active div,\n .PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item.vjs-recommendations-overlay-item-secondary:hover div {\n color: --base-color;\n background-color: rgba(--accent-color, 0.8);\n }\n\n .PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item.vjs-recommendations-overlay-item-secondary div {\n background: --base-color;\n }\n\n .PLAYER-CLASS-PREFIX .vjs-upcoming-video {\n border: 1px solid --text-color;\n }\n\n .PLAYER-CLASS-PREFIX .vjs-upcoming-video .vjs-upcoming-video-bar {\n background-color: --base-color;\n }\n\n .PLAYER-CLASS-PREFIX .vjs-context-menu-ui .vjs-menu-content {\n background-color: --base-color;\n }\n\n .PLAYER-CLASS-PREFIX .cld-plw-item-info-wrap {\n color: --text-color;\n }\n\n @media only screen and (max-width: 768px) {\n .PLAYER-CLASS-PREFIX.cld-plw-vertical .cld-plw-item-info-wrap {\n color: --accent-color;\n }\n }\n")):s(o("\n .PLAYER-CLASS-PREFIX.cld-video-player-skin-dark .base-color-bg,\n .PLAYER-CLASS-PREFIX.cld-video-player-skin-dark .vjs-control-bar,\n .PLAYER-CLASS-PREFIX.cld-video-player-skin-dark .vjs-big-play-button,\n .PLAYER-CLASS-PREFIX.cld-video-player-skin-dark .vjs-menu-button .vjs-menu-content {\n background-color: rgba(--base-color, 0.6);\n }\n\n .PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item.vjs-recommendations-overlay-item-primary .vjs-recommendations-overlay-item-primary-content {\n background-color: rgba(--base-color, 0.6);\n }\n\n .PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item.vjs-recommendations-overlay-item-secondary div {\n background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent 80%);\n }\n\n .PLAYER-CLASS-PREFIX .vjs-upcoming-video {\n border: 1px solid rgba(--text-color, 0.5);\n }\n\n .PLAYER-CLASS-PREFIX .vjs-upcoming-video .vjs-upcoming-video-bar {\n background-color: rgba(--base-color, 0.6);\n }\n\n .PLAYER-CLASS-PREFIX .vjs-context-menu-ui .vjs-menu-content {\n background-color: rgba(--base-color, 0.6);\n }\n"))};const s=e=>{const t=document.createElement("style");t.innerHTML=e,this.player.el_.appendChild(t)},r=e=>{e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(e,t,i,n){return t+t+i+i+n+n}));const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?parseInt(t[1],16)+", "+parseInt(t[2],16)+", "+parseInt(t[3],16):null},o=e=>e.replace(/PLAYER\-CLASS\-PREFIX/g,(0,n.playerClassPrefix)(this.player)).replace(/rgba\(\-\-base\-color/g,"rgba("+r(t.colors.base)).replace(/rgba\(\-\-accent\-color/g,"rgba("+r(t.colors.accent)).replace(/rgba\(\-\-text\-color/g,"rgba("+r(t.colors.text)).replace(/\-\-base\-color/g,t.colors.base).replace(/\-\-accent\-color/g,t.colors.accent).replace(/\-\-text\-color/g,t.colors.text)}}function l(){new o(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).init()}},5004:(e,t,i)=>{i.r(t),i.d(t,{addTextTracks:()=>c,handleCldError:()=>o,isKeyInTransformation:()=>l});var n=i(8033),s=i(9339);const r={method:"head"},a={method:"get",credentials:"include",headers:{"Content-Range":"bytes=0-0"}},o=(e,t)=>{const i=t.fetchErrorUsingGet?a:r,s=e.videojs.cloudinary.getCurrentSources();s.length>0?Promise.all(s.map((e=>fetch(e.src,i)))).then((t=>{const i=(e=>e.reduce(((e,t)=>{if(t.status>=200&&t.status<399&&""!==t.url){const i=new URL(t.url);e.push(i.host+i.pathname)}return e}),[]))(t),r=t[0];if(i.length){const r=((e,t)=>e.filter((e=>{const i=new URL(e.src);return-1!==t.indexOf(i.host+i.pathname)&&!0!==e.try})))(s,i);r&&r.length?((e,t)=>{e.options.playerOptions.debug&&console.log("Trying sources: ",t),t.forEach((e=>{e.try=!0})),e.videojs.autoplay(e.videojs.autoplay()||e.playWasCalled),e.videojs.src(t)})(e,r):e.videojs.error({code:n.bo.NO_SUPPORTED_MEDIA,message:"No supported media sources",statusCode:t.status})}else((e,t)=>{e.videojs.error((0,n.ww)({errorMsg:t.headers.get("x-cld-error")||"",publicId:e.currentPublicId(),cloudName:e.cloudinaryConfig().cloud_name,error:t,statusCode:t.status}))})(e,r)})).catch((t=>{e.videojs.error({code:7,message:t&&t.message?t.message:"Failed to test sources"})})):e.videojs.error({code:n.bo.NO_SUPPORTED_MEDIA,message:"No supported media sources"})},l=(e,t)=>!!(e&&t&&(Array.isArray(e)?(0,s.I)(e,(e=>l(e,t))):e.getValue?e.getValue(t):e[t])),c=(e,t)=>{e.forEach((e=>{(e.maxWords||e.wordHighlight)&&t.pacedTranscript?t.pacedTranscript(e):e.src&&fetch(e.src,r).then((i=>{i.status>=200&&i.status<=399&&t.addRemoteTextTrack(e,!0)}))}))}},1104:(e,t,i)=>{i.d(t,{f:()=>n,x:()=>s});const n={READY:"ready",PLAY:"play",PLAYING:"playing",PAUSE:"pause",SEEK:"seek",SEEKING:"seeking",MUTE:"mute",UNMUTE:"unmute",PAUSE_NO_SEEK:"pausenoseek",ERROR:"error",TIME_UPDATE:"timeupdate",RETRY_PLAYLIST:"retryplaylist",CAN_PLAY_THROUGH:"canplaythrough",CLD_SOURCE_CHANGED:"cldsourcechanged",SOURCE_CHANGED:"sourcechanged",LOADED_METADATA:"loadedmetadata",LOADED_DATA:"loadeddata",REFRESH_TEXT_TRACKS:"refreshTextTracks",PLAYLIST_CREATED:"playlistcreated",UP_COMING_VIDEO_SHOW:"upcomingvideoshow",UP_COMING_VIDEO_HIDE:"upcomingvideohide",PLAYLIST_ITEM_CHANGED:"playlistitemchanged",VOLUME_CHANGE:"volumechange",FLUID:"fluid",PLAYLIST_PANEL:"PlaylistPanel",ENDED:"ended",RESIZE:"resize",START:"start",VIDEO_LOAD:"videoload",PRODUCT_BAR_MIN:"productBarMin",SHOW_PRODUCTS_OVERLAY:"showProductsOverlay",SHOPPABLE_ITEM_CHANGED:"shoppableitemchanged",FULL_SCREEN_CHANGE:"fullscreenchange",PERCENTS_PLAYED:"percentsplayed",TIME_PLAYED:"timeplayed",PLAYER_LOAD:"playerload",DISPOSE:"dispose",QUALITY_CHANGED:"qualitychanged"},s={AUDIO:"AudioSource",VIDEO:"VideoSource"}},3066:(e,t,i)=>{i.r(t),i.d(t,{CLASS_PREFIX:()=>r,playerClassPrefix:()=>o,setSkinClassPrefix:()=>u,skinClass:()=>l,skinClassPrefix:()=>c});var n=i(7668),s=i(9339);const r="cld-video-player",a="".concat(r,"-skin-"),o=e=>"".concat(r,"-").concat(e.id_),l=e=>"".concat(a).concat(e),c=e=>(0,s.I)(e.el().classList,(e=>e.startsWith(a))),u=(e,t)=>{const i=c(e),s=!!t&&t.replace(a,"");let r="";r=s?l(s):e.options_.skin?l(e.options_.skin):l(n.A.skin),r!==i&&(i&&e.removeClass(i),e.addClass(r)),s&&e.options_.skin!==s&&(e.options_.skin=s)}},7134:(e,t,i)=>{i.d(t,{It:()=>u,cu:()=>c,n:()=>o,q2:()=>h});var n=i(2160),s=i.n(n),r=i(9040),a=i.n(r);const o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;const n=document.createElement(e);for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&n.setAttribute(e,t[e]);return s()(i).forEach((e=>l(e,n))),n},l=(e,t)=>{if(a()(e))t.appendChild(e);else if(e&&"object"!=typeof e){const i=document.createTextNode(e);t.appendChild(i)}},c=(e,t)=>{for(let i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e.style[i]=t[i]);return e},u=e=>{const t=Array.isArray(e.children)?e.children.map(u):e.children,i=a()(e)?e:o(e.tag,e.attr,t);return e.onClick&&(e.event={name:"click",callback:e.onClick}),e.event&&i.addEventListener(e.event.name,e.event.callback,!1),e.style&&c(i,e.style),i},h=(e,t,i)=>(e.addEventListener(t,i,!1),()=>{e.removeEventListener(t,i,!1)})},9339:(e,t,i)=>{function n(e,t){return Array.prototype.find&&Array.isArray(e)?e.find(t):function(e,t){for(let i=0;i<e.length;i++){const n=e[i];if(t(n,i,e))return[n,i]}return[void 0,-1]}(e,t)[0]}i.d(t,{I:()=>n})},7588:(e,t,i)=>{i.r(t),i.d(t,{fontFace:()=>r});var n=i(5303),s=i.n(n);const r=(e,t)=>{void 0===t&&(t="Inter"),t&&"inherit"!==t?(s().load({google:{families:[t]}}),e.style.fontFamily=t):"inherit"===t&&(e.style.fontFamily="inherit")}},5104:(e,t,i)=>{i.d(t,{A:()=>y});var n={};i.r(n),i.d(n,{mixin:()=>l});var s={};i.r(s),i.d(s,{normalizeAttributes:()=>g});var r=i(5871),a=i(3171),o=i(5004);function l(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return t.reduce(((e,t)=>t(e)),class{})}var c=i(7588),u=i(3066),h=i(3686),d=i.n(h);const p=/^(data-cld-)(\w+)/,f={},m=e=>function(e){let t=null;if(""===e)return!0;try{t=JSON.parse(e)}catch(e){}return t||(t=Number(e),t||e)}(e),g=e=>{const t={};if(e&&e.attributes&&e.attributes.length>0){const i=e.attributes;for(let n=i.length-1;n>=0;n--){let s=i[n].name,r=i[n].value;s.match(p)&&(s=d()(s.replace(p,"$2"))),r="boolean"==typeof e[s]?null!==r:(f[s]||m)(r),t[s]=r}}return t},y=Object.assign({},r,a,o,c,n,u,s)},3171:(e,t,i)=>{function n(e){const t=e.getBoundingClientRect(),i=document.body,n=document.documentElement,s=window.pageYOffset||n.scrollTop||i.scrollTop,r=window.pageXOffset||n.scrollLeft||i.scrollLeft,a=n.clientTop||i.clientTop||0,o=n.clientLeft||i.clientLeft||0,l=t.top+s-a,c=t.left+r-o;return{top:Math.round(l),left:Math.round(c)}}function s(e,t){const i={},s=n(e),r=e.offsetWidth,a=e.offsetHeight,o=s.top,l=s.left;let c=t.pageY,u=t.pageX;return t.changedTouches&&(u=t.changedTouches[0].pageX,c=t.changedTouches[0].pageY),i.y=Math.max(0,Math.min(1,(o-c+a)/a)),i.x=Math.max(0,Math.min(1,(u-l)/r)),i}function r(e,t){let{fraction:i}=t;const s=n(e),r=s.left,a=s.top,o=e.offsetHeight,l=e.offsetWidth,c=r+l,u=a+o;return Math.max(0,Math.min(l,window.pageXOffset+window.innerWidth-r,c-window.pageXOffset))*Math.max(0,Math.min(l,window.pageYOffset+window.innerHeight-a,u-window.pageYOffset))/(l*o)>i}function a(e,t,i){e.style.left="".concat(t,"px"),e.style.top="".concat(i,"px")}i.r(t),i.d(t,{getPointerPosition:()=>s,isElementInViewport:()=>r,setPosition:()=>a})},7311:(e,t,i)=>{i.d(t,{y:()=>n});const n=e=>{const t=Object.keys(e);if(!t.length)return"";const i=t.map((t=>"".concat(t,"=").concat(e[t]))).join("&");return"?".concat(i)}},5871:(e,t,i)=>{function n(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),s=2;s<i;s++)n[s-2]=arguments[s];return n.reduce(((i,n)=>(Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n],t&&delete e[n]),i)),{})}function s(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return n(e,!1,...i)}function r(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return n(e,!0,...i)}i.r(t),i.d(t,{sliceAndUnsetProperties:()=>r,sliceProperties:()=>s})},5779:(e,t,i)=>{i.d(t,{I6:()=>u,Is:()=>h,O6:()=>o,QF:()=>l});var n=i(8446),s=i.n(n),r=i(8953),a=i.n(r);const o=e=>s()(e)?e():e,l=(e,t,i)=>{const n=o(e),s=n.value(t);return s||console.error("cloudinary video player: ".concat(n.message(i))),s},c=(e,t)=>{if(a()(t))for(let i in e)if(Object.prototype.hasOwnProperty.call(t,i)){const n=e[i],s=t[i],r=a()(n);if(r&&!c(n,s))return!1;if(!r&&!l(s,n,i))return!1}return!0},u=async e=>i.e(40).then(i.bind(i,9754)).then((t=>{let{playerValidators:i}=t;return c(e,i)})),h=e=>i.e(40).then(i.bind(i,9754)).then((t=>{let{sourceValidators:i}=t;return c(e,i)}))},608:(e,t,i)=>{i.d(t,{Am:()=>p,HJ:()=>u,KE:()=>d,_V:()=>o,gi:()=>c,jK:()=>a,jV:()=>l,rT:()=>h,uy:()=>r});var n=i(7938),s=i.n(n);const r=["cloudinaryConfig","transformation","sourceTypes","sourceTransformation","posterOptions","autoShowRecommendations","fontFace","secure"],a=r.concat(["debug","publicId","source","autoplayMode","playedEventPercents","playedEventTimes","analytics","cloudinaryAnalytics","allowUsageReport","fluid","ima","playlistWidget","hideContextMenu","colors","floatingWhenNotVisible","ads","showJumpControls","chaptersButton","pictureInPictureToggle","textTracks","qualitySelector","fetchErrorUsingGet","withCredentials","seekThumbnails","aiHighlightsGraph","chapters","queryParams"]),o=["cloud_name","secure","private_cdn","secure_distribution","cdn_subdomain","secure_cdn_subdomain","cname","shorten","sign_url","api_secret","url_suffix","use_root_path","auth_token"],l={html5:{handlePartialData:!1,vhs:{overrideNative:!s()||!s().browser||!s().browser.IS_IOS&&!s().browser.IS_SAFARI}}},c="cld-fluid",u={ALWAYS:"always",ON_SCROLL:"on-scroll",NEVER:"never"},h={LEFT:"left",RIGHT:"right",NONE:"none"},d={FIRST_VIDEO:"first-video",EVERY_VIDEO:"every-video"},p={AUTO:"auto",METADATA:"metadata",NONE:"none"}},8838:(e,t,i)=>{i.d(t,{T4:()=>p,Wi:()=>m,eo:()=>d,go:()=>g,iG:()=>f});var n=i(7938),s=i.n(n),r=i(5104),a=i(7668),o=i(608),l=i(7571),c=i.n(l),u=i(3337),h=i.n(u);const d=(e,t)=>e.addRemoteTextTrack({kind:"metadata",srclang:"en",src:t,default:!0},!0).track,p=e=>e.class.indexOf("cld-video-player-skin-light")>-1||"light"===e.skin,f=e=>{if(c()(e)){let t=e;0===t.indexOf("#")&&(t=t.slice(1));try{e=document.querySelector("#".concat(h()(t)))||s().getPlayer(t)}catch(t){e=null}if(!e)throw new Error("Could not find element with id ".concat(t))}if(!e.tagName)throw new Error("Must specify either an element or an element id.");if("VIDEO"!==e.tagName)throw new Error("Element is not a video tag.");return e},m=(e,t)=>{const i=r.A.normalizeAttributes(e);(s().dom.hasClass(e,o.gi)||s().dom.hasClass(e,"vjs-fluid"))&&(t.fluid=!0),(e=>{const t=e.autoplayMode;if(t)switch(t){case o.HJ.ALWAYS:e.autoplay=!0;break;case o.HJ.ON_SCROLL:case o.HJ.NEVER:default:e.autoplay=!1}})(t=Object.assign({},o.jV,a.A,i,t));const n=r.A.sliceAndUnsetProperties(t,...o.jK);return n.cloudinary=r.A.sliceAndUnsetProperties(n,...o.uy),t.videojs&&(Object.assign(t,t.videojs),delete t.videojs),{playerOptions:n,videojsOptions:t}},g=()=>{let e=s().getComponent("Player").prototype.options_.children;e.push("titleBar");const t=s().getComponent("ControlBar");t&&(e=t.prototype.options_.children,e.splice(e.indexOf("progressControl"),0,"spacer","progressControlEventsBlocker"),e.splice(e.indexOf("playToggle"),1,"playToggle","JumpBackButton","JumpForwardButton"),e.push("logoButton"),e.splice(e.indexOf("skipForward"),1),e.splice(e.indexOf("skipBackward"),1));const i=s().getComponent("SeekBar");i&&!i.prototype.options_.children.includes("mouseTimeDisplay")&&i.prototype.options_.children.splice(1,0,"mouseTimeDisplay")}},4138:e=>{self,e.exports=(()=>{var e={805:e=>{e.exports=s,e.exports.isMobile=s,e.exports.default=s;const t=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,i=/CrOS/,n=/android|ipad|playbook|silk/i;function s(e){e||(e={});let s=e.ua;if(s||"undefined"==typeof navigator||(s=navigator.userAgent),s&&s.headers&&"string"==typeof s.headers["user-agent"]&&(s=s.headers["user-agent"]),"string"!=typeof s)return!1;let r=t.test(s)&&!i.test(s)||!!e.tablet&&n.test(s);return!r&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==s.indexOf("Macintosh")&&-1!==s.indexOf("Safari")&&(r=!0),r}}},t={};function i(n){var s=t[n];if(void 0!==s)return s.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,i),r.exports}i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{i.r(n),i.d(n,{connectCloudinaryAnalytics:()=>B});var e=i(805);function t(e){return t="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},t(e)}var s="pause",r=function(e,t){var i=function(){t("play",{})};return e.addEventListener("play",i),function(){e.removeEventListener("play",i)}},a=function(e,t){var i=function(){t(s,{})};e.addEventListener("pause",i);var n=function(){t(s,{})};return e.addEventListener("emptied",n),function(){e.removeEventListener("play",i),e.removeEventListener("emptied",n)}},o=function(e,t){var i=function(){var i=function(e){var t=e.duration,i=Number.isNaN(t)?null:t;return{videoDuration:Number.POSITIVE_INFINITY===i?"Infinity":i}}(e);t("loadMetadata",{videoDuration:i.videoDuration})};return e.addEventListener("loadedmetadata",i),e.addEventListener("loadedmetadata_after_init",i),function(){e.removeEventListener("loadedmetadata",i),e.removeEventListener("loadedmetadata_after_init",i)}},l=function(e,t){return{eventName:e,eventTime:Date.now(),eventDetails:t}};function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var u=function(e){var t={},i={};return function(n,s){t[n]=[],i[n]=[s];var u=t[n],h=i[n],d=function(e,t){return h.push(l(e,t))},p=[r(e,d),a(e,d),o(e,d)];return function(e){if(e.readyState>0){var t=new CustomEvent("loadedmetadata_after_init");e.dispatchEvent(t)}}(e),{flushEvents:function(){var e=h.splice(0,h.length);return u.splice.apply(u,[u.length,0].concat(function(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?c(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e))),e},getAllEvents:function(){return u},destroy:function(){p.forEach((function(e){return e()}))}}}};const h={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let d;const p=new Uint8Array(16);function f(){if(!d&&(d="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!d))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return d(p)}const m=[];for(let e=0;e<256;++e)m.push((e+256).toString(16).slice(1));const g=function(e,t,i){if(h.randomUUID&&!t&&!e)return h.randomUUID();const n=(e=e||{}).random||(e.rng||f)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){i=i||0;for(let e=0;e<16;++e)t[i+e]=n[e];return t}return function(e,t=0){return(m[e[t+0]]+m[e[t+1]]+m[e[t+2]]+m[e[t+3]]+"-"+m[e[t+4]]+m[e[t+5]]+"-"+m[e[t+6]]+m[e[t+7]]+"-"+m[e[t+8]]+m[e[t+9]]+"-"+m[e[t+10]]+m[e[t+11]]+m[e[t+12]]+m[e[t+13]]+m[e[t+14]]+m[e[t+15]]).toLowerCase()}(n)};var y=function(){return g().replace(/-/g,"")},v="cld-analytics-user-id",_=function(){var e=window.localStorage.getItem(v);if(e)return e;var t=g().replace(/-/g,"");return window.localStorage.setItem(v,t),t};function b(e){return b="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},b(e)}var T=["string","number","boolean"],S=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,w="native",E=[w,"cloudinary video player"];function C(e){return C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},C(e)}function x(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function k(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?x(Object(i),!0).forEach((function(t){A(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):x(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function A(e,t,i){return(t=function(e){var t=function(e,t){if("object"!==C(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,"string");if("object"!==C(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===C(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var I=function(e,t,i){var n,s,r,a=function(e){if("object"===b(e)&&null!==e&&!Array.isArray(e)){var t=Object.keys(e).reduce((function(t,i){return(T.includes(b(e[i]))||null===e[i])&&(t[i]=e[i]),t}),{});return Object.keys(t).length>0?t:null}return null}(null==i?void 0:i.providedData),o=function(e){return null!==e&&JSON.stringify(e).length<=1e3}(a),c=null!=i&&i.customVideoUrlFallback?function(e,t){try{var i=t(e);return{cloudName:i.cloudName,publicId:i.publicId}}catch(e){return null}}(e,i.customVideoUrlFallback):null,u=null!==(n=c)&&"object"===b(n)&&"string"==typeof n.cloudName&&n.cloudName&&"string"==typeof n.publicId&&n.publicId?{cloudName:n.cloudName,publicId:n.publicId}:null;return l("viewStart",k(k({videoUrl:e,analyticsModuleVersion:"1.5.0",videoPlayer:{type:(r=null==i?void 0:i.videoPlayerType,E.includes(r)?r:w),version:(s=null==i?void 0:i.videoPlayerVersion,"string"==typeof s&&S.test(s)?s:null)}},t),{},{customerData:k(k({},o?{providedData:a}:{}),u?{videoData:u}:{})}))};function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var O=function(e){var t=function(e){return function(e){if(Array.isArray(e))return P(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return P(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?P(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e);return t.push(l("viewEnd",{})),JSON.stringify(t)};function L(e){return L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},L(e)}function D(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function R(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?D(Object(i),!0).forEach((function(t){N(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):D(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function N(e,t,i){return(t=function(e){var t=function(e,t){if("object"!==L(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,"string");if("object"!==L(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===L(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var M=function(e,t,i,n){var s=function(){var n=t(),s=O(n);i(R(R({},e),{},{events:s}))},r=function(){"hidden"===document.visibilityState&&s()};return n?document.addEventListener("visibilitychange",r):window.addEventListener("beforeunload",s,{once:!0}),function(){window.removeEventListener("beforeunload",s),document.removeEventListener("visibilitychange",r),s()}},j=function(e){return e.currentSrc};function U(e){return U="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},U(e)}var B=function(i){var n=null,s=(0,e.isMobile)({tablet:!0,featureDetect:!0}),r=u(i),a=function(e){return function(e,t){var i=Object.keys(t).reduce((function(e,i){return e.append(i,t[i]),e}),new FormData);return"function"!=typeof window.navigator.sendBeacon?window.fetch(e,{method:"POST",mode:"no-cors",body:i,keepalive:!0}):window.navigator.sendBeacon(e,i)}("https://video-analytics-api.cloudinary.com/v1/video-analytics",e)},o=function(){n&&(n.clear(),n=null)};return{startManualTracking:function(e){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=function(e){return"object"!==t(e)?{isValid:!1,errorMessage:"Metadata param needs to be an object"}:"string"!=typeof e.cloudName?{isValid:!1,errorMessage:"You need to provide proper cloud name of your Cloudinary account [cloudName: string]"}:"string"!=typeof e.publicId?{isValid:!1,errorMessage:"You need to provide proper video public ID of your video on your Cloudinary cloud [videoPublicId: string]"}:{isValid:!0}}(e);if(!c.isValid)throw"Cloudinary video analytics tracking called without necessary data (".concat(c.errorMessage,")");if(l&&"object"!==U(l))throw"Options property must be an object";l.customVideoUrlFallback=function(){return e},o();var u=y(),h=j(i),d=I(h,{trackingType:"manual"},l),p=r(u,d),f=M({userId:_(),viewId:u},p.flushEvents,a,s);n={viewId:u,clear:function(){p.destroy(),f()}}},stopManualTracking:o,startAutoTracking:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(n)throw"Cloudinary video analytics tracking is already connected with this HTML Video Element";if(e&&"object"!==U(e))throw"Options property must be an object";var t=function(){var t=j(i);if(t===window.location.href||!t)return null;var o=y(),l=I(t,{trackingType:"auto"},e),c=r(o,l),u=M({userId:_(),viewId:o},c.flushEvents,a,s);n={viewId:o,clear:function(){c.destroy(),u()}}};i.addEventListener("loadstart",(function(){n||t()})),i.addEventListener("emptied",(function(){o()})),t()}}}})(),n})()},3337:function(e,t,i){var n;n=void 0!==i.g?i.g:this,e.exports=function(e){if(e.CSS&&e.CSS.escape)return e.CSS.escape;var t=function(e){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var t,i=String(e),n=i.length,s=-1,r="",a=i.charCodeAt(0);++s<n;)0!=(t=i.charCodeAt(s))?r+=t>=1&&t<=31||127==t||0==s&&t>=48&&t<=57||1==s&&t>=48&&t<=57&&45==a?"\\"+t.toString(16)+" ":0==s&&1==n&&45==t||!(t>=128||45==t||95==t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122)?"\\"+i.charAt(s):i.charAt(s):r+="�";return r};return e.CSS||(e.CSS={}),e.CSS.escape=t,t}(n)},6827:e=>{var t,i="object"==typeof Reflect?Reflect:null,n=i&&"function"==typeof i.apply?i.apply:function(e,t,i){return Function.prototype.apply.call(e,t,i)};t=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function r(){r.init.call(this)}e.exports=r,e.exports.once=function(e,t){return new Promise((function(i,n){function s(i){e.removeListener(t,r),n(i)}function r(){"function"==typeof e.removeListener&&e.removeListener("error",s),i([].slice.call(arguments))}m(e,t,r,{once:!0}),"error"!==t&&function(e,t,i){"function"==typeof e.on&&m(e,"error",t,{once:!0})}(e,s)}))},r.EventEmitter=r,r.prototype._events=void 0,r.prototype._eventsCount=0,r.prototype._maxListeners=void 0;var a=10;function o(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?r.defaultMaxListeners:e._maxListeners}function c(e,t,i,n){var s,r,a,c;if(o(i),void 0===(r=e._events)?(r=e._events=Object.create(null),e._eventsCount=0):(void 0!==r.newListener&&(e.emit("newListener",t,i.listener?i.listener:i),r=e._events),a=r[t]),void 0===a)a=r[t]=i,++e._eventsCount;else if("function"==typeof a?a=r[t]=n?[i,a]:[a,i]:n?a.unshift(i):a.push(i),(s=l(e))>0&&a.length>s&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,c=u,console&&console.warn&&console.warn(c)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,i){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},s=u.bind(n);return s.listener=i,n.wrapFn=s,s}function d(e,t,i){var n=e._events;if(void 0===n)return[];var s=n[t];return void 0===s?[]:"function"==typeof s?i?[s.listener||s]:[s]:i?function(e){for(var t=new Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t}(s):f(s,s.length)}function p(e){var t=this._events;if(void 0!==t){var i=t[e];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function f(e,t){for(var i=new Array(t),n=0;n<t;++n)i[n]=e[n];return i}function m(e,t,i,n){if("function"==typeof e.on)n.once?e.once(t,i):e.on(t,i);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function s(r){n.once&&e.removeEventListener(t,s),i(r)}))}}Object.defineProperty(r,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),r.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},r.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},r.prototype.getMaxListeners=function(){return l(this)},r.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t.push(arguments[i]);var s="error"===e,r=this._events;if(void 0!==r)s=s&&void 0===r.error;else if(!s)return!1;if(s){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var l=r[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else{var c=l.length,u=f(l,c);for(i=0;i<c;++i)n(u[i],this,t)}return!0},r.prototype.addListener=function(e,t){return c(this,e,t,!1)},r.prototype.on=r.prototype.addListener,r.prototype.prependListener=function(e,t){return c(this,e,t,!0)},r.prototype.once=function(e,t){return o(t),this.on(e,h(this,e,t)),this},r.prototype.prependOnceListener=function(e,t){return o(t),this.prependListener(e,h(this,e,t)),this},r.prototype.removeListener=function(e,t){var i,n,s,r,a;if(o(t),void 0===(n=this._events))return this;if(void 0===(i=n[e]))return this;if(i===t||i.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||t));else if("function"!=typeof i){for(s=-1,r=i.length-1;r>=0;r--)if(i[r]===t||i[r].listener===t){a=i[r].listener,s=r;break}if(s<0)return this;0===s?i.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(i,s),1===i.length&&(n[e]=i[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},r.prototype.off=r.prototype.removeListener,r.prototype.removeAllListeners=function(e){var t,i,n;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete i[e]),this;if(0===arguments.length){var s,r=Object.keys(i);for(n=0;n<r.length;++n)"removeListener"!==(s=r[n])&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=i[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},r.prototype.listeners=function(e){return d(this,e,!0)},r.prototype.rawListeners=function(e){return d(this,e,!1)},r.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},r.prototype.listenerCount=p,r.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},7938:(e,t,i)=>{var n=i(6914);i(8364).videojs=n,e.exports=n},8364:(e,t,i)=>{e.exports=function(){if("object"==typeof globalThis)return globalThis;var e;try{e=this||new Function("return this")()}catch(e){if("object"==typeof window)return window;if("object"==typeof self)return self;if(void 0!==i.g)return i.g}return e}()},7509:(e,t,i)=>{var n,s=void 0!==i.g?i.g:"undefined"!=typeof window?window:{},r=i(4626);"undefined"!=typeof document?n=document:(n=s["__GLOBAL_DOCUMENT_CACHE@4"])||(n=s["__GLOBAL_DOCUMENT_CACHE@4"]=r),e.exports=n},5204:(e,t,i)=>{var n;n="undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},e.exports=n},8716:e=>{e.exports=function(e){if(!e)return!1;var i=t.call(e);return"[object Function]"===i||"function"==typeof e&&"[object RegExp]"!==i||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)};var t=Object.prototype.toString},8261:(e,t)=>{function i(e){if(e&&"object"==typeof e){var t=e.which||e.keyCode||e.charCode;t&&(e=t)}if("number"==typeof e)return a[e];var i,r=String(e);return(i=n[r.toLowerCase()])?i:(i=s[r.toLowerCase()])||(1===r.length?r.charCodeAt(0):void 0)}i.isEventKey=function(e,t){if(e&&"object"==typeof e){var i=e.which||e.keyCode||e.charCode;if(null==i)return!1;if("string"==typeof t){var r;if(r=n[t.toLowerCase()])return r===i;if(r=s[t.toLowerCase()])return r===i}else if("number"==typeof t)return t===i;return!1}};var n=(t=e.exports=i).code=t.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},s=t.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(r=97;r<123;r++)n[String.fromCharCode(r)]=r-32;for(var r=48;r<58;r++)n[r-48]=r;for(r=1;r<13;r++)n["f"+r]=r+111;for(r=0;r<10;r++)n["numpad "+r]=r+96;var a=t.names=t.title={};for(r in n)a[n[r]]=r;for(var o in s)n[o]=s[o]},1416:(e,t,i)=>{var n=i(9138)(i(1433),"DataView");e.exports=n},9073:(e,t,i)=>{var n=i(2316),s=i(6458),r=i(2149),a=i(4297),o=i(3121);function l(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=s,l.prototype.get=r,l.prototype.has=a,l.prototype.set=o,e.exports=l},2707:(e,t,i)=>{var n=i(9714),s=i(3812),r=i(4727),a=i(8379),o=i(8291);function l(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=s,l.prototype.get=r,l.prototype.has=a,l.prototype.set=o,e.exports=l},1955:(e,t,i)=>{var n=i(9138)(i(1433),"Map");e.exports=n},369:(e,t,i)=>{var n=i(2092),s=i(9626),r=i(9925),a=i(6809),o=i(4385);function l(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=s,l.prototype.get=r,l.prototype.has=a,l.prototype.set=o,e.exports=l},2616:(e,t,i)=>{var n=i(9138)(i(1433),"Promise");e.exports=n},157:(e,t,i)=>{var n=i(9138)(i(1433),"Set");e.exports=n},6469:(e,t,i)=>{var n=i(2707),s=i(1848),r=i(7406),a=i(8569),o=i(3109),l=i(3389);function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=s,c.prototype.delete=r,c.prototype.get=a,c.prototype.has=o,c.prototype.set=l,e.exports=c},2781:(e,t,i)=>{var n=i(1433).Symbol;e.exports=n},8944:(e,t,i)=>{var n=i(1433).Uint8Array;e.exports=n},8499:(e,t,i)=>{var n=i(9138)(i(1433),"WeakMap");e.exports=n},6701:e=>{e.exports=function(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}},149:e=>{e.exports=function(e,t){for(var i=-1,n=null==e?0:e.length;++i<n&&!1!==t(e[i],i,e););return e}},1414:e=>{e.exports=function(e,t){for(var i=-1,n=null==e?0:e.length,s=0,r=[];++i<n;){var a=e[i];t(a,i,e)&&(r[s++]=a)}return r}},1163:(e,t,i)=>{var n=i(6204),s=i(1256),r=i(6397),a=i(492),o=i(2845),l=i(7995),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var i=r(e),u=!i&&s(e),h=!i&&!u&&a(e),d=!i&&!u&&!h&&l(e),p=i||u||h||d,f=p?n(e.length,String):[],m=f.length;for(var g in e)!t&&!c.call(e,g)||p&&("length"==g||h&&("offset"==g||"parent"==g)||d&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||o(g,m))||f.push(g);return f}},4272:e=>{e.exports=function(e,t){for(var i=-1,n=null==e?0:e.length,s=Array(n);++i<n;)s[i]=t(e[i],i,e);return s}},8740:e=>{e.exports=function(e,t){for(var i=-1,n=t.length,s=e.length;++i<n;)e[s+i]=t[i];return e}},2814:e=>{e.exports=function(e,t,i,n){var s=-1,r=null==e?0:e.length;for(n&&r&&(i=e[++s]);++s<r;)i=t(i,e[s],s,e);return i}},9174:e=>{e.exports=function(e){return e.split("")}},8273:e=>{var t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;e.exports=function(e){return e.match(t)||[]}},2863:(e,t,i)=>{var n=i(4772),s=i(9316),r=Object.prototype.hasOwnProperty;e.exports=function(e,t,i){var a=e[t];r.call(e,t)&&s(a,i)&&(void 0!==i||t in e)||n(e,t,i)}},8301:(e,t,i)=>{var n=i(9316);e.exports=function(e,t){for(var i=e.length;i--;)if(n(e[i][0],t))return i;return-1}},1145:(e,t,i)=>{var n=i(2083),s=i(1178);e.exports=function(e,t){return e&&n(t,s(t),e)}},4306:(e,t,i)=>{var n=i(2083),s=i(5405);e.exports=function(e,t){return e&&n(t,s(t),e)}},4772:(e,t,i)=>{var n=i(8559);e.exports=function(e,t,i){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}},2931:(e,t,i)=>{var n=i(6469),s=i(149),r=i(2863),a=i(1145),o=i(4306),l=i(7030),c=i(8835),u=i(859),h=i(6728),d=i(966),p=i(9697),f=i(1201),m=i(6785),g=i(3283),y=i(9181),v=i(6397),_=i(492),b=i(422),T=i(8953),S=i(3764),w=i(1178),E=i(5405),C="[object Arguments]",x="[object Function]",k="[object Object]",A={};A[C]=A["[object Array]"]=A["[object ArrayBuffer]"]=A["[object DataView]"]=A["[object Boolean]"]=A["[object Date]"]=A["[object Float32Array]"]=A["[object Float64Array]"]=A["[object Int8Array]"]=A["[object Int16Array]"]=A["[object Int32Array]"]=A["[object Map]"]=A["[object Number]"]=A[k]=A["[object RegExp]"]=A["[object Set]"]=A["[object String]"]=A["[object Symbol]"]=A["[object Uint8Array]"]=A["[object Uint8ClampedArray]"]=A["[object Uint16Array]"]=A["[object Uint32Array]"]=!0,A["[object Error]"]=A[x]=A["[object WeakMap]"]=!1,e.exports=function e(t,i,I,P,O,L){var D,R=1&i,N=2&i,M=4&i;if(I&&(D=O?I(t,P,O,L):I(t)),void 0!==D)return D;if(!T(t))return t;var j=v(t);if(j){if(D=m(t),!R)return c(t,D)}else{var U=f(t),B=U==x||"[object GeneratorFunction]"==U;if(_(t))return l(t,R);if(U==k||U==C||B&&!O){if(D=N||B?{}:y(t),!R)return N?h(t,o(D,t)):u(t,a(D,t))}else{if(!A[U])return O?t:{};D=g(t,U,R)}}L||(L=new n);var F=L.get(t);if(F)return F;L.set(t,D),S(t)?t.forEach((function(n){D.add(e(n,i,I,n,t,L))})):b(t)&&t.forEach((function(n,s){D.set(s,e(n,i,I,s,t,L))}));var q=j?void 0:(M?N?p:d:N?E:w)(t);return s(q||t,(function(n,s){q&&(n=t[s=n]),r(D,s,e(n,i,I,s,t,L))})),D}},3508:(e,t,i)=>{var n=i(8953),s=Object.create,r=function(){function e(){}return function(t){if(!n(t))return{};if(s)return s(t);e.prototype=t;var i=new e;return e.prototype=void 0,i}}();e.exports=r},1044:(e,t,i)=>{var n=i(8740),s=i(8031);e.exports=function e(t,i,r,a,o){var l=-1,c=t.length;for(r||(r=s),o||(o=[]);++l<c;){var u=t[l];i>0&&r(u)?i>1?e(u,i-1,r,a,o):n(o,u):a||(o[o.length]=u)}return o}},7722:(e,t,i)=>{var n=i(7181),s=i(6729);e.exports=function(e,t){for(var i=0,r=(t=n(t,e)).length;null!=e&&i<r;)e=e[s(t[i++])];return i&&i==r?e:void 0}},4403:(e,t,i)=>{var n=i(8740),s=i(6397);e.exports=function(e,t,i){var r=t(e);return s(e)?r:n(r,i(e))}},7148:(e,t,i)=>{var n=i(2781),s=i(7903),r=i(1738),a=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?s(e):r(e)}},809:e=>{e.exports=function(e,t){return null!=e&&t in Object(e)}},9250:(e,t,i)=>{var n=i(7148),s=i(2934);e.exports=function(e){return s(e)&&"[object Arguments]"==n(e)}},4800:(e,t,i)=>{var n=i(1201),s=i(2934);e.exports=function(e){return s(e)&&"[object Map]"==n(e)}},6567:(e,t,i)=>{var n=i(8446),s=i(8092),r=i(8953),a=i(1485),o=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,u=l.toString,h=c.hasOwnProperty,d=RegExp("^"+u.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!r(e)||s(e))&&(n(e)?d:o).test(a(e))}},7866:(e,t,i)=>{var n=i(1201),s=i(2934);e.exports=function(e){return s(e)&&"[object Set]"==n(e)}},7129:(e,t,i)=>{var n=i(7148),s=i(3330),r=i(2934),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return r(e)&&s(e.length)&&!!a[n(e)]}},1452:(e,t,i)=>{var n=i(7499),s=i(9566),r=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return s(e);var t=[];for(var i in Object(e))r.call(e,i)&&"constructor"!=i&&t.push(i);return t}},1491:(e,t,i)=>{var n=i(8953),s=i(7499),r=i(8201),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return r(e);var t=s(e),i=[];for(var o in e)("constructor"!=o||!t&&a.call(e,o))&&i.push(o);return i}},6733:(e,t,i)=>{var n=i(5576),s=i(8235);e.exports=function(e,t){return n(e,t,(function(t,i){return s(e,i)}))}},5576:(e,t,i)=>{var n=i(7722),s=i(8230),r=i(7181);e.exports=function(e,t,i){for(var a=-1,o=t.length,l={};++a<o;){var c=t[a],u=n(e,c);i(u,c)&&s(l,r(c,e),u)}return l}},6764:e=>{e.exports=function(e){return function(t){return null==e?void 0:e[t]}}},8230:(e,t,i)=>{var n=i(2863),s=i(7181),r=i(2845),a=i(8953),o=i(6729);e.exports=function(e,t,i,l){if(!a(e))return e;for(var c=-1,u=(t=s(t,e)).length,h=u-1,d=e;null!=d&&++c<u;){var p=o(t[c]),f=i;if("__proto__"===p||"constructor"===p||"prototype"===p)return e;if(c!=h){var m=d[p];void 0===(f=l?l(m,p,d):void 0)&&(f=a(m)?m:r(t[c+1])?[]:{})}n(d,p,f),d=d[p]}return e}},7310:(e,t,i)=>{var n=i(3122),s=i(8559),r=i(4796),a=s?function(e,t){return s(e,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:r;e.exports=a},9772:e=>{e.exports=function(e,t,i){var n=-1,s=e.length;t<0&&(t=-t>s?0:s+t),(i=i>s?s:i)<0&&(i+=s),s=t>i?0:i-t>>>0,t>>>=0;for(var r=Array(s);++n<s;)r[n]=e[n+t];return r}},6204:e=>{e.exports=function(e,t){for(var i=-1,n=Array(e);++i<e;)n[i]=t(i);return n}},6584:(e,t,i)=>{var n=i(2781),s=i(4272),r=i(6397),a=i(5414),o=n?n.prototype:void 0,l=o?o.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(r(t))return s(t,e)+"";if(a(t))return l?l.call(t):"";var i=t+"";return"0"==i&&1/t==-1/0?"-0":i}},41:e=>{e.exports=function(e){return function(t){return e(t)}}},5263:(e,t,i)=>{var n=i(7181),s=i(5342),r=i(8549),a=i(6729);e.exports=function(e,t){return t=n(t,e),null==(e=r(e,t))||delete e[a(s(t))]}},7181:(e,t,i)=>{var n=i(6397),s=i(3726),r=i(3614),a=i(3506);e.exports=function(e,t){return n(e)?e:s(e,t)?[e]:r(a(e))}},9270:(e,t,i)=>{var n=i(9772);e.exports=function(e,t,i){var s=e.length;return i=void 0===i?s:i,!t&&i>=s?e:n(e,t,i)}},7177:(e,t,i)=>{var n=i(8944);e.exports=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},7030:(e,t,i)=>{e=i.nmd(e);var n=i(1433),s=t&&!t.nodeType&&t,r=s&&e&&!e.nodeType&&e,a=r&&r.exports===s?n.Buffer:void 0,o=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var i=e.length,n=o?o(i):new e.constructor(i);return e.copy(n),n}},4893:(e,t,i)=>{var n=i(7177);e.exports=function(e,t){var i=t?n(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)}},4021:e=>{var t=/\w*$/;e.exports=function(e){var i=new e.constructor(e.source,t.exec(e));return i.lastIndex=e.lastIndex,i}},1548:(e,t,i)=>{var n=i(2781),s=n?n.prototype:void 0,r=s?s.valueOf:void 0;e.exports=function(e){return r?Object(r.call(e)):{}}},9114:(e,t,i)=>{var n=i(7177);e.exports=function(e,t){var i=t?n(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}},8835:e=>{e.exports=function(e,t){var i=-1,n=e.length;for(t||(t=Array(n));++i<n;)t[i]=e[i];return t}},2083:(e,t,i)=>{var n=i(2863),s=i(4772);e.exports=function(e,t,i,r){var a=!i;i||(i={});for(var o=-1,l=t.length;++o<l;){var c=t[o],u=r?r(i[c],e[c],c,i,e):void 0;void 0===u&&(u=e[c]),a?s(i,c,u):n(i,c,u)}return i}},859:(e,t,i)=>{var n=i(2083),s=i(8876);e.exports=function(e,t){return n(e,s(e),t)}},6728:(e,t,i)=>{var n=i(2083),s=i(8355);e.exports=function(e,t){return n(e,s(e),t)}},8109:(e,t,i)=>{var n=i(1433)["__core-js_shared__"];e.exports=n},7383:(e,t,i)=>{var n=i(9270),s=i(654),r=i(4092),a=i(3506);e.exports=function(e){return function(t){t=a(t);var i=s(t)?r(t):void 0,o=i?i[0]:t.charAt(0),l=i?n(i,1).join(""):t.slice(1);return o[e]()+l}}},6983:(e,t,i)=>{var n=i(2814),s=i(3768),r=i(7385),a=RegExp("['’]","g");e.exports=function(e){return function(t){return n(r(s(t).replace(a,"")),e,"")}}},7222:(e,t,i)=>{var n=i(4679);e.exports=function(e){return n(e)?void 0:e}},8795:(e,t,i)=>{var n=i(6764)({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"});e.exports=n},8559:(e,t,i)=>{var n=i(9138),s=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=s},9820:(e,t,i)=>{var n=i(3406),s=i(5265),r=i(6805);e.exports=function(e){return r(s(e,void 0,n),e+"")}},5380:(e,t,i)=>{var n="object"==typeof i.g&&i.g&&i.g.Object===Object&&i.g;e.exports=n},966:(e,t,i)=>{var n=i(4403),s=i(8876),r=i(1178);e.exports=function(e){return n(e,r,s)}},9697:(e,t,i)=>{var n=i(4403),s=i(8355),r=i(5405);e.exports=function(e){return n(e,r,s)}},5535:(e,t,i)=>{var n=i(5662);e.exports=function(e,t){var i=e.__data__;return n(t)?i["string"==typeof t?"string":"hash"]:i.map}},9138:(e,t,i)=>{var n=i(6567),s=i(6772);e.exports=function(e,t){var i=s(e,t);return n(i)?i:void 0}},3347:(e,t,i)=>{var n=i(1019)(Object.getPrototypeOf,Object);e.exports=n},7903:(e,t,i)=>{var n=i(2781),s=Object.prototype,r=s.hasOwnProperty,a=s.toString,o=n?n.toStringTag:void 0;e.exports=function(e){var t=r.call(e,o),i=e[o];try{e[o]=void 0;var n=!0}catch(e){}var s=a.call(e);return n&&(t?e[o]=i:delete e[o]),s}},8876:(e,t,i)=>{var n=i(1414),s=i(3629),r=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,o=a?function(e){return null==e?[]:(e=Object(e),n(a(e),(function(t){return r.call(e,t)})))}:s;e.exports=o},8355:(e,t,i)=>{var n=i(8740),s=i(3347),r=i(8876),a=i(3629),o=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)n(t,r(e)),e=s(e);return t}:a;e.exports=o},1201:(e,t,i)=>{var n=i(1416),s=i(1955),r=i(2616),a=i(157),o=i(8499),l=i(7148),c=i(1485),u="[object Map]",h="[object Promise]",d="[object Set]",p="[object WeakMap]",f="[object DataView]",m=c(n),g=c(s),y=c(r),v=c(a),_=c(o),b=l;(n&&b(new n(new ArrayBuffer(1)))!=f||s&&b(new s)!=u||r&&b(r.resolve())!=h||a&&b(new a)!=d||o&&b(new o)!=p)&&(b=function(e){var t=l(e),i="[object Object]"==t?e.constructor:void 0,n=i?c(i):"";if(n)switch(n){case m:return f;case g:return u;case y:return h;case v:return d;case _:return p}return t}),e.exports=b},6772:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},6866:(e,t,i)=>{var n=i(7181),s=i(1256),r=i(6397),a=i(2845),o=i(3330),l=i(6729);e.exports=function(e,t,i){for(var c=-1,u=(t=n(t,e)).length,h=!1;++c<u;){var d=l(t[c]);if(!(h=null!=e&&i(e,d)))break;e=e[d]}return h||++c!=u?h:!!(u=null==e?0:e.length)&&o(u)&&a(d,u)&&(r(e)||s(e))}},654:e=>{var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},5854:e=>{var t=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;e.exports=function(e){return t.test(e)}},2316:(e,t,i)=>{var n=i(4558);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},6458:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},2149:(e,t,i)=>{var n=i(4558),s=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return s.call(t,e)?t[e]:void 0}},4297:(e,t,i)=>{var n=i(4558),s=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:s.call(t,e)}},3121:(e,t,i)=>{var n=i(4558);e.exports=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},6785:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var i=e.length,n=new e.constructor(i);return i&&"string"==typeof e[0]&&t.call(e,"index")&&(n.index=e.index,n.input=e.input),n}},3283:(e,t,i)=>{var n=i(7177),s=i(4893),r=i(4021),a=i(1548),o=i(9114);e.exports=function(e,t,i){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return n(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return s(e,i);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return o(e,i);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(e);case"[object RegExp]":return r(e);case"[object Symbol]":return a(e)}}},9181:(e,t,i)=>{var n=i(3508),s=i(3347),r=i(7499);e.exports=function(e){return"function"!=typeof e.constructor||r(e)?{}:n(s(e))}},8031:(e,t,i)=>{var n=i(2781),s=i(1256),r=i(6397),a=n?n.isConcatSpreadable:void 0;e.exports=function(e){return r(e)||s(e)||!!(a&&e&&e[a])}},2845:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,i){var n=typeof e;return!!(i=null==i?9007199254740991:i)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e<i}},3726:(e,t,i)=>{var n=i(6397),s=i(5414),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(n(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!s(e))||a.test(e)||!r.test(e)||null!=t&&e in Object(t)}},5662:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},8092:(e,t,i)=>{var n,s=i(8109),r=(n=/[^.]+$/.exec(s&&s.keys&&s.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!r&&r in e}},7499:e=>{var t=Object.prototype;e.exports=function(e){var i=e&&e.constructor;return e===("function"==typeof i&&i.prototype||t)}},9714:e=>{e.exports=function(){this.__data__=[],this.size=0}},3812:(e,t,i)=>{var n=i(8301),s=Array.prototype.splice;e.exports=function(e){var t=this.__data__,i=n(t,e);return!(i<0||(i==t.length-1?t.pop():s.call(t,i,1),--this.size,0))}},4727:(e,t,i)=>{var n=i(8301);e.exports=function(e){var t=this.__data__,i=n(t,e);return i<0?void 0:t[i][1]}},8379:(e,t,i)=>{var n=i(8301);e.exports=function(e){return n(this.__data__,e)>-1}},8291:(e,t,i)=>{var n=i(8301);e.exports=function(e,t){var i=this.__data__,s=n(i,e);return s<0?(++this.size,i.push([e,t])):i[s][1]=t,this}},2092:(e,t,i)=>{var n=i(9073),s=i(2707),r=i(1955);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(r||s),string:new n}}},9626:(e,t,i)=>{var n=i(5535);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},9925:(e,t,i)=>{var n=i(5535);e.exports=function(e){return n(this,e).get(e)}},6809:(e,t,i)=>{var n=i(5535);e.exports=function(e){return n(this,e).has(e)}},4385:(e,t,i)=>{var n=i(5535);e.exports=function(e,t){var i=n(this,e),s=i.size;return i.set(e,t),this.size+=i.size==s?0:1,this}},9268:(e,t,i)=>{var n=i(4556);e.exports=function(e){var t=n(e,(function(e){return 500===i.size&&i.clear(),e})),i=t.cache;return t}},4558:(e,t,i)=>{var n=i(9138)(Object,"create");e.exports=n},9566:(e,t,i)=>{var n=i(1019)(Object.keys,Object);e.exports=n},8201:e=>{e.exports=function(e){var t=[];if(null!=e)for(var i in Object(e))t.push(i);return t}},3685:(e,t,i)=>{e=i.nmd(e);var n=i(5380),s=t&&!t.nodeType&&t,r=s&&e&&!e.nodeType&&e,a=r&&r.exports===s&&n.process,o=function(){try{return r&&r.require&&r.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=o},1738:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},1019:e=>{e.exports=function(e,t){return function(i){return e(t(i))}}},5265:(e,t,i)=>{var n=i(6701),s=Math.max;e.exports=function(e,t,i){return t=s(void 0===t?e.length-1:t,0),function(){for(var r=arguments,a=-1,o=s(r.length-t,0),l=Array(o);++a<o;)l[a]=r[t+a];a=-1;for(var c=Array(t+1);++a<t;)c[a]=r[a];return c[t]=i(l),n(e,this,c)}}},8549:(e,t,i)=>{var n=i(7722),s=i(9772);e.exports=function(e,t){return t.length<2?e:n(e,s(t,0,-1))}},1433:(e,t,i)=>{var n=i(5380),s="object"==typeof self&&self&&self.Object===Object&&self,r=n||s||Function("return this")();e.exports=r},6805:(e,t,i)=>{var n=i(7310),s=i(3983)(n);e.exports=s},3983:e=>{var t=Date.now;e.exports=function(e){var i=0,n=0;return function(){var s=t(),r=16-(s-n);if(n=s,r>0){if(++i>=800)return arguments[0]}else i=0;return e.apply(void 0,arguments)}}},1848:(e,t,i)=>{var n=i(2707);e.exports=function(){this.__data__=new n,this.size=0}},7406:e=>{e.exports=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i}},8569:e=>{e.exports=function(e){return this.__data__.get(e)}},3109:e=>{e.exports=function(e){return this.__data__.has(e)}},3389:(e,t,i)=>{var n=i(2707),s=i(1955),r=i(369);e.exports=function(e,t){var i=this.__data__;if(i instanceof n){var a=i.__data__;if(!s||a.length<199)return a.push([e,t]),this.size=++i.size,this;i=this.__data__=new r(a)}return i.set(e,t),this.size=i.size,this}},4092:(e,t,i)=>{var n=i(9174),s=i(654),r=i(4082);e.exports=function(e){return s(e)?r(e):n(e)}},3614:(e,t,i)=>{var n=i(9268),s=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,a=n((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(s,(function(e,i,n,s){t.push(n?s.replace(r,"$1"):i||e)})),t}));e.exports=a},6729:(e,t,i)=>{var n=i(5414);e.exports=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},1485:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},4082:e=>{var t="\\ud800-\\udfff",i="["+t+"]",n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",s="\\ud83c[\\udffb-\\udfff]",r="[^"+t+"]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",o="[\\ud800-\\udbff][\\udc00-\\udfff]",l="(?:"+n+"|"+s+")?",c="[\\ufe0e\\ufe0f]?",u=c+l+"(?:\\u200d(?:"+[r,a,o].join("|")+")"+c+l+")*",h="(?:"+[r+n+"?",n,a,o,i].join("|")+")",d=RegExp(s+"(?="+s+")|"+h+u,"g");e.exports=function(e){return e.match(d)||[]}},5701:e=>{var t="\\ud800-\\udfff",i="\\u2700-\\u27bf",n="a-z\\xdf-\\xf6\\xf8-\\xff",s="A-Z\\xc0-\\xd6\\xd8-\\xde",r="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",a="["+r+"]",o="\\d+",l="["+i+"]",c="["+n+"]",u="[^"+t+r+o+i+n+s+"]",h="(?:\\ud83c[\\udde6-\\uddff]){2}",d="[\\ud800-\\udbff][\\udc00-\\udfff]",p="["+s+"]",f="(?:"+c+"|"+u+")",m="(?:"+p+"|"+u+")",g="(?:['’](?:d|ll|m|re|s|t|ve))?",y="(?:['’](?:D|LL|M|RE|S|T|VE))?",v="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",_="[\\ufe0e\\ufe0f]?",b=_+v+"(?:\\u200d(?:"+["[^"+t+"]",h,d].join("|")+")"+_+v+")*",T="(?:"+[l,h,d].join("|")+")"+b,S=RegExp([p+"?"+c+"+"+g+"(?="+[a,p,"$"].join("|")+")",m+"+"+y+"(?="+[a,p+f,"$"].join("|")+")",p+"?"+f+"+"+g,p+"+"+y,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",o,T].join("|"),"g");e.exports=function(e){return e.match(S)||[]}},3686:(e,t,i)=>{var n=i(8756),s=i(6983)((function(e,t,i){return t=t.toLowerCase(),e+(i?n(t):t)}));e.exports=s},8756:(e,t,i)=>{var n=i(3506),s=i(8580);e.exports=function(e){return s(n(e).toLowerCase())}},2160:(e,t,i)=>{var n=i(6397);e.exports=function(){if(!arguments.length)return[];var e=arguments[0];return n(e)?e:[e]}},3122:e=>{e.exports=function(e){return function(){return e}}},3768:(e,t,i)=>{var n=i(8795),s=i(3506),r=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,a=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");e.exports=function(e){return(e=s(e))&&e.replace(r,n).replace(a,"")}},9316:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},3406:(e,t,i)=>{var n=i(1044);e.exports=function(e){return null!=e&&e.length?n(e,1):[]}},2832:(e,t,i)=>{var n=i(7722);e.exports=function(e,t,i){var s=null==e?void 0:n(e,t);return void 0===s?i:s}},8235:(e,t,i)=>{var n=i(809),s=i(6866);e.exports=function(e,t){return null!=e&&s(e,t,n)}},4796:e=>{e.exports=function(e){return e}},1256:(e,t,i)=>{var n=i(9250),s=i(2934),r=Object.prototype,a=r.hasOwnProperty,o=r.propertyIsEnumerable,l=n(function(){return arguments}())?n:function(e){return s(e)&&a.call(e,"callee")&&!o.call(e,"callee")};e.exports=l},6397:e=>{var t=Array.isArray;e.exports=t},8330:(e,t,i)=>{var n=i(8446),s=i(3330);e.exports=function(e){return null!=e&&s(e.length)&&!n(e)}},492:(e,t,i)=>{e=i.nmd(e);var n=i(1433),s=i(659),r=t&&!t.nodeType&&t,a=r&&e&&!e.nodeType&&e,o=a&&a.exports===r?n.Buffer:void 0,l=(o?o.isBuffer:void 0)||s;e.exports=l},9040:(e,t,i)=>{var n=i(2934),s=i(4679);e.exports=function(e){return n(e)&&1===e.nodeType&&!s(e)}},5685:(e,t,i)=>{var n=i(1452),s=i(1201),r=i(1256),a=i(6397),o=i(8330),l=i(492),c=i(7499),u=i(7995),h=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(o(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||l(e)||u(e)||r(e)))return!e.length;var t=s(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(c(e))return!n(e).length;for(var i in e)if(h.call(e,i))return!1;return!0}},8446:(e,t,i)=>{var n=i(7148),s=i(8953);e.exports=function(e){if(!s(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},3330:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},422:(e,t,i)=>{var n=i(4800),s=i(41),r=i(3685),a=r&&r.isMap,o=a?s(a):n;e.exports=o},8953:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},2934:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},4679:(e,t,i)=>{var n=i(7148),s=i(3347),r=i(2934),a=Function.prototype,o=Object.prototype,l=a.toString,c=o.hasOwnProperty,u=l.call(Object);e.exports=function(e){if(!r(e)||"[object Object]"!=n(e))return!1;var t=s(e);if(null===t)return!0;var i=c.call(t,"constructor")&&t.constructor;return"function"==typeof i&&i instanceof i&&l.call(i)==u}},3764:(e,t,i)=>{var n=i(7866),s=i(41),r=i(3685),a=r&&r.isSet,o=a?s(a):n;e.exports=o},7571:(e,t,i)=>{var n=i(7148),s=i(6397),r=i(2934);e.exports=function(e){return"string"==typeof e||!s(e)&&r(e)&&"[object String]"==n(e)}},5414:(e,t,i)=>{var n=i(7148),s=i(2934);e.exports=function(e){return"symbol"==typeof e||s(e)&&"[object Symbol]"==n(e)}},7995:(e,t,i)=>{var n=i(7129),s=i(41),r=i(3685),a=r&&r.isTypedArray,o=a?s(a):n;e.exports=o},1178:(e,t,i)=>{var n=i(1163),s=i(1452),r=i(8330);e.exports=function(e){return r(e)?n(e):s(e)}},5405:(e,t,i)=>{var n=i(1163),s=i(1491),r=i(8330);e.exports=function(e){return r(e)?n(e,!0):s(e)}},5342:e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},4556:(e,t,i)=>{var n=i(369);function s(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var i=function(){var n=arguments,s=t?t.apply(this,n):n[0],r=i.cache;if(r.has(s))return r.get(s);var a=e.apply(this,n);return i.cache=r.set(s,a)||r,a};return i.cache=new(s.Cache||n),i}s.Cache=n,e.exports=s},4319:(e,t,i)=>{var n=i(4272),s=i(2931),r=i(5263),a=i(7181),o=i(2083),l=i(7222),c=i(9820),u=i(9697),h=c((function(e,t){var i={};if(null==e)return i;var c=!1;t=n(t,(function(t){return t=a(t,e),c||(c=t.length>1),t})),o(e,u(e),i),c&&(i=s(i,7,l));for(var h=t.length;h--;)r(i,t[h]);return i}));e.exports=h},7171:(e,t,i)=>{var n=i(6733),s=i(9820)((function(e,t){return null==e?{}:n(e,t)}));e.exports=s},5072:(e,t,i)=>{var n=i(6983)((function(e,t,i){return e+(i?"_":"")+t.toLowerCase()}));e.exports=n},3629:e=>{e.exports=function(){return[]}},659:e=>{e.exports=function(){return!1}},3506:(e,t,i)=>{var n=i(6584);e.exports=function(e){return null==e?"":n(e)}},8580:(e,t,i)=>{var n=i(7383)("toUpperCase");e.exports=n},7385:(e,t,i)=>{var n=i(8273),s=i(5854),r=i(3506),a=i(5701);e.exports=function(e,t,i){return e=r(e),void 0===(t=i?void 0:t)?s(e)?a(e):n(e):e.match(t)||[]}},9910:(e,t,i)=>{var n=i(4390).getUint64;e.exports=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8)},s=12;0===i.version?(i.earliestPresentationTime=t.getUint32(s),i.firstOffset=t.getUint32(s+4),s+=8):(i.earliestPresentationTime=n(e.subarray(s)),i.firstOffset=n(e.subarray(s+8)),s+=16),s+=2;var r=t.getUint16(s);for(s+=2;r>0;s+=12,r--)i.references.push({referenceType:(128&e[s])>>>7,referencedSize:2147483647&t.getUint32(s),subsegmentDuration:t.getUint32(s+4),startsWithSap:!!(128&e[s+8]),sapType:(112&e[s+8])>>>4,sapDeltaTime:268435455&t.getUint32(s+8)});return i}},6946:e=>{var t,i,n,s,r,a,o,l=9e4;t=function(e){return e*l},i=function(e,t){return e*t},n=function(e){return e/l},s=function(e,t){return e/t},r=function(e,i){return t(s(e,i))},a=function(e,t){return i(n(e),t)},o=function(e,t,i){return n(i?e:e-t)},e.exports={ONE_SECOND_IN_TS:l,secondsToVideoTs:t,secondsToAudioTs:i,videoTsToSeconds:n,audioTsToSeconds:s,audioTsToVideoTs:r,videoTsToAudioTs:a,metadataTsToSeconds:o}},4390:e=>{var t=Math.pow(2,32);e.exports={getUint64:function(e){var i,n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getBigUint64?(i=n.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(i):i:n.getUint32(0)*t+n.getUint32(4)},MAX_UINT32:t}},613:e=>{e.exports=function(e,t){var i,n=null;try{i=JSON.parse(e,t)}catch(e){n=e}return[n,i]}},8726:function(e){var t,i,n,s,r;t=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,n=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,r={buildAbsoluteURL:function(e,t,n){if(n=n||{},e=e.trim(),!(t=t.trim())){if(!n.alwaysNormalize)return e;var s=r.parseURL(e);if(!s)throw new Error("Error trying to parse base URL.");return s.path=r.normalizePath(s.path),r.buildURLFromParts(s)}var a=r.parseURL(t);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return n.alwaysNormalize?(a.path=r.normalizePath(a.path),r.buildURLFromParts(a)):t;var o=r.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var l=i.exec(o.path);o.netLoc=l[1],o.path=l[2]}o.netLoc&&!o.path&&(o.path="/");var c={scheme:o.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(c.netLoc=o.netLoc,"/"!==a.path[0]))if(a.path){var u=o.path,h=u.substring(0,u.lastIndexOf("/")+1)+a.path;c.path=r.normalizePath(h)}else c.path=o.path,a.params||(c.params=o.params,a.query||(c.query=o.query));return null===c.path&&(c.path=n.alwaysNormalize?r.normalizePath(a.path):a.path),r.buildURLFromParts(c)},parseURL:function(e){var i=t.exec(e);return i?{scheme:i[1]||"",netLoc:i[2]||"",path:i[3]||"",params:i[4]||"",query:i[5]||"",fragment:i[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(n,"");e.length!==(e=e.replace(s,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=r},6914:(e,t,i)=>{i.r(t),i.d(t,{default:()=>va});var n=i(5204),s=i.n(n),r=i(7509),a=i.n(r),o=i(8261),l=i.n(o),c=i(613),u=i.n(c),h=i(6e3),d=i.n(h),p=i(52),f=i.n(p);function m(){return m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},m.apply(this,arguments)}var g=i(8726),y=i.n(g);const v=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=s().location&&s().location.href||"");var i="function"==typeof s().URL,n=/^\/\//.test(e),r=!s().location&&!/\/\//i.test(e);if(i?e=new(s().URL)(e,s().location||"http://example.com"):/\/\//i.test(e)||(e=y().buildAbsoluteURL(s().location&&s().location.href||"",e)),i){var a=new URL(t,e);return r?a.href.slice(18):n?a.href.slice(a.protocol.length):a.href}return y().buildAbsoluteURL(e,t)};var _=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(i,1),i>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n<i;++n)t[n].call(this,arguments[1]);else for(var s=Array.prototype.slice.call(arguments,1),r=t.length,a=0;a<r;++a)t[a].apply(this,s)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}();function b(e){for(var t,i=(t=e,s().atob?s().atob(t):Buffer.from(t,"base64").toString("binary")),n=new Uint8Array(i.length),r=0;r<i.length;r++)n[r]=i.charCodeAt(r);return n}class T extends _{constructor(){super(),this.buffer=""}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf("\n");t>-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const S=String.fromCharCode(9),w=function(e){const t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),i={};return t[1]&&(i.length=parseInt(t[1],10)),t[2]&&(i.offset=parseInt(t[2],10)),i},E=function(e){const t={};if(!e)return t;const i=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))'));let n,s=i.length;for(;s--;)""!==i[s]&&(n=/([^=]*)=(.*)/.exec(i[s]).slice(1),n[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};class C extends _{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,i;0!==(e=e.trim()).length&&("#"===e[0]?this.tagMappers.reduce(((t,i)=>{const n=i(e);return n===e?t:t.concat([n])}),[e]).forEach((e=>{for(let t=0;t<this.customParsers.length;t++)if(this.customParsers[t].call(this,e))return;if(0===e.indexOf("#EXT"))if(e=e.replace("\r",""),t=/^#EXTM3U/.exec(e),t)this.trigger("data",{type:"tag",tagType:"m3u"});else{if(t=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(e),t)return i={type:"tag",tagType:"inf"},t[1]&&(i.duration=parseFloat(t[1])),t[2]&&(i.title=t[2]),void this.trigger("data",i);if(t=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"targetduration"},t[1]&&(i.duration=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-VERSION:([0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"version"},t[1]&&(i.version=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"media-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(e),t)return i={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void this.trigger("data",i);if(t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(e),t)return i={type:"tag",tagType:"playlist-type"},t[1]&&(i.playlistType=t[1]),void this.trigger("data",i);if(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(e),t)return i=m(w(t[1]),{type:"tag",tagType:"byterange"}),void this.trigger("data",i);if(t=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(e),t)return i={type:"tag",tagType:"allow-cache"},t[1]&&(i.allowed=!/NO/.test(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-MAP:(.*)$/.exec(e),t){if(i={type:"tag",tagType:"map"},t[1]){const e=E(t[1]);e.URI&&(i.uri=e.URI),e.BYTERANGE&&(i.byterange=w(e.BYTERANGE))}this.trigger("data",i)}else if(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(e),t){if(i={type:"tag",tagType:"stream-inf"},t[1]){if(i.attributes=E(t[1]),i.attributes.RESOLUTION){const e=i.attributes.RESOLUTION.split("x"),t={};e[0]&&(t.width=parseInt(e[0],10)),e[1]&&(t.height=parseInt(e[1],10)),i.attributes.RESOLUTION=t}i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes["FRAME-RATE"]&&(i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])),i.attributes["PROGRAM-ID"]&&(i.attributes["PROGRAM-ID"]=parseInt(i.attributes["PROGRAM-ID"],10))}this.trigger("data",i)}else{if(t=/^#EXT-X-MEDIA:(.*)$/.exec(e),t)return i={type:"tag",tagType:"media"},t[1]&&(i.attributes=E(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-ENDLIST/.exec(e),t)this.trigger("data",{type:"tag",tagType:"endlist"});else if(t=/^#EXT-X-DISCONTINUITY/.exec(e),t)this.trigger("data",{type:"tag",tagType:"discontinuity"});else{if(t=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(e),t)return i={type:"tag",tagType:"program-date-time"},t[1]&&(i.dateTimeString=t[1],i.dateTimeObject=new Date(t[1])),void this.trigger("data",i);if(t=/^#EXT-X-KEY:(.*)$/.exec(e),t)return i={type:"tag",tagType:"key"},t[1]&&(i.attributes=E(t[1]),i.attributes.IV&&("0x"===i.attributes.IV.substring(0,2).toLowerCase()&&(i.attributes.IV=i.attributes.IV.substring(2)),i.attributes.IV=i.attributes.IV.match(/.{8}/g),i.attributes.IV[0]=parseInt(i.attributes.IV[0],16),i.attributes.IV[1]=parseInt(i.attributes.IV[1],16),i.attributes.IV[2]=parseInt(i.attributes.IV[2],16),i.attributes.IV[3]=parseInt(i.attributes.IV[3],16),i.attributes.IV=new Uint32Array(i.attributes.IV))),void this.trigger("data",i);if(t=/^#EXT-X-START:(.*)$/.exec(e),t)return i={type:"tag",tagType:"start"},t[1]&&(i.attributes=E(t[1]),i.attributes["TIME-OFFSET"]=parseFloat(i.attributes["TIME-OFFSET"]),i.attributes.PRECISE=/YES/.test(i.attributes.PRECISE)),void this.trigger("data",i);if(t=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(e),t)return i={type:"tag",tagType:"cue-out-cont"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);if(t=/^#EXT-X-CUE-OUT:(.*)?$/.exec(e),t)return i={type:"tag",tagType:"cue-out"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);if(t=/^#EXT-X-CUE-IN:(.*)?$/.exec(e),t)return i={type:"tag",tagType:"cue-in"},t[1]?i.data=t[1]:i.data="",void this.trigger("data",i);if(t=/^#EXT-X-SKIP:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"skip"},i.attributes=E(t[1]),i.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(i.attributes["SKIPPED-SEGMENTS"]=parseInt(i.attributes["SKIPPED-SEGMENTS"],10)),i.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(i.attributes["RECENTLY-REMOVED-DATERANGES"]=i.attributes["RECENTLY-REMOVED-DATERANGES"].split(S)),void this.trigger("data",i);if(t=/^#EXT-X-PART:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"part"},i.attributes=E(t[1]),["DURATION"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))})),["INDEPENDENT","GAP"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/.test(i.attributes[e]))})),i.attributes.hasOwnProperty("BYTERANGE")&&(i.attributes.byterange=w(i.attributes.BYTERANGE)),void this.trigger("data",i);if(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"server-control"},i.attributes=E(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))})),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/.test(i.attributes[e]))})),void this.trigger("data",i);if(t=/^#EXT-X-PART-INF:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"part-inf"},i.attributes=E(t[1]),["PART-TARGET"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))})),void this.trigger("data",i);if(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"preload-hint"},i.attributes=E(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach((function(e){if(i.attributes.hasOwnProperty(e)){i.attributes[e]=parseInt(i.attributes[e],10);const t="BYTERANGE-LENGTH"===e?"length":"offset";i.attributes.byterange=i.attributes.byterange||{},i.attributes.byterange[t]=i.attributes[e],delete i.attributes[e]}})),void this.trigger("data",i);if(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e),t&&t[1])return i={type:"tag",tagType:"rendition-report"},i.attributes=E(t[1]),["LAST-MSN","LAST-PART"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseInt(i.attributes[e],10))})),void this.trigger("data",i);if(t=/^#EXT-X-DATERANGE:(.*)$/.exec(e),t&&t[1]){i={type:"tag",tagType:"daterange"},i.attributes=E(t[1]),["ID","CLASS"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=String(i.attributes[e]))})),["START-DATE","END-DATE"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=new Date(i.attributes[e]))})),["DURATION","PLANNED-DURATION"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))})),["END-ON-NEXT"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/i.test(i.attributes[e]))})),["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach((function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=i.attributes[e].toString(16))}));const e=/^X-([A-Z]+-)+[A-Z]+$/;for(const t in i.attributes){if(!e.test(t))continue;const n=/[0-9A-Fa-f]{6}/g.test(i.attributes[t]),s=/^\d+(\.\d+)?$/.test(i.attributes[t]);i.attributes[t]=n?i.attributes[t].toString(16):s?parseFloat(i.attributes[t]):String(i.attributes[t])}this.trigger("data",i)}else if(t=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(e),t)this.trigger("data",{type:"tag",tagType:"independent-segments"});else{if(t=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(e),t)return i={type:"tag",tagType:"content-steering"},i.attributes=E(t[1]),void this.trigger("data",i);this.trigger("data",{type:"tag",data:e.slice(4)})}}}}else this.trigger("data",{type:"comment",text:e.slice(1)})})):this.trigger("data",{type:"uri",uri:e}))}addParser({expression:e,customType:t,dataParser:i,segment:n}){"function"!=typeof i&&(i=e=>e),this.customParsers.push((s=>{if(e.exec(s))return this.trigger("data",{type:"custom",data:i(s),customType:t,segment:n}),!0}))}addTagMapper({expression:e,map:t}){this.tagMappers.push((i=>e.test(i)?t(i):i))}}const x=function(e){const t={};return Object.keys(e).forEach((function(i){var n;t[(n=i,n.toLowerCase().replace(/-(\w)/g,(e=>e[1].toUpperCase())))]=e[i]})),t},k=function(e){const{serverControl:t,targetDuration:i,partTargetDuration:n}=e;if(!t)return;const s="#EXT-X-SERVER-CONTROL",r="holdBack",a="partHoldBack",o=i&&3*i,l=n&&2*n;i&&!t.hasOwnProperty(r)&&(t[r]=o,this.trigger("info",{message:`${s} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})),o&&t[r]<o&&(this.trigger("warn",{message:`${s} clamping HOLD-BACK (${t[r]}) to targetDuration * 3 (${o})`}),t[r]=o),n&&!t.hasOwnProperty(a)&&(t[a]=3*n,this.trigger("info",{message:`${s} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${t[a]}).`})),n&&t[a]<l&&(this.trigger("warn",{message:`${s} clamping PART-HOLD-BACK (${t[a]}) to partTargetDuration * 2 (${l}).`}),t[a]=l)};class A extends _{constructor(){super(),this.lineStream=new T,this.parseStream=new C,this.lineStream.pipe(this.parseStream),this.lastProgramDateTime=null;const e=this,t=[];let i,n,s={},r=!1;const a=function(){},o={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}};let l=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],segments:[]};let c=0,u=0;const h={};this.on("end",(()=>{s.uri||!s.parts&&!s.preloadHints||(!s.map&&i&&(s.map=i),!s.key&&n&&(s.key=n),s.timeline||"number"!=typeof l||(s.timeline=l),this.manifest.preloadSegment=s)})),this.parseStream.on("data",(function(d){let p,f;({tag(){({version(){d.version&&(this.manifest.version=d.version)},"allow-cache"(){this.manifest.allowCache=d.allowed,"allowed"in d||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const e={};"length"in d&&(s.byterange=e,e.length=d.length,"offset"in d||(d.offset=c)),"offset"in d&&(s.byterange=e,e.offset=d.offset),c=e.offset+e.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),d.title&&(s.title=d.title),d.duration>0&&(s.duration=d.duration),0===d.duration&&(s.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=t},key(){if(d.attributes)if("NONE"!==d.attributes.METHOD)if(d.attributes.URI){if("com.apple.streamingkeydelivery"===d.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:d.attributes});if("com.microsoft.playready"===d.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.microsoft.playready"]={uri:d.attributes.URI});if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===d.attributes.KEYFORMAT)return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(d.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===d.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==d.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):d.attributes.KEYID&&"0x"===d.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:d.attributes.KEYFORMAT,keyId:d.attributes.KEYID.substring(2)},pssh:b(d.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}));d.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),n={method:d.attributes.METHOD||"AES-128",uri:d.attributes.URI},void 0!==d.attributes.IV&&(n.iv=d.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else n=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence"(){isFinite(d.number)?this.manifest.mediaSequence=d.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+d.number})},"discontinuity-sequence"(){isFinite(d.number)?(this.manifest.discontinuitySequence=d.number,l=d.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+d.number})},"playlist-type"(){/VOD|EVENT/.test(d.playlistType)?this.manifest.playlistType=d.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+d.playlist})},map(){i={},d.uri&&(i.uri=d.uri),d.byterange&&(i.byterange=d.byterange),n&&(i.key=n)},"stream-inf"(){this.manifest.playlists=t,this.manifest.mediaGroups=this.manifest.mediaGroups||o,d.attributes?(s.attributes||(s.attributes={}),m(s.attributes,d.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||o,!(d.attributes&&d.attributes.TYPE&&d.attributes["GROUP-ID"]&&d.attributes.NAME))return void this.trigger("warn",{message:"ignoring incomplete or missing media group"});const e=this.manifest.mediaGroups[d.attributes.TYPE];e[d.attributes["GROUP-ID"]]=e[d.attributes["GROUP-ID"]]||{},p=e[d.attributes["GROUP-ID"]],f={default:/yes/i.test(d.attributes.DEFAULT)},f.default?f.autoselect=!0:f.autoselect=/yes/i.test(d.attributes.AUTOSELECT),d.attributes.LANGUAGE&&(f.language=d.attributes.LANGUAGE),d.attributes.URI&&(f.uri=d.attributes.URI),d.attributes["INSTREAM-ID"]&&(f.instreamId=d.attributes["INSTREAM-ID"]),d.attributes.CHARACTERISTICS&&(f.characteristics=d.attributes.CHARACTERISTICS),d.attributes.FORCED&&(f.forced=/yes/i.test(d.attributes.FORCED)),p[d.attributes.NAME]=f},discontinuity(){l+=1,s.discontinuity=!0,this.manifest.discontinuityStarts.push(t.length)},"program-date-time"(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=d.dateTimeString,this.manifest.dateTimeObject=d.dateTimeObject),s.dateTimeString=d.dateTimeString,s.dateTimeObject=d.dateTimeObject;const{lastProgramDateTime:e}=this;this.lastProgramDateTime=new Date(d.dateTimeString).getTime(),null===e&&this.manifest.segments.reduceRight(((e,t)=>(t.programDateTime=e-1e3*t.duration,t.programDateTime)),this.lastProgramDateTime)},targetduration(){!isFinite(d.duration)||d.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+d.duration}):(this.manifest.targetDuration=d.duration,k.call(this,this.manifest))},start(){d.attributes&&!isNaN(d.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:d.attributes["TIME-OFFSET"],precise:d.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out"(){s.cueOut=d.data},"cue-out-cont"(){s.cueOutCont=d.data},"cue-in"(){s.cueIn=d.data},skip(){this.manifest.skip=x(d.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",d.attributes,["SKIPPED-SEGMENTS"])},part(){r=!0;const e=this.manifest.segments.length,t=x(d.attributes);s.parts=s.parts||[],s.parts.push(t),t.byterange&&(t.byterange.hasOwnProperty("offset")||(t.byterange.offset=u),u=t.byterange.offset+t.byterange.length);const i=s.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${i} for segment #${e}`,d.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(((e,t)=>{e.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${t} lacks required attribute(s): LAST-PART`})}))},"server-control"(){const e=this.manifest.serverControl=x(d.attributes);e.hasOwnProperty("canBlockReload")||(e.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),k.call(this,this.manifest),e.canSkipDateranges&&!e.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const e=this.manifest.segments.length,t=x(d.attributes),i=t.type&&"PART"===t.type;s.preloadHints=s.preloadHints||[],s.preloadHints.push(t),t.byterange&&(t.byterange.hasOwnProperty("offset")||(t.byterange.offset=i?u:0,i&&(u=t.byterange.offset+t.byterange.length)));const n=s.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${n} for segment #${e}`,d.attributes,["TYPE","URI"]),t.type)for(let i=0;i<s.preloadHints.length-1;i++){const r=s.preloadHints[i];r.type&&r.type===t.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${n} for segment #${e} has the same TYPE ${t.type} as preload hint #${i}`})}},"rendition-report"(){const e=x(d.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(e);const t=this.manifest.renditionReports.length-1,i=["LAST-MSN","URI"];r&&i.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${t}`,d.attributes,i)},"part-inf"(){this.manifest.partInf=x(d.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",d.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),k.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(x(d.attributes));const e=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${e}`,d.attributes,["ID","START-DATE"]);const t=this.manifest.dateRanges[e];t.endDate&&t.startDate&&new Date(t.endDate)<new Date(t.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),t.duration&&t.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),t.plannedDuration&&t.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});const i=!!t.endOnNext;if(i&&!t.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute"}),i&&(t.duration||t.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),t.duration&&t.endDate){const i=t.startDate.getTime()+1e3*t.duration;this.manifest.dateRanges[e].endDate=new Date(i)}if(h[t.id]){for(const e in h[t.id])if(t[e]&&JSON.stringify(h[t.id][e])!==JSON.stringify(t[e])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}const e=this.manifest.dateRanges.findIndex((e=>e.id===t.id));this.manifest.dateRanges[e]=m(this.manifest.dateRanges[e],t),h[t.id]=m(h[t.id],t),this.manifest.dateRanges.pop()}else h[t.id]=t},"independent-segments"(){this.manifest.independentSegments=!0},"content-steering"(){this.manifest.contentSteering=x(d.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",d.attributes,["SERVER-URI"])}}[d.tagType]||a).call(e)},uri(){s.uri=d.uri,t.push(s),this.manifest.targetDuration&&!("duration"in s)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),s.duration=this.manifest.targetDuration),n&&(s.key=n),s.timeline=l,i&&(s.map=i),u=0,null!==this.lastProgramDateTime&&(s.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=1e3*s.duration),s={}},comment(){},custom(){d.segment?(s.custom=s.custom||{},s.custom[d.customType]=d.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[d.customType]=d.data)}})[d.type].call(e)}))}warnOnMissingAttributes_(e,t,i){const n=[];i.forEach((function(e){t.hasOwnProperty(e)||n.push(e)})),n.length&&this.trigger("warn",{message:`${e} lacks required attribute(s): ${n.join(", ")}`})}push(e){this.lineStream.push(e)}end(){this.lineStream.push("\n"),this.manifest.dateRanges.length&&null===this.lastProgramDateTime&&this.trigger("warn",{message:"A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"}),this.lastProgramDateTime=null,this.trigger("end")}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}}var I,P,O={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^/},L=["video","audio","text"],D=["Video","Audio","Text"],R=function(e){return e?e.replace(/avc1\.(\d+)\.(\d+)/i,(function(e,t,i){return"avc1."+("00"+Number(t).toString(16)).slice(-2)+"00"+("00"+Number(i).toString(16)).slice(-2)})):e},N=function(e){void 0===e&&(e="");var t=e.split(","),i=[];return t.forEach((function(e){var t;e=e.trim(),L.forEach((function(n){var s=O[n].exec(e.toLowerCase());if(s&&!(s.length<=1)){t=n;var r=e.substring(0,s[1].length),a=e.replace(r,"");i.push({type:r,details:a,mediaType:n})}})),t||i.push({type:e,details:"",mediaType:"unknown"})})),i},M=function(e){return void 0===e&&(e=""),O.audio.test(e.trim().toLowerCase())},j=function(e){if(e&&"string"==typeof e){var t,i=e.toLowerCase().split(",").map((function(e){return R(e.trim())})),n="video";1===i.length&&M(i[0])?n="audio":1===i.length&&(void 0===(t=i[0])&&(t=""),O.text.test(t.trim().toLowerCase()))&&(n="application");var s="mp4";return i.every((function(e){return O.mp4.test(e)}))?s="mp4":i.every((function(e){return O.webm.test(e)}))?s="webm":i.every((function(e){return O.ogg.test(e)}))&&(s="ogg"),n+"/"+s+';codecs="'+e+'"'}},U=function(e){return void 0===e&&(e=""),s().MediaSource&&s().MediaSource.isTypeSupported&&s().MediaSource.isTypeSupported(j(e))||!1},B=function(e){return void 0===e&&(e=""),e.toLowerCase().split(",").every((function(e){e=e.trim();for(var t=0;t<D.length;t++)if(O["muxer"+D[t]].test(e))return!0;return!1}))},F="mp4a.40.2",q=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,$=/^application\/dash\+xml/i,H=function(e){return q.test(e)?"hls":$.test(e)?"dash":"application/vnd.videojs.vhs+json"===e?"vhs-json":null},V=function(e){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},z=function(e){return e instanceof Uint8Array?e:(Array.isArray(e)||V(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))},W=s().BigInt||Number,G=[W("0x1"),W("0x100"),W("0x10000"),W("0x1000000"),W("0x100000000"),W("0x10000000000"),W("0x1000000000000"),W("0x100000000000000"),W("0x10000000000000000")],X=(I=new Uint16Array([65484]),255===(P=new Uint8Array(I.buffer,I.byteOffset,I.byteLength))[0]||P[0],function(e,t){var i=void 0===t?{}:t,n=i.signed,s=void 0!==n&&n,r=i.le,a=void 0!==r&&r;e=z(e);var o=a?"reduce":"reduceRight",l=(e[o]?e[o]:Array.prototype[o]).call(e,(function(t,i,n){var s=a?n:Math.abs(n+1-e.length);return t+W(i)*G[s]}),W(0));if(s){var c=G[e.length]/W(2)-W(1);(l=W(l))>c&&(l-=c,l-=c,l-=W(2))}return Number(l)}),Y=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 i=new Uint8Array(e.length),n=0;n<e.length;n++)i[n]=e.charCodeAt(n);return i},K=function(e,t,i){var n=void 0===i?{}:i,s=n.offset,r=void 0===s?0:s,a=n.mask,o=void 0===a?[]:a;e=z(e);var l=(t=z(t)).every?t.every:Array.prototype.every;return t.length&&e.length-r>=t.length&&l.call(t,(function(t,i){return t===(o[i]?o[i]&e[r+i]:e[r+i])}))};var Q=i(2854);const J=e=>!!e&&"object"==typeof e,Z=(...e)=>e.reduce(((e,t)=>("object"!=typeof t||Object.keys(t).forEach((i=>{Array.isArray(e[i])&&Array.isArray(t[i])?e[i]=e[i].concat(t[i]):J(e[i])&&J(t[i])?e[i]=Z(e[i],t[i]):e[i]=t[i]})),e)),{}),ee=e=>Object.keys(e).map((t=>e[t])),te=e=>e.reduce(((e,t)=>e.concat(t)),[]),ie=e=>{if(!e.length)return[];const t=[];for(let i=0;i<e.length;i++)t.push(e[i]);return t};const ne=({baseUrl:e="",source:t="",range:i="",indexRange:n=""})=>{const r={uri:t,resolvedUri:v(e||"",t)};if(i||n){const e=(i||n).split("-");let t,a=s().BigInt?s().BigInt(e[0]):parseInt(e[0],10),o=s().BigInt?s().BigInt(e[1]):parseInt(e[1],10);a<Number.MAX_SAFE_INTEGER&&"bigint"==typeof a&&(a=Number(a)),o<Number.MAX_SAFE_INTEGER&&"bigint"==typeof o&&(o=Number(o)),t="bigint"==typeof o||"bigint"==typeof a?s().BigInt(o)-s().BigInt(a)+s().BigInt(1):o-a+1,"bigint"==typeof t&&t<Number.MAX_SAFE_INTEGER&&(t=Number(t)),r.byterange={length:t,offset:a}}return r},se=e=>(e&&"number"!=typeof e&&(e=parseInt(e,10)),isNaN(e)?null:e),re={static(e){const{duration:t,timescale:i=1,sourceDuration:n,periodDuration:s}=e,r=se(e.endNumber),a=t/i;return"number"==typeof r?{start:0,end:r}:"number"==typeof s?{start:0,end:s/a}:{start:0,end:n/a}},dynamic(e){const{NOW:t,clientOffset:i,availabilityStartTime:n,timescale:s=1,duration:r,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:l=1/0}=e,c=se(e.endNumber),u=(t+i)/1e3,h=n+a,d=u+o-h,p=Math.ceil(d*s/r),f=Math.floor((u-h-l)*s/r),m=Math.floor((u-h)*s/r);return{start:Math.max(0,f),end:"number"==typeof c?c:Math.min(p,m)}}},ae=e=>{const{type:t,duration:i,timescale:n=1,periodDuration:s,sourceDuration:r}=e,{start:a,end:o}=re[t](e),l=((e,t)=>{const i=[];for(let n=e;n<t;n++)i.push(n);return i})(a,o).map((e=>t=>{const{duration:i,timescale:n=1,periodStart:s,startNumber:r=1}=e;return{number:r+t,duration:i/n,timeline:s,time:t*i}})(e));if("static"===t){const e=l.length-1,t="number"==typeof s?s:r;l[e].duration=t-i/n*e}return l},oe=e=>{const{baseUrl:t,initialization:i={},sourceDuration:n,indexRange:s="",periodStart:r,presentationTime:a,number:o=0,duration:l}=e;if(!t)throw new Error("NO_BASE_URL");const c=ne({baseUrl:t,source:i.sourceURL,range:i.range}),u=ne({baseUrl:t,source:t,indexRange:s});if(u.map=c,l){const t=ae(e);t.length&&(u.duration=t[0].duration,u.timeline=t[0].timeline)}else n&&(u.duration=n,u.timeline=r);return u.presentationTime=a||r,u.number=o,[u]},le=(e,t,i)=>{const n=e.sidx.map?e.sidx.map:null,r=e.sidx.duration,a=e.timeline||0,o=e.sidx.byterange,l=o.offset+o.length,c=t.timescale,u=t.references.filter((e=>1!==e.referenceType)),h=[],d=e.endList?"static":"dynamic",p=e.sidx.timeline;let f,m=p,g=e.mediaSequence||0;f="bigint"==typeof t.firstOffset?s().BigInt(l)+t.firstOffset:l+t.firstOffset;for(let e=0;e<u.length;e++){const o=t.references[e],l=o.referencedSize,u=o.subsegmentDuration;let y;y="bigint"==typeof f?f+s().BigInt(l)-s().BigInt(1):f+l-1;const v=oe({baseUrl:i,timescale:c,timeline:a,periodStart:p,presentationTime:m,number:g,duration:u,sourceDuration:r,indexRange:`${f}-${y}`,type:d})[0];n&&(v.map=n),h.push(v),f+="bigint"==typeof f?s().BigInt(l):l,m+=u/c,g++}return e.segments=h,e},ce=["AUDIO","SUBTITLES"],ue=1/60,he=e=>{return(t=e,i=({timeline:e})=>e,ee(t.reduce(((e,t)=>(t.forEach((t=>{e[i(t)]=t})),e)),{}))).sort(((e,t)=>e.timeline>t.timeline?1:-1));var t,i},de=e=>{let t=[];var i,n;return i=e,n=(e,i,n,s)=>{t=t.concat(e.playlists||[])},ce.forEach((function(e){for(var t in i.mediaGroups[e])for(var s in i.mediaGroups[e][t]){var r=i.mediaGroups[e][t][s];n(r)}})),t},pe=({playlist:e,mediaSequence:t})=>{e.mediaSequence=t,e.segments.forEach(((t,i)=>{t.number=e.mediaSequence+i}))},fe=e=>e&&e.uri+"-"+(e=>{let t;return t="bigint"==typeof e.offset||"bigint"==typeof e.length?s().BigInt(e.offset)+s().BigInt(e.length)-s().BigInt(1):e.offset+e.length-1,`${e.offset}-${t}`})(e.byterange),me=e=>{const t=e.reduce((function(e,t){return e[t.attributes.baseUrl]||(e[t.attributes.baseUrl]=[]),e[t.attributes.baseUrl].push(t),e}),{});let i=[];return Object.values(t).forEach((e=>{const t=ee(e.reduce(((e,t)=>{const i=t.attributes.id+(t.attributes.lang||"");return e[i]?(t.segments&&(t.segments[0]&&(t.segments[0].discontinuity=!0),e[i].segments.push(...t.segments)),t.attributes.contentProtection&&(e[i].attributes.contentProtection=t.attributes.contentProtection)):(e[i]=t,e[i].attributes.timelineStarts=[]),e[i].attributes.timelineStarts.push({start:t.attributes.periodStart,timeline:t.attributes.periodStart}),e}),{}));i=i.concat(t)})),i.map((e=>{var t;return e.discontinuityStarts=(t=e.segments||[],"discontinuity",t.reduce(((e,t,i)=>(t.discontinuity&&e.push(i),e)),[])),e}))},ge=(e,t)=>{const i=fe(e.sidx),n=i&&t[i]&&t[i].sidx;return n&&le(e,n,e.sidx.resolvedUri),e},ye=(e,t={})=>{if(!Object.keys(t).length)return e;for(const i in e)e[i]=ge(e[i],t);return e},ve=({attributes:e,segments:t,sidx:i,discontinuityStarts:n})=>{const s={attributes:{NAME:e.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:e.width,height:e.height},CODECS:e.codecs,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1},uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuityStarts:n,timelineStarts:e.timelineStarts,segments:t};return e.frameRate&&(s.attributes["FRAME-RATE"]=e.frameRate),e.contentProtection&&(s.contentProtection=e.contentProtection),e.serviceLocation&&(s.attributes.serviceLocation=e.serviceLocation),i&&(s.sidx=i),s},_e=({attributes:e})=>"video/mp4"===e.mimeType||"video/webm"===e.mimeType||"video"===e.contentType,be=({attributes:e})=>"audio/mp4"===e.mimeType||"audio/webm"===e.mimeType||"audio"===e.contentType,Te=({attributes:e})=>"text/vtt"===e.mimeType||"text"===e.contentType,Se=e=>e?Object.keys(e).reduce(((t,i)=>{const n=e[i];return t.concat(n.playlists)}),[]):[],we=({dashPlaylists:e,locations:t,contentSteering:i,sidxMapping:n={},previousManifest:s,eventStream:r})=>{if(!e.length)return{};const{sourceDuration:a,type:o,suggestedPresentationDelay:l,minimumUpdatePeriod:c}=e[0].attributes,u=me(e.filter(_e)).map(ve),h=me(e.filter(be)),d=me(e.filter(Te)),p=e.map((e=>e.attributes.captionServices)).filter(Boolean),f={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:ye(u,n)};c>=0&&(f.minimumUpdatePeriod=1e3*c),t&&(f.locations=t),i&&(f.contentSteering=i),"dynamic"===o&&(f.suggestedPresentationDelay=l),r&&r.length>0&&(f.eventStream=r);const m=0===f.playlists.length,g=h.length?((e,t={},i=!1)=>{let n;const s=e.reduce(((e,s)=>{const r=s.attributes.role&&s.attributes.role.value||"",a=s.attributes.lang||"";let o=s.attributes.label||"main";if(a&&!s.attributes.label){const e=r?` (${r})`:"";o=`${s.attributes.lang}${e}`}e[o]||(e[o]={language:a,autoselect:!0,default:"main"===r,playlists:[],uri:""});const l=ge((({attributes:e,segments:t,sidx:i,mediaSequence:n,discontinuitySequence:s,discontinuityStarts:r},a)=>{const o={attributes:{NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs,"PROGRAM-ID":1},uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuitySequence:s,discontinuityStarts:r,timelineStarts:e.timelineStarts,mediaSequence:n,segments:t};return e.contentProtection&&(o.contentProtection=e.contentProtection),e.serviceLocation&&(o.attributes.serviceLocation=e.serviceLocation),i&&(o.sidx=i),a&&(o.attributes.AUDIO="audio",o.attributes.SUBTITLES="subs"),o})(s,i),t);return e[o].playlists.push(l),void 0===n&&"main"===r&&(n=s,n.default=!0),e}),{});return n||(s[Object.keys(s)[0]].default=!0),s})(h,n,m):null,y=d.length?((e,t={})=>e.reduce(((e,i)=>{const n=i.attributes.label||i.attributes.lang||"text";return e[n]||(e[n]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),e[n].playlists.push(ge((({attributes:e,segments:t,mediaSequence:i,discontinuityStarts:n,discontinuitySequence:s})=>{void 0===t&&(t=[{uri:e.baseUrl,timeline:e.periodStart,resolvedUri:e.baseUrl||"",duration:e.sourceDuration,number:0}],e.duration=e.sourceDuration);const r={NAME:e.id,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1};e.codecs&&(r.CODECS=e.codecs);const a={attributes:r,uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,timelineStarts:e.timelineStarts,discontinuityStarts:n,discontinuitySequence:s,mediaSequence:i,segments:t};return e.serviceLocation&&(a.attributes.serviceLocation=e.serviceLocation),a})(i),t)),e}),{}))(d,n):null,v=u.concat(Se(g),Se(y)),_=v.map((({timelineStarts:e})=>e));var b,T;return f.timelineStarts=he(_),b=v,T=f.timelineStarts,b.forEach((e=>{e.mediaSequence=0,e.discontinuitySequence=T.findIndex((function({timeline:t}){return t===e.timeline})),e.segments&&e.segments.forEach(((e,t)=>{e.number=t}))})),g&&(f.mediaGroups.AUDIO.audio=g),y&&(f.mediaGroups.SUBTITLES.subs=y),p.length&&(f.mediaGroups["CLOSED-CAPTIONS"].cc=p.reduce(((e,t)=>t?(t.forEach((t=>{const{channel:i,language:n}=t;e[n]={autoselect:!1,default:!1,instreamId:i,language:n},t.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[n].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[n]["3D"]=t["3D"])})),e):e),{})),s?(({oldManifest:e,newManifest:t})=>{const i=e.playlists.concat(de(e)),n=t.playlists.concat(de(t));return t.timelineStarts=he([e.timelineStarts,t.timelineStarts]),(({oldPlaylists:e,newPlaylists:t,timelineStarts:i})=>{t.forEach((t=>{t.discontinuitySequence=i.findIndex((function({timeline:e}){return e===t.timeline}));const n=((e,t)=>{for(let i=0;i<e.length;i++)if(e[i].attributes.NAME===t)return e[i];return null})(e,t.attributes.NAME);if(!n)return;if(t.sidx)return;const s=t.segments[0],r=n.segments.findIndex((function(e){return Math.abs(e.presentationTime-s.presentationTime)<ue}));if(-1===r)return pe({playlist:t,mediaSequence:n.mediaSequence+n.segments.length}),t.segments[0].discontinuity=!0,t.discontinuityStarts.unshift(0),void((!n.segments.length&&t.timeline>n.timeline||n.segments.length&&t.timeline>n.segments[n.segments.length-1].timeline)&&t.discontinuitySequence--);n.segments[r].discontinuity&&!s.discontinuity&&(s.discontinuity=!0,t.discontinuityStarts.unshift(0),t.discontinuitySequence--),pe({playlist:t,mediaSequence:n.segments[r].number})}))})({oldPlaylists:i,newPlaylists:n,timelineStarts:t.timelineStarts}),t})({oldManifest:s,newManifest:f}):f},Ee=(e,t,i)=>{const{NOW:n,clientOffset:s,availabilityStartTime:r,timescale:a=1,periodStart:o=0,minimumUpdatePeriod:l=0}=e,c=(n+s)/1e3+l-(r+o);return Math.ceil((c*a-t)/i)},Ce=(e,t)=>{const{type:i,minimumUpdatePeriod:n=0,media:s="",sourceDuration:r,timescale:a=1,startNumber:o=1,periodStart:l}=e,c=[];let u=-1;for(let h=0;h<t.length;h++){const d=t[h],p=d.d,f=d.r||0,m=d.t||0;let g;if(u<0&&(u=m),m&&m>u&&(u=m),f<0){const o=h+1;g=o===t.length?"dynamic"===i&&n>0&&s.indexOf("$Number$")>0?Ee(e,u,p):(r*a-u)/p:(t[o].t-u)/p}else g=f+1;const y=o+c.length+g;let v=o+c.length;for(;v<y;)c.push({number:v,duration:p/a,time:u,timeline:l}),u+=p,v++}return c},xe=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,ke=(e,t)=>e.replace(xe,(e=>(t,i,n,s)=>{if("$$"===t)return"$";if(void 0===e[i])return t;const r=""+e[i];return"RepresentationID"===i?r:(s=n?parseInt(s,10):1,r.length>=s?r:`${new Array(s-r.length+1).join("0")}${r}`)})(t)),Ae=(e,t)=>{const i={RepresentationID:e.id,Bandwidth:e.bandwidth||0},{initialization:n={sourceURL:"",range:""}}=e,s=ne({baseUrl:e.baseUrl,source:ke(n.sourceURL,i),range:n.range}),r=((e,t)=>e.duration||t?e.duration?ae(e):Ce(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}])(e,t);return r.map((t=>{i.Number=t.number,i.Time=t.time;const n=ke(e.media||"",i),r=e.timescale||1,a=e.presentationTimeOffset||0,o=e.periodStart+(t.time-a)/r;return{uri:n,timeline:t.timeline,duration:t.duration,resolvedUri:v(e.baseUrl||"",n),map:s,number:t.number,presentationTime:o}}))},Ie=(e,t)=>{const{duration:i,segmentUrls:n=[],periodStart:s}=e;if(!i&&!t||i&&t)throw new Error("SEGMENT_TIME_UNSPECIFIED");const r=n.map((t=>((e,t)=>{const{baseUrl:i,initialization:n={}}=e,s=ne({baseUrl:i,source:n.sourceURL,range:n.range}),r=ne({baseUrl:i,source:t.media,range:t.mediaRange});return r.map=s,r})(e,t)));let a;return i&&(a=ae(e)),t&&(a=Ce(e,t)),a.map(((t,i)=>{if(r[i]){const n=r[i],a=e.timescale||1,o=e.presentationTimeOffset||0;return n.timeline=t.timeline,n.duration=t.duration,n.number=t.number,n.presentationTime=s+(t.time-o)/a,n}})).filter((e=>e))},Pe=({attributes:e,segmentInfo:t})=>{let i,n;t.template?(n=Ae,i=Z(e,t.template)):t.base?(n=oe,i=Z(e,t.base)):t.list&&(n=Ie,i=Z(e,t.list));const s={attributes:e};if(!n)return s;const r=n(i,t.segmentTimeline);if(i.duration){const{duration:e,timescale:t=1}=i;i.duration=e/t}else r.length?i.duration=r.reduce(((e,t)=>Math.max(e,Math.ceil(t.duration))),0):i.duration=0;return s.attributes=i,s.segments=r,t.base&&i.indexRange&&(s.sidx=r[0],s.segments=[]),s},Oe=(e,t)=>ie(e.childNodes).filter((({tagName:e})=>e===t)),Le=e=>e.textContent.trim(),De=e=>{const t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t)return 0;const[i,n,s,r,a,o]=t.slice(1);return 31536e3*parseFloat(i||0)+2592e3*parseFloat(n||0)+86400*parseFloat(s||0)+3600*parseFloat(r||0)+60*parseFloat(a||0)+parseFloat(o||0)},Re={mediaPresentationDuration:e=>De(e),availabilityStartTime(e){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t=e)&&(t+="Z"),Date.parse(t)/1e3;var t},minimumUpdatePeriod:e=>De(e),suggestedPresentationDelay:e=>De(e),type:e=>e,timeShiftBufferDepth:e=>De(e),start:e=>De(e),width:e=>parseInt(e,10),height:e=>parseInt(e,10),bandwidth:e=>parseInt(e,10),frameRate:e=>(e=>parseFloat(e.split("/").reduce(((e,t)=>e/t))))(e),startNumber:e=>parseInt(e,10),timescale:e=>parseInt(e,10),presentationTimeOffset:e=>parseInt(e,10),duration(e){const t=parseInt(e,10);return isNaN(t)?De(e):t},d:e=>parseInt(e,10),t:e=>parseInt(e,10),r:e=>parseInt(e,10),presentationTime:e=>parseInt(e,10),DEFAULT:e=>e},Ne=e=>e&&e.attributes?ie(e.attributes).reduce(((e,t)=>{const i=Re[t.name]||Re.DEFAULT;return e[t.name]=i(t.value),e}),{}):{},Me={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},je=(e,t)=>t.length?te(e.map((function(e){return t.map((function(t){const i=Le(t),n=v(e.baseUrl,i),s=Z(Ne(t),{baseUrl:n});return n!==i&&!s.serviceLocation&&e.serviceLocation&&(s.serviceLocation=e.serviceLocation),s}))}))):e,Ue=e=>{const t=Oe(e,"SegmentTemplate")[0],i=Oe(e,"SegmentList")[0],n=i&&Oe(i,"SegmentURL").map((e=>Z({tag:"SegmentURL"},Ne(e)))),s=Oe(e,"SegmentBase")[0],r=i||t,a=r&&Oe(r,"SegmentTimeline")[0],o=i||s||t,l=o&&Oe(o,"Initialization")[0],c=t&&Ne(t);c&&l?c.initialization=l&&Ne(l):c&&c.initialization&&(c.initialization={sourceURL:c.initialization});const u={template:c,segmentTimeline:a&&Oe(a,"S").map((e=>Ne(e))),list:i&&Z(Ne(i),{segmentUrls:n,initialization:Ne(l)}),base:s&&Z(Ne(s),{initialization:Ne(l)})};return Object.keys(u).forEach((e=>{u[e]||delete u[e]})),u},Be=e=>te(Oe(e.node,"EventStream").map((t=>{const i=Ne(t),n=i.schemeIdUri;return Oe(t,"Event").map((t=>{const s=Ne(t),r=s.presentationTime||0,a=i.timescale||1,o=s.duration||0,l=r/a+e.attributes.start;return{schemeIdUri:n,value:i.value,id:s.id,start:l,end:l+o/a,messageData:Le(t)||s.messageData,contentEncoding:i.contentEncoding,presentationTimeOffset:i.presentationTimeOffset||0}}))}))),Fe=(e,t,i)=>n=>{const r=Ne(n),a=je(t,Oe(n,"BaseURL")),o=Oe(n,"Role")[0],l={role:Ne(o)};let c=Z(e,r,l);const u=Oe(n,"Accessibility")[0],h="urn:scte:dash:cc:cea-608:2015"===(d=Ne(u)).schemeIdUri?("string"!=typeof d.value?[]:d.value.split(";")).map((e=>{let t,i;return i=e,/^CC\d=/.test(e)?[t,i]=e.split("="):/^CC\d$/.test(e)&&(t=e),{channel:t,language:i}})):"urn:scte:dash:cc:cea-708:2015"===d.schemeIdUri?("string"!=typeof d.value?[]:d.value.split(";")).map((e=>{const t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){const[i,n=""]=e.split("=");t.channel=i,t.language=e,n.split(",").forEach((e=>{const[i,n]=e.split(":");"lang"===i?t.language=n:"er"===i?t.easyReader=Number(n):"war"===i?t.aspectRatio=Number(n):"3D"===i&&(t["3D"]=Number(n))}))}else t.language=e;return t.channel&&(t.channel="SERVICE"+t.channel),t})):void 0;var d;h&&(c=Z(c,{captionServices:h}));const p=Oe(n,"Label")[0];if(p&&p.childNodes.length){const e=p.childNodes[0].nodeValue.trim();c=Z(c,{label:e})}const f=Oe(n,"ContentProtection").reduce(((e,t)=>{const i=Ne(t);i.schemeIdUri&&(i.schemeIdUri=i.schemeIdUri.toLowerCase());const n=Me[i.schemeIdUri];if(n){e[n]={attributes:i};const r=Oe(t,"cenc:pssh")[0];if(r){const t=Le(r);e[n].pssh=t&&function(e){for(var t,i=(t=e,s().atob?s().atob(t):Buffer.from(t,"base64").toString("binary")),n=new Uint8Array(i.length),r=0;r<i.length;r++)n[r]=i.charCodeAt(r);return n}(t)}}return e}),{});Object.keys(f).length&&(c=Z(c,{contentProtection:f}));const m=Ue(n),g=Oe(n,"Representation"),y=Z(i,m);return te(g.map(((e,t,i)=>n=>{const s=Oe(n,"BaseURL"),r=je(t,s),a=Z(e,Ne(n)),o=Ue(n);return r.map((e=>({segmentInfo:Z(i,o),attributes:Z(a,e)})))})(c,a,y)))},qe=(e,t)=>(i,n)=>{const s=je(t,Oe(i.node,"BaseURL")),r=Z(e,{periodStart:i.attributes.start});"number"==typeof i.attributes.duration&&(r.periodDuration=i.attributes.duration);const a=Oe(i.node,"AdaptationSet"),o=Ue(i.node);return te(a.map(Fe(r,s,o)))},$e=(e,t)=>{if(e.length>1&&t({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!e.length)return null;const i=Z({serverURL:Le(e[0])},Ne(e[0]));return i.queryBeforeStart="true"===i.queryBeforeStart,i},He=e=>{if(""===e)throw new Error("DASH_EMPTY_MANIFEST");const t=new Q.DOMParser;let i,n;try{i=t.parseFromString(e,"application/xml"),n=i&&"MPD"===i.documentElement.tagName?i.documentElement:null}catch(e){}if(!n||n&&n.getElementsByTagName("parsererror").length>0)throw new Error("DASH_INVALID_XML");return n};var Ve,ze=i(9910),We=i.n(ze),Ge=z([73,68,51]),Xe=function e(t,i){return void 0===i&&(i=0),(t=z(t)).length-i<10||!K(t,Ge,{offset:i})?i:(i+=function(e,t){void 0===t&&(t=0);var i=(e=z(e))[t+5],n=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&i)>>4?n+20:n+10}(t,i),e(t,i))},Ye=(new Uint8Array([79,112,117,115,72,101,97,100]),function(e){return"string"==typeof e?Y(e):e}),Ke=function(e){e=z(e);for(var t=[],i=0;e.length>i;){var n=e[i],s=0,r=0,a=e[++r];for(r++;128&a;)s=(127&a)<<7,a=e[r],r++;s+=127&a;for(var o=0;o<Ve.length;o++){var l=Ve[o],c=l.id,u=l.parser;if(n===c){t.push(u(e.subarray(r,r+s)));break}}i+=s+r}return t};Ve=[{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 i=e[t.size];t.url=function(e){if(!e)return"";e=Array.prototype.slice.call(e);var t=String.fromCharCode.apply(null,z(e));try{return decodeURIComponent(escape(t))}catch(e){}return t}(e.subarray(t.size+1,t.size+1+i)),t.size+=i}return 32&t.flags&&(t.ocrEsId=e[t.size]<<8|e[t.size+1],t.size+=2),t.descriptors=Ke(e.subarray(t.size))||[],t}},{id:4,parser:function(e){return{tag:4,oti:e[0],streamType:e[1],bufferSize:e[2]<<16|e[3]<<8|e[4],maxBitrate:e[5]<<24|e[6]<<16|e[7]<<8|e[8],avgBitrate:e[9]<<24|e[10]<<16|e[11]<<8|e[12],descriptors:Ke(e.subarray(13))}}},{id:5,parser:function(e){return{tag:5,bytes:e}}},{id:6,parser:function(e){return{tag:6,bytes:e}}}];var Qe=function e(t,i,n){void 0===n&&(n=!1),i=function(e){return Array.isArray(e)?e.map((function(e){return Ye(e)})):[Ye(e)]}(i),t=z(t);var s=[];if(!i.length)return s;for(var r=0;r<t.length;){var a=(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3])>>>0,o=t.subarray(r+4,r+8);if(0===a)break;var l=r+a;if(l>t.length){if(n)break;l=t.length}var c=t.subarray(r+8,l);K(o,i[0])&&(1===i.length?s.push(c):s.push.apply(s,e(c,i.slice(1),n))),r=l}return s},Je={EBML:z([26,69,223,163]),DocType:z([66,130]),Segment:z([24,83,128,103]),SegmentInfo:z([21,73,169,102]),Tracks:z([22,84,174,107]),Track:z([174]),TrackNumber:z([215]),DefaultDuration:z([35,227,131]),TrackEntry:z([174]),TrackType:z([131]),FlagDefault:z([136]),CodecID:z([134]),CodecPrivate:z([99,162]),VideoTrack:z([224]),AudioTrack:z([225]),Cluster:z([31,67,182,117]),Timestamp:z([231]),TimestampScale:z([42,215,177]),BlockGroup:z([160]),BlockDuration:z([155]),Block:z([161]),SimpleBlock:z([163])},Ze=[128,64,32,16,8,4,2,1],et=function(e,t,i,n){void 0===i&&(i=!0),void 0===n&&(n=!1);var s=function(e){for(var t=1,i=0;i<Ze.length&&!(e&Ze[i]);i++)t++;return t}(e[t]),r=e.subarray(t,t+s);return i&&((r=Array.prototype.slice.call(e,t,t+s))[0]^=Ze[s-1]),{length:s,value:X(r,{signed:n}),bytes:r}},tt=function e(t){return"string"==typeof t?t.match(/.{1,2}/g).map((function(t){return e(t)})):"number"==typeof t?function(e,t){var i=(void 0===t?{}:t).le,n=void 0!==i&&i;("bigint"!=typeof e&&"number"!=typeof e||"number"==typeof e&&e!=e)&&(e=0);for(var s,r=(s=e=W(e),Math.ceil(function(e){return e.toString(2).length}(s)/8)),a=new Uint8Array(new ArrayBuffer(r)),o=0;o<r;o++){var l=n?o:Math.abs(o+1-a.length);a[l]=Number(e/G[o]&W(255)),e<0&&(a[l]=Math.abs(~a[l]),a[l]-=0===o?1:2)}return a}(t):t},it=function e(t,i,n){if(n>=i.length)return i.length;var s=et(i,n,!1);if(K(t.bytes,s.bytes))return n;var r=et(i,n+s.length);return e(t,i,n+r.length+r.value+s.length)},nt=function e(t,i){i=function(e){return Array.isArray(e)?e.map((function(e){return tt(e)})):[tt(e)]}(i),t=z(t);var n=[];if(!i.length)return n;for(var s=0;s<t.length;){var r=et(t,s,!1),a=et(t,s+r.length),o=s+r.length+a.length;127===a.value&&(a.value=it(r,t,o),a.value!==t.length&&(a.value-=o));var l=o+a.value>t.length?t.length:o+a.value,c=t.subarray(o,l);K(i[0],r.bytes)&&(1===i.length?n.push(c):n=n.concat(e(c,i.slice(1)))),s+=r.length+a.length+c.length}return n},st=z([0,0,0,1]),rt=z([0,0,1]),at=z([0,0,3]),ot=function(e){for(var t=[],i=1;i<e.length-2;)K(e.subarray(i,i+3),at)&&(t.push(i+2),i++),i++;if(0===t.length)return e;var n=e.length-t.length,s=new Uint8Array(n),r=0;for(i=0;i<n;r++,i++)r===t[0]&&(r++,t.shift()),s[i]=e[r];return s},lt=function(e,t,i,n){void 0===n&&(n=1/0),e=z(e),i=[].concat(i);for(var s,r=0,a=0;r<e.length&&(a<n||s);){var o=void 0;if(K(e.subarray(r),st)?o=4:K(e.subarray(r),rt)&&(o=3),o){if(a++,s)return ot(e.subarray(s,r));var l=void 0;"h264"===t?l=31&e[r+o]:"h265"===t&&(l=e[r+o]>>1&63),-1!==i.indexOf(l)&&(s=r+o),r+=o+("h264"===t?1:2)}else r++}return e.subarray(0,0)},ct={webm:z([119,101,98,109]),matroska:z([109,97,116,114,111,115,107,97]),flac:z([102,76,97,67]),ogg:z([79,103,103,83]),ac3:z([11,119]),riff:z([82,73,70,70]),avi:z([65,86,73]),wav:z([87,65,86,69]),"3gp":z([102,116,121,112,51,103]),mp4:z([102,116,121,112]),fmp4:z([115,116,121,112]),mov:z([102,116,121,112,113,116]),moov:z([109,111,111,118]),moof:z([109,111,111,102])},ut={aac:function(e){var t=Xe(e);return K(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Xe(e);return K(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=nt(e,[Je.EBML,Je.DocType])[0];return K(t,ct.webm)},mkv:function(e){var t=nt(e,[Je.EBML,Je.DocType])[0];return K(t,ct.matroska)},mp4:function(e){return!ut["3gp"](e)&&!ut.mov(e)&&(!(!K(e,ct.mp4,{offset:4})&&!K(e,ct.fmp4,{offset:4}))||!(!K(e,ct.moof,{offset:4})&&!K(e,ct.moov,{offset:4}))||void 0)},mov:function(e){return K(e,ct.mov,{offset:4})},"3gp":function(e){return K(e,ct["3gp"],{offset:4})},ac3:function(e){var t=Xe(e);return K(e,ct.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return 71===e[0];for(var t=0;t+188<e.length&&t<188;){if(71===e[t]&&71===e[t+188])return!0;t+=1}return!1},flac:function(e){var t=Xe(e);return K(e,ct.flac,{offset:t})},ogg:function(e){return K(e,ct.ogg)},avi:function(e){return K(e,ct.riff)&&K(e,ct.avi,{offset:8})},wav:function(e){return K(e,ct.riff)&&K(e,ct.wav,{offset:8})},h264:function(e){return function(e,t,i){return lt(e,"h264",7,3)}(e).length},h265:function(e){return function(e,t,i){return lt(e,"h265",[32,33],3)}(e).length}},ht=Object.keys(ut).filter((function(e){return"ts"!==e&&"h264"!==e&&"h265"!==e})).concat(["ts","h264","h265"]);ht.forEach((function(e){var t=ut[e];ut[e]=function(e){return t(z(e))}}));var dt=ut,pt=function(e){e=z(e);for(var t=0;t<ht.length;t++){var i=ht[t];if(dt[i](e))return i}return""},ft=i(6946),mt="8.11.8";const gt={},yt=function(e,t){return gt[e]=gt[e]||[],t&&(gt[e]=gt[e].concat(t)),gt[e]},vt=function(e,t){const i=yt(e).indexOf(t);return!(i<=-1||(gt[e]=gt[e].slice(),gt[e].splice(i,1),0))},_t={prefixed:!0},bt=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],Tt=bt[0];let St;for(let e=0;e<bt.length;e++)if(bt[e][1]in a()){St=bt[e];break}if(St){for(let e=0;e<St.length;e++)_t[Tt[e]]=St[e];_t.prefixed=St[0]!==Tt[0]}let wt=[];const Et=function e(t,i=":",n=""){let r,a="info";const o=function(...e){r("log",a,e)};return r=((e,t,i)=>(n,r,a)=>{const o=t.levels[r],l=new RegExp(`^(${o})$`);let c=e;if("log"!==n&&a.unshift(n.toUpperCase()+":"),i&&(c=`%c${e}`,a.unshift(i)),a.unshift(c+":"),wt){wt.push([].concat(a));const e=wt.length-1e3;wt.splice(0,e>0?e:0)}if(!s().console)return;let u=s().console[n];u||"debug"!==n||(u=s().console.info||s().console.log),u&&o&&l.test(n)&&u[Array.isArray(a)?"apply":"call"](s().console,a)})(t,o,n),o.createLogger=(s,r,a)=>{const o=void 0!==r?r:i;return e(`${t} ${o} ${s}`,o,void 0!==a?a:n)},o.createNewLogger=(t,i,n)=>e(t,i,n),o.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:a},o.level=e=>{if("string"==typeof e){if(!o.levels.hasOwnProperty(e))throw new Error(`"${e}" in not a valid log level`);a=e}return a},(o.history=()=>wt?[].concat(wt):[]).filter=e=>(wt||[]).filter((t=>new RegExp(`.*${e}.*`).test(t[0]))),o.history.clear=()=>{wt&&(wt.length=0)},o.history.disable=()=>{null!==wt&&(wt.length=0,wt=null)},o.history.enable=()=>{null===wt&&(wt=[])},o.error=(...e)=>r("error",a,e),o.warn=(...e)=>r("warn",a,e),o.debug=(...e)=>r("debug",a,e),o}("VIDEOJS"),Ct=Et.createLogger,xt=Object.prototype.toString,kt=function(e){return Pt(e)?Object.keys(e):[]};function At(e,t){kt(e).forEach((i=>t(e[i],i)))}function It(e,t,i=0){return kt(e).reduce(((i,n)=>t(i,e[n],n)),i)}function Pt(e){return!!e&&"object"==typeof e}function Ot(e){return Pt(e)&&"[object Object]"===xt.call(e)&&e.constructor===Object}function Lt(...e){const t={};return e.forEach((e=>{e&&At(e,((e,i)=>{Ot(e)?(Ot(t[i])||(t[i]={}),t[i]=Lt(t[i],e)):t[i]=e}))})),t}function Dt(e={}){const t=[];for(const i in e)if(e.hasOwnProperty(i)){const n=e[i];t.push(n)}return t}function Rt(e,t,i,n=!0){const s=i=>Object.defineProperty(e,t,{value:i,enumerable:!0,writable:!0}),r={configurable:!0,enumerable:!0,get(){const e=i();return s(e),e}};return n&&(r.set=s),Object.defineProperty(e,t,r)}var Nt=Object.freeze({__proto__:null,each:At,reduce:It,isObject:Pt,isPlain:Ot,merge:Lt,values:Dt,defineLazyProperty:Rt});let Mt,jt=!1,Ut=null,Bt=!1,Ft=!1,qt=!1,$t=!1,Ht=!1,Vt=null,zt=null,Wt=null,Gt=!1,Xt=!1,Yt=!1,Kt=!1,Qt=!1,Jt=!1;const Zt=Boolean(ri()&&("ontouchstart"in s()||s().navigator.maxTouchPoints||s().DocumentTouch&&s().document instanceof s().DocumentTouch)),ei=s().navigator&&s().navigator.userAgentData;if(ei&&ei.platform&&ei.brands&&(Bt="Android"===ei.platform,qt=Boolean(ei.brands.find((e=>"Microsoft Edge"===e.brand))),$t=Boolean(ei.brands.find((e=>"Chromium"===e.brand))),Ht=!qt&&$t,Vt=zt=(ei.brands.find((e=>"Chromium"===e.brand))||{}).version||null,Xt="Windows"===ei.platform),!$t){const e=s().navigator&&s().navigator.userAgent||"";jt=/iPod/i.test(e),Ut=function(){const t=e.match(/OS (\d+)_/i);return t&&t[1]?t[1]:null}(),Bt=/Android/i.test(e),Mt=function(){const t=e.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!t)return null;const i=t[1]&&parseFloat(t[1]),n=t[2]&&parseFloat(t[2]);return i&&n?parseFloat(t[1]+"."+t[2]):i||null}(),Ft=/Firefox/i.test(e),qt=/Edg/i.test(e),$t=/Chrome/i.test(e)||/CriOS/i.test(e),Ht=!qt&&$t,Vt=zt=function(){const t=e.match(/(Chrome|CriOS)\/(\d+)/);return t&&t[2]?parseFloat(t[2]):null}(),Wt=function(){const t=/MSIE\s(\d+)\.\d/.exec(e);let i=t&&parseFloat(t[1]);return!i&&/Trident\/7.0/i.test(e)&&/rv:11.0/.test(e)&&(i=11),i}(),Qt=/Tizen/i.test(e),Jt=/Web0S/i.test(e),Gt=/Safari/i.test(e)&&!Ht&&!Bt&&!qt&&!Qt&&!Jt,Xt=/Windows/i.test(e),Yt=/iPad/i.test(e)||Gt&&Zt&&!/iPhone/i.test(e),Kt=/iPhone/i.test(e)&&!Yt}const ti=Kt||Yt||jt,ii=(Gt||ti)&&!Ht;var ni=Object.freeze({__proto__:null,get IS_IPOD(){return jt},get IOS_VERSION(){return Ut},get IS_ANDROID(){return Bt},get ANDROID_VERSION(){return Mt},get IS_FIREFOX(){return Ft},get IS_EDGE(){return qt},get IS_CHROMIUM(){return $t},get IS_CHROME(){return Ht},get CHROMIUM_VERSION(){return Vt},get CHROME_VERSION(){return zt},get IE_VERSION(){return Wt},get IS_SAFARI(){return Gt},get IS_WINDOWS(){return Xt},get IS_IPAD(){return Yt},get IS_IPHONE(){return Kt},get IS_TIZEN(){return Qt},get IS_WEBOS(){return Jt},TOUCH_ENABLED:Zt,IS_IOS:ti,IS_ANY_SAFARI:ii});function si(e){return"string"==typeof e&&Boolean(e.trim())}function ri(){return a()===s().document}function ai(e){return Pt(e)&&1===e.nodeType}function oi(){try{return s().parent!==s().self}catch(e){return!0}}function li(e){return function(t,i){if(!si(t))return a()[e](null);si(i)&&(i=a().querySelector(i));const n=ai(i)?i:a();return n[e]&&n[e](t)}}function ci(e="div",t={},i={},n){const s=a().createElement(e);return Object.getOwnPropertyNames(t).forEach((function(e){const i=t[e];"textContent"===e?ui(s,i):s[e]===i&&"tabIndex"!==e||(s[e]=i)})),Object.getOwnPropertyNames(i).forEach((function(e){s.setAttribute(e,i[e])})),n&&Ii(s,n),s}function ui(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function hi(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function di(e,t){return function(e){if(e.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}(t),e.classList.contains(t)}function pi(e,...t){return e.classList.add(...t.reduce(((e,t)=>e.concat(t.split(/\s+/))),[])),e}function fi(e,...t){return e?(e.classList.remove(...t.reduce(((e,t)=>e.concat(t.split(/\s+/))),[])),e):(Et.warn("removeClass was called with an element that doesn't exist"),null)}function mi(e,t,i){return"function"==typeof i&&(i=i(e,t)),"boolean"!=typeof i&&(i=void 0),t.split(/\s+/).forEach((t=>e.classList.toggle(t,i))),e}function gi(e,t){Object.getOwnPropertyNames(t).forEach((function(i){const n=t[i];null==n||!1===n?e.removeAttribute(i):e.setAttribute(i,!0===n?"":n)}))}function yi(e){const t={},i=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(e&&e.attributes&&e.attributes.length>0){const n=e.attributes;for(let e=n.length-1;e>=0;e--){const s=n[e].name;let r=n[e].value;i.includes(s)&&(r=null!==r),t[s]=r}}return t}function vi(e,t){return e.getAttribute(t)}function _i(e,t,i){e.setAttribute(t,i)}function bi(e,t){e.removeAttribute(t)}function Ti(){a().body.focus(),a().onselectstart=function(){return!1}}function Si(){a().onselectstart=function(){return!0}}function wi(e){if(e&&e.getBoundingClientRect&&e.parentNode){const t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach((e=>{void 0!==t[e]&&(i[e]=t[e])})),i.height||(i.height=parseFloat(Ri(e,"height"))),i.width||(i.width=parseFloat(Ri(e,"width"))),i}}function Ei(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};const t=e.offsetWidth,i=e.offsetHeight;let n=0,s=0;for(;e.offsetParent&&e!==a()[_t.fullscreenElement];)n+=e.offsetLeft,s+=e.offsetTop,e=e.offsetParent;return{left:n,top:s,width:t,height:i}}function Ci(e,t){const i={x:0,y:0};if(ti){let t=e;for(;t&&"html"!==t.nodeName.toLowerCase();){const e=Ri(t,"transform");if(/^matrix/.test(e)){const t=e.slice(7,-1).split(/,\s/).map(Number);i.x+=t[4],i.y+=t[5]}else if(/^matrix3d/.test(e)){const t=e.slice(9,-1).split(/,\s/).map(Number);i.x+=t[12],i.y+=t[13]}t=t.parentNode}}const n={},s=Ei(t.target),r=Ei(e),a=r.width,o=r.height;let l=t.offsetY-(r.top-s.top),c=t.offsetX-(r.left-s.left);return t.changedTouches&&(c=t.changedTouches[0].pageX-r.left,l=t.changedTouches[0].pageY+r.top,ti&&(c-=i.x,l-=i.y)),n.y=1-Math.max(0,Math.min(1,l/o)),n.x=Math.max(0,Math.min(1,c/a)),n}function xi(e){return Pt(e)&&3===e.nodeType}function ki(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function Ai(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map((e=>("function"==typeof e&&(e=e()),ai(e)||xi(e)?e:"string"==typeof e&&/\S/.test(e)?a().createTextNode(e):void 0))).filter((e=>e))}function Ii(e,t){return Ai(t).forEach((t=>e.appendChild(t))),e}function Pi(e,t){return Ii(ki(e),t)}function Oi(e){return void 0===e.button&&void 0===e.buttons||0===e.button&&void 0===e.buttons||"mouseup"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons}const Li=li("querySelector"),Di=li("querySelectorAll");function Ri(e,t){if(!e||!t)return"";if("function"==typeof s().getComputedStyle){let i;try{i=s().getComputedStyle(e)}catch(e){return""}return i?i.getPropertyValue(t)||i[t]:""}return""}function Ni(e){[...a().styleSheets].forEach((t=>{try{const i=[...t.cssRules].map((e=>e.cssText)).join(""),n=a().createElement("style");n.textContent=i,e.document.head.appendChild(n)}catch(i){const n=a().createElement("link");n.rel="stylesheet",n.type=t.type,n.media=t.media.mediaText,n.href=t.href,e.document.head.appendChild(n)}}))}var Mi=Object.freeze({__proto__:null,isReal:ri,isEl:ai,isInFrame:oi,createEl:ci,textContent:ui,prependTo:hi,hasClass:di,addClass:pi,removeClass:fi,toggleClass:mi,setAttributes:gi,getAttributes:yi,getAttribute:vi,setAttribute:_i,removeAttribute:bi,blockTextSelection:Ti,unblockTextSelection:Si,getBoundingClientRect:wi,findPosition:Ei,getPointerPosition:Ci,isTextNode:xi,emptyEl:ki,normalizeContent:Ai,appendContent:Ii,insertContent:Pi,isSingleLeftClick:Oi,$:Li,$$:Di,computedStyle:Ri,copyStyleSheetsToWindow:Ni});let ji,Ui=!1;const Bi=function(){if(!1===ji.options.autoSetup)return;const e=Array.prototype.slice.call(a().getElementsByTagName("video")),t=Array.prototype.slice.call(a().getElementsByTagName("audio")),i=Array.prototype.slice.call(a().getElementsByTagName("video-js")),n=e.concat(t,i);if(n&&n.length>0)for(let e=0,t=n.length;e<t;e++){const t=n[e];if(!t||!t.getAttribute){Fi(1);break}void 0===t.player&&null!==t.getAttribute("data-setup")&&ji(t)}else Ui||Fi(1)};function Fi(e,t){ri()&&(t&&(ji=t),s().setTimeout(Bi,e))}function qi(){Ui=!0,s().removeEventListener("load",qi)}ri()&&("complete"===a().readyState?qi():s().addEventListener("load",qi));const $i=function(e){const t=a().createElement("style");return t.className=e,t},Hi=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t};var Vi=new WeakMap;let zi,Wi=3;function Gi(){return Wi++}function Xi(e,t){if(!Vi.has(e))return;const i=Vi.get(e);0===i.handlers[t].length&&(delete i.handlers[t],e.removeEventListener?e.removeEventListener(t,i.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,i.dispatcher)),Object.getOwnPropertyNames(i.handlers).length<=0&&(delete i.handlers,delete i.dispatcher,delete i.disabled),0===Object.getOwnPropertyNames(i).length&&Vi.delete(e)}function Yi(e,t,i,n){i.forEach((function(i){e(t,i,n)}))}function Ki(e){if(e.fixed_)return e;function t(){return!0}function i(){return!1}if(!e||!e.isPropagationStopped||!e.isImmediatePropagationStopped){const n=e||s().event;e={};for(const t in n)"layerX"!==t&&"layerY"!==t&&"keyLocation"!==t&&"webkitMovementX"!==t&&"webkitMovementY"!==t&&"path"!==t&&("returnValue"===t&&n.preventDefault||(e[t]=n[t]));if(e.target||(e.target=e.srcElement||a()),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){n.preventDefault&&n.preventDefault(),e.returnValue=!1,n.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){n.stopPropagation&&n.stopPropagation(),e.cancelBubble=!0,n.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=i,e.stopImmediatePropagation=function(){n.stopImmediatePropagation&&n.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=i,null!==e.clientX&&void 0!==e.clientX){const t=a().documentElement,i=a().body;e.pageX=e.clientX+(t&&t.scrollLeft||i&&i.scrollLeft||0)-(t&&t.clientLeft||i&&i.clientLeft||0),e.pageY=e.clientY+(t&&t.scrollTop||i&&i.scrollTop||0)-(t&&t.clientTop||i&&i.clientTop||0)}e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e.fixed_=!0,e}const Qi=function(){if("boolean"!=typeof zi){zi=!1;try{const e=Object.defineProperty({},"passive",{get(){zi=!0}});s().addEventListener("test",null,e),s().removeEventListener("test",null,e)}catch(e){}}return zi},Ji=["touchstart","touchmove"];function Zi(e,t,i){if(Array.isArray(t))return Yi(Zi,e,t,i);Vi.has(e)||Vi.set(e,{});const n=Vi.get(e);if(n.handlers||(n.handlers={}),n.handlers[t]||(n.handlers[t]=[]),i.guid||(i.guid=Gi()),n.handlers[t].push(i),n.dispatcher||(n.disabled=!1,n.dispatcher=function(t,i){if(n.disabled)return;t=Ki(t);const s=n.handlers[t.type];if(s){const n=s.slice(0);for(let s=0,r=n.length;s<r&&!t.isImmediatePropagationStopped();s++)try{n[s].call(e,t,i)}catch(e){Et.error(e)}}}),1===n.handlers[t].length)if(e.addEventListener){let i=!1;Qi()&&Ji.indexOf(t)>-1&&(i={passive:!0}),e.addEventListener(t,n.dispatcher,i)}else e.attachEvent&&e.attachEvent("on"+t,n.dispatcher)}function en(e,t,i){if(!Vi.has(e))return;const n=Vi.get(e);if(!n.handlers)return;if(Array.isArray(t))return Yi(en,e,t,i);const s=function(e,t){n.handlers[t]=[],Xi(e,t)};if(void 0===t){for(const t in n.handlers)Object.prototype.hasOwnProperty.call(n.handlers||{},t)&&s(e,t);return}const r=n.handlers[t];if(r)if(i){if(i.guid)for(let e=0;e<r.length;e++)r[e].guid===i.guid&&r.splice(e--,1);Xi(e,t)}else s(e,t)}function tn(e,t,i){const n=Vi.has(e)?Vi.get(e):{},s=e.parentNode||e.ownerDocument;if("string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=Ki(t),n.dispatcher&&n.dispatcher.call(e,t,i),s&&!t.isPropagationStopped()&&!0===t.bubbles)tn.call(null,s,t,i);else if(!s&&!t.defaultPrevented&&t.target&&t.target[t.type]){Vi.has(t.target)||Vi.set(t.target,{});const e=Vi.get(t.target);t.target[t.type]&&(e.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),e.disabled=!1)}return!t.defaultPrevented}function nn(e,t,i){if(Array.isArray(t))return Yi(nn,e,t,i);const n=function(){en(e,t,n),i.apply(this,arguments)};n.guid=i.guid=i.guid||Gi(),Zi(e,t,n)}function sn(e,t,i){const n=function(){en(e,t,n),i.apply(this,arguments)};n.guid=i.guid=i.guid||Gi(),Zi(e,t,n)}var rn=Object.freeze({__proto__:null,fixEvent:Ki,on:Zi,off:en,trigger:tn,one:nn,any:sn});const an=30,on=function(e,t,i){t.guid||(t.guid=Gi());const n=t.bind(e);return n.guid=i?i+"_"+t.guid:t.guid,n},ln=function(e,t){let i=s().performance.now();return function(...n){const r=s().performance.now();r-i>=t&&(e(...n),i=r)}},cn=function(e,t,i,n=s()){let r;const a=function(){const s=this,a=arguments;let o=function(){r=null,o=null,i||e.apply(s,a)};!r&&i&&e.apply(s,a),n.clearTimeout(r),r=n.setTimeout(o,t)};return a.cancel=()=>{n.clearTimeout(r),r=null},a};var un=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:an,bind_:on,throttle:ln,debounce:cn});let hn;class dn{on(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Zi(this,e,t),this.addEventListener=i}off(e,t){en(this,e,t)}one(e,t){const i=this.addEventListener;this.addEventListener=()=>{},nn(this,e,t),this.addEventListener=i}any(e,t){const i=this.addEventListener;this.addEventListener=()=>{},sn(this,e,t),this.addEventListener=i}trigger(e){const t=e.type||e;"string"==typeof e&&(e={type:t}),e=Ki(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),tn(this,e)}queueTrigger(e){hn||(hn=new Map);const t=e.type||e;let i=hn.get(this);i||(i=new Map,hn.set(this,i));const n=i.get(t);i.delete(t),s().clearTimeout(n);const r=s().setTimeout((()=>{i.delete(t),0===i.size&&(i=null,hn.delete(this)),this.trigger(e)}),0);i.set(t,r)}}dn.prototype.allowedEvents_={},dn.prototype.addEventListener=dn.prototype.on,dn.prototype.removeEventListener=dn.prototype.off,dn.prototype.dispatchEvent=dn.prototype.trigger;const pn=e=>"function"==typeof e.name?e.name():"string"==typeof e.name?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e,fn=e=>e instanceof dn||!!e.eventBusEl_&&["on","one","off","trigger"].every((t=>"function"==typeof e[t])),mn=e=>"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length,gn=(e,t,i)=>{if(!e||!e.nodeName&&!fn(e))throw new Error(`Invalid target for ${pn(t)}#${i}; must be a DOM node or evented object.`)},yn=(e,t,i)=>{if(!mn(e))throw new Error(`Invalid event type for ${pn(t)}#${i}; must be a non-empty string or array.`)},vn=(e,t,i)=>{if("function"!=typeof e)throw new Error(`Invalid listener for ${pn(t)}#${i}; must be a function.`)},_n=(e,t,i)=>{const n=t.length<3||t[0]===e||t[0]===e.eventBusEl_;let s,r,a;return n?(s=e.eventBusEl_,t.length>=3&&t.shift(),[r,a]=t):[s,r,a]=t,gn(s,e,i),yn(r,e,i),vn(a,e,i),a=on(e,a),{isTargetingSelf:n,target:s,type:r,listener:a}},bn=(e,t,i,n)=>{gn(e,e,t),e.nodeName?rn[t](e,i,n):e[t](i,n)},Tn={on(...e){const{isTargetingSelf:t,target:i,type:n,listener:s}=_n(this,e,"on");if(bn(i,"on",n,s),!t){const e=()=>this.off(i,n,s);e.guid=s.guid;const t=()=>this.off("dispose",e);t.guid=s.guid,bn(this,"on","dispose",e),bn(i,"on","dispose",t)}},one(...e){const{isTargetingSelf:t,target:i,type:n,listener:s}=_n(this,e,"one");if(t)bn(i,"one",n,s);else{const e=(...t)=>{this.off(i,n,e),s.apply(null,t)};e.guid=s.guid,bn(i,"one",n,e)}},any(...e){const{isTargetingSelf:t,target:i,type:n,listener:s}=_n(this,e,"any");if(t)bn(i,"any",n,s);else{const e=(...t)=>{this.off(i,n,e),s.apply(null,t)};e.guid=s.guid,bn(i,"any",n,e)}},off(e,t,i){if(!e||mn(e))en(this.eventBusEl_,e,t);else{const n=e,s=t;gn(n,this,"off"),yn(s,this,"off"),vn(i,this,"off"),i=on(this,i),this.off("dispose",i),n.nodeName?(en(n,s,i),en(n,"dispose",i)):fn(n)&&(n.off(s,i),n.off("dispose",i))}},trigger(e,t){gn(this.eventBusEl_,this,"trigger");const i=e&&"string"!=typeof e?e.type:e;if(!mn(i))throw new Error(`Invalid event type for ${pn(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return tn(this.eventBusEl_,e,t)}};function Sn(e,t={}){const{eventBusKey:i}=t;if(i){if(!e[i].nodeName)throw new Error(`The eventBusKey "${i}" does not refer to an element.`);e.eventBusEl_=e[i]}else e.eventBusEl_=ci("span",{className:"vjs-event-bus"});return Object.assign(e,Tn),e.eventedCallbacks&&e.eventedCallbacks.forEach((e=>{e()})),e.on("dispose",(()=>{e.off(),[e,e.el_,e.eventBusEl_].forEach((function(e){e&&Vi.has(e)&&Vi.delete(e)})),s().setTimeout((()=>{e.eventBusEl_=null}),0)})),e}const wn={state:{},setState(e){let t;return"function"==typeof e&&(e=e()),At(e,((e,i)=>{this.state[i]!==e&&(t=t||{},t[i]={from:this.state[i],to:e}),this.state[i]=e})),t&&fn(this)&&this.trigger({changes:t,type:"statechanged"}),t}};function En(e,t){return Object.assign(e,wn),e.state=Object.assign({},e.state,t),"function"==typeof e.handleStateChanged&&fn(e)&&e.on("statechanged",e.handleStateChanged),e}const Cn=function(e){return"string"!=typeof e?e:e.replace(/./,(e=>e.toLowerCase()))},xn=function(e){return"string"!=typeof e?e:e.replace(/./,(e=>e.toUpperCase()))},kn=function(e,t){return xn(e)===xn(t)};var An=Object.freeze({__proto__:null,toLowerCase:Cn,toTitleCase:xn,titleCaseEquals:kn});class In{constructor(e,t,i){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=Lt({},this.options_),t=this.options_=Lt(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const t=e&&e.id&&e.id()||"no_player";this.id_=`${t}_component_${Gi()}`}this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach((e=>this.addClass(e))),["on","off","one","any","trigger"].forEach((e=>{this[e]=void 0})),!1!==t.evented&&(Sn(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),En(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,!1!==t.initChildren&&this.initChildren(),this.ready(i),!1!==t.reportTouchActivity&&this.enableTouchActivity()}on(e,t){}off(e,t){}one(e,t){}any(e,t){}trigger(e,t){}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let e=this.children_.length-1;e>=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return Boolean(this.isDisposed_)}player(){return this.player_}options(e){return e?(this.options_=Lt(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,i){return ci(e,t,i)}localize(e,t,i=e){const n=this.player_.language&&this.player_.language(),s=this.player_.languages&&this.player_.languages(),r=s&&s[n],a=n&&n.split("-")[0],o=s&&s[a];let l=i;return r&&r[e]?l=r[e]:o&&o[e]&&(l=o[e]),t&&(l=l.replace(/\{(\d+)\}/g,(function(e,i){const n=t[i-1];let s=n;return void 0===n&&(s=e),s}))),l}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce(((e,t)=>e.concat(t)),[]);let t=this;for(let i=0;i<e.length;i++)if(t=t.getChild(e[i]),!t||!t.getChild)return;return t}setIcon(e,t=this.el()){if(!this.player_.options_.experimentalSvgIcons)return;const i="http://www.w3.org/2000/svg",n=ci("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),s=a().createElementNS(i,"svg");s.setAttributeNS(null,"viewBox","0 0 512 512");const r=a().createElementNS(i,"use");return s.appendChild(r),r.setAttributeNS(null,"href",`#vjs-icon-${e}`),n.appendChild(s),this.iconIsSet_?t.replaceChild(n,t.querySelector(".vjs-icon-placeholder")):t.appendChild(n),this.iconIsSet_=!0,n}addChild(e,t={},i=this.children_.length){let n,s;if("string"==typeof e){s=xn(e);const i=t.componentClass||s;t.name=s;const r=In.getComponent(i);if(!r)throw new Error(`Component ${i} does not exist`);if("function"!=typeof r)return null;n=new r(this.player_||this,t)}else n=e;if(n.parentComponent_&&n.parentComponent_.removeChild(n),this.children_.splice(i,0,n),n.parentComponent_=this,"function"==typeof n.id&&(this.childIndex_[n.id()]=n),s=s||n.name&&xn(n.name()),s&&(this.childNameIndex_[s]=n,this.childNameIndex_[Cn(s)]=n),"function"==typeof n.el&&n.el()){let e=null;this.children_[i+1]&&(this.children_[i+1].el_?e=this.children_[i+1].el_:ai(this.children_[i+1])&&(e=this.children_[i+1])),this.contentEl().insertBefore(n.el(),e)}return n}removeChild(e){if("string"==typeof e&&(e=this.getChild(e)),!e||!this.children_)return;let t=!1;for(let i=this.children_.length-1;i>=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[xn(e.name())]=null,this.childNameIndex_[Cn(e.name())]=null;const i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,i=e=>{const i=e.name;let n=e.opts;if(void 0!==t[i]&&(n=t[i]),!1===n)return;!0===n&&(n={}),n.playerOptions=this.options_.playerOptions;const s=this.addChild(i,n);s&&(this[i]=s)};let n;const s=In.getComponent("Tech");n=Array.isArray(e)?e:Object.keys(e),n.concat(Object.keys(this.options_).filter((function(e){return!n.some((function(t){return"string"==typeof t?e===t:e===t.name}))}))).map((t=>{let i,n;return"string"==typeof t?(i=t,n=e[i]||this.options_[i]||{}):(i=t.name,n=t),{name:i,opts:n}})).filter((e=>{const t=In.getComponent(e.opts.componentClass||xn(e.name));return t&&!s.isTech(t)})).forEach(i)}}buildCSSClass(){return""}ready(e,t=!1){if(e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))}triggerReady(){this.isReady_=!0,this.setTimeout((function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach((function(e){e.call(this)}),this),this.trigger("ready")}),1)}$(e,t){return Li(e,t||this.contentEl())}$$(e,t){return Di(e,t||this.contentEl())}hasClass(e){return di(this.el_,e)}addClass(...e){pi(this.el_,...e)}removeClass(...e){fi(this.el_,...e)}toggleClass(e,t){mi(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return vi(this.el_,e)}setAttribute(e,t){_i(this.el_,e,t)}removeAttribute(e){bi(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,i){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(i||this.trigger("componentresize"));if(!this.el_)return 0;const n=this.el_.style[e],s=n.indexOf("px");return-1!==s?parseInt(n.slice(0,s),10):parseInt(this.el_["offset"+xn(e)],10)}currentDimension(e){let t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if(t=Ri(this.el_,e),t=parseFloat(t),0===t||isNaN(t)){const i=`offset${xn(e)}`;t=this.el_[i]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(l().isEventKey(e,"Tab")||e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e,t=0,i=null;this.on("touchstart",(function(n){1===n.touches.length&&(i={pageX:n.touches[0].pageX,pageY:n.touches[0].pageY},t=s().performance.now(),e=!0)})),this.on("touchmove",(function(t){if(t.touches.length>1)e=!1;else if(i){const n=t.touches[0].pageX-i.pageX,s=t.touches[0].pageY-i.pageY;Math.sqrt(n*n+s*s)>10&&(e=!1)}}));const n=function(){e=!1};this.on("touchleave",n),this.on("touchcancel",n),this.on("touchend",(function(n){i=null,!0===e&&s().performance.now()-t<200&&(n.preventDefault(),this.trigger("tap"))}))}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const e=on(this.player(),this.player().reportUserActivity);let t;this.on("touchstart",(function(){e(),this.clearInterval(t),t=this.setInterval(e,250)}));const i=function(i){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",i),this.on("touchcancel",i)}setTimeout(e,t){var i;return e=on(this,e),this.clearTimersOnDispose_(),i=s().setTimeout((()=>{this.setTimeoutIds_.has(i)&&this.setTimeoutIds_.delete(i),e()}),t),this.setTimeoutIds_.add(i),i}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),s().clearTimeout(e)),e}setInterval(e,t){e=on(this,e),this.clearTimersOnDispose_();const i=s().setInterval(e,t);return this.setIntervalIds_.add(i),i}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),s().clearInterval(e)),e}requestAnimationFrame(e){var t;return this.clearTimersOnDispose_(),e=on(this,e),t=s().requestAnimationFrame((()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()})),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){if(this.namedRafs_.has(e))return;this.clearTimersOnDispose_(),t=on(this,t);const i=this.requestAnimationFrame((()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)}));return this.namedRafs_.set(e,i),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),s().cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",(()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach((([e,t])=>{this[e].forEach(((e,i)=>this[t](i)))})),this.clearingTimersOnDispose_=!1})))}static registerComponent(e,t){if("string"!=typeof e||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const i=In.getComponent("Tech"),n=i&&i.isTech(t),s=In===t||In.prototype.isPrototypeOf(t.prototype);if(n||!s){let t;throw t=n?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error(`Illegal component, "${e}"; ${t}.`)}e=xn(e),In.components_||(In.components_={});const r=In.getComponent("Player");if("Player"===e&&r&&r.players){const e=r.players,t=Object.keys(e);if(e&&t.length>0&&t.map((t=>e[t])).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return In.components_[e]=t,In.components_[Cn(e)]=t,t}static getComponent(e){if(e&&In.components_)return In.components_[e]}}function Pn(e,t,i,n){return function(e,t,i){if("number"!=typeof t||t<0||t>i)throw new Error(`Failed to execute '${e}' on 'TimeRanges': The index provided (${t}) is non-numeric or out of bounds (0-${i}).`)}(e,n,i.length-1),i[n][t]}function On(e){let t;return t=void 0===e||0===e.length?{length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:Pn.bind(null,"start",0,e),end:Pn.bind(null,"end",1,e)},s().Symbol&&s().Symbol.iterator&&(t[s().Symbol.iterator]=()=>(e||[]).values()),t}function Ln(e,t){return Array.isArray(e)?On(e):void 0===e||void 0===t?On():On([[e,t]])}In.registerComponent("Component",In);const Dn=function(e,t){e=e<0?0:e;let i=Math.floor(e%60),n=Math.floor(e/60%60),s=Math.floor(e/3600);const r=Math.floor(t/60%60),a=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(s=n=i="-"),s=s>0||a>0?s+":":"",n=((s||r>=10)&&n<10?"0"+n:n)+":",i=i<10?"0"+i:i,s+n+i};let Rn=Dn;function Nn(e){Rn=e}function Mn(){Rn=Dn}function jn(e,t=e){return Rn(e,t)}var Un=Object.freeze({__proto__:null,createTimeRanges:Ln,createTimeRange:Ln,setFormatTime:Nn,resetFormatTime:Mn,formatTime:jn});function Bn(e,t){let i,n,s=0;if(!t)return 0;e&&e.length||(e=Ln(0,0));for(let r=0;r<e.length;r++)i=e.start(r),n=e.end(r),n>t&&(n=t),s+=n-i;return s/t}function Fn(e){if(e instanceof Fn)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:Pt(e)&&("number"==typeof e.code&&(this.code=e.code),Object.assign(this,e)),this.message||(this.message=Fn.defaultMessages[this.code]||"")}function qn(e){return null!=e&&"function"==typeof e.then}function $n(e){qn(e)&&e.then(null,(e=>{}))}Fn.prototype.code=0,Fn.prototype.message="",Fn.prototype.status=null,Fn.prototype.metadata=null,Fn.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Fn.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."},Fn.MEDIA_ERR_CUSTOM=0,Fn.prototype.MEDIA_ERR_CUSTOM=0,Fn.MEDIA_ERR_ABORTED=1,Fn.prototype.MEDIA_ERR_ABORTED=1,Fn.MEDIA_ERR_NETWORK=2,Fn.prototype.MEDIA_ERR_NETWORK=2,Fn.MEDIA_ERR_DECODE=3,Fn.prototype.MEDIA_ERR_DECODE=3,Fn.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Fn.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Fn.MEDIA_ERR_ENCRYPTED=5,Fn.prototype.MEDIA_ERR_ENCRYPTED=5;const Hn=function(e){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(((t,i,n)=>(e[i]&&(t[i]=e[i]),t)),{cues:e.cues&&Array.prototype.map.call(e.cues,(function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}}))})};const Vn="vjs-modal-dialog";class zn extends In{constructor(e,t){super(e,t),this.handleKeyDown_=e=>this.handleKeyDown(e),this.close_=e=>this.close(e),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=ci("div",{className:`${Vn}-content`},{role:"document"}),this.descEl_=ci("p",{className:`${Vn}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),ui(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${Vn} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_)return void(this.options_.fillAlways&&this.fill());const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return"boolean"==typeof e&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if("boolean"==typeof e){const t=this.closeable_=!!e;let i=this.getChild("closeButton");if(t&&!i){const e=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=e,this.on(i,"close",this.close_)}!t&&i&&(this.off(i,"close",this.close_),this.removeChild(i),i.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),i=t.parentNode,n=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),Pi(t,e),this.trigger("modalfill"),n?i.insertBefore(t,n):i.appendChild(t);const s=this.getChild("closeButton");s&&i.appendChild(s.el_)}empty(){this.trigger("beforemodalempty"),ki(this.contentEl()),this.trigger("modalempty")}content(e){return void 0!==e&&(this.content_=e),this.content_}conditionalFocus_(){const e=a().activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(e.stopPropagation(),l().isEventKey(e,"Escape")&&this.closeable())return e.preventDefault(),void this.close();if(!l().isEventKey(e,"Tab"))return;const t=this.focusableEls_(),i=this.el_.querySelector(":focus");let n;for(let e=0;e<t.length;e++)if(i===t[e]){n=e;break}a().activeElement===this.el_&&(n=0),e.shiftKey&&0===n?(t[t.length-1].focus(),e.preventDefault()):e.shiftKey||n!==t.length-1||(t[0].focus(),e.preventDefault())}focusableEls_(){const e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,(e=>(e instanceof s().HTMLAnchorElement||e instanceof s().HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof s().HTMLInputElement||e instanceof s().HTMLSelectElement||e instanceof s().HTMLTextAreaElement||e instanceof s().HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof s().HTMLIFrameElement||e instanceof s().HTMLObjectElement||e instanceof s().HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable")))}}zn.prototype.options_={pauseOnOpen:!0,temporary:!0},In.registerComponent("ModalDialog",zn);class Wn extends dn{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t<e.length;t++)this.addTrack(e[t])}addTrack(e){const t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.tracks_[t]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=()=>{this.trigger({track:e,type:"labelchange",target:this})},fn(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let i=0,n=this.length;i<n;i++)if(this[i]===e){t=this[i],t.off&&t.off(),this.tracks_.splice(i,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})}getTrackById(e){let t=null;for(let i=0,n=this.length;i<n;i++){const n=this[i];if(n.id===e){t=n;break}}return t}}Wn.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const e in Wn.prototype.allowedEvents_)Wn.prototype["on"+e]=null;const Gn=function(e,t){for(let i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].enabled=!1)},Xn=function(e,t){for(let i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].selected=!1)};class Yn extends Wn{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),-1===["metadata","chapters"].indexOf(e.kind)&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}}class Kn{constructor(e){Kn.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){const t=this.length||0;let i=0;const n=e.length;this.cues_=e,this.length_=e.length;const s=function(e){""+e in this||Object.defineProperty(this,""+e,{get(){return this.cues_[e]}})};if(t<n)for(i=t;i<n;i++)s.call(this,i)}getCueById(e){let t=null;for(let i=0,n=this.length;i<n;i++){const n=this[i];if(n.id===e){t=n;break}}return t}}const Qn={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},Jn={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},Zn={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},es={disabled:"disabled",hidden:"hidden",showing:"showing"};class ts extends dn{constructor(e={}){super();const t={id:e.id||"vjs_track_"+Gi(),kind:e.kind||"",language:e.language||""};let i=e.label||"";for(const e in t)Object.defineProperty(this,e,{get:()=>t[e],set(){}});Object.defineProperty(this,"label",{get:()=>i,set(e){e!==i&&(i=e,this.trigger("labelchange"))}})}}const is=function(e){const t=["protocol","hostname","port","pathname","search","hash","host"],i=a().createElement("a");i.href=e;const n={};for(let e=0;e<t.length;e++)n[t[e]]=i[t[e]];return"http:"===n.protocol&&(n.host=n.host.replace(/:80$/,"")),"https:"===n.protocol&&(n.host=n.host.replace(/:443$/,"")),n.protocol||(n.protocol=s().location.protocol),n.host||(n.host=s().location.host),n},ns=function(e){if(!e.match(/^https?:\/\//)){const t=a().createElement("a");t.href=e,e=t.href}return e},ss=function(e){if("string"==typeof e){const t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e);if(t)return t.pop().toLowerCase()}return""},rs=function(e,t=s().location){const i=is(e);return(":"===i.protocol?t.protocol:i.protocol)+i.host!==t.protocol+t.host};var as=Object.freeze({__proto__:null,parseUrl:is,getAbsoluteURL:ns,getFileExtension:ss,isCrossOrigin:rs});const os=function(e,t){const i=new(s().WebVTT.Parser)(s(),s().vttjs,s().WebVTT.StringDecoder()),n=[];i.oncue=function(e){t.addCue(e)},i.onparsingerror=function(e){n.push(e)},i.onflush=function(){t.trigger({type:"loadeddata",target:t})},i.parse(e),n.length>0&&(s().console&&s().console.groupCollapsed&&s().console.groupCollapsed(`Text Track parsing errors for ${t.src}`),n.forEach((e=>Et.error(e))),s().console&&s().console.groupEnd&&s().console.groupEnd()),i.flush()},ls=function(e,t){const i={uri:e},n=rs(e);n&&(i.cors=n);const r="use-credentials"===t.tech_.crossOrigin();r&&(i.withCredentials=r),d()(i,on(this,(function(e,i,n){if(e)return Et.error(e,i);t.loaded_=!0,"function"!=typeof s().WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],(e=>{if("vttjserror"!==e.type)return os(n,t);Et.error(`vttjs failed to load, stopping trying to process ${t.src}`)})):os(n,t)})))};class cs extends ts{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=Lt(e,{kind:Zn[e.kind]||"subtitles",language:e.language||e.srclang||""});let i=es[t.mode]||"disabled";const n=t.default;"metadata"!==t.kind&&"chapters"!==t.kind||(i="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=!1!==this.tech_.preloadTextTracks;const s=new Kn(this.cues_),r=new Kn(this.activeCues_);let a=!1;this.timeupdateHandler=on(this,(function(e={}){this.tech_.isDisposed()||(this.tech_.isReady_?(this.activeCues=this.activeCues,a&&(this.trigger("cuechange"),a=!1),"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))):"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)))})),this.tech_.one("dispose",(()=>{this.stopTracking()})),"disabled"!==i&&this.startTracking(),Object.defineProperties(this,{default:{get:()=>n,set(){}},mode:{get:()=>i,set(e){es[e]&&i!==e&&(i=e,this.preload_||"disabled"===i||0!==this.cues.length||ls(this.src,this),this.stopTracking(),"disabled"!==i&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?s:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(0===this.cues.length)return r;const e=this.tech_.currentTime(),t=[];for(let i=0,n=this.cues.length;i<n;i++){const n=this.cues[i];n.startTime<=e&&n.endTime>=e&&t.push(n)}if(a=!1,t.length!==this.activeCues_.length)a=!0;else for(let e=0;e<t.length;e++)-1===this.activeCues_.indexOf(t[e])&&(a=!0);return this.activeCues_=t,r.setCues_(this.activeCues_),r},set(){}}}),t.src?(this.src=t.src,this.preload_||(this.loaded_=!0),(this.preload_||"subtitles"!==t.kind&&"captions"!==t.kind)&&ls(this.src,this)):this.loaded_=!0}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)}stopTracking(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)}addCue(e){let t=e;if(!("getCueAsHTML"in t)){t=new(s().vttjs.VTTCue)(e.startTime,e.endTime,e.text);for(const i in e)i in t||(t[i]=e[i]);t.id=e.id,t.originalCue_=e}const i=this.tech_.textTracks();for(let e=0;e<i.length;e++)i[e]!==this&&i[e].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}removeCue(e){let t=this.cues_.length;for(;t--;){const i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}}cs.prototype.allowedEvents_={cuechange:"cuechange"};class us extends ts{constructor(e={}){const t=Lt(e,{kind:Jn[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"enabled",{get:()=>i,set(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}}class hs extends ts{constructor(e={}){const t=Lt(e,{kind:Qn[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"selected",{get:()=>i,set(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}}class ds extends dn{constructor(e={}){let t;super();const i=new cs(e);this.kind=i.kind,this.src=i.src,this.srclang=i.language,this.label=i.label,this.default=i.default,Object.defineProperties(this,{readyState:{get:()=>t},track:{get:()=>i}}),t=ds.NONE,i.addEventListener("loadeddata",(()=>{t=ds.LOADED,this.trigger({type:"load",target:this})}))}}ds.prototype.allowedEvents_={load:"load"},ds.NONE=0,ds.LOADING=1,ds.LOADED=2,ds.ERROR=3;const ps={audio:{ListClass:class extends Wn{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){Gn(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&Gn(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,Gn(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}},TrackClass:us,capitalName:"Audio"},video:{ListClass:class extends Wn{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){Xn(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set(){}})}addTrack(e){e.selected&&Xn(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,Xn(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}},TrackClass:hs,capitalName:"Video"},text:{ListClass:Yn,TrackClass:cs,capitalName:"Text"}};Object.keys(ps).forEach((function(e){ps[e].getterName=`${e}Tracks`,ps[e].privateName=`${e}Tracks_`}));const fs={remoteText:{ListClass:Yn,TrackClass:cs,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:class{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,i=e.length;t<i;t++)this.addTrackElement_(e[t])}addTrackElement_(e){const t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.trackElements_[t]}}),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)}getTrackElementByTrack_(e){let t;for(let i=0,n=this.trackElements_.length;i<n;i++)if(e===this.trackElements_[i].track){t=this.trackElements_[i];break}return t}removeTrackElement_(e){for(let t=0,i=this.trackElements_.length;t<i;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&"function"==typeof this.trackElements_[t].track.off&&this.trackElements_[t].track.off(),"function"==typeof this.trackElements_[t].off&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}}},TrackClass:ds,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},ms=Object.assign({},ps,fs);fs.names=Object.keys(fs),ps.names=Object.keys(ps),ms.names=[].concat(fs.names).concat(ps.names);class gs extends In{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=e=>this.onDurationChange(e),this.trackProgress_=e=>this.trackProgress(e),this.trackCurrentTime_=e=>this.trackCurrentTime(e),this.stopTrackingCurrentTime_=e=>this.stopTrackingCurrentTime(e),this.disposeSourceHandler_=e=>this.disposeSourceHandler(e),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",(function(){this.hasStarted_=!0})),this.on("loadstart",(function(){this.hasStarted_=!1})),ms.names.forEach((t=>{const i=ms[t];e&&e[i.getterName]&&(this[i.privateName]=e[i.getterName])})),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach((t=>{!1===e[`native${t}Tracks`]&&(this[`featuresNative${t}Tracks`]=!1)})),!1===e.nativeCaptions||!1===e.nativeTextTracks?this.featuresNativeTextTracks=!1:!0!==e.nativeCaptions&&!0!==e.nativeTextTracks||(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=!1!==e.preloadTextTracks,this.autoRemoteTextTracks_=new ms.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",(()=>this.setTimeout((()=>this.triggerSourceset(e)),1))),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(on(this,(function(){const e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()})),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return Ln(0,0)}bufferedPercent(){return Bn(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval((function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}),250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(ps.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){(e=[].concat(e)).forEach((e=>{const t=this[`${e}Tracks`]()||[];let i=t.length;for(;i--;){const n=t[i];"text"===e&&this.removeRemoteTextTrack(n),t.removeTrack(n)}}))}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const i=e[t];this.removeRemoteTextTrack(i)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return void 0!==e&&(this.error_=new Fn(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?Ln(0,0):Ln()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){ps.names.forEach((e=>{const t=ps[e],i=()=>{this.trigger(`${e}trackchange`)},n=this[t.getterName]();n.addEventListener("removetrack",i),n.addEventListener("addtrack",i),this.on("dispose",(()=>{n.removeEventListener("removetrack",i),n.removeEventListener("addtrack",i)}))}))}addWebVttScript_(){if(!s().WebVTT)if(a().body.contains(this.el())){if(!this.options_["vtt.js"]&&Ot(f())&&Object.keys(f()).length>0)return void this.trigger("vttjsloaded");const e=a().createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",(()=>{e.onload=null,e.onerror=null})),s().WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),i=t=>e.addTrack(t.track),n=t=>e.removeTrack(t.track);t.on("addtrack",i),t.on("removetrack",n),this.addWebVttScript_();const s=()=>this.trigger("texttrackchange"),r=()=>{s();for(let t=0;t<e.length;t++){const i=e[t];i.removeEventListener("cuechange",s),"showing"===i.mode&&i.addEventListener("cuechange",s)}};r(),e.addEventListener("change",r),e.addEventListener("addtrack",r),e.addEventListener("removetrack",r),this.on("dispose",(function(){t.off("addtrack",i),t.off("removetrack",n),e.removeEventListener("change",r),e.removeEventListener("addtrack",r),e.removeEventListener("removetrack",r);for(let t=0;t<e.length;t++)e[t].removeEventListener("cuechange",s)}))}addTextTrack(e,t,i){if(!e)throw new Error("TextTrack kind is required but was not provided");return function(e,t,i,n,s={}){const r=e.textTracks();s.kind=t,i&&(s.label=i),n&&(s.language=n),s.tech=e;const a=new ms.text.TrackClass(s);return r.addTrack(a),a}(this,e,t,i)}createRemoteTextTrack(e){const t=Lt(e,{tech:this});return new fs.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){const i=this.createRemoteTextTrack(e);return"boolean"!=typeof t&&(t=!1),this.remoteTextTrackEls().addTrackElement_(i),this.remoteTextTracks().addTrack(i.track),!1===t&&this.ready((()=>this.autoRemoteTextTracks_.addTrack(i.track))),i}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=Gi();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",(()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())}))):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return gs.canPlayType(e.type)}static isTech(e){return e.prototype instanceof gs||e instanceof gs||e===gs}static registerTech(e,t){if(gs.techs_||(gs.techs_={}),!gs.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!gs.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!gs.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=xn(e),gs.techs_[e]=t,gs.techs_[Cn(e)]=t,"Tech"!==e&&gs.defaultTechOrder_.push(e),t}static getTech(e){if(e)return gs.techs_&&gs.techs_[e]?gs.techs_[e]:(e=xn(e),s()&&s().videojs&&s().videojs[e]?(Et.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),s().videojs[e]):void 0)}}ms.names.forEach((function(e){const t=ms[e];gs.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}})),gs.prototype.featuresVolumeControl=!0,gs.prototype.featuresMuteControl=!0,gs.prototype.featuresFullscreenResize=!1,gs.prototype.featuresPlaybackRate=!1,gs.prototype.featuresProgressEvents=!1,gs.prototype.featuresSourceset=!1,gs.prototype.featuresTimeupdateEvents=!1,gs.prototype.featuresNativeTextTracks=!1,gs.prototype.featuresVideoFrameCallback=!1,gs.withSourceHandlers=function(e){e.registerSourceHandler=function(t,i){let n=e.sourceHandlers;n||(n=e.sourceHandlers=[]),void 0===i&&(i=n.length),n.splice(i,0,t)},e.canPlayType=function(t){const i=e.sourceHandlers||[];let n;for(let e=0;e<i.length;e++)if(n=i[e].canPlayType(t),n)return n;return""},e.selectSourceHandler=function(t,i){const n=e.sourceHandlers||[];let s;for(let e=0;e<n.length;e++)if(s=n[e].canHandleSource(t,i),s)return n[e];return null},e.canPlaySource=function(t,i){const n=e.selectSourceHandler(t,i);return n?n.canHandleSource(t,i):""},["seekable","seeking","duration"].forEach((function(e){const t=this[e];"function"==typeof t&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})}),e.prototype),e.prototype.setSource=function(t){let i=e.selectSourceHandler(t,this.options_);i||(e.nativeSourceHandler?i=e.nativeSourceHandler:Et.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),i!==e.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=i.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)}},In.registerComponent("Tech",gs),gs.registerTech("Tech",gs),gs.defaultTechOrder_=[];const ys={},vs={},_s={};function bs(e,t,i){e.setTimeout((()=>xs(t,ys[t.type],i,e)),1)}function Ts(e,t,i,n=null){const s="call"+xn(i),r=e.reduce(Cs(s),n),a=r===_s,o=a?null:t[i](r);return function(e,t,i,n){for(let s=e.length-1;s>=0;s--){const r=e[s];r[t]&&r[t](n,i)}}(e,i,o,a),o}const Ss={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},ws={setCurrentTime:1,setMuted:1,setVolume:1},Es={play:1,pause:1};function Cs(e){return(t,i)=>t===_s?_s:i[e]?i[e](t):t}function xs(e={},t=[],i,n,s=[],r=!1){const[a,...o]=t;if("string"==typeof a)xs(e,ys[a],i,n,s,r);else if(a){const t=function(e,t){const i=vs[e.id()];let n=null;if(null==i)return n=t(e),vs[e.id()]=[[t,n]],n;for(let e=0;e<i.length;e++){const[s,r]=i[e];s===t&&(n=r)}return null===n&&(n=t(e),i.push([t,n])),n}(n,a);if(!t.setSource)return s.push(t),xs(e,o,i,n,s,r);t.setSource(Object.assign({},e),(function(a,l){if(a)return xs(e,o,i,n,s,r);s.push(t),xs(l,e.type===l.type?o:ys[l.type],i,n,s,r)}))}else o.length?xs(e,o,i,n,s,r):r?i(e,s):xs(e,ys["*"],i,n,s,!0)}const ks={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"},As=function(e=""){const t=ss(e);return ks[t.toLowerCase()]||""},Is=function(e){if(Array.isArray(e)){let t=[];e.forEach((function(e){e=Is(e),Array.isArray(e)?t=t.concat(e):Pt(e)&&t.push(e)})),e=t}else e="string"==typeof e&&e.trim()?[Ps({src:e})]:Pt(e)&&"string"==typeof e.src&&e.src&&e.src.trim()?[Ps(e)]:[];return e};function Ps(e){if(!e.type){const t=As(e.src);t&&(e.type=t)}return e}In.registerComponent("MediaLoader",class extends In{constructor(e,t,i){if(super(e,Lt({createEl:!1},t),i),t.playerOptions.sources&&0!==t.playerOptions.sources.length)e.src(t.playerOptions.sources);else for(let i=0,n=t.playerOptions.techOrder;i<n.length;i++){const t=xn(n[i]);let s=gs.getTech(t);if(t||(s=In.getComponent(t)),s&&s.isSupported()){e.loadTech_(t);break}}}});class Os extends In{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=e=>this.handleMouseOver(e),this.handleMouseOut_=e=>this.handleMouseOut(e),this.handleClick_=e=>this.handleClick(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.emitTapEvents(),this.enable()}createEl(e="div",t={},i={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),"button"===e&&Et.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),i=Object.assign({role:"button"},i),this.tabIndex_=t.tabIndex;const n=ci(e,t,i);return this.player_.options_.experimentalSvgIcons||n.appendChild(ci("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(n),n}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=ci("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(void 0===e)return this.controlText_||"Need Text";const i=this.localize(e);this.controlText_=e,ui(this.controlTextEl_,i),this.nonIconControl||this.player_.options_.noUITitleAttributes||t.setAttribute("title",i)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){l().isEventKey(e,"Space")||l().isEventKey(e,"Enter")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}In.registerComponent("ClickableComponent",Os);class Ls extends Os{constructor(e,t){super(e,t),this.update(),this.update_=e=>this.update(e),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return ci("div",{className:"vjs-poster"})}crossOrigin(e){if(void 0===e)return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;null===e||"anonymous"===e||"use-credentials"===e?this.$("img")&&(this.$("img").crossOrigin=e):this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){e?(this.$("img")||this.el_.appendChild(ci("picture",{className:"vjs-poster",tabIndex:-1},{},ci("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e):this.el_.textContent=""}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?$n(this.player_.play()):this.player_.pause())}}Ls.prototype.crossorigin=Ls.prototype.crossOrigin,In.registerComponent("PosterImage",Ls);const Ds="#222",Rs="#ccc",Ns={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Ms(e,t){let i;if(4===e.length)i=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.");i=e.slice(1)}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function js(e,t,i){try{e.style[t]=i}catch(e){return}}function Us(e){return e?`${e}px`:""}In.registerComponent("TextTrackDisplay",class extends In{constructor(e,t,i){super(e,t,i);const n=e=>{this.updateDisplayOverlay(),this.updateDisplay(e)};e.on("loadstart",(e=>this.toggleDisplay(e))),e.on("texttrackchange",(e=>this.updateDisplay(e))),e.on("loadedmetadata",(e=>{this.updateDisplayOverlay(),this.preselectTrack(e)})),e.ready(on(this,(function(){if(e.tech_&&e.tech_.featuresNativeTextTracks)return void this.hide();e.on("fullscreenchange",n),e.on("playerresize",n);const t=s().screen.orientation||s(),i=s().screen.orientation?"change":"orientationchange";t.addEventListener(i,n),e.on("dispose",(()=>t.removeEventListener(i,n)));const r=this.options_.playerOptions.tracks||[];for(let e=0;e<r.length;e++)this.player_.addRemoteTextTrack(r[e],!0);this.preselectTrack()})))}preselectTrack(){const e={captions:1,subtitles:1},t=this.player_.textTracks(),i=this.player_.cache_.selectedLanguage;let n,s,r;for(let a=0;a<t.length;a++){const o=t[a];i&&i.enabled&&i.language&&i.language===o.language&&o.kind in e?o.kind===i.kind?r=o:r||(r=o):i&&!i.enabled?(r=null,n=null,s=null):o.default&&("descriptions"!==o.kind||n?o.kind in e&&!s&&(s=o):n=o)}r?r.mode="showing":s?s.mode="showing":n&&(n.mode="showing")}toggleDisplay(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()}createEl(){return super.createEl("div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})}clearDisplay(){"function"==typeof s().WebVTT&&s().WebVTT.processCues(s(),[],this.el_)}updateDisplay(){const e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){const t=[];for(let i=0;i<e.length;++i){const n=e[i];"showing"===n.mode&&t.push(n)}return void this.updateForTrack(t)}let i=null,n=null,s=e.length;for(;s--;){const t=e[s];"showing"===t.mode&&("descriptions"===t.kind?i=t:n=t)}n?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(n)):i&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(i))}updateDisplayOverlay(){if(!this.player_.videoHeight()||!s().CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),i=e/t,n=this.player_.videoWidth()/this.player_.videoHeight();let r=0,a=0;Math.abs(i-n)>.1&&(i>n?r=Math.round((e-t*n)/2):a=Math.round((t-e/n)/2)),js(this.el_,"insetInline",Us(r)),js(this.el_,"insetBlock",Us(a))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),i=e.activeCues;let n=i.length;for(;n--;){const e=i[n];if(!e)continue;const r=e.displayState;if(t.color&&(r.firstChild.style.color=t.color),t.textOpacity&&js(r.firstChild,"color",Ms(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(r.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&js(r.firstChild,"backgroundColor",Ms(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?js(r,"backgroundColor",Ms(t.windowColor,t.windowOpacity)):r.style.backgroundColor=t.windowColor),t.edgeStyle&&("dropshadow"===t.edgeStyle?r.firstChild.style.textShadow=`2px 2px 3px ${Ds}, 2px 2px 4px ${Ds}, 2px 2px 5px ${Ds}`:"raised"===t.edgeStyle?r.firstChild.style.textShadow=`1px 1px ${Ds}, 2px 2px ${Ds}, 3px 3px ${Ds}`:"depressed"===t.edgeStyle?r.firstChild.style.textShadow=`1px 1px ${Rs}, 0 1px ${Rs}, -1px -1px ${Ds}, 0 -1px ${Ds}`:"uniform"===t.edgeStyle&&(r.firstChild.style.textShadow=`0 0 4px ${Ds}, 0 0 4px ${Ds}, 0 0 4px ${Ds}, 0 0 4px ${Ds}`)),t.fontPercent&&1!==t.fontPercent){const e=s().parseFloat(r.style.fontSize);r.style.fontSize=e*t.fontPercent+"px",r.style.height="auto",r.style.top="auto"}t.fontFamily&&"default"!==t.fontFamily&&("small-caps"===t.fontFamily?r.firstChild.style.fontVariant="small-caps":r.firstChild.style.fontFamily=Ns[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),"function"!=typeof s().WebVTT||e.every((e=>!e.activeCues)))return;const t=[];for(let i=0;i<e.length;++i){const n=e[i];for(let e=0;e<n.activeCues.length;++e)t.push(n.activeCues[e])}s().WebVTT.processCues(s(),t,this.el_);for(let t=0;t<e.length;++t){const i=e[t];for(let e=0;e<i.activeCues.length;++e){const n=i.activeCues[e].displayState;pi(n,"vjs-text-track-cue","vjs-text-track-cue-"+(i.language?i.language:t)),i.language&&_i(n,"lang",i.language)}this.player_.textTrackSettings&&this.updateDisplayState(i)}}}),In.registerComponent("LoadingSpinner",class extends In{createEl(){const e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"Video Player"),i=ci("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])}),n=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});return n.appendChild(i),n}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}});class Bs extends Os{createEl(e,t={},i={}){const n=ci("button",t=Object.assign({className:this.buildCSSClass()},t),i=Object.assign({type:"button"},i));return this.player_.options_.experimentalSvgIcons||n.appendChild(ci("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(n),n}addChild(e,t={}){const i=this.constructor.name;return Et.warn(`Adding an actionable (user controllable) child to a Button (${i}) is not supported; use a ClickableComponent instead.`),In.prototype.addChild.call(this,e,t)}enable(){super.enable(),this.el_.removeAttribute("disabled")}disable(){super.disable(),this.el_.setAttribute("disabled","disabled")}handleKeyDown(e){l().isEventKey(e,"Space")||l().isEventKey(e,"Enter")?e.stopPropagation():super.handleKeyDown(e)}}In.registerComponent("Button",Bs);class Fs extends Bs{constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon("play"),this.on("mousedown",(e=>this.handleMouseDown(e)))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(this.mouseused_&&"clientX"in e&&"clientY"in e)return $n(t),void(this.player_.tech(!0)&&this.player_.tech(!0).focus());const i=this.player_.getChild("controlBar"),n=i&&i.getChild("playToggle");if(!n)return void this.player_.tech(!0).focus();const s=()=>n.focus();qn(t)?t.then(s,(()=>{})):this.setTimeout(s,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}Fs.prototype.controlText_="Play Video",In.registerComponent("BigPlayButton",Fs),In.registerComponent("CloseButton",class extends Bs{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){l().isEventKey(e,"Esc")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}});class qs extends Bs{constructor(e,t={}){super(e,t),t.replay=void 0===t.replay||t.replay,this.setIcon("play"),this.on(e,"play",(e=>this.handlePlay(e))),this.on(e,"pause",(e=>this.handlePause(e))),t.replay&&this.on(e,"ended",(e=>this.handleEnded(e)))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?$n(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",(e=>this.handleSeeked(e)))}}qs.prototype.controlText_="Play",In.registerComponent("PlayToggle",qs);class $s extends In{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],(e=>this.update(e))),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),i=ci("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return t.appendChild(i),this.contentEl_=ci("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){(this.player_.options_.enableSmoothSeeking||"seeking"!==e.type)&&this.updateContent(e)}updateTextNode_(e=0){e=jn(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",(()=>{if(!this.contentEl_)return;let e=this.textNode_;e&&this.contentEl_.firstChild!==e&&(e=null,Et.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=a().createTextNode(this.formattedTime_),this.textNode_&&(e?this.contentEl_.replaceChild(this.textNode_,e):this.contentEl_.appendChild(this.textNode_))})))}updateContent(e){}}$s.prototype.labelText_="Time",$s.prototype.controlText_="Time",In.registerComponent("TimeDisplay",$s);class Hs extends $s{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;t=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}Hs.prototype.labelText_="Current Time",Hs.prototype.controlText_="Current Time",In.registerComponent("CurrentTimeDisplay",Hs);class Vs extends $s{constructor(e,t){super(e,t);const i=e=>this.updateContent(e);this.on(e,"durationchange",i),this.on(e,"loadstart",i),this.on(e,"loadedmetadata",i)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}Vs.prototype.labelText_="Duration",Vs.prototype.controlText_="Duration",In.registerComponent("DurationDisplay",Vs),In.registerComponent("TimeDivider",class extends In{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),i=super.createEl("span",{textContent:"/"});return t.appendChild(i),e.appendChild(t),e}});class zs extends $s{constructor(e,t){super(e,t),this.on(e,"durationchange",(e=>this.updateContent(e)))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return!1!==this.options_.displayNegative&&e.insertBefore(ci("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if("number"!=typeof this.player_.duration())return;let t;t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t)}}zs.prototype.labelText_="Remaining Time",zs.prototype.controlText_="Remaining Time",In.registerComponent("RemainingTimeDisplay",zs),In.registerComponent("LiveDisplay",class extends In{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",(e=>this.updateShowing(e)))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=ci("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(ci("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(a().createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}});class Ws extends Bs{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=e=>this.updateLiveEdgeStatus(e),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=ci("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}function Gs(e,t,i){return e=Number(e),Math.min(i,Math.max(t,isNaN(e)?t:e))}Ws.prototype.controlText_="Seek to live, currently playing live",In.registerComponent("SeekToLive",Ws);var Xs=Object.freeze({__proto__:null,clamp:Gs});class Ys extends In{constructor(e,t){super(e,t),this.handleMouseDown_=e=>this.handleMouseDown(e),this.handleMouseUp_=e=>this.handleMouseUp(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.handleClick_=e=>this.handleClick(e),this.handleMouseMove_=e=>this.handleMouseMove(e),this.update_=e=>this.update(e),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},i={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),i=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},i),super.createEl(e,t,i)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||Ht||e.preventDefault(),Ti(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;Si(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",(()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(100*e).toFixed(2)+"%"}))),e}getProgress(){return Number(Gs(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=Ci(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){l().isEventKey(e,"Left")||l().isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepBack()):l().isEventKey(e,"Right")||l().isEventKey(e,"Up")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}In.registerComponent("Slider",Ys);const Ks=(e,t)=>Gs(e/t*100,0,100).toFixed(2)+"%";In.registerComponent("LoadProgressBar",class extends In{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",(e=>this.update(e)))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=ci("span",{className:"vjs-control-text"}),i=ci("span",{textContent:this.localize("Loaded")}),n=a().createTextNode(": ");return this.percentageEl_=ci("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(i),t.appendChild(n),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",(()=>{const e=this.player_.liveTracker,t=this.player_.buffered(),i=e&&e.isLive()?e.seekableEnd():this.player_.duration(),n=this.player_.bufferedEnd(),s=this.partEls_,r=Ks(n,i);this.percent_!==r&&(this.el_.style.width=r,ui(this.percentageEl_,r),this.percent_=r);for(let e=0;e<t.length;e++){const i=t.start(e),r=t.end(e);let a=s[e];a||(a=this.el_.appendChild(ci()),s[e]=a),a.dataset.start===i&&a.dataset.end===r||(a.dataset.start=i,a.dataset.end=r,a.style.left=Ks(i,n),a.style.width=Ks(r-i,n))}for(let e=s.length;e>t.length;e--)this.el_.removeChild(s[e-1]);s.length=t.length}))}}),In.registerComponent("TimeTooltip",class extends In{constructor(e,t){super(e,t),this.update=ln(on(this,this.update),an)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,i){const n=Ei(this.el_),s=wi(this.player_.el()),r=e.width*t;if(!s||!n)return;const a=e.left-s.left+r,o=e.width-r+(s.right-e.right);let l=n.width/2;a<l?l+=l-a:o<l&&(l=o),l<0?l=0:l>n.width&&(l=n.width),l=Math.round(l),this.el_.style.right=`-${l}px`,this.write(i)}write(e){ui(this.el_,e)}updateTime(e,t,i,n){this.requestNamedAnimationFrame("TimeTooltip#updateTime",(()=>{let s;const r=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const e=this.player_.liveTracker.liveWindow(),i=e-t*e;s=(i<1?"":"-")+jn(i,e)}else s=jn(i,r);this.update(e,t,s),n&&n()}))}});class Qs extends In{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=ln(on(this,this.update),an)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){const i=this.getChild("timeTooltip");if(!i)return;const n=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,t,n)}}Qs.prototype.options_={children:[]},ti||Bt||Qs.prototype.options_.children.push("timeTooltip"),In.registerComponent("PlayProgressBar",Qs);class Js extends In{constructor(e,t){super(e,t),this.update=ln(on(this,this.update),an)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,(()=>{this.el_.style.left=e.width*t+"px"}))}}Js.prototype.options_={children:["timeTooltip"]},In.registerComponent("MouseTimeDisplay",Js);class Zs extends Ys{constructor(e,t){super(e,t),this.setEventHandlers_()}setEventHandlers_(){this.update_=on(this,this.update),this.update=ln(this.update_,an),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in a()&&"visibilityState"in a()&&this.on(a(),"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){"hidden"===a().visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,an))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if("hidden"===a().visibilityState)return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",(()=>{const e=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),i=this.player_.liveTracker;let n=this.player_.duration();i&&i.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.percent_=t),this.currentTime_===e&&this.duration_===n||(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[jn(e,n),jn(n,n)],"{1} of {2}")),this.currentTime_=e,this.duration_=n),this.bar&&this.bar.update(wi(this.el()),this.getProgress())})),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){const e=this.getCurrentTime_();let t;const i=this.player_.liveTracker;return i&&i.isLive()?(t=(e-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){Oi(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!Oi(e)||isNaN(this.player_.duration()))return;let i;t||this.player_.scrubbing()||this.player_.scrubbing(!0);const n=this.calculateDistance(e),s=this.player_.liveTracker;if(s&&s.isLive()){if(n>=.99)return void s.seekToLiveEdge();const e=s.seekableStart(),t=s.liveCurrentTime();if(i=e+n*s.liveWindow(),i>=t&&(i=t),i<=e&&(i=e+.1),i===1/0)return}else i=n*this.player_.duration(),i===this.player_.duration()&&(i-=.1);this.userSeek_(i),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?$n(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+5)}stepBack(){this.userSeek_(this.player_.currentTime()-5)}handleAction(e){this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(l().isEventKey(e,"Space")||l().isEventKey(e,"Enter"))e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(l().isEventKey(e,"Home"))e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(l().isEventKey(e,"End"))e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(l()(e))){e.preventDefault(),e.stopPropagation();const i=10*(l().codes[l()(e)]-l().codes[0])/100;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*i):this.userSeek_(this.player_.duration()*i)}else l().isEventKey(e,"PgDn")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):l().isEventKey(e,"PgUp")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in a()&&"visibilityState"in a()&&this.off(a(),"visibilitychange",this.toggleVisibility_),super.dispose()}}Zs.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},ti||Bt||Zs.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),In.registerComponent("SeekBar",Zs);class er extends In{constructor(e,t){super(e,t),this.handleMouseMove=ln(on(this,this.handleMouseMove),an),this.throttledHandleMouseSeek=ln(on(this,this.handleMouseSeek),an),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.handleMouseDownHandler_=e=>this.handleMouseDown(e),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const i=t.getChild("playProgressBar"),n=t.getChild("mouseTimeDisplay");if(!i&&!n)return;const s=t.el(),r=Ei(s);let a=Ci(s,e).x;a=Gs(a,0,1),n&&n.update(r,a),i&&i.update(r,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach((e=>e.disable&&e.disable())),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&$n(this.player_.play())}}enable(){this.children().forEach((e=>e.enable&&e.enable())),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}er.prototype.options_={children:["seekBar"]},In.registerComponent("ProgressControl",er);class tr extends Bs{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],(e=>this.handlePictureInPictureChange(e))),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],(e=>this.handlePictureInPictureEnabledChange(e))),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],(()=>this.handlePictureInPictureAudioModeChange())),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){"audio"===this.player_.currentType().substring(0,5)||this.player_.audioPosterMode()||this.player_.audioOnlyMode()?(this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()):this.show()}handlePictureInPictureEnabledChange(){a().pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in s()?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){"function"==typeof a().exitPictureInPicture&&super.show()}}tr.prototype.controlText_="Picture-in-Picture",In.registerComponent("PictureInPictureToggle",tr);class ir extends Bs{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",(e=>this.handleFullscreenChange(e))),!1===a()[e.fsApi_.fullscreenEnabled]&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}ir.prototype.controlText_="Fullscreen",In.registerComponent("FullscreenToggle",ir),In.registerComponent("VolumeLevel",class extends In{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}),In.registerComponent("VolumeLevelTooltip",class extends In{constructor(e,t){super(e,t),this.update=ln(on(this,this.update),an)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,i,n){if(!i){const i=wi(this.el_),n=wi(this.player_.el()),s=e.width*t;if(!n||!i)return;const r=e.left-n.left+s,a=e.width-s+(n.right-e.right);let o=i.width/2;r<o?o+=o-r:a<o&&(o=a),o<0?o=0:o>i.width&&(o=i.width),this.el_.style.right=`-${o}px`}this.write(`${n}%`)}write(e){ui(this.el_,e)}updateVolume(e,t,i,n,s){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",(()=>{this.update(e,t,i,n.toFixed(0)),s&&s()}))}});class nr extends In{constructor(e,t){super(e,t),this.update=ln(on(this,this.update),an)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,i){const n=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,n,(()=>{i?this.el_.style.bottom=e.height*t+"px":this.el_.style.left=e.width*t+"px"}))}}nr.prototype.options_={children:["volumeLevelTooltip"]},In.registerComponent("MouseVolumeLevelDisplay",nr);class sr extends Ys{constructor(e,t){super(e,t),this.on("slideractive",(e=>this.updateLastVolume_(e))),this.on(e,"volumechange",(e=>this.updateARIAAttributes(e))),e.ready((()=>this.updateARIAAttributes()))}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){Oi(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const i=this.el(),n=wi(i),s=this.vertical();let r=Ci(i,e);r=s?r.y:r.x,r=Gs(r,0,1),t.update(n,r,s)}Oi(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(100*this.player_.volume())}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",(()=>{0===this.player_.volume()&&this.player_.lastVolume_(e)}))}}sr.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},ti||Bt||sr.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),sr.prototype.playerEvent="volumechange",In.registerComponent("VolumeBar",sr);class rr extends In{constructor(e,t={}){t.vertical=t.vertical||!1,(void 0===t.volumeBar||Ot(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))}(this,e),this.throttledHandleMouseMove=ln(on(this,this.handleMouseMove),an),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.on("mousedown",(e=>this.handleMouseDown(e))),this.on("touchstart",(e=>this.handleMouseDown(e))),this.on("mousemove",(e=>this.handleMouseMove(e))),this.on(this.volumeBar,["focus","slideractive"],(()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")})),this.on(this.volumeBar,["blur","sliderinactive"],(()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")}))}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}rr.prototype.options_={children:["volumeBar"]},In.registerComponent("VolumeControl",rr);class ar extends Bs{constructor(e,t){super(e,t),function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",(function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")}))}(this,e),this.on(e,["loadstart","volumechange"],(e=>this.update(e)))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),i=this.player_.lastVolume_();if(0===t){const e=i<.1?.1:i;this.player_.volume(e),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high"),ti&&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),fi(this.el_,[0,1,2,3].reduce(((e,t)=>e+`${t?" ":""}vjs-vol-${t}`),"")),pi(this.el_,`vjs-vol-${t}`)}updateControlText_(){const e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)}}ar.prototype.controlText_="Mute",In.registerComponent("MuteToggle",ar);class or extends In{constructor(e,t={}){void 0!==t.inline?t.inline=t.inline:t.inline=!0,(void 0===t.volumeControl||Ot(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=e=>this.handleKeyPress(e),this.on(e,["loadstart"],(e=>this.volumePanelState_(e))),this.on(this.muteToggle,"keyup",(e=>this.handleKeyPress(e))),this.on(this.volumeControl,"keyup",(e=>this.handleVolumeControlKeyUp(e))),this.on("keydown",(e=>this.handleKeyPress(e))),this.on("mouseover",(e=>this.handleMouseOver(e))),this.on("mouseout",(e=>this.handleMouseOut(e))),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){l().isEventKey(e,"Esc")&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),Zi(a(),"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),en(a(),"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){l().isEventKey(e,"Esc")&&this.handleMouseOut()}}or.prototype.options_={children:["muteToggle","volumeControl"]},In.registerComponent("VolumePanel",or);class lr extends Bs{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const t=this.player_.currentTime(),i=this.player_.liveTracker,n=i&&i.isLive()?i.seekableEnd():this.player_.duration();let s;s=t+this.skipTime<=n?t+this.skipTime:n,this.player_.currentTime(s)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}lr.prototype.controlText_="Skip Forward",In.registerComponent("SkipForward",lr);class cr extends Bs{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime(),i=this.player_.liveTracker,n=i&&i.isLive()&&i.seekableStart();let s;s=n&&t-this.skipTime<=n?n:t>=this.skipTime?t-this.skipTime:0,this.player_.currentTime(s)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}cr.prototype.controlText_="Skip Backward",In.registerComponent("SkipBackward",cr);class ur extends In{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",(e=>this.handleKeyDown(e))),this.boundHandleBlur_=e=>this.handleBlur(e),this.boundHandleTapClick_=e=>this.handleTapClick(e)}addEventListenerForItem(e){e instanceof In&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof In&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){"string"==typeof e&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=ci(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),Zi(t,"click",(function(e){e.preventDefault(),e.stopImmediatePropagation()})),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||a().activeElement;if(!this.children().some((e=>e.el()===t))){const e=this.menuButton_;e&&e.buttonPressed_&&t!==e.el().firstChild&&e.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const i=t.filter((t=>t.el()===e.target))[0];if(!i)return;"CaptionSettingsMenuItem"!==i.name()&&this.menuButton_.focus()}}handleKeyDown(e){l().isEventKey(e,"Left")||l().isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(l().isEventKey(e,"Right")||l().isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}In.registerComponent("Menu",ur);class hr extends In{constructor(e,t={}){super(e,t),this.menuButton_=new Bs(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const i=Bs.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+i,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const n=e=>this.handleClick(e);this.handleMenuKeyUp_=e=>this.handleMenuKeyUp(e),this.on(this.menuButton_,"tap",n),this.on(this.menuButton_,"click",n),this.on(this.menuButton_,"keydown",(e=>this.handleKeyDown(e))),this.on(this.menuButton_,"mouseenter",(()=>{this.addClass("vjs-hover"),this.menu.show(),Zi(a(),"keyup",this.handleMenuKeyUp_)})),this.on("mouseleave",(e=>this.handleMouseLeave(e))),this.on("keydown",(e=>this.handleSubmenuKeyDown(e)))}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new ur(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=ci("li",{className:"vjs-menu-title",textContent:xn(this.options_.title),tabIndex:-1}),i=new In(this.player_,{el:t});e.addItem(i)}if(this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}createItems(){}createEl(){return super.createEl("div",{className:this.buildWrapperCSSClass()},{})}setIcon(e){super.setIcon(e,this.menuButton_.el_)}buildWrapperCSSClass(){let e="vjs-menu-button";return!0===this.options_.inline?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${Bs.prototype.buildCSSClass()} ${super.buildCSSClass()}`}buildCSSClass(){let e="vjs-menu-button";return!0===this.options_.inline?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${super.buildCSSClass()}`}controlText(e,t=this.menuButton_.el()){return this.menuButton_.controlText(e,t)}dispose(){this.handleMouseLeave(),super.dispose()}handleClick(e){this.buttonPressed_?this.unpressButton():this.pressButton()}handleMouseLeave(e){this.removeClass("vjs-hover"),en(a(),"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(e){l().isEventKey(e,"Esc")||l().isEventKey(e,"Tab")?(this.buttonPressed_&&this.unpressButton(),l().isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus())):(l().isEventKey(e,"Up")||l().isEventKey(e,"Down"))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))}handleMenuKeyUp(e){(l().isEventKey(e,"Esc")||l().isEventKey(e,"Tab"))&&this.removeClass("vjs-hover")}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e)}handleSubmenuKeyDown(e){(l().isEventKey(e,"Esc")||l().isEventKey(e,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),l().isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus()))}pressButton(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),ti&&oi())return;this.menu.focus()}}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))}disable(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()}enable(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()}}In.registerComponent("MenuButton",hr);class dr extends hr{constructor(e,t){const i=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),!i)return;const n=on(this,this.update);i.addEventListener("removetrack",n),i.addEventListener("addtrack",n),i.addEventListener("labelchange",n),this.player_.on("ready",n),this.player_.on("dispose",(function(){i.removeEventListener("removetrack",n),i.removeEventListener("addtrack",n),i.removeEventListener("labelchange",n)}))}}In.registerComponent("TrackButton",dr);const pr=["Tab","Esc","Up","Down","Right","Left"];class fr extends Os{constructor(e,t){super(e,t),this.selectable=t.selectable,this.isSelected_=t.selected||!1,this.multiSelectable=t.multiSelectable,this.selected(this.isSelected_),this.selectable?this.multiSelectable?this.el_.setAttribute("role","menuitemcheckbox"):this.el_.setAttribute("role","menuitemradio"):this.el_.setAttribute("role","menuitem")}createEl(e,t,i){this.nonIconControl=!0;const n=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),i),s=ci("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?n.appendChild(s):n.replaceChild(s,n.querySelector(".vjs-icon-placeholder")),n}handleKeyDown(e){pr.some((t=>l().isEventKey(e,t)))||super.handleKeyDown(e)}handleClick(e){this.selected(!0)}selected(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))}}In.registerComponent("MenuItem",fr);class mr extends fr{constructor(e,t){const i=t.track,n=e.textTracks();t.label=i.label||i.language||"Unknown",t.selected="showing"===i.mode,super(e,t),this.track=i,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);const r=(...e)=>{this.handleTracksChange.apply(this,e)},o=(...e)=>{this.handleSelectedLanguageChange.apply(this,e)};if(e.on(["loadstart","texttrackchange"],r),n.addEventListener("change",r),n.addEventListener("selectedlanguagechange",o),this.on("dispose",(function(){e.off(["loadstart","texttrackchange"],r),n.removeEventListener("change",r),n.removeEventListener("selectedlanguagechange",o)})),void 0===n.onchange){let e;this.on(["tap","click"],(function(){if("object"!=typeof s().Event)try{e=new(s().Event)("change")}catch(e){}e||(e=a().createEvent("Event"),e.initEvent("change",!0,!0)),n.dispatchEvent(e)}))}this.handleTracksChange()}handleClick(e){const t=this.track,i=this.player_.textTracks();if(super.handleClick(e),i)for(let e=0;e<i.length;e++){const n=i[e];-1!==this.kinds.indexOf(n.kind)&&(n===t?"showing"!==n.mode&&(n.mode="showing"):"disabled"!==n.mode&&(n.mode="disabled"))}}handleTracksChange(e){const t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)}handleSelectedLanguageChange(e){if("showing"===this.track.mode){const e=this.player_.cache_.selectedLanguage;if(e&&e.enabled&&e.language===this.track.language&&e.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}}dispose(){this.track=null,super.dispose()}}In.registerComponent("TextTrackMenuItem",mr);class gr extends mr{constructor(e,t){t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:"disabled"},t.kinds||(t.kinds=[t.kind]),t.label?t.track.label=t.label:t.track.label=t.kinds.join(" and ")+" off",t.selectable=!0,t.multiSelectable=!1,super(e,t)}handleTracksChange(e){const t=this.player().textTracks();let i=!0;for(let e=0,n=t.length;e<n;e++){const n=t[e];if(this.options_.kinds.indexOf(n.kind)>-1&&"showing"===n.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let i=!0;for(let e=0,n=t.length;e<n;e++){const n=t[e];if(["captions","descriptions","subtitles"].indexOf(n.kind)>-1&&"showing"===n.mode){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}In.registerComponent("OffTextTrackMenuItem",gr);class yr extends dr{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=mr){let i;this.label_&&(i=`${this.label_} off`),e.push(new gr(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;const n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let i=0;i<n.length;i++){const s=n[i];if(this.kinds_.indexOf(s.kind)>-1){const i=new t(this.player_,{track:s,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});i.addClass(`vjs-${s.kind}-menu-item`),e.push(i)}}return e}}In.registerComponent("TextTrackButton",yr);class vr extends fr{constructor(e,t){const i=t.track,n=t.cue,s=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=n.text,t.selected=n.startTime<=s&&s<n.endTime,super(e,t),this.track=i,this.cue=n}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}}In.registerComponent("ChaptersTrackMenuItem",vr);class _r extends yr{constructor(e,t,i){super(e,t,i),this.setIcon("chapters"),this.selectCurrentItem_=()=>{this.items.forEach((e=>{e.selected(this.track_.activeCues[0]===e.cue)}))}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&"chapters"!==e.track.kind)return;const t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){const i=e[t];if(i.kind===this.kind_)return i}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(xn(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let i=0,n=t.length;i<n;i++){const n=t[i],s=new vr(this.player_,{track:this.track_,cue:n});e.push(s)}return e}}_r.prototype.kind_="chapters",_r.prototype.controlText_="Chapters",In.registerComponent("ChaptersButton",_r);class br extends yr{constructor(e,t,i){super(e,t,i),this.setIcon("audio-description");const n=e.textTracks(),s=on(this,this.handleTracksChange);n.addEventListener("change",s),this.on("dispose",(function(){n.removeEventListener("change",s)}))}handleTracksChange(e){const t=this.player().textTracks();let i=!1;for(let e=0,n=t.length;e<n;e++){const n=t[e];if(n.kind!==this.kind_&&"showing"===n.mode){i=!0;break}}i?this.disable():this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}}br.prototype.kind_="descriptions",br.prototype.controlText_="Descriptions",In.registerComponent("DescriptionsButton",br);class Tr extends yr{constructor(e,t,i){super(e,t,i),this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}}Tr.prototype.kind_="subtitles",Tr.prototype.controlText_="Subtitles",In.registerComponent("SubtitlesButton",Tr);class Sr extends mr{constructor(e,t){t.track={player:e,kind:t.kind,label:t.kind+" settings",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="CaptionSettingsMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.controlText(", opens "+t.kind+" settings dialog")}handleClick(e){this.player().getChild("textTrackSettings").open()}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.kind+" settings"),super.handleLanguagechange()}}In.registerComponent("CaptionSettingsMenuItem",Sr);class wr extends yr{constructor(e,t,i){super(e,t,i),this.setIcon("captions")}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){const e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new Sr(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}}wr.prototype.kind_="captions",wr.prototype.controlText_="Captions",In.registerComponent("CaptionsButton",wr);class Er extends mr{createEl(e,t,i){const n=super.createEl(e,t,i),s=n.querySelector(".vjs-menu-item-text");return"captions"===this.options_.track.kind&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",n):s.appendChild(ci("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),s.appendChild(ci("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))),n}}In.registerComponent("SubsCapsMenuItem",Er);class Cr extends yr{constructor(e,t={}){super(e,t),this.label_="subtitles",this.setIcon("subtitles"),["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)>-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(xn(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new Sr(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,Er),e}}Cr.prototype.kinds_=["captions","subtitles"],Cr.prototype.controlText_="Subtitles",In.registerComponent("SubsCapsButton",Cr);class xr extends fr{constructor(e,t){const i=t.track,n=e.audioTracks();t.label=i.label||i.language||"Unknown",t.selected=i.enabled,super(e,t),this.track=i,this.addClass(`vjs-${i.kind}-menu-item`);const s=(...e)=>{this.handleTracksChange.apply(this,e)};n.addEventListener("change",s),this.on("dispose",(()=>{n.removeEventListener("change",s)}))}createEl(e,t,i){const n=super.createEl(e,t,i),s=n.querySelector(".vjs-menu-item-text");return["main-desc","description"].indexOf(this.options_.track.kind)>=0&&(s.appendChild(ci("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),s.appendChild(ci("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),n}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const e=this.player_.audioTracks();for(let t=0;t<e.length;t++){const i=e[t];i!==this.track&&(i.enabled=i===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}}In.registerComponent("AudioTrackMenuItem",xr);class kr extends dr{constructor(e,t={}){t.tracks=e.audioTracks(),super(e,t),this.setIcon("audio")}buildCSSClass(){return`vjs-audio-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-audio-button ${super.buildWrapperCSSClass()}`}createItems(e=[]){this.hideThreshold_=1;const t=this.player_.audioTracks();for(let i=0;i<t.length;i++){const n=t[i];e.push(new xr(this.player_,{track:n,selectable:!0,multiSelectable:!1}))}return e}}kr.prototype.controlText_="Audio Track",In.registerComponent("AudioTrackButton",kr);class Ar extends fr{constructor(e,t){const i=t.rate,n=parseFloat(i,10);t.label=i,t.selected=n===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=i,this.rate=n,this.on(e,"ratechange",(e=>this.update(e)))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}Ar.prototype.contentElType="button",In.registerComponent("PlaybackRateMenuItem",Ar);class Ir extends hr{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",(e=>this.updateVisibility(e))),this.on(e,"ratechange",(e=>this.updateLabel(e))),this.on(e,"playbackrateschange",(e=>this.handlePlaybackRateschange(e)))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=ci("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),t=[];for(let i=e.length-1;i>=0;i--)t.push(new Ar(this.player(),{rate:e[i]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}Ir.prototype.controlText_="Playback Rate",In.registerComponent("PlaybackRateMenuButton",Ir);class Pr extends In{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},i={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,i)}}In.registerComponent("Spacer",Pr),In.registerComponent("CustomControlSpacer",class extends Pr{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}});class Or extends In{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}Or.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]},In.registerComponent("ControlBar",Or);class Lr extends zn{constructor(e,t){super(e,t),this.on(e,"error",(e=>{this.open(e)}))}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}Lr.prototype.options_=Object.assign({},zn.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),In.registerComponent("ErrorDisplay",Lr);const Dr="vjs-text-track-settings",Rr=["#000","Black"],Nr=["#00F","Blue"],Mr=["#0FF","Cyan"],jr=["#0F0","Green"],Ur=["#F0F","Magenta"],Br=["#F00","Red"],Fr=["#FFF","White"],qr=["#FF0","Yellow"],$r=["1","Opaque"],Hr=["0.5","Semi-Transparent"],Vr=["0","Transparent"],zr={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Rr,Fr,Br,jr,Nr,qr,Ur,Mr]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[$r,Hr,Vr]},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Fr,Rr,Br,jr,Nr,qr,Ur,Mr]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:e=>"1.00"===e?null:Number(e)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[$r,Hr]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[Vr,Hr,$r]}};function Wr(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}zr.windowColor.options=zr.backgroundColor.options,In.registerComponent("TextTrackSettings",class extends zn{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.endDialog=ci("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),void 0===t.persistTextTrackSettings&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.on(this.$(".vjs-done-button"),"click",(()=>{this.saveSettings(),this.close()})),this.on(this.$(".vjs-default-button"),"click",(()=>{this.setDefaults(),this.updateDisplay()})),At(zr,(e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})),this.options_.persistTextTrackSettings&&this.restoreSettings()}dispose(){this.endDialog=null,super.dispose()}createElSelect_(e,t="",i="label"){const n=zr[e],s=n.id.replace("%s",this.id_),r=[t,s].join(" ").trim(),a=`vjs_select_${Gi()}`;return[`<${i} id="${s}"${"label"===i?` for="${a}" class="vjs-label"`:""}>`,this.localize(n.label),`</${i}>`,`<select aria-labelledby="${r}" id="${a}">`].concat(n.options.map((e=>{const t=s+"-"+e[1].replace(/\W+/g,"");return[`<option id="${t}" value="${e[0]}" `,`aria-labelledby="${r} ${t}">`,this.localize(e[1]),"</option>"].join("")}))).concat("</select>").join("")}createElFgColor_(){const e=`captions-text-legend-${this.id_}`;return['<fieldset class="vjs-fg vjs-track-setting">',`<legend id="${e}">`,this.localize("Text"),"</legend>",'<span class="vjs-text-color">',this.createElSelect_("color",e),"</span>",'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",e),"</span>","</fieldset>"].join("")}createElBgColor_(){const e=`captions-background-${this.id_}`;return['<fieldset class="vjs-bg vjs-track-setting">',`<legend id="${e}">`,this.localize("Text Background"),"</legend>",'<span class="vjs-bg-color">',this.createElSelect_("backgroundColor",e),"</span>",'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",e),"</span>","</fieldset>"].join("")}createElWinColor_(){const e=`captions-window-${this.id_}`;return['<fieldset class="vjs-window vjs-track-setting">',`<legend id="${e}">`,this.localize("Caption Area Background"),"</legend>",'<span class="vjs-window-color">',this.createElSelect_("windowColor",e),"</span>",'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",e),"</span>","</fieldset>"].join("")}createElColors_(){return ci("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})}createElFont_(){return ci("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})}createElControls_(){const e=this.localize("restore all settings to the default values");return ci("div",{className:"vjs-track-settings-controls",innerHTML:[`<button type="button" class="vjs-default-button" title="${e}">`,this.localize("Reset"),`<span class="vjs-control-text"> ${e}</span>`,"</button>",`<button type="button" class="vjs-done-button">${this.localize("Done")}</button>`].join("")})}content(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return It(zr,((e,t,i)=>{const n=(s=this.$(t.selector),r=t.parser,Wr(s.options[s.options.selectedIndex].value,r));var s,r;return void 0!==n&&(e[i]=n),e}),{})}setValues(e){At(zr,((t,i)=>{!function(e,t,i){if(t)for(let n=0;n<e.options.length;n++)if(Wr(e.options[n].value,i)===t){e.selectedIndex=n;break}}(this.$(t.selector),e[i],t.parser)}))}setDefaults(){At(zr,(e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t}))}restoreSettings(){let e;try{e=JSON.parse(s().localStorage.getItem(Dr))}catch(e){Et.warn(e)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?s().localStorage.setItem(Dr,JSON.stringify(e)):s().localStorage.removeItem(Dr)}catch(e){Et.warn(e)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}conditionalBlur_(){this.previouslyActiveEl_=null;const e=this.player_.controlBar,t=e&&e.subsCapsButton,i=e&&e.captionsButton;t?t.focus():i&&i.focus()}handleLanguagechange(){this.fill()}}),In.registerComponent("ResizeManager",class extends In{constructor(e,t){let i=t.ResizeObserver||s().ResizeObserver;null===t.ResizeObserver&&(i=!1),super(e,Lt({createEl:!i,reportTouchActivity:!1},t)),this.ResizeObserver=t.ResizeObserver||s().ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=cn((()=>{this.resizeHandler()}),100,!1,this),i?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const e=this.debouncedHandler_;let t=this.unloadListener_=function(){en(this,"resize",e),en(this,"unload",t),t=null};Zi(this.el_.contentWindow,"unload",t),Zi(this.el_.contentWindow,"resize",e)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}});const Gr={trackingThreshold:20,liveTolerance:15};In.registerComponent("LiveTracker",class extends In{constructor(e,t){super(e,Lt(Gr,t,{createEl:!1})),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=e=>this.handlePlay(e),this.handleFirstTimeupdate_=e=>this.handleFirstTimeupdate(e),this.handleSeeked_=e=>this.handleSeeked(e),this.seekToLiveEdge_=e=>this.seekToLiveEdge(e),this.reset_(),this.on(this.player_,"durationchange",(e=>this.handleDurationchange(e))),this.on(this.player_,"canplay",(()=>this.toggleTracking()))}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(s().performance.now().toFixed(4)),i=-1===this.lastTime_?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+i;const n=this.liveCurrentTime(),r=this.player_.currentTime();let a=this.player_.paused()||this.seekedBehindLive_||Math.abs(n-r)>this.options_.liveTolerance;this.timeupdateSeen_&&n!==1/0||(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,an),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return-1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return"number"==typeof this.trackingInterval_}seekToLiveEdge(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}),In.registerComponent("TitleBar",class extends In{constructor(e,t){super(e,t),this.on("statechanged",(e=>this.updateDom_())),this.updateDom_()}createEl(){return this.els={title:ci("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${Gi()}`}),description:ci("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${Gi()}`})},ci("div",{className:"vjs-title-bar"},{},Dt(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,i={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach((e=>{const n=this.state[e],s=this.els[e],r=i[e];ki(s),n&&ui(s,n),t&&(t.removeAttribute(r),n&&t.setAttribute(r,s.id))})),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}});const Xr=e=>{const t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;const i=e.$$("source"),n=[];let s="";if(!i.length)return!1;for(let e=0;e<i.length;e++){const t=i[e].src;t&&-1===n.indexOf(t)&&n.push(t)}return!!n.length&&(1===n.length&&(s=n[0]),e.triggerSourceset(s),!0)},Yr=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(e){const t=a().createElement(this.nodeName.toLowerCase());t.innerHTML=e;const i=a().createDocumentFragment();for(;t.childNodes.length;)i.appendChild(t.childNodes[0]);return this.innerText="",s().Element.prototype.appendChild.call(this,i),this.innerHTML}}),Kr=(e,t)=>{let i={};for(let n=0;n<e.length&&(i=Object.getOwnPropertyDescriptor(e[n],t),!(i&&i.set&&i.get));n++);return i.enumerable=!0,i.configurable=!0,i},Qr=function(e){const t=e.el();if(t.resetSourceWatch_)return;const i={},n=(e=>Kr([e.el(),s().HTMLMediaElement.prototype,s().Element.prototype,Yr],"innerHTML"))(e),r=i=>(...n)=>{const s=i.apply(t,n);return Xr(e),s};["append","appendChild","insertAdjacentHTML"].forEach((e=>{t[e]&&(i[e]=t[e],t[e]=r(i[e]))})),Object.defineProperty(t,"innerHTML",Lt(n,{set:r(n.set)})),t.resetSourceWatch_=()=>{t.resetSourceWatch_=null,Object.keys(i).forEach((e=>{t[e]=i[e]})),Object.defineProperty(t,"innerHTML",n)},e.one("sourceset",t.resetSourceWatch_)},Jr=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?ns(s().Element.prototype.getAttribute.call(this,"src")):""},set(e){return s().Element.prototype.setAttribute.call(this,"src",e),e}});class Zr extends gs{constructor(e,t){super(e,t);const i=e.source;let n=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&"VIDEO"===this.el_.tagName,i&&(this.el_.currentSrc!==i.src||e.tag&&3===e.tag.initNetworkState_)?this.setSource(i):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const e=this.el_.childNodes;let t=e.length;const i=[];for(;t--;){const s=e[t];"track"===s.nodeName.toLowerCase()&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(s),this.remoteTextTracks().addTrack(s.track),this.textTracks().addTrack(s.track),n||this.el_.hasAttribute("crossorigin")||!rs(s.src)||(n=!0)):i.push(s))}for(let e=0;e<i.length;e++)this.el_.removeChild(i[e])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&n&&Et.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading."),this.restoreMetadataTracksInIOSNativePlayer_(),(Zt||Kt)&&!0===e.nativeControlsForTouch&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),Zr.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){!function(e){if(!e.featuresSourceset)return;const t=e.el();if(t.resetSourceset_)return;const i=(e=>Kr([e.el(),s().HTMLMediaElement.prototype,Jr],"src"))(e),n=t.setAttribute,r=t.load;Object.defineProperty(t,"src",Lt(i,{set:n=>{const s=i.set.call(t,n);return e.triggerSourceset(t.src),s}})),t.setAttribute=(i,s)=>{const r=n.call(t,i,s);return/src/i.test(i)&&e.triggerSourceset(t.src),r},t.load=()=>{const i=r.call(t);return Xr(e)||(e.triggerSourceset(""),Qr(e)),i},t.currentSrc?e.triggerSourceset(t.currentSrc):Xr(e)||Qr(e),t.resetSourceset_=()=>{t.resetSourceset_=null,t.load=r,t.setAttribute=n,Object.defineProperty(t,"src",i),t.resetSourceWatch_&&t.resetSourceWatch_()}}(this)}restoreMetadataTracksInIOSNativePlayer_(){const e=this.textTracks();let t;const i=()=>{t=[];for(let i=0;i<e.length;i++){const n=e[i];"metadata"===n.kind&&t.push({track:n,storedMode:n.mode})}};i(),e.addEventListener("change",i),this.on("dispose",(()=>e.removeEventListener("change",i)));const n=()=>{for(let e=0;e<t.length;e++){const i=t[e];"disabled"===i.track.mode&&i.track.mode!==i.storedMode&&(i.track.mode=i.storedMode)}e.removeEventListener("change",n)};this.on("webkitbeginfullscreen",(()=>{e.removeEventListener("change",i),e.removeEventListener("change",n),e.addEventListener("change",n)})),this.on("webkitendfullscreen",(()=>{e.removeEventListener("change",i),e.addEventListener("change",i),e.removeEventListener("change",n)}))}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const i=e.toLowerCase();this[`${i}TracksListeners_`]&&Object.keys(this[`${i}TracksListeners_`]).forEach((e=>{this.el()[`${i}Tracks`].removeEventListener(e,this[`${i}TracksListeners_`][e])})),this[`featuresNative${e}Tracks`]=!t,this[`${i}TracksListeners_`]=null,this.proxyNativeTracksForType_(i)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=ps[e],i=this.el()[t.getterName],n=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!i||!i.addEventListener)return;const s={change:t=>{const i={type:"change",target:n,currentTarget:n,srcElement:n};n.trigger(i),"text"===e&&this[fs.remoteText.getterName]().trigger(i)},addtrack(e){n.addTrack(e.track)},removetrack(e){n.removeTrack(e.track)}},r=function(){const e=[];for(let t=0;t<n.length;t++){let s=!1;for(let e=0;e<i.length;e++)if(i[e]===n[t]){s=!0;break}s||e.push(n[t])}for(;e.length;)n.removeTrack(e.shift())};this[t.getterName+"Listeners_"]=s,Object.keys(s).forEach((e=>{const t=s[e];i.addEventListener(e,t),this.on("dispose",(n=>i.removeEventListener(e,t)))})),this.on("loadstart",r),this.on("dispose",(e=>this.off("loadstart",r)))}proxyNativeTracks_(){ps.names.forEach((e=>{this.proxyNativeTracksForType_(e)}))}createEl(){let e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){const t=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(t,e),Zr.disposeMediaElement(e),e=t}else{e=a().createElement("video");const t=Lt({},this.options_.tag&&yi(this.options_.tag));Zt&&!0===this.options_.nativeControlsForTouch||delete t.controls,gi(e,Object.assign(t,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}void 0!==this.options_.preload&&_i(e,"preload",this.options_.preload),void 0!==this.options_.disablePictureInPicture&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let i=0;i<t.length;i++){const n=t[i],s=this.options_[n];void 0!==s&&(s?_i(e,n,n):bi(e,n),e[n]=s)}return e}handleLateInit_(e){if(0===e.networkState||3===e.networkState)return;if(0===e.readyState){let e=!1;const t=function(){e=!0};this.on("loadstart",t);const i=function(){e||this.trigger("loadstart")};return this.on("loadedmetadata",i),void this.ready((function(){this.off("loadstart",t),this.off("loadedmetadata",i),e||this.trigger("loadstart")}))}const t=["loadstart"];t.push("loadedmetadata"),e.readyState>=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready((function(){t.forEach((function(e){this.trigger(e)}),this)}))}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&ii?this.el_.fastSeek(e):this.el_.currentTime=e}catch(e){Et(e,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&Bt&&Ht&&0===this.el_.currentTime){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",(()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)}))}supportsFullScreen(){return"function"==typeof this.el_.webkitEnterFullScreen}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)$n(this.el_.play()),this.setTimeout((function(){e.pause();try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}}),0);else try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}}exitFullScreen(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(void 0===e)return this.el_.src;this.setSrc(e)}reset(){Zr.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,i):super.addTextTrack(e,t,i)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=a().createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){const i=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(i),i}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let i=t.length;for(;i--;)e!==t[i]&&e!==t[i].track||this.el().removeChild(t[i])}}getVideoPlaybackQuality(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();const e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),s().performance&&(e.creationTime=s().performance.now()),e}}Rt(Zr,"TEST_VID",(function(){if(!ri())return;const e=a().createElement("video"),t=a().createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e})),Zr.isSupported=function(){try{Zr.TEST_VID.volume=.5}catch(e){return!1}return!(!Zr.TEST_VID||!Zr.TEST_VID.canPlayType)},Zr.canPlayType=function(e){return Zr.TEST_VID.canPlayType(e)},Zr.canPlaySource=function(e,t){return Zr.canPlayType(e.type)},Zr.canControlVolume=function(){try{const e=Zr.TEST_VID.volume;Zr.TEST_VID.volume=e/2+.1;const t=e!==Zr.TEST_VID.volume;return t&&ti?(s().setTimeout((()=>{Zr&&Zr.prototype&&(Zr.prototype.featuresVolumeControl=e!==Zr.TEST_VID.volume)})),!1):t}catch(e){return!1}},Zr.canMuteVolume=function(){try{const e=Zr.TEST_VID.muted;return Zr.TEST_VID.muted=!e,Zr.TEST_VID.muted?_i(Zr.TEST_VID,"muted","muted"):bi(Zr.TEST_VID,"muted"),e!==Zr.TEST_VID.muted}catch(e){return!1}},Zr.canControlPlaybackRate=function(){if(Bt&&Ht&&zt<58)return!1;try{const e=Zr.TEST_VID.playbackRate;return Zr.TEST_VID.playbackRate=e/2+.1,e!==Zr.TEST_VID.playbackRate}catch(e){return!1}},Zr.canOverrideAttributes=function(){try{const e=()=>{};Object.defineProperty(a().createElement("video"),"src",{get:e,set:e}),Object.defineProperty(a().createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(a().createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(a().createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return!1}return!0},Zr.supportsNativeTextTracks=function(){return ii||ti&&Ht},Zr.supportsNativeVideoTracks=function(){return!(!Zr.TEST_VID||!Zr.TEST_VID.videoTracks)},Zr.supportsNativeAudioTracks=function(){return!(!Zr.TEST_VID||!Zr.TEST_VID.audioTracks)},Zr.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach((function([e,t]){Rt(Zr.prototype,e,(()=>Zr[t]()),!0)})),Zr.prototype.featuresVolumeControl=Zr.canControlVolume(),Zr.prototype.movingMediaElementInDOM=!ti,Zr.prototype.featuresFullscreenResize=!0,Zr.prototype.featuresProgressEvents=!0,Zr.prototype.featuresTimeupdateEvents=!0,Zr.prototype.featuresVideoFrameCallback=!(!Zr.TEST_VID||!Zr.TEST_VID.requestVideoFrameCallback),Zr.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){}}()}},Zr.resetMediaElement=function(e){if(!e)return;const t=e.querySelectorAll("source");let i=t.length;for(;i--;)e.removeChild(t[i]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach((function(e){Zr.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}})),["muted","defaultMuted","autoplay","loop","playsinline"].forEach((function(e){Zr.prototype["set"+xn(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){Zr.prototype[e]=function(){return this.el_[e]}})),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach((function(e){Zr.prototype["set"+xn(e)]=function(t){this.el_[e]=t}})),["pause","load","play"].forEach((function(e){Zr.prototype[e]=function(){return this.el_[e]()}})),gs.withSourceHandlers(Zr),Zr.nativeSourceHandler={},Zr.nativeSourceHandler.canPlayType=function(e){try{return Zr.TEST_VID.canPlayType(e)}catch(e){return""}},Zr.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return Zr.nativeSourceHandler.canPlayType(e.type);if(e.src){const t=ss(e.src);return Zr.nativeSourceHandler.canPlayType(`video/${t}`)}return""},Zr.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)},Zr.nativeSourceHandler.dispose=function(){},Zr.registerSourceHandler(Zr.nativeSourceHandler),gs.registerTech("Html5",Zr);const ea=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],ta={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},ia=["tiny","xsmall","small","medium","large","xlarge","huge"],na={};ia.forEach((e=>{const t="x"===e.charAt(0)?`x-${e.substring(1)}`:e;na[e]=`vjs-layout-${t}`}));const sa={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class ra extends In{constructor(e,t,i){if(e.id=e.id||t.id||`vjs_video_${Gi()}`,(t=Object.assign(ra.getTagSettings(e),t)).initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const i=e.closest("[lang]");i&&(t.language=i.getAttribute("lang"))}if(super(null,t,i),this.boundDocumentFullscreenChange_=e=>this.documentFullscreenChange_(e),this.boundFullWindowOnEscKey_=e=>this.fullWindowOnEscKey(e),this.boundUpdateStyleEl_=e=>this.updateStyleEl_(e),this.boundApplyInitTime_=e=>this.applyInitTime_(e),this.boundUpdateCurrentBreakpoint_=e=>this.updateCurrentBreakpoint_(e),this.boundHandleTechClick_=e=>this.handleTechClick_(e),this.boundHandleTechDoubleClick_=e=>this.handleTechDoubleClick_(e),this.boundHandleTechTouchStart_=e=>this.handleTechTouchStart_(e),this.boundHandleTechTouchMove_=e=>this.handleTechTouchMove_(e),this.boundHandleTechTouchEnd_=e=>this.handleTechTouchEnd_(e),this.boundHandleTechTap_=e=>this.handleTechTap_(e),this.isFullscreen_=!1,this.log=Ct(this.id_),this.fsApi_=_t,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&yi(e),this.language(this.options_.language),t.languages){const e={};Object.getOwnPropertyNames(t.languages).forEach((function(i){e[i.toLowerCase()]=t.languages[i]})),this.languages_=e}else this.languages_=ra.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach((e=>{if("function"!=typeof this[e])throw new Error(`plugin "${e}" does not exist`)})),this.scrubbing_=!1,this.el_=this.createEl(),Sn(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(Zi(a(),this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const n=Lt(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach((e=>{this[e](t.plugins[e])})),t.debug&&this.debug(!0),this.options_.playerOptions=n,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const e=(new(s().DOMParser)).parseFromString('<svg xmlns="http://www.w3.org/2000/svg">\n <defs>\n <symbol viewBox="0 0 48 48" id="vjs-icon-play">\n <path d="M16 10v28l22-14z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-pause">\n <path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-audio">\n <path d="M24 2C14.06 2 6 10.06 6 20v14c0 3.31 2.69 6 6 6h6V24h-8v-4c0-7.73 6.27-14 14-14s14 6.27 14 14v4h-8v16h6c3.31 0 6-2.69 6-6V20c0-9.94-8.06-18-18-18z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-captions">\n <path d="M38 8H10c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM22 22h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2zm14 0h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-subtitles">\n <path d="M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-enter">\n <path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-exit">\n <path d="M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-play-circle">\n <path d="M20 33l12-9-12-9v18zm4-29C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-mute">\n <path d="M33 24c0-3.53-2.04-6.58-5-8.05v4.42l4.91 4.91c.06-.42.09-.85.09-1.28zm5 0c0 1.88-.41 3.65-1.08 5.28l3.03 3.03C41.25 29.82 42 27 42 24c0-8.56-5.99-15.72-14-17.54v4.13c5.78 1.72 10 7.07 10 13.41zM8.55 6L6 8.55 15.45 18H6v12h8l10 10V26.55l8.51 8.51c-1.34 1.03-2.85 1.86-4.51 2.36v4.13a17.94 17.94 0 0 0 7.37-3.62L39.45 42 42 39.45l-18-18L8.55 6zM24 8l-4.18 4.18L24 16.36V8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-low">\n <path d="M14 18v12h8l10 10V8L22 18h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-medium">\n <path d="M37 24c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zm-27-6v12h8l10 10V8L18 18h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-high">\n <path d="M6 18v12h8l10 10V8L14 18H6zm27 6c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zM28 6.46v4.13c5.78 1.72 10 7.07 10 13.41s-4.22 11.69-10 13.41v4.13c8.01-1.82 14-8.97 14-17.54S36.01 8.28 28 6.46z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-spinner">\n <path d="M18.8 21l9.53-16.51C26.94 4.18 25.49 4 24 4c-4.8 0-9.19 1.69-12.64 4.51l7.33 12.69.11-.2zm24.28-3c-1.84-5.85-6.3-10.52-11.99-12.68L23.77 18h19.31zm.52 2H28.62l.58 1 9.53 16.5C41.99 33.94 44 29.21 44 24c0-1.37-.14-2.71-.4-4zm-26.53 4l-7.8-13.5C6.01 14.06 4 18.79 4 24c0 1.37.14 2.71.4 4h14.98l-2.31-4zM4.92 30c1.84 5.85 6.3 10.52 11.99 12.68L24.23 30H4.92zm22.54 0l-7.8 13.51c1.4.31 2.85.49 4.34.49 4.8 0 9.19-1.69 12.64-4.51L29.31 26.8 27.46 30z"></path>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-hd">\n <path d="M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12H9.5v-2h-2v2H6V9h1.5v2.5h2V9H11v6zm2-6h4c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1h-4V9zm1.5 4.5h2v-3h-2v3z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-chapters">\n <path d="M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"></path>\n </symbol>\n <symbol viewBox="0 0 40 40" id="vjs-icon-downloading">\n <path d="M18.208 36.875q-3.208-.292-5.979-1.729-2.771-1.438-4.812-3.729-2.042-2.292-3.188-5.229-1.146-2.938-1.146-6.23 0-6.583 4.334-11.416 4.333-4.834 10.833-5.5v3.166q-5.167.75-8.583 4.646Q6.25 14.75 6.25 19.958q0 5.209 3.396 9.104 3.396 3.896 8.562 4.646zM20 28.417L11.542 20l2.083-2.083 4.917 4.916v-11.25h2.916v11.25l4.875-4.916L28.417 20zm1.792 8.458v-3.167q1.833-.25 3.541-.958 1.709-.708 3.167-1.875l2.333 2.292q-1.958 1.583-4.25 2.541-2.291.959-4.791 1.167zm6.791-27.792q-1.541-1.125-3.25-1.854-1.708-.729-3.541-1.021V3.042q2.5.25 4.77 1.208 2.271.958 4.271 2.5zm4.584 21.584l-2.25-2.25q1.166-1.5 1.854-3.209.687-1.708.937-3.541h3.209q-.292 2.5-1.229 4.791-.938 2.292-2.521 4.209zm.541-12.417q-.291-1.833-.958-3.562-.667-1.73-1.833-3.188l2.375-2.208q1.541 1.916 2.458 4.208.917 2.292 1.167 4.75z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download">\n <path d="M10.8 40.55q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h26.35v-7.7h3.4v7.7q0 1.4-1 2.4t-2.4 1zM24 32.1L13.9 22.05l2.45-2.45 5.95 5.95V7.15h3.4v18.4l5.95-5.95 2.45 2.45z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-done">\n <path d="M9.8 40.5v-3.45h28.4v3.45zm9.2-9.05L7.4 19.85l2.45-2.35L19 26.65l19.2-19.2 2.4 2.4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-off">\n <path d="M4.9 4.75L43.25 43.1 41 45.3l-4.75-4.75q-.05.05-.075.025-.025-.025-.075-.025H10.8q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h22.05l-7-7-1.85 1.8L13.9 21.9l1.85-1.85L2.7 7zm26.75 14.7l2.45 2.45-3.75 3.8-2.45-2.5zM25.7 7.15V21.1l-3.4-3.45V7.15z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-share">\n <path d="M36 32.17c-1.52 0-2.89.59-3.93 1.54L17.82 25.4c.11-.45.18-.92.18-1.4s-.07-.95-.18-1.4l14.1-8.23c1.07 1 2.5 1.62 4.08 1.62 3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6c0 .48.07.95.18 1.4l-14.1 8.23c-1.07-1-2.5-1.62-4.08-1.62-3.31 0-6 2.69-6 6s2.69 6 6 6c1.58 0 3.01-.62 4.08-1.62l14.25 8.31c-.1.42-.16.86-.16 1.31A5.83 5.83 0 1 0 36 32.17z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cog">\n <path d="M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97L29 4.84c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3a14.8 14.8 0 0 0-3.38 1.97L9.9 10.1a1 1 0 0 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31C9.06 22.69 9 23.34 9 24s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3a14.8 14.8 0 0 0 3.38-1.97l4.98 2.01a1 1 0 0 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zM24 31c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-square">\n <path d="M36 8H12c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h24c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zm0 28H12V12h24v24z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle">\n <circle cx="24" cy="24" r="20"></circle>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle-outline">\n <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle-inner-circle">\n <path d="M24 4C12.97 4 4 12.97 4 24s8.97 20 20 20 20-8.97 20-20S35.03 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16zm6-16c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6 6 2.69 6 6z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cancel">\n <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm10 27.17L31.17 34 24 26.83 16.83 34 14 31.17 21.17 24 14 16.83 16.83 14 24 21.17 31.17 14 34 16.83 26.83 24 34 31.17z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-replay">\n <path d="M24 10V2L14 12l10 10v-8c6.63 0 12 5.37 12 12s-5.37 12-12 12-12-5.37-12-12H8c0 8.84 7.16 16 16 16s16-7.16 16-16-7.16-16-16-16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-repeat">\n <path d="M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-5">\n <path d="M17.689 98l-8.697 8.696 8.697 8.697 2.486-2.485-4.32-4.319h1.302c4.93 0 9.071 1.722 12.424 5.165 3.352 3.443 5.029 7.638 5.029 12.584h3.55c0-2.958-.553-5.73-1.658-8.313-1.104-2.583-2.622-4.841-4.555-6.774-1.932-1.932-4.19-3.45-6.773-4.555-2.584-1.104-5.355-1.657-8.313-1.657H15.5l4.615-4.615zm-8.08 21.659v13.861h11.357v5.008H9.609V143h12.7c.834 0 1.55-.298 2.146-.894.596-.597.895-1.31.895-2.145v-7.781c0-.835-.299-1.55-.895-2.147a2.929 2.929 0 0 0-2.147-.894h-8.227v-5.096H25.35v-4.384z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-10">\n <path d="M42.315 125.63c0-4.997-1.694-9.235-5.08-12.713-3.388-3.479-7.571-5.218-12.552-5.218h-1.315l4.363 4.363-2.51 2.51-8.787-8.786L25.221 97l2.45 2.45-4.662 4.663h1.375c2.988 0 5.788.557 8.397 1.673 2.61 1.116 4.892 2.65 6.844 4.602 1.953 1.953 3.487 4.234 4.602 6.844 1.116 2.61 1.674 5.41 1.674 8.398zM8.183 142v-19.657H3.176V117.8h9.643V142zm13.63 0c-1.156 0-2.127-.393-2.912-1.178-.778-.778-1.168-1.746-1.168-2.902v-16.04c0-1.156.393-2.127 1.178-2.912.779-.779 1.746-1.168 2.902-1.168h7.696c1.156 0 2.126.392 2.911 1.177.779.78 1.168 1.747 1.168 2.903v16.04c0 1.156-.392 2.127-1.177 2.912-.779.779-1.746 1.168-2.902 1.168zm.556-4.636h6.583v-15.02H22.37z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-30">\n <path d="M26.047 97l-8.733 8.732 8.733 8.733 2.496-2.494-4.336-4.338h1.307c4.95 0 9.108 1.73 12.474 5.187 3.367 3.458 5.051 7.668 5.051 12.635h3.565c0-2.97-.556-5.751-1.665-8.346-1.109-2.594-2.633-4.862-4.574-6.802-1.94-1.941-4.208-3.466-6.803-4.575-2.594-1.109-5.375-1.664-8.345-1.664H23.85l4.634-4.634zM2.555 117.531v4.688h10.297v5.25H5.873v4.687h6.979v5.156H2.555V142H13.36c1.061 0 1.95-.395 2.668-1.186.718-.79 1.076-1.772 1.076-2.94v-16.218c0-1.168-.358-2.149-1.076-2.94-.717-.79-1.607-1.185-2.668-1.185zm22.482.14c-1.149 0-2.11.39-2.885 1.165-.78.78-1.172 1.744-1.172 2.893v15.943c0 1.149.388 2.11 1.163 2.885.78.78 1.745 1.172 2.894 1.172h7.649c1.148 0 2.11-.388 2.884-1.163.78-.78 1.17-1.745 1.17-2.894v-15.943c0-1.15-.386-2.111-1.16-2.885-.78-.78-1.746-1.172-2.894-1.172zm.553 4.518h6.545v14.93H25.59z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-5">\n <path d="M29.508 97l-2.431 2.43 4.625 4.625h-1.364c-2.965 0-5.742.554-8.332 1.66-2.589 1.107-4.851 2.629-6.788 4.566-1.937 1.937-3.458 4.2-4.565 6.788-1.107 2.59-1.66 5.367-1.66 8.331h3.557c0-4.957 1.68-9.16 5.04-12.611 3.36-3.45 7.51-5.177 12.451-5.177h1.304l-4.326 4.33 2.49 2.49 8.715-8.716zm-9.783 21.61v13.89h11.382v5.018H19.725V142h12.727a2.93 2.93 0 0 0 2.15-.896 2.93 2.93 0 0 0 .896-2.15v-7.798c0-.837-.299-1.554-.896-2.152a2.93 2.93 0 0 0-2.15-.896h-8.245V123h11.29v-4.392z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-10">\n <path d="M23.119 97l-2.386 2.383 4.538 4.538h-1.339c-2.908 0-5.633.543-8.173 1.63-2.54 1.085-4.76 2.577-6.66 4.478-1.9 1.9-3.392 4.12-4.478 6.66-1.085 2.54-1.629 5.264-1.629 8.172h3.49c0-4.863 1.648-8.986 4.944-12.372 3.297-3.385 7.368-5.078 12.216-5.078h1.279l-4.245 4.247 2.443 2.442 8.55-8.55zm-9.52 21.45v4.42h4.871V142h4.513v-23.55zm18.136 0c-1.125 0-2.066.377-2.824 1.135-.764.764-1.148 1.709-1.148 2.834v15.612c0 1.124.38 2.066 1.139 2.824.764.764 1.708 1.145 2.833 1.145h7.489c1.125 0 2.066-.378 2.824-1.136.764-.764 1.145-1.709 1.145-2.833v-15.612c0-1.125-.378-2.067-1.136-2.825-.764-.764-1.708-1.145-2.833-1.145zm.54 4.42h6.408v14.617h-6.407z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-30">\n <path d="M25.549 97l-2.437 2.434 4.634 4.635H26.38c-2.97 0-5.753.555-8.347 1.664-2.594 1.109-4.861 2.633-6.802 4.574-1.94 1.94-3.465 4.207-4.574 6.802-1.109 2.594-1.664 5.377-1.664 8.347h3.565c0-4.967 1.683-9.178 5.05-12.636 3.366-3.458 7.525-5.187 12.475-5.187h1.307l-4.335 4.338 2.495 2.494 8.732-8.732zm-11.553 20.53v4.689h10.297v5.249h-6.978v4.688h6.978v5.156H13.996V142h10.808c1.06 0 1.948-.395 2.666-1.186.718-.79 1.077-1.771 1.077-2.94v-16.217c0-1.169-.36-2.15-1.077-2.94-.718-.79-1.605-1.186-2.666-1.186zm21.174.168c-1.149 0-2.11.389-2.884 1.163-.78.78-1.172 1.745-1.172 2.894v15.942c0 1.15.388 2.11 1.162 2.885.78.78 1.745 1.17 2.894 1.17h7.649c1.149 0 2.11-.386 2.885-1.16.78-.78 1.17-1.746 1.17-2.895v-15.942c0-1.15-.387-2.11-1.161-2.885-.78-.78-1.745-1.172-2.894-1.172zm.552 4.516h6.542v14.931h-6.542z"></path>\n </symbol>\n <symbol viewBox="0 0 512 512" id="vjs-icon-audio-description">\n <g fill-rule="evenodd"><path d="M227.29 381.351V162.993c50.38-1.017 89.108-3.028 117.631 17.126 27.374 19.342 48.734 56.965 44.89 105.325-4.067 51.155-41.335 94.139-89.776 98.475-24.085 2.155-71.972 0-71.972 0s-.84-1.352-.773-2.568m48.755-54.804c31.43 1.26 53.208-16.633 56.495-45.386 4.403-38.51-21.188-63.552-58.041-60.796v103.612c-.036 1.466.575 2.22 1.546 2.57"></path><path d="M383.78 381.328c13.336 3.71 17.387-11.06 23.215-21.408 12.722-22.571 22.294-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.226 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M425.154 381.328c13.336 3.71 17.384-11.061 23.215-21.408 12.721-22.571 22.291-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.511c-.586 3.874 2.226 7.315 3.866 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M466.26 381.328c13.337 3.71 17.385-11.061 23.216-21.408 12.722-22.571 22.292-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.225 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894M4.477 383.005H72.58l18.573-28.484 64.169-.135s.065 19.413.065 28.62h48.756V160.307h-58.816c-5.653 9.537-140.85 222.697-140.85 222.697zm152.667-145.282v71.158l-40.453-.27 40.453-70.888z"></path></g>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-next-item">\n <path d="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-previous-item">\n <path d="M12 12h4v24h-4zm7 12l17 12V12z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-shuffle">\n <path d="M21.17 18.34L10.83 8 8 10.83l10.34 10.34 2.83-2.83zM29 8l4.09 4.09L8 37.17 10.83 40l25.09-25.09L40 19V8H29zm.66 18.83l-2.83 2.83 6.26 6.26L29 40h11V29l-4.09 4.09-6.25-6.26z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cast">\n <path d="M42 6H6c-2.21 0-4 1.79-4 4v6h4v-6h36v28H28v4h14c2.21 0 4-1.79 4-4V10c0-2.21-1.79-4-4-4zM2 36v6h6c0-3.31-2.69-6-6-6zm0-8v4c5.52 0 10 4.48 10 10h4c0-7.73-6.27-14-14-14zm0-8v4c9.94 0 18 8.06 18 18h4c0-12.15-9.85-22-22-22z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-picture-in-picture-enter">\n <path d="M38 22H22v11.99h16V22zm8 16V9.96C46 7.76 44.2 6 42 6H6C3.8 6 2 7.76 2 9.96V38c0 2.2 1.8 4 4 4h36c2.2 0 4-1.8 4-4zm-4 .04H6V9.94h36v28.1z"></path>\n </symbol>\n <symbol viewBox="0 0 22 18" id="vjs-icon-picture-in-picture-exit">\n <path d="M18 4H4v10h14V4zm4 12V1.98C22 .88 21.1 0 20 0H2C.9 0 0 .88 0 1.98V16c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H2V1.97h18v14.05z"></path>\n <path fill="none" d="M-1-3h24v24H-1z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-facebook">\n <path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-linkedin">\n <path d="M477 625v991H147V625h330zm21-306q1 73-50.5 122T312 490h-2q-82 0-132-49t-50-122q0-74 51.5-122.5T314 148t133 48.5T498 319zm1166 729v568h-329v-530q0-105-40.5-164.5T1168 862q-63 0-105.5 34.5T999 982q-11 30-11 81v553H659q2-399 2-647t-1-296l-1-48h329v144h-2q20-32 41-56t56.5-52 87-43.5T1285 602q171 0 275 113.5t104 332.5z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-twitter">\n <path d="M1684 408q-67 98-162 167 1 14 1 42 0 130-38 259.5T1369.5 1125 1185 1335.5t-258 146-323 54.5q-271 0-496-145 35 4 78 4 225 0 401-138-105-2-188-64.5T285 1033q33 5 61 5 43 0 85-11-112-23-185.5-111.5T172 710v-4q68 38 146 41-66-44-105-115t-39-154q0-88 44-163 121 149 294.5 238.5T884 653q-8-38-8-74 0-134 94.5-228.5T1199 256q140 0 236 102 109-21 205-78-37 115-142 178 93-10 186-50z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-tumblr">\n <path d="M1328 1329l80 237q-23 35-111 66t-177 32q-104 2-190.5-26T787 1564t-95-106-55.5-120-16.5-118V676H452V461q72-26 129-69.5t91-90 58-102 34-99T779 12q1-5 4.5-8.5T791 0h244v424h333v252h-334v518q0 30 6.5 56t22.5 52.5 49.5 41.5 81.5 14q78-2 134-29z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-pinterest">\n <path d="M1664 896q0 209-103 385.5T1281.5 1561 896 1664q-111 0-218-32 59-93 78-164 9-34 54-211 20 39 73 67.5t114 28.5q121 0 216-68.5t147-188.5 52-270q0-114-59.5-214T1180 449t-255-63q-105 0-196 29t-154.5 77-109 110.5-67 129.5T377 866q0 104 40 183t117 111q30 12 38-20 2-7 8-31t8-30q6-23-11-43-51-61-51-151 0-151 104.5-259.5T904 517q151 0 235.5 82t84.5 213q0 170-68.5 289T980 1220q-61 0-98-43.5T859 1072q8-35 26.5-93.5t30-103T927 800q0-50-27-83t-77-33q-62 0-105 57t-43 142q0 73 25 122l-99 418q-17 70-13 177-206-91-333-281T128 896q0-209 103-385.5T510.5 231 896 128t385.5 103T1561 510.5 1664 896z"></path>\n </symbol>\n </defs>\n</svg>',"image/svg+xml");if(e.querySelector("parsererror"))Et.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const t=e.documentElement;t.style.display="none",this.el_.appendChild(t),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio("audio"===e.nodeName.toLowerCase()),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),Zt&&this.addClass("vjs-touch-enabled"),ti||this.addClass("vjs-workinghover"),ra.players[this.id_]=this;const r=mt.split(".")[0];this.addClass(`vjs-v${r}`),this.userActive(!0),this.reportUserActivity(),this.one("play",(e=>this.listenForUserActivity_(e))),this.on("keydown",(e=>this.handleKeyDown(e))),this.on("languagechange",(e=>this.handleLanguagechange(e))),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",(()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)}))}dispose(){this.trigger("dispose"),this.off("dispose"),en(a(),this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),en(a(),"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),ra.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),vs[this.id()]=null,ms.names.forEach((e=>{const t=this[ms[e].getterName]();t&&t.off&&t.off()})),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e,t=this.tag,i=this.playerElIngest_=t.parentNode&&t.parentNode.hasAttribute&&t.parentNode.hasAttribute("data-vjs-player");const n="video-js"===this.tag.tagName.toLowerCase();i?e=this.el_=t.parentNode:n||(e=this.el_=super.createEl("div"));const r=yi(t);if(n){for(e=this.el_=t,t=this.tag=a().createElement("video");e.children.length;)t.appendChild(e.firstChild);di(e,"video-js")||pi(e,"video-js"),e.appendChild(t),i=this.playerElIngest_=e,Object.keys(e).forEach((i=>{try{t[i]=e[i]}catch(e){}}))}if(t.setAttribute("tabindex","-1"),r.tabindex="-1",Ht&&Xt&&(t.setAttribute("role","application"),r.role="application"),t.removeAttribute("width"),t.removeAttribute("height"),"width"in r&&delete r.width,"height"in r&&delete r.height,Object.getOwnPropertyNames(r).forEach((function(i){n&&"class"===i||e.setAttribute(i,r[i]),n&&t.setAttribute(i,r[i])})),t.playerId=t.id,t.id+="_html5_api",t.className="vjs-tech",t.player=e.player=this,this.addClass("vjs-paused"),!0!==s().VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=$i("vjs-styles-dimensions");const e=Li(".vjs-styles-defaults"),t=Li("head");t.insertBefore(this.styleEl_,e?e.nextSibling:t.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const o=t.getElementsByTagName("a");for(let e=0;e<o.length;e++){const t=o.item(e);pi(t,"vjs-hidden"),t.setAttribute("hidden","hidden")}return t.initNetworkState_=t.networkState,t.parentNode&&!i&&t.parentNode.insertBefore(e,t),hi(t,e),this.children_.unshift(t),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=e,e}crossOrigin(e){if(void 0===e)return this.techGet_("crossOrigin");null===e||"anonymous"===e||"use-credentials"===e?(this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e)):Et.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`)}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){const i=e+"_";if(void 0===t)return this[i]||0;if(""===t||"auto"===t)return this[i]=void 0,void this.updateStyleEl_();const n=parseFloat(t);isNaN(n)?Et.error(`Improper value "${t}" supplied for for ${e}`):(this[i]=n,this.updateStyleEl_())}fluid(e){if(void 0===e)return!!this.fluid_;var t,i;this.fluid_=!!e,fn(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),i=()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)},fn(t=this)?i():(t.eventedCallbacks||(t.eventedCallbacks=[]),t.eventedCallbacks.push(i))):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(void 0===e)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(!0===s().VIDEOJS_NO_DYNAMIC_STYLE){const e="number"==typeof this.width_?this.width_:this.options_.width,t="number"==typeof this.height_?this.height_:this.options_.height,i=this.tech_&&this.tech_.el();return void(i&&(e>=0&&(i.width=e),t>=0&&(i.height=t)))}let e,t,i,n;i=void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9";const r=i.split(":"),a=r[1]/r[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/a:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*a,n=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(n),Hi(this.styleEl_,`\n .${n} {\n width: ${e}px;\n height: ${t}px;\n }\n\n .${n}.vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: ${100*a}%;\n }\n `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const i=xn(e),n=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==i&&this.tag&&(gs.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=i,this.isReady_=!1;let s=this.autoplay();("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(s=!1);const r={source:t,autoplay:s,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${n}_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};ms.names.forEach((e=>{const t=ms[e];r[t.getterName]=this[t.privateName]})),Object.assign(r,this.options_[i]),Object.assign(r,this.options_[n]),Object.assign(r,this.options_[e.toLowerCase()]),this.tag&&(r.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(r.startTime=this.cache_.currentTime);const a=gs.getTech(e);if(!a)throw new Error(`No Tech named '${i}' exists! '${i}' should be registered using videojs.registerTech()'`);var o,l;this.tech_=new a(r),this.tech_.ready(on(this,this.handleTechReady_),!0),o=this.textTracksJson_||[],l=this.tech_,o.forEach((function(e){const t=l.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach((e=>t.addCue(e)))})),l.textTracks(),ea.forEach((e=>{this.on(this.tech_,e,(t=>this[`handleTech${xn(e)}_`](t)))})),Object.keys(ta).forEach((e=>{this.on(this.tech_,e,(t=>{0===this.tech_.playbackRate()&&this.tech_.seeking()?this.queuedCallbacks_.push({callback:this[`handleTech${ta[e]}_`].bind(this),event:t}):this[`handleTech${ta[e]}_`](t)}))})),this.on(this.tech_,"loadstart",(e=>this.handleTechLoadStart_(e))),this.on(this.tech_,"sourceset",(e=>this.handleTechSourceset_(e))),this.on(this.tech_,"waiting",(e=>this.handleTechWaiting_(e))),this.on(this.tech_,"ended",(e=>this.handleTechEnded_(e))),this.on(this.tech_,"seeking",(e=>this.handleTechSeeking_(e))),this.on(this.tech_,"play",(e=>this.handleTechPlay_(e))),this.on(this.tech_,"pause",(e=>this.handleTechPause_(e))),this.on(this.tech_,"durationchange",(e=>this.handleTechDurationChange_(e))),this.on(this.tech_,"fullscreenchange",((e,t)=>this.handleTechFullscreenChange_(e,t))),this.on(this.tech_,"fullscreenerror",((e,t)=>this.handleTechFullscreenError_(e,t))),this.on(this.tech_,"enterpictureinpicture",(e=>this.handleTechEnterPictureInPicture_(e))),this.on(this.tech_,"leavepictureinpicture",(e=>this.handleTechLeavePictureInPicture_(e))),this.on(this.tech_,"error",(e=>this.handleTechError_(e))),this.on(this.tech_,"posterchange",(e=>this.handleTechPosterChange_(e))),this.on(this.tech_,"textdata",(e=>this.handleTechTextData_(e))),this.on(this.tech_,"ratechange",(e=>this.handleTechRateChange_(e))),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===i&&this.tag||hi(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){ms.names.forEach((e=>{const t=ms[e];this[t.privateName]=this[t.getterName]()})),this.textTracksJson_=function(e){const t=e.$$("track"),i=Array.prototype.map.call(t,(e=>e.track));return Array.prototype.map.call(t,(function(e){const t=Hn(e.track);return e.src&&(t.src=e.src),t})).concat(Array.prototype.filter.call(e.textTracks(),(function(e){return-1===i.indexOf(e)})).map(Hn))}(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return void 0===e&&Et.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_}version(){return{"video.js":mt}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||"string"!=typeof e)return;const t=()=>{const e=this.muted();this.muted(!0);const t=()=>{this.muted(e)};this.playTerminatedQueue_.push(t);const i=this.play();if(qn(i))return i.catch((e=>{throw t(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${e||""}`)}))};let i;return"any"!==e||this.muted()?i="muted"!==e||this.muted()?this.play():t():(i=this.play(),qn(i)&&(i=i.catch(t))),qn(i)?i.then((()=>{this.trigger({type:"autoplay-success",autoplay:e})})).catch((()=>{this.trigger({type:"autoplay-failure",autoplay:e})})):void 0}updateSourceCaches_(e=""){let t=e,i="";"string"!=typeof t&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=((e,t)=>{if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;const i=e.cache_.sources.filter((e=>e.src===t));if(i.length)return i[0].type;const n=e.$$("source");for(let e=0;e<n.length;e++){const i=n[e];if(i.type&&i.src&&i.src===t)return i.type}return As(t)})(this,t)),this.cache_.source=Lt({},e,{src:t,type:i});const n=this.cache_.sources.filter((e=>e.src&&e.src===t)),s=[],r=this.$$("source"),a=[];for(let e=0;e<r.length;e++){const i=yi(r[e]);s.push(i),i.src&&i.src===t&&a.push(i.src)}a.length&&!n.length?this.cache_.sources=s:n.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=e=>this.updateSourceCaches_(e);const i=this.currentSource().src,n=e.src;i&&!/^blob:/.test(i)&&/^blob:/.test(n)&&(!this.lastSource_||this.lastSource_.tech!==n&&this.lastSource_.player!==i)&&(t=()=>{}),t(n),e.src||this.tech_.any(["sourceset","loadstart"],(e=>{if("sourceset"===e.type)return;const t=this.techGet_("currentSrc");this.lastSource_.tech=t,this.updateSourceCaches_(t)}))}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(void 0===e)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach((e=>e.callback(e.event))),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.click&&!1===this.options_.userActions.click||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.click?this.options_.userActions.click.call(this,e):this.paused()?$n(this.play()):this.pause()))}handleTechDoubleClick_(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),(t=>t.contains(e.target)))||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this)return;const i=this.el();let n=a()[this.fsApi_.fullscreenElement]===i;!n&&i.matches&&(n=i.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(n)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",(()=>{this.removeClass("vjs-ios-native-fs")}))),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready((function(){if(e in ws)return function(e,t,i,n){return t[i](e.reduce(Cs(i),n))}(this.middleware_,this.tech_,e,t);if(e in Es)return Ts(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(e){throw Et(e),e}}),!0)}techGet_(e){if(this.tech_&&this.tech_.isReady_){if(e in Ss)return function(e,t,i){return e.reduceRight(Cs(i),t[i]())}(this.middleware_,this.tech_,e);if(e in Es)return Ts(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw Et(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t;if("TypeError"===t.name)throw Et(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t;throw Et(t),t}}}play(){return new Promise((e=>{this.play_(e)}))}play_(e=$n){this.playCallbacks_.push(e);const t=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc())),i=Boolean(ii||ti);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t)return this.waitToPlay_=e=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(!t&&i&&this.load());const n=this.techGet_("play");i&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),null===n?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(n)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach((function(e){e()}))}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach((function(t){t(e)}))}pause(){this.techCall_("pause")}paused(){return!1!==this.techGet_("paused")}played(){return this.techGet_("played")||Ln(0,0)}scrubbing(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){return void 0===e?(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime):(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),this.cache_.initTime=0,void(isFinite(e)&&(this.cache_.currentTime=Number(e)))):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_)))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return e&&e.length||(e=Ln(0,0)),e}seekable(){let e=this.techGet_("seekable");return e&&e.length||(e=Ln(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return Bn(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let i=e.end(e.length-1);return i>t&&(i=t),i}volume(e){let t;return void 0!==e?(t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)}muted(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)}defaultMuted(e){return void 0!==e&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(void 0!==e){const t=this.isFullscreen_;return this.isFullscreen_=Boolean(e),this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise(((i,n)=>{function s(){t.off("fullscreenerror",a),t.off("fullscreenchange",r)}function r(){s(),i()}function a(e,t){s(),n(t)}t.one("fullscreenchange",r),t.one("fullscreenerror",a);const o=t.requestFullscreenHelper_(e);o&&(o.then(s,s),o.then(i,n))}))}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(t=e)),this.fsApi_.requestFullscreen){const e=this.el_[this.fsApi_.requestFullscreen](t);return e&&e.then((()=>this.isFullscreen(!0)),(()=>this.isFullscreen(!1))),e}this.tech_.supportsFullScreen()&&1==!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise(((t,i)=>{function n(){e.off("fullscreenerror",r),e.off("fullscreenchange",s)}function s(){n(),t()}function r(e,t){n(),i(t)}e.one("fullscreenchange",s),e.one("fullscreenerror",r);const a=e.exitFullscreenHelper_();a&&(a.then(n,n),a.then(t,i))}))}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=a()[this.fsApi_.exitFullscreen]();return e&&$n(e.then((()=>this.isFullscreen(!1)))),e}this.tech_.supportsFullScreen()&&1==!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=a().documentElement.style.overflow,Zi(a(),"keydown",this.boundFullWindowOnEscKey_),a().documentElement.style.overflow="hidden",pi(a().body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){l().isEventKey(e,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,en(a(),"keydown",this.boundFullWindowOnEscKey_),a().documentElement.style.overflow=this.docOrigOverflow,fi(a().body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){return void 0!==e?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&s().documentPictureInPicture){const e=a().createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(ci("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),s().documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then((t=>(Ni(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:t}),t.addEventListener("pagehide",(t=>{const i=t.target.querySelector(".video-js");e.parentNode.replaceChild(i,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")})),t)))}return"pictureInPictureEnabled"in a()&&!1===this.disablePictureInPicture()?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){return s().documentPictureInPicture&&s().documentPictureInPicture.window?(s().documentPictureInPicture.window.close(),Promise.resolve()):"pictureInPictureEnabled"in a()?a().exitPictureInPicture():void 0}handleKeyDown(e){const{userActions:t}=this.options_;t&&t.hotkeys&&((e=>{const t=e.tagName.toLowerCase();return!!e.isContentEditable||("input"===t?-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(e.type):-1!==["textarea"].indexOf(t))})(this.el_.ownerDocument.activeElement)||("function"==typeof t.hotkeys?t.hotkeys.call(this,e):this.handleHotkeys(e)))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:i=(e=>l().isEventKey(e,"f")),muteKey:n=(e=>l().isEventKey(e,"m")),playPauseKey:s=(e=>l().isEventKey(e,"k")||l().isEventKey(e,"Space"))}=t;if(i.call(this,e)){e.preventDefault(),e.stopPropagation();const t=In.getComponent("FullscreenToggle");!1!==a()[this.fsApi_.fullscreenEnabled]&&t.prototype.handleClick.call(this,e)}else n.call(this,e)?(e.preventDefault(),e.stopPropagation(),In.getComponent("MuteToggle").prototype.handleClick.call(this,e)):s.call(this,e)&&(e.preventDefault(),e.stopPropagation(),In.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let i=0,n=this.options_.techOrder;i<n.length;i++){const s=n[i];let r=gs.getTech(s);if(r||(r=In.getComponent(s)),r){if(r.isSupported()&&(t=r.canPlayType(e),t))return t}else Et.error(`The "${s}" tech is undefined. Skipped browser support check for that tech.`)}return""}selectSource(e){const t=this.options_.techOrder.map((e=>[e,gs.getTech(e)])).filter((([e,t])=>t?t.isSupported():(Et.error(`The "${e}" tech is undefined. Skipped browser support check for that tech.`),!1))),i=function(e,t,i){let n;return e.some((e=>t.some((t=>{if(n=i(e,t),n)return!0})))),n};let n;const s=([e,t],i)=>{if(t.canPlaySource(i,this.options_[e.toLowerCase()]))return{source:i,tech:e}};var r;return n=this.options_.sourceOrder?i(e,t,(r=s,(e,t)=>r(t,e))):i(t,e,s),n||!1}handleSrc_(e,t){if(void 0===e)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const i=Is(e);if(i.length){if(this.changingSrc_=!0,t||(this.cache_.sources=i),this.updateSourceCaches_(i[0]),bs(this,i[0],((e,n)=>{if(this.middleware_=n,t||(this.cache_.sources=i),this.updateSourceCaches_(e),this.src_(e))return i.length>1?this.handleSrc_(i.slice(1)):(this.changingSrc_=!1,this.setTimeout((function(){this.error({code:4,message:this.options_.notSupportedMessage})}),0),void this.triggerReady());var s,r;s=n,r=this.tech_,s.forEach((e=>e.setTech&&e.setTech(r)))})),i.length>1){const e=()=>{this.error(null),this.handleSrc_(i.slice(1),!0)},t=()=>{this.off("error",e)};this.one("error",e),this.one("playing",t),this.resetRetryOnError_=()=>{this.off("error",e),this.off("playing",t)}}}else this.setTimeout((function(){this.error({code:4,message:this.options_.notSupportedMessage})}),0)}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return!t||(kn(t.tech,this.techName_)?(this.ready((function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1}),!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready((()=>{this.changingSrc_=!1})),!1))}load(){this.tech_&&this.tech_.vhs?this.src(this.currentSource()):this.techCall_("load")}reset(){this.paused()?this.doReset_():$n(this.play().then((()=>this.doReset_())))}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),fn(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:i,remainingTimeDisplay:n}=this.controlBar||{},{seekBar:s}=i||{};e&&e.updateContent(),t&&t.updateContent(),n&&n.updateContent(),s&&(s.update(),s.loadProgressBar&&s.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")}autoplay(e){if(void 0===e)return this.options_.autoplay||!1;let t;"string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"==typeof e?e:"play"),t=!1):this.options_.autoplay=!!e,t=void 0===t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return void 0!==e&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")}poster(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(void 0===e)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(void 0===e)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(void 0===e)return this.error_||null;if(yt("beforeerror").forEach((t=>{const i=t(this,e);Pt(i)&&!Array.isArray(i)||"string"==typeof i||"number"==typeof i||null===i?e=i:this.log.error("please return a value that MediaError expects in beforeerror hooks")})),this.options_.suppressNotSupportedError&&e&&4===e.code){const t=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),void this.one("loadstart",(function(){this.off(["click","touchstart"],t)}))}if(null===e)return this.error_=null,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new Fn(e),this.addClass("vjs-error"),Et.error(`(CODE:${this.error_.code} ${Fn.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),yt("error").forEach((e=>e(this,this.error_)))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",(function(e){e.stopPropagation(),e.preventDefault()})),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,i;const n=on(this,this.reportUserActivity),s=function(t){n(),this.clearInterval(e)};this.on("mousedown",(function(){n(),this.clearInterval(e),e=this.setInterval(n,250)})),this.on("mousemove",(function(e){e.screenX===t&&e.screenY===i||(t=e.screenX,i=e.screenY,n())})),this.on("mouseup",s),this.on("mouseleave",s);const r=this.getChild("controlBar");let a;!r||ti||Bt||(r.on("mouseenter",(function(e){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0})),r.on("mouseleave",(function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout}))),this.on("keydown",n),this.on("keyup",n),this.setInterval((function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(a);const e=this.options_.inactivityTimeout;e<=0||(a=this.setTimeout((function(){this.userActivity_||this.userActive(!1)}),e))}),250)}playbackRate(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)}defaultPlaybackRate(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),i=t&&t.currentHeight();e.forEach((e=>{e!==t&&e.el_&&!e.hasClass("vjs-hidden")&&(e.hide(),this.audioOnlyCache_.hiddenChildren.push(e))})),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(i),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.audioOnlyCache_.hiddenChildren.forEach((e=>e.show())),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if("boolean"!=typeof e||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const e=[];return this.isInPictureInPicture()&&e.push(this.exitPictureInPicture()),this.isFullscreen()&&e.push(this.exitFullscreen()),this.audioPosterMode()&&e.push(this.audioPosterMode(!1)),Promise.all(e).then((()=>this.enableAudioOnlyUI_()))}return Promise.resolve().then((()=>this.disableAudioOnlyUI_()))}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return"boolean"!=typeof e||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then((()=>{this.enablePosterModeUI_()})):Promise.resolve().then((()=>{this.enablePosterModeUI_()})):Promise.resolve().then((()=>{this.disablePosterModeUI_()})))}addTextTrack(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),fn(this)&&this.trigger("languagechange"))}languages(){return Lt(ra.prototype.options_.languages,this.languages_)}toJSON(){const e=Lt(this.options_),t=e.tracks;e.tracks=[];for(let i=0;i<t.length;i++){let n=t[i];n=Lt(n),n.player=void 0,e.tracks[i]=n}return e}createModal(e,t){(t=t||{}).content=e||"";const i=new zn(this,t);return this.addChild(i),i.on("dispose",(()=>{this.removeChild(i)})),i.open(),i}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let i=0;i<ia.length;i++){const n=ia[i];if(t<=this.breakpoints_[n]){if(e===n)return;e&&this.removeClass(na[e]),this.addClass(na[n]),this.breakpoint_=n;break}}}removeCurrentBreakpoint_(){const e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)}breakpoints(e){return void 0===e||(this.breakpoint_="",this.breakpoints_=Object.assign({},sa,e),this.updateCurrentBreakpoint_()),Object.assign(this.breakpoints_)}responsive(e){return void 0===e?this.responsive_:(e=Boolean(e))!==this.responsive_?(this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return na[this.breakpoint_]||""}loadMedia(e,t){if(!e||"object"!=typeof e)return;const i=this.crossOrigin();this.reset(),this.cache_.media=Lt(e);const{artist:n,artwork:s,description:r,poster:a,src:o,textTracks:l,title:c}=this.cache_.media;!s&&a&&(this.cache_.media.artwork=[{src:a,type:As(a)}]),i&&this.crossOrigin(i),o&&this.src(o),a&&this.poster(a),Array.isArray(l)&&l.forEach((e=>this.addRemoteTextTrack(e,!1))),this.titleBar&&this.titleBar.update({title:c,description:r||n||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),(e=>({kind:e.kind,label:e.label,language:e.language,src:e.src})))};return e&&(t.poster=e,t.artwork=[{src:t.poster,type:As(t.poster)}]),t}return Lt(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},i=yi(e),n=i["data-setup"];if(di(e,"vjs-fill")&&(i.fill=!0),di(e,"vjs-fluid")&&(i.fluid=!0),null!==n){const[e,t]=u()(n||"{}");e&&Et.error(e),Object.assign(i,t)}if(Object.assign(t,i),e.hasChildNodes()){const i=e.childNodes;for(let e=0,n=i.length;e<n;e++){const n=i[e],s=n.nodeName.toLowerCase();"source"===s?t.sources.push(yi(n)):"track"===s&&t.tracks.push(yi(n))}}return t}debug(e){if(void 0===e)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)}playbackRates(e){if(void 0===e)return this.cache_.playbackRates;Array.isArray(e)&&e.every((e=>"number"==typeof e))&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}}ms.names.forEach((function(e){const t=ms[e];ra.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}})),ra.prototype.crossorigin=ra.prototype.crossOrigin,ra.players={};const aa=s().navigator;ra.prototype.options_={techOrder:gs.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:aa&&(aa.languages&&aa.languages[0]||aa.userLanguage||aa.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,enableSmoothSeeking:!1},ea.forEach((function(e){ra.prototype[`handleTech${xn(e)}_`]=function(){return this.trigger(e)}})),In.registerComponent("Player",ra);const oa="plugin",la="activePlugins_",ca={},ua=e=>ca.hasOwnProperty(e),ha=e=>ua(e)?ca[e]:void 0,da=(e,t)=>{e[la]=e[la]||{},e[la][t]=!0},pa=(e,t,i)=>{const n=(i?"before":"")+"pluginsetup";e.trigger(n,t),e.trigger(n+":"+t.name,t)},fa=(e,t)=>(t.prototype.name=e,function(...i){pa(this,{name:e,plugin:t,instance:null},!0);const n=new t(...[this,...i]);return this[e]=()=>n,pa(this,n.getEventHash()),n});class ma{constructor(e){if(this.constructor===ma)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),Sn(this),delete this.trigger,En(this,this.constructor.defaultState),da(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return tn(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[la][e]=!1,this.player=this.state=null,t[e]=fa(e,ca[e])}static isBasic(e){const t="string"==typeof e?ha(e):e;return"function"==typeof t&&!ma.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if("string"!=typeof e)throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(ua(e))Et.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(ra.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if("function"!=typeof t)throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return ca[e]=t,e!==oa&&(ma.isBasic(t)?ra.prototype[e]=function(e,t){const i=function(){pa(this,{name:e,plugin:t,instance:null},!0);const i=t.apply(this,arguments);return da(this,e),pa(this,{name:e,plugin:t,instance:i}),i};return Object.keys(t).forEach((function(e){i[e]=t[e]})),i}(e,t):ra.prototype[e]=fa(e,t)),t}static deregisterPlugin(e){if(e===oa)throw new Error("Cannot de-register base plugin.");ua(e)&&(delete ca[e],delete ra.prototype[e])}static getPlugins(e=Object.keys(ca)){let t;return e.forEach((e=>{const i=ha(e);i&&(t=t||{},t[e]=i)})),t}static getPluginVersion(e){const t=ha(e);return t&&t.VERSION||""}}function ga(e,t,i,n){return function(e,t){let i=!1;return function(...n){return i||Et.warn(e),i=!0,t.apply(this,n)}}(`${t} is deprecated and will be removed in ${e}.0; please use ${i} instead.`,n)}ma.getPlugin=ha,ma.BASE_PLUGIN_NAME=oa,ma.registerPlugin(oa,ma),ra.prototype.usingPlugin=function(e){return!!this[la]&&!0===this[la][e]},ra.prototype.hasPlugin=function(e){return!!ua(e)};const ya=e=>0===e.indexOf("#")?e.slice(1):e;function va(e,t,i){let n=va.getPlayer(e);if(n)return t&&Et.warn(`Player "${e}" is already initialised. Options will not be applied.`),i&&n.ready(i),n;const r="string"==typeof e?Li("#"+ya(e)):e;if(!ai(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");const a="getRootNode"in r&&r.getRootNode()instanceof s().ShadowRoot?r.getRootNode():r.ownerDocument.body;r.ownerDocument.defaultView&&a.contains(r)||Et.warn("The element supplied is not included in the DOM"),!0===(t=t||{}).restoreEl&&(t.restoreEl=(r.parentNode&&r.parentNode.hasAttribute("data-vjs-player")?r.parentNode:r).cloneNode(!0)),yt("beforesetup").forEach((e=>{const i=e(r,Lt(t));Pt(i)&&!Array.isArray(i)?t=Lt(t,i):Et.error("please return an object in beforesetup hooks")}));const o=In.getComponent("Player");return n=new o(r,t,i),yt("setup").forEach((e=>e(n))),n}if(va.hooks_=gt,va.hooks=yt,va.hook=function(e,t){yt(e,t)},va.hookOnce=function(e,t){yt(e,[].concat(t).map((t=>{const i=(...n)=>(vt(e,i),t(...n));return i})))},va.removeHook=vt,!0!==s().VIDEOJS_NO_DYNAMIC_STYLE&&ri()){let e=Li(".vjs-styles-defaults");if(!e){e=$i("vjs-styles-defaults");const t=Li("head");t&&t.insertBefore(e,t.firstChild),Hi(e,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: 56.25%\n }\n ")}}Fi(1,va),va.VERSION=mt,va.options=ra.prototype.options_,va.getPlayers=()=>ra.players,va.getPlayer=e=>{const t=ra.players;let i;if("string"==typeof e){const n=ya(e),s=t[n];if(s)return s;i=Li("#"+n)}else i=e;if(ai(i)){const{player:e,playerId:n}=i;if(e||t[n])return e||t[n]}},va.getAllPlayers=()=>Object.keys(ra.players).map((e=>ra.players[e])).filter(Boolean),va.players=ra.players,va.getComponent=In.getComponent,va.registerComponent=(e,t)=>(gs.isTech(t)&&Et.warn(`The ${e} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),In.registerComponent.call(In,e,t)),va.getTech=gs.getTech,va.registerTech=gs.registerTech,va.use=function(e,t){ys[e]=ys[e]||[],ys[e].push(t)},Object.defineProperty(va,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(va.middleware,"TERMINATOR",{value:_s,writeable:!1,enumerable:!0}),va.browser=ni,va.obj=Nt,va.mergeOptions=ga(9,"videojs.mergeOptions","videojs.obj.merge",Lt),va.defineLazyProperty=ga(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",Rt),va.bind=ga(9,"videojs.bind","native Function.prototype.bind",on),va.registerPlugin=ma.registerPlugin,va.deregisterPlugin=ma.deregisterPlugin,va.plugin=(e,t)=>(Et.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),ma.registerPlugin(e,t)),va.getPlugins=ma.getPlugins,va.getPlugin=ma.getPlugin,va.getPluginVersion=ma.getPluginVersion,va.addLanguage=function(e,t){return e=(""+e).toLowerCase(),va.options.languages=Lt(va.options.languages,{[e]:t}),va.options.languages[e]},va.log=Et,va.createLogger=Ct,va.time=Un,va.createTimeRange=ga(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Ln),va.createTimeRanges=ga(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Ln),va.formatTime=ga(9,"videojs.formatTime","videojs.time.formatTime",jn),va.setFormatTime=ga(9,"videojs.setFormatTime","videojs.time.setFormatTime",Nn),va.resetFormatTime=ga(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",Mn),va.parseUrl=ga(9,"videojs.parseUrl","videojs.url.parseUrl",is),va.isCrossOrigin=ga(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",rs),va.EventTarget=dn,va.any=sn,va.on=Zi,va.one=nn,va.off=en,va.trigger=tn,va.xhr=d(),va.TextTrack=cs,va.AudioTrack=us,va.VideoTrack=hs,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach((e=>{va[e]=function(){return Et.warn(`videojs.${e}() is deprecated; use videojs.dom.${e}() instead`),Mi[e].apply(null,arguments)}})),va.computedStyle=ga(9,"videojs.computedStyle","videojs.dom.computedStyle",Ri),va.dom=Mi,va.fn=un,va.num=Xs,va.str=An,va.url=as,va.Error={UnsupportedSidxContainer:"unsupported-sidx-container-error",DashManifestSidxParsingError:"dash-manifest-sidx-parsing-error",HlsPlaylistRequestError:"hls-playlist-request-error",SegmentUnsupportedMediaFormat:"segment-unsupported-media-format-error",UnsupportedMediaInitialization:"unsupported-media-initialization-error",SegmentSwitchError:"segment-switch-error",SegmentExceedsSourceBufferQuota:"segment-exceeds-source-buffer-quota-error",SegmentAppendError:"segment-append-error",VttLoadError:"vtt-load-error",VttCueParsingError:"vtt-cue-parsing-error",AdsBeforePrerollError:"ads-before-preroll-error",AdsPrerollError:"ads-preroll-error",AdsMidrollError:"ads-midroll-error",AdsPostrollError:"ads-postroll-error",AdsMacroReplacementFailed:"ads-macro-replacement-failed",AdsResumeContentFailed:"ads-resume-content-failed",EMEEncryptedError:"eme-encrypted-error",MSKeyError:"ms-key-error",WebkitKeyError:"webkit-key-error",EMEFailedToRequestMediaKeySystemAccess:"eme-failed-request-media-key-system-access",EMEFailedToCreateMediaKeys:"eme-failed-create-media-keys",EMEFailedToAttachMediaKeysToVideoElement:"eme-failed-attach-media-keys-to-video",EMEFailedToCreateMediaKeySession:"eme-failed-create-media-key-session",EMEFailedToSetServerCertificate:"eme-failed-set-server-certificate",EMEFailedToGenerateLicenseRequest:"eme-failed-generate-license-request",EMEFailedToUpdateSessionWithReceivedLicenseKeys:"eme-failed-update-session",EMEFailedToCloseSession:"eme-failed-close-session"};class _a{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get:()=>t.enabled_(),set(e){t.enabled_(e)}}),t}}class ba extends va.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get:()=>e.selectedIndex_}),Object.defineProperty(e,"length",{get:()=>e.levels_.length}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const i=this.levels_.length;return t=new _a(e),""+i in this||Object.defineProperty(this,i,{get(){return this.levels_[i]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let i=0,n=this.length;i<n;i++)if(this[i]===e){t=this.levels_.splice(i,1)[0],this.selectedIndex_===i?this.selectedIndex_=-1:this.selectedIndex_>i&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,i=this.length;t<i;t++){const i=this[t];if(i.id===e)return i}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}}ba.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const e in ba.prototype.allowedEvents_)ba.prototype["on"+e]=null;var Ta="4.1.0";const Sa=function(e){return function(e,t){const i=e.qualityLevels,n=new ba,s=function(){n.dispose(),e.qualityLevels=i,e.off("dispose",s)};return e.on("dispose",s),e.qualityLevels=()=>n,e.qualityLevels.VERSION=Ta,n}(this,va.obj.merge({},e))};va.registerPlugin("qualityLevels",Sa),Sa.VERSION=Ta;const wa=v,Ea=(e,t)=>t&&t.responseURL&&e!==t.responseURL?t.responseURL:e,Ca=e=>va.log.debug?va.log.debug.bind(va,"VHS:",`${e} >`):function(){};function xa(...e){const t=va.obj||va;return(t.merge||t.mergeOptions).apply(t,e)}function ka(...e){const t=va.time||va;return(t.createTimeRanges||t.createTimeRanges).apply(t,e)}const Aa=1/30,Ia=.1,Pa=function(e,t){const i=[];let n;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 ka(i)},Oa=function(e,t){return Pa(e,(function(e,i){return e-Ia<=t&&i+Ia>=t}))},La=function(e,t){return Pa(e,(function(e){return e-Aa>=t}))},Da=e=>{const t=[];if(!e||!e.length)return"";for(let i=0;i<e.length;i++)t.push(e.start(i)+" => "+e.end(i));return t.join(", ")},Ra=e=>{const t=[];for(let i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t},Na=function(e){if(e&&e.length&&e.end)return e.end(e.length-1)},Ma=function(e,t){let i=0;if(!e||!e.length)return i;for(let n=0;n<e.length;n++){const s=e.start(n),r=e.end(n);t>r||(i+=t>s&&t<=r?r-t:r-s)}return i},ja=(e,t)=>{if(!t.preload)return t.duration;let i=0;return(t.parts||[]).forEach((function(e){i+=e.duration})),(t.preloadHints||[]).forEach((function(t){"PART"===t.type&&(i+=e.partTargetDuration)})),i},Ua=e=>(e.segments||[]).reduce(((e,t,i)=>(t.parts?t.parts.forEach((function(n,s){e.push({duration:n.duration,segmentIndex:i,partIndex:s,part:n,segment:t})})):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e)),[]),Ba=e=>{const t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},Fa=({preloadSegment:e})=>{if(!e)return;const{parts:t,preloadHints:i}=e;let n=(i||[]).reduce(((e,t)=>e+("PART"===t.type?1:0)),0);return n+=t&&t.length?t.length:0,n},qa=(e,t)=>{if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;const i=Ba(t).length>0;return i&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:i&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},$a=function(e,t,i){if(void 0===t&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;const n=function(e,t){let i=0,n=t-e.mediaSequence,s=e.segments[n];if(s){if(void 0!==s.start)return{result:s.start,precise:!0};if(void 0!==s.end)return{result:s.end-s.duration,precise:!0}}for(;n--;){if(s=e.segments[n],void 0!==s.end)return{result:i+s.end,precise:!0};if(i+=ja(e,s),void 0!==s.start)return{result:i+s.start,precise:!0}}return{result:i,precise:!1}}(e,t);if(n.precise)return n.result;const s=function(e,t){let i,n=0,s=t-e.mediaSequence;for(;s<e.segments.length;s++){if(i=e.segments[s],void 0!==i.start)return{result:i.start-n,precise:!0};if(n+=ja(e,i),void 0!==i.end)return{result:i.end-n,precise:!0}}return{result:-1,precise:!1}}(e,t);return s.precise?s.result:n.result+i},Ha=function(e,t,i){if(!e)return 0;if("number"!=typeof i&&(i=0),void 0===t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return s()[1/0]}return $a(e,t,i)},Va=function({defaultDuration:e,durationList:t,startIndex:i,endIndex:n}){let s=0;if(i>n&&([i,n]=[n,i]),i<0){for(let t=i;t<Math.min(0,n);t++)s+=e;i=0}for(let e=i;e<n;e++)s+=t[e].duration;return s},za=function(e,t,i,n){if(!e||!e.segments)return null;if(e.endList)return Ha(e);if(null===t)return null;t=t||0;let s=$a(e,e.mediaSequence+e.segments.length,t);return i&&(s-=n="number"==typeof n?n:qa(null,e)),Math.max(0,s)},Wa=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},Ga=function(e){return e.excludeUntil&&e.excludeUntil===1/0},Xa=function(e){const t=Wa(e);return!e.disabled&&!t},Ya=function(e,t){return t.attributes&&t.attributes[e]},Ka=(e,t)=>{if(1===e.playlists.length)return!0;const i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter((e=>!!Xa(e)&&(e.attributes.BANDWIDTH||0)<i)).length},Qa=(e,t)=>!(!e&&!t||!e&&t||e&&!t||e!==t&&(!e.id||!t.id||e.id!==t.id)&&(!e.resolvedUri||!t.resolvedUri||e.resolvedUri!==t.resolvedUri)&&(!e.uri||!t.uri||e.uri!==t.uri)),Ja=function(e,t){const i=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{};let n=!1;for(const e in i){for(const s in i[e])if(n=t(i[e][s]),n)break;if(n)break}return!!n},Za=e=>{if(!e||!e.playlists||!e.playlists.length)return Ja(e,(e=>e.playlists&&e.playlists.length||e.uri));for(let t=0;t<e.playlists.length;t++){const i=e.playlists[t],n=i.attributes&&i.attributes.CODECS;if((!n||!n.split(",").every((e=>M(e))))&&!Ja(e,(e=>Qa(i,e))))return!1}return!0};var eo={liveEdgeDelay:qa,duration:Ha,seekable:function(e,t,i){const n=t||0;let s=za(e,t,!0,i);return null===s?ka():(s<n&&(s=n),ka(n,s))},getMediaInfoForTime:function({playlist:e,currentTime:t,startingSegmentIndex:i,startingPartIndex:n,startTime:s,exactManifestTimings:r}){let a=t-s;const o=Ua(e);let l=0;for(let e=0;e<o.length;e++){const t=o[e];if(i===t.segmentIndex&&("number"!=typeof n||"number"!=typeof t.partIndex||n===t.partIndex)){l=e;break}}if(a<0){if(l>0)for(let t=l-1;t>=0;t--){const i=o[t];if(a+=i.duration,r){if(a<0)continue}else if(a+Aa<=0)continue;return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:s-Va({defaultDuration:e.targetDuration,durationList:o,startIndex:l,endIndex:t})}}return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t}}if(l<0){for(let i=l;i<0;i++)if(a-=e.targetDuration,a<0)return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t};l=0}for(let t=l;t<o.length;t++){const i=o[t];a-=i.duration;const n=i.duration>Aa;if(0!==a&&!(n&&a+Aa>=0)||t===o.length-1){if(r){if(a>0)continue}else if(a-Aa>=0)continue;return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:s+Va({defaultDuration:e.targetDuration,durationList:o,startIndex:l,endIndex:t})}}}return{segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:t}},isEnabled:Xa,isDisabled:function(e){return e.disabled},isExcluded:Wa,isIncompatible:Ga,playlistEnd:za,isAes:function(e){for(let t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},hasAttribute:Ya,estimateSegmentRequestTime:function(e,t,i,n=0){return Ya("BANDWIDTH",i)?(e*i.attributes.BANDWIDTH-8*n)/t:NaN},isLowestEnabledRendition:Ka,isAudioOnly:Za,playlistMatch:Qa,segmentDurationWithParts:ja};const{log:to}=va,io=(e,t)=>`${e}-${t}`,no=(e,t,i)=>`placeholder-uri-${e}-${t}-${i}`,so=(e,t)=>{e.mediaGroups&&["AUDIO","SUBTITLES"].forEach((i=>{if(e.mediaGroups[i])for(const n in e.mediaGroups[i])for(const s in e.mediaGroups[i][n]){const r=e.mediaGroups[i][n][s];t(r,i,n,s)}}))},ro=({playlist:e,uri:t,id:i})=>{e.id=i,e.playlistErrors_=0,t&&(e.uri=t),e.attributes=e.attributes||{}},ao=(e,t,i=no)=>{e.uri=t;for(let t=0;t<e.playlists.length;t++)if(!e.playlists[t].uri){const i=`placeholder-uri-${t}`;e.playlists[t].uri=i}const n=Za(e);so(e,((t,s,r,a)=>{if(!t.playlists||!t.playlists.length){if(n&&"AUDIO"===s&&!t.uri)for(let t=0;t<e.playlists.length;t++){const i=e.playlists[t];if(i.attributes&&i.attributes.AUDIO&&i.attributes.AUDIO===r)return}t.playlists=[m({},t)]}t.playlists.forEach((function(t,n){const o=i(s,r,a,t),l=io(n,o);t.uri?t.resolvedUri=t.resolvedUri||wa(e.uri,t.uri):(t.uri=0===n?o:l,t.resolvedUri=t.uri),t.id=t.id||l,t.attributes=t.attributes||{},e.playlists[t.id]=t,e.playlists[t.uri]=t}))})),(e=>{let t=e.playlists.length;for(;t--;){const i=e.playlists[t];ro({playlist:i,id:io(t,i.uri)}),i.resolvedUri=wa(e.uri,i.uri),e.playlists[i.id]=i,e.playlists[i.uri]=i,i.attributes.BANDWIDTH||to.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}})(e),(e=>{so(e,(t=>{t.uri&&(t.resolvedUri=wa(e.uri,t.uri))}))})(e)};class oo{constructor(){this.offset_=null,this.pendingDateRanges_=new Map,this.processedDateRanges_=new Map}setOffset(e=[]){if(null!==this.offset_)return;if(!e.length)return;const[t]=e;void 0!==t.programDateTime&&(this.offset_=t.programDateTime/1e3)}setPendingDateRanges(e=[]){if(!e.length)return;const[t]=e,i=t.startDate.getTime();this.trimProcessedDateRanges_(i),this.pendingDateRanges_=e.reduce(((e,t)=>(e.set(t.id,t),e)),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(null===this.offset_)return[];const e={},t=[];this.pendingDateRanges_.forEach(((i,n)=>{if(!this.processedDateRanges_.has(n)&&(i.startTime=i.startDate.getTime()/1e3-this.offset_,i.processDateRange=()=>this.processDateRange(i),t.push(i),i.class))if(e[i.class]){const t=e[i.class].push(i);i.classListIndex=t-1}else e[i.class]=[i],i.classListIndex=0}));for(const i of t){const t=e[i.class]||[];i.endDate?i.endTime=i.endDate.getTime()/1e3-this.offset_:i.endOnNext&&t[i.classListIndex+1]?i.endTime=t[i.classListIndex+1].startTime:i.duration?i.endTime=i.startTime+i.duration:i.plannedDuration?i.endTime=i.startTime+i.plannedDuration:i.endTime=i.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach(((t,i)=>{t.startDate.getTime()<e&&this.processedDateRanges_.delete(i)}))}}const{EventTarget:lo}=va,co=(e,t)=>{if(!e)return t;const i=xa(e,t);if(e.preloadHints&&!t.preloadHints&&delete i.preloadHints,e.parts&&!t.parts)delete i.parts;else if(e.parts&&t.parts)for(let n=0;n<t.parts.length;n++)e.parts&&e.parts[n]&&(i.parts[n]=xa(e.parts[n],t.parts[n]));return!e.skipped&&t.skipped&&(i.skipped=!1),e.preload&&!t.preload&&(i.preload=!1),i},uo=(e,t)=>{!e.resolvedUri&&e.uri&&(e.resolvedUri=wa(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=wa(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=wa(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=wa(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach((e=>{e.resolvedUri||(e.resolvedUri=wa(t,e.uri))})),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach((e=>{e.resolvedUri||(e.resolvedUri=wa(t,e.uri))}))},ho=function(e){const t=e.segments||[],i=e.preloadSegment;if(i&&i.parts&&i.parts.length){if(i.preloadHints)for(let e=0;e<i.preloadHints.length;e++)if("MAP"===i.preloadHints[e].type)return t;i.duration=e.targetDuration,i.preload=!0,t.push(i)}return t},po=(e,t)=>e===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence&&e.preloadSegment===t.preloadSegment,fo=(e,t,i=po)=>{const n=xa(e,{}),s=n.playlists[t.id];if(!s)return null;if(i(s,t))return null;t.segments=ho(t);const r=xa(s,t);if(r.preloadSegment&&!t.preloadSegment&&delete r.preloadSegment,s.segments){if(t.skip){t.segments=t.segments||[];for(let e=0;e<t.skip.skippedSegments;e++)t.segments.unshift({skipped:!0})}r.segments=((e,t,i)=>{const n=e.slice(),s=t.slice();i=i||0;const r=[];let a;for(let e=0;e<s.length;e++){const t=n[e+i],o=s[e];t?(a=t.map||a,r.push(co(t,o))):(a&&!o.map&&(o.map=a),r.push(o))}return r})(s.segments,t.segments,t.mediaSequence-s.mediaSequence)}r.segments.forEach((e=>{uo(e,r.resolvedUri)}));for(let e=0;e<n.playlists.length;e++)n.playlists[e].id===t.id&&(n.playlists[e]=r);return n.playlists[t.id]=r,n.playlists[t.uri]=r,so(e,((e,i,n,s)=>{if(e.playlists)for(let i=0;i<e.playlists.length;i++)t.id===e.playlists[i].id&&(e.playlists[i]=r)})),n},mo=(e,t)=>{const i=e.segments||[],n=i[i.length-1],s=n&&n.parts&&n.parts[n.parts.length-1],r=s&&s.duration||n&&n.duration;return t&&r?1e3*r:500*(e.partTargetDuration||e.targetDuration||10)};class go extends lo{constructor(e,t,i={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=Ca("PlaylistLoader");const{withCredentials:n=!1}=i;this.src=e,this.vhs_=t,this.withCredentials=n,this.addDateRangesToTextTrack_=i.addDateRangesToTextTrack;const s=t.options_;this.customTagParsers=s&&s.customTagParsers||[],this.customTagMappers=s&&s.customTagMappers||[],this.llhls=s&&s.llhls,this.dateRangesStorage_=new oo,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();t.length&&this.addDateRangesToTextTrack_&&this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if("HAVE_METADATA"!==this.state)return;const e=this.media();let t=wa(this.main.uri,e.uri);this.llhls&&(t=((e,t)=>{if(t.endList||!t.serverControl)return e;const i={};if(t.serverControl.canBlockReload){const{preloadSegment:e}=t;let n=t.mediaSequence+t.segments.length;if(e){const s=e.parts||[],r=Fa(t)-1;r>-1&&r!==s.length-1&&(i._HLS_part=r),(r>-1||s.length)&&n--}i._HLS_msn=n}if(t.serverControl&&t.serverControl.canSkipUntil&&(i._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(i).length){const t=new(s().URL)(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach((function(e){i.hasOwnProperty(e)&&t.searchParams.set(e,i[e])})),e=t.toString()}return e})(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},((e,t)=>{if(this.request)return e?this.playlistRequestError(this.request,this.media(),"HAVE_METADATA"):void this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}))}playlistRequestError(e,t,i){const{uri:n,id:s}=t;this.request=null,i&&(this.state=i),this.error={playlist:this.main.playlists[s],status:e.status,message:`HLS playlist request error at URL: ${n}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:{errorType:va.Error.HlsPlaylistRequestError}},this.trigger("error")}parseManifest_({url:e,manifestString:t}){return(({onwarn:e,oninfo:t,manifestString:i,customTagParsers:n=[],customTagMappers:s=[],llhls:r})=>{const a=new A;e&&a.on("warn",e),t&&a.on("info",t),n.forEach((e=>a.addParser(e))),s.forEach((e=>a.addTagMapper(e))),a.push(i),a.end();const o=a.manifest;if(r||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach((function(e){o.hasOwnProperty(e)&&delete o[e]})),o.segments&&o.segments.forEach((function(e){["parts","preloadHints"].forEach((function(t){e.hasOwnProperty(t)&&delete e[t]}))}))),!o.targetDuration){let t=10;o.segments&&o.segments.length&&(t=o.segments.reduce(((e,t)=>Math.max(e,t.duration)),0)),e&&e({message:`manifest has no targetDuration defaulting to ${t}`}),o.targetDuration=t}const l=Ba(o);if(l.length&&!o.partTargetDuration){const t=l.reduce(((e,t)=>Math.max(e,t.duration)),0);e&&(e({message:`manifest has no partTargetDuration defaulting to ${t}`}),to.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),o.partTargetDuration=t}return o})({onwarn:({message:t})=>this.logger_(`m3u8-parser warn for ${e}: ${t}`),oninfo:({message:t})=>this.logger_(`m3u8-parser info for ${e}: ${t}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls})}haveMetadata({playlistString:e,playlistObject:t,url:i,id:n}){this.request=null,this.state="HAVE_METADATA";const s=t||this.parseManifest_({url:i,manifestString:e});s.lastRequest=Date.now(),ro({playlist:s,uri:i,id:n});const r=fo(this.main,s);this.targetDuration=s.partTargetDuration||s.targetDuration,this.pendingMedia_=null,r?(this.main=r,this.media_=this.main.playlists[n]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(mo(this.media(),!!r)),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),s().clearTimeout(this.mediaUpdateTimeout),s().clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new oo,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"==typeof e){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(s().clearTimeout(this.finalRenditionTimeout),t){const t=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;return void(this.finalRenditionTimeout=s().setTimeout(this.media.bind(this,e,!1),t))}const i=this.state,n=!this.media_||e.id!==this.media_.id,r=this.main.playlists[e.id];if(r&&r.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(n&&(this.trigger("mediachanging"),"HAVE_MAIN_MANIFEST"===i?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(mo(e,!0)),n){if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},((t,n)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=Ea(e.resolvedUri,n),t)return this.playlistRequestError(this.request,e,i);this.haveMetadata({playlistString:n.responseText,url:e.uri,id:e.id}),"HAVE_MAIN_MANIFEST"===i?this.trigger("loadedmetadata"):this.trigger("mediachange")}}))}}pause(){this.mediaUpdateTimeout&&(s().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(s().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const e=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=s().setTimeout((()=>{this.mediaUpdateTimeout=null,this.load()}),e)}else this.started?t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(s().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=s().setTimeout((()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)}),e))}start(){if(this.started=!0,"object"==typeof this.src)return this.src.uri||(this.src.uri=s().location.href),this.src.resolvedUri=this.src.uri,void setTimeout((()=>{this.setupInitialPlaylist(this.src)}),0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},((e,t)=>{if(!this.request)return;if(this.request=null,e)return this.error={status:t.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:t.responseText,code:2,metadata:{errorType:va.Error.HlsPlaylistRequestError}},"HAVE_NOTHING"===this.state&&(this.started=!1),this.trigger("error");this.src=Ea(this.src,t);const i=this.parseManifest_({manifestString:t.responseText,url:this.src});this.setupInitialPlaylist(i)}))}srcUri(){return"string"==typeof this.src?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists)return this.main=e,ao(this.main,this.srcUri()),e.playlists.forEach((e=>{e.segments=ho(e),e.segments.forEach((t=>{uo(t,e.resolvedUri)}))})),this.trigger("loadedplaylist"),void(this.request||this.media(this.main.playlists[0]));const t=this.srcUri()||s().location.href;this.main=((e,t)=>{const i=io(0,t),n={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:s().location.href,resolvedUri:s().location.href,playlists:[{uri:t,id:i,resolvedUri:t,attributes:{}}]};return n.playlists[i]=n.playlists[0],n.playlists[t]=n.playlists[0],n})(0,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const i=this.main,n=e.ID;let s=i.playlists.length;for(;s--;){const r=i.playlists[s];if(r.attributes["PATHWAY-ID"]===n){const a=r.resolvedUri,o=r.id;if(t){const t=this.createCloneURI_(r.resolvedUri,e),a=io(n,t),o=this.createCloneAttributes_(n,r.attributes),l=this.createClonePlaylist_(r,a,e,o);i.playlists[s]=l,i.playlists[a]=l,i.playlists[t]=l}else i.playlists.splice(s,1);delete i.playlists[o],delete i.playlists[a]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const i=this.main,n=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((e=>{if(i.mediaGroups[e]&&i.mediaGroups[e][n])for(const t in i.mediaGroups[e])if(t===n){for(const n in i.mediaGroups[e][t])i.mediaGroups[e][t][n].playlists.forEach(((e,t)=>{const n=i.playlists[e.id],s=n.id,r=n.resolvedUri;delete i.playlists[s],delete i.playlists[r]}));delete i.mediaGroups[e][t]}})),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const i=this.main,n=i.playlists.length,s=this.createCloneURI_(t.resolvedUri,e),r=io(e.ID,s),a=this.createCloneAttributes_(e.ID,t.attributes),o=this.createClonePlaylist_(t,r,e,a);i.playlists[n]=o,i.playlists[r]=o,i.playlists[s]=o,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,i=e["BASE-ID"],n=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((s=>{if(n.mediaGroups[s]&&!n.mediaGroups[s][t])for(const r in n.mediaGroups[s])if(r===i){n.mediaGroups[s][t]={};for(const i in n.mediaGroups[s][r]){const a=n.mediaGroups[s][r][i];n.mediaGroups[s][t][i]=m({},a);const o=n.mediaGroups[s][t][i],l=this.createCloneURI_(a.resolvedUri,e);o.resolvedUri=l,o.uri=l,o.playlists=[],a.playlists.forEach(((r,a)=>{const l=n.playlists[r.id],c=no(s,t,i),u=io(t,c);if(l&&!n.playlists[u]){const t=this.createClonePlaylist_(l,u,e),i=t.resolvedUri;n.playlists[u]=t,n.playlists[i]=t}o.playlists[a]=this.createClonePlaylist_(r,u,e)}))}}}))}createClonePlaylist_(e,t,i,n){const s=this.createCloneURI_(e.resolvedUri,i),r={resolvedUri:s,uri:s,id:t};return e.segments&&(r.segments=[]),n&&(r.attributes=n),xa(e,r)}createCloneURI_(e,t){const i=new URL(e);i.hostname=t["URI-REPLACEMENT"].HOST;const n=t["URI-REPLACEMENT"].PARAMS;for(const e of Object.keys(n))i.searchParams.set(e,n[e]);return i.href}createCloneAttributes_(e,t){const i={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((n=>{t[n]&&(i[n]=e)})),i}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const n=e.contentProtection[i].attributes.keyId;n&&t.add(n.toLowerCase())}return t}}}const yo=function(e,t,i,n){const s="arraybuffer"===e.responseType?e.response:e.responseText;!t&&s&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=s.byteLength||s.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),i.headers&&(e.responseHeaders=i.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),t||e.aborted||200===i.statusCode||206===i.statusCode||0===i.statusCode||(t=new Error("XHR Failed with a response of: "+(e&&(s||e.responseText)))),n(t,e)},vo=function(){const e=function e(t,i){t=xa({timeout:45e3},t);const n=e.beforeRequest||va.Vhs.xhr.beforeRequest,s=e._requestCallbackSet||va.Vhs.xhr._requestCallbackSet||new Set,r=e._responseCallbackSet||va.Vhs.xhr._responseCallbackSet;n&&"function"==typeof n&&(va.log.warn("beforeRequest is deprecated, use onRequest instead."),s.add(n));const a=!0===va.Vhs.xhr.original?va.xhr:va.Vhs.xhr,o=((e,t)=>{if(!e||!e.size)return;let i=t;return e.forEach((e=>{i=e(i)})),i})(s,t);s.delete(n);const l=a(o||t,(function(e,t){return((e,t,i,n)=>{e&&e.size&&e.forEach((e=>{e(t,i,n)}))})(r,l,e,t),yo(l,e,t,i)})),c=l.abort;return l.abort=function(){return l.aborted=!0,c.apply(l,arguments)},l.uri=t.uri,l.requestTime=Date.now(),l};return e.original=!0,e},_o=function(e){const t={};return e.byterange&&(t.Range=function(e){let t;const i=e.offset;return t="bigint"==typeof e.offset||"bigint"==typeof e.length?s().BigInt(e.offset)+s().BigInt(e.length)-s().BigInt(1):e.offset+e.length-1,"bytes="+i+"-"+t}(e.byterange)),t},bo=function(e,t){return e.start(t)+"-"+e.end(t)},To=function(e,t){const i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")},So=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},wo=function(e){const t={};return Object.keys(e).forEach((i=>{const n=e[i];V(n)?t[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:t[i]=n})),t},Eo=function(e){const t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},Co=function(e){return e.resolvedUri},xo=e=>{const t=Array.prototype.slice.call(e),i=16;let n,s,r="";for(let e=0;e<t.length/i;e++)n=t.slice(e*i,e*i+i).map(To).join(""),s=t.slice(e*i,e*i+i).map(So).join(""),r+=n+" "+s+"\n";return r};var ko=Object.freeze({__proto__:null,createTransferableMessage:wo,initSegmentId:Eo,segmentKeyId:Co,hexDump:xo,tagDump:({bytes:e})=>xo(e),textRanges:e=>{let t,i="";for(t=0;t<e.length;t++)i+=bo(e,t)+" ";return i}});const Ao=({programTime:e,playlist:t,retryCount:i=2,seekTo:n,pauseAfterSeek:s=!0,tech:r,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if(void 0===e||!t||!n)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!t.endList&&!r.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!(e=>{if(!e.segments||0===e.segments.length)return!1;for(let t=0;t<e.segments.length;t++)if(!e.segments[t].dateTimeObject)return!1;return!0})(t))return a({message:"programDateTime tags must be provided in the manifest "+t.resolvedUri});const o=((e,t)=>{let i;try{i=new Date(e)}catch(e){return null}if(!t||!t.segments||0===t.segments.length)return null;let n=t.segments[0];if(i<new Date(n.dateTimeObject))return null;for(let e=0;e<t.segments.length-1&&(n=t.segments[e],!(i<new Date(t.segments[e+1].dateTimeObject)));e++);const s=t.segments[t.segments.length-1],r=s.dateTimeObject,a=s.videoTimingInfo?(o=s.videoTimingInfo).transmuxedPresentationEnd-o.transmuxedPresentationStart-o.transmuxerPrependedSeconds:s.duration+.25*s.duration;var o;return i>new Date(r.getTime()+1e3*a)?null:(i>new Date(r)&&(n=s),{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:eo.duration(t,t.mediaSequence+t.segments.indexOf(n)),type:n.videoTimingInfo?"accurate":"estimate"})})(e,t);if(!o)return a({message:`${e} was not found in the stream`});const l=o.segment,c=((e,t)=>{let i,n;try{i=new Date(e),n=new Date(t)}catch(e){}const s=i.getTime();return(n.getTime()-s)/1e3})(l.dateTimeObject,e);if("estimate"===o.type)return 0===i?a({message:`${e} is not buffered yet. Try again`}):(n(o.estimatedStart+c),void r.one("seeked",(()=>{Ao({programTime:e,playlist:t,retryCount:i-1,seekTo:n,pauseAfterSeek:s,tech:r,callback:a})})));const u=l.start+c;r.one("seeked",(()=>a(null,r.currentTime()))),s&&r.pause(),n(u)},Io=(e,t)=>{if(4===e.readyState)return t()},{EventTarget:Po}=va,Oo=function(e,t){if(!po(e,t))return!1;if(e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length))return!1;if(!e.sidx&&t.sidx||e.sidx&&!t.sidx)return!1;if(e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(let i=0;i<e.segments.length;i++){const n=e.segments[i],s=t.segments[i];if(n.uri!==s.uri)return!1;if(!n.byterange&&!s.byterange)continue;const r=n.byterange,a=s.byterange;if(r&&!a||!r&&a)return!1;if(r.offset!==a.offset||r.length!==a.length)return!1}return!0},Lo=(e,t,i,n)=>`placeholder-uri-${e}-${t}-${n.attributes.NAME||i}`,Do=(e,t)=>(Boolean(!e.map&&!t.map)||Boolean(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length))&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length,Ro=(e,t)=>{const i={};for(const n in e){const s=e[n].sidx;if(s){const e=fe(s);if(!t[e])break;const n=t[e].sidxInfo;Do(n,s)&&(i[e]=t[e])}}return i};class No extends Po{constructor(e,t,i={},n){super(),this.mainPlaylistLoader_=n||this,n||(this.isMain_=!0);const{withCredentials:s=!1}=i;if(this.vhs_=t,this.withCredentials=s,this.addMetadataToTextTrack=i.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",(()=>{this.refreshXml_()})),this.on("mediaupdatetimeout",(()=>{this.refreshMedia_(this.media().id)})),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=Ca("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}requestErrored_(e,t,i){return!this.request||(this.request=null,e?(this.error="object"!=typeof e||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata}:e,i&&(this.state=i),this.trigger("error"),!0):void 0)}addSidxSegments_(e,t,i){const n=e.sidx&&fe(e.sidx);if(!e.sidx||!n||this.mainPlaylistLoader_.sidxMapping_[n])return void(this.mediaRequest_=s().setTimeout((()=>i(!1)),0));const r=Ea(e.sidx.resolvedUri),a=(s,r)=>{if(this.requestErrored_(s,r,t))return;const a=this.mainPlaylistLoader_.sidxMapping_;let o;try{o=We()(z(r.response).subarray(8))}catch(e){return e.metadata={errorType:va.Error.DashManifestSidxParsingError},void this.requestErrored_(e,r,t)}return a[n]={sidxInfo:e.sidx,sidx:o},le(e,o,e.sidx.resolvedUri),i(!0)};this.request=((e,t,i)=>{let n,s=[],r=!1;const a=function(e,t,n,s){return t.abort(),r=!0,i(e,t,n,s)},o=function(e,t){if(r)return;if(e)return a(e,t,"",s);const i=t.responseText.substring(s&&s.byteLength||0,t.responseText.length);if(s=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];if(t=t.filter((function(e){return e&&(e.byteLength||e.length)&&"string"!=typeof e})),t.length<=1)return z(t[0]);var n=t.reduce((function(e,t,i){return e+(t.byteLength||t.length)}),0),s=new Uint8Array(n),r=0;return t.forEach((function(e){e=z(e),s.set(e,r),r+=e.byteLength})),s}(s,Y(i,!0)),n=n||Xe(s),s.length<10||n&&s.length<n+2)return Io(t,(()=>a(e,t,"",s)));const o=pt(s);return"ts"===o&&s.length<188||!o&&s.length<376?Io(t,(()=>a(e,t,"",s))):a(null,t,o,s)},l={uri:e,beforeSend(e){e.overrideMimeType("text/plain; charset=x-user-defined"),e.addEventListener("progress",(function({total:t,loaded:i}){return yo(e,null,{statusCode:e.status},o)}))}},c=t(l,(function(e,t){return yo(c,e,t,o)}));return c})(r,this.vhs_.xhr,((t,i,n,s)=>{if(t)return a(t,i);if(!n||"mp4"!==n){const t=n||"unknown";return a({status:i.status,message:`Unsupported ${t} container type for sidx segment at URL: ${r}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2,metadata:{errorType:va.Error.UnsupportedSidxContainer,sidxContainer:t}},i)}const{offset:o,length:l}=e.sidx.byterange;if(s.length>=l+o)return a(t,{response:s.subarray(o,o+l),status:i.status,uri:i.uri});this.request=this.vhs_.xhr({uri:r,responseType:"arraybuffer",headers:_o({byterange:e.sidx.byterange})},a)}))}dispose(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},s().clearTimeout(this.minimumUpdatePeriodTimeout_),s().clearTimeout(this.mediaRequest_),s().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if("string"==typeof e){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const 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,t,(i=>{this.haveMetadata({startingState:t,playlist:e})})))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,this.mediaRequest_=null,this.refreshMedia_(t.id),"HAVE_MAIN_MANIFEST"===e?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),s().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(s().clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)}load(e){s().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const e=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=s().setTimeout((()=>this.load()),e)}else this.started?t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()}start(){this.started=!0,this.isMain_?this.requestMain_(((e,t)=>{this.haveMain_(),this.hasPendingRequest()||this.media_||this.media(this.mainPlaylistLoader_.main.playlists[0])})):this.mediaRequest_=s().setTimeout((()=>this.haveMain_()),0)}requestMain_(e){this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},((t,i)=>{if(this.requestErrored_(t,i))return void("HAVE_NOTHING"===this.state&&(this.started=!1));const n=i.responseText!==this.mainPlaylistLoader_.mainXml_;return this.mainPlaylistLoader_.mainXml_=i.responseText,i.responseHeaders&&i.responseHeaders.date?this.mainLoaded_=Date.parse(i.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=Ea(this.mainPlaylistLoader_.srcUrl,i),n?(this.handleMain_(),void this.syncClientServerClock_((()=>e(i,n)))):e(i,n)}))}syncClientServerClock_(e){const t=(i=this.mainPlaylistLoader_.mainXml_,(e=>{const t=Oe(e,"UTCTiming")[0];if(!t)return null;const i=Ne(t);switch(i.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":i.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":i.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":i.method="DIRECT",i.value=Date.parse(i.value);break;default:throw new Error("UNSUPPORTED_UTC_TIMING_SCHEME")}return i})(He(i)));var i;return null===t?(this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()):"DIRECT"===t.method?(this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:wa(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},((i,n)=>{if(!this.request)return;if(i)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();let s;s="HEAD"===t.method?n.responseHeaders&&n.responseHeaders.date?Date.parse(n.responseHeaders.date):this.mainLoaded_:Date.parse(n.responseText),this.mainPlaylistLoader_.clientOffset_=s-Date.now(),e()})))}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main;let t=(({mainXml:e,srcUrl:t,clientOffset:i,sidxMapping:n,previousManifest:s})=>{const r=((e,t={})=>{const i=((e,t={})=>{const{manifestUri:i="",NOW:n=Date.now(),clientOffset:s=0,eventHandler:r=function(){}}=t,a=Oe(e,"Period");if(!a.length)throw new Error("INVALID_NUMBER_OF_PERIOD");const o=Oe(e,"Location"),l=Ne(e),c=je([{baseUrl:i}],Oe(e,"BaseURL")),u=Oe(e,"ContentSteering");l.type=l.type||"static",l.sourceDuration=l.mediaPresentationDuration||0,l.NOW=n,l.clientOffset=s,o.length&&(l.locations=o.map(Le));const h=[];return a.forEach(((e,t)=>{const i=Ne(e),n=h[t-1];i.start=(({attributes:e,priorPeriodAttributes:t,mpdType:i})=>"number"==typeof e.start?e.start:t&&"number"==typeof t.start&&"number"==typeof t.duration?t.start+t.duration:t||"static"!==i?null:0)({attributes:i,priorPeriodAttributes:n?n.attributes:null,mpdType:l.type}),h.push({node:e,attributes:i})})),{locations:l.locations,contentSteeringInfo:$e(u,r),representationInfo:te(h.map(qe(l,c))),eventStream:te(h.map(Be))}})(He(e),t),n=i.representationInfo.map(Pe);return we({dashPlaylists:n,locations:i.locations,contentSteering:i.contentSteeringInfo,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest,eventStream:i.eventStream})})(e,{manifestUri:t,clientOffset:i,sidxMapping:n,previousManifest:s});return ao(r,t,Lo),r})({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e});e&&(t=((e,t,i)=>{let n=!0,s=xa(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts});for(let e=0;e<t.playlists.length;e++){const r=t.playlists[e];if(r.sidx){const e=fe(r.sidx);i&&i[e]&&i[e].sidx&&le(r,i[e].sidx,r.sidx.resolvedUri)}const a=fo(s,r,Oo);a&&(s=a,n=!1)}return so(t,((e,t,i,r)=>{if(e.playlists&&e.playlists.length){const a=e.playlists[0].id,o=fo(s,e.playlists[0],Oo);o&&(s=o,r in s.mediaGroups[t][i]||(s.mediaGroups[t][i][r]=e),s.mediaGroups[t][i][r].playlists[0]=s.playlists[a],n=!1)}})),((e,t)=>{so(e,((i,n,s,r)=>{r in t.mediaGroups[n][s]||delete e.mediaGroups[n][s][r]}))})(s,t),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(n=!1),n?null:s})(e,t,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=t||e;const i=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];return i&&i!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=i),(!e||t&&t.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(t),Boolean(t)}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(s().clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;0===t&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),"number"!=typeof t||t<=0?t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`):this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=s().setTimeout((()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)}),e)}refreshXml_(){this.requestMain_(((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=((e,t)=>{let i=Ro(e.playlists,t);return so(e,((e,n,s,r)=>{if(e.playlists&&e.playlists.length){const n=e.playlists;i=xa(i,Ro(n,t))}})),i})(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,(e=>{this.refreshMedia_(this.media().id)})))}))}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,i=!this.media_||this.media_!==t[e];if(i?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const e=()=>{this.media().endList||(this.mediaUpdateTimeout=s().setTimeout((()=>{this.trigger("mediaupdatetimeout"),e()}),mo(this.media(),Boolean(i))))};e()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const e=this.mainPlaylistLoader_.main.eventStream.map((e=>({cueTime:e.start,frames:[{data:e.messageData}]})));this.addMetadataToTextTrack("EventStream",e,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const n=e.contentProtection[i].attributes["cenc:default_KID"];n&&t.add(n.replace(/-/g,"").toLowerCase())}return t}}}var Mo={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const jo=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},Uo=function(e){return function(){const t=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch(t){const i=new BlobBuilder;return i.append(e),URL.createObjectURL(i.getBlob())}}(e),i=jo(new Worker(t));i.objURL=t;const n=i.terminate;return i.on=i.addEventListener,i.off=i.removeEventListener,i.terminate=function(){return URL.revokeObjectURL(t),n.call(this)},i}},Bo=function(e){return`var browserWorkerPolyFill = ${jo.toString()};\nbrowserWorkerPolyFill(self);\n`+e},Fo=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)},qo=Bo(Fo((function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},t=function(){this.init=function(){var e={};this.on=function(t,i){e[t]||(e[t]=[]),e[t]=e[t].concat(i)},this.off=function(t,i){var n;return!!e[t]&&(n=e[t].indexOf(i),e[t]=e[t].slice(),e[t].splice(n,1),n>-1)},this.trigger=function(t){var i,n,s,r;if(i=e[t])if(2===arguments.length)for(s=i.length,n=0;n<s;++n)i[n].call(this,arguments[1]);else{for(r=[],n=arguments.length,n=1;n<arguments.length;++n)r.push(arguments[n]);for(s=i.length,n=0;n<s;++n)i[n].apply(this,r)}},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 n,s,r,a,o,l,c,u,h,d,p,f,m,g,y,v,_,b,T,S,w,E,C,x,k,A,I,P,O,L,D,R,N,M,j,U,B,F,q,$,H=t,V=Math.pow(2,32),z={getUint64:function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.getBigUint64?(t=i.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(t):t:i.getUint32(0)*V+i.getUint32(4)},MAX_UINT32:V},W=z.MAX_UINT32;!function(){var e;if(E={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 E)E.hasOwnProperty(e)&&(E[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);C=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),k=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),x=new Uint8Array([0,0,0,1]),A=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]),I=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]),P={video:A,audio:I},D=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]),N=R,M=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),j=R,O=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),n=function(e){var t,i,n=[],s=0;for(t=1;t<arguments.length;t++)n.push(arguments[t]);for(t=n.length;t--;)s+=n[t].byteLength;for(i=new Uint8Array(s+8),new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,i.byteLength),i.set(e,4),t=0,s=8;t<n.length;t++)i.set(n[t],s),s+=n[t].byteLength;return i},s=function(){return n(E.dinf,n(E.dref,D))},r=function(e){return n(E.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,e.audioobjecttype<<3|e.samplingfrequencyindex>>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},y=function(e){return n(E.hdlr,P[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),n(E.mdhd,t)},m=function(e){return n(E.mdia,g(e),y(e.type),l(e))},o=function(e){return n(E.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},l=function(e){return n(E.minf,"video"===e.type?n(E.vmhd,O):n(E.smhd,L),s(),_(e))},c=function(e,t){for(var i=[],s=t.length;s--;)i[s]=T(t[s]);return n.apply(null,[E.moof,o(e)].concat(i))},u=function(e){for(var t=e.length,i=[];t--;)i[t]=p(e[t]);return n.apply(null,[E.moov,d(4294967295)].concat(i).concat(h(e)))},h=function(e){for(var t=e.length,i=[];t--;)i[t]=S(e[t]);return n.apply(null,[E.mvex].concat(i))},d=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 n(E.mvhd,t)},v=function(e){var t,i,s=e.samples||[],r=new Uint8Array(4+s.length);for(i=0;i<s.length;i++)t=s[i].flags,r[i+4]=t.dependsOn<<4|t.isDependedOn<<2|t.hasRedundancy;return n(E.sdtp,r)},_=function(e){return n(E.stbl,b(e),n(E.stts,j),n(E.stsc,N),n(E.stsz,M),n(E.stco,R))},b=function(e){return n(E.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===e.type?U(e):B(e))},U=function(e){var t,i,s=e.sps||[],r=e.pps||[],a=[],o=[];for(t=0;t<s.length;t++)a.push((65280&s[t].byteLength)>>>8),a.push(255&s[t].byteLength),a=a.concat(Array.prototype.slice.call(s[t]));for(t=0;t<r.length;t++)o.push((65280&r[t].byteLength)>>>8),o.push(255&r[t].byteLength),o=o.concat(Array.prototype.slice.call(r[t]));if(i=[E.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]),n(E.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([s.length],a,[r.length],o))),n(E.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var l=e.sarRatio[0],c=e.sarRatio[1];i.push(n(E.pasp,new Uint8Array([(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l,(4278190080&c)>>24,(16711680&c)>>16,(65280&c)>>8,255&c])))}return n.apply(null,i)},B=function(e){return n(E.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]),r(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 n(E.tkhd,t)},T=function(e){var t,i,s,r,a,o;return t=n(E.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])),a=Math.floor(e.baseMediaDecodeTime/W),o=Math.floor(e.baseMediaDecodeTime%W),i=n(E.tfdt,new Uint8Array([1,0,0,0,a>>>24&255,a>>>16&255,a>>>8&255,255&a,o>>>24&255,o>>>16&255,o>>>8&255,255&o])),"audio"===e.type?(s=w(e,92),n(E.traf,t,i,s)):(r=v(e),s=w(e,r.length+92),n(E.traf,t,i,s,r))},p=function(e){return e.duration=e.duration||4294967295,n(E.trak,f(e),m(e))},S=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),n(E.trex,t)},$=function(e,t){var i=0,n=0,s=0,r=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(n=2),void 0!==e[0].flags&&(s=4),void 0!==e[0].compositionTimeOffset&&(r=8)),[0,0,i|n|s|r,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},q=function(e,t){var i,s,r,a,o,l;for(t+=20+16*(a=e.samples||[]).length,r=$(a,t),(s=new Uint8Array(r.length+16*a.length)).set(r),i=r.length,l=0;l<a.length;l++)o=a[l],s[i++]=(4278190080&o.duration)>>>24,s[i++]=(16711680&o.duration)>>>16,s[i++]=(65280&o.duration)>>>8,s[i++]=255&o.duration,s[i++]=(4278190080&o.size)>>>24,s[i++]=(16711680&o.size)>>>16,s[i++]=(65280&o.size)>>>8,s[i++]=255&o.size,s[i++]=o.flags.isLeading<<2|o.flags.dependsOn,s[i++]=o.flags.isDependedOn<<6|o.flags.hasRedundancy<<4|o.flags.paddingValue<<1|o.flags.isNonSyncSample,s[i++]=61440&o.flags.degradationPriority,s[i++]=15&o.flags.degradationPriority,s[i++]=(4278190080&o.compositionTimeOffset)>>>24,s[i++]=(16711680&o.compositionTimeOffset)>>>16,s[i++]=(65280&o.compositionTimeOffset)>>>8,s[i++]=255&o.compositionTimeOffset;return n(E.trun,s)},F=function(e,t){var i,s,r,a,o,l;for(t+=20+8*(a=e.samples||[]).length,r=$(a,t),(i=new Uint8Array(r.length+8*a.length)).set(r),s=r.length,l=0;l<a.length;l++)o=a[l],i[s++]=(4278190080&o.duration)>>>24,i[s++]=(16711680&o.duration)>>>16,i[s++]=(65280&o.duration)>>>8,i[s++]=255&o.duration,i[s++]=(4278190080&o.size)>>>24,i[s++]=(16711680&o.size)>>>16,i[s++]=(65280&o.size)>>>8,i[s++]=255&o.size;return n(E.trun,i)},w=function(e,t){return"audio"===e.type?F(e,t):q(e,t)};var G,X,Y,K,Q,J,Z,ee,te={ftyp:a=function(){return n(E.ftyp,C,x,C,k)},mdat:function(e){return n(E.mdat,e)},moof:c,moov:u,initSegment:function(e){var t,i=a(),n=u(e);return(t=new Uint8Array(i.byteLength+n.byteLength)).set(i),t.set(n,i.byteLength),t}},ie=function(e,t){var i={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return i.dataOffset=t,i.compositionTimeOffset=e.pts-e.dts,i.duration=e.duration,i.size=4*e.length,i.size+=e.byteLength,e.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i},ne={groupNalsIntoFrames:function(e){var t,i,n=[],s=[];for(s.byteLength=0,s.nalCount=0,s.duration=0,n.byteLength=0,t=0;t<e.length;t++)"access_unit_delimiter_rbsp"===(i=e[t]).nalUnitType?(n.length&&(n.duration=i.dts-n.dts,s.byteLength+=n.byteLength,s.nalCount+=n.length,s.duration+=n.duration,s.push(n)),(n=[i]).byteLength=i.data.byteLength,n.pts=i.pts,n.dts=i.dts):("slice_layer_without_partitioning_rbsp_idr"===i.nalUnitType&&(n.keyFrame=!0),n.duration=i.dts-n.dts,n.byteLength+=i.data.byteLength,n.push(i));return s.length&&(!n.duration||n.duration<=0)&&(n.duration=s[s.length-1].duration),s.byteLength+=n.byteLength,s.nalCount+=n.length,s.duration+=n.duration,s.push(n),s},groupFramesIntoGops:function(e){var t,i,n=[],s=[];for(n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=e[0].pts,n.dts=e[0].dts,s.byteLength=0,s.nalCount=0,s.duration=0,s.pts=e[0].pts,s.dts=e[0].dts,t=0;t<e.length;t++)(i=e[t]).keyFrame?(n.length&&(s.push(n),s.byteLength+=n.byteLength,s.nalCount+=n.nalCount,s.duration+=n.duration),(n=[i]).nalCount=i.length,n.byteLength=i.byteLength,n.pts=i.pts,n.dts=i.dts,n.duration=i.duration):(n.duration+=i.duration,n.nalCount+=i.length,n.byteLength+=i.byteLength,n.push(i));return s.length&&n.duration<=0&&(n.duration=s[s.length-1].duration),s.byteLength+=n.byteLength,s.nalCount+=n.nalCount,s.duration+=n.duration,s.push(n),s},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 i,n,s,r,a,o=t||0,l=[];for(i=0;i<e.length;i++)for(r=e[i],n=0;n<r.length;n++)a=r[n],o+=(s=ie(a,o)).size,l.push(s);return l},concatenateNalData:function(e){var t,i,n,s,r,a,o=0,l=e.byteLength,c=e.nalCount,u=new Uint8Array(l+4*c),h=new DataView(u.buffer);for(t=0;t<e.length;t++)for(s=e[t],i=0;i<s.length;i++)for(r=s[i],n=0;n<r.length;n++)a=r[n],h.setUint32(o,a.data.byteLength),o+=4,u.set(a.data,o),o+=a.data.byteLength;return u},generateSampleTableForFrame:function(e,t){var i,n=[];return i=ie(e,t||0),n.push(i),n},concatenateNalDataForFrame:function(e){var t,i,n=0,s=e.byteLength,r=e.length,a=new Uint8Array(s+4*r),o=new DataView(a.buffer);for(t=0;t<e.length;t++)i=e[t],o.setUint32(n,i.data.byteLength),n+=4,a.set(i.data,n),n+=i.data.byteLength;return a}},se=[33,16,5,32,164,27],re=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],ae=function(e){for(var t=[];e--;)t.push(0);return t},oe=9e4;J=function(e,t){return X(Q(e,t))},Z=function(e,t){return Y(K(e),t)},ee=function(e,t,i){return K(i?e:e-t)};var le={ONE_SECOND_IN_TS:oe,secondsToVideoTs:X=function(e){return e*oe},secondsToAudioTs:Y=function(e,t){return e*t},videoTsToSeconds:K=function(e){return e/oe},audioTsToSeconds:Q=function(e,t){return e/t},audioTsToVideoTs:J,videoTsToAudioTs:Z,metadataTsToSeconds:ee},ce=le,ue={prefixWithSilence:function(e,t,i,n){var s,r,a,o,l,c=0,u=0,h=0;if(t.length&&(s=ce.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),r=Math.ceil(ce.ONE_SECOND_IN_TS/(e.samplerate/1024)),i&&n&&(c=s-Math.max(i,n),h=(u=Math.floor(c/r))*r),!(u<1||h>ce.ONE_SECOND_IN_TS/2))){for((a=function(){if(!G){var e={96e3:[se,[227,64],ae(154),[56]],88200:[se,[231],ae(170),[56]],64e3:[se,[248,192],ae(240),[56]],48e3:[se,[255,192],ae(268),[55,148,128],ae(54),[112]],44100:[se,[255,192],ae(268),[55,163,128],ae(84),[112]],32e3:[se,[255,192],ae(268),[55,234],ae(226),[112]],24e3:[se,[255,192],ae(268),[55,255,128],ae(268),[111,112],ae(126),[224]],16e3:[se,[255,192],ae(268),[55,255,128],ae(268),[111,255],ae(269),[223,108],ae(195),[1,192]],12e3:[re,ae(268),[3,127,248],ae(268),[6,255,240],ae(268),[13,255,224],ae(268),[27,253,128],ae(259),[56]],11025:[re,ae(268),[3,127,248],ae(268),[6,255,240],ae(268),[13,255,224],ae(268),[27,255,192],ae(268),[55,175,128],ae(108),[112]],8e3:[re,ae(268),[3,121,16],ae(47),[7]]};t=e,G=Object.keys(t).reduce((function(e,i){return e[i]=new Uint8Array(t[i].reduce((function(e,t){return e.concat(t)}),[])),e}),{})}var t;return G}()[e.samplerate])||(a=t[0].data),o=0;o<u;o++)l=t[0],t.splice(0,0,{data:a,dts:l.dts-r,pts:l.pts-r});return e.baseMediaDecodeTime-=Math.floor(ce.videoTsToAudioTs(h,e.samplerate)),h}},trimAdtsFramesByEarliestDts:function(e,t,i){return t.minSegmentDts>=i?e:(t.minSegmentDts=1/0,e.filter((function(e){return e.dts>=i&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)})))},generateSampleTable:function(e){var t,i,n=[];for(t=0;t<e.length;t++)i=e[t],n.push({size:i.data.byteLength,duration:1024});return n},concatenateFrameData:function(e){var t,i,n=0,s=new Uint8Array(function(e){var t,i=0;for(t=0;t<e.length;t++)i+=e[t].data.byteLength;return i}(e));for(t=0;t<e.length;t++)i=e[t],s.set(i.data,n),n+=i.data.byteLength;return s}},he=le.ONE_SECOND_IN_TS,de={clearDtsInfo:function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},calculateTrackBaseMediaDecodeTime:function(e,t){var i,n=e.minSegmentDts;return t||(n-=e.timelineStartInfo.dts),i=e.timelineStartInfo.baseMediaDecodeTime,i+=n,i=Math.max(0,i),"audio"===e.type&&(i*=e.samplerate/he,i=Math.floor(i)),i},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))}},pe={parseSei:function(e){for(var t=0,i={payloadType:-1,payloadSize:0},n=0,s=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)n+=255,t++;for(n+=e[t++];255===e[t];)s+=255,t++;if(s+=e[t++],!i.payload&&4===n){if("GA94"===String.fromCharCode(e[t+3],e[t+4],e[t+5],e[t+6])){i.payloadType=n,i.payloadSize=s,i.payload=e.subarray(t,t+s);break}i.payload=void 0}t+=s,n=0,s=0}return i},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 i,n,s,r,a=[];if(!(64&t[0]))return a;for(n=31&t[0],i=0;i<n;i++)r={type:3&t[2+(s=3*i)],pts:e},4&t[s+2]&&(r.ccData=t[s+3]<<8|t[s+4],a.push(r));return a},discardEmulationPreventionBytes:function(e){for(var t,i,n=e.byteLength,s=[],r=1;r<n-2;)0===e[r]&&0===e[r+1]&&3===e[r+2]?(s.push(r+2),r+=2):r++;if(0===s.length)return e;t=n-s.length,i=new Uint8Array(t);var a=0;for(r=0;r<t;a++,r++)a===s[0]&&(a++,s.shift()),i[r]=e[a];return i},USER_DATA_REGISTERED_ITU_T_T35:4},fe=H,me=pe,ge=function(e){e=e||{},ge.prototype.init.call(this),this.parse708captions_="boolean"!=typeof e.parse708captions||e.parse708captions,this.captionPackets_=[],this.ccStreams_=[new xe(0,0),new xe(0,1),new xe(1,0),new xe(1,1)],this.parse708captions_&&(this.cc708Stream_=new Te({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")))};ge.prototype=new fe,ge.prototype.push=function(e){var t,i,n;if("sei_rbsp"===e.nalUnitType&&(t=me.parseSei(e.escapedRBSP)).payload&&t.payloadType===me.USER_DATA_REGISTERED_ITU_T_T35&&(i=me.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));n=me.parseCaptionPackets(e.pts,i),this.captionPackets_=this.captionPackets_.concat(n),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},ge.prototype.flushCCStreams=function(e){this.ccStreams_.forEach((function(t){return"flush"===e?t.flush():t.partialFlush()}),this)},ge.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)},ge.prototype.flush=function(){return this.flushStream("flush")},ge.prototype.partialFlush=function(){return this.flushStream("partialFlush")},ge.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach((function(e){e.reset()}))},ge.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)},ge.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},ge.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)},ge.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData)},ge.prototype.dispatchCea708Packet=function(e){this.parse708captions_&&this.cc708Stream_.push(e)};var ye={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},ve=function(e){return 32<=e&&e<=127||160<=e&&e<=255},_e=function(e){this.windowNum=e,this.reset()};_e.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},_e.prototype.getText=function(){return this.rows.join("\n")},_e.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},_e.prototype.newLine=function(e){for(this.rows.length>=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},_e.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},_e.prototype.addText=function(e){this.rows[this.rowIdx]+=e},_e.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var be=function(e,t,i){this.serviceNum=e,this.text="",this.currentWindow=new _e(-1),this.windows=[],this.stream=i,"string"==typeof t&&this.createTextDecoder(t)};be.prototype.init=function(e,t){this.startPts=e;for(var i=0;i<8;i++)this.windows[i]=new _e(i),"function"==typeof t&&(this.windows[i].beforeRowOverflow=t)},be.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]},be.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 Te=function(e){e=e||{},Te.prototype.init.call(this);var t,i=this,n=e.captionServices||{},s={};Object.keys(n).forEach((e=>{t=n[e],/^SERVICE/.test(e)&&(s[e]=t.encoding)})),this.serviceEncodings=s,this.current708Packet=null,this.services={},this.push=function(e){3===e.type?(i.new708Packet(),i.add708Bytes(e)):(null===i.current708Packet&&i.new708Packet(),i.add708Bytes(e))}};Te.prototype=new fe,Te.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},Te.prototype.add708Bytes=function(e){var t=e.ccData,i=t>>>8,n=255&t;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(i),this.current708Packet.data.push(n)},Te.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,i=null,n=null,s=0,r=t[s++];for(e.seq=r>>6,e.sizeCode=63&r;s<t.length;s++)n=31&(r=t[s++]),7==(i=r>>5)&&n>0&&(i=r=t[s++]),this.pushServiceBlock(i,s,n),n>0&&(s+=n-1)},Te.prototype.pushServiceBlock=function(e,t,i){var n,s=t,r=this.current708Packet.data,a=this.services[e];for(a||(a=this.initService(e,s));s<t+i&&s<r.length;s++)n=r[s],ve(n)?s=this.handleText(s,a):24===n?s=this.multiByteCharacter(s,a):16===n?s=this.extendedCommands(s,a):128<=n&&n<=135?s=this.setCurrentWindow(s,a):152<=n&&n<=159?s=this.defineWindow(s,a):136===n?s=this.clearWindows(s,a):140===n?s=this.deleteWindows(s,a):137===n?s=this.displayWindows(s,a):138===n?s=this.hideWindows(s,a):139===n?s=this.toggleWindows(s,a):151===n?s=this.setWindowAttributes(s,a):144===n?s=this.setPenAttributes(s,a):145===n?s=this.setPenColor(s,a):146===n?s=this.setPenLocation(s,a):143===n?a=this.reset(s,a):8===n?a.currentWindow.backspace():12===n?a.currentWindow.clearText():13===n?a.currentWindow.pendingNewLine=!0:14===n?a.currentWindow.clearText():141===n&&s++},Te.prototype.extendedCommands=function(e,t){var i=this.current708Packet.data[++e];return ve(i)&&(e=this.handleText(e,t,{isExtended:!0})),e},Te.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)]},Te.prototype.initService=function(e,t){var i,n,s=this;return(i="SERVICE"+e)in this.serviceEncodings&&(n=this.serviceEncodings[i]),this.services[e]=new be(e,n,s),this.services[e].init(this.getPts(t),(function(t){s.flushDisplayed(t,s.services[e])})),this.services[e]},Te.prototype.handleText=function(e,t,i){var n,s,r,a,o=i&&i.isExtended,l=i&&i.isMultiByte,c=this.current708Packet.data,u=o?4096:0,h=c[e],d=c[e+1],p=t.currentWindow;if(l?(s=[h,d],e++):s=[h],t.textDecoder_&&!o)n=t.textDecoder_.decode(new Uint8Array(s));else if(l){const e=s.map((e=>("0"+(255&e).toString(16)).slice(-2))).join("");n=String.fromCharCode(parseInt(e,16))}else a=ye[r=u|h]||r,n=4096&r&&r===a?"":String.fromCharCode(a);return p.pendingNewLine&&!p.isEmpty()&&p.newLine(this.getPts(e)),p.pendingNewLine=!1,p.addText(n),e},Te.prototype.multiByteCharacter=function(e,t){var i=this.current708Packet.data,n=i[e+1],s=i[e+2];return ve(n)&&ve(s)&&(e=this.handleText(++e,t,{isMultiByte:!0})),e},Te.prototype.setCurrentWindow=function(e,t){var i=7&this.current708Packet.data[e];return t.setCurrentWindow(i),e},Te.prototype.defineWindow=function(e,t){var i=this.current708Packet.data,n=i[e],s=7&n;t.setCurrentWindow(s);var r=t.currentWindow;return n=i[++e],r.visible=(32&n)>>5,r.rowLock=(16&n)>>4,r.columnLock=(8&n)>>3,r.priority=7&n,n=i[++e],r.relativePositioning=(128&n)>>7,r.anchorVertical=127&n,n=i[++e],r.anchorHorizontal=n,n=i[++e],r.anchorPoint=(240&n)>>4,r.rowCount=15&n,n=i[++e],r.columnCount=63&n,n=i[++e],r.windowStyle=(56&n)>>3,r.penStyle=7&n,r.virtualRowCount=r.rowCount+1,e},Te.prototype.setWindowAttributes=function(e,t){var i=this.current708Packet.data,n=i[e],s=t.currentWindow.winAttr;return n=i[++e],s.fillOpacity=(192&n)>>6,s.fillRed=(48&n)>>4,s.fillGreen=(12&n)>>2,s.fillBlue=3&n,n=i[++e],s.borderType=(192&n)>>6,s.borderRed=(48&n)>>4,s.borderGreen=(12&n)>>2,s.borderBlue=3&n,n=i[++e],s.borderType+=(128&n)>>5,s.wordWrap=(64&n)>>6,s.printDirection=(48&n)>>4,s.scrollDirection=(12&n)>>2,s.justify=3&n,n=i[++e],s.effectSpeed=(240&n)>>4,s.effectDirection=(12&n)>>2,s.displayEffect=3&n,e},Te.prototype.flushDisplayed=function(e,t){for(var i=[],n=0;n<8;n++)t.windows[n].visible&&!t.windows[n].isEmpty()&&i.push(t.windows[n].getText());t.endPts=e,t.text=i.join("\n\n"),this.pushCaption(t),t.startPts=e},Te.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts)},Te.prototype.displayWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var s=0;s<8;s++)i&1<<s&&(t.windows[s].visible=1);return e},Te.prototype.hideWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var s=0;s<8;s++)i&1<<s&&(t.windows[s].visible=0);return e},Te.prototype.toggleWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var s=0;s<8;s++)i&1<<s&&(t.windows[s].visible^=1);return e},Te.prototype.clearWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var s=0;s<8;s++)i&1<<s&&t.windows[s].clearText();return e},Te.prototype.deleteWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var s=0;s<8;s++)i&1<<s&&t.windows[s].reset();return e},Te.prototype.setPenAttributes=function(e,t){var i=this.current708Packet.data,n=i[e],s=t.currentWindow.penAttr;return n=i[++e],s.textTag=(240&n)>>4,s.offset=(12&n)>>2,s.penSize=3&n,n=i[++e],s.italics=(128&n)>>7,s.underline=(64&n)>>6,s.edgeType=(56&n)>>3,s.fontStyle=7&n,e},Te.prototype.setPenColor=function(e,t){var i=this.current708Packet.data,n=i[e],s=t.currentWindow.penColor;return n=i[++e],s.fgOpacity=(192&n)>>6,s.fgRed=(48&n)>>4,s.fgGreen=(12&n)>>2,s.fgBlue=3&n,n=i[++e],s.bgOpacity=(192&n)>>6,s.bgRed=(48&n)>>4,s.bgGreen=(12&n)>>2,s.bgBlue=3&n,n=i[++e],s.edgeRed=(48&n)>>4,s.edgeGreen=(12&n)>>2,s.edgeBlue=3&n,e},Te.prototype.setPenLocation=function(e,t){var i=this.current708Packet.data,n=i[e],s=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,n=i[++e],s.row=15&n,n=i[++e],s.column=63&n,e},Te.prototype.reset=function(e,t){var i=this.getPts(e);return this.flushDisplayed(i,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},xe=function(e,t){xe.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,i,n,s,r;if((t=32639&e.ccData)!==this.lastControlCode_){if(4096==(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),n=t>>>8,s=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),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,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()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(n,s))r=we((n=(3&n)<<8)|s),this[this.mode_](e.pts,r),this.column_++;else if(this.isExtCharacter(n,s))"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),r=we((n=(3&n)<<8)|s),this[this.mode_](e.pts,r),this.column_++;else if(this.isMidRowCode(n,s))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14&~s||this.addFormatting(e.pts,["i"]),1&~s||this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(n,s)){const e=3&s;this.nonDisplayed_[this.row_].offset=e,this.column_+=e}else if(this.isPAC(n,s)){var a=Ee.indexOf(7968&t);if("rollUp"===this.mode_&&(a-this.rollUpRows_+1<0&&(a=this.rollUpRows_-1),this.setRollUp(e.pts,a)),a!==this.row_&&a>=0&&a<=14&&(this.clearFormatting(e.pts),this.row_=a),1&s&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),!(16&~t)){const e=(14&t)>>1;this.column_=4*e,this.nonDisplayed_[this.row_].indent+=e}this.isColorPAC(s)&&(14&~s||this.addFormatting(e.pts,["i"]))}else this.isNormalChar(n)&&(0===s&&(s=null),r=we(n),r+=we(s),this[this.mode_](e.pts,r),this.column_+=r.length)}else this.lastControlCode_=null}};xe.prototype=new fe,xe.prototype.flushDisplayed=function(e){const t=e=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+e+"."})},i=[];this.displayed_.forEach(((e,n)=>{if(e&&e.text&&e.text.length){try{e.text=e.text.trim()}catch(e){t(n)}e.text.length&&i.push({text:e.text,line:n+1,position:10+Math.min(70,10*e.indent)+2.5*e.offset})}else null==e&&t(n)})),i.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,content:i,stream:this.name_})},xe.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_=[]},xe.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_},xe.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},xe.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},xe.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},xe.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},xe.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},xe.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},xe.prototype.isNormalChar=function(e){return e>=32&&e<=127},xe.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 i=0;i<this.rollUpRows_;i++)this.displayed_[t-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]={text:"",indent:0,offset:0};void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},xe.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var i=t.reduce((function(e,t){return e+"<"+t+">"}),"");this[this.mode_](e,i)},xe.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)}},xe.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_].text;i+=t,this.nonDisplayed_[this.row_].text=i},xe.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_].text;i+=t,this.displayed_[this.row_].text=i},xe.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}},xe.prototype.paintOn=function(e,t){var i=this.displayed_[this.row_].text;i+=t,this.displayed_[this.row_].text=i};var ke={CaptionStream:ge,Cea608Stream:xe,Cea708Stream:Te},Ae={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Ie=H,Pe="shared",Oe=function(e,t){var i=1;for(e>t&&(i=-1);Math.abs(t-e)>4294967296;)e+=8589934592*i;return e},Le=function(e){var t,i;Le.prototype.init.call(this),this.type_=e||Pe,this.push=function(e){"metadata"!==e.type?this.type_!==Pe&&e.type!==this.type_||(void 0===i&&(i=e.dts),e.dts=Oe(e.dts,i),e.pts=Oe(e.pts,i),t=e.dts,this.trigger("data",e)):this.trigger("data",e)},this.flush=function(){i=t,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){i=void 0,t=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Le.prototype=new Ie;var De,Re={TimestampRolloverStream:Le,handleRollover:Oe},Ne=(e,t,i)=>{if(!e)return-1;for(var n=i;n<e.length;n++)if(e[n]===t)return n;return-1},Me=function(e,t,i){var n,s="";for(n=t;n<i;n++)s+="%"+("00"+e[n].toString(16)).slice(-2);return s},je=function(e,t,i){return decodeURIComponent(Me(e,t,i))},Ue=function(e,t,i){return unescape(Me(e,t,i))},Be=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},Fe={APIC:function(e){var t,i,n=1;3===e.data[0]&&((t=Ne(e.data,0,n))<0||(e.mimeType=Ue(e.data,n,t),n=t+1,e.pictureType=e.data[n],n++,(i=Ne(e.data,0,n))<0||(e.description=je(e.data,n,i),n=i+1,"--\x3e"===e.mimeType?e.url=Ue(e.data,n,e.data.length):e.pictureData=e.data.subarray(n,e.data.length))))},"T*":function(e){3===e.data[0]&&(e.value=je(e.data,1,e.data.length).replace(/\0*$/,""),e.values=e.value.split("\0"))},TXXX:function(e){var t;3===e.data[0]&&-1!==(t=Ne(e.data,0,1))&&(e.description=je(e.data,1,t),e.value=je(e.data,t+1,e.data.length).replace(/\0*$/,""),e.data=e.value)},"W*":function(e){e.url=Ue(e.data,0,e.data.length).replace(/\0.*$/,"")},WXXX:function(e){var t;3===e.data[0]&&-1!==(t=Ne(e.data,0,1))&&(e.description=je(e.data,1,t),e.url=Ue(e.data,t+1,e.data.length).replace(/\0.*$/,""))},PRIV:function(e){var t;for(t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=Ue(e.data,0,t);break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}},qe={parseId3Frames:function(e){var t,i=10,n=0,s=[];if(!(e.length<10||e[0]!=="I".charCodeAt(0)||e[1]!=="D".charCodeAt(0)||e[2]!=="3".charCodeAt(0))){n=Be(e.subarray(6,10)),n+=10,64&e[5]&&(i+=4,i+=Be(e.subarray(10,14)),n-=Be(e.subarray(16,20)));do{if((t=Be(e.subarray(i+4,i+8)))<1)break;var r={id:String.fromCharCode(e[i],e[i+1],e[i+2],e[i+3]),data:e.subarray(i+10,i+t+10)};r.key=r.id,Fe[r.id]?Fe[r.id](r):"T"===r.id[0]?Fe["T*"](r):"W"===r.id[0]&&Fe["W*"](r),s.push(r),i+=10,i+=t}while(i<n);return s}},parseSyncSafeInteger:Be,frameParsers:Fe},$e=Ae,He=qe;(De=function(e){var t,i={descriptor:e&&e.descriptor},n=0,s=[],r=0;if(De.prototype.init.call(this),this.dispatchType=$e.METADATA_STREAM_TYPE.toString(16),i.descriptor)for(t=0;t<i.descriptor.length;t++)this.dispatchType+=("00"+i.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,i,a,o,l;if("timed-metadata"===e.type)if(e.dataAlignmentIndicator&&(r=0,s.length=0),0===s.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(s.push(e),r+=e.data.byteLength,1===s.length&&(n=He.parseSyncSafeInteger(e.data.subarray(6,10)),n+=10),!(r<n)){for(t={data:new Uint8Array(n),frames:[],pts:s[0].pts,dts:s[0].dts},l=0;l<n;)t.data.set(s[0].data.subarray(0,n-l),l),l+=s[0].data.byteLength,r-=s[0].data.byteLength,s.shift();i=10,64&t.data[5]&&(i+=4,i+=He.parseSyncSafeInteger(t.data.subarray(10,14)),n-=He.parseSyncSafeInteger(t.data.subarray(16,20)));do{if((a=He.parseSyncSafeInteger(t.data.subarray(i+4,i+8)))<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if((o={id:String.fromCharCode(t.data[i],t.data[i+1],t.data[i+2],t.data[i+3]),data:t.data.subarray(i+10,i+a+10)}).key=o.id,He.frameParsers[o.id]?He.frameParsers[o.id](o):"T"===o.id[0]?He.frameParsers["T*"](o):"W"===o.id[0]&&He.frameParsers["W*"](o),"com.apple.streaming.transportStreamTimestamp"===o.owner){var c=o.data,u=(1&c[3])<<30|c[4]<<22|c[5]<<14|c[6]<<6|c[7]>>>2;u*=4,u+=3&c[7],o.timeStamp=u,void 0===t.pts&&void 0===t.dts&&(t.pts=o.timeStamp,t.dts=o.timeStamp),this.trigger("timestamp",o)}t.frames.push(o),i+=10,i+=a}while(i<n);this.trigger("data",t)}}}).prototype=new H;var Ve,ze,We,Ge=De,Xe=H,Ye=ke,Ke=Ae,Qe=Re.TimestampRolloverStream,Je=188;(Ve=function(){var e=new Uint8Array(Je),t=0;Ve.prototype.init.call(this),this.push=function(i){var n,s=0,r=Je;for(t?((n=new Uint8Array(i.byteLength+t)).set(e.subarray(0,t)),n.set(i,t),t=0):n=i;r<n.byteLength;)71!==n[s]||71!==n[r]?(s++,r++):(this.trigger("data",n.subarray(s,r)),s+=Je,r+=Je);s<n.byteLength&&(e.set(n.subarray(s),0),t=n.byteLength-s)},this.flush=function(){t===Je&&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 Xe,(ze=function(){var e,t,i,n;ze.prototype.init.call(this),n=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,n){var s=0;n.payloadUnitStartIndicator&&(s+=e[s]+1),"pat"===n.type?t(e.subarray(s),n):i(e.subarray(s),n)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],n.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=n.pmtPid},i=function(e,t){var i,s;if(1&e[5]){for(n.programMapTable={video:null,audio:null,"timed-metadata":{}},i=3+((15&e[1])<<8|e[2])-4,s=12+((15&e[10])<<8|e[11]);s<i;){var r=e[s],a=(31&e[s+1])<<8|e[s+2];r===Ke.H264_STREAM_TYPE&&null===n.programMapTable.video?n.programMapTable.video=a:r===Ke.ADTS_STREAM_TYPE&&null===n.programMapTable.audio?n.programMapTable.audio=a:r===Ke.METADATA_STREAM_TYPE&&(n.programMapTable["timed-metadata"][a]=r),s+=5+((15&e[s+3])<<8|e[s+4])}t.programMapTable=n.programMapTable}},this.push=function(t){var i={},n=4;if(i.payloadUnitStartIndicator=!!(64&t[1]),i.pid=31&t[1],i.pid<<=8,i.pid|=t[2],(48&t[3])>>>4>1&&(n+=t[n]+1),0===i.pid)i.type="pat",e(t.subarray(n),i),this.trigger("data",i);else if(i.pid===this.pmtPid)for(i.type="pmt",e(t.subarray(n),i),this.trigger("data",i);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,n,i]):this.processPes_(t,n,i)},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=Ke.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=Ke.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}}).prototype=new Xe,ze.STREAM_TYPES={h264:27,adts:15},We=function(){var e,t=this,i=!1,n={data:[],size:0},s={data:[],size:0},r={data:[],size:0},a=function(e,i,n){var s,r,a=new Uint8Array(e.size),o={type:i},l=0,c=0;if(e.data.length&&!(e.size<9)){for(o.trackId=e.data[0].pid,l=0;l<e.data.length;l++)r=e.data[l],a.set(r.data,c),c+=r.data.byteLength;!function(e,t){var i;const n=e[0]<<16|e[1]<<8|e[2];t.data=new Uint8Array,1===n&&(t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=!!(4&e[6]),192&(i=e[7])&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&i&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1)),t.data=e.subarray(9+e[8]))}(a,o),s="video"===i||o.packetLength<=e.size,(n||s)&&(e.size=0,e.data.length=0),s&&t.trigger("data",o)}};We.prototype.init.call(this),this.push=function(o){({pat:function(){},pes:function(){var e,t;switch(o.streamType){case Ke.H264_STREAM_TYPE:e=n,t="video";break;case Ke.ADTS_STREAM_TYPE:e=s,t="audio";break;case Ke.METADATA_STREAM_TYPE:e=r,t="timed-metadata";break;default:return}o.payloadUnitStartIndicator&&a(e,t,!0),e.data.push(o),e.size+=o.data.byteLength},pmt:function(){var n={type:"metadata",tracks:[]};null!==(e=o.programMapTable).video&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),i=!0,t.trigger("data",n)}})[o.type]()},this.reset=function(){n.size=0,n.data.length=0,s.size=0,s.data.length=0,this.trigger("reset")},this.flushStreams_=function(){a(n,"video"),a(s,"audio"),a(r,"timed-metadata")},this.flush=function(){if(!i&&e){var n={type:"metadata",tracks:[]};null!==e.video&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),t.trigger("data",n)}i=!1,this.flushStreams_(),this.trigger("done")}},We.prototype=new Xe;var Ze={PAT_PID:0,MP2T_PACKET_LENGTH:Je,TransportPacketStream:Ve,TransportParseStream:ze,ElementaryStream:We,TimestampRolloverStream:Qe,CaptionStream:Ye.CaptionStream,Cea608Stream:Ye.Cea608Stream,Cea708Stream:Ye.Cea708Stream,MetadataStream:Ge};for(var et in Ke)Ke.hasOwnProperty(et)&&(Ze[et]=Ke[et]);var tt,it=Ze,nt=le.ONE_SECOND_IN_TS,st=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];(tt=function(e){var t,i=0;tt.prototype.init.call(this),this.skipWarn_=function(e,t){this.trigger("log",{level:"warn",message:`adts skiping bytes ${e} to ${t} in frame ${i} outside syncword`})},this.push=function(n){var s,r,a,o,l,c=0;if(e||(i=0),"audio"===n.type){var u;for(t&&t.length?(a=t,(t=new Uint8Array(a.byteLength+n.data.byteLength)).set(a),t.set(n.data,a.byteLength)):t=n.data;c+7<t.length;)if(255===t[c]&&240==(246&t[c+1])){if("number"==typeof u&&(this.skipWarn_(u,c),u=null),r=2*(1&~t[c+1]),s=(3&t[c+3])<<11|t[c+4]<<3|(224&t[c+5])>>5,l=(o=1024*(1+(3&t[c+6])))*nt/st[(60&t[c+2])>>>2],t.byteLength-c<s)break;this.trigger("data",{pts:n.pts+i*l,dts:n.dts+i*l,sampleCount:o,audioobjecttype:1+(t[c+2]>>>6&3),channelcount:(1&t[c+2])<<2|(192&t[c+3])>>>6,samplerate:st[(60&t[c+2])>>>2],samplingfrequencyindex:(60&t[c+2])>>>2,samplesize:16,data:t.subarray(c+7+r,c+s)}),i++,c+=s}else"number"!=typeof u&&(u=c),c++;"number"==typeof u&&(this.skipWarn_(u,c),u=null),t=t.subarray(c)}},this.flush=function(){i=0,this.trigger("done")},this.reset=function(){t=void 0,this.trigger("reset")},this.endTimeline=function(){t=void 0,this.trigger("endedtimeline")}}).prototype=new H;var rt,at,ot,lt=tt,ct=H,ut=function(e){var t=e.byteLength,i=0,n=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+n},this.loadWord=function(){var s=e.byteLength-t,r=new Uint8Array(4),a=Math.min(4,t);if(0===a)throw new Error("no bytes available");r.set(e.subarray(s,s+a)),i=new DataView(r.buffer).getUint32(0),n=8*a,t-=a},this.skipBits=function(e){var s;n>e?(i<<=e,n-=e):(e-=n,e-=8*(s=Math.floor(e/8)),t-=s,this.loadWord(),i<<=e,n-=e)},this.readBits=function(e){var s=Math.min(n,e),r=i>>>32-s;return(n-=s)>0?i<<=s:t>0&&this.loadWord(),(s=e-s)>0?r<<s|this.readBits(s):r},this.skipLeadingZeros=function(){var e;for(e=0;e<n;++e)if(i&2147483648>>>e)return i<<=e,n-=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()};(at=function(){var e,t,i=0;at.prototype.init.call(this),this.push=function(n){var s;t?((s=new Uint8Array(t.byteLength+n.data.byteLength)).set(t),s.set(n.data,t.byteLength),t=s):t=n.data;for(var r=t.byteLength;i<r-3;i++)if(1===t[i+2]){e=i+5;break}for(;e<r;)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}i+3!==e-2&&this.trigger("data",t.subarray(i+3,e-2));do{e++}while(1!==t[e]&&e<r);i=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(i+3,e-2)),i=e-2,e+=3;break;default:e+=3}t=t.subarray(i),e-=i,i=0},this.reset=function(){t=null,i=0,this.trigger("reset")},this.flush=function(){t&&t.byteLength>3&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}}).prototype=new ct,ot={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},rt=function(){var e,t,i,n,s,r,a,o=new at;rt.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,n=e.dts,o.push(e))},o.on("data",(function(a){var o={trackId:t,pts:i,dts:n,data:a,nalUnitTypeCode:31&a[0]};switch(o.nalUnitTypeCode){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=s(a.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=s(a.subarray(1)),o.config=r(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()},a=function(e,t){var i,n=8,s=8;for(i=0;i<e;i++)0!==s&&(s=(n+t.readExpGolomb()+256)%256),n=0===s?n:s},s=function(e){for(var t,i,n=e.byteLength,s=[],r=1;r<n-2;)0===e[r]&&0===e[r+1]&&3===e[r+2]?(s.push(r+2),r+=2):r++;if(0===s.length)return e;t=n-s.length,i=new Uint8Array(t);var a=0;for(r=0;r<t;a++,r++)a===s[0]&&(a++,s.shift()),i[r]=e[a];return i},r=function(e){var t,i,n,s,r,o,l,c,u,h,d,p,f=0,m=0,g=0,y=0,v=[1,1];if(i=(t=new ut(e)).readUnsignedByte(),s=t.readUnsignedByte(),n=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),ot[i]&&(3===(r=t.readUnsignedExpGolomb())&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(d=3!==r?8:12,p=0;p<d;p++)t.readBoolean()&&a(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(),l=t.readUnsignedExpGolomb(),p=0;p<l;p++)t.skipExpGolomb();if(t.skipUnsignedExpGolomb(),t.skipBits(1),c=t.readUnsignedExpGolomb(),u=t.readUnsignedExpGolomb(),0===(h=t.readBits(1))&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(f=t.readUnsignedExpGolomb(),m=t.readUnsignedExpGolomb(),g=t.readUnsignedExpGolomb(),y=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(t.readUnsignedByte()){case 1:v=[1,1];break;case 2:v=[12,11];break;case 3:v=[10,11];break;case 4:v=[16,11];break;case 5:v=[40,33];break;case 6:v=[24,11];break;case 7:v=[20,11];break;case 8:v=[32,11];break;case 9:v=[80,33];break;case 10:v=[18,11];break;case 11:v=[15,11];break;case 12:v=[64,33];break;case 13:v=[160,99];break;case 14:v=[4,3];break;case 15:v=[3,2];break;case 16:v=[2,1];break;case 255:v=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()]}v&&(v[0],v[1])}return{profileIdc:i,levelIdc:n,profileCompatibility:s,width:16*(c+1)-2*f-2*m,height:(2-h)*(u+1)*16-2*g-2*y,sarRatio:v}}},rt.prototype=new ct;var ht,dt={H264Stream:rt,NalByteStream:at},pt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],ft=function(e,t){var i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return i=i>=0?i:0,(16&e[t+5])>>4?i+20:i+10},mt=function(e,t){return e.length-t<10||e[t]!=="I".charCodeAt(0)||e[t+1]!=="D".charCodeAt(0)||e[t+2]!=="3".charCodeAt(0)?t:(t+=ft(e,t),mt(e,t))},gt=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},yt={isLikelyAacData:function(e){var t=mt(e,0);return e.length>=t+2&&!(255&~e[t])&&!(240&~e[t+1])&&16==(22&e[t+1])},parseId3TagSize:ft,parseAdtsSize:function(e,t){var i=(224&e[t+5])>>5,n=e[t+4]<<3;return 6144&e[t+3]|n|i},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 pt[(60&e[t+2])>>>2];t++}return null},parseAacTimestamp:function(e){var t,i,n;t=10,64&e[5]&&(t+=4,t+=gt(e.subarray(10,14)));do{if((i=gt(e.subarray(t+4,t+8)))<1)return null;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){n=e.subarray(t+10,t+i+10);for(var s=0;s<n.byteLength;s++)if(0===n[s]){var r=unescape(function(e,t,i){var n,s="";for(n=0;n<i;n++)s+="%"+("00"+e[n].toString(16)).slice(-2);return s}(n,0,s));if("com.apple.streaming.transportStreamTimestamp"===r){var a=n.subarray(s+1),o=(1&a[3])<<30|a[4]<<22|a[5]<<14|a[6]<<6|a[7]>>>2;return(o*=4)+(3&a[7])}break}}t+=10,t+=i}while(t<e.byteLength);return null}},vt=yt;(ht=function(){var e=new Uint8Array,t=0;ht.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(i){var n,s,r,a,o=0,l=0;for(e.length?(a=e.length,(e=new Uint8Array(i.byteLength+a)).set(e.subarray(0,a)),e.set(i,a)):e=i;e.length-l>=3;)if(e[l]!=="I".charCodeAt(0)||e[l+1]!=="D".charCodeAt(0)||e[l+2]!=="3".charCodeAt(0))if(255&~e[l]||240&~e[l+1])l++;else{if(e.length-l<7)break;if(l+(o=vt.parseAdtsSize(e,l))>e.length)break;r={type:"audio",data:e.subarray(l,l+o),pts:t,dts:t},this.trigger("data",r),l+=o}else{if(e.length-l<10)break;if(l+(o=vt.parseId3TagSize(e,l))>e.length)break;s={type:"timed-metadata",data:e.subarray(l,l+o)},this.trigger("data",s),l+=o}n=e.length-l,e=n>0?e.subarray(l):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){e=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new H;var _t,bt,Tt,St,wt=H,Et=te,Ct=ne,xt=ue,kt=de,At=it,It=le,Pt=lt,Ot=dt.H264Stream,Lt=ht,Dt=yt.isLikelyAacData,Rt=le.ONE_SECOND_IN_TS,Nt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Mt=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],jt=function(e,t){t.stream=e,this.trigger("log",t)},Ut=function(e,t){for(var i=Object.keys(t),n=0;n<i.length;n++){var s=i[n];"headOfPipeline"!==s&&t[s].on&&t[s].on("log",jt.bind(e,s))}},Bt=function(e,t){var i;if(e.length!==t.length)return!1;for(i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0},Ft=function(e,t,i,n,s,r){return{start:{dts:e,pts:e+(i-t)},end:{dts:e+(n-t),pts:e+(s-i)},prependedContentDuration:r,baseMediaDecodeTime:e}};bt=function(e,t){var i,n=[],s=0,r=0,a=1/0;i=(t=t||{}).firstSequenceNumber||0,bt.prototype.init.call(this),this.push=function(t){kt.collectDtsInfo(e,t),e&&Nt.forEach((function(i){e[i]=t[i]})),n.push(t)},this.setEarliestDts=function(e){s=e},this.setVideoBaseMediaDecodeTime=function(e){a=e},this.setAudioAppendStart=function(e){r=e},this.flush=function(){var o,l,c,u,h,d,p;0!==n.length?(o=xt.trimAdtsFramesByEarliestDts(n,e,s),e.baseMediaDecodeTime=kt.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),p=xt.prefixWithSilence(e,o,r,a),e.samples=xt.generateSampleTable(o),c=Et.mdat(xt.concatenateFrameData(o)),n=[],l=Et.moof(i,[e]),u=new Uint8Array(l.byteLength+c.byteLength),i++,u.set(l),u.set(c,l.byteLength),kt.clearDtsInfo(e),h=Math.ceil(1024*Rt/e.samplerate),o.length&&(d=o.length*h,this.trigger("segmentTimingInfo",Ft(It.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),o[0].dts,o[0].pts,o[0].dts+d,o[0].pts+d,p||0)),this.trigger("timingInfo",{start:o[0].pts,end:o[0].pts+d})),this.trigger("data",{track:e,boxes:u}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")},this.reset=function(){kt.clearDtsInfo(e),n=[],this.trigger("reset")}},bt.prototype=new wt,_t=function(e,t){var i,n,s,r=[],a=[];i=(t=t||{}).firstSequenceNumber||0,_t.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){kt.collectDtsInfo(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||n||(n=t.config,e.sps=[t.data],Mt.forEach((function(t){e[t]=n[t]}),this)),"pic_parameter_set_rbsp"!==t.nalUnitType||s||(s=t.data,e.pps=[t.data]),r.push(t)},this.flush=function(){for(var n,s,o,l,c,u,h,d,p=0;r.length&&"access_unit_delimiter_rbsp"!==r[0].nalUnitType;)r.shift();if(0===r.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(n=Ct.groupNalsIntoFrames(r),(o=Ct.groupFramesIntoGops(n))[0][0].keyFrame||((s=this.getGopForFusion_(r[0],e))?(p=s.duration,o.unshift(s),o.byteLength+=s.byteLength,o.nalCount+=s.nalCount,o.pts=s.pts,o.dts=s.dts,o.duration+=s.duration):o=Ct.extendFirstKeyFrame(o)),a.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),r=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");kt.clearDtsInfo(e),o=f}kt.collectDtsInfo(e,o),e.samples=Ct.generateSampleTable(o),c=Et.mdat(Ct.concatenateNalData(o)),e.baseMediaDecodeTime=kt.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",o.map((function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}}))),h=o[0],d=o[o.length-1],this.trigger("segmentTimingInfo",Ft(e.baseMediaDecodeTime,h.dts,h.pts,d.dts+d.duration,d.pts+d.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),r=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),l=Et.moof(i,[e]),u=new Uint8Array(l.byteLength+c.byteLength),i++,u.set(l),u.set(c,l.byteLength),this.trigger("data",{track:e,boxes:u}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),r=[],this.gopCache_.length=0,a.length=0,this.trigger("reset")},this.resetStream_=function(){kt.clearDtsInfo(e),n=void 0,s=void 0},this.getGopForFusion_=function(t){var i,n,s,r,a,o=1/0;for(a=0;a<this.gopCache_.length;a++)s=(r=this.gopCache_[a]).gop,e.pps&&Bt(e.pps[0],r.pps[0])&&e.sps&&Bt(e.sps[0],r.sps[0])&&(s.dts<e.timelineStartInfo.dts||(i=t.dts-s.dts-s.duration)>=-1e4&&i<=45e3&&(!n||o>i)&&(n=r,o=i));return n?n.gop:null},this.alignGopsAtStart_=function(e){var t,i,n,s,r,o,l,c;for(r=e.byteLength,o=e.nalCount,l=e.duration,t=i=0;t<a.length&&i<e.length&&(n=a[t],s=e[i],n.pts!==s.pts);)s.pts>n.pts?t++:(i++,r-=s.byteLength,o-=s.nalCount,l-=s.duration);return 0===i?e:i===e.length?null:((c=e.slice(i)).byteLength=r,c.duration=l,c.nalCount=o,c.pts=c[0].pts,c.dts=c[0].dts,c)},this.alignGopsAtEnd_=function(e){var t,i,n,s,r,o,l;for(t=a.length-1,i=e.length-1,r=null,o=!1;t>=0&&i>=0;){if(n=a[t],s=e[i],n.pts===s.pts){o=!0;break}n.pts>s.pts?t--:(t===a.length-1&&(r=i),i--)}if(!o&&null===r)return null;if(0===(l=o?i:r))return e;var c=e.slice(l),u=c.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 c.byteLength=u.byteLength,c.duration=u.duration,c.nalCount=u.nalCount,c.pts=c[0].pts,c.dts=c[0].dts,c},this.alignGopsWith=function(e){a=e}},_t.prototype=new wt,St=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,St.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))))}},St.prototype=new wt,St.prototype.flush=function(e){var t,i,n,s,r=0,a={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,Mt.forEach((function(e){a.info[e]=this.videoTrack[e]}),this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,Nt.forEach((function(e){a.info[e]=this.audioTrack[e]}),this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?a.type=this.pendingTracks[0].type:a.type="combined",this.emittedTracks+=this.pendingTracks.length,n=Et.initSegment(this.pendingTracks),a.initSegment=new Uint8Array(n.byteLength),a.initSegment.set(n),a.data=new Uint8Array(this.pendingBytes),s=0;s<this.pendingBoxes.length;s++)a.data.set(this.pendingBoxes[s],r),r+=this.pendingBoxes[s].byteLength;for(s=0;s<this.pendingCaptions.length;s++)(t=this.pendingCaptions[s]).startTime=It.metadataTsToSeconds(t.startPts,o,this.keepOriginalTimestamps),t.endTime=It.metadataTsToSeconds(t.endPts,o,this.keepOriginalTimestamps),a.captionStreams[t.stream]=!0,a.captions.push(t);for(s=0;s<this.pendingMetadata.length;s++)(i=this.pendingMetadata[s]).cueTime=It.metadataTsToSeconds(i.pts,o,this.keepOriginalTimestamps),a.metadata.push(i);for(a.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",a),s=0;s<a.captions.length;s++)t=a.captions[s],this.trigger("caption",t);for(s=0;s<a.metadata.length;s++)i=a.metadata[s],this.trigger("id3Frame",i)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},St.prototype.setRemux=function(e){this.remuxTracks=e},(Tt=function(e){var t,i,n=this,s=!0;Tt.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var s={};this.transmuxPipeline_=s,s.type="aac",s.metadataStream=new At.MetadataStream,s.aacStream=new Lt,s.audioTimestampRolloverStream=new At.TimestampRolloverStream("audio"),s.timedMetadataTimestampRolloverStream=new At.TimestampRolloverStream("timed-metadata"),s.adtsStream=new Pt,s.coalesceStream=new St(e,s.metadataStream),s.headOfPipeline=s.aacStream,s.aacStream.pipe(s.audioTimestampRolloverStream).pipe(s.adtsStream),s.aacStream.pipe(s.timedMetadataTimestampRolloverStream).pipe(s.metadataStream).pipe(s.coalesceStream),s.metadataStream.on("timestamp",(function(e){s.aacStream.setTimestamp(e.timeStamp)})),s.aacStream.on("data",(function(r){"timed-metadata"!==r.type&&"audio"!==r.type||s.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:n.baseMediaDecodeTime},codec:"adts",type:"audio"},s.coalesceStream.numberOfTracks++,s.audioSegmentStream=new bt(i,e),s.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream")),s.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),s.adtsStream.pipe(s.audioSegmentStream).pipe(s.coalesceStream),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t}))})),s.coalesceStream.on("data",this.trigger.bind(this,"data")),s.coalesceStream.on("done",this.trigger.bind(this,"done")),Ut(this,s)},this.setupTsPipeline=function(){var s={};this.transmuxPipeline_=s,s.type="ts",s.metadataStream=new At.MetadataStream,s.packetStream=new At.TransportPacketStream,s.parseStream=new At.TransportParseStream,s.elementaryStream=new At.ElementaryStream,s.timestampRolloverStream=new At.TimestampRolloverStream,s.adtsStream=new Pt,s.h264Stream=new Ot,s.captionStream=new At.CaptionStream(e),s.coalesceStream=new St(e,s.metadataStream),s.headOfPipeline=s.packetStream,s.packetStream.pipe(s.parseStream).pipe(s.elementaryStream).pipe(s.timestampRolloverStream),s.timestampRolloverStream.pipe(s.h264Stream),s.timestampRolloverStream.pipe(s.adtsStream),s.timestampRolloverStream.pipe(s.metadataStream).pipe(s.coalesceStream),s.h264Stream.pipe(s.captionStream).pipe(s.coalesceStream),s.elementaryStream.on("data",(function(r){var a;if("metadata"===r.type){for(a=r.tracks.length;a--;)t||"video"!==r.tracks[a].type?i||"audio"!==r.tracks[a].type||((i=r.tracks[a]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime):(t=r.tracks[a]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime;t&&!s.videoSegmentStream&&(s.coalesceStream.numberOfTracks++,s.videoSegmentStream=new _t(t,e),s.videoSegmentStream.on("log",n.getLogTrigger_("videoSegmentStream")),s.videoSegmentStream.on("timelineStartInfo",(function(t){i&&!e.keepOriginalTimestamps&&(i.timelineStartInfo=t,s.audioSegmentStream.setEarliestDts(t.dts-n.baseMediaDecodeTime))})),s.videoSegmentStream.on("processedGopsInfo",n.trigger.bind(n,"gopInfo")),s.videoSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"videoSegmentTimingInfo")),s.videoSegmentStream.on("baseMediaDecodeTime",(function(e){i&&s.audioSegmentStream.setVideoBaseMediaDecodeTime(e)})),s.videoSegmentStream.on("timingInfo",n.trigger.bind(n,"videoTimingInfo")),s.h264Stream.pipe(s.videoSegmentStream).pipe(s.coalesceStream)),i&&!s.audioSegmentStream&&(s.coalesceStream.numberOfTracks++,s.audioSegmentStream=new bt(i,e),s.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream")),s.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),s.audioSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"audioSegmentTimingInfo")),s.adtsStream.pipe(s.audioSegmentStream).pipe(s.coalesceStream)),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t})}})),s.coalesceStream.on("data",this.trigger.bind(this,"data")),s.coalesceStream.on("id3Frame",(function(e){e.dispatchType=s.metadataStream.dispatchType,n.trigger("id3Frame",e)})),s.coalesceStream.on("caption",this.trigger.bind(this,"caption")),s.coalesceStream.on("done",this.trigger.bind(this,"done")),Ut(this,s)},this.setBaseMediaDecodeTime=function(n){var s=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=n),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,kt.clearDtsInfo(i),s.audioTimestampRolloverStream&&s.audioTimestampRolloverStream.discontinuity()),t&&(s.videoSegmentStream&&(s.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,kt.clearDtsInfo(t),s.captionStream.reset()),s.timestampRolloverStream&&s.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(t){var i=this.transmuxPipeline_;e.remux=t,i&&i.coalesceStream&&i.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(i){i.stream=e,t.trigger("log",i)}},this.push=function(e){if(s){var t=Dt(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),s=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){s=!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 wt;var qt,$t,Ht,Vt,zt={Transmuxer:Tt,VideoSegmentStream:_t,AudioSegmentStream:bt,AUDIO_PROPERTIES:Nt,VIDEO_PROPERTIES:Mt,generateSegmentTimingInfo:Ft},Wt=function(e){return e>>>0},Gt=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),(t+=String.fromCharCode(e[2]))+String.fromCharCode(e[3])},Xt=Wt,Yt=Gt,Kt=function(e,t){var i,n,s,r,a,o=[];if(!t.length)return null;for(i=0;i<e.byteLength;)n=Xt(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]),s=Yt(e.subarray(i+4,i+8)),r=n>1?i+n:e.byteLength,s===t[0]&&(1===t.length?o.push(e.subarray(i+8,r)):(a=Kt(e.subarray(i+8,r),t.slice(1))).length&&(o=o.concat(a))),i=r;return o},Qt=Wt,Jt=z.getUint64,Zt=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};return 1===t.version?t.baseMediaDecodeTime=Jt(e.subarray(4)):t.baseMediaDecodeTime=Qt(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),t},ei=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]}},ti=function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},n=new DataView(e.buffer,e.byteOffset,e.byteLength),s=1&i.flags[2],r=4&i.flags[2],a=1&i.flags[1],o=2&i.flags[1],l=4&i.flags[1],c=8&i.flags[1],u=n.getUint32(4),h=8;for(s&&(i.dataOffset=n.getInt32(h),h+=4),r&&u&&(t={flags:ei(e.subarray(h,h+4))},h+=4,a&&(t.duration=n.getUint32(h),h+=4),o&&(t.size=n.getUint32(h),h+=4),c&&(1===i.version?t.compositionTimeOffset=n.getInt32(h):t.compositionTimeOffset=n.getUint32(h),h+=4),i.samples.push(t),u--);u--;)t={},a&&(t.duration=n.getUint32(h),h+=4),o&&(t.size=n.getUint32(h),h+=4),l&&(t.flags=ei(e.subarray(h,h+4)),h+=4),c&&(1===i.version?t.compositionTimeOffset=n.getInt32(h):t.compositionTimeOffset=n.getUint32(h),h+=4),i.samples.push(t);return i},ii=function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:i.getUint32(4)},s=1&n.flags[2],r=2&n.flags[2],a=8&n.flags[2],o=16&n.flags[2],l=32&n.flags[2],c=65536&n.flags[0],u=131072&n.flags[0];return t=8,s&&(t+=4,n.baseDataOffset=i.getUint32(12),t+=4),r&&(n.sampleDescriptionIndex=i.getUint32(t),t+=4),a&&(n.defaultSampleDuration=i.getUint32(t),t+=4),o&&(n.defaultSampleSize=i.getUint32(t),t+=4),l&&(n.defaultSampleFlags=i.getUint32(t)),c&&(n.durationIsEmpty=!0),!s&&u&&(n.baseDataOffsetIsMoof=!0),n},ni=(qt="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},pe.discardEmulationPreventionBytes),si=ke.CaptionStream,ri=Kt,ai=Zt,oi=ti,li=ii,ci=qt,ui=function(e,t){for(var i=e,n=0;n<t.length;n++){var s=t[n];if(i<s.size)return s;i-=s.size}return null},hi=function(){var e,t,i,n,s,r,a=!1;this.isInitialized=function(){return a},this.init=function(t){e=new si,a=!0,r=!!t&&t.isPartial,e.on("data",(function(e){e.startTime=e.startPts/n,e.endTime=e.endPts/n,s.captions.push(e),s.captionStreams[e.stream]=!0})),e.on("log",(function(e){s.logs.push(e)}))},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"==typeof t&&0===Object.keys(t).length||i===e[0]&&n===t[i])},this.parse=function(e,r,a){var o;if(!this.isInitialized())return null;if(!r||!a)return null;if(this.isNewInit(r,a))i=r[0],n=a[i];else if(null===i||!n)return t.push(e),null;for(;t.length>0;){var l=t.shift();this.parse(l,r,a)}return o=function(e,t,i){if(null===t)return null;var n=function(e,t){var i=ri(e,["moof","traf"]),n=ri(e,["mdat"]),s={},r=[];return n.forEach((function(e,t){var n=i[t];r.push({mdat:e,traf:n})})),r.forEach((function(e){var i,n,r=e.mdat,a=e.traf,o=ri(a,["tfhd"]),l=li(o[0]),c=l.trackId,u=ri(a,["tfdt"]),h=u.length>0?ai(u[0]).baseMediaDecodeTime:0,d=ri(a,["trun"]);t===c&&d.length>0&&(i=function(e,t,i){var n=t,s=i.defaultSampleDuration||0,r=i.defaultSampleSize||0,a=i.trackId,o=[];return e.forEach((function(e){var t=oi(e).samples;t.forEach((function(e){void 0===e.duration&&(e.duration=s),void 0===e.size&&(e.size=r),e.trackId=a,e.dts=n,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),"bigint"==typeof n?(e.pts=n+ci.BigInt(e.compositionTimeOffset),n+=ci.BigInt(e.duration)):(e.pts=n+e.compositionTimeOffset,n+=e.duration)})),o=o.concat(t)})),o}(d,h,l),n=function(e,t,i){var n,s,r,a,o=new DataView(e.buffer,e.byteOffset,e.byteLength),l={logs:[],seiNals:[]};for(s=0;s+4<e.length;s+=r)if(r=o.getUint32(s),s+=4,!(r<=0))switch(31&e[s]){case 6:var c=e.subarray(s+1,s+1+r),u=ui(s,t);if(n={nalUnitType:"sei_rbsp",size:r,data:c,escapedRBSP:ni(c),trackId:i},u)n.pts=u.pts,n.dts=u.dts,a=u;else{if(!a){l.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+s+" for trackId "+i+". See mux.js#223."});break}n.pts=a.pts,n.dts=a.dts}l.seiNals.push(n)}return l}(r,i,c),s[c]||(s[c]={seiNals:[],logs:[]}),s[c].seiNals=s[c].seiNals.concat(n.seiNals),s[c].logs=s[c].logs.concat(n.logs))})),s}(e,t)[t]||{};return{seiNals:n.seiNals,logs:n.logs,timescale:i}}(e,i,n),o&&o.logs&&(s.logs=s.logs.concat(o.logs)),null!==o&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),s):s.logs.length?{logs:s.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;r?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){s.captions=[],s.captionStreams={},s.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],i=null,n=null,s?this.clearParsedCaptions():s={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},di=function(e){for(var t=0,i=String.fromCharCode(e[t]),n="";"\0"!==i;)n+=i,t++,i=String.fromCharCode(e[t]);return n+i},pi=z.getUint64,fi=function(e){return void 0!==e||null!==e},mi={parseEmsgBox:function(e){var t,i,n,s,r,a,o,l=4,c=e[0];if(0===c)l+=(t=di(e.subarray(l))).length,l+=(i=di(e.subarray(l))).length,n=(u=new DataView(e.buffer)).getUint32(l),l+=4,r=u.getUint32(l),l+=4,a=u.getUint32(l),l+=4,o=u.getUint32(l),l+=4;else if(1===c){var u;n=(u=new DataView(e.buffer)).getUint32(l),l+=4,s=pi(e.subarray(l)),l+=8,a=u.getUint32(l),l+=4,o=u.getUint32(l),l+=4,l+=(t=di(e.subarray(l))).length,l+=(i=di(e.subarray(l))).length}var h={scheme_id_uri:t,value:i,timescale:n||1,presentation_time:s,presentation_time_delta:r,event_duration:a,id:o,message_data:new Uint8Array(e.subarray(l,e.byteLength))};return function(e,t){var i="\0"!==t.scheme_id_uri,n=0===e&&fi(t.presentation_time_delta)&&i,s=1===e&&fi(t.presentation_time)&&i;return!(e>1)&&n||s}(c,h)?h:void 0},scaleTime:function(e,t,i,n){return e||0===e?e/t:n+i/t}},gi=Wt,yi=function(e){return("00"+e.toString(16)).slice(-2)},vi=Kt,_i=Gt,bi=mi,Ti=z.getUint64,Si=qt,wi=qe.parseId3Frames;$t=function(e,t){var i=vi(t,["moof","traf"]).reduce((function(t,i){var n,s=vi(i,["tfhd"])[0],r=gi(s[4]<<24|s[5]<<16|s[6]<<8|s[7]),a=e[r]||9e4,o=vi(i,["tfdt"])[0],l=new DataView(o.buffer,o.byteOffset,o.byteLength);let c;return"bigint"==typeof(n=1===o[0]?Ti(o.subarray(4,12)):l.getUint32(4))?c=n/Si.BigInt(a):"number"!=typeof n||isNaN(n)||(c=n/a),c<Number.MAX_SAFE_INTEGER&&(c=Number(c)),c<t&&(t=c),t}),1/0);return"bigint"==typeof i||isFinite(i)?i:0},Vt=function(e){var t=0===e[0]?12:20;return gi(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])},Ht=function(e){var t=vi(e,["moov","trak"]),i=[];return t.forEach((function(e){var t,n,s={},r=vi(e,["tkhd"])[0];r&&(n=(t=new DataView(r.buffer,r.byteOffset,r.byteLength)).getUint8(0),s.id=0===n?t.getUint32(12):t.getUint32(20));var a=vi(e,["mdia","hdlr"])[0];if(a){var o=_i(a.subarray(8,12));s.type="vide"===o?"video":"soun"===o?"audio":o}var l=vi(e,["mdia","minf","stbl","stsd"])[0];if(l){var c=l.subarray(8);s.codec=_i(c.subarray(4,8));var u,h=vi(c,[s.codec])[0];h&&(/^[asm]vc[1-9]$/i.test(s.codec)?(u=h.subarray(78),"avcC"===_i(u.subarray(4,8))&&u.length>11?(s.codec+=".",s.codec+=yi(u[9]),s.codec+=yi(u[10]),s.codec+=yi(u[11])):s.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(s.codec)?(u=h.subarray(28),"esds"===_i(u.subarray(4,8))&&u.length>20&&0!==u[19]?(s.codec+="."+yi(u[19]),s.codec+="."+yi(u[20]>>>2&63).replace(/^0/,"")):s.codec="mp4a.40.2"):s.codec=s.codec.toLowerCase())}var d=vi(e,["mdia","mdhd"])[0];d&&(s.timescale=Vt(d)),i.push(s)})),i};var Ei=$t,Ci=Ht,xi=function(e,t=0){return vi(e,["emsg"]).map((e=>{var i=bi.parseEmsgBox(new Uint8Array(e)),n=wi(i.message_data);return{cueTime:bi.scaleTime(i.presentation_time,i.timescale,i.presentation_time_delta,t),duration:bi.scaleTime(i.event_duration,i.timescale),frames:n}}))},ki=Ae,Ai=function(e){var t=31&e[1];return(t<<=8)|e[2]},Ii=function(e){return!!(64&e[1])},Pi=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},Oi=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}},Li={parseType:function(e,t){var i=Ai(e);return 0===i?"pat":i===t?"pmt":t?"pes":null},parsePat:function(e){var t=Ii(e),i=4+Pi(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},parsePmt:function(e){var t={},i=Ii(e),n=4+Pi(e);if(i&&(n+=e[n]+1),1&e[n+5]){var s;s=3+((15&e[n+1])<<8|e[n+2])-4;for(var r=12+((15&e[n+10])<<8|e[n+11]);r<s;){var a=n+r;t[(31&e[a+1])<<8|e[a+2]]=e[a],r+=5+((15&e[a+3])<<8|e[a+4])}return t}},parsePayloadUnitStartIndicator:Ii,parsePesType:function(e,t){switch(t[Ai(e)]){case ki.H264_STREAM_TYPE:return"video";case ki.ADTS_STREAM_TYPE:return"audio";case ki.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(e){if(!Ii(e))return null;var t=4+Pi(e);if(t>=e.byteLength)return null;var i,n=null;return 192&(i=e[t+7])&&((n={}).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,n.pts*=4,n.pts+=(6&e[t+13])>>>1,n.dts=n.pts,64&i&&(n.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,n.dts*=4,n.dts+=(6&e[t+18])>>>1)),n},videoPacketContainsKeyFrame:function(e){for(var t=4+Pi(e),i=e.subarray(t),n=0,s=0,r=!1;s<i.byteLength-3;s++)if(1===i[s+2]){n=s+5;break}for(;n<i.byteLength;)switch(i[n]){case 0:if(0!==i[n-1]){n+=2;break}if(0!==i[n-2]){n++;break}s+3!==n-2&&"slice_layer_without_partitioning_rbsp_idr"===Oi(31&i[s+3])&&(r=!0);do{n++}while(1!==i[n]&&n<i.length);s=n-2,n+=3;break;case 1:if(0!==i[n-1]||0!==i[n-2]){n+=3;break}"slice_layer_without_partitioning_rbsp_idr"===Oi(31&i[s+3])&&(r=!0),s=n-2,n+=3;break;default:n+=3}return i=i.subarray(s),n-=s,s=0,i&&i.byteLength>3&&"slice_layer_without_partitioning_rbsp_idr"===Oi(31&i[s+3])&&(r=!0),r}},Di=Ae,Ri=Re.handleRollover,Ni={};Ni.ts=Li,Ni.aac=yt;var Mi=le.ONE_SECOND_IN_TS,ji=188,Ui=71,Bi=function(e,t,i){for(var n,s,r,a,o=0,l=ji,c=!1;l<=e.byteLength;)if(e[o]!==Ui||e[l]!==Ui&&l!==e.byteLength)o++,l++;else{if(n=e.subarray(o,l),"pes"===Ni.ts.parseType(n,t.pid)&&(s=Ni.ts.parsePesType(n,t.table),r=Ni.ts.parsePayloadUnitStartIndicator(n),"audio"===s&&r&&(a=Ni.ts.parsePesTime(n))&&(a.type="audio",i.audio.push(a),c=!0)),c)break;o+=ji,l+=ji}for(o=(l=e.byteLength)-ji,c=!1;o>=0;)if(e[o]!==Ui||e[l]!==Ui&&l!==e.byteLength)o--,l--;else{if(n=e.subarray(o,l),"pes"===Ni.ts.parseType(n,t.pid)&&(s=Ni.ts.parsePesType(n,t.table),r=Ni.ts.parsePayloadUnitStartIndicator(n),"audio"===s&&r&&(a=Ni.ts.parsePesTime(n))&&(a.type="audio",i.audio.push(a),c=!0)),c)break;o-=ji,l-=ji}},Fi=function(e,t,i){for(var n,s,r,a,o,l,c,u=0,h=ji,d=!1,p={data:[],size:0};h<e.byteLength;)if(e[u]!==Ui||e[h]!==Ui)u++,h++;else{if(n=e.subarray(u,h),"pes"===Ni.ts.parseType(n,t.pid)&&(s=Ni.ts.parsePesType(n,t.table),r=Ni.ts.parsePayloadUnitStartIndicator(n),"video"===s&&(r&&!d&&(a=Ni.ts.parsePesTime(n))&&(a.type="video",i.video.push(a),d=!0),!i.firstKeyFrame))){if(r&&0!==p.size){for(o=new Uint8Array(p.size),l=0;p.data.length;)c=p.data.shift(),o.set(c,l),l+=c.byteLength;if(Ni.ts.videoPacketContainsKeyFrame(o)){var f=Ni.ts.parsePesTime(o);f?(i.firstKeyFrame=f,i.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(n),p.size+=n.byteLength}if(d&&i.firstKeyFrame)break;u+=ji,h+=ji}for(u=(h=e.byteLength)-ji,d=!1;u>=0;)if(e[u]!==Ui||e[h]!==Ui)u--,h--;else{if(n=e.subarray(u,h),"pes"===Ni.ts.parseType(n,t.pid)&&(s=Ni.ts.parsePesType(n,t.table),r=Ni.ts.parsePayloadUnitStartIndicator(n),"video"===s&&r&&(a=Ni.ts.parsePesTime(n))&&(a.type="video",i.video.push(a),d=!0)),d)break;u-=ji,h-=ji}},qi=function(e,t){var i;return i=Ni.aac.isLikelyAacData(e)?function(e){for(var t,i=!1,n=0,s=null,r=null,a=0,o=0;e.length-o>=3;){switch(Ni.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10){i=!0;break}if((a=Ni.aac.parseId3TagSize(e,o))>e.length){i=!0;break}null===r&&(t=e.subarray(o,o+a),r=Ni.aac.parseAacTimestamp(t)),o+=a;break;case"audio":if(e.length-o<7){i=!0;break}if((a=Ni.aac.parseAdtsSize(e,o))>e.length){i=!0;break}null===s&&(t=e.subarray(o,o+a),s=Ni.aac.parseSampleRate(t)),n++,o+=a;break;default:o++}if(i)return null}if(null===s||null===r)return null;var l=Mi/s;return{audio:[{type:"audio",dts:r,pts:r},{type:"audio",dts:r+1024*n*l,pts:r+1024*n*l}]}}(e):function(e){var t={pid:null,table:null},i={};for(var n in function(e,t){for(var i,n=0,s=ji;s<e.byteLength;)if(e[n]!==Ui||e[s]!==Ui)n++,s++;else{switch(i=e.subarray(n,s),Ni.ts.parseType(i,t.pid)){case"pat":t.pid=Ni.ts.parsePat(i);break;case"pmt":var r=Ni.ts.parsePmt(i);t.table=t.table||{},Object.keys(r).forEach((function(e){t.table[e]=r[e]}))}n+=ji,s+=ji}}(e,t),t.table)if(t.table.hasOwnProperty(n))switch(t.table[n]){case Di.H264_STREAM_TYPE:i.video=[],Fi(e,t,i),0===i.video.length&&delete i.video;break;case Di.ADTS_STREAM_TYPE:i.audio=[],Bi(e,t,i),0===i.audio.length&&delete i.audio}return i}(e),i&&(i.audio||i.video)?(function(e,t){if(e.audio&&e.audio.length){var i=t;(void 0===i||isNaN(i))&&(i=e.audio[0].dts),e.audio.forEach((function(e){e.dts=Ri(e.dts,i),e.pts=Ri(e.pts,i),e.dtsTime=e.dts/Mi,e.ptsTime=e.pts/Mi}))}if(e.video&&e.video.length){var n=t;if((void 0===n||isNaN(n))&&(n=e.video[0].dts),e.video.forEach((function(e){e.dts=Ri(e.dts,n),e.pts=Ri(e.pts,n),e.dtsTime=e.dts/Mi,e.ptsTime=e.pts/Mi})),e.firstKeyFrame){var s=e.firstKeyFrame;s.dts=Ri(s.dts,n),s.pts=Ri(s.pts,n),s.dtsTime=s.dts/Mi,s.ptsTime=s.pts/Mi}}}(i,t),i):null};class $i{constructor(e,t){this.options=t||{},this.self=e,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new zt.Transmuxer(this.options),function(e,t){t.on("data",(function(t){const i=t.initSegment;t.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength};const n=t.data;t.data=n.buffer,e.postMessage({action:"data",segment:t,byteOffset:n.byteOffset,byteLength:n.byteLength},[t.data])})),t.on("done",(function(t){e.postMessage({action:"done"})})),t.on("gopInfo",(function(t){e.postMessage({action:"gopInfo",gopInfo:t})})),t.on("videoSegmentTimingInfo",(function(t){const i={start:{decode:le.videoTsToSeconds(t.start.dts),presentation:le.videoTsToSeconds(t.start.pts)},end:{decode:le.videoTsToSeconds(t.end.dts),presentation:le.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:le.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=le.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:i})})),t.on("audioSegmentTimingInfo",(function(t){const i={start:{decode:le.videoTsToSeconds(t.start.dts),presentation:le.videoTsToSeconds(t.start.pts)},end:{decode:le.videoTsToSeconds(t.end.dts),presentation:le.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:le.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=le.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:i})})),t.on("id3Frame",(function(t){e.postMessage({action:"id3Frame",id3Frame:t})})),t.on("caption",(function(t){e.postMessage({action:"caption",caption:t})})),t.on("trackinfo",(function(t){e.postMessage({action:"trackinfo",trackInfo:t})})),t.on("audioTimingInfo",(function(t){e.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:le.videoTsToSeconds(t.start),end:le.videoTsToSeconds(t.end)}})})),t.on("videoTimingInfo",(function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:le.videoTsToSeconds(t.start),end:le.videoTsToSeconds(t.end)}})})),t.on("log",(function(t){e.postMessage({action:"log",log:t})}))}(this.self,this.transmuxer)}pushMp4Captions(e){this.captionParser||(this.captionParser=new hi,this.captionParser.init());const t=new Uint8Array(e.data,e.byteOffset,e.byteLength),i=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:i&&i.captions||[],logs:i&&i.logs||[],data:t.buffer},[t.buffer])}probeMp4StartTime({timescales:e,data:t}){const i=Ei(e,t);this.self.postMessage({action:"probeMp4StartTime",startTime:i,data:t},[t.buffer])}probeMp4Tracks({data:e}){const t=Ci(e);this.self.postMessage({action:"probeMp4Tracks",tracks:t,data:e},[e.buffer])}probeEmsgID3({data:e,offset:t}){const i=xi(e,t);this.self.postMessage({action:"probeEmsgID3",id3Frames:i,emsgData:e},[e.buffer])}probeTs({data:e,baseStartTime:t}){const i="number"!=typeof t||isNaN(t)?void 0:t*le.ONE_SECOND_IN_TS,n=qi(e,i);let s=null;n&&(s={hasVideo:n.video&&2===n.video.length||!1,hasAudio:n.audio&&2===n.audio.length||!1},s.hasVideo&&(s.videoStart=n.video[0].ptsTime),s.hasAudio&&(s.audioStart=n.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:s,data:e},[e.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(e){const t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)}reset(){this.transmuxer.reset()}setTimestampOffset(e){const t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(le.secondsToVideoTs(t)))}setAudioAppendStart(e){this.transmuxer.setAudioAppendStart(Math.ceil(le.secondsToVideoTs(e.appendStart)))}setRemux(e){this.transmuxer.setRemux(e.remux)}flush(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())}}self.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new $i(self,e.data.options):(this.messageHandlers||(this.messageHandlers=new $i(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}})));var $o=Uo(qo);const Ho=e=>{const{transmuxer:t,bytes:i,audioAppendStart:n,gopsToAlignWith:s,remux:r,onData:a,onTrackInfo:o,onAudioTimingInfo:l,onVideoTimingInfo:c,onVideoSegmentTimingInfo:u,onAudioSegmentTimingInfo:h,onId3:d,onCaptions:p,onDone:f,onEndedTimeline:m,onTransmuxerLog:g,isEndOfTimeline:y}=e,v={buffer:[]};let _=y;if(t.onmessage=i=>{t.currentTransmux===e&&("data"===i.data.action&&((e,t,i)=>{const{type:n,initSegment:s,captions:r,captionStreams:a,metadata:o,videoFrameDtsTime:l,videoFramePtsTime:c}=e.data.segment;t.buffer.push({captions:r,captionStreams:a,metadata:o});const u=e.data.segment.boxes||{data:e.data.segment.data},h={type:n,data:new Uint8Array(u.data,u.data.byteOffset,u.data.byteLength),initSegment:new Uint8Array(s.data,s.byteOffset,s.byteLength)};void 0!==l&&(h.videoFrameDtsTime=l),void 0!==c&&(h.videoFramePtsTime=c),i(h)})(i,v,a),"trackinfo"===i.data.action&&o(i.data.trackInfo),"gopInfo"===i.data.action&&((e,t)=>{t.gopInfo=e.data.gopInfo})(i,v),"audioTimingInfo"===i.data.action&&l(i.data.audioTimingInfo),"videoTimingInfo"===i.data.action&&c(i.data.videoTimingInfo),"videoSegmentTimingInfo"===i.data.action&&u(i.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===i.data.action&&h(i.data.audioSegmentTimingInfo),"id3Frame"===i.data.action&&d([i.data.id3Frame],i.data.id3Frame.dispatchType),"caption"===i.data.action&&p(i.data.caption),"endedtimeline"===i.data.action&&(_=!1,m()),"log"===i.data.action&&g(i.data.log),"transmuxed"===i.data.type&&(_||(t.onmessage=null,(({transmuxedData:e,callback:t})=>{e.buffer=[],t(e)})({transmuxedData:v,callback:f}),Vo(t))))},n&&t.postMessage({action:"setAudioAppendStart",appendStart:n}),Array.isArray(s)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:s}),void 0!==r&&t.postMessage({action:"setRemux",remux:r}),i.byteLength){const e=i instanceof ArrayBuffer?i:i.buffer,n=i instanceof ArrayBuffer?0:i.byteOffset;t.postMessage({action:"push",data:e,byteOffset:n,byteLength:i.byteLength},[e])}y&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},Vo=e=>{e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():Ho(e.currentTransmux))},zo=(e,t)=>{e.postMessage({action:t}),Vo(e)};var Wo=e=>{((e,t)=>{if(!t.currentTransmux)return t.currentTransmux=e,void zo(t,e);t.transmuxQueue.push(zo.bind(null,t,e))})("reset",e)};const Go=function(e){const t=e.transmuxer,i=e.endAction||e.action,n=e.callback,s=m({},e,{endAction:null,transmuxer:null,callback:null}),r=s=>{s.data.action===i&&(t.removeEventListener("message",r),s.data.data&&(s.data.data=new Uint8Array(s.data.data,e.byteOffset||0,e.byteLength||s.data.data.byteLength),e.data&&(e.data=s.data.data)),n(s.data))};if(t.addEventListener("message",r),e.data){const i=e.data instanceof ArrayBuffer;s.byteOffset=i?0:e.data.byteOffset,s.byteLength=e.data.byteLength;const n=[i?e.data:e.data.buffer];t.postMessage(s,n)}else t.postMessage(s)},Xo=-101,Yo=-102,Ko=e=>{e.forEach((e=>{e.abort()}))},Qo=(e,t)=>t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:Xo,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:Yo,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:2,xhr:t}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:2,xhr:t}:null,Jo=(e,t,i)=>(n,s)=>{const r=s.response,a=Qo(n,s);if(a)return i(a,e);if(16!==r.byteLength)return i({status:s.status,message:"Invalid HLS key at URL: "+s.uri,code:2,xhr:s},e);const o=new DataView(r),l=new Uint32Array([o.getUint32(0),o.getUint32(4),o.getUint32(8),o.getUint32(12)]);for(let e=0;e<t.length;e++)t[e].bytes=l;return i(null,e)},Zo=(e,t)=>{const i=pt(e.map.bytes);if("mp4"!==i){const n=e.map.resolvedUri||e.map.uri,s=i||"unknown";return t({internal:!0,message:`Found unsupported ${s} container for initialization segment at URL: ${n}`,code:2,metadata:{errorType:va.Error.UnsupportedMediaInitialization,mediaType:s}})}Go({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:({tracks:i,data:n})=>(e.map.bytes=n,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))})),t(null))})},el=({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:h,onTransmuxerLog:d})=>{const p=e.map&&e.map.tracks||{},f=Boolean(p.audio&&p.video);let m=n.bind(null,e,"audio","start");const g=n.bind(null,e,"audio","end");let y=n.bind(null,e,"video","start");const v=n.bind(null,e,"video","end");Go({action:"probeTs",transmuxer:e.transmuxer,data:t,baseStartTime:e.baseStartTime,callback:n=>{e.bytes=t=n.data;const p=n.result;p&&(i(e,{hasAudio:p.hasAudio,hasVideo:p.hasVideo,isMuxed:f}),i=null),(e=>{if(!e.transmuxer.currentTransmux)return e.transmuxer.currentTransmux=e,void Ho(e);e.transmuxer.transmuxQueue.push(e)})({bytes:t,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,remux:f,onData:t=>{t.type="combined"===t.type?"video":t.type,u(e,t)},onTrackInfo:t=>{i&&(f&&(t.isMuxed=!0),i(e,t))},onAudioTimingInfo:e=>{m&&void 0!==e.start&&(m(e.start),m=null),g&&void 0!==e.end&&g(e.end)},onVideoTimingInfo:e=>{y&&void 0!==e.start&&(y(e.start),y=null),v&&void 0!==e.end&&v(e.end)},onVideoSegmentTimingInfo:e=>{s(e)},onAudioSegmentTimingInfo:e=>{r(e)},onId3:(t,i)=>{a(e,t,i)},onCaptions:t=>{o(e,[t])},isEndOfTimeline:l,onEndedTimeline:()=>{c()},onTransmuxerLog:d,onDone:t=>{h&&(t.type="combined"===t.type?"video":t.type,h(null,e,t))}})}})},tl=({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:h,onTransmuxerLog:d})=>{let p=new Uint8Array(t);if(function(e){return Qe(e,["moof"]).length>0}(p)){e.isFmp4=!0;const{tracks:s}=e.map,r={isFmp4:!0,hasVideo:!!s.video,hasAudio:!!s.audio};s.audio&&s.audio.codec&&"enca"!==s.audio.codec&&(r.audioCodec=s.audio.codec),s.video&&s.video.codec&&"encv"!==s.video.codec&&(r.videoCodec=s.video.codec),s.video&&s.audio&&(r.isMuxed=!0),i(e,r);const l=(t,i)=>{u(e,{data:p,type:r.hasAudio&&!r.isMuxed?"audio":"video"}),i&&i.length&&a(e,i),t&&t.length&&o(e,t),h(null,e,{})};Go({action:"probeMp4StartTime",timescales:e.map.timescales,data:p,transmuxer:e.transmuxer,callback:({data:i,startTime:a})=>{t=i.buffer,e.bytes=p=i,r.hasAudio&&!r.isMuxed&&n(e,"audio","start",a),r.hasVideo&&n(e,"video","start",a),Go({action:"probeEmsgID3",data:p,transmuxer:e.transmuxer,offset:a,callback:({emsgData:i,id3Frames:n})=>{t=i.buffer,e.bytes=p=i,s.video&&i.byteLength&&e.transmuxer?Go({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:e.transmuxer,data:p,timescales:e.map.timescales,trackIds:[s.video.id],callback:i=>{t=i.data.buffer,e.bytes=p=i.data,i.logs.forEach((function(e){d(xa(e,{stream:"mp4CaptionParser"}))})),l(i.captions,n)}}):l(void 0,n)}})}})}else if(e.transmuxer){if(void 0===e.container&&(e.container=pt(p)),"ts"!==e.container&&"aac"!==e.container)return i(e,{hasAudio:!1,hasVideo:!1}),void h(null,e,{});el({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:h,onTransmuxerLog:d})}else h(null,e,{})},il=function({id:e,key:t,encryptedBytes:i,decryptionWorker:n},s){const r=t=>{if(t.data.source===e){n.removeEventListener("message",r);const e=t.data.decrypted;s(new Uint8Array(e.bytes,e.byteOffset,e.byteLength))}};let a;n.addEventListener("message",r),a=t.bytes.slice?t.bytes.slice():new Uint32Array(Array.prototype.slice.call(t.bytes)),n.postMessage(wo({source:e,encrypted:i,key:a,iv:t.iv}),[i.buffer,a.buffer])},nl=({xhr:e,xhrOptions:t,decryptionWorker:i,segment:n,abortFn:s,progressFn:r,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:u,captionsFn:h,isEndOfTimeline:d,endedTimelineFn:p,dataFn:f,doneFn:m,onTransmuxerLog:g})=>{const y=[],v=(({activeXhrs:e,decryptionWorker:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:h,onTransmuxerLog:d})=>{let p=0,f=!1;return(m,g)=>{if(!f){if(m)return f=!0,Ko(e),h(m,g);if(p+=1,p===e.length){const p=function(){if(g.encryptedBytes)return(({decryptionWorker:e,segment:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:h,onTransmuxerLog:d})=>{il({id:t.requestId,key:t.key,encryptedBytes:t.encryptedBytes,decryptionWorker:e},(e=>{t.bytes=e,tl({segment:t,bytes:t.bytes,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:h,onTransmuxerLog:d})}))})({decryptionWorker:t,segment:g,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:h,onTransmuxerLog:d});tl({segment:g,bytes:g.bytes,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u,doneFn:h,onTransmuxerLog:d})};if(g.endOfAllRequests=Date.now(),g.map&&g.map.encryptedBytes&&!g.map.bytes)return il({decryptionWorker:t,id:g.requestId+"-init",encryptedBytes:g.map.encryptedBytes,key:g.map.key},(t=>{g.map.bytes=t,Zo(g,(t=>{if(t)return Ko(e),h(t,g);p()}))}));p()}}}})({activeXhrs:y,decryptionWorker:i,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:u,captionsFn:h,isEndOfTimeline:d,endedTimelineFn:p,dataFn:f,doneFn:m,onTransmuxerLog:g});if(n.key&&!n.key.bytes){const i=[n.key];n.map&&!n.map.bytes&&n.map.key&&n.map.key.resolvedUri===n.key.resolvedUri&&i.push(n.map.key);const s=e(xa(t,{uri:n.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),Jo(n,i,v));y.push(s)}if(n.map&&!n.map.bytes){if(n.map.key&&(!n.key||n.key.resolvedUri!==n.map.key.resolvedUri)){const i=e(xa(t,{uri:n.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),Jo(n,[n.map.key],v));y.push(i)}const i=xa(t,{uri:n.map.resolvedUri,responseType:"arraybuffer",headers:_o(n.map),requestType:"segment-media-initialization"}),s=(({segment:e,finishProcessingFn:t})=>(i,n)=>{const s=Qo(i,n);if(s)return t(s,e);const r=new Uint8Array(n.response);if(e.map.key)return e.map.encryptedBytes=r,t(null,e);e.map.bytes=r,Zo(e,(function(i){if(i)return i.xhr=n,i.status=n.status,t(i,e);t(null,e)}))})({segment:n,finishProcessingFn:v}),r=e(i,s);y.push(r)}const _=xa(t,{uri:n.part&&n.part.resolvedUri||n.resolvedUri,responseType:"arraybuffer",headers:_o(n),requestType:"segment"}),b=e(_,(({segment:e,finishProcessingFn:t,responseType:i})=>(n,s)=>{const r=Qo(n,s);if(r)return t(r,e);const a="arraybuffer"!==i&&s.responseText?(e=>{const t=new Uint8Array(new ArrayBuffer(e.length));for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t.buffer})(s.responseText.substring(e.lastReachedChar||0)):s.response;return e.stats=(e=>({bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}))(s),e.key?e.encryptedBytes=new Uint8Array(a):e.bytes=new Uint8Array(a),t(null,e)})({segment:n,finishProcessingFn:v,responseType:_.responseType}));b.addEventListener("progress",(({segment:e,progressFn:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:c,dataFn:u})=>i=>{if(!i.target.aborted)return e.stats=xa(e.stats,(e=>{const t=e.target,i={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-t.requestTime||0};return i.bytesReceived=e.loaded,i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3),i})(i)),!e.stats.firstBytesReceivedAt&&e.stats.bytesReceived&&(e.stats.firstBytesReceivedAt=Date.now()),t(i,e)})({segment:n,progressFn:r,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:u,captionsFn:h,isEndOfTimeline:d,endedTimelineFn:p,dataFn:f})),y.push(b);const T={};return y.forEach((e=>{e.addEventListener("loadend",(({loadendState:e,abortFn:t})=>i=>{i.target.aborted&&t&&!e.calledAbortFn&&(t(),e.calledAbortFn=!0)})({loadendState:T,abortFn:s}))})),()=>Ko(y)},sl=Ca("CodecUtils"),rl=(e,t)=>{const i=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&i.AUDIO&&e.mediaGroups.AUDIO[i.AUDIO]},al=function(e){const t={};return e.forEach((({mediaType:e,type:i,details:n})=>{t[e]=t[e]||[],t[e].push(R(`${i}${n}`))})),Object.keys(t).forEach((function(e){if(t[e].length>1)return sl(`multiple ${e} codecs found as attributes: ${t[e].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),void(t[e]=null);t[e]=t[e][0]})),t},ol=function(e){let t=0;return e.audio&&t++,e.video&&t++,t},ll=function(e,t){const i=t.attributes||{},n=al(function(e){const t=e.attributes||{};if(t.CODECS)return N(t.CODECS)}(t)||[]);if(rl(e,t)&&!n.audio&&!((e,t)=>{if(!rl(e,t))return!0;const i=t.attributes||{},n=e.mediaGroups.AUDIO[i.AUDIO];for(const e in n)if(!n[e].uri&&!n[e].playlists)return!0;return!1})(e,t)){const t=al(function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var i=e.mediaGroups.AUDIO[t];if(!i)return null;for(var n in i){var s=i[n];if(s.default&&s.playlists)return N(s.playlists[0].attributes.CODECS)}return null}(e,i.AUDIO)||[]);t.audio&&(n.audio=t.audio)}return n},cl=Ca("PlaylistSelector"),ul=function(e){if(!e||!e.playlist)return;const t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})},hl=function(e,t){if(!e)return"";const i=s().getComputedStyle(e);return i?i[t]:""},dl=function(e,t){const i=e.slice();e.sort((function(e,n){const s=t(e,n);return 0===s?i.indexOf(e)-i.indexOf(n):s}))},pl=function(e,t){let i,n;return e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||s().Number.MAX_VALUE,t.attributes.BANDWIDTH&&(n=t.attributes.BANDWIDTH),n=n||s().Number.MAX_VALUE,i-n};let fl=function(e,t,i,n,r,a){if(!e)return;const o={bandwidth:t,width:i,height:n,limitRenditionByPlayerDimensions:r};let l=e.playlists;eo.isAudioOnly(e)&&(l=a.getAudioTrackPlaylists_(),o.audioOnly=!0);let c=l.map((e=>{let t;const i=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,n=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return t=e.attributes&&e.attributes.BANDWIDTH,t=t||s().Number.MAX_VALUE,{bandwidth:t,width:i,height:n,playlist:e}}));dl(c,((e,t)=>e.bandwidth-t.bandwidth)),c=c.filter((e=>!eo.isIncompatible(e.playlist)));let u=c.filter((e=>eo.isEnabled(e.playlist)));u.length||(u=c.filter((e=>!eo.isDisabled(e.playlist))));const h=u.filter((e=>e.bandwidth*Mo.BANDWIDTH_VARIANCE<t));let d=h[h.length-1];const p=h.filter((e=>e.bandwidth===d.bandwidth))[0];if(!1===r){const e=p||u[0]||c[0];if(e&&e.playlist){let t="sortedPlaylistReps";return p&&(t="bandwidthBestRep"),u[0]&&(t="enabledPlaylistReps"),cl(`choosing ${ul(e)} using ${t} with options`,o),e.playlist}return cl("could not choose a playlist with options",o),null}const f=h.filter((e=>e.width&&e.height));dl(f,((e,t)=>e.width-t.width));const m=f.filter((e=>e.width===i&&e.height===n));d=m[m.length-1];const g=m.filter((e=>e.bandwidth===d.bandwidth))[0];let y,v,_,b;if(g||(y=f.filter((e=>e.width>i||e.height>n)),v=y.filter((e=>e.width===y[0].width&&e.height===y[0].height)),d=v[v.length-1],_=v.filter((e=>e.bandwidth===d.bandwidth))[0]),a.leastPixelDiffSelector){const e=f.map((e=>(e.pixelDiff=Math.abs(e.width-i)+Math.abs(e.height-n),e)));dl(e,((e,t)=>e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff)),b=e[0]}const T=b||_||g||p||u[0]||c[0];if(T&&T.playlist){let e="sortedPlaylistReps";return b?e="leastPixelDiffRep":_?e="resolutionPlusOneRep":g?e="resolutionBestRep":p?e="bandwidthBestRep":u[0]&&(e="enabledPlaylistReps"),cl(`choosing ${ul(T)} using ${e} with options`,o),T.playlist}return cl("could not choose a playlist with options",o),null};const ml=function(){let e=this.useDevicePixelRatio&&s().devicePixelRatio||1;return isNaN(this.customPixelRatio)||(e=this.customPixelRatio),fl(this.playlists.main,this.systemBandwidth,parseInt(hl(this.tech_.el(),"width"),10)*e,parseInt(hl(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.playlistController_)};function gl(e){try{return new URL(e).pathname.split("/").slice(-2).join("/")}catch(e){return""}}const yl={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"},vl=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),_l=(e,t,i)=>{e.metadataTrack_||(e.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,va.browser.IS_ANY_SAFARI||(e.metadataTrack_.inBandMetadataTrackDispatchType=t))},bl=function(e,t,i){let n,s;if(i&&i.cues)for(n=i.cues.length;n--;)s=i.cues[n],s.startTime>=e&&s.endTime<=t&&i.removeCue(s)},Tl=e=>"number"==typeof e&&isFinite(e),Sl=1/60,wl=e=>{const{startOfSegment:t,duration:i,segment:n,part:s,playlist:{mediaSequence:r,id:a,segments:o=[]},mediaIndex:l,partIndex:c,timeline:u}=e,h=o.length-1;let d="mediaIndex/partIndex increment";e.getMediaInfoForTime?d=`getMediaInfoForTime (${e.getMediaInfoForTime})`:e.isSyncRequest&&(d="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(d+=` with independent ${e.independent}`);const p="number"==typeof c,f=e.segment.uri?"segment":"pre-segment",m=p?Fa({preloadSegment:n})-1:0;return`${f} [${r+l}/${r+h}]`+(p?` part [${c}/${m}]`:"")+` segment start/end [${n.start} => ${n.end}]`+(p?` part start/end [${s.start} => ${s.end}]`:"")+` startOfSegment [${t}]`+` duration [${i}]`+` timeline [${u}]`+` selected by [${d}]`+` playlist [${a}]`},El=e=>`${e}TimingInfo`,Cl=({timelineChangeController:e,currentTimeline:t,segmentTimeline:i,loaderType:n,audioDisabled:s})=>{if(t===i)return!1;if("audio"===n){const t=e.lastTimelineChange({type:"main"});return!t||t.to!==i}if("main"===n&&s){const t=e.pendingTimelineChange({type:"audio"});return!t||t.to!==i}return!1},xl=({segmentDuration:e,maxDuration:t})=>!!e&&Math.round(e)>t+Aa;class kl extends va.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if("function"!=typeof e.currentTime)throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",(()=>{this.isEndOfStream_()||(this.ended_=!1)})),this.fetchAtBuffer_=!1,this.logger_=Ca(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(e){e!==this.state_&&(this.logger_(`${this.state_} -> ${e}`),this.state_=e,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",(()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_()})),"main"===this.loaderType_&&this.timelineChangeController_.on("pendingtimelinechange",(()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_()})),"audio"===this.loaderType_&&this.timelineChangeController_.on("timelinechange",(()=>{this.hasEnoughInfoToLoad_()&&this.processLoadQueue_(),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}))}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return(e=>{const t=new $o;t.currentTransmux=null,t.transmuxQueue=[];const i=t.terminate;return t.terminate=()=>(t.currentTransmux=null,t.transmuxQueue.length=0,i.call(t)),t.postMessage({action:"init",options:e}),t})({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&s().clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,s().clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)}error(e){return void 0!==e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&Wo(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return ka();if("main"===this.loaderType_){const{hasAudio:t,hasVideo:i,isMuxed:n}=e;if(i&&t&&!this.audioDisabled_&&!n)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const i=Eo(e);let n=this.initSegments_[i];return t&&!n&&e.bytes&&(this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),n||e}segmentKey(e,t=!1){if(!e)return null;const i=Co(e);let n=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!n&&e.bytes&&(this.keyCache_[i]=n={resolvedUri:e.resolvedUri,bytes:e.bytes});const s={resolvedUri:(n||e).resolvedUri};return n&&(s.bytes=n.bytes),s}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),this.playlist_)return"INIT"===this.state&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY"))}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e)return;const i=this.playlist_,n=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));let s=null;if(i&&(i.id?s=i.id:i.uri&&(s=i.uri)),this.logger_(`playlist update [${s} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update:\ncurrentTime: ${this.currentTime_()}\nbufferedEnd: ${Na(this.buffered_())}\n`,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri)return null!==this.mediaIndex&&(e.endList||"number"!=typeof e.partTargetDuration?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");const r=e.mediaSequence-i.mediaSequence;if(this.logger_(`live window shift [${r}]`),null!==this.mediaIndex)if(this.mediaIndex-=r,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const e=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!e.parts||!e.parts.length||!e.parts[this.partIndex])){const e=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=e}}n&&(n.mediaIndex-=r,n.mediaIndex<0?(n.mediaIndex=null,n.partIndex=null):(n.mediaIndex>=0&&(n.segment=e.segments[n.mediaIndex]),n.partIndex>=0&&n.segment.parts&&(n.part=n.segment.parts[n.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e)}pause(){this.checkBufferTimeout_&&(s().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return null===this.checkBufferTimeout_}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&Wo(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,"hls"===this.sourceType_&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,i=(()=>{}),n=!1){if(t===1/0&&(t=this.duration_()),t<=e)return void this.logger_("skipping remove because end ${end} is <= start ${start}");if(!this.sourceUpdater_||!this.getMediaInfo_())return void this.logger_("skipping remove because no source updater or starting media info");let s=1;const r=()=>{s--,0===s&&i()};!n&&this.audioDisabled_||(s++,this.sourceUpdater_.removeAudio(e,t,r)),(n||"main"===this.loaderType_)&&(this.gopBuffer_=((e,t,i,n)=>{const s=Math.ceil((t-n)*ft.ONE_SECOND_IN_TS),r=Math.ceil((i-n)*ft.ONE_SECOND_IN_TS),a=e.slice();let o=e.length;for(;o--&&!(e[o].pts<=r););if(-1===o)return a;let l=o+1;for(;l--&&!(e[l].pts<=s););return l=Math.max(l,0),a.splice(l,o-l+1),a})(this.gopBuffer_,e,t,this.timeMapping_),s++,this.sourceUpdater_.removeVideo(e,t,r));for(const i in this.inbandTextTracks_)bl(e,t,this.inbandTextTracks_[i]);bl(e,t,this.segmentMetadataTrack_),r()}monitorBuffer_(){this.checkBufferTimeout_&&s().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=s().setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&s().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=s().setTimeout(this.monitorBufferTick_.bind(this),500)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();e&&("number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,i=this.partIndex){if(!t||!this.mediaSource_)return!1;const n="number"==typeof e&&t.segments[e],s=e+1===t.segments.length,r=!n||!n.parts||i+1===n.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&s&&r}chooseNextRequest_(){const e=this.buffered_(),t=Na(e)||0,i=Ma(e,this.currentTime_()),n=!this.hasPlayed_()&&i>=1,s=i>=this.goalBufferLength_(),r=this.playlist_.segments;if(!r.length||n||s)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const a={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(a.isSyncRequest)a.mediaIndex=function(e,t,i){t=t||[];const n=[];let s=0;for(let r=0;r<t.length;r++){const a=t[r];if(e===a.timeline&&(n.push(r),s+=a.duration,s>i))return r}return 0===n.length?0:n[n.length-1]}(this.currentTimeline_,r,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${a.mediaIndex}`);else if(null!==this.mediaIndex){const e=r[this.mediaIndex],i="number"==typeof this.partIndex?this.partIndex:-1;a.startOfSegment=e.end?e.end:t,e.parts&&e.parts[i+1]?(a.mediaIndex=this.mediaIndex,a.partIndex=i+1):a.mediaIndex=this.mediaIndex+1}else{let e,i,n;const s=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch:\nFor TargetTime: ${s}.\nCurrentTime: ${this.currentTime_()}\nBufferedEnd: ${t}\nFetch At Buffer: ${this.fetchAtBuffer_}\n`,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const t=this.getSyncInfoFromMediaSequenceSync_(s);if(!t)return this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null;this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${t.start} --\x3e ${t.end})`),e=t.segmentIndex,i=t.partIndex,n=t.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const t=eo.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:s,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});e=t.segmentIndex,i=t.partIndex,n=t.startTime}a.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${s}`:`currentTime ${s}`,a.mediaIndex=e,a.startOfSegment=n,a.partIndex=i,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${a.mediaIndex} `)}const o=r[a.mediaIndex];let l=o&&"number"==typeof a.partIndex&&o.parts&&o.parts[a.partIndex];if(!o||"number"==typeof a.partIndex&&!l)return null;"number"!=typeof a.partIndex&&o.parts&&(a.partIndex=0,l=o.parts[0]);const c=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!i&&l&&!c&&!l.independent)if(0===a.partIndex){const e=r[a.mediaIndex-1],t=e.parts&&e.parts.length&&e.parts[e.parts.length-1];t&&t.independent&&(a.mediaIndex-=1,a.partIndex=e.parts.length-1,a.independent="previous segment")}else o.parts[a.partIndex-1].independent&&(a.partIndex-=1,a.independent="previous part");const u=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return a.mediaIndex>=r.length-1&&u&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,a.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(a))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);const i=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!i)return null;if(!i.isAppended)return i;const n=this.mediaSequenceSync_.getSyncInfoForTime(i.end);return n?(n.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),n):null}generateSegmentInfo_(e){const{independent:t,playlist:i,mediaIndex:n,startOfSegment:s,isSyncRequest:r,partIndex:a,forceTimestampOffset:o,getMediaInfoForTime:l}=e,c=i.segments[n],u="number"==typeof a&&c.parts[a],h={requestId:"segment-loader-"+Math.random(),uri:u&&u.resolvedUri||c.resolvedUri,mediaIndex:n,partIndex:u?a:null,isSyncRequest:r,startOfSegment:s,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:c.timeline,duration:u&&u.duration||c.duration,segment:c,part:u,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:l,independent:t},d=void 0!==o?o:this.isPendingTimestampOffset_;h.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:c.timeline,currentTimeline:this.currentTimeline_,startOfSegment:s,buffered:this.buffered_(),overrideCheck:d});const p=Na(this.sourceUpdater_.audioBuffered());return"number"==typeof p&&(h.audioAppendStart=p-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(h.gopsToAlignWith=((e,t,i)=>{if(null==t||!e.length)return[];const n=Math.ceil((t-i+3)*ft.ONE_SECOND_IN_TS);let s;for(s=0;s<e.length&&!(e[s].pts>n);s++);return e.slice(s)})(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),h}timestampOffsetForSegment_(e){return(({segmentTimeline:e,currentTimeline:t,startOfSegment:i,buffered:n,overrideCheck:s})=>s||e!==t?e<t?i:n.length?n.end(n.length-1):i:null)(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)return;if(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),i=e.bandwidth,n=this.pendingSegment_.duration,s=eo.estimateSegmentRequestTime(n,i,this.playlist_,e.bytesReceived),r=function(e,t,i=1){return((e.length?e.end(e.length-1):0)-t)/i}(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(s<=r)return;const a=function(e){const{main:t,currentTime:i,bandwidth:n,duration:s,segmentDuration:r,timeUntilRebuffer:a,currentTimeline:o,syncController:l}=e,c=t.playlists.filter((e=>!eo.isIncompatible(e)));let u=c.filter(eo.isEnabled);u.length||(u=c.filter((e=>!eo.isDisabled(e))));const h=u.filter(eo.hasAttribute.bind(null,"BANDWIDTH")).map((e=>{const t=l.getSyncPoint(e,s,o,i)?1:2;return{playlist:e,rebufferingImpact:eo.estimateSegmentRequestTime(r,n,e)*t-a}})),d=h.filter((e=>e.rebufferingImpact<=0));return dl(d,((e,t)=>pl(t.playlist,e.playlist))),d.length?d[0]:(dl(h,((e,t)=>e.rebufferingImpact-t.rebufferingImpact)),h[0]||null)}({main:this.vhs_.playlists.main,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:n,timeUntilRebuffer:r,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!a)return;const o=s-r-a.rebufferingImpact;let l=.5;r<=Aa&&(l=1),!a.playlist||a.playlist.uri===this.playlist_.uri||o<l||(this.bandwidth=a.playlist.attributes.BANDWIDTH*Mo.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${wl(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId)||this.trigger("progress")}handleTrackInfo_(e,t){this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||this.checkForIllegalMediaSwitch(t)||(t=t||{},function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;const i=Object.keys(e).sort(),n=Object.keys(t).sort();if(i.length!==n.length)return!1;for(let s=0;s<i.length;s++){const r=i[s];if(r!==n[s])return!1;if(e[r]!==t[r])return!1}return!0}(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),this.checkForAbort_(e.requestId)||(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()&&this.processCallQueue_()))}handleTimingInfo_(e,t,i,n){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const s=this.pendingSegment_,r=El(t);s[r]=s[r]||{},s[r][i]=n,this.logger_(`timinginfo: ${t} - ${i} - ${n}`),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(0===t.length)return void this.logger_("SegmentLoader received no captions from a caption event");if(!this.pendingSegment_.hasAppendedData_)return void this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));const i=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),n={};t.forEach((e=>{n[e.stream]=n[e.stream]||{startTime:1/0,captions:[],endTime:0};const t=n[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(n).forEach((e=>{const{startTime:t,endTime:r,captions:a}=n[e],o=this.inbandTextTracks_;this.logger_(`adding cues from ${t} -> ${r} for ${e}`),function(e,t,i){if(!e[i]){t.trigger({type:"usage",name:"vhs-608"});let n=i;/^cc708_/.test(i)&&(n="SERVICE"+i.split("_")[1]);const s=t.textTracks().getTrackById(n);if(s)e[i]=s;else{let s=i,r=i,a=!1;const o=(t.options_.vhs&&t.options_.vhs.captionServices||{})[n];o&&(s=o.label,r=o.language,a=o.default),e[i]=t.addRemoteTextTrack({kind:"captions",id:n,default:a,label:s,language:r},!1).track}}}(o,this.vhs_.tech_,e),bl(t,r,o[e]),function({inbandTextTracks:e,captionArray:t,timestampOffset:i}){if(!t)return;const n=s().WebKitDataCue||s().VTTCue;t.forEach((t=>{const s=t.stream;t.content?t.content.forEach((r=>{const a=new n(t.startTime+i,t.endTime+i,r.text);a.line=r.line,a.align="left",a.position=r.position,a.positionAlign="line-left",e[s].addCue(a)})):e[s].addCue(new n(t.startTime+i,t.endTime+i,t.text))}))}({captionArray:a,inbandTextTracks:o,timestampOffset:i})})),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,i){this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||(this.pendingSegment_.hasAppendedData_?this.addMetadataToTextTrack(i,t,this.duration_()):this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i)))}processMetadataQueue_(){this.metadataQueue_.id3.forEach((e=>e())),this.metadataQueue_.caption.forEach((e=>e())),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach((e=>e()))}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach((e=>e()))}hasEnoughInfoToLoad_(){if("audio"!==this.loaderType_)return!0;const e=this.pendingSegment_;return!(!e||this.getCurrentMediaInfo_()&&Cl({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready())return!1;if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:i,hasVideo:n,isMuxed:s}=t;return!(n&&!e.videoTimingInfo||i&&!this.audioDisabled_&&!s&&!e.audioTimingInfo||Cl({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_())return void this.callQueue_.push(this.handleData_.bind(this,e,t));const i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.part||i.segment),"closed"!==this.mediaSource_.readyState){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),i.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[El(t.type)].start;else{const e=this.getCurrentMediaInfo_(),t="main"===this.loaderType_&&e&&e.hasVideo;let n;t&&(n=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:t,firstVideoFrameTimeForData:n,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:"main"===this.loaderType_});const e=this.chooseNextRequest_();if(e.mediaIndex!==i.mediaIndex||e.partIndex!==i.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,t)}}updateAppendInitSegmentStatus(e,t){"main"!==this.loaderType_||"number"!=typeof e.timestampOffset||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:i,playlist:n}){if(i){const e=Eo(i);if(this.activeInitSegmentId_===e)return null;t=this.initSegmentForMap(i,!0).bytes,this.activeInitSegmentId_=e}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=n,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i},n){const r=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();r.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Ra(r).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Ra(a).join(", "));const o=r.length?r.start(0):0,l=r.length?r.end(r.length-1):0,c=a.length?a.start(0):0,u=a.length?a.end(a.length-1):0;if(l-o<=1&&u-c<=1)return this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${i.byteLength}, audio buffer: ${Ra(r).join(", ")}, video buffer: ${Ra(a).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0,metadata:{errorType:va.Error.SegmentExceedsSourceBufferQuota}}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:i}));const h=this.currentTime_()-1;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${h}`),this.remove(0,h,(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=s().setTimeout((()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()}),1e3)}),!0)}handleAppendError_({segmentInfo:e,type:t,bytes:i},n){n&&(22!==n.code?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",n),this.error({message:`${t} append of ${i.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:va.Error.SegmentAppendError}}),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i}))}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:i,data:n,bytes:s}){if(!s){const e=[n];let t=n.byteLength;i&&(e.unshift(i),t+=i.byteLength),s=(e=>{let t,i=0;return e.bytes&&(t=new Uint8Array(e.bytes),e.segments.forEach((e=>{t.set(e,i),i+=e.byteLength}))),t})({bytes:t,segments:e})}this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:s},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:s}))}handleSegmentTimingInfo_(e,t,i){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const n=this.pendingSegment_.segment,s=`${e}TimingInfo`;n[s]||(n[s]={}),n[s].transmuxerPrependedSeconds=i.prependedContentDuration||0,n[s].transmuxedPresentationStart=i.start.presentation,n[s].transmuxedDecodeStart=i.start.decode,n[s].transmuxedPresentationEnd=i.end.presentation,n[s].transmuxedDecodeEnd=i.end.decode,n[s].baseMediaDecodeTime=i.baseMediaDecodeTime}appendData_(e,t){const{type:i,data:n}=t;if(!n||!n.byteLength)return;if("audio"===i&&this.audioDisabled_)return;const s=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:s,data:n})}loadSegment_(e){this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(e):this.loadQueue_.push((()=>{const t=m({},e,{forceTimestampOffset:!0});m(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)}))}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),i=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),n=null!==this.mediaIndex,s=e.timeline!==this.currentTimeline_&&e.timeline>0,r=i||n&&s;this.logger_(`Requesting\n${gl(e.uri)}\n${wl(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=nl({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:r,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:t,level:i,stream:n})=>{this.logger_(`${wl(e)} logged from transmuxer stream ${n} as a ${i}: ${t}`)}})}trimBackBuffer_(e){const t=((e,t,i)=>{let n=t-Mo.BACK_BUFFER_LENGTH;e.length&&(n=Math.max(n,e.start(0)));const s=t-i;return Math.min(s,n)})(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,i=e.part,n={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},s=e.playlist.segments[e.mediaIndex-1];if(s&&s.timeline===t.timeline&&(s.videoTimingInfo?n.baseStartTime=s.videoTimingInfo.transmuxedDecodeEnd:s.audioTimingInfo&&(n.baseStartTime=s.audioTimingInfo.transmuxedDecodeEnd)),t.key){const i=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);n.key=this.segmentKey(t.key),n.key.iv=i}return t.map&&(n.map=this.initSegmentForMap(t.map)),n}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){this.pendingSegment_.byteLength=t.bytesReceived,e<Sl?this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record 0.016666666666666666`):(this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime)}handleTimeout_(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")}segmentRequestFinished_(e,t,i){if(this.callQueue_.length)return void this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,i));if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return;if(t.requestId!==this.pendingSegment_.requestId)return;if(e){if(this.pendingSegment_=null,this.state="READY",e.code===Yo)return;return this.pause(),e.code===Xo?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error"))}const n=this.pendingSegment_;this.saveBandwidthRelatedStats_(n.duration,t.stats),n.endOfAllRequests=t.endOfAllRequests,i.gopInfo&&(this.gopBuffer_=((e,t,i)=>{if(!t.length)return e;if(i)return t.slice();const n=t[0].pts;let s=0;for(;s<e.length&&!(e[s].pts>=n);s++);return e.slice(0,s).concat(t)})(this.gopBuffer_,i.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(n)}setTimeMapping_(e){const t=this.syncController_.mappingForTimeline(e);null!==t&&(this.timeMapping_=t)}updateMediaSecondsLoaded_(e){"number"==typeof e.start&&"number"==typeof e.end?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration}shouldUpdateTransmuxerTimestampOffset_(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())}trueSegmentStart_({currentStart:e,playlist:t,mediaIndex:i,firstVideoFrameTimeForData:n,currentVideoTimestampOffset:s,useVideoTimingInfo:r,videoTimingInfo:a,audioTimingInfo:o}){if(void 0!==e)return e;if(!r)return o.start;const l=t.segments[i-1];return 0!==i&&l&&void 0!==l.start&&l.end===n+s?a.start:n}waitForAppendsToComplete_(e){const t=this.getCurrentMediaInfo_(e);if(!t)return this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0,metadata:{errorType:va.Error.SegmentUnsupportedMediaFormat}}),void this.trigger("error");const{hasAudio:i,hasVideo:n,isMuxed:s}=t,r="main"===this.loaderType_&&n,a=!this.audioDisabled_&&i&&!s;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);r&&e.waitingOnAppends++,a&&e.waitingOnAppends++,r&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),a&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=((e,t,i)=>"main"===e&&t&&i?i.hasAudio||i.hasVideo?t.hasVideo&&!i.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&&i.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,metadata:{errorType:va.Error.SegmentSwitchError}}),this.trigger("error"),!0)}updateSourceBufferTimestampOffset_(e){if(null===e.timestampOffset||"number"!=typeof e.timingInfo.start||e.changedTimestampOffset||"main"!==this.loaderType_)return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:i}){return this.useDtsForTimestampOffset_?e&&"number"==typeof e.transmuxedDecodeStart?e.transmuxedDecodeStart:t&&"number"==typeof t.transmuxedDecodeStart?t.transmuxedDecodeStart:i.start:i.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),i="main"===this.loaderType_&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;i&&(e.timingInfo.end="number"==typeof i.end?i.end:i.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());const e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});const t=((e,t)=>{if("hls"!==t)return null;const i=(e=>{let t=0;return["video","audio"].forEach((function(i){const n=e[`${i}TimingInfo`];if(!n)return;const{start:r,end:a}=n;let o;"bigint"==typeof r||"bigint"==typeof a?o=s().BigInt(a)-s().BigInt(r):"number"==typeof r&&"number"==typeof a&&(o=a-r),void 0!==o&&o>t&&(t=o)})),"bigint"==typeof t&&t<Number.MAX_SAFE_INTEGER&&(t=Number(t)),t})({audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo});if(!i)return null;const n=e.playlist.targetDuration,r=xl({segmentDuration:i,maxDuration:2*n}),a=xl({segmentDuration:i,maxDuration:n}),o=`Segment with index ${e.mediaIndex} from playlist ${e.playlist.id} has a duration of ${i} when the reported duration is ${e.duration} and the target duration is ${n}. 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 r||a?{severity:r?"warn":"info",message:o}:null})(e,this.sourceType_);if(t&&("warn"===t.severity?va.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_))return void this.logger_(`Throwing away un-appended sync request ${wl(e)}`);this.logger_(`Appended ${wl(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),"main"!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const i=e.segment,n=e.part,r=i.end&&this.currentTime_()-i.end>3*e.playlist.targetDuration,a=n&&n.end&&this.currentTime_()-n.end>3*e.playlist.partTargetDuration;if(r||a)return this.logger_(`bad ${r?"segment":"part"} ${wl(e)}`),void this.resetEverything();null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duration<Sl)return void this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record 0.016666666666666666`);const t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,n=Math.floor(e.byteLength/i*8*1e3);this.throughput.rate+=(n-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;const t=e.segment,i=t.start,n=t.end;if(!Tl(i)||!Tl(n))return;bl(i,n,this.segmentMetadataTrack_);const r=s().WebKitDataCue||s().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.uri,timeline:e.timeline,playlist:e.playlist.id,start:i,end:n},o=new r(i,n,JSON.stringify(a));o.value=a,this.segmentMetadataTrack_.addCue(o)}}function Al(){}const Il=function(e){return"string"!=typeof e?e:e.replace(/./,(e=>e.toUpperCase()))},Pl=["video","audio"],Ol=(e,t)=>{const i=t[`${e}Buffer`];return i&&i.updating||t.queuePending[e]},Ll=(e,t)=>{if(0===t.queue.length)return;let i=0,n=t.queue[i];if("mediaSource"!==n.type){if("mediaSource"!==e&&t.ready()&&"closed"!==t.mediaSource.readyState&&!Ol(e,t)){if(n.type!==e){if(i=((e,t)=>{for(let i=0;i<t.length;i++){const n=t[i];if("mediaSource"===n.type)return null;if(n.type===e)return i}return null})(e,t.queue),null===i)return;n=t.queue[i]}return t.queue.splice(i,1),t.queuePending[e]=n,n.action(e,t),n.doneFn?void 0:(t.queuePending[e]=null,void Ll(e,t))}}else t.updating()||"closed"===t.mediaSource.readyState||(t.queue.shift(),n.action(t),n.doneFn&&n.doneFn(),Ll("audio",t),Ll("video",t))},Dl=(e,t)=>{const i=t[`${e}Buffer`],n=Il(e);i&&(i.removeEventListener("updateend",t[`on${n}UpdateEnd_`]),i.removeEventListener("error",t[`on${n}Error_`]),t.codecs[e]=null,t[`${e}Buffer`]=null)},Rl=(e,t)=>e&&t&&-1!==Array.prototype.indexOf.call(e.sourceBuffers,t),Nl=(e,t,i)=>(n,s)=>{const r=s[`${n}Buffer`];if(Rl(s.mediaSource,r)){s.logger_(`Appending segment ${t.mediaIndex}'s ${e.length} bytes to ${n}Buffer`);try{r.appendBuffer(e)}catch(e){s.logger_(`Error with code ${e.code} `+(22===e.code?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${t.mediaIndex} to ${n}Buffer`),s.queuePending[n]=null,i(e)}}},Ml=(e,t)=>(i,n)=>{const s=n[`${i}Buffer`];if(Rl(n.mediaSource,s)){n.logger_(`Removing ${e} to ${t} from ${i}Buffer`);try{s.remove(e,t)}catch(s){n.logger_(`Remove ${e} to ${t} from ${i}Buffer failed`)}}},jl=e=>(t,i)=>{const n=i[`${t}Buffer`];Rl(i.mediaSource,n)&&(i.logger_(`Setting ${t}timestampOffset to ${e}`),n.timestampOffset=e)},Ul=e=>(t,i)=>{e()},Bl=e=>t=>{if("open"===t.mediaSource.readyState){t.logger_(`Calling mediaSource endOfStream(${e||""})`);try{t.mediaSource.endOfStream(e)}catch(e){va.log.warn("Failed to call media source endOfStream",e)}}},Fl=e=>t=>{t.logger_(`Setting mediaSource duration to ${e}`);try{t.mediaSource.duration=e}catch(e){va.log.warn("Failed to set media source duration",e)}},ql=(e,t)=>i=>{const n=Il(e),s=j(t);i.logger_(`Adding ${e}Buffer with codec ${t} to mediaSource`);const r=i.mediaSource.addSourceBuffer(s);r.addEventListener("updateend",i[`on${n}UpdateEnd_`]),r.addEventListener("error",i[`on${n}Error_`]),i.codecs[e]=t,i[`${e}Buffer`]=r},$l=e=>t=>{const i=t[`${e}Buffer`];if(Dl(e,t),Rl(t.mediaSource,i)){t.logger_(`Removing ${e}Buffer with codec ${t.codecs[e]} from mediaSource`);try{t.mediaSource.removeSourceBuffer(i)}catch(t){va.log.warn(`Failed to removeSourceBuffer ${e}Buffer`,t)}}},Hl=e=>(t,i)=>{const n=i[`${t}Buffer`],s=j(e);if(!Rl(i.mediaSource,n))return;const r=e.substring(0,e.indexOf(".")),a=i.codecs[t];if(a.substring(0,a.indexOf("."))!==r){i.logger_(`changing ${t}Buffer codec from ${i.codecs[t]} to ${e}`);try{n.changeType(s),i.codecs[t]=e}catch(e){va.log.warn(`Failed to changeType on ${t}Buffer`,e)}}},Vl=({type:e,sourceUpdater:t,action:i,doneFn:n,name:s})=>{t.queue.push({type:e,action:i,doneFn:n,name:s}),Ll(e,t)},zl=(e,t)=>i=>{const n=function(e){if(0===e.length)return"Buffered Ranges are empty";let t="Buffered Ranges: \n";for(let i=0;i<e.length;i++){const n=e.start(i),s=e.end(i);t+=`${n} --\x3e ${s}. Duration (${s-n})\n`}return t}(t[`${e}Buffered`]());if(t.logger_(`received "updateend" event for ${e} Source Buffer: `,n),t.queuePending[e]){const i=t.queuePending[e].doneFn;t.queuePending[e]=null,i&&i(t[`${e}Error_`])}Ll(e,t)};class Wl extends va.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>Ll("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=Ca("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=zl("video",this),this.onAudioUpdateEnd_=zl("audio",this),this.onVideoError_=e=>{this.videoError_=e},this.onAudioError_=e=>{this.audioError_=e},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){Vl({type:"mediaSource",sourceUpdater:this,action:ql(e,t),name:"addSourceBuffer"})}abort(e){Vl({type:e,sourceUpdater:this,action:(e,t)=>{if("open"!==t.mediaSource.readyState)return;const i=t[`${e}Buffer`];if(Rl(t.mediaSource,i)){t.logger_(`calling abort on ${e}Buffer`);try{i.abort()}catch(t){va.log.warn(`Failed to abort on ${e}Buffer`,t)}}},name:"abort"})}removeSourceBuffer(e){this.canRemoveSourceBuffer()?Vl({type:"mediaSource",sourceUpdater:this,action:$l(e),name:"removeSourceBuffer"}):va.log.error("removeSourceBuffer is not supported!")}canRemoveSourceBuffer(){return!va.browser.IS_FIREFOX&&s().MediaSource&&s().MediaSource.prototype&&"function"==typeof s().MediaSource.prototype.removeSourceBuffer}static canChangeType(){return s().SourceBuffer&&s().SourceBuffer.prototype&&"function"==typeof s().SourceBuffer.prototype.changeType}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){this.canChangeType()?Vl({type:e,sourceUpdater:this,action:Hl(t),name:"changeType"}):va.log.error("changeType is not supported!")}addOrChangeSourceBuffers(e){if(!e||"object"!=typeof e||0===Object.keys(e).length)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach((t=>{const i=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,i);this.canChangeType()&&this.changeType(t,i)}))}appendBuffer(e,t){const{segmentInfo:i,type:n,bytes:s}=e;if(this.processedAppend_=!0,"audio"===n&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([e,t]),void this.logger_(`delayed audio append of ${s.length} until video append`);if(Vl({type:n,sourceUpdater:this,action:Nl(s,i||{mediaIndex:-1},t),doneFn:t,name:"appendBuffer"}),"video"===n){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const e=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${e.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,e.forEach((e=>{this.appendBuffer.apply(this,e)}))}}audioBuffered(){return Rl(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:ka()}videoBuffered(){return Rl(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:ka()}buffered(){const e=Rl(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=Rl(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():function(e,t){let i=null,n=null,s=0;const r=[],a=[];if(!(e&&e.length&&t&&t.length))return ka();let o=e.length;for(;o--;)r.push({time:e.start(o),type:"start"}),r.push({time:e.end(o),type:"end"});for(o=t.length;o--;)r.push({time:t.start(o),type:"start"}),r.push({time:t.end(o),type:"end"});for(r.sort((function(e,t){return e.time-t.time})),o=0;o<r.length;o++)"start"===r[o].type?(s++,2===s&&(i=r[o].time)):"end"===r[o].type&&(s--,1===s&&(n=r[o].time)),null!==i&&null!==n&&(a.push([i,n]),i=null,n=null);return ka(a)}(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=Al){Vl({type:"mediaSource",sourceUpdater:this,action:Fl(e),name:"duration",doneFn:t})}endOfStream(e=null,t=Al){"string"!=typeof e&&(e=void 0),Vl({type:"mediaSource",sourceUpdater:this,action:Bl(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,i=Al){this.audioBuffered().length&&0!==this.audioBuffered().end(0)?Vl({type:"audio",sourceUpdater:this,action:Ml(e,t),doneFn:i,name:"remove"}):i()}removeVideo(e,t,i=Al){this.videoBuffered().length&&0!==this.videoBuffered().end(0)?Vl({type:"video",sourceUpdater:this,action:Ml(e,t),doneFn:i,name:"remove"}):i()}updating(){return!(!Ol("audio",this)&&!Ol("video",this))}audioTimestampOffset(e){return void 0!==e&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(Vl({type:"audio",sourceUpdater:this,action:jl(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return void 0!==e&&this.videoBuffer&&this.videoTimestampOffset!==e&&(Vl({type:"video",sourceUpdater:this,action:jl(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&Vl({type:"audio",sourceUpdater:this,action:Ul(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&Vl({type:"video",sourceUpdater:this,action:Ul(e),name:"callback"})}dispose(){this.trigger("dispose"),Pl.forEach((e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`]((()=>Dl(e,this)))})),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const Gl=e=>decodeURIComponent(escape(String.fromCharCode.apply(null,e))),Xl=new Uint8Array("\n\n".split("").map((e=>e.charCodeAt(0))));class Yl extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class Kl extends kl{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}createTransmuxer_(){return null}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return ka();const e=this.subtitlesTrack_.cues;return ka([[e[0].startTime,e[e.length-1].startTime]])}initSegmentForMap(e,t=!1){if(!e)return null;const i=Eo(e);let n=this.initSegments_[i];if(t&&!n&&e.bytes){const t=Xl.byteLength+e.bytes.byteLength,s=new Uint8Array(t);s.set(e.bytes),s.set(Xl,e.bytes.byteLength),this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:s}}return n||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return void 0===e||(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_}remove(e,t){bl(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(null===this.syncController_.timestampOffsetForTimeline(e.timeline)){const e=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};return this.syncController_.one("timestampoffset",e),void(this.state="WAITING_ON_TIMELINE")}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,i){if(!this.subtitlesTrack_)return void(this.state="READY");if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===Xo&&this.handleTimeout_(),e.code===Yo?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);const n=this.pendingSegment_;this.saveBandwidthRelatedStats_(n.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const r=n.segment;if(r.map&&(r.map.bytes=t.map.bytes),n.bytes=t.bytes,"function"!=typeof s().WebVTT&&"function"==typeof this.loadVttJs)return this.state="WAITING_ON_VTTJS",void this.loadVttJs().then((()=>this.segmentRequestFinished_(e,t,i)),(()=>this.stopForError({message:"Error loading vtt.js",metadata:{errorType:va.Error.VttLoadError}})));r.requested=!0;try{this.parseVTTCues_(n)}catch(e){return void this.stopForError({message:e.message,metadata:{errorType:va.Error.VttCueParsingError}})}if(this.updateTimeMapping_(n,this.syncController_.timelines[n.timeline],this.playlist_),n.cues.length?n.timingInfo={start:n.cues[0].startTime,end:n.cues[n.cues.length-1].endTime}:n.timingInfo={start:n.startOfSegment,end:n.startOfSegment+n.duration},n.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");n.byteLength=n.bytes.byteLength,this.mediaSecondsLoaded+=r.duration,n.cues.forEach((e=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new(s().VTTCue)(e.startTime,e.endTime,e.text):e)})),function(e){const t=e.cues;if(!t)return;const i={};for(let n=t.length-1;n>=0;n--){const s=t[n],r=`${s.startTime}-${s.endTime}-${s.text}`;i[r]?e.removeCue(s):i[r]=s}}(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(e){let t,i=!1;if("function"!=typeof s().WebVTT)throw new Yl;"function"==typeof s().TextDecoder?t=new(s().TextDecoder)("utf8"):(t=s().WebVTT.StringDecoder(),i=!0);const n=new(s().WebVTT.Parser)(s(),s().vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},n.oncue=e.cues.push.bind(e.cues),n.ontimestampmap=t=>{e.timestampmap=t},n.onparsingerror=e=>{va.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){let t=e.segment.map.bytes;i&&(t=Gl(t)),n.parse(t)}let r=e.bytes;i&&(r=Gl(r)),n.parse(r),n.flush()}updateTimeMapping_(e,t,i){const n=e.segment;if(!t)return;if(!e.cues.length)return void(n.empty=!0);const{MPEGTS:s,LOCAL:r}=e.timestampmap,a=s/ft.ONE_SECOND_IN_TS-r+t.mapping;if(e.cues.forEach((e=>{const i=e.endTime-e.startTime,n=0===s?e.startTime+a:this.handleRollover_(e.startTime+a,t.time);e.startTime=Math.max(n,0),e.endTime=Math.max(n+i,0)})),!i.syncInfo){const t=e.cues[0].startTime,s=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(t,s-n.duration)}}}handleRollover_(e,t){if(null===t)return e;let i=e*ft.ONE_SECOND_IN_TS;const n=t*ft.ONE_SECOND_IN_TS;let s;for(s=n<i?-8589934592:8589934592;Math.abs(i-n)>4294967296;)i+=s;return i/ft.ONE_SECOND_IN_TS}}const Ql=function(e,t){const i=e.cues;for(let e=0;e<i.length;e++){const n=i[e];if(t>=n.adStartTime&&t<=n.adEndTime)return n}return null};class Jl{constructor({start:e,end:t,segmentIndex:i,partIndex:n=null,appended:s=!1}){this.start_=e,this.end_=t,this.segmentIndex_=i,this.partIndex_=n,this.appended_=s}isInRange(e){return e>=this.start&&e<this.end}markAppended(){this.appended_=!0}resetAppendedStatus(){this.appended_=!1}get isAppended(){return this.appended_}get start(){return this.start_}get end(){return this.end_}get segmentIndex(){return this.segmentIndex_}get partIndex(){return this.partIndex_}}class Zl{constructor(e,t=[]){this.segmentSyncInfo_=e,this.partsSyncInfo_=t}get segmentSyncInfo(){return this.segmentSyncInfo_}get partsSyncInfo(){return this.partsSyncInfo_}get hasPartsSyncInfo(){return this.partsSyncInfo_.length>0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach((e=>e.resetAppendedStatus()))}}class ec{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach((e=>e.resetAppendStatus()))}update(e,t){const{mediaSequence:i,segments:n}=e;if(this.isReliable_=this.isReliablePlaylist_(i,n),this.isReliable_)return this.updateStorage_(n,i,this.calculateBaseTime_(i,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:i}of this.storage_.values())if(i.length){for(const t of i)if(t.isInRange(e))return t}else if(t.isInRange(e))return t;return null}updateStorage_(e,t,i){const n=new Map;let s="\n",r=i,a=t;this.start_=r,e.forEach(((e,t)=>{const i=this.storage_.get(a),o=r,l=o+e.duration,c=Boolean(i&&i.segmentSyncInfo&&i.segmentSyncInfo.isAppended),u=new Jl({start:o,end:l,appended:c,segmentIndex:t});e.syncInfo=u;let h=r;const d=(e.parts||[]).map(((e,n)=>{const r=h,o=h+e.duration,l=Boolean(i&&i.partsSyncInfo&&i.partsSyncInfo[n]&&i.partsSyncInfo[n].isAppended),c=new Jl({start:r,end:o,appended:l,segmentIndex:t,partIndex:n});return h=o,s+=`Media Sequence: ${a}.${n} | Range: ${r} --\x3e ${o} | Appended: ${l}\n`,e.syncInfo=c,c}));n.set(a,new Zl(u,d)),s+=`${gl(e.resolvedUri)} | Media Sequence: ${a} | Range: ${o} --\x3e ${l} | Appended: ${c}\n`,a++,r=l})),this.end_=r,this.storage_=n,this.diagnostics_=s}calculateBaseTime_(e,t){return this.storage_.size?this.storage_.has(e)?this.storage_.get(e).segmentSyncInfo.start:t:0}isReliablePlaylist_(e,t){return null!=e&&Array.isArray(t)&&t.length}}const tc=[{name:"VOD",run:(e,t,i,n,s)=>i!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(e,t,i,n,s,r)=>{const a=e.getMediaSequenceSync(r);if(!a)return null;if(!a.isReliable)return null;const o=a.getSyncInfoForTime(s);return o?{time:o.start,partIndex:o.partIndex,segmentIndex:o.segmentIndex}:null}},{name:"ProgramDateTime",run:(e,t,i,n,s)=>{if(!Object.keys(e.timelineToDatetimeMappings).length)return null;let r=null,a=null;const o=Ua(t);s=s||0;for(let i=0;i<o.length;i++){const n=o[t.endList||0===s?i:o.length-(i+1)],l=n.segment,c=e.timelineToDatetimeMappings[l.timeline];if(!c||!l.dateTimeObject)continue;let u=l.dateTimeObject.getTime()/1e3+c;if(l.parts&&"number"==typeof n.partIndex)for(let e=0;e<n.partIndex;e++)u+=l.parts[e].duration;const h=Math.abs(s-u);if(null!==a&&(0===h||a<h))break;a=h,r={time:u,segmentIndex:n.segmentIndex,partIndex:n.partIndex}}return r}},{name:"Segment",run:(e,t,i,n,s)=>{let r=null,a=null;s=s||0;const o=Ua(t);for(let e=0;e<o.length;e++){const i=o[t.endList||0===s?e:o.length-(e+1)],l=i.segment,c=i.part&&i.part.start||l&&l.start;if(l.timeline===n&&void 0!==c){const e=Math.abs(s-c);if(null!==a&&a<e)break;(!r||null===a||a>=e)&&(a=e,r={time:c,segmentIndex:i.segmentIndex,partIndex:i.partIndex})}}return r}},{name:"Discontinuity",run:(e,t,i,n,s)=>{let r=null;if(s=s||0,t.discontinuityStarts&&t.discontinuityStarts.length){let i=null;for(let n=0;n<t.discontinuityStarts.length;n++){const a=t.discontinuityStarts[n],o=t.discontinuitySequence+n+1,l=e.discontinuities[o];if(l){const e=Math.abs(s-l.time);if(null!==i&&i<e)break;(!r||null===i||i>=e)&&(i=e,r={time:l.time,segmentIndex:a,partIndex:null})}}}return r}},{name:"Playlist",run:(e,t,i,n,s)=>t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}];class ic extends va.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={},this.mediaSequenceStorage_={main:new ec,audio:new ec,vtt:new ec},this.logger_=Ca("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,i,n,s){if(t!==1/0)return tc.find((({name:e})=>"VOD"===e)).run(this,e,t);const r=this.runStrategies_(e,t,i,n,s);if(!r.length)return null;for(const t of r){const{syncPoint:i,strategy:s}=t,{segmentIndex:r,time:a}=i;if(r<0)continue;const o=a,l=o+e.segments[r].duration;if(this.logger_(`Strategy: ${s}. Current time: ${n}. selected segment: ${r}. Time: [${o} -> ${l}]}`),n>=o&&n<l)return this.logger_("Found sync point with exact match: ",i),i}return this.selectSyncPoint_(r,{key:"time",value:n})}getExpiredTime(e,t){if(!e||!e.segments)return null;const i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length)return null;const n=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});return n.segmentIndex>0&&(n.time*=-1),Math.abs(n.time+Va({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:n.segmentIndex,endIndex:0}))}runStrategies_(e,t,i,n,s){const r=[];for(let a=0;a<tc.length;a++){const o=tc[a],l=o.run(this,e,t,i,n,s);l&&(l.strategy=o.name,r.push({strategy:o.name,syncPoint:l}))}return r}selectSyncPoint_(e,t){let i=e[0].syncPoint,n=Math.abs(e[0].syncPoint[t.key]-t.value),s=e[0].strategy;for(let r=1;r<e.length;r++){const a=Math.abs(e[r].syncPoint[t.key]-t.value);a<n&&(n=a,i=e[r].syncPoint,s=e[r].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${s}]: [time:${i.time}, segmentIndex:${i.segmentIndex}`+("number"==typeof i.partIndex?`,partIndex:${i.partIndex}`:"")+"]"),i}saveExpiredSegmentInfo(e,t){const i=t.mediaSequence-e.mediaSequence;if(i>86400)va.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);else for(let n=i-1;n>=0;n--){const i=e.segments[n];if(i&&void 0!==i.start){t.syncInfo={mediaSequence:e.mediaSequence+n,time:i.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const i=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),n=e.segment;i&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:n.start}));const s=n.dateTimeObject;n.discontinuity&&t&&s&&(this.timelineToDatetimeMappings[n.timeline]=-s.getTime()/1e3)}timestampOffsetForTimeline(e){return void 0===this.timelines[e]?null:this.timelines[e].time}mappingForTimeline(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,i){const n=e.segment,s=e.part;let r,a,o=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)o={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=o,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${o.time}] [mapping: ${o.mapping}]`)),r=e.startOfSegment,a=t.end+o.mapping;else{if(!o)return!1;r=t.start+o.mapping,a=t.end+o.mapping}return s&&(s.start=r,s.end=a),(!n.start||r<n.start)&&(n.start=r),n.end=a,!0}saveDiscontinuitySyncInfo_(e){const t=e.playlist,i=e.segment;if(i.discontinuity)this.discontinuities[i.timeline]={time:i.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(let n=0;n<t.discontinuityStarts.length;n++){const s=t.discontinuityStarts[n],r=t.discontinuitySequence+n+1,a=s-e.mediaIndex,o=Math.abs(a);if(!this.discontinuities[r]||this.discontinuities[r].accuracy>o){let n;n=a<0?i.start-Va({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:s}):i.end+Va({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:s}),this.discontinuities[r]={time:n,accuracy:o}}}}dispose(){this.trigger("dispose"),this.off()}}class nc extends va.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:i}){return"number"==typeof t&&"number"==typeof i&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:i},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:i}){return"number"==typeof t&&"number"==typeof i&&(this.lastTimelineChanges_[e]={type:e,from:t,to:i},delete this.pendingTimelineChanges_[e],this.trigger("timelinechange")),this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const sc=Bo(Fo((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 i=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(i,1),i>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n<i;++n)t[n].call(this,arguments[1]);else for(var s=Array.prototype.slice.call(arguments,1),r=t.length,a=0;a<r;++a)t[a].apply(this,s)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",(function(t){e.push(t)}))},e}();let t=null;class n{constructor(e){let i,n,s;t||(t=function(){const e=[[[],[],[],[],[]],[[],[],[],[],[]]],t=e[0],i=e[1],n=t[4],s=i[4];let r,a,o;const l=[],c=[];let u,h,d,p,f,m;for(r=0;r<256;r++)c[(l[r]=r<<1^283*(r>>7))^r]=r;for(a=o=0;!n[a];a^=u||1,o=c[o]||1)for(p=o^o<<1^o<<2^o<<3^o<<4,p=p>>8^255&p^99,n[a]=p,s[p]=a,d=l[h=l[u=l[a]]],m=16843009*d^65537*h^257*u^16843008*a,f=257*l[p]^16843008*p,r=0;r<4;r++)t[r][a]=f=f<<24^f>>>8,i[r][p]=m=m<<24^m>>>8;for(r=0;r<5;r++)t[r]=t[r].slice(0),i[r]=i[r].slice(0);return e}()),this._tables=[[t[0][0].slice(),t[0][1].slice(),t[0][2].slice(),t[0][3].slice(),t[0][4].slice()],[t[1][0].slice(),t[1][1].slice(),t[1][2].slice(),t[1][3].slice(),t[1][4].slice()]];const r=this._tables[0][4],a=this._tables[1],o=e.length;let l=1;if(4!==o&&6!==o&&8!==o)throw new Error("Invalid aes key size");const c=e.slice(0),u=[];for(this._key=[c,u],i=o;i<4*o+28;i++)s=c[i-1],(i%o==0||8===o&&i%o==4)&&(s=r[s>>>24]<<24^r[s>>16&255]<<16^r[s>>8&255]<<8^r[255&s],i%o==0&&(s=s<<8^s>>>24^l<<24,l=l<<1^283*(l>>7))),c[i]=c[i-o]^s;for(n=0;i;n++,i--)s=c[3&n?i:i-4],u[n]=i<=4||n<4?s:a[0][r[s>>>24]]^a[1][r[s>>16&255]]^a[2][r[s>>8&255]]^a[3][r[255&s]]}decrypt(e,t,i,n,s,r){const a=this._key[1];let o,l,c,u=e^a[0],h=n^a[1],d=i^a[2],p=t^a[3];const f=a.length/4-2;let m,g=4;const y=this._tables[1],v=y[0],_=y[1],b=y[2],T=y[3],S=y[4];for(m=0;m<f;m++)o=v[u>>>24]^_[h>>16&255]^b[d>>8&255]^T[255&p]^a[g],l=v[h>>>24]^_[d>>16&255]^b[p>>8&255]^T[255&u]^a[g+1],c=v[d>>>24]^_[p>>16&255]^b[u>>8&255]^T[255&h]^a[g+2],p=v[p>>>24]^_[u>>16&255]^b[h>>8&255]^T[255&d]^a[g+3],g+=4,u=o,h=l,d=c;for(m=0;m<4;m++)s[(3&-m)+r]=S[u>>>24]<<24^S[h>>16&255]<<16^S[d>>8&255]<<8^S[255&p]^a[g++],o=u,u=h,h=d,d=p,p=o}}class s extends e{constructor(){super(e),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const r=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24};class a{constructor(e,t,i,n){const o=a.STEP,l=new Int32Array(e.buffer),c=new Uint8Array(e.byteLength);let u=0;for(this.asyncStream_=new s,this.asyncStream_.push(this.decryptChunk_(l.subarray(u,u+o),t,i,c)),u=o;u<l.length;u+=o)i=new Uint32Array([r(l[u-4]),r(l[u-3]),r(l[u-2]),r(l[u-1])]),this.asyncStream_.push(this.decryptChunk_(l.subarray(u,u+o),t,i,c));this.asyncStream_.push((function(){var e;n(null,(e=c).subarray(0,e.byteLength-e[e.byteLength-1]))}))}static get STEP(){return 32e3}decryptChunk_(e,t,i,s){return function(){const a=function(e,t,i){const s=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),a=new n(Array.prototype.slice.call(t)),o=new Uint8Array(e.byteLength),l=new Int32Array(o.buffer);let c,u,h,d,p,f,m,g,y;for(c=i[0],u=i[1],h=i[2],d=i[3],y=0;y<s.length;y+=4)p=r(s[y]),f=r(s[y+1]),m=r(s[y+2]),g=r(s[y+3]),a.decrypt(p,f,m,g,l,y),l[y]=r(l[y]^c),l[y+1]=r(l[y+1]^u),l[y+2]=r(l[y+2]^h),l[y+3]=r(l[y+3]^d),c=p,u=f,h=m,d=g;return o}(e,t,i);s.set(a,e.byteOffset)}}}var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},l=("undefined"!=typeof window?window:void 0!==o?o:"undefined"!=typeof self?self:{}).BigInt||Number;l("0x1"),l("0x100"),l("0x10000"),l("0x1000000"),l("0x100000000"),l("0x10000000000"),l("0x1000000000000"),l("0x100000000000000"),l("0x10000000000000000"),function(){var e=new Uint16Array([65484]),t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);255===t[0]||t[0]}();self.onmessage=function(e){const t=e.data,i=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),n=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),s=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new a(i,n,s,(function(e,i){self.postMessage(function(e){const t={};return Object.keys(e).forEach((i=>{const n=e[i];var s;s=n,("function"===ArrayBuffer.isView?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer)?t[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:t[i]=n})),t}({source:t.source,decrypted:i}),[i.buffer])}))}})));var rc=Uo(sc);const ac=e=>{let t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},oc=(e,t)=>{e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},lc=(e,t)=>{t.activePlaylistLoader=e,e.load()},cc={AUDIO:(e,t)=>()=>{const{mediaTypes:{[e]:i},excludePlaylist:n}=t,s=i.activeTrack(),r=i.activeGroup(),a=(r.filter((e=>e.default))[0]||r[0]).id,o=i.tracks[a];if(s!==o){va.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const e in i.tracks)i.tracks[e].enabled=i.tracks[e]===o;i.onTrackChanged()}else n({error:{message:"Problem encountered loading the default audio track."}})},SUBTITLES:(e,t)=>()=>{const{mediaTypes:{[e]:i}}=t;va.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const n=i.activeTrack();n&&(n.mode="disabled"),i.onTrackChanged()}},uc={AUDIO:(e,t,i)=>{if(!t)return;const{tech:n,requestOptions:s,segmentLoaders:{[e]:r}}=i;t.on("loadedmetadata",(()=>{const e=t.media();r.playlist(e,s),(!n.paused()||e.endList&&"none"!==n.preload())&&r.load()})),t.on("loadedplaylist",(()=>{r.playlist(t.media(),s),n.paused()||r.load()})),t.on("error",cc[e](e,i))},SUBTITLES:(e,t,i)=>{const{tech:n,requestOptions:s,segmentLoaders:{[e]:r},mediaTypes:{[e]:a}}=i;t.on("loadedmetadata",(()=>{const e=t.media();r.playlist(e,s),r.track(a.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&r.load()})),t.on("loadedplaylist",(()=>{r.playlist(t.media(),s),n.paused()||r.load()})),t.on("error",cc[e](e,i))}},hc={AUDIO:(e,t)=>{const{vhs:i,sourceType:n,segmentLoaders:{[e]:s},requestOptions:r,main:{mediaGroups:a},mediaTypes:{[e]:{groups:o,tracks:l,logger_:c}},mainPlaylistLoader:u}=t,h=Za(u.main);a[e]&&0!==Object.keys(a[e]).length||(a[e]={main:{default:{default:!0}}},h&&(a[e].main.default.playlists=u.main.playlists));for(const s in a[e]){o[s]||(o[s]=[]);for(const d in a[e][s]){let p,f=a[e][s][d];if(h?(c(`AUDIO group '${s}' label '${d}' is a main playlist`),f.isMainPlaylist=!0,p=null):p="vhs-json"===n&&f.playlists?new go(f.playlists[0],i,r):f.resolvedUri?new go(f.resolvedUri,i,r):f.playlists&&"dash"===n?new No(f.playlists[0],i,r,u):null,f=xa({id:d,playlistLoader:p},f),uc[e](e,f.playlistLoader,t),o[s].push(f),void 0===l[d]){const e=new va.AudioTrack({id:d,kind:ac(f),enabled:!1,language:f.language,default:f.default,label:d});l[d]=e}}}s.on("error",cc[e](e,t))},SUBTITLES:(e,t)=>{const{tech:i,vhs:n,sourceType:s,segmentLoaders:{[e]:r},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[e]:{groups:l,tracks:c}},mainPlaylistLoader:u}=t;for(const r in o[e]){l[r]||(l[r]=[]);for(const h in o[e][r]){if(!n.options_.useForcedSubtitles&&o[e][r][h].forced)continue;let d,p=o[e][r][h];if("hls"===s)d=new go(p.resolvedUri,n,a);else if("dash"===s){if(!p.playlists.filter((e=>e.excludeUntil!==1/0)).length)return;d=new No(p.playlists[0],n,a,u)}else"vhs-json"===s&&(d=new go(p.playlists?p.playlists[0]:p.resolvedUri,n,a));if(p=xa({id:h,playlistLoader:d},p),uc[e](e,p.playlistLoader,t),l[r].push(p),void 0===c[h]){const e=i.addRemoteTextTrack({id:h,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:h},!1).track;c[h]=e}}}r.on("error",cc[e](e,t))},"CLOSED-CAPTIONS":(e,t)=>{const{tech:i,main:{mediaGroups:n},mediaTypes:{[e]:{groups:s,tracks:r}}}=t;for(const t in n[e]){s[t]||(s[t]=[]);for(const a in n[e][t]){const o=n[e][t][a];if(!/^(?:CC|SERVICE)/.test(o.instreamId))continue;const l=i.options_.vhs&&i.options_.vhs.captionServices||{};let c={label:a,language:o.language,instreamId:o.instreamId,default:o.default&&o.autoselect};if(l[c.instreamId]&&(c=xa(c,l[c.instreamId])),void 0===c.default&&delete c.default,s[t].push(xa({id:a},o)),void 0===r[a]){const e=i.addRemoteTextTrack({id:c.instreamId,kind:"captions",default:c.default,language:c.language,label:c.label},!1).track;r[a]=e}}}}},dc=(e,t)=>{for(let i=0;i<e.length;i++){if(Qa(t,e[i]))return!0;if(e[i].playlists&&dc(e[i].playlists,t))return!0}return!1},pc={AUDIO:(e,t)=>()=>{const{mediaTypes:{[e]:{tracks:i}}}=t;for(const e in i)if(i[e].enabled)return i[e];return null},SUBTITLES:(e,t)=>()=>{const{mediaTypes:{[e]:{tracks:i}}}=t;for(const e in i)if("showing"===i[e].mode||"hidden"===i[e].mode)return i[e];return null}};class fc{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){1===e&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=wa(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map((e=>[e.ID,e]))))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class mc extends va.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new fc,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=Ca("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const i=t.serverUri||t.serverURL;if(!i)return this.logger_(`steering manifest URL is ${i}, cannot request steering manifest.`),void this.trigger("error");i.startsWith("data:")?this.decodeDataUriManifest_(i.substring(i.indexOf(",")+1)):(this.steeringManifest.reloadUri=wa(e,i),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering"))}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t)return;const i=e?t:this.getRequestURI(t);if(!i)return this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),void this.dispose();this.request_=this.xhr_({uri:i,requestType:"content-steering-manifest"},((e,t)=>{if(e){if(410===t.status)return this.logger_(`manifest request 410 ${e}.`),this.logger_(`There will be no more content steering requests to ${i} this session.`),void this.excludedSteeringManifestURLs.add(i);if(429===t.status){const i=t.responseHeaders["retry-after"];return this.logger_(`manifest request 429 ${e}.`),this.logger_(`content steering will retry in ${i} seconds.`),void this.startTTLTimeout_(parseInt(i,10))}return this.logger_(`manifest failed to load ${e}.`),void this.startTTLTimeout_()}const n=JSON.parse(this.request_.responseText);this.assignSteeringProperties_(n),this.startTTLTimeout_()}))}setProxyServerUrl_(e){const t=new(s().URL)(e),i=new(s().URL)(this.proxyServerUrl_);return i.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(i.toString())}decodeDataUriManifest_(e){const t=JSON.parse(s().atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new(s().URL)(e),i=this.getPathway(),n=this.getBandwidth_();if(i){const e=`_${this.manifestType_}_pathway`;t.searchParams.set(e,i)}if(n){const e=`_${this.manifestType_}_throughput`;t.searchParams.set(e,n)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version)return this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),void this.trigger("error");this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const t=(e=>{for(const t of e)if(this.availablePathways_.has(t))return t;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==t&&(this.currentPathway=t,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=e=>this.excludedSteeringManifestURLs.has(e);if(this.proxyServerUrl_){const i=this.setProxyServerUrl_(e);if(!t(i))return i}const i=this.setSteeringParams_(e);return t(i)?null:i}startTTLTimeout_(e=this.steeringManifest.ttl){const t=1e3*e;this.ttlTimeout_=s().setTimeout((()=>{this.requestSteeringManifest()}),t)}clearTTLTimeout_(){s().clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new fc}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(wa(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}let gc;const yc=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],vc=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]};class _c extends va.EventTarget{constructor(e){super();const{src:t,withCredentials:i,tech:n,bandwidth:r,externVhs:a,useCueTags:o,playlistExclusionDuration:l,enableLowInitialPlaylist:c,sourceType:u,cacheEncryptionKeys:h,bufferBasedABR:d,leastPixelDiffSelector:p,captionServices:f}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:m}=e;null==m&&(m=1/0),gc=a,this.bufferBasedABR=Boolean(d),this.leastPixelDiffSelector=Boolean(p),this.withCredentials=i,this.tech_=n,this.vhs_=n.vhs,this.sourceType_=u,this.useCueTags_=o,this.playlistExclusionDuration=l,this.maxPlaylistRetries=m,this.enableLowInitialPlaylist=c,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:i,maxPlaylistRetries:m,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=(()=>{const e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((t=>{e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Al,activeTrack:Al,getActiveGroup:Al,onGroupChanged:Al,onTrackChanged:Al,lastTrack_:null,logger_:Ca(`MediaGroups[${t}]`)}})),e})(),this.mediaSource=new(s().MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.seekable_=ka(),this.hasPlayed_=!1,this.syncController_=new ic(e),this.segmentMetadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new rc,this.sourceUpdater_=new Wl(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new nc,this.keyStatusMap_=new Map;const g={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:f,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:r,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:h,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_="dash"===this.sourceType_?new No(t,this.vhs_,xa(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new go(t,this.vhs_,xa(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new kl(xa(g,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new kl(xa(g,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new Kl(xa(g,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise(((e,t)=>{function i(){n.off("vttjserror",s),e()}function s(){n.off("vttjsloaded",i),t()}n.one("vttjsloaded",i),n.one("vttjserror",s),n.addWebVttScript_()}))}),e),this.contentSteeringController_=new mc(this.vhs_.xhr,(()=>this.mainSegmentLoader_.bandwidth)),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",(()=>this.startABRTimer_())),this.tech_.on("pause",(()=>this.stopABRTimer_())),this.tech_.on("play",(()=>this.startABRTimer_()))),yc.forEach((e=>{this[e+"_"]=vc.bind(this,e)})),this.logger_=Ca("pc"),this.triggeredFmp4Usage=!1,"none"===this.tech_.preload()?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const y="none"===this.tech_.preload()?"play":"loadstart";this.tech_.one(y,(()=>{const e=Date.now();this.tech_.one("loadeddata",(()=>{this.timeToLoadedData__=Date.now()-e,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends}))}))}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return-1===e||-1===t?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,i){const n=this.media(),s=n&&(n.id||n.uri),r=e&&(e.id||e.uri);s&&s!==r&&(this.logger_(`switch media ${s} -> ${r} from ${t}`),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})),this.mainPlaylistLoader_.media(e,i)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((e=>{const t=this.mediaTypes_[e],i=t?t.activeGroup():null,n=this.contentSteeringController_.getPathway();if(i&&n){const t=(i.length?i[0].playlists:i.playlists).filter((e=>e.attributes.serviceLocation===n));t.length&&this.mediaTypes_[e].activePlaylistLoader.media(t[0])}}))}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=s().setInterval((()=>this.checkABR_()),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(s().clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const i=e.mediaGroups.AUDIO,n=Object.keys(i);let s;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)s=this.mediaTypes_.AUDIO.activeTrack();else{const e=i.main||n.length&&i[n[0]];for(const t in e)if(e[t].default){s={label:t};break}}if(!s)return t;const r=[];for(const t in i)if(i[t][s.label]){const n=i[t][s.label];if(n.playlists&&n.playlists.length)r.push.apply(r,n.playlists);else if(n.uri)r.push(n);else if(e.playlists.length)for(let i=0;i<e.playlists.length;i++){const n=e.playlists[i];n.attributes&&n.attributes.AUDIO&&n.attributes.AUDIO===t&&r.push(n)}}return r.length?r:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",(()=>{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;Ka(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,e.endList&&"none"!==this.tech_.preload()&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),(e=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((t=>{hc[t](t,e)}));const{mediaTypes:t,mainPlaylistLoader:i,tech:n,vhs:s,segmentLoaders:{AUDIO:r,main:a}}=e;["AUDIO","SUBTITLES"].forEach((i=>{t[i].activeGroup=((e,t)=>i=>{const{mainPlaylistLoader:n,mediaTypes:{[e]:{groups:s}}}=t,r=n.media();if(!r)return null;let a=null;r.attributes[e]&&(a=s[r.attributes[e]]);const o=Object.keys(s);if(!a)if("AUDIO"===e&&o.length>1&&Za(t.main))for(let e=0;e<o.length;e++){const t=s[o[e]];if(dc(t,r)){a=t;break}}else s.main?a=s.main:1===o.length&&(a=s[o[0]]);return void 0===i?a:null!==i&&a&&a.filter((e=>e.id===i.id))[0]||null})(i,e),t[i].activeTrack=pc[i](i,e),t[i].onGroupChanged=((e,t)=>()=>{const{segmentLoaders:{[e]:i,main:n},mediaTypes:{[e]:s}}=t,r=s.activeTrack(),a=s.getActiveGroup(),o=s.activePlaylistLoader,l=s.lastGroup_;a&&l&&a.id===l.id||(s.lastGroup_=a,s.lastTrack_=r,oc(i,s),a&&!a.isMainPlaylist&&(a.playlistLoader?(i.resyncLoader(),lc(a.playlistLoader,s)):o&&n.resetEverything()))})(i,e),t[i].onGroupChanging=((e,t)=>()=>{const{segmentLoaders:{[e]:i},mediaTypes:{[e]:n}}=t;n.lastGroup_=null,i.abort(),i.pause()})(i,e),t[i].onTrackChanged=((e,t)=>()=>{const{mainPlaylistLoader:i,segmentLoaders:{[e]:n,main:s},mediaTypes:{[e]:r}}=t,a=r.activeTrack(),o=r.getActiveGroup(),l=r.activePlaylistLoader,c=r.lastTrack_;if((!c||!a||c.id!==a.id)&&(r.lastGroup_=o,r.lastTrack_=a,oc(n,r),o)){if(o.isMainPlaylist){if(!a||!c||a.id===c.id)return;const e=t.vhs.playlistController_,n=e.selectPlaylist();if(e.media()===n)return;return r.logger_(`track change. Switching main audio from ${c.id} to ${a.id}`),i.pause(),s.resetEverything(),void e.fastQualityChange_(n)}if("AUDIO"===e){if(!o.playlistLoader)return s.setAudio(!0),void s.resetEverything();n.setAudio(!0),s.setAudio(!1)}l!==o.playlistLoader?(n.track&&n.track(a),n.resetEverything(),lc(o.playlistLoader,r)):lc(o.playlistLoader,r)}})(i,e),t[i].getActiveGroup=((e,{mediaTypes:t})=>()=>{const i=t[e].activeTrack();return i?t[e].activeGroup(i):null})(i,e)}));const o=t.AUDIO.activeGroup();if(o){const e=(o.filter((e=>e.default))[0]||o[0]).id;t.AUDIO.tracks[e].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged(),t.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),r.setAudio(!0)):a.setAudio(!0)}i.on("mediachange",(()=>{["AUDIO","SUBTITLES"].forEach((e=>t[e].onGroupChanged()))})),i.on("mediachanging",(()=>{["AUDIO","SUBTITLES"].forEach((e=>t[e].onGroupChanging()))}));const l=()=>{t.AUDIO.onTrackChanged(),n.trigger({type:"usage",name:"vhs-audio-change"})};n.audioTracks().addEventListener("change",l),n.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),s.on("dispose",(()=>{n.audioTracks().removeEventListener("change",l),n.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)})),n.clearTracks("audio");for(const e in t.AUDIO.tracks)n.audioTracks().addTrack(t.AUDIO.tracks[e])})({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),e),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",(()=>{this.trigger("selectedinitialmedia")}))})),this.mainPlaylistLoader_.on("loadedplaylist",(()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let e=this.mainPlaylistLoader_.media();if(!e){let t;if(this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_(),this.enableLowInitialPlaylist&&(t=this.selectInitialPlaylist()),t||(t=this.selectPlaylist()),!t||!this.shouldSwitchToMedia_(t))return;if(this.initialMedia_=t,this.switchMedia_(this.initialMedia_,"initial"),"vhs-json"!==this.sourceType_||!this.initialMedia_.segments)return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)})),this.mainPlaylistLoader_.on("error",(()=>{const e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})})),this.mainPlaylistLoader_.on("mediachanging",(()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()})),this.mainPlaylistLoader_.on("mediachange",(()=>{const e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;Ka(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,"dash"===this.sourceType_&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})})),this.mainPlaylistLoader_.on("playlistunchanged",(()=>{const e=this.mainPlaylistLoader_.media();"playlist-unchanged"!==e.lastExcludeReason_&&this.stuckAtPlaylistEnd_(e)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))})),this.mainPlaylistLoader_.on("renditiondisabled",(()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})})),this.mainPlaylistLoader_.on("renditionenabled",(()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}))}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const i=e.mediaGroups||{};let n=!0;const s=Object.keys(i.AUDIO);for(const e in i.AUDIO)for(const t in i.AUDIO[e])i.AUDIO[e][t].uri||(n=!1);n&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),gc.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),s.length&&Object.keys(i.AUDIO[s[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,i=this.tech_.currentTime(),n=this.bufferLowWaterLine(),s=this.bufferHighWaterLine();return function({currentPlaylist:e,buffered:t,currentTime:i,nextPlaylist:n,bufferLowWaterLine:s,bufferHighWaterLine:r,duration:a,bufferBasedABR:o,log:l}){if(!n)return va.log.warn("We received no playlist to switch to. Please check your stream."),!1;const c=`allowing switch ${e&&e.id||"null"} -> ${n.id}`;if(!e)return l(`${c} as current playlist is not set`),!0;if(n.id===e.id)return!1;const u=Boolean(Oa(t,i).length);if(!e.endList)return u||"number"!=typeof e.partTargetDuration?(l(`${c} as current playlist is live`),!0):(l(`not ${c} as current playlist is live llhls, but currentTime isn't in buffered.`),!1);const h=Ma(t,i),d=o?Mo.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Mo.MAX_BUFFER_LOW_WATER_LINE;if(a<d)return l(`${c} as duration < max low water line (${a} < ${d})`),!0;const p=n.attributes.BANDWIDTH,f=e.attributes.BANDWIDTH;if(p<f&&(!o||h<r)){let e=`${c} as next bandwidth < current bandwidth (${p} < ${f})`;return o&&(e+=` and forwardBuffer < bufferHighWaterLine (${h} < ${r})`),l(e),!0}if((!o||p>f)&&h>=s){let e=`${c} as forwardBuffer >= bufferLowWaterLine (${h} >= ${s})`;return o&&(e+=` and next bandwidth > current bandwidth (${p} > ${f})`),l(e),!0}return l(`not ${c} as no switching criteria met`),!1}({buffered:this.tech_.buffered(),currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:n,bufferHighWaterLine:s,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",(()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")})),this.mainSegmentLoader_.on("timeout",(()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()})),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",(()=>{this.trigger("progress")})),this.mainSegmentLoader_.on("error",(()=>{const e=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:e.playlist,error:e})})),this.mainSegmentLoader_.on("appenderror",(()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")})),this.mainSegmentLoader_.on("syncinfoupdate",(()=>{this.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("timestampoffset",(()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})})),this.audioSegmentLoader_.on("syncinfoupdate",(()=>{this.onSyncInfoUpdate_()})),this.audioSegmentLoader_.on("appenderror",(()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")})),this.mainSegmentLoader_.on("ended",(()=>{this.logger_("main segment loader ended"),this.onEndOfStream()})),this.mainSegmentLoader_.on("earlyabort",(e=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:10}))}));const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const e=this.getCodecsOrExclude_();e&&this.sourceUpdater_.addOrChangeSourceBuffers(e)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",(()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("fmp4",(()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("ended",(()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}))}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}fastQualityChange_(e=this.selectPlaylist()){e&&e===this.mainPlaylistLoader_.media()?this.logger_("skipping fastQualityChange because new media is same as old"):(this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0)}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything((()=>{this.tech_.setCurrentTime(this.tech_.currentTime())}))}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0)?this.tech_.setCurrentTime(e.end(e.length-1)):void 0}setupFirstPlay(){const e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList||e.start){const t=this.seekable();if(!t.length)return!1;const i=t.end(0);let n=i;if(e.start){const s=e.start.timeOffset;n=s<0?Math.max(i+s,t.start(0)):Math.min(i,s)}this.trigger("firstplay"),this.tech_.setCurrentTime(n)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){const e=this.tech_.play();void 0!==e&&"function"==typeof e.then&&e.then(null,(e=>{}))}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();e=!t||t.hasVideo?e&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const t=this.syncController_.getExpiredTime(e,this.duration());if(null===t)return!1;const i=gc.Playlist.playlistEnd(e,t),n=this.tech_.currentTime(),s=this.tech_.buffered();if(!s.length)return i-n<=Ia;const r=s.end(s.length-1);return r-n<=Ia&&i-r<=Ia}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:i}){if(e=e||this.mainPlaylistLoader_.media(),i=i||t.playlistExclusionDuration||this.playlistExclusionDuration,!e)return this.error=t,void("open"!==this.mediaSource.readyState?this.trigger("error"):this.sourceUpdater_.endOfStream("network"));e.playlistErrors_++;const n=this.mainPlaylistLoader_.main.playlists,s=n.filter(Xa),r=1===s.length&&s[0]===e;if(1===n.length&&i!==1/0)return va.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(r);if(r){if(this.main().contentSteering){const t=this.pathwayAttribute_(e),i=1e3*this.contentSteeringController_.steeringManifest.ttl;return this.contentSteeringController_.excludePathway(t),this.excludeThenChangePathway_(),void setTimeout((()=>{this.contentSteeringController_.addAvailablePathway(t)}),i)}let t=!1;n.forEach((i=>{if(i===e)return;const n=i.excludeUntil;void 0!==n&&n!==1/0&&(t=!0,delete i.excludeUntil)})),t&&(va.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let a;a=e.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*i,e.excludeUntil=a,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const o=this.selectPlaylist();if(!o)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");const l=t.internal?this.logger_:va.log.warn,c=t.message?" "+t.message:"";l(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${c} Switching to playlist ${o.id}.`),o.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),o.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const u=o.targetDuration/2*1e3||5e3,h="number"==typeof o.lastRequest&&Date.now()-o.lastRequest<=u;return this.switchMedia_(o,"exclude",r||h)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const i=[],n="all"===e;(n||"main"===e)&&i.push(this.mainPlaylistLoader_);const s=[];(n||"audio"===e)&&s.push("AUDIO"),(n||"subtitle"===e)&&(s.push("CLOSED-CAPTIONS"),s.push("SUBTITLES")),s.forEach((e=>{const t=this.mediaTypes_[e]&&this.mediaTypes_[e].activePlaylistLoader;t&&i.push(t)})),["main","audio","subtitle"].forEach((t=>{const n=this[`${t}SegmentLoader_`];!n||e!==t&&"all"!==e||i.push(n)})),i.forEach((e=>t.forEach((t=>{"function"==typeof e[t]&&e[t]()}))))}setCurrentTime(e){const t=Oa(this.tech_.buffered(),e);return this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media()&&this.mainPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),void this.load()):0}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:gc.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}onSyncInfoUpdate_(){let e;if(!this.mainPlaylistLoader_)return;let t=this.mainPlaylistLoader_.media();if(!t)return;let i=this.syncController_.getExpiredTime(t,this.duration());if(null===i)return;const n=this.mainPlaylistLoader_.main,s=gc.Playlist.seekable(t,i,gc.Playlist.liveEdgeDelay(n,t));if(0===s.length)return;if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),i=this.syncController_.getExpiredTime(t,this.duration()),null===i)return;if(e=gc.Playlist.seekable(t,i,gc.Playlist.liveEdgeDelay(n,t)),0===e.length)return}let r,a;this.seekable_&&this.seekable_.length&&(r=this.seekable_.end(0),a=this.seekable_.start(0)),e?e.start(0)>s.end(0)||s.start(0)>e.end(0)?this.seekable_=s:this.seekable_=ka([[e.start(0)>s.start(0)?e.start(0):s.start(0),e.end(0)<s.end(0)?e.end(0):s.end(0)]]):this.seekable_=s,this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===r&&this.seekable_.start(0)===a||(this.logger_(`seekable updated [${Da(this.seekable_)}]`),this.tech_.trigger("seekablechanged"))}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),"open"!==this.mediaSource.readyState)return this.updateDuration_=this.updateDuration.bind(this,e),void this.mediaSource.addEventListener("sourceopen",this.updateDuration_);if(e){const e=this.seekable();if(!e.length)return;return void((isNaN(this.mediaSource.duration)||this.mediaSource.duration<e.end(e.length-1))&&this.sourceUpdater_.setDuration(e.end(e.length-1)))}const t=this.tech_.buffered();let i=gc.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(i=Math.max(i,t.end(t.length-1))),this.mediaSource.duration!==i&&this.sourceUpdater_.setDuration(i)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach((e=>{const t=this.mediaTypes_[e].groups;for(const e in t)t[e].forEach((e=>{e.playlistLoader&&e.playlistLoader.dispose()}))})),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!i)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const i=ll(this.main(),t),n={},s=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(n.video=i.video||e.main.videoCodec||"avc1.4d400d"),e.main.isMuxed&&(n.video+=`,${i.audio||e.main.audioCodec||F}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||s)&&(n.audio=i.audio||e.main.audioCodec||e.audio.audioCodec||F,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!n.audio&&!n.video)return void this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});const r={};let a;if(["video","audio"].forEach((function(t){if(n.hasOwnProperty(t)&&(i=e[t].isFmp4,s=n[t],!(i?U(s):B(s)))){const i=e[t].isFmp4?"browser":"muxer";r[i]=r[i]||[],r[i].push(n[t]),"audio"===t&&(a=i)}var i,s})),s&&a&&t.attributes.AUDIO){const e=t.attributes.AUDIO;this.main().playlists.forEach((i=>{(i.attributes&&i.attributes.AUDIO)===e&&i!==t&&(i.excludeUntil=1/0)})),this.logger_(`excluding audio group ${e} as ${a} does not support codec(s): "${n.audio}"`)}if(!Object.keys(r).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const e=[];if(["video","audio"].forEach((t=>{const i=(N(this.sourceUpdater_.codecs[t]||"")[0]||{}).type,s=(N(n[t]||"")[0]||{}).type;i&&s&&i.toLowerCase()!==s.toLowerCase()&&e.push(`"${this.sourceUpdater_.codecs[t]}" -> "${n[t]}"`)})),e.length)return void this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${e.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0})}return n}{const e=Object.keys(r).reduce(((e,t)=>(e&&(e+=", "),e+`${t} does not support codec(s): "${r[t].join(",")}"`)),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:e},playlistExclusionDuration:1/0})}}tryToCreateSourceBuffers_(){if("open"!==this.mediaSource.readyState||this.sourceUpdater_.hasCreatedSourceBuffers())return;if(!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach((i=>{const n=e[i];if(-1!==t.indexOf(n.id))return;t.push(n.id);const s=ll(this.main,n),r=[];!s.audio||B(s.audio)||U(s.audio)||r.push(`audio codec ${s.audio}`),!s.video||B(s.video)||U(s.video)||r.push(`video codec ${s.video}`),s.text&&"stpp.ttml.im1t"===s.text&&r.push(`text codec ${s.text}`),r.length&&(n.excludeUntil=1/0,this.logger_(`excluding ${n.id} for unsupported: ${r.join(", ")}`))}))}excludeIncompatibleVariants_(e){const t=[],i=this.main().playlists,n=al(N(e)),s=ol(n),r=n.video&&N(n.video)[0]||null,a=n.audio&&N(n.audio)[0]||null;Object.keys(i).forEach((e=>{const n=i[e];if(-1!==t.indexOf(n.id)||n.excludeUntil===1/0)return;t.push(n.id);const o=[],l=ll(this.mainPlaylistLoader_.main,n),c=ol(l);if(l.audio||l.video){if(c!==s&&o.push(`codec count "${c}" !== "${s}"`),!this.sourceUpdater_.canChangeType()){const e=l.video&&N(l.video)[0]||null,t=l.audio&&N(l.audio)[0]||null;e&&r&&e.type.toLowerCase()!==r.type.toLowerCase()&&o.push(`video codec "${e.type}" !== "${r.type}"`),t&&a&&t.type.toLowerCase()!==a.type.toLowerCase()&&o.push(`audio codec "${t.type}" !== "${a.type}"`)}o.length&&(n.excludeUntil=1/0,this.logger_(`excluding ${n.id}: ${o.join(" && ")}`))}}))}updateAdCues_(e){let t=0;const i=this.seekable();i.length&&(t=i.start(0)),function(e,t,i=0){if(!e.segments)return;let n,r=i;for(let i=0;i<e.segments.length;i++){const a=e.segments[i];if(n||(n=Ql(t,r+a.duration/2)),n){if("cueIn"in a){n.endTime=r,n.adEndTime=r,r+=a.duration,n=null;continue}if(r<n.endTime){r+=a.duration;continue}n.endTime+=a.duration}else if("cueOut"in a&&(n=new(s().VTTCue)(r,r+a.duration,a.cueOut),n.adStartTime=r,n.adEndTime=r+parseFloat(a.cueOut),t.addCue(n)),"cueOutCont"in a){const[e,i]=a.cueOutCont.split("/").map(parseFloat);n=new(s().VTTCue)(r,r+a.duration,""),n.adStartTime=r-e,n.adEndTime=n.adStartTime+i,t.addCue(n)}r+=a.duration}}(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=Mo.GOAL_BUFFER_LENGTH,i=Mo.GOAL_BUFFER_LENGTH_RATE,n=Math.max(t,Mo.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,n)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=Mo.BUFFER_LOW_WATER_LINE,i=Mo.BUFFER_LOW_WATER_LINE_RATE,n=Math.max(t,Mo.MAX_BUFFER_LOW_WATER_LINE),s=Math.max(t,Mo.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?s:n)}bufferHighWaterLine(){return Mo.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){_l(this.inbandTextTracks_,"com.apple.streaming",this.tech_),(({inbandTextTracks:e,dateRanges:t})=>{const i=e.metadataTrack_;if(!i)return;const n=s().WebKitDataCue||s().VTTCue;t.forEach((e=>{for(const t of Object.keys(e)){if(vl.has(t))continue;const s=new n(e.startTime,e.endTime,"");s.id=e.id,s.type="com.apple.quicktime.HLS",s.value={key:yl[t],data:e[t]},"scte35Out"!==t&&"scte35In"!==t||(s.value.data=new Uint8Array(s.value.data.match(/[\da-f]{2}/gi)).buffer),i.addCue(s)}e.processDateRange()}))})({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,i){const n=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();_l(this.inbandTextTracks_,e,this.tech_),(({inbandTextTracks:e,metadataArray:t,timestampOffset:i,videoDuration:n})=>{if(!t)return;const r=s().WebKitDataCue||s().VTTCue,a=e.metadataTrack_;if(!a)return;if(t.forEach((e=>{const t=e.cueTime+i;!("number"!=typeof t||s().isNaN(t)||t<0)&&t<1/0&&e.frames&&e.frames.length&&e.frames.forEach((e=>{const i=new r(t,t,e.value||e.url||e.data||"");i.frame=e,i.value=e,function(e){Object.defineProperties(e.frame,{id:{get:()=>(va.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key)},value:{get:()=>(va.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data)},privateData:{get:()=>(va.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data)}})}(i),a.addCue(i)}))})),!a.cues||!a.cues.length)return;const o=a.cues,l=[];for(let e=0;e<o.length;e++)o[e]&&l.push(o[e]);const c=l.reduce(((e,t)=>{const i=e[t.startTime]||[];return i.push(t),e[t.startTime]=i,e}),{}),u=Object.keys(c).sort(((e,t)=>Number(e)-Number(t)));u.forEach(((e,t)=>{const i=c[e],s=isFinite(n)?n:e,r=Number(u[t+1])||s;i.forEach((e=>{e.endTime=r}))}))})({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:n,videoDuration:i})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart?this.contentSteeringController_.requestSteeringManifest(!0):this.tech_.one("canplay",(()=>{this.contentSteeringController_.requestSteeringManifest()}))}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),"dash"===this.sourceType_&&this.mainPlaylistLoader_.on("loadedplaylist",(()=>{const e=this.main();(this.contentSteeringController_.didDASHTagChange(e.uri,e.contentSteering)||(()=>{const t=this.contentSteeringController_.getAvailablePathways(),i=[];for(const n of e.playlists){const e=n.attributes.serviceLocation;if(e&&(i.push(e),!t.has(e)))return!0}return!(i.length||!t.size)})())&&this.resetContentSteeringController_()}))}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const t=this.main().playlists,i=new Set;let n=!1;Object.keys(t).forEach((s=>{const r=t[s],a=this.pathwayAttribute_(r),o=a&&e!==a;r.excludeUntil===1/0&&"content-steering"===r.lastExcludeReason_&&!o&&(delete r.excludeUntil,delete r.lastExcludeReason_,n=!0);const l=!r.excludeUntil&&r.excludeUntil!==1/0;!i.has(r.id)&&o&&l&&(i.add(r.id),r.excludeUntil=1/0,r.lastExcludeReason_="content-steering",this.logger_(`excluding ${r.id} for ${r.lastExcludeReason_}`))})),"DASH"===this.contentSteeringController_.manifestType_&&Object.keys(this.mediaTypes_).forEach((t=>{const i=this.mediaTypes_[t];if(i.activePlaylistLoader){const t=i.activePlaylistLoader.media_;t&&t.attributes.serviceLocation!==e&&(n=!0)}})),n&&this.changeSegmentPathway_()}handlePathwayClones_(){const e=this.main().playlists,t=this.contentSteeringController_.currentPathwayClones,i=this.contentSteeringController_.nextPathwayClones;if(t&&t.size||i&&i.size){for(const[e,n]of t.entries())i.get(e)||(this.mainPlaylistLoader_.updateOrDeleteClone(n),this.contentSteeringController_.excludePathway(e));for(const[n,s]of i.entries()){const i=t.get(n);i?this.equalPathwayClones_(i,s)||(this.mainPlaylistLoader_.updateOrDeleteClone(s,!0),this.contentSteeringController_.addAvailablePathway(n)):(e.filter((e=>e.attributes["PATHWAY-ID"]===s["BASE-ID"])).forEach((e=>{this.mainPlaylistLoader_.addClonePathway(s,e)})),this.contentSteeringController_.addAvailablePathway(n))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...i])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;const i=e["URI-REPLACEMENT"].PARAMS,n=t["URI-REPLACEMENT"].PARAMS;for(const e in i)if(i[e]!==n[e])return!1;for(const e in n)if(i[e]!==n[e])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),"DASH"===this.contentSteeringController_.manifestType_&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach((i=>{const n=this.mainPlaylistLoader_.getKeyIdSet(i);n&&n.size&&n.forEach((n=>{const s="usable",r=this.keyStatusMap_.has(n)&&this.keyStatusMap_.get(n)===s,a=i.lastExcludeReason_===t&&i.excludeUntil===1/0;r?r&&a&&(delete i.excludeUntil,delete i.lastExcludeReason_,this.logger_(`enabling playlist ${i.id} because key ID ${n} is ${s}`)):(i.excludeUntil!==1/0&&i.lastExcludeReason_!==t&&(i.excludeUntil=1/0,i.lastExcludeReason_=t,this.logger_(`excluding playlist ${i.id} because the key ID ${n} doesn't exist in the keyStatusMap or is not ${s}`)),e++)}))})),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach((e=>{const i=e&&e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height<720,n=e.excludeUntil===1/0&&e.lastExcludeReason_===t;i&&n&&(delete e.excludeUntil,va.log.warn(`enabling non-HD playlist ${e.id} because all playlists were excluded due to ${t} key IDs`))}))}addKeyStatus_(e,t){const i=("string"==typeof e?e:(e=>{const t=new Uint8Array(e);return Array.from(t).map((e=>e.toString(16).padStart(2,"0"))).join("")})(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${i} added to the keyStatusMap`),this.keyStatusMap_.set(i,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}class bc{constructor(e,t,i){const{playlistController_:n}=e,s=n.fastQualityChange_.bind(n);if(t.attributes){const e=t.attributes.RESOLUTION;this.width=e&&e.width,this.height=e&&e.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}var r,a,o;this.codecs=ll(n.main(),t),this.playlist=t,this.id=i,this.enabled=(r=e.playlists,a=t.id,o=s,e=>{const t=r.main.playlists[a],i=Ga(t),n=Xa(t);return void 0===e?n:(e?delete t.disabled:t.disabled=!0,e===n||i||(o(),e?r.trigger("renditionenabled"):r.trigger("renditiondisabled")),e)})}}const Tc=["seeking","seeked","pause","playing","error"];class Sc{constructor(e){this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=Ca("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),i=()=>this.monitorCurrentTime_(),n=()=>this.techWaiting_(),r=()=>this.resetTimeUpdate_(),a=this.playlistController_,o=["main","subtitle","audio"],l={};o.forEach((e=>{l[e]={reset:()=>this.resetSegmentDownloads_(e),updateend:()=>this.checkSegmentDownloads_(e)},a[`${e}SegmentLoader_`].on("appendsdone",l[e].updateend),a[`${e}SegmentLoader_`].on("playlistupdate",l[e].reset),this.tech_.on(["seeked","seeking"],l[e].reset)}));const c=e=>{["main","audio"].forEach((t=>{a[`${t}SegmentLoader_`][e]("appended",this.seekingAppendCheck_)}))};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),c("off"))},this.clearSeekingAppendCheck_=()=>c("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),c("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",n),this.tech_.on(Tc,r),this.tech_.on("canplay",i),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",n),this.tech_.off(Tc,r),this.tech_.off("canplay",i),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),o.forEach((e=>{a[`${e}SegmentLoader_`].off("appendsdone",l[e].updateend),a[`${e}SegmentLoader_`].off("playlistupdate",l[e].reset),this.tech_.off(["seeked","seeking"],l[e].reset)})),this.checkCurrentTimeTimeout_&&s().clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&s().clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=s().setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,i=t[`${e}SegmentLoader_`],n=i.buffered_(),s=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e)return!0;if(e.length!==t.length)return!0;for(let i=0;i<e.length;i++)if(e.start(i)!==t.start(i)||e.end(i)!==t.end(i))return!0;return!1}(this[`${e}Buffered_`],n);this[`${e}Buffered_`]=n,s?this.resetSegmentDownloads_(e):(this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:Ra(n)}),this[`${e}StalledDownloads_`]<10||(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),"subtitle"!==e&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0})))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Ia>=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const e=this.seekable(),t=this.tech_.currentTime();let i;if(this.afterSeekableWindow_(e,t,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(i=e.end(e.length-1)),this.beforeSeekableWindow_(e,t)){const t=e.start(0);i=t+(t===e.end(0)?0:Ia)}if(void 0!==i)return this.logger_(`Trying to seek outside of seekable at time ${t} with seekable range ${Da(e)}. Seeking to ${i}.`),this.tech_.setCurrentTime(i),!0;const n=this.playlistController_.sourceUpdater_,s=this.tech_.buffered(),r=n.audioBuffer?n.audioBuffered():null,a=n.videoBuffer?n.videoBuffered():null,o=this.media(),l=o.partTargetDuration?o.partTargetDuration:2*(o.targetDuration-Aa),c=[r,a];for(let e=0;e<c.length;e++)if(c[e]&&Ma(c[e],t)<l)return!1;const u=La(s,t);return 0!==u.length&&(i=u.start(0)+Ia,this.logger_(`Buffered region starts (${u.start(0)}) just beyond seek point (${t}). Seeking to ${i}.`),this.tech_.setCurrentTime(i),!0)}waiting_(){if(this.techWaiting_())return;const e=this.tech_.currentTime(),t=this.tech_.buffered(),i=Oa(t,e);return i.length&&e+3<=i.end(0)?(this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${i.start(0)} -> ${i.end(0)}]. Attempting to resume playback by seeking to the current time.`),void this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"})):void 0}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const i=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${i}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const i=this.tech_.vhs.playlistController_.sourceUpdater_,n=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;const s=La(n,t);return s.length>0&&(this.logger_(`Stopped at ${t} and seeking to ${s.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0)}afterSeekableWindow_(e,t,i,n=!1){if(!e.length)return!1;let s=e.end(e.length-1)+Ia;const r=!i.endList,a="number"==typeof i.partTargetDuration;return r&&(a||n)&&(s=e.end(e.length-1)+3*i.targetDuration),t>s}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:i}){if(!e)return;let n;if(e.length&&t.length){const s=Oa(e,i-3),r=Oa(e,i),a=Oa(t,i);a.length&&!r.length&&s.length&&(n={start:s.end(0),end:a.end(0)})}else La(e,i).length||(n=this.gapFromVideoUnderflow_(e,i));return!!n&&(this.logger_(`Encountered a gap in video from ${n.start} to ${n.end}. Seeking to current time ${i}`),!0)}skipTheGap_(e){const t=this.tech_.buffered(),i=this.tech_.currentTime(),n=La(t,i);this.resetTimeUpdate_(),0!==n.length&&i===e&&(this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",n.start(0)),this.tech_.setCurrentTime(n.start(0)+Aa),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}))}gapFromVideoUnderflow_(e,t){const i=function(e){if(e.length<2)return ka();const t=[];for(let i=1;i<e.length;i++){const n=e.end(i-1),s=e.start(i);t.push([n,s])}return ka(t)}(e);for(let e=0;e<i.length;e++){const n=i.start(e),s=i.end(e);if(t-n<4&&t-n>2)return{start:n,end:s}}return null}}const wc={errorInterval:30,getSource(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},Ec=function(e,t){let i=0,n=0;const s=xa(wc,t);e.ready((()=>{e.trigger({type:"usage",name:"vhs-error-reload-initialized"})}));const r=function(){n&&e.currentTime(n)},a=function(t){null!=t&&(n=e.duration()!==1/0&&e.currentTime()||0,e.one("loadedmetadata",r),e.src(t),e.trigger({type:"usage",name:"vhs-error-reload"}),e.play())},o=function(){if(Date.now()-i<1e3*s.errorInterval)e.trigger({type:"usage",name:"vhs-error-reload-canceled"});else{if(s.getSource&&"function"==typeof s.getSource)return i=Date.now(),s.getSource.call(e,a);va.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}},l=function(){e.off("loadedmetadata",r),e.off("error",o),e.off("dispose",l)};e.on("error",o),e.on("dispose",l),e.reloadSourceOnError=function(t){l(),Ec(e,t)}};var Cc="3.12.0";const xc={PlaylistLoader:go,Playlist:eo,utils:ko,STANDARD_PLAYLIST_SELECTOR:ml,INITIAL_PLAYLIST_SELECTOR:function(){const e=this.playlists.main.playlists.filter(eo.isEnabled);return dl(e,((e,t)=>pl(e,t))),e.filter((e=>!!ll(this.playlists.main,e).video))[0]||null},lastBandwidthSelector:ml,movingAverageBandwidthSelector:function(e){let t=-1,i=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let n=this.useDevicePixelRatio&&s().devicePixelRatio||1;return isNaN(this.customPixelRatio)||(n=this.customPixelRatio),t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),fl(this.playlists.main,t,parseInt(hl(this.tech_.el(),"width"),10)*n,parseInt(hl(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.playlistController_)}},comparePlaylistBandwidth:pl,comparePlaylistResolution:function(e,t){let i,n;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||s().Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),n=n||s().Number.MAX_VALUE,i===n&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-n},xhr:vo()};Object.keys(Mo).forEach((e=>{Object.defineProperty(xc,e,{get:()=>(va.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),Mo[e]),set(t){va.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),"number"!=typeof t||t<0?va.log.warn(`value of Vhs.${e} must be greater than or equal to 0`):Mo[e]=t}})}));const kc="videojs-vhs",Ac=function(e,t){const i=t.media();let n=-1;for(let t=0;t<e.length;t++)if(e[t].id===i.id){n=t;break}e.selectedIndex_=n,e.trigger({selectedIndex:n,type:"change"})};xc.canPlaySource=function(){return va.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const Ic=()=>{if(!s().localStorage)return null;const e=s().localStorage.getItem(kc);if(!e)return null;try{return JSON.parse(e)}catch(e){return null}},Pc=(e,t)=>{e._requestCallbackSet||(e._requestCallbackSet=new Set),e._requestCallbackSet.add(t)},Oc=(e,t)=>{e._responseCallbackSet||(e._responseCallbackSet=new Set),e._responseCallbackSet.add(t)},Lc=(e,t)=>{e._requestCallbackSet&&(e._requestCallbackSet.delete(t),e._requestCallbackSet.size||delete e._requestCallbackSet)},Dc=(e,t)=>{e._responseCallbackSet&&(e._responseCallbackSet.delete(t),e._responseCallbackSet.size||delete e._responseCallbackSet)};xc.supportsNativeHls=function(){if(!a()||!a().createElement)return!1;const e=a().createElement("video");return!!va.getTech("Html5").isSupported()&&["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some((function(t){return/maybe|probably/i.test(e.canPlayType(t))}))}(),xc.supportsNativeDash=!!(a()&&a().createElement&&va.getTech("Html5").isSupported())&&/maybe|probably/i.test(a().createElement("video").canPlayType("application/dash+xml")),xc.supportsTypeNatively=e=>"hls"===e?xc.supportsNativeHls:"dash"===e&&xc.supportsNativeDash,xc.isSupported=function(){return va.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},xc.xhr.onRequest=function(e){Pc(xc.xhr,e)},xc.xhr.onResponse=function(e){Oc(xc.xhr,e)},xc.xhr.offRequest=function(e){Lc(xc.xhr,e)},xc.xhr.offResponse=function(e){Dc(xc.xhr,e)};const Rc=va.getComponent("Component");class Nc extends Rc{constructor(e,t,i){if(super(t,i.vhs),"number"==typeof i.initialBandwidth&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=Ca("VhsHandler"),t.options_&&t.options_.playerId){const e=va.getPlayer(t.options_.playerId);this.player_=e}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(a(),["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],(e=>{const t=a().fullscreenElement||a().webkitFullscreenElement||a().mozFullScreenElement||a().msFullscreenElement;t&&t.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()})),this.on(this.tech_,"seeking",(function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())})),this.on(this.tech_,"error",(function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()})),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=xa(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage=void 0!==this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=!1!==this.options_.llhls,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,"number"!=typeof this.options_.playlistExclusionDuration&&(this.options_.playlistExclusionDuration=60),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){const e=Ic();e&&e.bandwidth&&(this.options_.bandwidth=e.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),e&&e.throughput&&(this.options_.throughput=e.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}"number"!=typeof this.options_.bandwidth&&(this.options_.bandwidth=Mo.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Mo.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach((e=>{void 0!==this.source_[e]&&(this.options_[e]=this.source_[e])})),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio;const t=this.options_.customPixelRatio;"number"==typeof t&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;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=xc,this.options_.sourceType=H(t),this.options_.seekTo=e=>{this.tech_.setCurrentTime(e)},this.playlistController_=new _c(this.options_);const n=xa({liveRangeSafeTimeDelta:Ia},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new Sc(n),this.playlistController_.on("error",(()=>{const e=va.players[this.tech_.options_.playerId];let t=this.playlistController_.error;"object"!=typeof t||t.code?"string"==typeof t&&(t={message:t,code:3}):t.code=3,e.error(t)}));const r=this.options_.bufferBasedABR?xc.movingAverageBandwidthSelector(.55):xc.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=xc.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(e){this.playlistController_.selectPlaylist=e.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(e){this.playlistController_.mainSegmentLoader_.throughput.rate=e,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let e=this.playlistController_.mainSegmentLoader_.bandwidth;const t=s().navigator.connection||s().navigator.mozConnection||s().navigator.webkitConnection,i=1e7;if(this.options_.useNetworkInformationApi&&t){const n=1e3*t.downlink*1e3;e=n>=i&&e>=i?Math.max(e,n):n}return e},set(e){this.playlistController_.mainSegmentLoader_.bandwidth=e,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const e=1/(this.bandwidth||1);let t;return t=this.throughput>0?1/this.throughput:0,Math.floor(1/(e+t))},set(){va.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>Ra(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>Ra(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",(()=>{this.options_.useBandwidthFromLocalStorage&&(e=>{if(!s().localStorage)return!1;let t=Ic();t=t?xa(t,e):e;try{s().localStorage.setItem(kc,JSON.stringify(t))}catch(e){return!1}})({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})})),this.playlistController_.on("selectedinitialmedia",(()=>{var e;(e=this).representations=()=>{const t=e.playlistController_.main(),i=Za(t)?e.playlistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter((e=>!Ga(e))).map(((t,i)=>new bc(e,t,t.id))):[]}})),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",(()=>{this.setupEme_()})),this.on(this.playlistController_,"progress",(function(){this.tech_.trigger("progress")})),this.on(this.playlistController_,"firstplay",(function(){this.ignoreNextSeekingEvent_=!0})),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=s().URL.createObjectURL(this.playlistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),(({player:e,sourceKeySystems:t,audioMedia:i,mainPlaylists:n})=>{if(!e.eme.initializeMediaKeys)return Promise.resolve();const s=(o=i?n.concat([i]):n,l=Object.keys(t),o.reduce(((e,t)=>{if(!t.contentProtection)return e;const i=l.reduce(((e,i)=>{const n=t.contentProtection[i];return n&&n.pssh&&(e[i]={pssh:n.pssh}),e}),{});return Object.keys(i).length&&e.push(i),e}),[])),r=[],a=[];var o,l;return s.forEach((t=>{a.push(new Promise(((t,i)=>{e.tech_.one("keysessioncreated",t)}))),r.push(new Promise(((i,n)=>{e.eme.initializeMediaKeys({keySystems:t},(e=>{e?n(e):i()}))})))})),Promise.race([Promise.all(r),Promise.race(a)])})({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then((()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()})).catch((e=>{this.logger_("error while creating EME key session",e),this.player_.error({message:"Failed to initialize media keys for EME",code:3,metadata:{errorType:va.Error.EMEKeySessionCreationError}})}))}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=(({player:e,sourceKeySystems:t,media:i,audioMedia:n})=>{const s=((e,t,i)=>{if(!e)return e;let n={};t&&t.attributes&&t.attributes.CODECS&&(n=al(N(t.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(n.audio=i.attributes.CODECS);const s=j(n.video),r=j(n.audio),a={};for(const i in e)a[i]={},r&&(a[i].audioContentType=r),s&&(a[i].videoContentType=s),t.contentProtection&&t.contentProtection[i]&&t.contentProtection[i].pssh&&(a[i].pssh=t.contentProtection[i].pssh),"string"==typeof e[i]&&(a[i].url=e[i]);return xa(e,a)})(t,i,n);return!(!s||(e.currentSource().keySystems=s,s&&!e.eme&&(va.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),1)))})({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});this.player_.tech_.on("keystatuschange",(e=>{this.playlistController_.updatePlaylistByKeyStatus(e.keyId,e.status)})),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),t?this.createKeySessions_():this.playlistController_.sourceUpdater_.initializedEme()}setupQualityLevels_(){const e=va.players[this.tech_.options_.playerId];e&&e.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",(()=>{!function(e,t){t.representations().forEach((t=>{e.addQualityLevel(t)})),Ac(e,t.playlists)}(this.qualityLevels_,this)})),this.playlists.on("mediachange",(()=>{Ac(this.qualityLevels_,this.playlists)})))}static version(){return{"@videojs/http-streaming":Cc,"mux.js":"7.0.3","mpd-parser":"1.3.0","m3u8-parser":"7.1.0","aes-decrypter":"4.0.1"}}version(){return this.constructor.version()}canChangeType(){return Wl.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&s().URL.revokeObjectURL&&(s().URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return(({playlist:e,time:t,callback:i})=>{if(!i)throw new Error("getProgramTime: callback must be provided");if(!e||void 0===t)return i({message:"getProgramTime: playlist and time must be provided"});const n=((e,t)=>{if(!t||!t.segments||0===t.segments.length)return null;let i,n=0;for(let s=0;s<t.segments.length&&(i=t.segments[s],n=i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationEnd:n+i.duration,!(e<=n));s++);const s=t.segments[t.segments.length-1];if(s.videoTimingInfo&&s.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>n){if(e>n+.25*s.duration)return null;i=s}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:n-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}})(t,e);if(!n)return i({message:"valid programTime was not found"});if("estimate"===n.type)return i({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:n.estimatedStart});const s={mediaSeconds:t},r=((e,t)=>{if(!t.dateTimeObject)return null;const i=t.videoTimingInfo.transmuxerPrependedSeconds,n=e-(t.videoTimingInfo.transmuxedPresentationStart+i);return new Date(t.dateTimeObject.getTime()+1e3*n)})(t,n.segment);return r&&(s.programDateTime=r.toISOString()),i(null,s)})({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=!0,n=2){return Ao({programTime:e,playlist:this.playlistController_.media(),retryCount:n,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{Pc(this.xhr,e)},this.xhr.onResponse=e=>{Oc(this.xhr,e)},this.xhr.offRequest=e=>{Lc(this.xhr,e)},this.xhr.offResponse=e=>{Dc(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}}const Mc={name:"videojs-http-streaming",VERSION:Cc,canHandleSource(e,t={}){const i=xa(va.options,t);return Mc.canPlayType(e.type,i)},handleSource(e,t,i={}){const n=xa(va.options,i);return t.vhs=new Nc(e,t,n),t.vhs.xhr=vo(),t.vhs.setupXhrHooks_(),t.vhs.src(e.src,e.type),t.vhs},canPlayType(e,t){const i=H(e);if(!i)return"";const n=Mc.getOverrideNative(t);return!xc.supportsTypeNatively(i)||n?"maybe":""},getOverrideNative(e={}){const{vhs:t={}}=e,i=!(va.browser.IS_ANY_SAFARI||va.browser.IS_IOS),{overrideNative:n=i}=t;return n}};U("avc1.4d400d,mp4a.40.2")&&va.getTech("Html5").registerSourceHandler(Mc,0),va.VhsHandler=Nc,va.VhsSourceHandler=Mc,va.Vhs=xc,va.use||va.registerComponent("Vhs",xc),va.options.vhs=va.options.vhs||{},va.getPlugin&&va.getPlugin("reloadSourceOnError")||va.registerPlugin("reloadSourceOnError",(function(e){Ec(this,e)}))},52:(e,t,i)=>{var n=i(5204),s=e.exports={WebVTT:i(5483),VTTCue:i(2980),VTTRegion:i(6791)};n.vttjs=s,n.WebVTT=s.WebVTT;var r=s.VTTCue,a=s.VTTRegion,o=n.VTTCue,l=n.VTTRegion;s.shim=function(){n.VTTCue=r,n.VTTRegion=a},s.restore=function(){n.VTTCue=o,n.VTTRegion=l},n.VTTCue||s.shim()},5483:(e,t,i)=>{var n=i(7509),s=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 r(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function a(e){function t(e,t,i,n){return 3600*(0|e)+60*(0|t)+(0|i)+(0|n)/1e3}var i=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return i?i[3]?t(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function o(){this.values=s(null)}function l(e,t,i,n){var s=n?e.split(n):[e];for(var r in s)if("string"==typeof s[r]){var a=s[r].split(i);2===a.length&&t(a[0].trim(),a[1].trim())}}function c(e,t,i){var n=e;function s(){var t=a(e);if(null===t)throw new r(r.Errors.BadTimeStamp,"Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function c(){e=e.replace(/^\s+/,"")}if(c(),t.startTime=s(),c(),"--\x3e"!==e.substr(0,3))throw new r(r.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);e=e.substr(3),c(),t.endTime=s(),c(),function(e,t){var n=new o;l(e,(function(e,t){switch(e){case"region":for(var s=i.length-1;s>=0;s--)if(i[s].id===t){n.set(e,i[s].region);break}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":var r=t.split(","),a=r[0];n.integer(e,a),n.percent(e,a)&&n.set("snapToLines",!1),n.alt(e,a,["auto"]),2===r.length&&n.alt("lineAlign",r[1],["start","center","end"]);break;case"position":r=t.split(","),n.percent(e,r[0]),2===r.length&&n.alt("positionAlign",r[1],["start","center","end"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start","center","end","left","right"])}}),/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical","");try{t.line=n.get("line","auto")}catch(e){}t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100);try{t.align=n.get("align","center")}catch(e){t.align=n.get("align","middle")}try{t.position=n.get("position","auto")}catch(e){t.position=n.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=n.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}(e,t)}r.prototype=s(Error.prototype),r.prototype.constructor=r,r.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,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var n=0;n<i.length;++n)if(t===i[n]){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 u=n.createElement&&n.createElement("textarea"),h={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},d={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 i(){if(!t)return null;var e,i=t.match(/^([^<]*)(<[^>]*>?)?/);return e=i[1]?i[1]:i[2],t=t.substr(e.length),e}function n(e,t){return!f[t.localName]||f[t.localName]===e.localName}function s(t,i){var n=h[t];if(!n)return null;var s=e.document.createElement(n),r=p[t];return r&&i&&(s[r]=i.trim()),s}for(var r,o,l=e.document.createElement("div"),c=l,m=[];null!==(r=i());)if("<"!==r[0])c.appendChild(e.document.createTextNode((o=r,u.innerHTML=o,o=u.textContent,u.textContent="",o)));else{if("/"===r[1]){m.length&&m[m.length-1]===r.substr(2).replace(">","")&&(m.pop(),c=c.parentNode);continue}var g,y=a(r.substr(1,r.length-2));if(y){g=e.document.createProcessingInstruction("timestamp",y),c.appendChild(g);continue}var v=r.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!v)continue;if(!(g=s(v[1],v[3])))continue;if(!n(c,g))continue;if(v[2]){var _=v[2].split(".");_.forEach((function(e){var t=/^bg_/.test(e),i=t?e.slice(3):e;if(d.hasOwnProperty(i)){var n=t?"background-color":"color",s=d[i];g.style[n]=s}})),g.className=_.join(" ")}m.push(v[1]),c.appendChild(g),c=g}return l}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],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function y(e){for(var t=0;t<g.length;t++){var i=g[t];if(e>=i[0]&&e<=i[1])return!0}return!1}function v(e){var t=[],i="";if(!e||!e.childNodes)return"ltr";function n(e,t){for(var i=t.childNodes.length-1;i>=0;i--)e.push(t.childNodes[i])}function s(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textContent||t.innerText;if(i){var r=i.match(/^.*(\n|\r)/);return r?(e.length=0,r[0]):i}return"ruby"===t.tagName?s(e):t.childNodes?(n(e,t),s(e)):void 0}for(n(t,e);i=s(t);)for(var r=0;r<i.length;r++)if(y(i.charCodeAt(r)))return"rtl";return"ltr"}function _(){}function b(e,t,i){_.call(this),this.cue=t,this.cueDiv=m(e,t.text);var n={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(n,this.cueDiv),this.div=e.document.createElement("div"),n={direction:v(this.cueDiv),writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:"middle"===t.align?"center":t.align,font:i.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(n),this.div.appendChild(this.cueDiv);var s=0;switch(t.positionAlign){case"start":case"line-left":s=t.position;break;case"center":s=t.position-t.size/2;break;case"end":case"line-right":s=t.position-t.size}""===t.vertical?this.applyStyles({left:this.formatStyle(s,"%"),width:this.formatStyle(t.size,"%")}):this.applyStyles({top:this.formatStyle(s,"%"),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,i,n,s;if(e.div){i=e.div.offsetHeight,n=e.div.offsetWidth,s=e.div.offsetTop;var r=(r=e.div.childNodes)&&(r=r[0])&&r.getClientRects&&r.getClientRects();e=e.div.getBoundingClientRect(),t=r?Math.max(r[0]&&r[0].height||0,e.height/r.length):0}this.left=e.left,this.right=e.right,this.top=e.top||s,this.height=e.height||i,this.bottom=e.bottom||s+(e.height||i),this.width=e.width||n,this.lineHeight=void 0!==t?t:e.lineHeight}function S(e,t,i,n){var s=new T(t),r=t.cue,a=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,i=t.textTrackList,n=0,s=0;s<i.length&&i[s]!==t;s++)"showing"===i[s].mode&&n++;return-1*++n}(r),o=[];if(r.snapToLines){var l;switch(r.vertical){case"":o=["+y","-y"],l="height";break;case"rl":o=["+x","-x"],l="width";break;case"lr":o=["-x","+x"],l="width"}var c=s.lineHeight,u=c*Math.round(a),h=i[l]+c,d=o[0];Math.abs(u)>h&&(u=u<0?-1:1,u*=Math.ceil(h/c)*c),a<0&&(u+=""===r.vertical?i.height:i.width,o=o.reverse()),s.move(d,u)}else{var p=s.lineHeight/i.height*100;switch(r.lineAlign){case"center":a-=p/2;break;case"end":a-=p}switch(r.vertical){case"":t.applyStyles({top:t.formatStyle(a,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(a,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(a,"%")})}o=["+y","-x","+x","-y"],s=new T(t)}var f=function(e,t){for(var s,r=new T(e),a=1,o=0;o<t.length;o++){for(;e.overlapsOppositeAxis(i,t[o])||e.within(i)&&e.overlapsAny(n);)e.move(t[o]);if(e.within(i))return e;var l=e.intersectPercentage(i);a>l&&(s=new T(e),a=l),e=new T(r)}return s||r}(s,o);t.move(f.toCSSCompatValues(i))}function w(){}_.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},_.prototype.formatStyle=function(e,t){return 0===e?0:e+t},b.prototype=s(_.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,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i}},w.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},w.convertCueToDOMTree=function(e,t){return e&&t?m(e,t):null},w.processCues=function(e,t,i){if(!e||!t||!i)return null;for(;i.firstChild;)i.removeChild(i.firstChild);var n=e.document.createElement("div");if(n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin="1.5%",i.appendChild(n),function(e){for(var t=0;t<e.length;t++)if(e[t].hasBeenReset||!e[t].displayState)return!0;return!1}(t)){var s=[],r=T.getSimpleBoxPosition(n),a={font:Math.round(.05*r.height*100)/100+"px sans-serif"};!function(){for(var i,o,l=0;l<t.length;l++)o=t[l],i=new b(e,o,a),n.appendChild(i.div),S(0,i,r,s),o.displayState=i.div,s.push(T.getSimpleBoxPosition(i))}()}else for(var o=0;o<t.length;o++)n.appendChild(t[o].displayState)},w.Parser=function(e,t,i){i||(i=t,t={}),t||(t={}),this.window=e,this.vttjs=t,this.state="INITIAL",this.buffer="",this.decoder=i||new TextDecoder("utf8"),this.regionList=[]},w.Parser.prototype={reportOrThrowError:function(e){if(!(e instanceof r))throw e;this.onparsingerror&&this.onparsingerror(e)},parse:function(e){var t,i=this;function n(){for(var e=i.buffer,t=0;t<e.length&&"\r"!==e[t]&&"\n"!==e[t];)++t;var n=e.substr(0,t);return"\r"===e[t]&&++t,"\n"===e[t]&&++t,i.buffer=e.substr(t),n}e&&(i.buffer+=i.decoder.decode(e,{stream:!0}));try{var s;if("INITIAL"===i.state){if(!/\r\n|\n/.test(i.buffer))return this;var u=(s=n()).match(/^WEBVTT([ \t].*)?$/);if(!u||!u[0])throw new r(r.Errors.BadSignature);i.state="HEADER"}for(var h=!1;i.buffer;){if(!/\r\n|\n/.test(i.buffer))return this;switch(h?h=!1:s=n(),i.state){case"HEADER":/:/.test(s)?(t=s).match(/X-TIMESTAMP-MAP/)?l(t,(function(e,t){"X-TIMESTAMP-MAP"===e&&function(e){var t=new o;l(e,(function(e,i){switch(e){case"MPEGT":t.integer(e+"S",i);break;case"LOCA":t.set(e+"L",a(i))}}),/[^\d]:/,/,/),i.ontimestampmap&&i.ontimestampmap({MPEGTS:t.get("MPEGTS"),LOCAL:t.get("LOCAL")})}(t)}),/=/):l(t,(function(e,t){"Region"===e&&function(e){var t=new o;if(l(e,(function(e,i){switch(e){case"id":t.set(e,i);break;case"width":t.percent(e,i);break;case"lines":t.integer(e,i);break;case"regionanchor":case"viewportanchor":var n=i.split(",");if(2!==n.length)break;var s=new o;if(s.percent("x",n[0]),s.percent("y",n[1]),!s.has("x")||!s.has("y"))break;t.set(e+"X",s.get("x")),t.set(e+"Y",s.get("y"));break;case"scroll":t.alt(e,i,["up"])}}),/=/,/\s/),t.has("id")){var n=new(i.vttjs.VTTRegion||i.window.VTTRegion);n.width=t.get("width",100),n.lines=t.get("lines",3),n.regionAnchorX=t.get("regionanchorX",0),n.regionAnchorY=t.get("regionanchorY",100),n.viewportAnchorX=t.get("viewportanchorX",0),n.viewportAnchorY=t.get("viewportanchorY",100),n.scroll=t.get("scroll",""),i.onregion&&i.onregion(n),i.regionList.push({id:t.get("id"),region:n})}}(t)}),/:/):s||(i.state="ID");continue;case"NOTE":s||(i.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(s)){i.state="NOTE";break}if(!s)continue;i.cue=new(i.vttjs.VTTCue||i.window.VTTCue)(0,0,"");try{i.cue.align="center"}catch(e){i.cue.align="middle"}if(i.state="CUE",-1===s.indexOf("--\x3e")){i.cue.id=s;continue}case"CUE":try{c(s,i.cue,i.regionList)}catch(e){i.reportOrThrowError(e),i.cue=null,i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":var d=-1!==s.indexOf("--\x3e");if(!s||d&&(h=!0)){i.oncue&&i.oncue(i.cue),i.cue=null,i.state="ID";continue}i.cue.text&&(i.cue.text+="\n"),i.cue.text+=s.replace(/\u2028/g,"\n").replace(/u2029/g,"\n");continue;case"BADCUE":s||(i.state="ID");continue}}}catch(e){i.reportOrThrowError(e),"CUETEXT"===i.state&&i.cue&&i.oncue&&i.oncue(i.cue),i.cue=null,i.state="INITIAL"===i.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 r(r.Errors.BadSignature)}catch(t){e.reportOrThrowError(t)}return e.onflush&&e.onflush(),this}},e.exports=w},2980:e=>{var t={"":1,lr:1,rl:1},i={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function n(e){return"string"==typeof e&&!!i[e.toLowerCase()]&&e.toLowerCase()}function s(e,i,s){this.hasBeenReset=!1;var r="",a=!1,o=e,l=i,c=s,u=null,h="",d=!0,p="auto",f="start",m="auto",g="auto",y=100,v="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return r},set:function(e){r=""+e}},pauseOnExit:{enumerable:!0,get:function(){return a},set:function(e){a=!!e}},startTime:{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");o=e,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return l},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");l=e,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return c},set:function(e){c=""+e,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return u},set:function(e){u=e,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return h},set:function(e){var i=function(e){return"string"==typeof e&&!!t[e.toLowerCase()]&&e.toLowerCase()}(e);if(!1===i)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");h=i,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return d},set:function(e){d=!!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=n(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=n(e);t?(g=t,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return y},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");y=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return v},set:function(e){var t=n(e);if(!t)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");v=t,this.hasBeenReset=!0}}}),this.displayState=void 0}s.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},e.exports=s},6791:e=>{var t={"":!0,up:!0};function i(e){return"number"==typeof e&&e>=0&&e<=100}e.exports=function(){var e=100,n=3,s=0,r=100,a=0,o=100,l="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!i(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return n},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");n=e}},regionAnchorY:{enumerable:!0,get:function(){return r},set:function(e){if(!i(e))throw new Error("RegionAnchorX must be between 0 and 100.");r=e}},regionAnchorX:{enumerable:!0,get:function(){return s},set:function(e){if(!i(e))throw new Error("RegionAnchorY must be between 0 and 100.");s=e}},viewportAnchorY:{enumerable:!0,get:function(){return o},set:function(e){if(!i(e))throw new Error("ViewportAnchorY must be between 0 and 100.");o=e}},viewportAnchorX:{enumerable:!0,get:function(){return a},set:function(e){if(!i(e))throw new Error("ViewportAnchorX must be between 0 and 100.");a=e}},scroll:{enumerable:!0,get:function(){return l},set:function(e){var i=function(e){return"string"==typeof e&&!!t[e.toLowerCase()]&&e.toLowerCase()}(e);!1===i?console.warn("Scroll: an invalid or illegal string was specified."):l=i}}})}},5303:(e,t,i)=>{var n;!function(){function s(e,t,i){return e.call.apply(e.bind,arguments)}function r(e,t,i){if(!e)throw Error();if(2<arguments.length){var n=Array.prototype.slice.call(arguments,2);return function(){var i=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(i,n),e.apply(t,i)}}return function(){return e.apply(t,arguments)}}function a(e,t,i){return(a=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?s:r).apply(null,arguments)}var o=Date.now||function(){return+new Date};function l(e,t){this.a=e,this.o=t||e,this.c=this.o.document}var c=!!window.FontFace;function u(e,t,i,n){if(t=e.c.createElement(t),i)for(var s in i)i.hasOwnProperty(s)&&("style"==s?t.style.cssText=i[s]:t.setAttribute(s,i[s]));return n&&t.appendChild(e.c.createTextNode(n)),t}function h(e,t,i){(e=e.c.getElementsByTagName(t)[0])||(e=document.documentElement),e.insertBefore(i,e.lastChild)}function d(e){e.parentNode&&e.parentNode.removeChild(e)}function p(e,t,i){t=t||[],i=i||[];for(var n=e.className.split(/\s+/),s=0;s<t.length;s+=1){for(var r=!1,a=0;a<n.length;a+=1)if(t[s]===n[a]){r=!0;break}r||n.push(t[s])}for(t=[],s=0;s<n.length;s+=1){for(r=!1,a=0;a<i.length;a+=1)if(n[s]===i[a]){r=!0;break}r||t.push(n[s])}e.className=t.join(" ").replace(/\s+/g," ").replace(/^\s+|\s+$/,"")}function f(e,t){for(var i=e.className.split(/\s+/),n=0,s=i.length;n<s;n++)if(i[n]==t)return!0;return!1}function m(e,t,i){function n(){o&&s&&r&&(o(a),o=null)}t=u(e,"link",{rel:"stylesheet",href:t,media:"all"});var s=!1,r=!0,a=null,o=i||null;c?(t.onload=function(){s=!0,n()},t.onerror=function(){s=!0,a=Error("Stylesheet failed to load"),n()}):setTimeout((function(){s=!0,n()}),0),h(e,"head",t)}function g(e,t,i,n){var s=e.c.getElementsByTagName("head")[0];if(s){var r=u(e,"script",{src:t}),a=!1;return r.onload=r.onreadystatechange=function(){a||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(a=!0,i&&i(null),r.onload=r.onreadystatechange=null,"HEAD"==r.parentNode.tagName&&s.removeChild(r))},s.appendChild(r),setTimeout((function(){a||(a=!0,i&&i(Error("Script load timeout")))}),n||5e3),r}return null}function y(){this.a=0,this.c=null}function v(e){return e.a++,function(){e.a--,b(e)}}function _(e,t){e.c=t,b(e)}function b(e){0==e.a&&e.c&&(e.c(),e.c=null)}function T(e){this.a=e||"-"}function S(e,t){this.c=e,this.f=4,this.a="n";var i=(t||"n4").match(/^([nio])([1-9])$/i);i&&(this.a=i[1],this.f=parseInt(i[2],10))}function w(e){var t=[];e=e.split(/,\s*/);for(var i=0;i<e.length;i++){var n=e[i].replace(/['"]/g,"");-1!=n.indexOf(" ")||/^\d/.test(n)?t.push("'"+n+"'"):t.push(n)}return t.join(",")}function E(e){return e.a+e.f}function C(e){var t="normal";return"o"===e.a?t="oblique":"i"===e.a&&(t="italic"),t}function x(e){var t=4,i="n",n=null;return e&&((n=e.match(/(normal|oblique|italic)/i))&&n[1]&&(i=n[1].substr(0,1).toLowerCase()),(n=e.match(/([1-9]00|normal|bold)/i))&&n[1]&&(/bold/i.test(n[1])?t=7:/[1-9]00/.test(n[1])&&(t=parseInt(n[1].substr(0,1),10)))),i+t}function k(e,t){this.c=e,this.f=e.o.document.documentElement,this.h=t,this.a=new T("-"),this.j=!1!==t.events,this.g=!1!==t.classes}function A(e){if(e.g){var t=f(e.f,e.a.c("wf","active")),i=[],n=[e.a.c("wf","loading")];t||i.push(e.a.c("wf","inactive")),p(e.f,i,n)}I(e,"inactive")}function I(e,t,i){e.j&&e.h[t]&&(i?e.h[t](i.c,E(i)):e.h[t]())}function P(){this.c={}}function O(e,t){this.c=e,this.f=t,this.a=u(this.c,"span",{"aria-hidden":"true"},this.f)}function L(e){h(e.c,"body",e.a)}function D(e){return"display:block;position:absolute;top:-9999px;left:-9999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;white-space:nowrap;font-family:"+w(e.c)+";font-style:"+C(e)+";font-weight:"+e.f+"00;"}function R(e,t,i,n,s,r){this.g=e,this.j=t,this.a=n,this.c=i,this.f=s||3e3,this.h=r||void 0}function N(e,t,i,n,s,r,a){this.v=e,this.B=t,this.c=i,this.a=n,this.s=a||"BESbswy",this.f={},this.w=s||3e3,this.u=r||null,this.m=this.j=this.h=this.g=null,this.g=new O(this.c,this.s),this.h=new O(this.c,this.s),this.j=new O(this.c,this.s),this.m=new O(this.c,this.s),e=D(e=new S(this.a.c+",serif",E(this.a))),this.g.a.style.cssText=e,e=D(e=new S(this.a.c+",sans-serif",E(this.a))),this.h.a.style.cssText=e,e=D(e=new S("serif",E(this.a))),this.j.a.style.cssText=e,e=D(e=new S("sans-serif",E(this.a))),this.m.a.style.cssText=e,L(this.g),L(this.h),L(this.j),L(this.m)}T.prototype.c=function(e){for(var t=[],i=0;i<arguments.length;i++)t.push(arguments[i].replace(/[\W_]+/g,"").toLowerCase());return t.join(this.a)},R.prototype.start=function(){var e=this.c.o.document,t=this,i=o(),n=new Promise((function(n,s){!function r(){o()-i>=t.f?s():e.fonts.load(function(e){return C(e)+" "+e.f+"00 300px "+w(e.c)}(t.a),t.h).then((function(e){1<=e.length?n():setTimeout(r,25)}),(function(){s()}))}()})),s=null,r=new Promise((function(e,i){s=setTimeout(i,t.f)}));Promise.race([r,n]).then((function(){s&&(clearTimeout(s),s=null),t.g(t.a)}),(function(){t.j(t.a)}))};var M={D:"serif",C:"sans-serif"},j=null;function U(){if(null===j){var e=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);j=!!e&&(536>parseInt(e[1],10)||536===parseInt(e[1],10)&&11>=parseInt(e[2],10))}return j}function B(e,t,i){for(var n in M)if(M.hasOwnProperty(n)&&t===e.f[M[n]]&&i===e.f[M[n]])return!0;return!1}function F(e){var t,i=e.g.a.offsetWidth,n=e.h.a.offsetWidth;(t=i===e.f.serif&&n===e.f["sans-serif"])||(t=U()&&B(e,i,n)),t?o()-e.A>=e.w?U()&&B(e,i,n)&&(null===e.u||e.u.hasOwnProperty(e.a.c))?q(e,e.v):q(e,e.B):function(e){setTimeout(a((function(){F(this)}),e),50)}(e):q(e,e.v)}function q(e,t){setTimeout(a((function(){d(this.g.a),d(this.h.a),d(this.j.a),d(this.m.a),t(this.a)}),e),0)}function $(e,t,i){this.c=e,this.a=t,this.f=0,this.m=this.j=!1,this.s=i}N.prototype.start=function(){this.f.serif=this.j.a.offsetWidth,this.f["sans-serif"]=this.m.a.offsetWidth,this.A=o(),F(this)};var H=null;function V(e){0==--e.f&&e.j&&(e.m?((e=e.a).g&&p(e.f,[e.a.c("wf","active")],[e.a.c("wf","loading"),e.a.c("wf","inactive")]),I(e,"active")):A(e.a))}function z(e){this.j=e,this.a=new P,this.h=0,this.f=this.g=!0}function W(e,t,i,n,s){var r=0==--e.h;(e.f||e.g)&&setTimeout((function(){var e=s||null,o=n||{};if(0===i.length&&r)A(t.a);else{t.f+=i.length,r&&(t.j=r);var l,c=[];for(l=0;l<i.length;l++){var u=i[l],h=o[u.c],d=t.a,f=u;if(d.g&&p(d.f,[d.a.c("wf",f.c,E(f).toString(),"loading")]),I(d,"fontloading",f),d=null,null===H)if(window.FontFace){f=/Gecko.*Firefox\/(\d+)/.exec(window.navigator.userAgent);var m=/OS X.*Version\/10\..*Safari/.exec(window.navigator.userAgent)&&/Apple/.exec(window.navigator.vendor);H=f?42<parseInt(f[1],10):!m}else H=!1;d=H?new R(a(t.g,t),a(t.h,t),t.c,u,t.s,h):new N(a(t.g,t),a(t.h,t),t.c,u,t.s,e,h),c.push(d)}for(l=0;l<c.length;l++)c[l].start()}}),0)}function G(e,t){this.c=e,this.a=t}function X(e,t){this.c=e,this.a=t}function Y(e,t){this.c=e||K,this.a=[],this.f=[],this.g=t||""}$.prototype.g=function(e){var t=this.a;t.g&&p(t.f,[t.a.c("wf",e.c,E(e).toString(),"active")],[t.a.c("wf",e.c,E(e).toString(),"loading"),t.a.c("wf",e.c,E(e).toString(),"inactive")]),I(t,"fontactive",e),this.m=!0,V(this)},$.prototype.h=function(e){var t=this.a;if(t.g){var i=f(t.f,t.a.c("wf",e.c,E(e).toString(),"active")),n=[],s=[t.a.c("wf",e.c,E(e).toString(),"loading")];i||n.push(t.a.c("wf",e.c,E(e).toString(),"inactive")),p(t.f,n,s)}I(t,"fontinactive",e),V(this)},z.prototype.load=function(e){this.c=new l(this.j,e.context||this.j),this.g=!1!==e.events,this.f=!1!==e.classes,function(e,t,i){var n=[],s=i.timeout;!function(e){e.g&&p(e.f,[e.a.c("wf","loading")]),I(e,"loading")}(t),n=function(e,t,i){var n,s=[];for(n in t)if(t.hasOwnProperty(n)){var r=e.c[n];r&&s.push(r(t[n],i))}return s}(e.a,i,e.c);var r=new $(e.c,t,s);for(e.h=n.length,t=0,i=n.length;t<i;t++)n[t].load((function(t,i,n){W(e,r,t,i,n)}))}(this,new k(this.c,e),e)},G.prototype.load=function(e){function t(){if(r["__mti_fntLst"+n]){var i,s=r["__mti_fntLst"+n](),a=[];if(s)for(var o=0;o<s.length;o++){var l=s[o].fontfamily;null!=s[o].fontStyle&&null!=s[o].fontWeight?(i=s[o].fontStyle+s[o].fontWeight,a.push(new S(l,i))):a.push(new S(l))}e(a)}else setTimeout((function(){t()}),50)}var i=this,n=i.a.projectId,s=i.a.version;if(n){var r=i.c.o;g(this.c,(i.a.api||"https://fast.fonts.net/jsapi")+"/"+n+".js"+(s?"?v="+s:""),(function(s){s?e([]):(r["__MonotypeConfiguration__"+n]=function(){return i.a},t())})).id="__MonotypeAPIScript__"+n}else e([])},X.prototype.load=function(e){var t,i,n=this.a.urls||[],s=this.a.families||[],r=this.a.testStrings||{},a=new y;for(t=0,i=n.length;t<i;t++)m(this.c,n[t],v(a));var o=[];for(t=0,i=s.length;t<i;t++)if((n=s[t].split(":"))[1])for(var l=n[1].split(","),c=0;c<l.length;c+=1)o.push(new S(n[0],l[c]));else o.push(new S(n[0]));_(a,(function(){e(o,r)}))};var K="https://fonts.googleapis.com/css";function Q(e){this.f=e,this.a=[],this.c={}}var J={latin:"BESbswy","latin-ext":"çöüğş",cyrillic:"йяЖ",greek:"αβΣ",khmer:"កខគ",Hanuman:"កខគ"},Z={thin:"1",extralight:"2","extra-light":"2",ultralight:"2","ultra-light":"2",light:"3",regular:"4",book:"4",medium:"5","semi-bold":"6",semibold:"6","demi-bold":"6",demibold:"6",bold:"7","extra-bold":"8",extrabold:"8","ultra-bold":"8",ultrabold:"8",black:"9",heavy:"9",l:"3",r:"4",b:"7"},ee={i:"i",italic:"i",n:"n",normal:"n"},te=/^(thin|(?:(?:extra|ultra)-?)?light|regular|book|medium|(?:(?:semi|demi|extra|ultra)-?)?bold|black|heavy|l|r|b|[1-9]00)?(n|i|normal|italic)?$/;function ie(e,t){this.c=e,this.a=t}var ne={Arimo:!0,Cousine:!0,Tinos:!0};function se(e,t){this.c=e,this.a=t}function re(e,t){this.c=e,this.f=t,this.a=[]}ie.prototype.load=function(e){var t=new y,i=this.c,n=new Y(this.a.api,this.a.text),s=this.a.families;!function(e,t){for(var i=t.length,n=0;n<i;n++){var s=t[n].split(":");3==s.length&&e.f.push(s.pop());var r="";2==s.length&&""!=s[1]&&(r=":"),e.a.push(s.join(r))}}(n,s);var r=new Q(s);!function(e){for(var t=e.f.length,i=0;i<t;i++){var n=e.f[i].split(":"),s=n[0].replace(/\+/g," "),r=["n4"];if(2<=n.length){var a;if(a=[],o=n[1])for(var o,l=(o=o.split(",")).length,c=0;c<l;c++){var u;if((u=o[c]).match(/^[\w-]+$/))if(null==(h=te.exec(u.toLowerCase())))u="";else{if(u=null==(u=h[2])||""==u?"n":ee[u],null==(h=h[1])||""==h)h="4";else var h=Z[h]||(isNaN(h)?"4":h.substr(0,1));u=[u,h].join("")}else u="";u&&a.push(u)}0<a.length&&(r=a),3==n.length&&(a=[],0<(n=(n=n[2])?n.split(","):a).length&&(n=J[n[0]])&&(e.c[s]=n))}for(e.c[s]||(n=J[s])&&(e.c[s]=n),n=0;n<r.length;n+=1)e.a.push(new S(s,r[n]))}}(r),m(i,function(e){if(0==e.a.length)throw Error("No fonts to load!");if(-1!=e.c.indexOf("kit="))return e.c;for(var t=e.a.length,i=[],n=0;n<t;n++)i.push(e.a[n].replace(/ /g,"+"));return t=e.c+"?family="+i.join("%7C"),0<e.f.length&&(t+="&subset="+e.f.join(",")),0<e.g.length&&(t+="&text="+encodeURIComponent(e.g)),t}(n),v(t)),_(t,(function(){e(r.a,r.c,ne)}))},se.prototype.load=function(e){var t=this.a.id,i=this.c.o;t?g(this.c,(this.a.api||"https://use.typekit.net")+"/"+t+".js",(function(t){if(t)e([]);else if(i.Typekit&&i.Typekit.config&&i.Typekit.config.fn){t=i.Typekit.config.fn;for(var n=[],s=0;s<t.length;s+=2)for(var r=t[s],a=t[s+1],o=0;o<a.length;o++)n.push(new S(r,a[o]));try{i.Typekit.load({events:!1,classes:!1,async:!0})}catch(e){}e(n)}}),2e3):e([])},re.prototype.load=function(e){var t=this.f.id,i=this.c.o,n=this;t?(i.__webfontfontdeckmodule__||(i.__webfontfontdeckmodule__={}),i.__webfontfontdeckmodule__[t]=function(t,i){for(var s=0,r=i.fonts.length;s<r;++s){var a=i.fonts[s];n.a.push(new S(a.name,x("font-weight:"+a.weight+";font-style:"+a.style)))}e(n.a)},g(this.c,(this.f.api||"https://f.fontdeck.com/s/css/js/")+function(e){return e.o.location.hostname||e.a.location.hostname}(this.c)+"/"+t+".js",(function(t){t&&e([])}))):e([])};var ae=new z(window);ae.a.c.custom=function(e,t){return new X(t,e)},ae.a.c.fontdeck=function(e,t){return new re(t,e)},ae.a.c.monotype=function(e,t){return new G(t,e)},ae.a.c.typekit=function(e,t){return new se(t,e)},ae.a.c.google=function(e,t){return new ie(t,e)};var oe={load:a(ae.load,ae)};void 0===(n=function(){return oe}.call(t,i,t,e))||(e.exports=n)}()},4626:()=>{},8304:e=>{function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(this,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}},n={};function s(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={id:e,loaded:!1,exports:{}};return i[e].call(r.exports,r,r.exports,s),r.loaded=!0,r.exports}s.m=i,e=[],s.O=(t,i,n,r)=>{if(!i){var a=1/0;for(u=0;u<e.length;u++){for(var[i,n,r]=e[u],o=!0,l=0;l<i.length;l++)(!1&r||a>=r)&&Object.keys(s.O).every((e=>s.O[e](i[l])))?i.splice(l--,1):(o=!1,r<a&&(a=r));if(o){e.splice(u--,1);var c=n();void 0!==c&&(t=c)}}return t}r=r||0;for(var u=e.length;u>0&&e[u-1][2]>r;u--)e[u]=e[u-1];e[u]=[i,n,r]},s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,i)=>(s.f[i](e,t),t)),[])),s.u=e=>({33:"playlist",40:"debug",330:"ima",367:"dash",404:"interaction-areas",410:"recommendations-overlay",525:"shoppable",625:"chapters"}[e]+".js"),s.miniCssF=e=>{},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},s.l=(e,i,n,r)=>{if(t[e])t[e].push(i);else{var a,o;if(void 0!==n)for(var l=document.getElementsByTagName("script"),c=0;c<l.length;c++){var u=l[c];if(u.getAttribute("src")==e){a=u;break}}a||(o=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",a.timeout=120,s.nc&&a.setAttribute("nonce",s.nc),a.src=e),t[e]=[i];var h=(i,n)=>{a.onerror=a.onload=null,clearTimeout(d);var s=t[e];if(delete t[e],a.parentNode&&a.parentNode.removeChild(a),s&&s.forEach((e=>e(n))),i)return i(n)},d=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),o&&document.head.appendChild(a)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),s.p="",(()=>{var e={278:0,869:0};s.f.j=(t,i)=>{var n=s.o(e,t)?e[t]:void 0;if(0!==n)if(n)i.push(n[2]);else if(869!=t){var r=new Promise(((i,s)=>n=e[t]=[i,s]));i.push(n[2]=r);var a=s.p+s.u(t),o=new Error;s.l(a,(i=>{if(s.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var r=i&&("load"===i.type?"missing":i.type),a=i&&i.target&&i.target.src;o.message="Loading chunk "+t+" failed.\n("+r+": "+a+")",o.name="ChunkLoadError",o.type=r,o.request=a,n[1](o)}}),"chunk-"+t,t)}else e[t]=0},s.O.j=t=>0===e[t];var t=(t,i)=>{var n,r,[a,o,l]=i,c=0;if(a.some((t=>0!==e[t]))){for(n in o)s.o(o,n)&&(s.m[n]=o[n]);if(l)var u=l(s)}for(t&&t(i);c<a.length;c++)r=a[c],s.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return s.O(u)},i=self.cloudinaryVideoPlayerChunkLoading=self.cloudinaryVideoPlayerChunkLoading||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var r=s.O(void 0,[869],(()=>s(9911))),a=(r=s.O(r)).Ay,o=r.xY,l=r.GF,c=r.Iy;export{a as default,o as videoPlayer,l as videoPlayerWithProfile,c as videoPlayers};
|
|
3
3
|
//# sourceMappingURL=cld-video-player.js.map
|