import{au as sy,x as oy,b as uy,r as _n,G as Md,o as ly,i as Rd,y as cy,T as dy,j as Ui,k as Bi,z as zt,l as Bt,A as Nd,B as ji,E as hy,F as Ud,Y as py,Z as fy,ar as my,v as qo,aw as gy,q as vy}from"./COz-SV36.js";import{u as yy}from"./BxSAvYuA.js";/* empty css */import{u as _y}from"./DWwTVl-6.js";var by={exports:{}};const Ty=sy(by.exports=(()=>{var Ho={480:(Ve,je,Ae)=>{var Ie=Ae(697),O=function(ie,Ee){return Ee===void 0&&(Ee=!1),function(ye,U,w){if(ye)ie(ye);else if(U.statusCode>=400&&U.statusCode<=599){var D=w;if(Ee)if(Ie.TextDecoder){var y=ke(U.headers&&U.headers["content-type"]);try{D=new TextDecoder(y).decode(w)}catch{}}else D=String.fromCharCode.apply(null,new Uint8Array(w));ie({cause:D})}else ie(null,w)}};function ke(ie){return ie===void 0&&(ie=""),ie.toLowerCase().split(";").reduce(function(Ee,ye){var U=ye.split("="),w=U[0],D=U[1];return w.trim()==="charset"?D.trim():Ee},"utf-8")}Ve.exports=O},424:(Ve,je,Ae)=>{var Ie=Ae(697),O=Ae(110),ke=Ae(988);w.httpHandler=Ae(480);/** * @license * slighly modified parse-headers 2.0.2
* Copyright (c) 2014 David Björklund * Available under the MIT license *
*/var ie=function(I){var E={};return I&&I.trim().split(` `).forEach(function(M){var H=M.indexOf(":"),te=M.slice(0,H).trim().toLowerCase(),V=M.slice(H+1).trim();E[te]===void 0?E[te]=V:Array.isArray(E[te])?E[te].push(V):E[te]=[E[te],V]}),E};function Ee(I,E){for(var M=0;M
0&&(F=setTimeout(function(){if(!R){R=!0,k.abort("timeout");var z=new Error("XMLHttpRequest timeout");z.code="ETIMEDOUT",V(z)}},I.timeout)),k.setRequestHeader)for(N in p)p.hasOwnProperty(N)&&k.setRequestHeader(N,p[N]);else if(I.headers&&!ye(I.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in I&&(k.responseType=I.responseType),"beforeSend"in I&&typeof I.beforeSend=="function"&&I.beforeSend(k),k.send(K||null),k}function y(I){try{if(I.responseType==="document")return I.responseXML;var E=I.responseXML&&I.responseXML.documentElement.nodeName==="parsererror";if(I.responseType===""&&!E)return I.responseXML}catch{}return null}function A(){}Ve.exports=w,Ve.exports.default=w,w.XMLHttpRequest=Ie.XMLHttpRequest||A,w.XDomainRequest="withCredentials"in new w.XMLHttpRequest?w.XMLHttpRequest:Ie.XDomainRequest,Ee(["get","put","post","patch","head","delete"],function(I){w[I==="delete"?"del":I]=function(E,M,H){return(M=U(E,M,H)).method=I.toUpperCase(),D(M)}})},29:(Ve,je)=>{function Ae(Ee,ye,U){if(U===void 0&&(U=Array.prototype),Ee&&typeof U.find=="function")return U.find.call(Ee,ye);for(var w=0;w
{var Ie=Ae(29),O=Ae(665),ke=Ae(884),ie=Ae(996),Ee=O.DOMImplementation,ye=Ie.NAMESPACE,U=ie.ParseError,w=ie.XMLReader;function D(V){return V.replace(/\r[\n\u0085]/g,` `).replace(/[\r\u0085\u2028]/g,` `)}function y(V){this.options=V||{locator:{}}}function A(V,X,k){if(!V){if(X instanceof I)return X;V=X}var N={},R=V instanceof Function;function F(Z){var L=V[Z];!L&&R&&(L=V.length==2?function(K){V(Z,K)}:V),N[Z]=L&&function(K){L("[xmldom "+Z+"] "+K+M(k))}||function(){}}return k=k||{},F("warning"),F("error"),F("fatalError"),N}function I(){this.cdata=!1}function E(V,X){X.lineNumber=V.lineNumber,X.columnNumber=V.columnNumber}function M(V){if(V)return` @`+(V.systemId||"")+"#[line:"+V.lineNumber+",col:"+V.columnNumber+"]"}function H(V,X,k){return typeof V=="string"?V.substr(X,k):V.length>=X+k||X?new java.lang.String(V,X,k)+"":V}function te(V,X){V.currentElement?V.currentElement.appendChild(X):V.doc.appendChild(X)}y.prototype.parseFromString=function(V,X){var k=this.options,N=new w,R=k.domBuilder||new I,F=k.errorHandler,Z=k.locator,L=k.xmlns||{},K=/\/x?html?$/.test(X),p=K?ke.HTML_ENTITIES:ke.XML_ENTITIES;Z&&R.setDocumentLocator(Z),N.errorHandler=A(F,R,Z),N.domBuilder=k.domBuilder||R,K&&(L[""]=ye.HTML),L.xml=L.xml||ye.XML;var v=k.normalizeLineEndings||D;return V&&typeof V=="string"?N.parse(v(V),L,p):N.errorHandler.error("invalid doc source"),R.doc},I.prototype={startDocument:function(){this.doc=new Ee().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(V,X,k,N){var R=this.doc,F=R.createElementNS(V,k||X),Z=N.length;te(this,F),this.currentElement=F,this.locator&&E(this.locator,F);for(var L=0;L
{var Ie=Ae(29),O=Ie.find,ke=Ie.NAMESPACE;function ie(S){return S!==""}function Ee(S){return S?S.split(/[\t\n\f\r ]+/).filter(ie):[]}function ye(S,C){return S.hasOwnProperty(C)||(S[C]=!0),S}function U(S){if(!S)return[];var C=Ee(S);return Object.keys(C.reduce(ye,{}))}function w(S){return function(C){return S&&S.indexOf(C)!==-1}}function D(S,C){for(var Q in S)Object.prototype.hasOwnProperty.call(S,Q)&&(C[Q]=S[Q])}function y(S,C){var Q=S.prototype;if(!(Q instanceof C)){let me=function(){};me.prototype=C.prototype,me=new me,D(Q,me),S.prototype=Q=me}Q.constructor!=S&&(typeof S!="function"&&console.error("unknown Class:"+S),Q.constructor=S)}var A={},I=A.ELEMENT_NODE=1,E=A.ATTRIBUTE_NODE=2,M=A.TEXT_NODE=3,H=A.CDATA_SECTION_NODE=4,te=A.ENTITY_REFERENCE_NODE=5,V=A.ENTITY_NODE=6,X=A.PROCESSING_INSTRUCTION_NODE=7,k=A.COMMENT_NODE=8,N=A.DOCUMENT_NODE=9,R=A.DOCUMENT_TYPE_NODE=10,F=A.DOCUMENT_FRAGMENT_NODE=11,Z=A.NOTATION_NODE=12,L={},K={};L.INDEX_SIZE_ERR=(K[1]="Index size error",1),L.DOMSTRING_SIZE_ERR=(K[2]="DOMString size error",2);var p=L.HIERARCHY_REQUEST_ERR=(K[3]="Hierarchy request error",3);L.WRONG_DOCUMENT_ERR=(K[4]="Wrong document",4),L.INVALID_CHARACTER_ERR=(K[5]="Invalid character",5),L.NO_DATA_ALLOWED_ERR=(K[6]="No data allowed",6),L.NO_MODIFICATION_ALLOWED_ERR=(K[7]="No modification allowed",7);var v=L.NOT_FOUND_ERR=(K[8]="Not found",8);L.NOT_SUPPORTED_ERR=(K[9]="Not supported",9);var P=L.INUSE_ATTRIBUTE_ERR=(K[10]="Attribute in use",10);function B(S,C){if(C instanceof Error)var Q=C;else Q=this,Error.call(this,K[S]),this.message=K[S],Error.captureStackTrace&&Error.captureStackTrace(this,B);return Q.code=S,C&&(this.message=this.message+": "+C),Q}function z(){}function ce(S,C){this._node=S,this._refresh=C,ae(this)}function ae(S){var C=S._node._inc||S._node.ownerDocument._inc;if(S._inc!=C){var Q=S._refresh(S._node);et(S,"length",Q.length),D(Q,S),S._inc=C}}function ge(){}function ue(S,C){for(var Q=S.length;Q--;)if(S[Q]===C)return Q}function le(S,C,Q,me){if(me?C[ue(C,me)]=Q:C[C.length++]=Q,S){Q.ownerElement=S;var Be=S.ownerDocument;Be&&(me&&J(Be,S,me),de(Be,S,Q))}}function pe(S,C,Q){var me=ue(C,Q);if(!(me>=0))throw new B(v,new Error(S.tagName+"@"+Q));for(var Be=C.length-1;me
"&&">")||S=="&"&&"&"||S=='"'&&"""||"&#"+S.charCodeAt()+";"}function Y(S,C){if(C(S))return!0;if(S=S.firstChild)do if(Y(S,C))return!0;while(S=S.nextSibling)}function $(){this.ownerDocument=this}function de(S,C,Q){S&&S._inc++,Q.namespaceURI===ke.XMLNS&&(C._nsMap[Q.prefix?Q.localName:""]=Q.value)}function J(S,C,Q,me){S&&S._inc++,Q.namespaceURI===ke.XMLNS&&delete C._nsMap[Q.prefix?Q.localName:""]}function ee(S,C,Q){if(S&&S._inc){S._inc++;var me=C.childNodes;if(Q)me[me.length++]=Q;else{for(var Be=C.firstChild,Ke=0;Be;)me[Ke++]=Be,Be=Be.nextSibling;me.length=Ke,delete me[me.length]}}}function fe(S,C){var Q=C.previousSibling,me=C.nextSibling;return Q?Q.nextSibling=me:S.firstChild=me,me?me.previousSibling=Q:S.lastChild=Q,C.parentNode=null,C.previousSibling=null,C.nextSibling=null,ee(S.ownerDocument,S),C}function Pe(S){return S&&(S.nodeType===oe.DOCUMENT_NODE||S.nodeType===oe.DOCUMENT_FRAGMENT_NODE||S.nodeType===oe.ELEMENT_NODE)}function Re(S){return S&&(He(S)||Ze(S)||Fe(S)||S.nodeType===oe.DOCUMENT_FRAGMENT_NODE||S.nodeType===oe.COMMENT_NODE||S.nodeType===oe.PROCESSING_INSTRUCTION_NODE)}function Fe(S){return S&&S.nodeType===oe.DOCUMENT_TYPE_NODE}function He(S){return S&&S.nodeType===oe.ELEMENT_NODE}function Ze(S){return S&&S.nodeType===oe.TEXT_NODE}function $e(S,C){var Q=S.childNodes||[];if(O(Q,He)||Fe(C))return!1;var me=O(Q,Fe);return!(C&&me&&Q.indexOf(me)>Q.indexOf(C))}function Et(S,C){var Q=S.childNodes||[];function me(Ke){return He(Ke)&&Ke!==C}if(O(Q,me))return!1;var Be=O(Q,Fe);return!(C&&Be&&Q.indexOf(Be)>Q.indexOf(C))}function wn(S,C,Q){if(!Pe(S))throw new B(p,"Unexpected parent node type "+S.nodeType);if(Q&&Q.parentNode!==S)throw new B(v,"child not in parent");if(!Re(C)||Fe(C)&&S.nodeType!==oe.DOCUMENT_NODE)throw new B(p,"Unexpected node type "+C.nodeType+" for parent node type "+S.nodeType)}function kn(S,C,Q){var me=S.childNodes||[],Be=C.childNodes||[];if(C.nodeType===oe.DOCUMENT_FRAGMENT_NODE){var Ke=Be.filter(He);if(Ke.length>1||O(Be,Ze))throw new B(p,"More than one element or text in fragment");if(Ke.length===1&&!$e(S,Q))throw new B(p,"Element in fragment can not be inserted before doctype")}if(He(C)&&!$e(S,Q))throw new B(p,"Only one element can be added and only after doctype");if(Fe(C)){if(O(me,Fe))throw new B(p,"Only one doctype is allowed");var nt=O(me,He);if(Q&&me.indexOf(nt)
1||O(Be,Ze))throw new B(p,"More than one element or text in fragment");if(Ke.length===1&&!Et(S,Q))throw new B(p,"Element in fragment can not be inserted before doctype")}if(He(C)&&!Et(S,Q))throw new B(p,"Only one element can be added and only after doctype");if(Fe(C)){if(O(me,function(at){return Fe(at)&&at!==Q}))throw new B(p,"Only one doctype is allowed");var nt=O(me,He);if(Q&&me.indexOf(nt)
&" \t\n\r]="" g,xe),'"')}function="" cn(s,c,q,me,be){if(be||(be="[]),me){if(!(S=me(S)))return;if(typeof" s="="string")return" void="" c.push(s)}switch(s.nodetype){case="" i:var="" sn,gn="0;Gn
=0;hn--)if((pn=Be[hn]).prefix===""&&pn.namespace===S.namespaceURI){sn=pn.namespace;break}}if(sn!==S.namespaceURI)for(hn=Be.length-1;hn>=0;hn--){var pn;if((pn=Be[hn]).namespace===S.namespaceURI){pn.prefix&&(Mt=pn.prefix+":"+dn);break}}}C.push("<",mt);for(var on=0;on
"),Q&&/^script$/i.test(dn))for(;at;)at.data?C.push(at.data):cn(at,C,Q,me,Be.slice()),at=at.nextSibling;else for(;at;)cn(at,C,Q,me,Be.slice()),at=at.nextSibling;C.push("")}else C.push("/>");return;case N:case F:for(at=S.firstChild;at;)cn(at,C,Q,me,Be.slice()),at=at.nextSibling;return;case E:return Wn(C,S.name,S.value);case M:return C.push(S.data.replace(/[<&>]/g,xe));case H:return C.push("");case k:return C.push("");case R:var Ln=S.publicId,fn=S.systemId;if(C.push("");else if(fn&&fn!=".")C.push(" SYSTEM ",fn,">");else{var Mn=S.internalSubset;Mn&&C.push(" [",Mn,"]"),C.push(">")}return;case X:return C.push("");case te:return C.push("&",S.nodeName,";");default:C.push("??",S.nodeName)}}function ve(S,C,Q){var me;switch(C.nodeType){case I:(me=C.cloneNode(!1)).ownerDocument=S;case F:break;case E:Q=!0}if(me||(me=C.cloneNode(!1)),me.ownerDocument=S,me.parentNode=null,Q)for(var Be=C.firstChild;Be;)me.appendChild(ve(S,Be,Q)),Be=Be.nextSibling;return me}function we(S,C,Q){var me=new C.constructor;for(var Be in C)if(Object.prototype.hasOwnProperty.call(C,Be)){var Ke=C[Be];typeof Ke!="object"&&Ke!=me[Be]&&(me[Be]=Ke)}switch(C.childNodes&&(me.childNodes=new z),me.ownerDocument=S,me.nodeType){case I:var nt=C.attributes,at=me.attributes=new ge,dn=nt.length;at._ownerElement=me;for(var Mt=0;Mt
0},lookupPrefix:function(S){for(var C=this;C;){var Q=C._nsMap;if(Q){for(var me in Q)if(Object.prototype.hasOwnProperty.call(Q,me)&&Q[me]===S)return me}C=C.nodeType==E?C.ownerDocument:C.parentNode}return null},lookupNamespaceURI:function(S){for(var C=this;C;){var Q=C._nsMap;if(Q&&Object.prototype.hasOwnProperty.call(Q,S))return Q[S];C=C.nodeType==E?C.ownerDocument:C.parentNode}return null},isDefaultNamespace:function(S){return this.lookupPrefix(S)==null}},D(A,oe),D(A,oe.prototype),$.prototype={nodeName:"#document",nodeType:N,doctype:null,documentElement:null,_inc:1,insertBefore:function(S,C){if(S.nodeType==F){for(var Q=S.firstChild;Q;){var me=Q.nextSibling;this.insertBefore(Q,C),Q=me}return S}return Xt(this,S,C),S.ownerDocument=this,this.documentElement===null&&S.nodeType===I&&(this.documentElement=S),S},removeChild:function(S){return this.documentElement==S&&(this.documentElement=null),fe(this,S)},replaceChild:function(S,C){Xt(this,S,C,Lt),S.ownerDocument=this,C&&this.removeChild(C),He(S)&&(this.documentElement=S)},importNode:function(S,C){return ve(this,S,C)},getElementById:function(S){var C=null;return Y(this.documentElement,function(Q){if(Q.nodeType==I&&Q.getAttribute("id")==S)return C=Q,!0}),C},getElementsByClassName:function(S){var C=U(S);return new ce(this,function(Q){var me=[];return C.length>0&&Y(Q.documentElement,function(Be){if(Be!==Q&&Be.nodeType===I){var Ke=Be.getAttribute("class");if(Ke){var nt=S===Ke;if(!nt){var at=U(Ke);nt=C.every(w(at))}nt&&me.push(Be)}}}),me})},createElement:function(S){var C=new pt;return C.ownerDocument=this,C.nodeName=S,C.tagName=S,C.localName=S,C.childNodes=new z,(C.attributes=new ge)._ownerElement=C,C},createDocumentFragment:function(){var S=new bn;return S.ownerDocument=this,S.childNodes=new z,S},createTextNode:function(S){var C=new _t;return C.ownerDocument=this,C.appendData(S),C},createComment:function(S){var C=new jt;return C.ownerDocument=this,C.appendData(S),C},createCDATASection:function(S){var C=new mr;return C.ownerDocument=this,C.appendData(S),C},createProcessingInstruction:function(S,C){var Q=new Tt;return Q.ownerDocument=this,Q.tagName=Q.target=S,Q.nodeValue=Q.data=C,Q},createAttribute:function(S){var C=new Jt;return C.ownerDocument=this,C.name=S,C.nodeName=S,C.localName=S,C.specified=!0,C},createEntityReference:function(S){var C=new ut;return C.ownerDocument=this,C.nodeName=S,C},createElementNS:function(S,C){var Q=new pt,me=C.split(":"),Be=Q.attributes=new ge;return Q.childNodes=new z,Q.ownerDocument=this,Q.nodeName=C,Q.tagName=C,Q.namespaceURI=S,me.length==2?(Q.prefix=me[0],Q.localName=me[1]):Q.localName=C,Be._ownerElement=Q,Q},createAttributeNS:function(S,C){var Q=new Jt,me=C.split(":");return Q.ownerDocument=this,Q.nodeName=C,Q.name=C,Q.namespaceURI=S,Q.specified=!0,me.length==2?(Q.prefix=me[0],Q.localName=me[1]):Q.localName=C,Q}},y(,ドルoe),pt.prototype={nodeType:I,hasAttribute:function(S){return this.getAttributeNode(S)!=null},getAttribute:function(S){var C=this.getAttributeNode(S);return C&&C.value||""},getAttributeNode:function(S){return this.attributes.getNamedItem(S)},setAttribute:function(S,C){var Q=this.ownerDocument.createAttribute(S);Q.value=Q.nodeValue=""+C,this.setAttributeNode(Q)},removeAttribute:function(S){var C=this.getAttributeNode(S);C&&this.removeAttributeNode(C)},appendChild:function(S){return S.nodeType===F?this.insertBefore(S,null):it(this,S)},setAttributeNode:function(S){return this.attributes.setNamedItem(S)},setAttributeNodeNS:function(S){return this.attributes.setNamedItemNS(S)},removeAttributeNode:function(S){return this.attributes.removeNamedItem(S.nodeName)},removeAttributeNS:function(S,C){var Q=this.getAttributeNodeNS(S,C);Q&&this.removeAttributeNode(Q)},hasAttributeNS:function(S,C){return this.getAttributeNodeNS(S,C)!=null},getAttributeNS:function(S,C){var Q=this.getAttributeNodeNS(S,C);return Q&&Q.value||""},setAttributeNS:function(S,C,Q){var me=this.ownerDocument.createAttributeNS(S,C);me.value=me.nodeValue=""+Q,this.setAttributeNode(me)},getAttributeNodeNS:function(S,C){return this.attributes.getNamedItemNS(S,C)},getElementsByTagName:function(S){return new ce(this,function(C){var Q=[];return Y(C,function(me){me!==C&&me.nodeType==I&&(S==="*"||me.tagName==S)&&Q.push(me)}),Q})},getElementsByTagNameNS:function(S,C){return new ce(this,function(Q){var me=[];return Y(Q,function(Be){Be!==Q&&Be.nodeType===I&&(S==="*"||Be.namespaceURI===S)&&(C==="*"||Be.localName==C)&&me.push(Be)}),me})}},$.prototype.getElementsByTagName=pt.prototype.getElementsByTagName,$.prototype.getElementsByTagNameNS=pt.prototype.getElementsByTagNameNS,y(pt,oe),Jt.prototype.nodeType=E,y(Jt,oe),Xe.prototype={data:"",substringData:function(S,C){return this.data.substring(S,S+C)},appendData:function(S){S=this.data+S,this.nodeValue=this.data=S,this.length=S.length},insertData:function(S,C){this.replaceData(S,0,C)},appendChild:function(S){throw new Error(K[p])},deleteData:function(S,C){this.replaceData(S,C,"")},replaceData:function(S,C,Q){Q=this.data.substring(0,S)+Q+this.data.substring(S+C),this.nodeValue=this.data=Q,this.length=Q.length}},y(Xe,oe),_t.prototype={nodeName:"#text",nodeType:M,splitText:function(S){var C=this.data,Q=C.substring(S);C=C.substring(0,S),this.data=this.nodeValue=C,this.length=C.length;var me=this.ownerDocument.createTextNode(Q);return this.parentNode&&this.parentNode.insertBefore(me,this.nextSibling),me}},y(_t,Xe),jt.prototype={nodeName:"#comment",nodeType:k},y(jt,Xe),mr.prototype={nodeName:"#cdata-section",nodeType:H},y(mr,Xe),qn.prototype.nodeType=R,y(qn,oe),Hn.prototype.nodeType=Z,y(Hn,oe),sr.prototype.nodeType=V,y(sr,oe),ut.prototype.nodeType=te,y(ut,oe),bn.prototype.nodeName="#document-fragment",bn.prototype.nodeType=F,y(bn,oe),Tt.prototype.nodeType=X,y(Tt,oe),or.prototype.serializeToString=function(S,C,Q){return wt.call(S,C,Q)},oe.prototype.toString=wt;try{if(Object.defineProperty){let S=function(C){switch(C.nodeType){case I:case F:var Q=[];for(C=C.firstChild;C;)C.nodeType!==7&&C.nodeType!==8&&Q.push(S(C)),C=C.nextSibling;return Q.join("");default:return C.nodeValue}};Object.defineProperty(ce.prototype,"length",{get:function(){return ae(this),this.$$length}}),Object.defineProperty(oe.prototype,"textContent",{get:function(){return S(this)},set:function(C){switch(this.nodeType){case I:case F:for(;this.firstChild;)this.removeChild(this.firstChild);(C||String(C))&&this.appendChild(this.ownerDocument.createTextNode(C));break;default:this.data=C,this.value=C,this.nodeValue=C}}}),et=function(C,Q,me){C["$$"+Q]=me}}}catch{}je.DocumentType=qn,je.DOMException=B,je.DOMImplementation=se,je.Element=pt,je.Node=oe,je.NodeList=z,je.XMLSerializer=or},884:(Ve,je,Ae)=>{var Ie=Ae(29).freeze;je.XML_ENTITIES=Ie({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),je.html_entities=ie({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"\",brvbar:"¦",sect:"§",uml:" ̈",copy:"©",ordf:"a",laquo:"«",not:"¬",shy:"",reg:"®",macr:" ̄",deg:"°",plusmn:"±",sup2:"2",sup3:"3",acute:" ́",micro:"μ",para:"¶",middot:"·",cedil:" ̧",sup1:"1",ordm:"o",raquo:"»",frac14:"1⁄4",frac12:"1⁄2",frac34:"3⁄4",iquest:"¿",times:"
×
ばつ
",divide:"÷",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"θ",upsih:"Υ",piv:"π",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:" ̃",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:""",rdquo:""",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"...",permil:"‰",prime:"′",Prime:"′′",lsaquo:"‹",rsaquo:"›",oline:" ̅",euro:"€",trade:"TM",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}),je.entityMap=je.HTML_ENTITIES},331:(Ve,je,Ae)=>{var Ie=Ae(665);Ie.DOMImplementation,Ie.XMLSerializer,je.DOMParser=Ae(407).DOMParser},996:(Ve,je,Ae)=>{var Ie=Ae(29).NAMESPACE,O=/[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]/,ke=new RegExp("[\\-\\.0-9"+O.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),ie=new RegExp("^"+O.source+ke.source+"*(?::"+O.source+ke.source+"*)?$"),Ee=0,ye=1,U=2,w=3,D=4,y=5,A=6,I=7;function E(p,v){this.message=p,this.locator=v,Error.captureStackTrace&&Error.captureStackTrace(this,E)}function M(){}function H(p,v,P,B,z){function ce(it){if(it>65535){var pt=55296+((it-=65536)>>10),Jt=56320+(1023&it);return String.fromCharCode(pt,Jt)}return String.fromCharCode(it)}function ae(it){var pt=it.slice(1,-1);return Object.hasOwnProperty.call(P,pt)?P[pt]:pt.charAt(0)==="#"?ce(parseInt(pt.substr(1).replace("x","0x"))):(z.error("entity not found:"+it),it)}function ge(it){if(it>$){var pt=p.substring(,ドルit).replace(/&#?\w+;/g,ae);oe&&ue($),B.characters(pt,0,it-$),$=it}}function ue(it,pt){for(;it>=pe&&(pt=se.exec(p));)le=pt.index,pe=le+pt[0].length,oe.lineNumber++;oe.columnNumber=it-le+1}for(var le=0,pe=0,se=/.*(?:\r\n?|\n)|.*$/g,oe=B.locator,xe=[{currentNSMap:v}],Y={},$=0;;){try{var de=p.indexOf("<",$);if(de<0){if(!p.substr($).match(/^\s*$/)){var J=B.doc,ee=J.createTextNode(p.substr($));J.appendChild(ee),B.currentElement=ee}return}switch(de>$&&ge(de),p.charAt(de+1)){case"/":var fe=p.indexOf(">",de+3),Pe=p.substring(de+2,fe).replace(/[ \t\n\r]+$/g,""),Re=xe.pop();fe<0?(pe=p.substring(de+2).replace(/[\s<].*/,""),z.error("end tag name: "+Pe+" is not complete:"+Re.tagName),fe=de+1+Pe.length):Pe.match(/\s$?$=fe:ge(Math.max(de,$)+1)}}function te(p,v){return v.lineNumber=p.lineNumber,v.columnNumber=p.columnNumber,v}function V(p,v,P,B,z,ce){function ae(oe,xe,Y){P.attributeNames.hasOwnProperty(oe)&&ce.fatalError("Attribute "+oe+" redefined"),P.addValue(oe,xe.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,z),Y)}for(var ge,ue=++v,le=Ee;;){var pe=p.charAt(ue);switch(pe){case"=":if(le===ye)ge=p.slice(v,ue),le=w;else{if(le!==U)throw new Error("attribute equal must after attrName");le=w}break;case"'":case'"':if(le===w||le===ye){if(le===ye&&(ce.warning('attribute value must after "="'),ge=p.slice(v,ue)),v=ue+1,!((ue=p.indexOf(pe,v))>0))throw new Error("attribute value no end '"+pe+"' match");ae(ge,se=p.slice(v,ue),v-1),le=y}else{if(le!=D)throw new Error('attribute value must after "="');ae(ge,se=p.slice(v,ue),v),ce.warning('attribute "'+ge+'" missed start quot('+pe+")!!"),v=ue+1,le=y}break;case"/":switch(le){case Ee:P.setTagName(p.slice(v,ue));case y:case A:case I:le=I,P.closed=!0;case D:case ye:case U:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return ce.error("unexpected end of input"),le==Ee&&P.setTagName(p.slice(v,ue)),ue;case">":switch(le){case Ee:P.setTagName(p.slice(v,ue));case y:case A:case I:break;case D:case ye:(se=p.slice(v,ue)).slice(-1)==="/"&&(P.closed=!0,se=se.slice(0,-1));case U:le===U&&(se=ge),le==D?(ce.warning('attribute "'+se+'" missed quot(")!'),ae(ge,se,v)):((!Ie.isHTML(B[""])||!se.match(/^(?:disabled|checked|selected)$/i))&&ce.warning('attribute "'+se+'" missed value!! "'+se+'" instead!!'),ae(se,se,v));break;case w:throw new Error("attribute value missed!!")}return ue;case"":pe=" ";default:if(pe<=" ")switch(le){case Ee:P.setTagName(p.slice(v,ue)),le=A;break;case ye:ge=p.slice(v,ue),le=U;break;case D:var se=p.slice(v,ue);ce.warning('attribute "'+se+'" missed quot(")!!'),ae(ge,se,v);case y:le=A}else switch(le){case U:P.tagName,(!Ie.isHTML(B[""])||!ge.match(/^(?:disabled|checked|selected)$/i))&&ce.warning('attribute "'+ge+'" missed value!! "'+ge+'" instead2!!'),ae(ge,ge,v),v=ue,le=ye;break;case y:ce.warning('attribute space is required"'+ge+'"!!');case A:le=ye,v=ue;break;case w:le=D,v=ue;break;case I:throw new Error("elements closed character '/' and '>' must be connected to")}}ue++}}function X(p,v,P){for(var B=p.tagName,z=null,ce=p.length;ce--;){var ae=p[ce],ge=ae.qName,ue=ae.value;if((oe=ge.indexOf(":"))>0)var le=ae.prefix=ge.slice(0,oe),pe=ge.slice(oe+1),se=le==="xmlns"&&pe;else pe=ge,le=null,se=ge==="xmlns"&&"";ae.localName=pe,se!==!1&&(z==null&&(z={},R(P,P={})),P[se]=z[se]=ue,ae.uri=Ie.XMLNS,v.startPrefixMapping(se,ue))}for(ce=p.length;ce--;)(le=(ae=p[ce]).prefix)&&(le==="xml"&&(ae.uri=Ie.XML),le!=="xmlns"&&(ae.uri=P[le||""]));var oe;(oe=B.indexOf(":"))>0?(le=p.prefix=B.slice(0,oe),pe=p.localName=B.slice(oe+1)):(le=null,pe=p.localName=B);var xe=p.uri=P[le||""];if(v.startElement(xe,pe,B,p),!p.closed)return p.currentNSMap=P,p.localNSMap=z,!0;if(v.endElement(xe,pe,B),z)for(le in z)Object.prototype.hasOwnProperty.call(z,le)&&v.endPrefixMapping(le)}function k(p,v,P,B,z){if(/^(?:script|textarea)$/i.test(P)){var ce=p.indexOf("",v),ae=p.substring(v+1,ce);if(/[&<]/.test(ae))return/^script$/i.test(p)?(z.characters(ae,0,ae.length),ce):(ae=ae.replace(/&#?\w+;/g,b),z.characters(ae,0,ae.length),ce)}return v+1}function N(p,v,P,B){var z=B[P];return z==null&&((z=p.lastIndexOf(""))
",v+4))>v?(P.comment(p,v+4,z-v-4),z+3):(B.error("Unclosed comment"),-1):-1;if(p.substr(v+3,6)=="CDATA["){var z=p.indexOf("]]>",v+9);return P.startCDATA(),P.characters(p,v+9,z-v-9),P.endCDATA(),z+3}var ce=K(p,v),ae=ce.length;if(ae>1&&/!doctype/i.test(ce[0][0])){var ge=ce[1][0],ue=!1,le=!1;ae>3&&(/^public$/i.test(ce[2][0])?(ue=ce[3][0],le=ae>4&&ce[4][0]):/^system$/i.test(ce[2][0])&&(le=ce[3][0]));var pe=ce[ae-1];return P.startDTD(ge,ue,le),P.endDTD(),pe.index+pe[0].length}return-1}function Z(p,v,P){var B=p.indexOf("?>",v);if(B){var z=p.substring(v,B).match(/^<\?(\s*)\s*([\s\s]*?)\s*$/);return z?(z[0].length,P.processingInstruction(z[1],z[2]),B+2):-1}return-1}function L(){this.attributeNames={}}function K(p,v){var P,B=[],z=/'[^']+'|"[^"]+"|[^\s
\/=]+=?|(\/?\s*>|<)/g;for(z.lastindex=v,z.exec(p);p=z.exec(p);)if(b.push(p),p[1])return B}E.prototype=new Error,E.prototype.name=E.name,M.prototype={parse:function(p,v,P){var B=this.domBuilder;B.startDocument(),R(v,v={}),H(p,v,P,B,this.errorHandler),B.endDocument()}},L.prototype={setTagName:function(p){if(!ie.test(p))throw new Error("invalid tagName:"+p);this.tagName=p},addValue:function(p,v,P){if(!ie.test(p))throw new Error("invalid attribute:"+p);this.attributeNames[p]=this.length,this[this.length++]={qName:p,value:v,offset:P}},length:0,getLocalName:function(p){return this[p].localName},getLocator:function(p){return this[p].locator},getQName:function(p){return this[p].qName},getURI:function(p){return this[p].uri},getValue:function(p){return this[p].value}},je.XMLReader=M,je.ParseError=E},675:(Ve,je,Ae)=>{var Ie,O=Ae.g!==void 0?Ae.g:typeof window<"u"?window:{},ke=ae(893);typeof document<"u"?ie=document:(ie=o["__global_document_cache@4"])||(ie=o["__global_document_cache@4"]=ke),ve.exports=ie},697:(ve,je,ae)=>{var Ie;Ie=typeof window<"u"?window:ae.g!==void 0?Ae.g:typeof self<"u"?self:{},ve.exports=ie},988:ve=>{Ve.exports=Ae;var je=Object.prototype.toString;function Ae(Ie){if(!Ie)return!1;var O=je.call(Ie);return O==="[object Function]"||typeof Ie=="function"&&O!=="[object RegExp]"||typeof window<"u"&&(ie===window.settimeout||ie===window.alert||ie===window.confirm||ie===window.prompt)}},642:(ve,je)=>{function Ae(ye){if(ye&&typeof ye=="object"){var U=ye.which||ye.keyCode||ye.charCode;U&&(ye=U)}if(typeof ye=="number")return ie[ye];var w,D=String(ye);return(w=Ie[D.toLowerCase()])?w:(w=O[D.toLowerCase()])||(D.length===1?D.charCodeAt(0):void 0)}Ae.isEventKey=function(ye,U){if(ye&&typeof ye=="object"){var w=ye.which||ye.keyCode||ye.charCode;if(w==null)return!1;if(typeof U=="string"){var D;if((D=Ie[U.toLowerCase()])||(D=O[U.toLowerCase()]))return D===w}else if(typeof U=="number")return U===w;return!1}};var Ie=(je=Ve.exports=Ae).code=je.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},O=je.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};/*! * Programatically add the following */for(ke=97;ke<123;ke++)ie[string.fromcharcode(ke)]=ke-32;for(var ke=48;ke<58;ke++)ie[ke-48]=ke;for(ke=1;ke<13;ke++)ie["f"+ke]=ke+111;for(ke=0;ke<10;ke++)ie["numpad "+ke]=ke+96;var ie=je.names=je.title={};for(ke in Ie)ie[Ie[ke]]=ke;for(var Ee in O)Ie[Ee]=O[Ee]},656:(Ve,je,Ae)=>{var Ie=Ae(559).getUint64,O=function(ke){var ie=new DataView(ke.buffer,ke.byteOffset,ke.byteLength),Ee={version:ke[0],flags:new Uint8Array(ke.subarray(1,4)),references:[],referenceId:ie.getUint32(4),timescale:ie.getUint32(8)},ye=12;Ee.version===0?(Ee.earliestPresentationTime=ie.getUint32(ye),Ee.firstOffset=ie.getUint32(ye+4),ye+=8):(Ee.earliestPresentationTime=Ie(ke.subarray(ye)),Ee.firstOffset=Ie(ke.subarray(ye+8)),ye+=16),ye+=2;var U=ie.getUint16(ye);for(ye+=2;U>0;ye+=12,U--)Ee.references.push({referenceType:(128&ke[ye])>>>7,referencedSize:2147483647&ie.getUint32(ye),subsegmentDuration:ie.getUint32(ye+4),startsWithSap:!!(128&ke[ye+8]),sapType:(112&ke[ye+8])>>>4,sapDeltaTime:268435455&ie.getUint32(ye+8)});return Ee};Ve.exports=O},275:Ve=>{var je,Ae,Ie,O,ke,ie,Ee,ye=9e4;je=function(U){return U*ye},Ae=function(U,w){return U*w},Ie=function(U){return U/ye},O=function(U,w){return U/w},ke=function(U,w){return je(O(U,w))},ie=function(U,w){return Ae(Ie(U),w)},Ee=function(U,w,D){return Ie(D?U:U-w)},Ve.exports={ONE_SECOND_IN_TS:ye,secondsToVideoTs:je,secondsToAudioTs:Ae,videoTsToSeconds:Ie,audioTsToSeconds:O,audioTsToVideoTs:ke,videoTsToAudioTs:ie,metadataTsToSeconds:Ee}},559:Ve=>{var je=Math.pow(2,32),Ae=function(Ie){var O,ke=new DataView(Ie.buffer,Ie.byteOffset,Ie.byteLength);return ke.getBigUint64?(O=ke.getBigUint64(0))
{function je(Ae,Ie){var O,ke=null;try{O=JSON.parse(Ae,Ie)}catch(ie){ke=ie}return[ke,O]}Ve.exports=je},311:function(Ve){var je,Ae,Ie,O,ke;je=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))1円(?=((?:\/\/[^\/?#]*)?))2円(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))3円((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,Ae=/^(?=([^\/?#]*))1円([^]*)$/,Ie=/(?:\/|^)\.(?=\/)/g,O=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,ke={buildAbsoluteURL:function(ie,Ee,ye){if(ye=ye||{},ie=ie.trim(),!(Ee=Ee.trim())){if(!ye.alwaysNormalize)return ie;var U=ke.parseURL(ie);if(!U)throw new Error("Error trying to parse base URL.");return U.path=ke.normalizePath(U.path),ke.buildURLFromParts(U)}var w=ke.parseURL(Ee);if(!w)throw new Error("Error trying to parse relative URL.");if(w.scheme)return ye.alwaysNormalize?(w.path=ke.normalizePath(w.path),ke.buildURLFromParts(w)):Ee;var D=ke.parseURL(ie);if(!D)throw new Error("Error trying to parse base URL.");if(!D.netLoc&&D.path&&D.path[0]!=="/"){var y=Ae.exec(D.path);D.netLoc=y[1],D.path=y[2]}D.netLoc&&!D.path&&(D.path="/");var A={scheme:D.scheme,netLoc:w.netLoc,path:null,params:w.params,query:w.query,fragment:w.fragment};if(!w.netLoc&&(A.netLoc=D.netLoc,w.path[0]!=="/"))if(w.path){var I=D.path,E=I.substring(0,I.lastIndexOf("/")+1)+w.path;A.path=ke.normalizePath(E)}else A.path=D.path,w.params||(A.params=D.params,w.query||(A.query=D.query));return A.path===null&&(A.path=ye.alwaysNormalize?ke.normalizePath(w.path):w.path),ke.buildURLFromParts(A)},parseURL:function(ie){var Ee=je.exec(ie);return Ee?{scheme:Ee[1]||"",netLoc:Ee[2]||"",path:Ee[3]||"",params:Ee[4]||"",query:Ee[5]||"",fragment:Ee[6]||""}:null},normalizePath:function(ie){for(ie=ie.split("").reverse().join("").replace(Ie,"");ie.length!==(ie=ie.replace(O,"")).length;);return ie.split("").reverse().join("")},buildURLFromParts:function(ie){return ie.scheme+ie.netLoc+ie.path+ie.params+ie.query+ie.fragment}},Ve.exports=ke},323:(Ve,je,Ae)=>{Ae.r(je),Ae.d(je,{default:()=>Cg});var Ie=Ae(697),O=Ae.n(Ie),ke=Ae(675),ie=Ae.n(ke);function Ee(){return Ee=Object.assign?Object.assign.bind():function(t){for(var i=1;i
"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function X(t,i,r){return(X=V()?Reflect.construct.bind():function(e,n,a){var s=[null];s.push.apply(s,n);var o=new(Function.bind.apply(e,s));return a&&D(o,a.prototype),o}).apply(null,arguments)}function k(t,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(i&&i.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),i&&D(t,i)}var N=Ae(311),R=Ae.n(N),F="http://example.com",Z=function(t,i){if(/^[a-z]+:/i.test(i))return i;/^data:/.test(t)&&(t=O().location&&O().location.href||"");var r=typeof O().URL=="function",e=/^\/\//.test(t),n=!O().location&&!/\/\//i.test(t);if(r?t=new(O()).URL(t,O().location||F):/\/\//i.test(t)||(t=R().buildAbsoluteURL(O().location&&O().location.href||"",t)),r){var a=new URL(i,t);return n?a.href.slice(F.length):e?a.href.slice(a.protocol.length):a.href}return R().buildAbsoluteURL(t,i)};const L=Z;var K=function(){function t(){this.listeners={}}var i=t.prototype;return i.on=function(r,e){this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push(e)},i.off=function(r,e){if(!this.listeners[r])return!1;var n=this.listeners[r].indexOf(e);return this.listeners[r]=this.listeners[r].slice(0),this.listeners[r].splice(n,1),n>-1},i.trigger=function(r){var e=this.listeners[r];if(e)if(arguments.length===2)for(var n=e.length,a=0;a
-1;e=this.buffer.indexOf(` `))this.trigger("data",this.buffer.substring(0,e)),this.buffer=this.buffer.substring(e+1)},i}(K),ce=" ",ae=function(t){var i=/([0-9.]*)?@?([0-9.]*)?/.exec(t||""),r={};return i[1]&&(r.length=parseInt(i[1],10)),i[2]&&(r.offset=parseInt(i[2],10)),r},ge=function(){return new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')},ue=function(t){for(var i,r=t.split(ge()),e={},n=r.length;n--;)r[n]!==""&&((i=/([^=]*)=(.*)/.exec(r[n]).slice(1))[0]=i[0].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^['"](.*)['"]$/g,"1ドル"),e[i[0]]=i[1]);return e},le=function(t){function i(){var e;return(e=t.call(this)||this).customParsers=[],e.tagMappers=[],e}y(i,t);var r=i.prototype;return r.push=function(e){var n,a,s=this;if((e=e.trim()).length!==0){if(e[0]!=="#")return void this.trigger("data",{type:"uri",uri:e});this.tagMappers.reduce(function(o,l){var h=l(e);return h===e?o:o.concat([h])},[e]).forEach(function(o){for(var l=0;l
0&&(l.duration=re.duration),re.duration===0&&(l.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=o},key:function(){if(re.attributes)if(re.attributes.METHOD!=="NONE")if(re.attributes.URI){if(re.attributes.KEYFORMAT==="com.apple.streamingkeydelivery")return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:re.attributes});if(re.attributes.KEYFORMAT==="com.microsoft.playready")return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.microsoft.playready"]={uri:re.attributes.URI});if(re.attributes.KEYFORMAT===_)return["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(re.attributes.METHOD)===-1?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):(re.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),re.attributes.URI.substring(0,23)!=="data:text/plain;base64,"?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):re.attributes.KEYID&&re.attributes.KEYID.substring(0,2)==="0x"?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:re.attributes.KEYFORMAT,keyId:re.attributes.KEYID.substring(2)},pssh:v(re.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}));re.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),a={method:re.attributes.METHOD||"AES-128",uri:re.attributes.URI},re.attributes.IV!==void 0&&(a.iv=re.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else a=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){isFinite(re.number)?this.manifest.mediaSequence=re.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+re.number})},"discontinuity-sequence":function(){isFinite(re.number)?(this.manifest.discontinuitySequence=re.number,G=re.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+re.number})},"playlist-type":function(){/VOD|EVENT/.test(re.playlistType)?this.manifest.playlistType=re.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+re.playlist})},map:function(){n={},re.uri&&(n.uri=re.uri),re.byterange&&(n.byterange=re.byterange),a&&(n.key=a)},"stream-inf":function(){this.manifest.playlists=o,this.manifest.mediaGroups=this.manifest.mediaGroups||b,re.attributes?(l.attributes||(l.attributes={}),Ee(l.attributes,re.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||b,re.attributes&&re.attributes.TYPE&&re.attributes["GROUP-ID"]&&re.attributes.NAME){var Te=this.manifest.mediaGroups[re.attributes.TYPE];Te[re.attributes["GROUP-ID"]]=Te[re.attributes["GROUP-ID"]]||{},Ue=Te[re.attributes["GROUP-ID"]],(Ge={default:/yes/i.test(re.attributes.DEFAULT)}).default?Ge.autoselect=!0:Ge.autoselect=/yes/i.test(re.attributes.AUTOSELECT),re.attributes.LANGUAGE&&(Ge.language=re.attributes.LANGUAGE),re.attributes.URI&&(Ge.uri=re.attributes.URI),re.attributes["INSTREAM-ID"]&&(Ge.instreamId=re.attributes["INSTREAM-ID"]),re.attributes.CHARACTERISTICS&&(Ge.characteristics=re.attributes.CHARACTERISTICS),re.attributes.FORCED&&(Ge.forced=/yes/i.test(re.attributes.FORCED)),Ue[re.attributes.NAME]=Ge}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){G+=1,l.discontinuity=!0,this.manifest.discontinuityStarts.push(o.length)},"program-date-time":function(){this.manifest.dateTimeString===void 0&&(this.manifest.dateTimeString=re.dateTimeString,this.manifest.dateTimeObject=re.dateTimeObject),l.dateTimeString=re.dateTimeString,l.dateTimeObject=re.dateTimeObject},targetduration:function(){!isFinite(re.duration)||re.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+re.duration}):(this.manifest.targetDuration=re.duration,oe.call(this,this.manifest))},start:function(){re.attributes&&!isNaN(re.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:re.attributes["TIME-OFFSET"],precise:re.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){l.cueOut=re.data},"cue-out-cont":function(){l.cueOutCont=re.data},"cue-in":function(){l.cueIn=re.data},skip:function(){this.manifest.skip=se(re.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",re.attributes,["SKIPPED-SEGMENTS"])},part:function(){var Te=this;h=!0;var De=this.manifest.segments.length,Se=se(re.attributes);l.parts=l.parts||[],l.parts.push(Se),Se.byterange&&(Se.byterange.hasOwnProperty("offset")||(Se.byterange.offset=_e),_e=Se.byterange.offset+Se.byterange.length);var Me=l.parts.length-1;this.warnOnMissingAttributes_("#EXT-X-PART #"+Me+" for segment #"+De,re.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(function(Ce,ze){Ce.hasOwnProperty("lastPart")||Te.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+ze+" lacks required attribute(s): LAST-PART"})})},"server-control":function(){var Te=this.manifest.serverControl=se(re.attributes);Te.hasOwnProperty("canBlockReload")||(Te.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),oe.call(this,this.manifest),Te.canSkipDateranges&&!Te.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint":function(){var Te=this.manifest.segments.length,De=se(re.attributes),Se=De.type&&De.type==="PART";l.preloadHints=l.preloadHints||[],l.preloadHints.push(De),De.byterange&&(De.byterange.hasOwnProperty("offset")||(De.byterange.offset=Se?_e:0,Se&&(_e=De.byterange.offset+De.byterange.length)));var Me=l.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+Me+" for segment #"+Te,re.attributes,["TYPE","URI"]),De.type)for(var Ce=0;Ce
h&&(l-=h,l-=h,l-=_t(2))}return Number(l)},qn=function(t,i){var r={}.le,e=r!==void 0&&r;(typeof t!="bigint"&&typeof t!="number"||typeof t=="number"&&t!=t)&&(t=0),t=_t(t);for(var n=it(t),a=new Uint8Array(new ArrayBuffer(n)),s=0;s
=i.length&&l.call(i,function(h,g){return h===(o[g]?o[g]&t[a+g]:t[a+g])})},bn=function(t,i,r){i.forEach(function(e){for(var n in t.mediaGroups[e])for(var a in t.mediaGroups[e][n]){var s=t.mediaGroups[e][n][a];r(s,e,n,a)}})},Tt=Ae(331),or=function(t){return!!t&&typeof t=="object"},wt=function t(){for(var i=arguments.length,r=new Array(i),e=0;e
r.timeline?1:-1})},pn=function(t,i){for(var r=0;r
a.timeline||a.segments.length&&n.timeline>a.segments[a.segments.length-1].timeline)&&n.discontinuitySequence--);a.segments[o].discontinuity&&!s.discontinuity&&(s.discontinuity=!0,n.discontinuityStarts.unshift(0),n.discontinuitySequence--),Vt({playlist:n,mediaSequence:a.segments[o].number})}})},Dn=function(t){var i=t.oldManifest,r=t.newManifest,e=i.playlists.concat(on(i)),n=r.playlists.concat(on(r));return r.timelineStarts=hn([i.timelineStarts,r.timelineStarts]),Tn({oldPlaylists:e,newPlaylists:n,timelineStarts:r.timelineStarts}),r},Ln=function(t){return t&&t.uri+"-"+me(t.byterange)},fn=function(t){return Vn(t.reduce(function(i,r){var e,n=r.attributes.id+(r.attributes.lang||"");return i[n]?(r.segments&&(r.segments[0]&&(r.segments[0].discontinuity=!0),(e=i[n].segments).push.apply(e,r.segments)),r.attributes.contentProtection&&(i[n].attributes.contentProtection=r.attributes.contentProtection)):(i[n]=r,i[n].attributes.timelineStarts=[]),i[n].attributes.timelineStarts.push({start:r.attributes.periodStart,timeline:r.attributes.periodStart}),i},{})).map(function(i){return i.discontinuityStarts=we(i.segments||[],"discontinuity"),i})},Mn=function(t,i){var r=Ln(t.sidx),e=r&&i[r]&&i[r].sidx;return e&&Mt(t,e,t.sidx.resolvedUri),t},Fi=function(t,i){if(i===void 0&&(i={}),!Object.keys(i).length)return t;for(var r in t)t[r]=Mn(t[r],i);return t},si=function(t,i){var r,e=t.attributes,n=t.segments,a=t.sidx,s=t.mediaSequence,o=t.discontinuitySequence,l=t.discontinuityStarts,h={attributes:(r={NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs},r["PROGRAM-ID"]=1,r),uri:"",endList:e.type==="static",timeline:e.periodStart,resolvedUri:"",targetDuration:e.duration,discontinuitySequence:o,discontinuityStarts:l,timelineStarts:e.timelineStarts,mediaSequence:s,segments:n};return e.contentProtection&&(h.contentProtection=e.contentProtection),a&&(h.sidx=a),i&&(h.attributes.AUDIO="audio",h.attributes.SUBTITLES="subs"),h},qi=function(t){var i,r=t.attributes,e=t.segments,n=t.mediaSequence,a=t.discontinuityStarts,s=t.discontinuitySequence;e===void 0&&(e=[{uri:r.baseUrl,timeline:r.periodStart,resolvedUri:r.baseUrl||"",duration:r.sourceDuration,number:0}],r.duration=r.sourceDuration);var o=((i={NAME:r.id,BANDWIDTH:r.bandwidth})["PROGRAM-ID"]=1,i);return r.codecs&&(o.CODECS=r.codecs),{attributes:o,uri:"",endList:r.type==="static",timeline:r.periodStart,resolvedUri:r.baseUrl||"",targetDuration:r.duration,timelineStarts:r.timelineStarts,discontinuityStarts:a,discontinuitySequence:s,mediaSequence:n,segments:e}},oi=function(t,i,r){i===void 0&&(i={}),r===void 0&&(r=!1);var e,n=t.reduce(function(a,s){var o=s.attributes.role&&s.attributes.role.value||"",l=s.attributes.lang||"",h=s.attributes.label||"main";if(l&&!s.attributes.label){var g=o?" ("+o+")":"";h=""+s.attributes.lang+g}a[h]||(a[h]={language:l,autoselect:!0,default:o==="main",playlists:[],uri:""});var b=Mn(si(s,r),i);return a[h].playlists.push(b),e===void 0&&o==="main"&&((e=s).default=!0),a},{});return e||(n[Object.keys(n)[0]].default=!0),n},ur=function(t,i){return i===void 0&&(i={}),t.reduce(function(r,e){var n=e.attributes.lang||"text";return r[n]||(r[n]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),r[n].playlists.push(Mn(qi(e),i)),r},{})},Or=function(t){return t.reduce(function(i,r){return r&&r.forEach(function(e){var n=e.channel,a=e.language;i[a]={autoselect:!1,default:!1,instreamId:n,language:a},e.hasOwnProperty("aspectRatio")&&(i[a].aspectRatio=e.aspectRatio),e.hasOwnProperty("easyReader")&&(i[a].easyReader=e.easyReader),e.hasOwnProperty("3D")&&(i[a]["3D"]=e["3D"])}),i},{})},rs=function(t){var i,r=t.attributes,e=t.segments,n=t.sidx,a=t.discontinuityStarts,s={attributes:(i={NAME:r.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:r.width,height:r.height},CODECS:r.codecs,BANDWIDTH:r.bandwidth},i["PROGRAM-ID"]=1,i),uri:"",endList:r.type==="static",timeline:r.periodStart,resolvedUri:"",targetDuration:r.duration,discontinuityStarts:a,timelineStarts:r.timelineStarts,segments:e};return r.frameRate&&(s.attributes["FRAME-RATE"]=r.frameRate),r.contentProtection&&(s.contentProtection=r.contentProtection),n&&(s.sidx=n),s},Hi=function(t){var i=t.attributes;return i.mimeType==="video/mp4"||i.mimeType==="video/webm"||i.contentType==="video"},Bd=function(t){var i=t.attributes;return i.mimeType==="audio/mp4"||i.mimeType==="audio/webm"||i.contentType==="audio"},jd=function(t){var i=t.attributes;return i.mimeType==="text/vtt"||i.contentType==="text"},Fd=function(t,i){t.forEach(function(r){r.mediaSequence=0,r.discontinuitySequence=et(i,function(e){return e.timeline===r.timeline}),r.segments&&r.segments.forEach(function(e,n){e.number=n})})},Vo=function(t){return t?Object.keys(t).reduce(function(i,r){var e=t[r];return i.concat(e.playlists)},[]):[]},qd=function(t){var i,r=t.dashPlaylists,e=t.locations,n=t.sidxMapping,a=n===void 0?{}:n,s=t.previousManifest;if(!r.length)return{};var o=r[0].attributes,l=o.sourceDuration,h=o.type,g=o.suggestedPresentationDelay,b=o.minimumUpdatePeriod,_=fn(r.filter(Hi)).map(rs),G=fn(r.filter(Bd)),ne=fn(r.filter(jd)),_e=r.map(function(Me){return Me.attributes.captionServices}).filter(Boolean),re={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(i={AUDIO:{},VIDEO:{}},i["CLOSED-CAPTIONS"]={},i.SUBTITLES={},i),uri:"",duration:l,playlists:Fi(_,a)};b>=0&&(re.minimumUpdatePeriod=1e3*b),e&&(re.locations=e),h==="dynamic"&&(re.suggestedPresentationDelay=g);var Ue=re.playlists.length===0,Ge=G.length?oi(G,a,Ue):null,Te=ne.length?ur(ne,a):null,De=_.concat(Vo(Ge),Vo(Te)),Se=De.map(function(Me){return Me.timelineStarts});return re.timelineStarts=hn(Se),Fd(De,re.timelineStarts),Ge&&(re.mediaGroups.AUDIO.audio=Ge),Te&&(re.mediaGroups.SUBTITLES.subs=Te),_e.length&&(re.mediaGroups["CLOSED-CAPTIONS"].cc=Or(_e)),s?Dn({oldManifest:s,newManifest:re}):re},Hd=function(t,i,r){var e=t.NOW,n=t.clientOffset,a=t.availabilityStartTime,s=t.timescale,o=s===void 0?1:s,l=t.periodStart,h=l===void 0?0:l,g=t.minimumUpdatePeriod,b=(e+n)/1e3+(g===void 0?0:g)-(a+h);return Math.ceil((b*o-i)/r)},Wo=function(t,i){for(var r=t.type,e=t.minimumUpdatePeriod,n=e===void 0?0:e,a=t.media,s=a===void 0?"":a,o=t.sourceDuration,l=t.timescale,h=l===void 0?1:l,g=t.startNumber,b=g===void 0?1:g,_=t.periodStart,G=[],ne=-1,_e=0;_e
ne&&(ne=Te);var De=void 0;if(Ge<0){var Se=_e+1;De=Se===i.length?r==="dynamic"&&n>0&&s.indexOf("$Number$")>0?Hd(t,ne,Ue):(o*h-ne)/Ue:(i[Se].t-ne)/Ue}else De=Ge+1;for(var Me=b+G.length+De,Ce=b+G.length;Ce
=n)?a:""+new Array(n-a.length+1).join("0")+a}},Go=function(t,i){return t.replace(Vd,Wd(i))},Gd=function(t,i){return t.duration||i?t.duration?at(t):Wo(t,i):[{number:t.startNumber||1,duration:t.sourceDuration,time:0,timeline:t.periodStart}]},zd=function(t,i){var r={RepresentationID:t.id,Bandwidth:t.bandwidth||0},e=t.initialization,n=e===void 0?{sourceURL:"",range:""}:e,a=Q({baseUrl:t.baseUrl,source:Go(n.sourceURL,r),range:n.range});return Gd(t,i).map(function(s){r.Number=s.number,r.Time=s.time;var o=Go(t.media||"",r),l=t.timescale||1,h=t.presentationTimeOffset||0,g=t.periodStart+(s.time-h)/l;return{uri:o,timeline:s.timeline,duration:s.duration,resolvedUri:L(t.baseUrl||"",o),map:a,number:s.number,presentationTime:g}})},Xd=function(t,i){var r=t.baseUrl,e=t.initialization,n=e===void 0?{}:e,a=Q({baseUrl:r,source:n.sourceURL,range:n.range}),s=Q({baseUrl:r,source:i.media,range:i.mediaRange});return s.map=a,s},Kd=function(t,i){var r=t.duration,e=t.segmentUrls,n=e===void 0?[]:e,a=t.periodStart;if(!r&&!i||r&&i)throw new Error(C.SEGMENT_TIME_UNSPECIFIED);var s,o=n.map(function(l){return Xd(t,l)});return r&&(s=at(t)),i&&(s=Wo(t,i)),s.map(function(l,h){if(o[h]){var g=o[h],b=t.timescale||1,_=t.presentationTimeOffset||0;return g.timeline=l.timeline,g.duration=l.duration,g.number=l.number,g.presentationTime=a+(l.time-_)/b,g}}).filter(function(l){return l})},Qd=function(t){var i,r,e=t.attributes,n=t.segmentInfo;n.template?(r=zd,i=wt(e,n.template)):n.base?(r=dn,i=wt(e,n.base)):n.list&&(r=Kd,i=wt(e,n.list));var a={attributes:e};if(!r)return a;var s=r(i,n.segmentTimeline);if(i.duration){var o=i,l=o.duration,h=o.timescale,g=h===void 0?1:h;i.duration=l/g}else s.length?i.duration=s.reduce(function(b,_){return Math.max(b,Math.ceil(_.duration))},0):i.duration=0;return a.attributes=i,a.segments=s,n.base&&i.indexRange&&(a.sidx=s[0],a.segments=[]),a},Yd=function(t){return t.map(Qd)},kt=function(t,i){return ve(t.childNodes).filter(function(r){return r.tagName===i})},is=function(t){return t.textContent.trim()},$d=function(t){return parseFloat(t.split("/").reduce(function(i,r){return i/r}))},Dr=function(t){var i=31536e3,r=2592e3,e=86400,n=3600,a=60,s=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(t);if(!s)return 0;var o=s.slice(1),l=o[0],h=o[1],g=o[2],b=o[3],_=o[4],G=o[5];return parseFloat(l||0)*i+parseFloat(h||0)*r+parseFloat(g||0)*e+parseFloat(b||0)*n+parseFloat(_||0)*a+parseFloat(G||0)},Jd=function(t){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t)&&(t+="Z"),Date.parse(t)},zo={mediaPresentationDuration:function(t){return Dr(t)},availabilityStartTime:function(t){return Jd(t)/1e3},minimumUpdatePeriod:function(t){return Dr(t)},suggestedPresentationDelay:function(t){return Dr(t)},type:function(t){return t},timeShiftBufferDepth:function(t){return Dr(t)},start:function(t){return Dr(t)},width:function(t){return parseInt(t,10)},height:function(t){return parseInt(t,10)},bandwidth:function(t){return parseInt(t,10)},frameRate:function(t){return $d(t)},startNumber:function(t){return parseInt(t,10)},timescale:function(t){return parseInt(t,10)},presentationTimeOffset:function(t){return parseInt(t,10)},duration:function(t){var i=parseInt(t,10);return isNaN(i)?Dr(t):i},d:function(t){return parseInt(t,10)},t:function(t){return parseInt(t,10)},r:function(t){return parseInt(t,10)},DEFAULT:function(t){return t}},Kt=function(t){return t&&t.attributes?ve(t.attributes).reduce(function(i,r){var e=zo[r.name]||zo.DEFAULT;return i[r.name]=e(r.value),i},{}):{}},Zd={"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"},Vi=function(t,i){return i.length?cn(t.map(function(r){return i.map(function(e){return L(r,is(e))})})):t},as=function(t){var i=kt(t,"SegmentTemplate")[0],r=kt(t,"SegmentList")[0],e=r&&kt(r,"SegmentURL").map(function(b){return wt({tag:"SegmentURL"},Kt(b))}),n=kt(t,"SegmentBase")[0],a=r||i,s=a&&kt(a,"SegmentTimeline")[0],o=r||n||i,l=o&&kt(o,"Initialization")[0],h=i&&Kt(i);h&&l?h.initialization=l&&Kt(l):h&&h.initialization&&(h.initialization={sourceURL:h.initialization});var g={template:h,segmentTimeline:s&&kt(s,"S").map(function(b){return Kt(b)}),list:r&&wt(Kt(r),{segmentUrls:e,initialization:Kt(l)}),base:n&&wt(Kt(n),{initialization:Kt(l)})};return Object.keys(g).forEach(function(b){g[b]||delete g[b]}),g},eh=function(t,i,r){return function(e){var n=kt(e,"BaseURL"),a=Vi(i,n),s=wt(t,Kt(e)),o=as(e);return a.map(function(l){return{segmentInfo:wt(r,o),attributes:wt(s,{baseUrl:l})}})}},th=function(t){return t.reduce(function(i,r){var e=Kt(r);e.schemeIdUri&&(e.schemeIdUri=e.schemeIdUri.toLowerCase());var n=Zd[e.schemeIdUri];if(n){i[n]={attributes:e};var a=kt(r,"cenc:pssh")[0];if(a){var s=is(a);i[n].pssh=s&&v(s)}}return i},{})},nh=function(t){return t.schemeIdUri==="urn:scte:dash:cc:cea-608:2015"?(typeof t.value!="string"?[]:t.value.split(";")).map(function(i){var r,e;if(e=i,/^CC\d=/.test(i)){var n=i.split("=");r=n[0],e=n[1]}else/^CC\d$/.test(i)&&(r=i);return{channel:r,language:e}}):t.schemeIdUri==="urn:scte:dash:cc:cea-708:2015"?(typeof t.value!="string"?[]:t.value.split(";")).map(function(i){var r={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(i)){var e=i.split("="),n=e[0],a=e[1],s=a===void 0?"":a;r.channel=n,r.language=i,s.split(",").forEach(function(o){var l=o.split(":"),h=l[0],g=l[1];h==="lang"?r.language=g:h==="er"?r.easyReader=Number(g):h==="war"?r.aspectRatio=Number(g):h==="3D"&&(r["3D"]=Number(g))})}else r.language=i;return r.channel&&(r.channel="SERVICE"+r.channel),r}):void 0},rh=function(t,i,r){return function(e){var n=Kt(e),a=Vi(i,kt(e,"BaseURL")),s=kt(e,"Role")[0],o={role:Kt(s)},l=wt(t,n,o),h=kt(e,"Accessibility")[0],g=nh(Kt(h));g&&(l=wt(l,{captionServices:g}));var b=kt(e,"Label")[0];if(b&&b.childNodes.length){var _=b.childNodes[0].nodeValue.trim();l=wt(l,{label:_})}var G=th(kt(e,"ContentProtection"));Object.keys(G).length&&(l=wt(l,{contentProtection:G}));var ne=as(e),_e=kt(e,"Representation"),re=wt(r,ne);return cn(_e.map(eh(l,a,re)))}},ih=function(t,i){return function(r,e){var n=Vi(i,kt(r.node,"BaseURL")),a=wt(t,{periodStart:r.attributes.start});typeof r.attributes.duration=="number"&&(a.periodDuration=r.attributes.duration);var s=kt(r.node,"AdaptationSet"),o=as(r.node);return cn(s.map(rh(a,n,o)))}},ah=function(t){var i=t.attributes,r=t.priorPeriodAttributes,e=t.mpdType;return typeof i.start=="number"?i.start:r&&typeof r.start=="number"&&typeof r.duration=="number"?r.start+r.duration:r||e!=="static"?null:0},sh=function(t,i){i===void 0&&(i={});var r=i,e=r.manifestUri,n=e===void 0?"":e,a=r.NOW,s=a===void 0?Date.now():a,o=r.clientOffset,l=o===void 0?0:o,h=kt(t,"Period");if(!h.length)throw new Error(C.INVALID_NUMBER_OF_PERIOD);var g=kt(t,"Location"),b=Kt(t),_=Vi([n],kt(t,"BaseURL"));b.type=b.type||"static",b.sourceDuration=b.mediaPresentationDuration||0,b.NOW=s,b.clientOffset=l,g.length&&(b.locations=g.map(is));var G=[];return h.forEach(function(ne,_e){var re=Kt(ne),Ue=G[_e-1];re.start=ah({attributes:re,priorPeriodAttributes:Ue?Ue.attributes:null,mpdType:b.type}),G.push({node:ne,attributes:re})}),{locations:b.locations,representationInfo:cn(G.map(ih(b,_)))}},Xo=function(t){if(t==="")throw new Error(C.DASH_EMPTY_MANIFEST);var i,r,e=new Tt.DOMParser;try{r=(i=e.parseFromString(t,"application/xml"))&&i.documentElement.tagName==="MPD"?i.documentElement:null}catch{}if(!r||r&&r.getElementsByTagName("parsererror").length>0)throw new Error(C.DASH_INVALID_XML);return r},oh=function(t){var i=kt(t,"UTCTiming")[0];if(!i)return null;var r=Kt(i);switch(r.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":r.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":r.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":r.method="DIRECT",r.value=Date.parse(r.value);break;default:throw new Error(C.UNSUPPORTED_UTC_TIMING_SCHEME)}return r},uh=function(t,i){i===void 0&&(i={});var r=sh(Xo(t),i),e=Yd(r.representationInfo);return qd({dashPlaylists:e,locations:r.locations,sidxMapping:i.sidxMapping,previousManifest:i.previousManifest})},lh=function(t){return oh(Xo(t))},ch=Ae(656),dh=Ae.n(ch),hh=Xe([73,68,51]),ph=function(t,i){i===void 0&&(i=0);var r=(t=Xe(t))[i+5],e=t[i+6]<<21|t[i+7]<<14|t[i+8]<<7|t[i+9];return(16&r)>>4?e+20:e+10},ui=function t(i,r){return r===void 0&&(r=0),(i=Xe(i)).length-r<10||!ut(i,hh,{offset:r})?r:t(i,r+=ph(i,r))},ko=function(t){return typeof t=="string"?Hn(t):t},fh=function(t){return Array.isArray(t)?t.map(function(i){return Ko(i)}):[Ko(t)]},mh=function t(i,r,e){e===void 0&&(e=!1),r=fh(r),i=Xe(i);var n=[];if(!r.length)return n;for(var a=0;a
>>0,o=i.subarray(a+4,a+8);if(s===0)break;var l=a+s;if(l>i.length){if(e)break;l=i.length}var h=i.subarray(a+8,l);ut(o,r[0])&&(r.length===1?n.push(h):n.push.apply(n,t(h,r.slice(1),e))),a=l}return n},Wi={EBML:Xe([26,69,223,163]),DocType:Xe([66,130]),Segment:Xe([24,83,128,103]),SegmentInfo:Xe([21,73,169,102]),Tracks:Xe([22,84,174,107]),Track:Xe([174]),TrackNumber:Xe([215]),DefaultDuration:Xe([35,227,131]),TrackEntry:Xe([174]),TrackType:Xe([131]),FlagDefault:Xe([136]),CodecID:Xe([134]),CodecPrivate:Xe([99,162]),VideoTrack:Xe([224]),AudioTrack:Xe([225]),Cluster:Xe([31,67,182,117]),Timestamp:Xe([231]),TimestampScale:Xe([42,215,177]),BlockGroup:Xe([160]),BlockDuration:Xe([155]),Block:Xe([161]),SimpleBlock:Xe([163])},ss=[128,64,32,16,8,4,2,1],gh=function(t){for(var i=1,r=0;r
=r.length)return r.length;var n=Gi(r,e,!1);if(ut(i.bytes,n.bytes))return e;var a=Gi(r,e+n.length);return t(i,r,e+a.length+a.value+n.length)},Yo=function t(i,r){r=vh(r),i=Xe(i);var e=[];if(!r.length)return e;for(var n=0;n
i.length?i.length:o+s.value,h=i.subarray(o,l);ut(r[0],a.bytes)&&(r.length===1?e.push(h):e=e.concat(t(h,r.slice(1)))),n+=a.length+s.length+h.length}return e},_h=Xe([0,0,0,1]),bh=Xe([0,0,1]),Th=Xe([0,0,3]),Sh=function(t){for(var i=[],r=1;r
>1&63),r.indexOf(l)!==-1&&(n=a+o),a+=o+(i==="h264"?1:2)}else a++}return t.subarray(0,0)},Eh=function(t,i,r){return $o(t,"h264",i,r)},wh=function(t,i,r){return $o(t,"h265",i,r)},Zt={webm:Xe([119,101,98,109]),matroska:Xe([109,97,116,114,111,115,107,97]),flac:Xe([102,76,97,67]),ogg:Xe([79,103,103,83]),ac3:Xe([11,119]),riff:Xe([82,73,70,70]),avi:Xe([65,86,73]),wav:Xe([87,65,86,69]),"3gp":Xe([102,116,121,112,51,103]),mp4:Xe([102,116,121,112]),fmp4:Xe([115,116,121,112]),mov:Xe([102,116,121,112,113,116]),moov:Xe([109,111,111,118]),moof:Xe([109,111,111,102])},Lr={aac:function(t){var i=ui(t);return ut(t,[255,16],{offset:i,mask:[255,22]})},mp3:function(t){var i=ui(t);return ut(t,[255,2],{offset:i,mask:[255,6]})},webm:function(t){var i=Yo(t,[Wi.EBML,Wi.DocType])[0];return ut(i,Zt.webm)},mkv:function(t){var i=Yo(t,[Wi.EBML,Wi.DocType])[0];return ut(i,Zt.matroska)},mp4:function(t){return!Lr["3gp"](t)&&!Lr.mov(t)&&(!!(ut(t,Zt.mp4,{offset:4})||ut(t,Zt.fmp4,{offset:4})||ut(t,Zt.moof,{offset:4})||ut(t,Zt.moov,{offset:4}))||void 0)},mov:function(t){return ut(t,Zt.mov,{offset:4})},"3gp":function(t){return ut(t,Zt["3gp"],{offset:4})},ac3:function(t){var i=ui(t);return ut(t,Zt.ac3,{offset:i})},ts:function(t){if(t.length<189&&t.length>=1)return t[0]===71;for(var i=0;i+188
0},zi=Ae(275);function Jo(t){return(Jo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(i){return i.__proto__||Object.getPrototypeOf(i)})(t)}function xh(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function ls(t){var i=typeof Map=="function"?new Map:void 0;return ls=function(r){if(r===null||!xh(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(i!==void 0){if(i.has(r))return i.get(r);i.set(r,e)}function e(){return X(r,arguments,Jo(this).constructor)}return e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),D(e,r)},ls(t);/** * @license * Video.js 7.21.2
* Copyright Brightcove, Inc.
* Available under Apache License Version 2.0 *
* * Includes vtt.js
* Available under Apache License Version 2.0 *
*/}for(var li,Zo="7.21.2",zn={},lr=function(t,i){return zn[t]=zn[t]||[],i&&(zn[t]=zn[t].concat(i)),zn[t]},Ih=function(t,i){lr(t,i)},eu=function(t,i){var r=lr(t).indexOf(i);return!(r<=-1||(zn[t]=zn[t].slice(),zn[t].splice(r,1),0))},ah=function(t,i){lr(t,[].concat(i).map(function(r){var e=function n(){return eu(t,n),r.apply(void 0,arguments)};return e}))},Xi={prefixed:!0},Ki=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],tu=Ki[0],Qi=0;Qi
0?o:0)}if(O().console){var l=O().console[r];!l&&r==="debug"&&(l=O().console.info||O().console.log),l&&a&&s.test(r)&&l[Array.isArray(n)?"apply":"call"](O().console,n)}}};function nu(t){var i,r="info",e=function(){for(var n=arguments.length,a=new Array(n),s=0;s
1?i-1:0),e=1;e
=0)throw new Error("class has illegal whitespace characters")}function Nh(t){return new RegExp("(^|\\s)"+t+"($|\\s)")}function Nr(){return ie()===O().document}function Ur(t){return Xn(t)&&t.nodeType===1}function pu(){try{return O().parent!==O().self}catch{return!0}}function fu(t){return function(i,r){if(!du(i))return ie()[t](null);du(r)&&(r=ie().querySelector(r));var e=Ur(r)?r:ie();return e[t]&&e[t](i)}}function st(t,i,r,e){t===void 0&&(t="div"),i===void 0&&(i={}),r===void 0&&(r={});var n=ie().createElement(t);return Object.getOwnPropertyNames(i).forEach(function(a){var s=i[a];a.indexOf("aria-")!==-1||a==="role"||a==="type"?(Je.warn(`Setting attributes in the second argument of createEl() has been deprecated. Use the third argument instead. createEl(type, properties, attributes). Attempting to set `+a+" to "+s+"."),n.setAttribute(a,s)):a==="textContent"?gr(n,s):(n[a]!==s||a==="tabIndex")&&(n[a]=s)}),Object.getOwnPropertyNames(r).forEach(function(a){n.setAttribute(a,r[a])}),e&&gs(n,e),n}function gr(t,i){return t.textContent===void 0?t.innerText=i:t.textContent=i,t}function fs(t,i){i.firstChild?i.insertBefore(t,i.firstChild):i.appendChild(t)}function vr(t,i){return hu(i),t.classList?t.classList.contains(i):Nh(i).test(t.className)}function Yn(t,i){return t.classList?t.classList.add(i):vr(t,i)||(t.className=(t.className+" "+i).trim()),t}function fi(t,i){return t?(t.classList?t.classList.remove(i):(hu(i),t.className=t.className.split(/\s+/).filter(function(r){return r!==i}).join(" ")),t):(Je.warn("removeClass was called with an element that doesn't exist"),null)}function mu(t,i,r){var e=vr(t,i);if(typeof r=="function"&&(r=r(t,i)),typeof r!="boolean"&&(r=!e),r!==e)return r?Yn(t,i):fi(t,i),t}function gu(t,i){Object.getOwnPropertyNames(i).forEach(function(r){var e=i[r];e==null||e===!1?t.removeAttribute(r):t.setAttribute(r,e===!0?"":e)})}function $n(t){var i={},r=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(t&&t.attributes&&t.attributes.length>0)for(var e=t.attributes,n=e.length-1;n>=0;n--){var a=e[n].name,s=e[n].value;(typeof t[a]=="boolean"||r.indexOf(","+a+",")!==-1)&&(s=s!==null),i[a]=s}return i}function vu(t,i){return t.getAttribute(i)}function Br(t,i,r){t.setAttribute(i,r)}function Ji(t,i){t.removeAttribute(i)}function yu(){ie().body.focus(),ie().onselectstart=function(){return!1}}function _u(){ie().onselectstart=function(){return!0}}function jr(t){if(t&&t.getBoundingClientRect&&t.parentNode){var i=t.getBoundingClientRect(),r={};return["bottom","height","left","right","top","width"].forEach(function(e){i[e]!==void 0&&(r[e]=i[e])}),r.height||(r.height=parseFloat(di(t,"height"))),r.width||(r.width=parseFloat(di(t,"width"))),r}}function mi(t){if(!t||t&&!t.offsetParent)return{left:0,top:0,width:0,height:0};for(var i=t.offsetWidth,r=t.offsetHeight,e=0,n=0;t.offsetParent&&t!==ie()[Xi.fullscreenElement];)e+=t.offsetLeft,n+=t.offsetTop,t=t.offsetParent;return{left:e,top:n,width:i,height:r}}function Zi(t,i){var r={x:0,y:0};if(en)for(var e=t;e&&e.nodeName.toLowerCase()!=="html";){var n=di(e,"transform");if(/^matrix/.test(n)){var a=n.slice(7,-1).split(/,\s/).map(Number);r.x+=a[4],r.y+=a[5]}else if(/^matrix3d/.test(n)){var s=n.slice(9,-1).split(/,\s/).map(Number);r.x+=s[12],r.y+=s[13]}e=e.parentNode}var o={},l=mi(i.target),h=mi(t),g=h.width,b=h.height,_=i.offsetY-(h.top-l.top),G=i.offsetX-(h.left-l.left);return i.changedTouches&&(G=i.changedTouches[0].pageX-h.left,_=i.changedTouches[0].pageY+h.top,en&&(G-=r.x,_-=r.y)),o.y=1-Math.max(0,Math.min(1,_/b)),o.x=Math.max(0,Math.min(1,G/g)),o}function bu(t){return Xn(t)&&t.nodeType===3}function ms(t){for(;t.firstChild;)t.removeChild(t.firstChild);return t}function Tu(t){return typeof t=="function"&&(t=t()),(Array.isArray(t)?t:[t]).map(function(i){return typeof i=="function"&&(i=i()),Ur(i)||bu(i)?i:typeof i=="string"&&/\S/.test(i)?ie().createTextNode(i):void 0}).filter(function(i){return i})}function gs(t,i){return Tu(i).forEach(function(r){return t.appendChild(r)}),t}function Su(t,i){return gs(ms(t),i)}function gi(t){return t.button===void 0&&t.buttons===void 0||t.button===0&&t.buttons===void 0||t.type==="mouseup"&&t.button===0&&t.buttons===0||!(t.button!==0||t.buttons!==1)}var vs,cr=fu("querySelector"),Eu=fu("querySelectorAll"),wu=Object.freeze({__proto__:null,isReal:Nr,isEl:Ur,isInFrame:pu,createEl:st,textContent:gr,prependTo:fs,hasClass:vr,addClass:Yn,removeClass:fi,toggleClass:mu,setAttributes:gu,getAttributes:$n,getAttribute:vu,setAttribute:Br,removeAttribute:Ji,blockTextSelection:yu,unblockTextSelection:_u,getBoundingClientRect:jr,findPosition:mi,getPointerPosition:Zi,isTextNode:bu,emptyEl:ms,normalizeContent:Tu,appendContent:gs,insertContent:Su,isSingleLeftClick:gi,$:cr,$$:Eu}),ku=!1,Uh=function(){if(vs.options.autoSetup!==!1){var t=Array.prototype.slice.call(ie().getElementsByTagName("video")),i=Array.prototype.slice.call(ie().getElementsByTagName("audio")),r=Array.prototype.slice.call(ie().getElementsByTagName("video-js")),e=t.concat(i,r);if(e&&e.length>0)for(var n=0,a=e.length;n
-1&&(n={passive:!0}),t.addEventListener(i,e.dispatcher,n)}else t.attachEvent&&t.attachEvent("on"+i,e.dispatcher)}function Qt(t,i,r){if(tn.has(t)){var e=tn.get(t);if(e.handlers){if(Array.isArray(i))return bs(Qt,t,i,r);var n=function(l,h){e.handlers[h]=[],Au(l,h)};if(i===void 0){for(var a in e.handlers)Object.prototype.hasOwnProperty.call(e.handlers||{},a)&&n(t,a);return}var s=e.handlers[i];if(s){if(!r)return void n(t,i);if(r.guid)for(var o=0;o
=i&&(t.apply(void 0,arguments),r=n)};return e},Hh=function(t,i,r,e){e===void 0&&(e=O());var n,a=function(){e.clearTimeout(n),n=null},s=function(){var o=this,l=arguments,h=function(){n=null,h=null,t.apply(o,l)};!n&&r&&t.apply(o,l),e.clearTimeout(n),n=e.setTimeout(h,i)};return s.cancel=a,s},qt=function(){};qt.prototype.allowedEvents_={},qt.prototype.on=function(t,i){var r=this.addEventListener;this.addEventListener=function(){},mn(this,t,i),this.addEventListener=r},qt.prototype.addEventListener=qt.prototype.on,qt.prototype.off=function(t,i){Qt(this,t,i)},qt.prototype.removeEventListener=qt.prototype.off,qt.prototype.one=function(t,i){var r=this.addEventListener;this.addEventListener=function(){},na(this,t,i),this.addEventListener=r},qt.prototype.any=function(t,i){var r=this.addEventListener;this.addEventListener=function(){},Pu(this,t,i),this.addEventListener=r},qt.prototype.trigger=function(t){var i=t.type||t;typeof t=="string"&&(t={type:i}),t=ea(t),this.allowedEvents_[i]&&this["on"+i]&&this["on"+i](t),Fr(this,t)},qt.prototype.dispatchEvent=qt.prototype.trigger,qt.prototype.queueTrigger=function(t){var i=this;vi||(vi=new Map);var r=t.type||t,e=vi.get(this);e||(e=new Map,vi.set(this,e));var n=e.get(r);e.delete(r),O().clearTimeout(n);var a=O().setTimeout(function(){e.delete(r),e.size===0&&(e=null,vi.delete(i)),i.trigger(t)},0);e.set(r,a)};var ra=function(t){return typeof t.name=="function"?t.name():typeof t.name=="string"?t.name:t.name_?t.name_:t.constructor&&t.constructor.name?t.constructor.name:typeof t},er=function(t){return t instanceof qt||!!t.eventBusEl_&&["on","one","off","trigger"].every(function(i){return typeof t[i]=="function"})},Vh=function(t,i){er(t)?i():(t.eventedCallbacks||(t.eventedCallbacks=[]),t.eventedCallbacks.push(i))},Ts=function(t){return typeof t=="string"&&/\S/.test(t)||Array.isArray(t)&&!!t.length},ia=function(t,i,r){if(!t||!t.nodeName&&!er(t))throw new Error("Invalid target for "+ra(i)+"#"+r+"; must be a DOM node or evented object.")},Ou=function(t,i,r){if(!Ts(t))throw new Error("Invalid event type for "+ra(i)+"#"+r+"; must be a non-empty string or array.")},Du=function(t,i,r){if(typeof t!="function")throw new Error("Invalid listener for "+ra(i)+"#"+r+"; must be a function.")},Ss=function(t,i,r){var e,n,a,s=i.length<3||i[0]===t||i[0]===t.eventbusel_;return s?(e=t.eventBusEl_,i.length>=3&&i.shift(),n=i[0],a=i[1]):(e=i[0],n=i[1],a=i[2]),ia(e,t,r),Ou(n,t,r),Du(a,t,r),{isTargetingSelf:s,target:e,type:n,listener:a=gt(t,a)}},yr=function(t,i,r,e){ia(t,t,i),t.nodeName?qh[i](t,r,e):t[i](r,e)},Wh={on:function(){for(var t=this,i=arguments.length,r=new Array(i),e=0;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&&(r.restoreEl?this.el_.parentNode.replaceChild(r.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}},i.isDisposed=function(){return!!this.isDisposed_},i.player=function(){return this.player_},i.options=function(r){return r?(this.options_=vt(this.options_,r),this.options_):this.options_},i.el=function(){return this.el_},i.createEl=function(r,e,n){return st(r,e,n)},i.localize=function(r,e,n){n===void 0&&(n=r);var a=this.player_.language&&this.player_.language(),s=this.player_.languages&&this.player_.languages(),o=s&&s[a],l=a&&a.split("-")[0],h=s&&s[l],g=n;return o&&o[r]?g=o[r]:h&&h[r]&&(g=h[r]),e&&(g=g.replace(/\{(\d+)\}/g,function(b,_){var G=e[_-1],ne=G;return G===void 0&&(ne=b),ne})),g},i.handleLanguagechange=function(){},i.contentEl=function(){return this.contentEl_||this.el_},i.id=function(){return this.id_},i.name=function(){return this.name_},i.children=function(){return this.children_},i.getChildById=function(r){return this.childIndex_[r]},i.getChild=function(r){if(r)return this.childNameIndex_[r]},i.getDescendant=function(){for(var r=arguments.length,e=new Array(r),n=0;n
=0;n--)if(this.children_[n]===r){e=!0,this.children_.splice(n,1);break}if(e){r.parentComponent_=null,this.childIndex_[r.id()]=null,this.childNameIndex_[xt(r.name())]=null,this.childNameIndex_[aa(r.name())]=null;var a=r.el();a&&a.parentNode===this.contentEl()&&this.contentEl().removeChild(r.el())}}},i.initChildren=function(){var r=this,e=this.options_.children;if(e){var n,a=this.options_,s=function(l){var h=l.name,g=l.opts;if(a[h]!==void 0&&(g=a[h]),g!==!1){g===!0&&(g={}),g.playerOptions=r.options_.playerOptions;var b=r.addChild(h,g);b&&(r[h]=b)}},o=t.getComponent("Tech");(n=Array.isArray(e)?e:Object.keys(e)).concat(Object.keys(this.options_).filter(function(l){return!n.some(function(h){return typeof h=="string"?l===h:l===h.name})})).map(function(l){var h,g;return typeof l=="string"?g=e[h=l]||r.options_[h]||{}:(h=l.name,g=l),{name:h,opts:g}}).filter(function(l){var h=t.getComponent(l.opts.componentClass||xt(l.name));return h&&!o.isTech(h)}).forEach(s)}},i.buildCSSClass=function(){return""},i.ready=function(r,e){if(e===void 0&&(e=!1),r){if(!this.isReady_)return this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(r);e?r.call(this):this.setTimeout(r,1)}},i.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var r=this.readyQueue_;this.readyQueue_=[],r&&r.length>0&&r.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)},i.$=function(r,e){return cr(r,e||this.contentEl())},i.$$=function(r,e){return Eu(r,e||this.contentEl())},i.hasClass=function(r){return vr(this.el_,r)},i.addClass=function(r){Yn(this.el_,r)},i.removeClass=function(r){fi(this.el_,r)},i.toggleClass=function(r,e){mu(this.el_,r,e)},i.show=function(){this.removeClass("vjs-hidden")},i.hide=function(){this.addClass("vjs-hidden")},i.lockShowing=function(){this.addClass("vjs-lock-showing")},i.unlockShowing=function(){this.removeClass("vjs-lock-showing")},i.getAttribute=function(r){return vu(this.el_,r)},i.setAttribute=function(r,e){Br(this.el_,r,e)},i.removeAttribute=function(r){Ji(this.el_,r)},i.width=function(r,e){return this.dimension("width",r,e)},i.height=function(r,e){return this.dimension("height",r,e)},i.dimensions=function(r,e){this.width(r,!0),this.height(e)},i.dimension=function(r,e,n){if(e!==void 0)return(e===null||e!=e)&&(e=0),(""+e).indexOf("%")!==-1||(""+e).indexOf("px")!==-1?this.el_.style[r]=e:this.el_.style[r]=e==="auto"?"":e+"px",void(n||this.trigger("componentresize"));if(!this.el_)return 0;var a=this.el_.style[r],s=a.indexOf("px");return parseInt(s!==-1?a.slice(0,s):this.el_["offset"+xt(r)],10)},i.currentDimension=function(r){var e=0;if(r!=="width"&&r!=="height")throw new Error("currentDimension only accepts width or height value");if(e=di(this.el_,r),(e=parseFloat(e))===0||isNaN(e)){var n="offset"+xt(r);e=this.el_[n]}return e},i.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},i.currentWidth=function(){return this.currentDimension("width")},i.currentHeight=function(){return this.currentDimension("height")},i.focus=function(){this.el_.focus()},i.blur=function(){this.el_.blur()},i.handleKeyDown=function(r){this.player_&&(U().isEventKey(r,"Tab")||r.stopPropagation(),this.player_.handleKeyDown(r))},i.handleKeyPress=function(r){this.handleKeyDown(r)},i.emitTapEvents=function(){var r,e=0,n=null,a=10,s=200;this.on("touchstart",function(l){l.touches.length===1&&(n={pageX:l.touches[0].pageX,pageY:l.touches[0].pageY},e=O().performance.now(),r=!0)}),this.on("touchmove",function(l){if(l.touches.length>1)r=!1;else if(n){var h=l.touches[0].pageX-n.pageX,g=l.touches[0].pageY-n.pageY;Math.sqrt(h*h+g*g)>a&&(r=!1)}});var o=function(){r=!1};this.on("touchleave",o),this.on("touchcancel",o),this.on("touchend",function(l){n=null,r===!0&&O().performance.now()-e
0&&g.map(function(b){return h[b]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return t.components_[r]=e,t.components_[aa(r)]=e,e},t.getComponent=function(r){if(r&&t.components_)return t.components_[r]},t}();function Yh(t,i,r){if(typeof i!="number"||i<0||i>r)throw new Error("Failed to execute '"+t+"' on 'TimeRanges': The index provided ("+i+") is non-numeric or out of bounds (0-"+r+").")}function Mu(t,i,r,e){return Yh(t,e,r.length-1),r[e][i]}function ks(t){var i;return i=t===void 0||t.length===0?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:t.length,start:Mu.bind(null,"start",0,t),end:Mu.bind(null,"end",1,t)},O().Symbol&&O().Symbol.iterator&&(i[O().Symbol.iterator]=function(){return(t||[]).values()}),i}function _r(t,i){return Array.isArray(t)?ks(t):t===void 0||i===void 0?ks():ks([[t,i]])}function Ru(t,i){var r,e,n=0;if(!i)return 0;(!t||!t.length)&&(t=_r(0,0));for(var a=0;a
i&&(e=i),n+=e-r;return n/i}function nn(t){if(t instanceof nn)return t;typeof t=="number"?this.code=t:typeof t=="string"?this.message=t:Xn(t)&&(typeof t.code=="number"&&(this.code=t.code),Ct(this,t)),this.message||(this.message=nn.defaultMessages[this.code]||"")}Le.prototype.supportsRaf_=typeof O().requestAnimationFrame=="function"&&typeof O().cancelAnimationFrame=="function",Le.registerComponent("Component",Le),nn.prototype.code=0,nn.prototype.message="",nn.prototype.status=null,nn.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],nn.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(var qr=0;qr
=0;a--)if(e[a].enabled){Is(e,e[a]);break}return(n=t.call(this,e)||this).changing_=!1,n}y(i,t);var r=i.prototype;return r.addTrack=function(e){var n=this;e.enabled&&Is(this,e),t.prototype.addTrack.call(this,e),e.addEventListener&&(e.enabledChange_=function(){n.changing_||(n.changing_=!0,Is(n,e),n.changing_=!1,n.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))},r.removeTrack=function(e){t.prototype.removeTrack.call(this,e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)},i}(Vr),As=function(t,i){for(var r=0;r
=0;a--)if(e[a].selected){As(e,e[a]);break}return(n=t.call(this,e)||this).changing_=!1,Object.defineProperty(w(n),"selectedIndex",{get:function(){for(var s=0;s
0&&(O().console&&O().console.groupCollapsed&&O().console.groupCollapsed("Text Track parsing errors for "+i.src),e.forEach(function(n){return Je.error(n)}),O().console&&O().console.groupEnd&&O().console.groupEnd()),r.flush()},Hu=function(t,i){var r={uri:t},e=sa(t);e&&(r.cors=e);var n=i.tech_.crossOrigin()==="use-credentials";n&&(r.withCredentials=n),M()(r,gt(this,function(a,s,o){if(a)return Je.error(a,s);i.loaded_=!0,typeof O().WebVTT!="function"?i.tech_&&i.tech_.any(["vttjsloaded","vttjserror"],function(l){if(l.type!=="vttjserror")return qu(o,i);Je.error("vttjs failed to load, stopping trying to process "+i.src)}):qu(o,i)}))},_i=function(t){function i(e){var n;if(e===void 0&&(e={}),!e.tech)throw new Error("A tech was not provided.");var a=vt(e,{kind:ap[e.kind]||"subtitles",language:e.language||e.srclang||""}),s=ju[a.mode]||"disabled",o=a.default;(a.kind==="metadata"||a.kind==="chapters")&&(s="hidden"),(n=t.call(this,a)||this).tech_=a.tech,n.cues_=[],n.activeCues_=[],n.preload_=n.tech_.preloadTextTracks!==!1;var l=new Bu(n.cues_),h=new Bu(n.activeCues_),g=!1;n.timeupdateHandler=gt(w(n),function(_){if(_===void 0&&(_={}),!this.tech_.isDisposed()){if(!this.tech_.isReady_)return void(_.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)));this.activeCues=this.activeCues,g&&(this.trigger("cuechange"),g=!1),_.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});var b=function(){n.stopTracking()};return n.tech_.one("dispose",b),s!=="disabled"&&n.startTracking(),Object.defineProperties(w(n),{default:{get:function(){return o},set:function(){}},mode:{get:function(){return s},set:function(_){!ju[_]||s!==_&&(s=_,!this.preload_&&s!=="disabled"&&this.cues.length===0&&Hu(this.src,this),this.stopTracking(),s!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?l:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(this.cues.length===0)return h;for(var _=this.tech_.currentTime(),G=[],ne=0,_e=this.cues.length;ne<_e;ne++){var re=this.cues[ne];(re.startTime<=_&&re.endtime>=_||re.startTime===re.endTime&&re.startTime<=_&&re.starttime+.5>=_)&&G.push(re)}if(g=!1,G.length!==this.activeCues_.length)g=!0;else for(var Ue=0;Ue
0)return void this.trigger("vttjsloaded");var n=ie().createElement("script");n.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",n.onload=function(){e.trigger("vttjsloaded")},n.onerror=function(){e.trigger("vttjserror")},this.on("dispose",function(){n.onload=null,n.onerror=null}),O().WebVTT=!0,this.el().parentNode.appendChild(n)}else this.ready(this.addWebVttScript_)},r.emulateTextTracks=function(){var e=this,n=this.textTracks(),a=this.remoteTextTracks(),s=function(g){return n.addTrack(g.track)},o=function(g){return n.removeTrack(g.track)};a.on("addtrack",s),a.on("removetrack",o),this.addWebVttScript_();var l=function(){return e.trigger("texttrackchange")},h=function(){l();for(var g=0;g
=0;n--){var a=t[n];a[i]&&a[i](e,r)}}function yp(t){Ls[t.id()]=null}function _p(t,i){var r=Ls[t.id()],e=null;if(r==null)return e=i(t),Ls[t.id()]=[[i,e]],e;for(var n=0;n
0;this.player_.tech(!0)&&!((pi||hi)&&n)&&this.player_.tech(!0).focus(),this.player_.paused()?Rn(this.player_.play()):this.player_.pause()}},i}(la);Le.registerComponent("PosterImage",wp);var En="#222",Yu="#ccc",kp={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 Rs(t,i){var r;if(t.length===4)r=t[1]+t[1]+t[2]+t[2]+t[3]+t[3];else{if(t.length!==7)throw new Error("Invalid color code provided, "+t+"; must be formatted as e.g. #f0e or #f604e2.");r=t.slice(1)}return"rgba("+parseInt(r.slice(0,2),16)+","+parseInt(r.slice(2,4),16)+","+parseInt(r.slice(4,6),16)+","+i+")"}function Ns(t,i,r){try{t.style[i]=r}catch{return}}var Cp=function(t){function i(e,n,a){var s;s=t.call(this,e,n,a)||this;var o=function(l){return s.updateDisplay(l)};return e.on("loadstart",function(l){return s.toggleDisplay(l)}),e.on("texttrackchange",o),e.on("loadedmetadata",function(l){return s.preselectTrack(l)}),e.ready(gt(w(s),function(){if(e.tech_&&e.tech_.featuresNativeTextTracks)this.hide();else{e.on("fullscreenchange",o),e.on("playerresize",o),O().addEventListener("orientationchange",o),e.on("dispose",function(){return O().removeEventListener("orientationchange",o)});for(var l=this.options_.playerOptions.tracks||[],h=0;h
0;return Rn(n),void(this.player_.tech(!0)&&(!pi&&!hi||!a)&&this.player_.tech(!0).focus())}var s=this.player_.getChild("controlBar"),o=s&&s.getChild("playToggle");if(o){var l=function(){return o.focus()};yi(n)?n.then(l,function(){}):this.setTimeout(l,1)}else this.player_.tech(!0).focus()},r.handleKeyDown=function(e){this.mouseused_=!1,t.prototype.handleKeyDown.call(this,e)},r.handleMouseDown=function(e){this.mouseused_=!0},i}(xn);$u.prototype.controlText_="Play Video",Le.registerComponent("BigPlayButton",$u);var Ip=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).controlText(n&&n.controlText||a.localize("Close")),a}y(i,t);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-close-button "+t.prototype.buildCSSClass.call(this)},r.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},r.handleKeyDown=function(e){U().isEventKey(e,"Esc")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):t.prototype.handleKeyDown.call(this,e)},i}(xn);Le.registerComponent("CloseButton",Ip);var Ju=function(t){function i(e,n){var a;return n===void 0&&(n={}),a=t.call(this,e,n)||this,n.replay=n.replay===void 0||n.replay,a.on(e,"play",function(s){return a.handlePlay(s)}),a.on(e,"pause",function(s){return a.handlePause(s)}),n.replay&&a.on(e,"ended",function(s){return a.handleEnded(s)}),a}y(i,t);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-play-control "+t.prototype.buildCSSClass.call(this)},r.handleClick=function(e){this.player_.paused()?Rn(this.player_.play()):this.player_.pause()},r.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},r.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},r.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},r.handleEnded=function(e){var n=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",function(a){return n.handleSeeked(a)})},i}(xn);Ju.prototype.controlText_="Play",Le.registerComponent("PlayToggle",Ju);var Zu=function(t,i){t=t<0?0:t;var r=Math.floor(t%60),e=Math.floor(t/60%60),n=Math.floor(t/3600),a=Math.floor(i/60%60),s=Math.floor(i/3600);return(isNaN(t)||t===1/0)&&(n=e=r="-"),(n=n>0||s>0?n+":":"")+(e=((n||a>=10)&&e<10?"0"+e:e)+":")+(r=r<10?"0"+r:r)},us=zu;function Ap(t){Us=t}function Pp(){Us=Zu}function zr(t,i){return i===void 0&&(i=t),Us(t,i)}var Xr=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).on(e,["timeupdate","ended"],function(s){return a.updateContent(s)}),a.updateTextNode_(),a}y(i,t);var r=i.prototype;return r.createEl=function(){var e=this.buildCSSClass(),n=t.prototype.createEl.call(this,"div",{className:e+" vjs-time-control vjs-control"}),a=st("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+" "},{role:"presentation"});return n.appendChild(a),this.contentEl_=st("span",{className:e+"-display"},{"aria-live":"off",role:"presentation"}),n.appendChild(this.contentEl_),n},r.dispose=function(){this.contentEl_=null,this.textNode_=null,t.prototype.dispose.call(this)},r.updateTextNode_=function(e){var n=this;e===void 0&&(e=0),e=zr(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",function(){if(n.contentEl_){var a=n.textNode_;a&&n.contentEl_.firstChild!==a&&(a=null,Je.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),n.textNode_=ie().createTextNode(n.formattedTime_),n.textNode_&&(a?n.contentEl_.replaceChild(n.textNode_,a):n.contentEl_.appendChild(n.textNode_))}}))},r.updateContent=function(e){},i}(Le);Xr.prototype.labelText_="Time",Xr.prototype.controlText_="Time",Le.registerComponent("TimeDisplay",Xr);var Bs=function(t){function i(){return t.apply(this,arguments)||this}y(i,t);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-current-time"},r.updateContent=function(e){var n;n=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(n)},i}(Xr);Bs.prototype.labelText_="Current Time",Bs.prototype.controlText_="Current Time",Le.registerComponent("CurrentTimeDisplay",Bs);var js=function(t){function i(e,n){var a,s=function(o){return a.updateContent(o)};return(a=t.call(this,e,n)||this).on(e,"durationchange",s),a.on(e,"loadstart",s),a.on(e,"loadedmetadata",s),a}y(i,t);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-duration"},r.updateContent=function(e){var n=this.player_.duration();this.updateTextNode_(n)},i}(Xr);js.prototype.labelText_="Duration",js.prototype.controlText_="Duration",Le.registerComponent("DurationDisplay",js);var Op=function(t){function i(){return t.apply(this,arguments)||this}return y(i,t),i.prototype.createEl=function(){var r=t.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),e=t.prototype.createEl.call(this,"div"),n=t.prototype.createEl.call(this,"span",{textContent:"/"});return e.appendChild(n),r.appendChild(e),r},i}(Le);Le.registerComponent("TimeDivider",Op);var Fs=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).on(e,"durationchange",function(s){return a.updateContent(s)}),a}y(i,t);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-remaining-time"},r.createEl=function(){var e=t.prototype.createEl.call(this);return this.options_.displayNegative!==!1&&e.insertBefore(st("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e},r.updateContent=function(e){var n;typeof this.player_.duration()=="number"&&(n=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(n))},i}(Xr);Fs.prototype.labelText_="Remaining Time",Fs.prototype.controlText_="Remaining Time",Le.registerComponent("RemainingTimeDisplay",Fs);var Dp=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).updateShowing(),a.on(a.player(),"durationchange",function(s){return a.updateShowing(s)}),a}y(i,t);var r=i.prototype;return r.createEl=function(){var e=t.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=st("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(st("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+" "})),this.contentEl_.appendChild(ie().createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e},r.dispose=function(){this.contentEl_=null,t.prototype.dispose.call(this)},r.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},i}(Le);Le.registerComponent("LiveDisplay",Dp);var el=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).updateLiveEdgeStatus(),a.player_.liveTracker&&(a.updateLiveEdgeStatusHandler_=function(s){return a.updateLiveEdgeStatus(s)},a.on(a.player_.liveTracker,"liveedgechange",a.updateLiveEdgeStatusHandler_)),a}y(i,t);var r=i.prototype;return r.createEl=function(){var e=t.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=st("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e},r.updateLiveEdgeStatus=function(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))},r.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},r.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,t.prototype.dispose.call(this)},i}(xn);el.prototype.controlText_="Seek to live, currently playing live",Le.registerComponent("SeekToLive",el);var ca=function(t,i,r){return t=Number(t),Math.min(r,Math.max(i,isNaN(t)?i:t))},qs=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).handleMouseDown_=function(s){return a.handleMouseDown(s)},a.handleMouseUp_=function(s){return a.handleMouseUp(s)},a.handleKeyDown_=function(s){return a.handleKeyDown(s)},a.handleClick_=function(s){return a.handleClick(s)},a.handleMouseMove_=function(s){return a.handleMouseMove(s)},a.update_=function(s){return a.update(s)},a.bar=a.getChild(a.options_.barName),a.vertical(!!a.options_.vertical),a.enable(),a}y(i,t);var r=i.prototype;return r.enabled=function(){return this.enabled_},r.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},r.disable=function(){if(this.enabled()){var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},r.createEl=function(e,n,a){return n===void 0&&(n={}),a===void 0&&(a={}),n.className=n.className+" vjs-slider",n=Ct({tabIndex:0},n),a=Ct({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},a),t.prototype.createEl.call(this,e,n,a)},r.handleMouseDown=function(e){var n=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type==="touchstart"&&!Qn&&e.preventDefault(),yu(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(n,"mousemove",this.handleMouseMove_),this.on(n,"mouseup",this.handleMouseUp_),this.on(n,"touchmove",this.handleMouseMove_),this.on(n,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)},r.handleMouseMove=function(e){},r.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;_u(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.update()},r.update=function(){var e=this;if(this.el_&&this.bar){var n=this.getProgress();return n===this.progress_||(this.progress_=n,this.requestNamedAnimationFrame("Slider#update",function(){var a=e.vertical()?"width";e.bar.el().style[a]=(100*n).toFixed(2)+"%"})),n}},r.getProgress=function(){return Number(ca(this.getPercent(),0,1).toFixed(4))},r.calculateDistance=function(e){var n=Zi(this.el_,e);return this.vertical()?n.y:n.x},r.handleKeyDown=function(e){U().isEventKey(e,"Left")||U().isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepBack()):U().isEventKey(e,"Right")||U().isEventKey(e,"Up")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):t.prototype.handleKeyDown.call(this,e)},r.handleClick=function(e){e.stopPropagation(),e.preventDefault()},r.vertical=function(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},i}(Le);Le.registerComponent("Slider",qs);var Hs=function(t,i){return ca(t/i*100,0,100).toFixed(2)+"%"},Lp=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).partEls_=[],a.on(e,"progress",function(s){return a.update(s)}),a}y(i,t);var r=i.prototype;return r.createEl=function(){var e=t.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),n=st("span",{className:"vjs-control-text"}),a=st("span",{textContent:this.localize("Loaded")}),s=ie().createTextNode(": ");return this.percentageEl_=st("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(n),n.appendChild(a),n.appendChild(s),n.appendChild(this.percentageEl_),e},r.dispose=function(){this.partEls_=null,this.percentageEl_=null,t.prototype.dispose.call(this)},r.update=function(e){var n=this;this.requestNamedAnimationFrame("LoadProgressBar#update",function(){var a=n.player_.liveTracker,s=n.player_.buffered(),o=a&&a.isLive()?a.seekableEnd():n.player_.duration(),l=n.player_.bufferedEnd(),h=n.partEls_,g=Hs(l,o);n.percent_!==g&&(n.el_.style.width="g,gr(n.percentageEl_,g),n.percent_=g);for(var" b=0;b
s.length;_e--)n.el_.removeChild(h[_e-1]);h.length=s.length})},i}(Le);Le.registerComponent("LoadProgressBar",Lp);var Mp=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).update=Zn(gt(w(a),a.update),Cn),a}y(i,t);var r=i.prototype;return r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},r.update=function(e,n,a){var s=mi(this.el_),o=jr(this.player_.el()),l=e.width*n;if(o&&s){var h=e.left-o.left+l,g=e.width-l+(o.right-e.right),b=s.width/2;h
s.width&&(b=s.width),b=Math.round(b),this.el_.style.right="-"+b+"px",this.write(a)}},r.write=function(e){gr(this.el_,e)},r.updateTime=function(e,n,a,s){var o=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",function(){var l,h=o.player_.duration();if(o.player_.liveTracker&&o.player_.liveTracker.isLive()){var g=o.player_.liveTracker.liveWindow(),b=g-n*g;l=(b<1?"":"-")+zr(b,g)}else l=zr(a,h);o.update(e,n,l),s&&s()})},i}(Le);Le.registerComponent("TimeTooltip",Mp);var Vs=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).update=Zn(gt(w(a),a.update),Cn),a}y(i,t);var r=i.prototype;return r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},r.update=function(e,n){var a=this.getChild("timeTooltip");if(a){var s=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();a.updateTime(e,n,s)}},i}(Le);Vs.prototype.options_={children:[]},!en&&!Kn&&Vs.prototype.options_.children.push("timeTooltip"),Le.registerComponent("PlayProgressBar",Vs);var tl=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).update=Zn(gt(w(a),a.update),Cn),a}y(i,t);var r=i.prototype;return r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},r.update=function(e,n){var a=this,s=n*this.player_.duration();this.getChild("timeTooltip").updateTime(e,n,s,function(){a.el_.style.left=e.width*n+"px"})},i}(Le);tl.prototype.options_={children:["timeTooltip"]},Le.registerComponent("MouseTimeDisplay",tl);var da=5,nl=12,Ws=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).setEventHandlers_(),a}y(i,t);var r=i.prototype;return r.setEventHandlers_=function(){var e=this;this.update_=gt(this,this.update),this.update=Zn(this.update_,Cn),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=function(n){return e.enableInterval_(n)},this.disableIntervalHandler_=function(n){return e.disableInterval_(n)},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in ie()&&"visibilityState"in ie()&&this.on(ie(),"visibilitychange",this.toggleVisibility_)},r.toggleVisibility_=function(e){ie().visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())},r.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,Cn))},r.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"||!this.updateInterval||(this.clearInterval(this.updateInterval),this.updateInterval=null)},r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},r.update=function(e){var n=this;if(ie().visibilityState!=="hidden"){var a=t.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",function(){var s=n.player_.ended()?n.player_.duration():n.getCurrentTime_(),o=n.player_.liveTracker,l=n.player_.duration();o&&o.isLive()&&(l=n.player_.liveTracker.liveCurrentTime()),n.percent_!==a&&(n.el_.setAttribute("aria-valuenow",(100*a).toFixed(2)),n.percent_=a),(n.currentTime_!==s||n.duration_!==l)&&(n.el_.setAttribute("aria-valuetext",n.localize("progress bar timing: currentTime={1} duration={2}",[zr(s,l),zr(l,l)],"{1} of {2}")),n.currentTime_=s,n.duration_=l),n.bar&&n.bar.update(jr(n.el()),n.getProgress())}),a}},r.userSeek_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)},r.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},r.getPercent=function(){var e,n=this.getCurrentTime_(),a=this.player_.liveTracker;return a&&a.isLive()?(e=(n-a.seekableStart())/a.liveWindow(),a.atLiveEdge()&&(e=1)):e=n/this.player_.duration(),e},r.handleMouseDown=function(e){!gi(e)||(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),t.prototype.handleMouseDown.call(this,e))},r.handleMouseMove=function(e,n){if(n===void 0&&(n=!1),gi(e)){!n&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);var a,s=this.calculateDistance(e),o=this.player_.liveTracker;if(o&&o.isLive()){if(s>=.99)return void o.seekToLiveEdge();var l=o.seekableStart(),h=o.liveCurrentTime();if((a=l+s*o.liveWindow())>=h&&(a=h),a<=l&&(a=l+.1),a===1/0)return}else(a=s*this.player_.duration())===this.player_.duration()&&(a-=.1);this.userseek_(a)}},r.enable=function(){t.prototype.enable.call(this);var e=this.getChild("mouseTimeDisplay");!e||e.show()},r.disable=function(){t.prototype.disable.call(this);var e=this.getChild("mouseTimeDisplay");!e||e.hide()},r.handleMouseUp=function(e){t.prototype.handleMouseUp.call(this,e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?Rn(this.player_.play()):this.update_()},r.stepForward=function(){this.userSeek_(this.player_.currentTime()+da)},r.stepBack=function(){this.userSeek_(this.player_.currentTime()-da)},r.handleAction="function(e){this.player_.paused()?this.player_.play():this.player_.pause()},r.handleKeyDown=function(e){var" n=this.player_.liveTracker;if(U().isEventKey(e,"Space")||U().isEventKey(e,"Enter"))e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(U().isEventKey(e,"Home"))e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(U().isEventKey(e,"End"))e.preventDefault(),e.stopPropagation(),n&&n.isLive()?this.userSeek_(n.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(U()(e))){e.preventDefault(),e.stopPropagation();var a=10*(U().codes[U()(e)]-U().codes[0])/100;n&&n.isLive()?this.userSeek_(n.seekableStart()+n.liveWindow()*a):this.userSeek_(this.player_.duration()*a)}else U().isEventKey(e,"PgDn")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-da*nl)):U().isEventKey(e,"PgUp")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+da*nl)):t.prototype.handleKeyDown.call(this,e)},r.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in ie()&&"visibilityState"in ie()&&this.off(ie(),"visibilitychange",this.toggleVisibility_),t.prototype.dispose.call(this)},i}(qs);Ws.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},!en&&!Kn&&Ws.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),Le.registerComponent("SeekBar",Ws);var rl=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).handleMouseMove=Zn(gt(w(a),a.handleMouseMove),Cn),a.throttledHandleMouseSeek=Zn(gt(w(a),a.handleMouseSeek),Cn),a.handleMouseUpHandler_=function(s){return a.handleMouseUp(s)},a.handleMouseDownHandler_=function(s){return a.handleMouseDown(s)},a.enable(),a}y(i,t);var r=i.prototype;return r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},r.handleMouseMove=function(e){var n=this.getChild("seekBar");if(n){var a=n.getChild("playProgressBar"),s=n.getChild("mouseTimeDisplay");if(a||s){var o=n.el(),l=mi(o),h=Zi(o,e).x;h=ca(h,0,1),s&&s.update(l,h),a&&a.update(l,n.getProgress())}}},r.handleMouseSeek=function(e){var n=this.getChild("seekBar");n&&n.handleMouseMove(e)},r.enabled=function(){return this.enabled_},r.disable=function(){if(this.children().forEach(function(n){return n.disable&&n.disable()}),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){var e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&Rn(this.player_.play())}},r.enable=function(){this.children().forEach(function(e){return e.enable&&e.enable()}),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},r.removeListenersAddedOnMousedownAndTouchstart=function(){var e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)},r.handleMouseDown=function(e){var n=this.el_.ownerDocument,a=this.getChild("seekBar");a&&a.handleMouseDown(e),this.on(n,"mousemove",this.throttledHandleMouseSeek),this.on(n,"touchmove",this.throttledHandleMouseSeek),this.on(n,"mouseup",this.handleMouseUpHandler_),this.on(n,"touchend",this.handleMouseUpHandler_)},r.handleMouseUp=function(e){var n=this.getChild("seekBar");n&&n.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()},i}(Le);rl.prototype.options_={children:["seekBar"]},Le.registerComponent("ProgressControl",rl);var il=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).on(e,["enterpictureinpicture","leavepictureinpicture"],function(s){return a.handlePictureInPictureChange(s)}),a.on(e,["disablepictureinpicturechanged","loadedmetadata"],function(s){return a.handlePictureInPictureEnabledChange(s)}),a.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],function(){e.currentType().substring(0,5)==="audio"||e.audioPosterMode()||e.audioOnlyMode()?(e.isInPictureInPicture()&&e.exitPictureInPicture(),a.hide()):a.show()}),a.disable(),a}y(i,t);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-picture-in-picture-control "+t.prototype.buildCSSClass.call(this)},r.handlePictureInPictureEnabledChange=function(){ie().pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1?this.enable():this.disable()},r.handlePictureInPictureChange=function(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},r.handleClick=function(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},i}(xn);il.prototype.controlText_="Picture-in-Picture",Le.registerComponent("PictureInPictureToggle",il);var al=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).on(e,"fullscreenchange",function(s){return a.handleFullscreenChange(s)}),ie()[e.fsApi_.fullscreenEnabled]===!1&&a.disable(),a}y(i,t);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-fullscreen-control "+t.prototype.buildCSSClass.call(this)},r.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},r.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},i}(xn);al.prototype.controlText_="Fullscreen",Le.registerComponent("FullscreenToggle",al);var Rp=function(t,i){i.tech_&&!i.tech_.featuresVolumeControl&&t.addClass("vjs-hidden"),t.on(i,"loadstart",function(){i.tech_.featuresVolumeControl?t.removeClass("vjs-hidden"):t.addClass("vjs-hidden")})},Np=function(t){function i(){return t.apply(this,arguments)||this}return y(i,t),i.prototype.createEl=function(){var r=t.prototype.createEl.call(this,"div",{className:"vjs-volume-level"});return r.appendChild(t.prototype.createEl.call(this,"span",{className:"vjs-control-text"})),r},i}(Le);Le.registerComponent("VolumeLevel",Np);var Up=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).update=Zn(gt(w(a),a.update),Cn),a}y(i,t);var r=i.prototype;return r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},r.update=function(e,n,a,s){if(!a){var o=jr(this.el_),l=jr(this.player_.el()),h=e.width*n;if(!l||!o)return;var g=e.left-l.left+h,b=e.width-h+(l.right-e.right),_=o.width/2;g<_?_+=_-g:b<_&&(_=b),_<0?_=0:_>o.width&&(_=o.width),this.el_.style.right="-"+_+"px"}this.write(s+"%")},r.write=function(e){gr(this.el_,e)},r.updateVolume=function(e,n,a,s,o){var l=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",function(){l.update(e,n,a,s.toFixed(0)),o&&o()})},i}(Le);Le.registerComponent("VolumeLevelTooltip",Up);var sl=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).update=Zn(gt(w(a),a.update),Cn),a}y(i,t);var r=i.prototype;return r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},r.update=function(e,n,a){var s=this,o=100*n;this.getChild("volumeLevelTooltip").updateVolume(e,n,a,o,function(){a?s.el_.style.bottom=e.height*n+"px":s.el_.style.left=e.width*n+"px"})},i}(Le);sl.prototype.options_={children:["volumeLevelTooltip"]},Le.registerComponent("MouseVolumeLevelDisplay",sl);var ha=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).on("slideractive",function(s){return a.updateLastVolume_(s)}),a.on(e,"volumechange",function(s){return a.updateARIAAttributes(s)}),e.ready(function(){return a.updateARIAAttributes()}),a}y(i,t);var r=i.prototype;return r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},r.handleMouseDown=function(e){!gi(e)||t.prototype.handleMouseDown.call(this,e)},r.handleMouseMove=function(e){var n=this.getChild("mouseVolumeLevelDisplay");if(n){var a=this.el(),s=jr(a),o=this.vertical(),l=Zi(a,e);l=o?l.y:l.x,l=ca(l,0,1),n.update(s,l,o)}!gi(e)||(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},r.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},r.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},r.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},r.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},r.updateARIAAttributes=function(e){var n=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",n),this.el_.setAttribute("aria-valuetext",n+"%")},r.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},r.updateLastVolume_=function(){var e=this,n=this.player_.volume();this.one("sliderinactive",function(){e.player_.volume()===0&&e.player_.lastVolume_(n)})},i}(qs);ha.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},!en&&!Kn&&ha.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),ha.prototype.playerEvent="volumechange",Le.registerComponent("VolumeBar",ha);var ol=function(t){function i(e,n){var a;return n===void 0&&(n={}),n.vertical=n.vertical||!1,(n.volumeBar===void 0||ci(n.volumeBar))&&(n.volumeBar=n.volumeBar||{},n.volumeBar.vertical=n.vertical),a=t.call(this,e,n)||this,Rp(w(a),e),a.throttledHandleMouseMove=Zn(gt(w(a),a.handleMouseMove),Cn),a.handleMouseUpHandler_=function(s){return a.handleMouseUp(s)},a.on("mousedown",function(s){return a.handleMouseDown(s)}),a.on("touchstart",function(s){return a.handleMouseDown(s)}),a.on("mousemove",function(s){return a.handleMouseMove(s)}),a.on(a.volumeBar,["focus","slideractive"],function(){a.volumeBar.addClass("vjs-slider-active"),a.addClass("vjs-slider-active"),a.trigger("slideractive")}),a.on(a.volumeBar,["blur","sliderinactive"],function(){a.volumeBar.removeClass("vjs-slider-active"),a.removeClass("vjs-slider-active"),a.trigger("sliderinactive")}),a}y(i,t);var r=i.prototype;return r.createEl=function(){var e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),t.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+e})},r.handleMouseDown=function(e){var n=this.el_.ownerDocument;this.on(n,"mousemove",this.throttledHandleMouseMove),this.on(n,"touchmove",this.throttledHandleMouseMove),this.on(n,"mouseup",this.handleMouseUpHandler_),this.on(n,"touchend",this.handleMouseUpHandler_)},r.handleMouseUp=function(e){var n=this.el_.ownerDocument;this.off(n,"mousemove",this.throttledHandleMouseMove),this.off(n,"touchmove",this.throttledHandleMouseMove),this.off(n,"mouseup",this.handleMouseUpHandler_),this.off(n,"touchend",this.handleMouseUpHandler_)},r.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},i}(Le);ol.prototype.options_={children:["volumeBar"]},Le.registerComponent("VolumeControl",ol);var Bp=function(t,i){i.tech_&&!i.tech_.featuresMuteControl&&t.addClass("vjs-hidden"),t.on(i,"loadstart",function(){i.tech_.featuresMuteControl?t.removeClass("vjs-hidden"):t.addClass("vjs-hidden")})},ul=function(t){function i(e,n){var a;return a=t.call(this,e,n)||this,Bp(w(a),e),a.on(e,["loadstart","volumechange"],function(s){return a.update(s)}),a}y(i,t);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-mute-control "+t.prototype.buildCSSClass.call(this)},r.handleClick=function(e){var n=this.player_.volume(),a=this.player_.lastVolume_();if(n===0){var s=a<.1?.1:a;this.player_.volume(s),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},r.update=function(e){this.updateIcon_(),this.updateControlText_()},r.updateIcon_=function(){var e=this.player_.volume(),n=3;en&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?n=0:e<.33?n=1:e<.67&&(n=2);for(var a=0;a<4;a++)fi(this.el_,"vjs-vol-"+a);yn(this.el_,"vjs-vol-"+n)},r.updatecontroltext_=function(){var e=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)},i}(xn);ul.prototype.controlText_="Mute",Le.registerComponent("MuteToggle",ul);var ll=function(t){function i(e,n){var a;return n===void 0&&(n={}),n.inline!==void 0?n.inline=n.inline:n.inline=!0,(n.volumeControl===void 0||ci(n.volumeControl))&&(n.volumeControl=n.volumeControl||{},n.volumeControl.vertical=!n.inline),(a=t.call(this,e,n)||this).handleKeyPressHandler_=function(s){return a.handleKeyPress(s)},a.on(e,["loadstart"],function(s){return a.volumePanelState_(s)}),a.on(a.muteToggle,"keyup",function(s){return a.handleKeyPress(s)}),a.on(a.volumeControl,"keyup",function(s){return a.handleVolumeControlKeyUp(s)}),a.on("keydown",function(s){return a.handleKeyPress(s)}),a.on("mouseover",function(s){return a.handleMouseOver(s)}),a.on("mouseout",function(s){return a.handleMouseOut(s)}),a.on(a.volumeControl,["slideractive"],a.sliderActive_),a.on(a.volumeControl,["sliderinactive"],a.sliderInactive_),a}y(i,t);var r=i.prototype;return r.sliderActive_=function(){this.addClass("vjs-slider-active")},r.sliderInactive_=function(){this.removeClass("vjs-slider-active")},r.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},r.createEl=function(){var e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),t.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+e})},r.dispose=function(){this.handleMouseOut(),t.prototype.dispose.call(this)},r.handleVolumeControlKeyUp=function(e){U().isEventKey(e,"Esc")&&this.muteToggle.focus()},r.handleMouseOver=function(e){this.addClass("vjs-hover"),mn(ie(),"keyup",this.handleKeyPressHandler_)},r.handleMouseOut=function(e){this.removeClass("vjs-hover"),Qt(ie(),"keyup",this.handleKeyPressHandler_)},r.handleKeyPress=function(e){U().isEventKey(e,"Esc")&&this.handleMouseOut()},i}(Le);ll.prototype.options_={children:["muteToggle","volumeControl"]},Le.registerComponent("VolumePanel",ll);var cl=function(t){function i(e,n){var a;return a=t.call(this,e,n)||this,n&&(a.menuButton_=n.menuButton),a.focusedChild_=-1,a.on("keydown",function(s){return a.handleKeyDown(s)}),a.boundHandleBlur_=function(s){return a.handleBlur(s)},a.boundHandleTapClick_=function(s){return a.handleTapClick(s)},a}y(i,t);var r=i.prototype;return r.addEventListenerForItem=function(e){e instanceof Le&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))},r.removeEventListenerForItem=function(e){e instanceof Le&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))},r.removeChild=function(e){typeof e=="string"&&(e=this.getChild(e)),this.removeEventListenerForItem(e),t.prototype.removeChild.call(this,e)},r.addItem=function(e){var n=this.addChild(e);n&&this.addEventListenerForItem(n)},r.createEl=function(){var e=this.options_.contentElType||"ul";this.contentEl_=st(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var n=t.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return n.appendChild(this.contentEl_),mn(n,"click",function(a){a.preventDefault(),a.stopImmediatePropagation()}),n},r.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,t.prototype.dispose.call(this)},r.handleBlur=function(e){var n=e.relatedTarget||ie().activeElement;if(!this.children().some(function(s){return s.el()===n})){var a=this.menuButton_;a&&a.buttonPressed_&&n!==a.el().firstChild&&a.unpressButton()}},r.handleTapClick=function(e){if(this.menuButton_){this.menuButton_.unpressButton();var n=this.children();if(!Array.isArray(n))return;var a=n.filter(function(s){return s.el()===e.target})[0];if(!a)return;a.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}},r.handleKeyDown=function(e){U().isEventKey(e,"Left")||U().isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(U().isEventKey(e,"Right")||U().isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())},r.stepForward=function(){var e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)},r.stepBack=function(){var e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)},r.focus=function(e){e===void 0&&(e=0);var n=this.children().slice();n.length&&n[0].hasClass("vjs-menu-title")&&n.shift(),n.length>0&&(e<0?e=0:e>=n.length&&(e=n.length-1),this.focusedChild_=e,n[e].el_.focus())},i}(Le);Le.registerComponent("Menu",cl);var Gs=function(t){function i(e,n){var a;n===void 0&&(n={}),(a=t.call(this,e,n)||this).menuButton_=new xn(e,n),a.menuButton_.controlText(a.controlText_),a.menuButton_.el_.setAttribute("aria-haspopup","true");var s=xn.prototype.buildCSSClass();a.menuButton_.el_.className=a.buildCSSClass()+" "+s,a.menuButton_.removeClass("vjs-control"),a.addChild(a.menuButton_),a.update(),a.enabled_=!0;var o=function(l){return a.handleClick(l)};return a.handleMenuKeyUp_=function(l){return a.handleMenuKeyUp(l)},a.on(a.menuButton_,"tap",o),a.on(a.menuButton_,"click",o),a.on(a.menuButton_,"keydown",function(l){return a.handleKeyDown(l)}),a.on(a.menuButton_,"mouseenter",function(){a.addClass("vjs-hover"),a.menu.show(),mn(ie(),"keyup",a.handleMenuKeyUp_)}),a.on("mouseleave",function(l){return a.handleMouseLeave(l)}),a.on("keydown",function(l){return a.handleSubmenuKeyDown(l)}),a}y(i,t);var r=i.prototype;return r.update=function(){var e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hidethreshold_?(this.hide(),this.menu.contentel_.removeattribute("role")):(this.show(),this.menu.contentel_.setattribute("role","menu"))},r.createmenu=function(){var e=new cl(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var n=st("li",{className:"vjs-menu-title",textContent:xt(this.options_.title),tabIndex:-1}),a=new Le(this.player_,{el:n});e.addItem(a)}if(this.items=this.createItems(),this.items)for(var s=0;s
-1&&l.mode==="showing"){a=!1;break}}a!==this.isSelected_&&this.selected(a)},r.handleSelectedLanguageChange=function(e){for(var n=this.player().textTracks(),a=!0,s=0,o=n.length;s
-1&&l.mode==="showing"){a=!1;break}}a&&(this.player_.cache_.selectedLanguage={enabled:!1})},i}(Ti);Le.registerComponent("OffTextTrackMenuItem",dl);var Kr=function(t){function i(r,e){return e===void 0&&(e={}),e.tracks=r.textTracks(),t.call(this,r,e)||this}return y(i,t),i.prototype.createItems=function(r,e){var n;r===void 0&&(r=[]),e===void 0&&(e=Ti),this.label_&&(n=this.label_+" off"),r.push(new dl(this.player_,{kinds:this.kinds_,kind:this.kind_,label:n})),this.hideThreshold_+=1;var a=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var s=0;s
-1){var l=new e(this.player_,{track:o,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});l.addClass("vjs-"+o.kind+"-menu-item"),r.push(l)}}return r},i}(zs);Le.registerComponent("TextTrackButton",Kr);var hl=function(t){function i(r,e){var n,a=e.track,s=e.cue,o=r.currentTime();return e.selectable=!0,e.multiSelectable=!1,e.label=s.text,e.selected=s.startTime<=o&&o
=0;n--){var a=e[n];if(a.kind===this.kind_)return a}},r.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(xt(this.kind_))},r.createMenu=function(){return this.options_.title=this.getMenuCaption(),t.prototype.createMenu.call(this)},r.createItems=function(){var e=[];if(!this.track_)return e;var n=this.track_.cues;if(!n)return e;for(var a=0,s=n.length;a
-1&&(a.label_="captions"),a.menuButton_.controlText(xt(a.label_)),a}y(i,t);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-subs-caps-button "+t.prototype.buildCSSClass.call(this)},r.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+t.prototype.buildWrapperCSSClass.call(this)},r.createItems=function(){var e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new Ys(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=t.prototype.createItems.call(this,e,pl)},i}(Kr);Js.prototype.kinds_=["captions","subtitles"],Js.prototype.controlText_="Subtitles",Le.registerComponent("SubsCapsButton",Js);var fl=function(t){function i(e,n){var a,s=n.track,o=e.audioTracks();n.label=s.label||s.language||"Unknown",n.selected=s.enabled,(a=t.call(this,e,n)||this).track=s,a.addClass("vjs-"+s.kind+"-menu-item");var l=function(){for(var h=arguments.length,g=new Array(h),b=0;b
=0;a--)n.push(new Zs(this.player(),{rate:e[a]+"x"}));return n},r.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},r.handleClick=function(e){var n=this.player().playbackRate(),a=this.playbackRates(),s=(a.indexOf(n)+1)%a.length;this.player().playbackRate(a[s])},r.handlePlaybackRateschange=function(e){this.update()},r.playbackRates=function(){var e=this.player();return e.playbackRates&&e.playbackRates()||[]},r.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},r.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},r.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")},i}(Gs);gl.prototype.controlText_="Playback Rate",Le.registerComponent("PlaybackRateMenuButton",gl);var vl=function(t){function i(){return t.apply(this,arguments)||this}y(i,t);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-spacer "+t.prototype.buildCSSClass.call(this)},r.createEl=function(e,n,a){return e===void 0&&(e="div"),n===void 0&&(n={}),a===void 0&&(a={}),n.className||(n.className=this.buildCSSClass()),t.prototype.createEl.call(this,e,n,a)},i}(Le);Le.registerComponent("Spacer",vl);var Fp=function(t){function i(){return t.apply(this,arguments)||this}y(i,t);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-custom-control-spacer "+t.prototype.buildCSSClass.call(this)},r.createEl=function(){return t.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),textContent:" "})},i}(vl);Le.registerComponent("CustomControlSpacer",Fp);var pa=function(t){function i(){return t.apply(this,arguments)||this}return y(i,t),i.prototype.createEl=function(){return t.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},i}(Le);pa.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in ie()&&pa.prototype.options_.children.splice(pa.prototype.options_.children.length-1,0,"pictureInPictureToggle"),Le.registerComponent("ControlBar",pa);var yl=function(t){function i(e,n){var a;return(a=t.call(this,e,n)||this).on(e,"error",function(s){return a.open(s)}),a}y(i,t);var r=i.prototype;return r.buildCSSClass=function(){return"vjs-error-display "+t.prototype.buildCSSClass.call(this)},r.content=function(){var e=this.player().error();return e?this.localize(e.message):""},i}(Hr);yl.prototype.options_=Ee({},Hr.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),Le.registerComponent("ErrorDisplay",yl);var eo="vjs-text-track-settings",_l=["#000","Black"],bl=["#00F","Blue"],Tl=["#0FF","Cyan"],Sl=["#0F0","Green"],El=["#F0F","Magenta"],wl=["#F00","Red"],kl=["#FFF","White"],Cl=["#FF0","Yellow"],to=["1","Opaque"],no=["0.5","Semi-Transparent"],xl=["0","Transparent"],Sr={backgroundColor:{selector:".vjs-bg-color> select",id:"captions-background-color-%s",label:"Color",options:[_l,kl,wl,Sl,bl,Cl,El,Tl]},backgroundOpacity:{selector:".vjs-bg-opacity> select",id:"captions-background-opacity-%s",label:"Transparency",options:[to,no,xl]},color:{selector:".vjs-fg-color> select",id:"captions-foreground-color-%s",label:"Color",options:[kl,_l,wl,Sl,bl,Cl,El,Tl]},edgeStyle:{selector:".vjs-edge-style> select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family> select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent> select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(t){return t==="1.00"?null:Number(t)}},textOpacity:{selector:".vjs-text-opacity> select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[to,no]},windowColor:{selector:".vjs-window-color> select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity> select",id:"captions-window-opacity-%s",label:"Transparency",options:[xl,no,to]}};function Il(t,i){if(i&&(t=i(t)),t&&t!=="none")return t}function qp(t,i){return Il(t.options[t.options.selectedIndex].value,i)}function Hp(t,i,r){if(i){for(var e=0;e
',this.localize(o.label),"",'
'].concat(o.options.map(function(g){var b=l+"-"+g[1].replace(/\W+/g,"");return['
',s.localize(g[1]),"
"].join("")})).concat("
").join("")},r.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['
','
',this.localize("Text"),"
",this.createElSelect_("color",e),'
',this.createElSelect_("textOpacity",e),"
","
"].join("")},r.createElBgColor_=function(){var e="captions-background-"+this.id_;return['
','
',this.localize("Background"),"
",this.createElSelect_("backgroundColor",e),'
',this.createElSelect_("backgroundOpacity",e),"
","
"].join("")},r.createElWinColor_=function(){var e="captions-window-"+this.id_;return['
','
',this.localize("Window"),"
",this.createElSelect_("windowColor",e),'
',this.createElSelect_("windowOpacity",e),"
","
"].join("")},r.createElColors_=function(){return st("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},r.createElFont_=function(){return st("div",{className:"vjs-track-settings-font",innerHTML:['
',this.createElSelect_("fontPercent","","legend"),"
",'
',this.createElSelect_("edgeStyle","","legend"),"
",'
',this.createElSelect_("fontFamily","","legend"),"
"].join("")})},r.createElControls_=function(){var e=this.localize("restore all settings to the default values");return st("div",{className:"vjs-track-settings-controls",innerHTML:['
',this.localize("Reset"),'
'+e+"
","
",'
'+this.localize("Done")+"
"].join("")})},r.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},r.label=function(){return this.localize("Caption Settings Dialog")},r.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},r.buildCSSClass=function(){return t.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},r.getValues=function(){var e=this;return Dh(Sr,function(n,a,s){var o=qp(e.$(a.selector),a.parser);return o!==void 0&&(n[s]=o),n},{})},r.setValues=function(e){var n=this;Mr(Sr,function(a,s){Hp(n.$(a.selector),e[s],a.parser)})},r.setDefaults=function(){var e=this;Mr(Sr,function(n){var a=n.hasOwnProperty("default")?n.default:0;e.$(n.selector).selectedIndex=a})},r.restoreSettings=function(){var e;try{e=JSON.parse(O().localStorage.getItem(eo))}catch(n){Je.warn(n)}e&&this.setValues(e)},r.saveSettings=function(){if(this.options_.persistTextTrackSettings){var e=this.getValues();try{Object.keys(e).length?O().localStorage.setItem(eo,JSON.stringify(e)):O().localStorage.removeItem(eo)}catch(n){Je.warn(n)}}},r.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()},r.conditionalBlur_=function(){this.previouslyActiveEl_=null;var e=this.player_.controlBar,n=e&&e.subsCapsButton,a=e&&e.captionsButton;n?n.focus():a&&a.focus()},i}(Hr);Le.registerComponent("TextTrackSettings",Vp);var Wp=function(t){function i(e,n){var a,s=n.ResizeObserver||O().ResizeObserver;n.ResizeObserver===null&&(s=!1);var o=vt({createEl:!s,reportTouchActivity:!1},n);return(a=t.call(this,e,o)||this).ResizeObserver=n.ResizeObserver||O().ResizeObserver,a.loadListener_=null,a.resizeObserver_=null,a.debouncedHandler_=Hh(function(){a.resizeHandler()},100,!1,w(a)),s?(a.resizeObserver_=new a.ResizeObserver(a.debouncedHandler_),a.resizeObserver_.observe(e.el())):(a.loadListener_=function(){if(a.el_&&a.el_.contentWindow){var l=a.debouncedHandler_,h=a.unloadListener_=function(){Qt(this,"resize",l),Qt(this,"unload",h),h=null};mn(a.el_.contentWindow,"unload",h),mn(a.el_.contentWindow,"resize",l)}},a.one("load",a.loadListener_)),a}y(i,t);var r=i.prototype;return r.createEl=function(){return t.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})},r.resizeHandler=function(){!this.player_||!this.player_.trigger||this.player_.trigger("playerresize")},r.dispose=function(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,t.prototype.dispose.call(this)},i}(Le);Le.registerComponent("ResizeManager",Wp);var Gp={trackingThreshold:20,liveTolerance:15},zp=function(t){function i(e,n){var a,s=vt(Gp,n,{createEl:!1});return(a=t.call(this,e,s)||this).handleVisibilityChange_=function(o){return a.handleVisibilityChange(o)},a.trackLiveHandler_=function(){return a.trackLive_()},a.handlePlay_=function(o){return a.handlePlay(o)},a.handleFirstTimeupdate_=function(o){return a.handleFirstTimeupdate(o)},a.handleSeeked_=function(o){return a.handleSeeked(o)},a.seekToLiveEdge_=function(o){return a.seekToLiveEdge(o)},a.reset_(),a.on(a.player_,"durationchange",function(o){return a.handleDurationchange(o)}),a.on(a.player_,"canplay",function(){return a.toggleTracking()}),pi&&"hidden"in ie()&&"visibilityState"in ie()&&a.on(ie(),"visibilitychange",a.handleVisibilityChange_),a}y(i,t);var r=i.prototype;return r.handleVisibilityChange=function(){this.player_.duration()===1/0&&(ie().hidden?this.stopTracking():this.startTracking())},r.trackLive_=function(){var e=this.player_.seekable();if(e&&e.length){var n=Number(O().performance.now().toFixed(4)),a=this.lastTime_===-1?0:(n-this.lastTime_)/1e3;this.lastTime_=n,this.pastSeekEnd_=this.pastSeekEnd()+a;var s=this.liveCurrentTime(),o=this.player_.currentTime(),l=this.player_.paused()||this.seekedBehindLive_||Math.abs(s-o)>this.options_.liveTolerance;(!this.timeupdateSeen_||s===1/0)&&(l=!1),l!==this.behindLiveEdge_&&(this.behindLiveEdge_=l,this.trigger("liveedgechange"))}},r.handleDurationchange=function(){this.toggleTracking()},r.toggleTracking=function(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())},r.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,Cn),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_)))},r.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)},r.handleSeeked=function(){var e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()},r.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)},r.reset_=function(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)},r.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},r.stopTracking=function(){!this.isTracking()||(this.reset_(),this.trigger("liveedgechange"))},r.seekableEnd=function(){for(var e=this.player_.seekable(),n=[],a=e?e.length:0;a--;)n.push(e.end(a));return n.length?n.sort()[n.length-1]:1/0},r.seekableStart=function(){for(var e=this.player_.seekable(),n=[],a=e?e.length:0;a--;)n.push(e.start(a));return n.length?n.sort()[0]:0},r.liveWindow=function(){var e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()},r.isLive=function(){return this.isTracking()},r.atLiveEdge=function(){return!this.behindLiveEdge()},r.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},r.pastSeekEnd=function(){var e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_},r.behindLiveEdge=function(){return this.behindLiveEdge_},r.isTracking=function(){return typeof this.trackingInterval_=="number"},r.seekToLiveEdge=function(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},r.dispose=function(){this.off(ie(),"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),t.prototype.dispose.call(this)},i}(Le);Le.registerComponent("LiveTracker",zp);var fa,ro=function(t){var i=t.el();if(i.hasAttribute("src"))return t.triggerSourceset(i.src),!0;var r=t.$$("source"),e=[],n="";if(!r.length)return!1;for(var a=0;a
=2&&o.push("loadeddata"),e.readyState>=3&&o.push("canplay"),e.readyState>=4&&o.push("canplaythrough"),this.ready(function(){o.forEach(function(l){this.trigger(l)},this)})}},r.setScrubbing=function(e){this.isScrubbing_=e},r.scrubbing=function(){return this.isScrubbing_},r.setCurrentTime=function(e){try{this.isScrubbing_&&this.el_.fastSeek&&$i?this.el_.fastSeek(e):this.el_.currentTime=e}catch(n){Je(n,"Video is not ready. (Video.js)")}},r.duration=function(){var e=this;if(this.el_.duration===1/0&&Kn&&Qn&&this.el_.currentTime===0){var n=function a(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",a))};return this.on("timeupdate",n),NaN}return this.el_.duration||NaN},r.width=function(){return this.el_.offsetWidth},r.height=function(){return this.el_.offsetHeight},r.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var n=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},a=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",n),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",a),this.on("dispose",function(){e.off("webkitbeginfullscreen",a),e.off("webkitendfullscreen",n)})}},r.supportsFullScreen=function(){if(typeof this.el_.webkitEnterFullScreen=="function"){var e=O().navigator&&O().navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},r.enterFullScreen=function(){var e=this.el_;if(e.paused&&e.networkState<=e.have_metadata)rn(this.el_.play()),this.settimeout(function(){e.pause();try{e.webkitenterfullscreen()}catch(n){this.trigger("fullscreenerror",n)}},0);else try{e.webkitEnterFullScreen()}catch(n){this.trigger("fullscreenerror",n)}},r.exitFullScreen=function(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))},r.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},r.requestVideoFrameCallback=function(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):t.prototype.requestVideoFrameCallback.call(this,e)},r.cancelVideoFrameCallback=function(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):t.prototype.cancelVideoFrameCallback.call(this,e)},r.src="function(e){if(e===void" 0)return this.el_.src;this.setSrc(e)},r.reset=function(){i.resetMediaElement(this.el_)},r.currentSrc="function(){return" this.currentSource_?this.currentSource_.src:this.el_.currentSrc},r.setControls=function(e){this.el_.controls=!!e},r.addTextTrack=function(e,n,a){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,n,a):t.prototype.addTextTrack.call(this,e,n,a)},r.createRemoteTextTrack=function(e){if(!this.featuresNativeTextTracks)return t.prototype.createRemoteTextTrack.call(this,e);var n=ie().createElement("track");return e.kind&&(n.kind=e.kind),e.label&&(n.label=e.label),(e.language||e.srclang)&&(n.srclang=e.language||e.srclang),e.default&&(n.default=e.default),e.id&&(n.id=e.id),e.src&&(n.src="e.src),n},r.addRemoteTextTrack=function(e,n){var" a=t.prototype.addRemoteTextTrack.call(this,e,n);return this.featuresNativeTextTracks&&this.el().appendChild(a),a},r.removeRemoteTextTrack=function(e){if(t.prototype.removeRemoteTextTrack.call(this,e),this.featuresNativeTextTracks)for(var n=this.$$("track"),a=n.length;a--;)(e===n[a]||e===n[a].track)&&this.el().removeChild(n[a])},r.getVideoPlaybackQuality=function(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();var e={};return this.el().webkitDroppedFrameCount!==void 0&&this.el().webkitDecodedFrameCount!==void 0&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),O().performance&&typeof O().performance.now=="function"?e.creationTime=O().performance.now():O().performance&&O().performance.timing&&typeof O().performance.timing.navigationStart=="number"&&(e.creationTime=O().Date.now()-O().performance.timing.navigationStart),e},i}(ft);io(qe,"TEST_VID",function(){if(Nr()){var t=ie().createElement("video"),i=ie().createElement("track");return i.kind="captions",i.srclang="en",i.label="English",t.appendChild(i),t}}),qe.isSupported=function(){try{qe.TEST_VID.volume=.5}catch{return!1}return!(!qe.TEST_VID||!qe.TEST_VID.canPlayType)},qe.canPlayType=function(t){return qe.TEST_VID.canPlayType(t)},qe.canPlaySource=function(t,i){return qe.canPlayType(t.type)},qe.canControlVolume=function(){try{var t=qe.TEST_VID.volume;qe.TEST_VID.volume=t/2+.1;var i=t!==qe.TEST_VID.volume;return i&&en?(O().setTimeout(function(){qe&&qe.prototype&&(qe.prototype.featuresVolumeControl=t!==qe.TEST_VID.volume)}),!1):i}catch{return!1}},qe.canMuteVolume=function(){try{var t=qe.TEST_VID.muted;return qe.TEST_VID.muted=!t,qe.TEST_VID.muted?Br(qe.TEST_VID,"muted","muted"):Ji(qe.TEST_VID,"muted","muted"),t!==qe.TEST_VID.muted}catch{return!1}},qe.canControlPlaybackRate=function(){if(Kn&&Qn&&lu<58)return!1;try{var t=qe.TEST_VID.playbackRate;return qe.TEST_VID.playbackRate=t/2+.1,t!==qe.TEST_VID.playbackRate}catch{return!1}},qe.canOverrideAttributes=function(){try{var t=function(){};Object.defineProperty(ie().createElement("video"),"src",{get:t,set:t}),Object.defineProperty(ie().createElement("audio"),"src",{get:t,set:t}),Object.defineProperty(ie().createElement("video"),"innerHTML",{get:t,set:t}),Object.defineProperty(ie().createElement("audio"),"innerHTML",{get:t,set:t})}catch{return!1}return!0},qe.supportsNativeTextTracks=function(){return $i||en&&Qn},qe.supportsNativeVideoTracks=function(){return!(!qe.TEST_VID||!qe.TEST_VID.videoTracks)},qe.supportsNativeAudioTracks=function(){return!(!qe.TEST_VID||!qe.TEST_VID.audioTracks)},qe.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(t){var i=t[0],r=t[1];io(qe.prototype,i,function(){return qe[r]()},!0)}),qe.prototype.featuresVolumeControl=qe.canControlVolume(),qe.prototype.movingMediaElementInDOM=!en,qe.prototype.featuresFullscreenResize=!0,qe.prototype.featuresProgressEvents=!0,qe.prototype.featuresTimeupdateEvents=!0,qe.prototype.featuresVideoFrameCallback=!(!qe.TEST_VID||!qe.TEST_VID.requestVideoFrameCallback),qe.patchCanPlayType=function(){cs>=4&&!uu&&!Qn&&(fa=qe.TEST_VID&&qe.TEST_VID.constructor.prototype.canPlayType,qe.TEST_VID.constructor.prototype.canPlayType=function(t){return t&&/^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(t)?"maybe":fa.call(this,t)})},qe.unpatchCanPlayType=function(){var t=qe.TEST_VID.constructor.prototype.canPlayType;return fa&&(qe.TEST_VID.constructor.prototype.canPlayType=fa),t},qe.patchCanPlayType(),qe.disposeMediaElement=function(t){if(t){for(t.parentNode&&t.parentNode.removeChild(t);t.hasChildNodes();)t.removeChild(t.firstChild);t.removeAttribute("src"),typeof t.load=="function"&&function(){try{t.load()}catch{}}()}},qe.resetMediaElement=function(t){if(t){for(var i=t.querySelectorAll("source"),r=i.length;r--;)t.removeChild(i[r]);t.removeAttribute("src"),typeof t.load=="function"&&function(){try{t.load()}catch{}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(t){qe.prototype[t]=function(){return this.el_[t]||this.el_.hasAttribute(t)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(t){qe.prototype["set"+xt(t)]=function(i){this.el_[t]=i,i?this.el_.setAttribute(t,t):this.el_.removeAttribute(t)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(t){qe.prototype[t]=function(){return this.el_[t]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(t){qe.prototype["set"+xt(t)]=function(i){this.el_[t]=i}}),["pause","load","play"].forEach(function(t){qe.prototype[t]=function(){return this.el_[t]()}}),ft.withSourceHandlers(qe),qe.nativeSourceHandler={},qe.nativeSourceHandler.canPlayType=function(t){try{return qe.TEST_VID.canPlayType(t)}catch{return""}},qe.nativeSourceHandler.canHandleSource=function(t,i){if(t.type)return qe.nativeSourceHandler.canPlayType(t.type);if(t.src){var r=Ds(t.src);return qe.nativeSourceHandler.canPlayType("video/"+r)}return""},qe.nativeSourceHandler.handleSource=function(t,i,r){i.setSrc(t.src)},qe.nativeSourceHandler.dispose=function(){},qe.registerSourceHandler(qe.nativeSourceHandler),ft.registerTech("Html5",qe);var Ol=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],ao={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},so=["tiny","xsmall","small","medium","large","xlarge","huge"],ma={};so.forEach(function(t){var i=t.charAt(0)==="x"?"x-"+t.substring(1):t;ma[t]="vjs-layout-"+i});var Jp={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Ot=function(t){function i(e,n,a){var s;if(e.id=e.id||n.id||"vjs_video_"+Jn(),(n=Ct(i.getTagSettings(e),n)).initChildren=!1,n.createEl=!1,n.evented=!1,n.reportTouchActivity=!1,!n.language)if(typeof e.closest=="function"){var o=e.closest("[lang]");o&&o.getAttribute&&(n.language=o.getAttribute("lang"))}else for(var l=e;l&&l.nodeType===1;){if($n(l).hasOwnProperty("lang")){n.language=l.getAttribute("lang");break}l=l.parentNode}if((s=t.call(this,null,n,a)||this).boundDocumentFullscreenChange_=function(_){return s.documentFullscreenChange_(_)},s.boundFullWindowOnEscKey_=function(_){return s.fullWindowOnEscKey(_)},s.boundUpdateStyleEl_=function(_){return s.updateStyleEl_(_)},s.boundApplyInitTime_=function(_){return s.applyInitTime_(_)},s.boundUpdateCurrentBreakpoint_=function(_){return s.updateCurrentBreakpoint_(_)},s.boundHandleTechClick_=function(_){return s.handleTechClick_(_)},s.boundHandleTechDoubleClick_=function(_){return s.handleTechDoubleClick_(_)},s.boundHandleTechTouchStart_=function(_){return s.handleTechTouchStart_(_)},s.boundHandleTechTouchMove_=function(_){return s.handleTechTouchMove_(_)},s.boundHandleTechTouchEnd_=function(_){return s.handleTechTouchEnd_(_)},s.boundHandleTechTap_=function(_){return s.handleTechTap_(_)},s.isFullscreen_=!1,s.log=ru(s.id_),s.fsApi_=Xi,s.isPosterFromTech_=!1,s.queuedCallbacks_=[],s.isReady_=!1,s.hasStarted_=!1,s.userActive_=!1,s.debugEnabled_=!1,s.audioOnlyMode_=!1,s.audioPosterMode_=!1,s.audioOnlyCache_={playerHeight:null,hiddenChildren:[]},!s.options_||!s.options_.techOrder||!s.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(s.tag=e,s.tagAttributes=e&&$n(e),s.language(s.options_.language),n.languages){var h={};Object.getOwnPropertyNames(n.languages).forEach(function(_){h[_.toLowerCase()]=n.languages[_]}),s.languages_=h}else s.languages_=i.prototype.options_.languages;s.resetCache_(),s.poster_=n.poster||"",s.controls_=!!n.controls,e.controls=!1,e.removeAttribute("controls"),s.changingSrc_=!1,s.playCallbacks_=[],s.playTerminatedQueue_=[],e.hasAttribute("autoplay")?s.autoplay(!0):s.autoplay(s.options_.autoplay),n.plugins&&Object.keys(n.plugins).forEach(function(_){if(typeof s[_]!="function")throw new Error('plugin "'+_+'" does not exist')}),s.scrubbing_=!1,s.el_=s.createEl(),Es(w(s),{eventBusKey:"el_"}),s.fsApi_.requestFullscreen&&(mn(ie(),s.fsApi_.fullscreenchange,s.boundDocumentFullscreenChange_),s.on(s.fsApi_.fullscreenchange,s.boundDocumentFullscreenChange_)),s.fluid_&&s.on(["playerreset","resize"],s.boundUpdateStyleEl_);var g=vt(s.options_);n.plugins&&Object.keys(n.plugins).forEach(function(_){s[_](n.plugins[_])}),n.debug&&s.debug(!0),s.options_.playerOptions=g,s.middleware_=[],s.playbackRates(n.playbackRates),s.initChildren(),s.isAudio(e.nodeName.toLowerCase()==="audio"),s.controls()?s.addClass("vjs-controls-enabled"):s.addClass("vjs-controls-disabled"),s.el_.setAttribute("role","region"),s.isAudio()?s.el_.setAttribute("aria-label",s.localize("Audio Player")):s.el_.setAttribute("aria-label",s.localize("Video Player")),s.isAudio()&&s.addClass("vjs-audio"),s.flexNotSupported_()&&s.addClass("vjs-no-flex"),Rr&&s.addClass("vjs-touch-enabled"),en||s.addClass("vjs-workinghover"),i.players[s.id_]=w(s);var b=Zo.split(".")[0];return s.addClass("vjs-v"+b),s.userActive(!0),s.reportUserActivity(),s.one("play",function(_){return s.listenForUserActivity_(_)}),s.on("stageclick",function(_){return s.handleStageClick_(_)}),s.on("keydown",function(_){return s.handleKeyDown(_)}),s.on("languagechange",function(_){return s.handleLanguagechange(_)}),s.breakpoints(s.options_.breakpoints),s.responsive(s.options_.responsive),s.on("ready",function(){s.audioPosterMode(s.options_.audioPosterMode),s.audioOnlyMode(s.options_.audioOnlyMode)}),s}y(i,t);var r=i.prototype;return r.dispose=function(){var e=this;this.trigger("dispose"),this.off("dispose"),Qt(ie(),this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Qt(ie(),"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),i.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),yp(this),rn.names.forEach(function(n){var a=rn[n],s=e[a.getterName]();s&&s.off&&s.off()}),t.prototype.dispose.call(this,{restoreEl:this.options_.restoreEl})},r.createEl=function(){var e,n=this.tag,a=this.playerElIngest_=n.parentNode&&n.parentNode.hasAttribute&&n.parentNode.hasAttribute("data-vjs-player"),s=this.tag.tagName.toLowerCase()==="video-js";a?e=this.el_=n.parentNode:s||(e=this.el_=t.prototype.createEl.call(this,"div"));var o=$n(n);if(s){for(e=this.el_=n,n=this.tag=ie().createElement("video");e.children.length;)n.appendChild(e.firstChild);vr(e,"video-js")||Yn(e,"video-js"),e.appendChild(n),a=this.playerElIngest_=e,Object.keys(e).forEach(function(G){try{n[G]=e[G]}catch{}})}if(n.setAttribute("tabindex","-1"),o.tabindex="-1",(pi||Qn&&cu)&&(n.setAttribute("role","application"),o.role="application"),n.removeAttribute("width"),n.removeAttribute("height"),"width"in o&&delete o.width,"height"in o&&delete o.height,Object.getOwnPropertyNames(o).forEach(function(G){s&&G==="class"||e.setAttribute(G,o[G]),s&&n.setAttribute(G,o[G])}),n.playerId=n.id,n.id+="_html5_api",n.className="vjs-tech",n.player=e.player=this,this.addClass("vjs-paused"),O().VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=xu("vjs-styles-dimensions");var l=cr(".vjs-styles-defaults"),h=cr("head");h.insertBefore(this.styleEl_,l?l.nextSibling:h.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);for(var g=n.getElementsByTagName("a"),b=0;b
0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),o=s[1]/s[0];e=this.width_!==void 0?this.width_:this.height_!==void 0?this.height_/o:this.videoWidth()||300,n=this.height_!==void 0?this.height_:e*o,a=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(a),Iu(this.styleEl_,` .`+a+` { width: `+e+`px; height: `+n+`px; } .`+a+`.vjs-fluid:not(.vjs-audio-only-mode) { padding-top: `+100*o+`%; } `)}else{var l=typeof this.width_=="number"?this.width_:this.options_.width,h=typeof this.height_=="number"?this.height_:this.options_.height,g=this.tech_&&this.tech_.el();g&&(l>=0&&(g.width=l),h>=0&&(g.height=h))}},r.loadTech_=function(e,n){var a=this;this.tech_&&this.unloadTech_();var s=xt(e),o=e.charAt(0).toLowerCase()+e.slice(1);s!=="Html5"&&this.tag&&(ft.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=s,this.isReady_=!1;var l=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(l=!1);var h={source:n,autoplay:l,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+o+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset,Promise:this.options_.Promise};rn.names.forEach(function(b){var _=rn[b];h[_.getterName]=a[_.privateName]}),Ct(h,this.options_[s]),Ct(h,this.options_[o]),Ct(h,this.options_[e.toLowerCase()]),this.tag&&(h.tag=this.tag),n&&n.src===this.cache_.src&&this.cache_.currentTime>0&&(h.startTime=this.cache_.currentTime);var g=ft.getTech(e);if(!g)throw new Error("No Tech named '"+s+"' exists! '"+s+"' should be registered using videojs.registerTech()'");this.tech_=new g(h),this.tech_.ready(gt(this,this.handleTechReady_),!0),Nu.jsonToTextTracks(this.textTracksJson_||[],this.tech_),Ol.forEach(function(b){a.on(a.tech_,b,function(_){return a["handleTech"+xt(b)+"_"](_)})}),Object.keys(ao).forEach(function(b){a.on(a.tech_,b,function(_){a.tech_.playbackRate()===0&&a.tech_.seeking()?a.queuedCallbacks_.push({callback:a["handleTech"+ao[b]+"_"].bind(a),event:_}):a["handleTech"+ao[b]+"_"](_)})}),this.on(this.tech_,"loadstart",function(b){return a.handleTechLoadStart_(b)}),this.on(this.tech_,"sourceset",function(b){return a.handleTechSourceset_(b)}),this.on(this.tech_,"waiting",function(b){return a.handleTechWaiting_(b)}),this.on(this.tech_,"ended",function(b){return a.handleTechEnded_(b)}),this.on(this.tech_,"seeking",function(b){return a.handleTechSeeking_(b)}),this.on(this.tech_,"play",function(b){return a.handleTechPlay_(b)}),this.on(this.tech_,"firstplay",function(b){return a.handleTechFirstPlay_(b)}),this.on(this.tech_,"pause",function(b){return a.handleTechPause_(b)}),this.on(this.tech_,"durationchange",function(b){return a.handleTechDurationChange_(b)}),this.on(this.tech_,"fullscreenchange",function(b,_){return a.handleTechFullscreenChange_(b,_)}),this.on(this.tech_,"fullscreenerror",function(b,_){return a.handleTechFullscreenError_(b,_)}),this.on(this.tech_,"enterpictureinpicture",function(b){return a.handleTechEnterPictureInPicture_(b)}),this.on(this.tech_,"leavepictureinpicture",function(b){return a.handleTechLeavePictureInPicture_(b)}),this.on(this.tech_,"error",function(b){return a.handleTechError_(b)}),this.on(this.tech_,"posterchange",function(b){return a.handleTechPosterChange_(b)}),this.on(this.tech_,"textdata",function(b){return a.handleTechTextData_(b)}),this.on(this.tech_,"ratechange",function(b){return a.handleTechRateChange_(b)}),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(s!=="Html5"||!this.tag)&&fs(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},r.unloadTech_=function(){var e=this;rn.names.forEach(function(n){var a=rn[n];e[a.privateName]=e[a.getterName]()}),this.textTracksJson_=Nu.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},r.tech=function(e){return e===void 0&&Je.warn(`Using the tech directly can be dangerous. I hope you know what you're doing. See https://github.com/videojs/video.js/issues/2617 for more info. `),this.tech_},r.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)},r.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)},r.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},r.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())},r.manualAutoplay_=function(e){var n=this;if(this.tech_&&typeof e=="string"){var a,s=function(){var o=n.muted();n.muted(!0);var l=function(){n.muted(o)};n.playTerminatedQueue_.push(l);var h=n.play();if(yi(h))return h.catch(function(g){throw l(),new Error("Rejection at manualAutoplay. Restoring muted value. "+(g||""))})};if(e!=="any"||this.muted()?a=e!=="muted"||this.muted()?this.play():s():yi(a=this.play())&&(a=a.catch(s)),yi(a))return a.then(function(){n.trigger({type:"autoplay-success",autoplay:e})}).catch(function(){n.trigger({type:"autoplay-failure",autoplay:e})})}},r.updateSourceCaches_=function(e){e===void 0&&(e="");var n=e,a="";typeof n!="string"&&(n=e.src,a=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],n&&!a&&(a=Tp(this,n)),this.cache_.source=vt({},e,{src:n,type:a});for(var s=this.cache_.sources.filter(function(_){return _.src&&_.src===n}),o=[],l=this.$$("source"),h=[],g=0;g
0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(function(e){return e.callback(e.event)}),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},r.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting");var n=this.currentTime(),a=function s(){n!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",s))};this.on("timeupdate",a)},r.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},r.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},r.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},r.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},r.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},r.handleTechFirstPlay_=function(){this.options_.starttime&&(Je.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},r.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},r.handleTechEnded_=function(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},r.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},r.handleTechClick_=function(e){!this.controls_||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.click===void 0||this.options_.userActions.click!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,e):this.paused()?Rn(this.play()):this.pause())},r.handleTechDoubleClick_=function(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),function(n){return n.contains(e.target)})||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||this.options_.userActions.doubleClick!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))},r.handleTechTap_=function(){this.userActive(!this.userActive())},r.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},r.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},r.handleTechTouchEnd_=function(e){e.cancelable&&e.preventDefault()},r.handleStageClick_=function(){this.reportUserActivity()},r.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},r.documentFullscreenChange_=function(e){var n=e.target.player;if(!n||n===this){var a=this.el(),s=ie()[this.fsApi_.fullscreenElement]===a;!s&&a.matches?s=a.matches(":"+this.fsApi_.fullscreen):!s&&a.msMatchesSelector&&(s=a.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(s)}},r.handleTechFullscreenChange_=function(e,n){var a=this;n&&(n.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",function(){a.removeClass("vjs-ios-native-fs")})),this.isFullscreen(n.isFullscreen))},r.handleTechFullscreenError_=function(e,n){this.trigger("fullscreenerror",n)},r.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},r.handleTechEnterPictureInPicture_=function(e){this.isInPictureInPicture(!0)},r.handleTechLeavePictureInPicture_=function(e){this.isInPictureInPicture(!1)},r.handleTechError_=function(){var e=this.tech_.error();this.error(e)},r.handleTechTextData_=function(){var e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)},r.getCache=function(){return this.cache_},r.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}},r.techCall_=function(e,n){this.ready(function(){if(e in gp)return fp(this.middleware_,this.tech_,e,n);if(e in Ku)return Xu(this.middleware_,this.tech_,e,n);try{this.tech_&&this.tech_[e](n)}catch(a){throw Je(a),a}},!0)},r.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in mp)return pp(this.middleware_,this.tech_,e);if(e in Ku)return Xu(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(n){throw this.tech_[e]===void 0?(Je("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",n),n):n.name==="TypeError"?(Je("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",n),this.tech_.isReady_=!1,n):(Je(n),n)}}},r.play=function(){var e=this,n=this.options_.Promise||O().Promise;return n?new n(function(a){e.play_(a)}):this.play_()},r.play_=function(e){var n=this;e===void 0&&(e=Rn),this.playCallbacks_.push(e);var a=!!(!this.changingSrc_&&(this.src()||this.currentSrc()));if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!a)return this.waitToPlay_=function(o){n.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(!a&&($i||en)&&this.load());var s=this.techGet_("play");s===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(s)},r.runPlayTerminatedQueue_=function(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(n){n()})},r.runPlayCallbacks_=function(e){var n=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],n.forEach(function(a){a(e)})},r.pause=function(){this.techCall_("pause")},r.paused=function(){return this.techGet_("paused")!==!1},r.played=function(){return this.techGet_("played")||_r(0,0)},r.scrubbing=function(e){if(e===void 0)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},r.currentTime=function(e){return e!==void 0?(e<0&&(e=0),this.isready_&&!this.changingsrc_&&this.tech_&&this.tech_.isready_?(this.techcall_("setcurrenttime",e),void(this.cache_.inittime=0)):(this.cache_.inittime=e,this.off("canplay",this.boundapplyinittime_),void this.one("canplay",this.boundApplyInitTime_))):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},r.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},r.duration=function(e){if(e===void 0)return this.cache_.duration!==void 0?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"))},r.remainingtime=function(){return this.duration()-this.currentTime()},r.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},r.buffered=function(){var e=this.techGet_("buffered");return(!e||!e.length)&&(e=_r(0,0)),e},r.bufferedPercent=function(){return Ru(this.buffered(),this.duration())},r.bufferedEnd=function(){var e=this.buffered(),n=this.duration(),a=e.end(e.length-1);return a>n&&(a=n),a},r.volume=function(e){var n;return e!==void 0?(n=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=n,this.techCall_("setVolume",n),void(n>0&&this.lastVolume_(n))):(n=parseFloat(this.techGet_("volume")),isNaN(n)?1:n)},r.muted=function(e){if(e===void 0)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)},r.defaultMuted=function(e){return e!==void 0?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},r.lastVolume_=function(e){if(e===void 0||e===0)return this.cache_.lastVolume;this.cache_.lastVolume=e},r.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},r.isFullscreen=function(e){if(e!==void 0){var n=this.isFullscreen_;return this.isFullscreen_=!!e,this.isFullscreen_!==n&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_},r.requestFullscreen=function(e){var n=this.options_.Promise||O().Promise;if(n){var a=this;return new n(function(s,o){function l(){a.off("fullscreenerror",g),a.off("fullscreenchange",h)}function h(){l(),s()}function g(_,G){l(),o(G)}a.one("fullscreenchange",h),a.one("fullscreenerror",g);var b=a.requestFullscreenHelper_(e);b&&(b.then(l,l),b.then(s,o))})}return this.requestFullscreenHelper_()},r.requestFullscreenHelper_=function(e){var n,a=this;if(this.fsApi_.prefixed||(n=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(n=e)),this.fsApi_.requestFullscreen){var s=this.el_[this.fsApi_.requestFullscreen](n);return s&&s.then(function(){return a.isFullscreen(!0)},function(){return a.isFullscreen(!1)}),s}this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()},r.exitFullscreen=function(){var e=this.options_.Promise||O().Promise;if(e){var n=this;return new e(function(a,s){function o(){n.off("fullscreenerror",h),n.off("fullscreenchange",l)}function l(){o(),a()}function h(b,_){o(),s(_)}n.one("fullscreenchange",l),n.one("fullscreenerror",h);var g=n.exitFullscreenHelper_();g&&(g.then(o,o),g.then(a,s))})}return this.exitFullscreenHelper_()},r.exitFullscreenHelper_=function(){var e=this;if(this.fsApi_.requestFullscreen){var n=ie()[this.fsApi_.exitFullscreen]();return n&&Rn(n.then(function(){return e.isFullscreen(!1)})),n}this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()},r.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=ie().documentElement.style.overflow,mn(ie(),"keydown",this.boundFullWindowOnEscKey_),ie().documentElement.style.overflow="hidden",Yn(ie().body,"vjs-full-window"),this.trigger("enterFullWindow")},r.fullWindowOnEscKey=function(e){U().isEventKey(e,"Esc")&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},r.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,Qt(ie(),"keydown",this.boundFullWindowOnEscKey_),ie().documentElement.style.overflow=this.docOrigOverflow,fi(ie().body,"vjs-full-window"),this.trigger("exitFullWindow")},r.disablePictureInPicture=function(e){if(e===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")},r.isInPictureInPicture=function(e){return e!==void 0?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_},r.requestPictureInPicture=function(){if("pictureInPictureEnabled"in ie()&&this.disablePictureInPicture()===!1)return this.techGet_("requestPictureInPicture")},r.exitPictureInPicture=function(){if("pictureInPictureEnabled"in ie())return ie().exitPictureInPicture()},r.handleKeyDown=function(e){var n,a,s=this.options_.userActions;s&&s.hotkeys&&(n=this.el_.ownerDocument.activeElement,a=n.tagName.toLowerCase(),n.isContentEditable||(a==="input"?["button","checkbox","hidden","radio","reset","submit"].indexOf(n.type)===-1:["textarea"].indexOf(a)!==-1)||(typeof s.hotkeys=="function"?s.hotkeys.call(this,e):this.handleHotkeys(e)))},r.handleHotkeys=function(e){var n=this.options_.userActions?this.options_.userActions.hotkeys:{},a=n.fullscreenKey,s=a===void 0?function(_){return U().isEventKey(_,"f")}:a,o=n.muteKey,l=o===void 0?function(_){return U().isEventKey(_,"m")}:o,h=n.playPauseKey,g=h===void 0?function(_){return U().isEventKey(_,"k")||U().isEventKey(_,"Space")}:h;if(s.call(this,e)){e.preventDefault(),e.stopPropagation();var b=Le.getComponent("FullscreenToggle");ie()[this.fsApi_.fullscreenEnabled]!==!1&&b.prototype.handleClick.call(this,e)}else l.call(this,e)?(e.preventDefault(),e.stopPropagation(),Le.getComponent("MuteToggle").prototype.handleClick.call(this,e)):g.call(this,e)&&(e.preventDefault(),e.stopPropagation(),Le.getComponent("PlayToggle").prototype.handleClick.call(this,e))},r.canPlayType=function(e){for(var n,a=0,s=this.options_.techOrder;a
1?a.handleSrc_(s.slice(1)):(a.changingSrc_=!1,a.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),void a.triggerReady());hp(g,a.tech_)}),this.options_.retryOnError&&s.length>1){var o=function(){a.error(null),a.handleSrc_(s.slice(1),!0)},l=function(){a.off("error",o)};this.one("error",o),this.one("playing",l),this.resetRetryOnError_=function(){a.off("error",o),a.off("playing",l)}}}else this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0)},r.src=function(e){return this.handleSrc_(e,!1)},r.src_=function(e){var n=this,a=this.selectSource([e]);return!a||(zh(a.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_(a.tech,a.source),this.tech_.ready(function(){n.changingSrc_=!1}),!1))},r.load=function(){this.techCall_("load")},r.reset=function(){var e=this,n=this.options_.Promise||O().Promise;this.paused()||!n?this.doReset_():Rn(this.play().then(function(){return e.doReset_()}))},r.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),er(this)&&this.trigger("playerreset")},r.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},r.resetProgressBar_=function(){this.currentTime(0);var e=this.controlBar||{},n=e.durationDisplay,a=e.remainingTimeDisplay;n&&n.updateContent(),a&&a.updateContent()},r.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},r.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},r.currentSources=function(){var e=this.currentSource(),n=[];return Object.keys(e).length!==0&&n.push(e),this.cache_.sources||n},r.currentSource=function(){return this.cache_.source||{}},r.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},r.currentType=function(){return this.currentSource()&&this.currentSource().type||""},r.preload=function(e){return e!==void 0?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")},r.autoplay=function(e){if(e===void 0)return this.options_.autoplay||!1;var n;typeof e=="string"&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e=="string"?e:"play"),n=!1):this.options_.autoplay=!!e,n=n===void 0?this.options_.autoplay:n,this.tech_&&this.techCall_("setAutoplay",n)},r.playsinline=function(e){return e!==void 0?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},r.loop=function(e){return e!==void 0?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")},r.poster=function(e){if(e===void 0)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},r.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},r.controls=function(e){if(e===void 0)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_()))},r.usingNativeControls=function(e){if(e===void 0)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")))},r.error=function(e){var n=this;if(e===void 0)return this.error_||null;if(lr("beforeerror").forEach(function(s){var o=s(n,e);Xn(o)&&!Array.isArray(o)||typeof o=="string"||typeof o=="number"||o===null?e=o:n.log.error("please return a value that MediaError expects in beforeerror hooks")}),this.options_.suppressNotSupportedError&&e&&e.code===4){var a=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],a),void this.one("loadstart",function(){this.off(["click","touchstart"],a)})}if(e===null)return this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new nn(e),this.addClass("vjs-error"),Je.error("(CODE:"+this.error_.code+" "+nn.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),lr("error").forEach(function(s){return s(n,n.error_)})},r.reportUserActivity=function(e){this.userActivity_=!0},r.userActive=function(e){if(e===void 0)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(n){n.stopPropagation(),n.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},r.listenForUserActivity_=function(){var e,n,a,s=gt(this,this.reportUserActivity),o=function(_){(_.screenX!==n||_.screenY!==a)&&(n=_.screenX,a=_.screenY,s())},l=function(){s(),this.clearInterval(e),e=this.setInterval(s,250)},h=function(_){s(),this.clearInterval(e)};this.on("mousedown",l),this.on("mousemove",o),this.on("mouseup",h),this.on("mouseleave",h);var g,b=this.getChild("controlBar");b&&!en&&!Kn&&(b.on("mouseenter",function(_){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),b.on("mouseleave",function(_){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",s),this.on("keyup",s),this.setInterval(function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(g);var _=this.options_.inactivityTimeout;_<=0||(g=this.settimeout(function(){this.useractivity_||this.useractive(!1)},_))}},250)},r.playbackrate=function(e){if(e===void 0)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)},r.defaultPlaybackRate=function(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},r.isAudio=function(e){if(e===void 0)return!!this.isAudio_;this.isAudio_=!!e},r.enableAudioOnlyUI_=function(){var e=this;this.addClass("vjs-audio-only-mode");var n=this.children(),a=this.getChild("ControlBar"),s=a&&a.currentHeight();n.forEach(function(o){o!==a&&o.el_&&!o.hasClass("vjs-hidden")&&(o.hide(),e.audioOnlyCache_.hiddenChildren.push(o))}),this.audioOnlyCache_.playeraudioonlymodechange")},r.disableAudioOnlyUI_=function(){this.removeClass("vjs-audio-only-mode"),this.audioOnlyCache_.hiddenChildren.forEach(function(e){return" e.show()}),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")},r.audioOnlyMode=function(e){var n=this;if(typeof e!="boolean"||e===this.audioOnlyMode_)return this.audioOnlyMode_;this.audioOnlyMode_=e;var a=this.options_.Promise||O().Promise;if(a){if(e){var s=[];return this.isInPictureInPicture()&&s.push(this.exitPictureInPicture()),this.isFullscreen()&&s.push(this.exitFullscreen()),this.audioPosterMode()&&s.push(this.audioPosterMode(!1)),a.all(s).then(function(){return n.enableAudioOnlyUI_()})}return a.resolve().then(function(){return n.disableAudioOnlyUI_()})}e?(this.isInPictureInPicture()&&this.exitPictureInPicture(),this.isFullscreen()&&this.exitFullscreen(),this.enableAudioOnlyUI_()):this.disableAudioOnlyUI_()},r.enablePosterModeUI_=function(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},r.disablePosterModeUI_=function(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},r.audioPosterMode=function(e){var n=this;if(typeof e!="boolean"||e===this.audioPosterMode_)return this.audioPosterMode_;this.audioPosterMode_=e;var a=this.options_.Promise||O().Promise;return a?e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(function(){n.enablePosterModeUI_()}):a.resolve().then(function(){n.enablePosterModeUI_()}):a.resolve().then(function(){n.disablePosterModeUI_()}):e?(this.audioOnlyMode()&&this.audioOnlyMode(!1),void this.enablePosterModeUI_()):void this.disablePosterModeUI_()},r.addTextTrack=function(e,n,a){if(this.tech_)return this.tech_.addTextTrack(e,n,a)},r.addRemoteTextTrack=function(e,n){if(this.tech_)return this.tech_.addRemoteTextTrack(e,n)},r.removeRemoteTextTrack=function(e){e===void 0&&(e={});var n=e.track;if(n||(n=e),this.tech_)return this.tech_.removeRemoteTextTrack(n)},r.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},r.videoWidth="function(){return" this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},r.videoHeight="function(){return" this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},r.language=function(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),er(this)&&this.trigger("languagechange"))},r.languages=function(){return vt(i.prototype.options_.languages,this.languages_)},r.toJSON=function(){var e=vt(this.options_),n=e.tracks;e.tracks=[];for(var a=0;a
"):function(){}},dr=1/30,Un=3*dr,Nl=function(t,i){var r,e=[];if(t&&t.length)for(r=0;r
=i})},Sa=function(t,i){return Nl(t,function(r){return r-dr>=i})},tf=function(t){if(t.length<2)return he.createTimeRanges();for(var i=[],r=1;r
"+t.end(r));return i.join(", ")},rf=function(t,i,r){return r===void 0&&(r=1),((t.length?t.end(t.length-1):0)-i)/r},Er=function(t){for(var i=[],r=0;r
a)){if(i>n&&i<=a){r+=a-i;continue}r+=a-n}}return r},jl=he.createTimeRange,lo=function(t,i){if(!i.preload)return i.duration;var r=0;return(i.parts||[]).forEach(function(e){r+=e.duration}),(i.preloadHints||[]).forEach(function(e){e.type==="PART"&&(r+=t.partTargetDuration)}),r},co=function(t){return(t.segments||[]).reduce(function(i,r,e){return r.parts?r.parts.forEach(function(n,a){i.push({duration:n.duration,segmentIndex:e,partIndex:a,part:n,segment:r})}):i.push({duration:r.duration,segmentIndex:e,partIndex:null,segment:r,part:null}),i},[])},Fl=function(t){var i=t.segments&&t.segments.length&&t.segments[t.segments.length-1];return i&&i.parts||[]},ql=function(t){var i=t.preloadSegment;if(i){var r=i.parts,e=(i.preloadHints||[]).reduce(function(n,a){return n+(a.type==="PART"?1:0)},0);return e+=r&&r.length?r.length:0}},Hl=function(t,i){if(i.endList)return 0;if(t&&t.suggestedPresentationDelay)return t.suggestedPresentationDelay;var r=Fl(i).length>0;return r&&i.serverControl&&i.serverControl.partHoldBack?i.serverControl.partHoldBack:r&&i.partTargetDuration?3*i.partTargetDuration:i.serverControl&&i.serverControl.holdBack?i.serverControl.holdBack:i.targetDuration?3*i.targetDuration:0},sf=function(t,i){var r=0,e=i-t.mediaSequence,n=t.segments[e];if(n){if(n.start!==void 0)return{result:n.start,precise:!0};if(n.end!==void 0)return{result:n.end-n.duration,precise:!0}}for(;e--;){if((n=t.segments[e]).end!==void 0)return{result:r+n.end,precise:!0};if(r+=lo(t,n),n.start!==void 0)return{result:r+n.start,precise:!0}}return{result:r,precise:!1}},of=function(t,i){for(var r,e=0,n=i-t.mediaSequence;n
n){var s=[n,e];e=s[0],n=s[1]}if(e<0){for(var o=e;o
0)for(var _=h-1;_>=0;_--){var G=l[_];if(o+=G.duration,s){if(o<0)continue}else if(o+dr<=0)continue;return{partindex:g.partindex,segmentindex:g.segmentindex,starttime:a-ei({defaultduration:i.targetduration,durationlist:l,startindex:h,endindex:_})}}return{partindex:l[0]&&l[0].partindex||null,segmentindex:l[0]&&l[0].segmentindex||0,starttime:r}}if(h<0){for(var ne=h;ne<0;ne++)if((o-=i.targetduration)<0)return{partindex:l[0]&&l[0].partindex||null,segmentindex:l[0]&&l[0].segmentindex||0,starttime:r};h=0}for(var _e=h;_e
0)continue}else if(o-dr>=0)continue;return{partIndex:re.partIndex,segmentIndex:re.segmentIndex,startTime:a+Ei({defaultDuration:i.targetDuration,durationList:l,startIndex:h,endIndex:_e})}}return{segmentIndex:l[l.length-1].segmentIndex,partIndex:l[l.length-1].partIndex,startTime:r}},zl=function(t){return t.excludeUntil&&t.excludeUntil>Date.now()},ho=function(t){return t.excludeUntil&&t.excludeUntil===1/0},Ea=function(t){var i=zl(t);return!t.disabled&&!i},cf=function(t){return t.disabled},df=function(t){for(var i=0;i
-1&&s!==a.length-1&&(r._HLS_part=s),(s>-1||a.length)&&n--}r._HLS_msn=n}if(i.serverControl&&i.serverControl.canSkipUntil&&(r._HLS_skip=i.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(r).length){var o=new(O()).URL(t);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(l){!r.hasOwnProperty(l)||o.searchParams.set(l,r[l])}),t=o.toString()}return t},_f=function(t,i){if(!t)return i;var r=wa(t,i);if(t.preloadHints&&!i.preloadHints&&delete r.preloadHints,t.parts&&!i.parts)delete r.parts;else if(t.parts&&i.parts)for(var e=0;e
=500?4:2},this.trigger("error")},r.parseManifest_=function(e){var n=this,a=e.url,s=e.manifestString;return pf({onwarn:function(o){var l=o.message;return n.logger_("m3u8-parser warn for "+a+": "+l)},oninfo:function(o){var l=o.message;return n.logger_("m3u8-parser info for "+a+": "+l)},manifestString:s,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},r.haveMetadata=function(e){var n=e.playlistString,a=e.playlistObject,s=e.url,o=e.id;this.request=null,this.state="HAVE_METADATA";var l=a||this.parseManifest_({url:s,manifestString:n});l.lastRequest=Date.now(),Yl({playlist:l,uri:s,id:o});var h=go(this.master,l);this.targetDuration=l.partTargetDuration||l.targetDuration,this.pendingMedia_=null,h?(this.master=h,this.media_=this.master.playlists[o]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(vo(this.media(),!!h)),this.trigger("loadedplaylist")},r.dispose=function(){this.trigger("dispose"),this.stopRequest(),O().clearTimeout(this.mediaUpdateTimeout),O().clearTimeout(this.finalRenditionTimeout),this.off()},r.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},r.media=function(e,n){var a=this;if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof e=="string"){if(!this.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.master.playlists[e]}if(O().clearTimeout(this.finalRenditionTimeout),n){var s=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=O().setTimeout(this.media.bind(this,e,!1),s)}else{var o=this.state,l=!this.media_||e.id!==this.media_.id,h=this.master.playlists[e.id];if(h&&h.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(l&&(this.trigger("mediachanging"),o==="HAVE_MASTER"?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(vo(e,!0)),l){if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},function(g,b){if(a.request){if(e.lastRequest=Date.now(),e.resolvedUri=Ta(a.handleManifestRedirects,e.resolvedUri,b),g)return a.playlistRequestError(a.request,e,o);a.haveMetadata({playlistString:b.responseText,url:e.uri,id:e.id}),o==="HAVE_MASTER"?a.trigger("loadedmetadata"):a.trigger("mediachange")}})}}},r.pause=function(){this.mediaUpdateTimeout&&(O().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")},r.load=function(e){var n=this;this.mediaUpdateTimeout&&(O().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var a=this.media();if(e){var s=a?(a.partTargetDuration||a.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=O().setTimeout(function(){n.mediaUpdateTimeout=null,n.load()},s)}else this.started?a&&!a.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()},r.updateMediaUpdateTimeout_=function(e){var n=this;this.mediaUpdateTimeout&&(O().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=O().setTimeout(function(){n.mediaUpdateTimeout=null,n.trigger("mediaupdatetimeout"),n.updateMediaUpdateTimeout_(e)},e))},r.start=function(){var e=this;if(this.started=!0,typeof this.src=="object")return this.src.uri||(this.src.uri=O().location.href),this.src.resolvedUri=this.src.uri,void setTimeout(function(){e.setupInitialPlaylist(e.src)},0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},function(n,a){if(e.request){if(e.request=null,n)return e.error={status:a.status,message:"HLS playlist request error at URL: "+e.src+".",responseText:a.responseText,code:2},e.state==="HAVE_NOTHING"&&(e.started=!1),e.trigger("error");e.src=Ta(e.handleManifestRedirects,e.src,a);var s=e.parseManifest_({manifestString:a.responseText,url:e.src});e.setupInitialPlaylist(s)}})},r.srcUri=function(){return typeof this.src=="string"?this.src:this.src.uri},r.setupInitialPlaylist=function(e){if(this.state="HAVE_MASTER",e.playlists)return this.master=e,$l(this.master,this.srcUri()),e.playlists.forEach(function(a){a.segments=Zl(a),a.segments.forEach(function(s){Jl(s,a.resolvedUri)})}),this.trigger("loadedplaylist"),void(this.request||this.media(this.master.playlists[0]));var n=this.srcUri()||O().location.href;this.master=gf(e,n),this.haveMetadata({playlistObject:e,url:n,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},i}(vf),Tf=he.xhr,Sf=he.mergeOptions,yo=function(t,i,r,e){var n=t.responseType==="arraybuffer"?t.response:t.responseText;!i&&n&&(t.responseTime=Date.now(),t.roundTripTime=t.responseTime-t.requestTime,t.bytesReceived=n.byteLength||n.length,t.bandwidth||(t.bandwidth=Math.floor(t.bytesReceived/t.roundTripTime*8*1e3))),r.headers&&(t.responseHeaders=r.headers),i&&i.code==="ETIMEDOUT"&&(t.timedout=!0),!i&&!t.aborted&&r.statusCode!==200&&r.statusCode!==206&&r.statusCode!==0&&(i=new Error("XHR Failed with a response of: "+(t&&(n||t.responseText)))),e(i,t)},tc=function(){var t=function i(r,e){r=Sf({timeout:45e3},r);var n=i.beforeRequest||he.Vhs.xhr.beforeRequest;if(n&&typeof n=="function"){var a=n(r);a&&(r=a)}var s=(he.Vhs.xhr.original===!0?Tf:he.Vhs.xhr)(r,function(l,h){return yo(s,l,h,e)}),o=s.abort;return s.abort=function(){return s.aborted=!0,o.apply(s,arguments)},s.uri=r.uri,s.requestTime=Date.now(),s};return t.original=!0,t},Ef=function(t){return"bytes="+t.offset+"-"+(typeof t.offset=="bigint"||typeof t.length=="bigint"?O().BigInt(t.offset)+O().BigInt(t.length)-O().BigInt(1):t.offset+t.length-1)},_o=function(t){var i={};return t.byterange&&(i.Range=Ef(t.byterange)),i},wf=function(t,i){return t.start(i)+"-"+t.end(i)},kf=function(t,i){var r=t.toString(16);return"00".substring(0,2-r.length)+r+(i%2?" ":"")},Cf=function(t){return t>=32&&t<126?string.fromcharcode(t):"."},nc=function(t){var i={};return Object.keys(t).forEach(function(r){var e=t[r];pt(e)?i[r]={bytes:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength}:i[r]=e}),i},ka=function(t){var i=t.byterange||{length:1/0,offset:0};return[i.length,i.offset,t.resolvedUri].join(",")},rc=function(t){return t.resolvedUri},ic=function(t){for(var i=Array.prototype.slice.call(t),r=16,e="",n=0;n
new Date(s.getTime()+1e3*o)?null:(r>s&&(e=a),{segment:e,estimatedStart:e.videoTimingInfo?e.videoTimingInfo.transmuxedPresentationStart:ln.duration(i,i.mediaSequence+i.segments.indexOf(e)),type:e.videoTimingInfo?"accurate":"estimate"})},Lf=function(t,i){if(!i||!i.segments||i.segments.length===0)return null;for(var r,e=0,n=0;n
e){if(t>e+a.duration*ac)return null;r=a}return{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:e-r.duration,type:r.videoTimingInfo?"accurate":"estimate"}},Mf=function(t,i){var r,e;try{r=new Date(t),e=new Date(i)}catch{}var n=r.getTime();return(e.getTime()-n)/1e3},Rf=function(t){if(!t.segments||t.segments.length===0)return!1;for(var i=0;i
=re+_e)return h(g,{response:G.subarray(_e,_e+re),status:b.status,uri:b.uri});s.request=s.vhs_.xhr({uri:l,responseType:"arraybuffer",headers:_o({byterange:e.sidx.byterange})},h)})}else this.mediaRequest_=O().setTimeout(function(){return a(!1)},0)},r.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},O().clearTimeout(this.minimumUpdatePeriodTimeout_),O().clearTimeout(this.mediaRequest_),O().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off()},r.hasPendingRequest=function(){return this.request||this.mediaRequest_},r.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},r.media=function(e){var n=this;if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);var a=this.state;if(typeof e=="string"){if(!this.masterPlaylistLoader_.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.masterPlaylistLoader_.master.playlists[e]}var s=!this.media_||e.id!==this.media_.id;if(s&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(s&&(this.trigger("mediachanging"),this.trigger("mediachange")));!s||(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,a,function(o){n.haveMetadata({startingState:a,playlist:e})}))},r.haveMetadata=function(e){var n=e.startingState,a=e.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[a.id]=a,this.mediaRequest_=null,this.refreshMedia_(a.id),n==="HAVE_MASTER"?this.trigger("loadedmetadata"):this.trigger("mediachange")},r.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),O().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(O().clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)},r.load=function(e){var n=this;O().clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var a=this.media();if(e){var s=a?a.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=O().setTimeout(function(){return n.load()},s)}else this.started?a&&!a.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()},r.start=function(){var e=this;this.started=!0,this.isMaster_?this.requestMaster_(function(n,a){e.haveMaster_(),!e.hasPendingRequest()&&!e.media_&&e.media(e.masterPlaylistLoader_.master.playlists[0])}):this.mediaRequest_=O().setTimeout(function(){return e.haveMaster_()},0)},r.requestMaster_=function(e){var n=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},function(a,s){if(!n.requestErrored_(a,s)){var o=s.responseText!==n.masterPlaylistLoader_.masterXml_;return n.masterPlaylistLoader_.masterXml_=s.responseText,s.responseHeaders&&s.responseHeaders.date?n.masterLoaded_=Date.parse(s.responseHeaders.date):n.masterLoaded_=Date.now(),n.masterPlaylistLoader_.srcUrl=Ta(n.handleManifestRedirects,n.masterPlaylistLoader_.srcUrl,s),o?(n.handleMaster_(),void n.syncClientServerClock_(function(){return e(s,o)})):e(s,o)}n.state==="HAVE_NOTHING"&&(n.started=!1)})},r.syncClientServerClock_=function(e){var n=this,a=lh(this.masterPlaylistLoader_.masterXml_);return a===null?(this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),e()):a.method==="DIRECT"?(this.masterPlaylistLoader_.clientOffset_=a.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:In(this.masterPlaylistLoader_.srcUrl,a.value),method:a.method,withCredentials:this.withCredentials},function(s,o){if(n.request){if(s)return n.masterPlaylistLoader_.clientOffset_=n.masterLoaded_-Date.now(),e();var l;l=a.method==="HEAD"?o.responseHeaders&&o.responseHeaders.date?Date.parse(o.responseHeaders.date):n.masterLoaded_:Date.parse(o.responseText),n.masterPlaylistLoader_.clientOffset_=l-Date.now(),e()}}))},r.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},r.handleMaster_=function(){this.mediaRequest_=null;var e=this.masterPlaylistLoader_.master,n=Ff({masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_,previousManifest:e});e&&(n=qf(e,n,this.masterPlaylistLoader_.sidxMapping_)),this.masterPlaylistLoader_.master=n||e;var a=this.masterPlaylistLoader_.master.locations&&this.masterPlaylistLoader_.master.locations[0];return a&&a!==this.masterPlaylistLoader_.srcUrl&&(this.masterPlaylistLoader_.srcUrl=a),(!e||n&&n.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),!!n},r.updateMinimumUpdatePeriodTimeout_=function(){var e=this.masterPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(O().clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);var n=e.master&&e.master.minimumUpdatePeriod;n===0&&(e.media()?n=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),typeof n!="number"||n<=0?n<0&&this.logger_("found invalid minimumUpdatePeriod of "+n+", not setting a timeout"):this.createMUPTimeout_(n)},r.createMUPTimeout_=function(e){var n=this.masterPlaylistLoader_;n.minimumUpdatePeriodTimeout_=O().setTimeout(function(){n.minimumUpdatePeriodTimeout_=null,n.trigger("minimumUpdatePeriod"),n.createMUPTimeout_(e)},e)},r.refreshXml_=function(){var e=this;this.requestMaster_(function(n,a){!a||(e.media_&&(e.media_=e.masterPlaylistLoader_.master.playlists[e.media_.id]),e.masterPlaylistLoader_.sidxMapping_=Vf(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.sidxMapping_),e.addSidxSegments_(e.media(),e.state,function(s){e.refreshMedia_(e.media().id)}))})},r.refreshMedia_=function(e){var n=this;if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMaster_&&this.handleMaster_();var a=this.masterPlaylistLoader_.master.playlists,s=!this.media_||this.media_!==a[e];s?this.media_=a[e]:this.trigger("playlistunchanged"),this.mediaUpdateTimeout||function o(){n.media().endList||(n.mediaUpdateTimeout=O().setTimeout(function(){n.trigger("mediaupdatetimeout"),o()},vo(n.media(),!!s)))}(),this.trigger("loadedplaylist")},i}(jf),Ht={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},Wf=function(t){for(var i=new Uint8Array(new ArrayBuffer(t.length)),r=0;r
-1)},this.trigger=function(c){var f,d,m,T;if(f=u[c])if(arguments.length===2)for(m=f.length,d=0;d
>>1,u.samplingfrequencyindex<<7|u.channelcount<<3,6,1,2]))},n=function(){return i(Ce.ftyp,ze,Ne,ze,Ye)},re=function(u){return i(Ce.hdlr,St[u])},a=function(u){return i(Ce.mdat,u)},_e=function(u){var c=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,u.duration>>>24&255,u.duration>>>16&255,u.duration>>>8&255,255&u.duration,85,196,0,0]);return u.samplerate&&(c[12]=u.samplerate>>>24&255,c[13]=u.samplerate>>>16&255,c[14]=u.samplerate>>>8&255,c[15]=255&u.samplerate),i(Ce.mdhd,c)},ne=function(u){return i(Ce.mdia,_e(u),re(u.type),o(u))},s=function(u){return i(Ce.mfhd,new Uint8Array([0,0,0,0,(4278190080&u)>>24,(16711680&u)>>16,(65280&u)>>8,255&u]))},o=function(u){return i(Ce.minf,u.type==="video"?i(Ce.vmhd,ot):i(Ce.smhd,Rt),r(),Ge(u))},l=function(u,c){for(var f=[],d=c.length;d--;)f[d]=De(c[d]);return i.apply(null,[Ce.moof,s(u)].concat(f))},h=function(u){for(var c=u.length,f=[];c--;)f[c]=_(u[c]);return i.apply(null,[Ce.moov,b(4294967295)].concat(f).concat(g(u)))},g=function(u){for(var c=u.length,f=[];c--;)f[c]=Se(u[c]);return i.apply(null,[Ce.mvex].concat(f))},b=function(u){var c=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&u)>>24,(16711680&u)>>16,(65280&u)>>8,255&u,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return i(Ce.mvhd,c)},Ue=function(u){var c,f,d=u.samples||[],m=new Uint8Array(4+d.length);for(f=0;f
>>8),T.push(255&d[c].byteLength),T=T.concat(Array.prototype.slice.call(d[c]));for(c=0;c
>>8),x.push(255&m[c].byteLength),x=x.concat(Array.prototype.slice.call(m[c]));if(f=[Ce.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&u.width)>>8,255&u.width,(65280&u.height)>>8,255&u.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),i(Ce.avcC,new Uint8Array([1,u.profileIdc,u.profileCompatibility,u.levelIdc,255].concat([d.length],T,[m.length],x))),i(Ce.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],u.sarRatio){var q=u.sarRatio[0],j=u.sarRatio[1];f.push(i(Ce.pasp,new Uint8Array([(4278190080&q)>>24,(16711680&q)>>16,(65280&q)>>8,255&q,(4278190080&j)>>24,(16711680&j)>>16,(65280&j)>>8,255&j])))}return i.apply(null,f)},wr=function(u){return i(Ce.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&u.channelcount)>>8,255&u.channelcount,(65280&u.samplesize)>>8,255&u.samplesize,0,0,0,0,(65280&u.samplerate)>>8,255&u.samplerate,0,0]),e(u))},G=function(u){var c=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&u.id)>>24,(16711680&u.id)>>16,(65280&u.id)>>8,255&u.id,0,0,0,0,(4278190080&u.duration)>>24,(16711680&u.duration)>>16,(65280&u.duration)>>8,255&u.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&u.width)>>8,255&u.width,0,0,(65280&u.height)>>8,255&u.height,0,0]);return i(Ce.tkhd,c)},De=function(u){var c,f,d,m,T,x,q;return c=i(Ce.tfhd,new Uint8Array([0,0,0,58,(4278190080&u.id)>>24,(16711680&u.id)>>16,(65280&u.id)>>8,255&u.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),x=Math.floor(u.baseMediaDecodeTime/zc),q=Math.floor(u.baseMediaDecodeTime%zc),f=i(Ce.tfdt,new Uint8Array([1,0,0,0,x>>>24&255,x>>>16&255,x>>>8&255,255&x,q>>>24&255,q>>>16&255,q>>>8&255,255&q])),T=92,u.type==="audio"?(d=Me(u,T),i(Ce.traf,c,f,d)):(m=Ue(u),d=Me(u,m.length+T),i(Ce.traf,c,f,d,m))},_=function(u){return u.duration=u.duration||4294967295,i(Ce.trak,G(u),ne(u))},Se=function(u){var c=new Uint8Array([0,0,0,0,(4278190080&u.id)>>24,(16711680&u.id)>>16,(65280&u.id)>>8,255&u.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return u.type!=="video"&&(c[c.length-1]=0),i(Ce.trex,c)},function(){var u,c,f;f=function(d,m){var T=0,x=0,q=0,j=0;return d.length&&(d[0].duration!==void 0&&(T=1),d[0].size!==void 0&&(x=2),d[0].flags!==void 0&&(q=4),d[0].compositionTimeOffset!==void 0&&(j=8)),[0,0,T|x|q|j,1,(4278190080&d.length)>>>24,(16711680&d.length)>>>16,(65280&d.length)>>>8,255&d.length,(4278190080&m)>>>24,(16711680&m)>>>16,(65280&m)>>>8,255&m]},c=function(d,m){var T,x,q,j,W,be;for(m+=20+16*(j=d.samples||[]).length,q=f(j,m),(x=new Uint8Array(q.length+16*j.length)).set(q),T=q.length,be=0;be
>>24,x[T++]=(16711680&W.duration)>>>16,x[T++]=(65280&W.duration)>>>8,x[T++]=255&W.duration,x[T++]=(4278190080&W.size)>>>24,x[T++]=(16711680&W.size)>>>16,x[T++]=(65280&W.size)>>>8,x[T++]=255&W.size,x[T++]=W.flags.isLeading<<2|w.flags.dependson,x[t++]=w.flags.isdependedon<<6|w.flags.hasredundancy<<4|w.flags.paddingvalue<<1|w.flags.isnonsyncsample,x[t++]=61440&w.flags.degradationpriority,x[t++]=15&w.flags.degradationpriority,x[t++]=(4278190080&w.compositiontimeoffset)>>>24,x[T++]=(16711680&W.compositionTimeOffset)>>>16,x[T++]=(65280&W.compositionTimeOffset)>>>8,x[T++]=255&W.compositionTimeOffset;return i(Ce.trun,x)},u=function(d,m){var T,x,q,j,W,be;for(m+=20+8*(j=d.samples||[]).length,q=f(j,m),(T=new Uint8Array(q.length+8*j.length)).set(q),x=q.length,be=0;be
>>24,T[x++]=(16711680&W.duration)>>>16,T[x++]=(65280&W.duration)>>>8,T[x++]=255&W.duration,T[x++]=(4278190080&W.size)>>>24,T[x++]=(16711680&W.size)>>>16,T[x++]=(65280&W.size)>>>8,T[x++]=255&W.size;return i(Ce.trun,T)},Me=function(d,m){return d.type==="audio"?u(d,m):c(d,m)}}();var Po,Oo,Do,Ma,Lo,Xc,Kc,Qc,Pi={ftyp:n,mdat:a,moof:l,moov:h,initSegment:function(u){var c,f=n(),d=h(u);return(c=new Uint8Array(f.byteLength+d.byteLength)).set(f),c.set(d,f.byteLength),c}},xg=function(u){var c,f,d=[],m=[];for(m.byteLength=0,m.nalCount=0,m.duration=0,d.byteLength=0,c=0;c
1&&(c=u.shift(),u.byteLength-=c.byteLength,u.nalCount-=c.nalCount,u[0][0].dts=c.dts,u[0][0].pts=c.pts,u[0][0].duration+=c.duration),u},Pg=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},Yc=function(u,c){var f=Pg();return f.dataOffset=c,f.compositionTimeOffset=u.pts-u.dts,f.duration=u.duration,f.size=4*u.length,f.size+=u.byteLength,u.keyFrame&&(f.flags.dependsOn=2,f.flags.isNonSyncSample=0),f},Og=function(u,c){var f,d,m,T,x,q=c||0,j=[];for(f=0;f
ct.ONE_SECOND_IN_TS/2))){for((T=Ng()[u.samplerate])||(T=c[0].data),x=0;x
=f?u:(c.minSegmentDts=1/0,u.filter(function(d){return d.dts>=f&&(c.minSegmentDts=Math.min(c.minSegmentDts,d.dts),c.minSegmentPts=c.minSegmentDts,!0)}))},Fg=function(u){var c,f,d=[];for(c=0;c
=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(u),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},ir.prototype.isEmpty=function(){return this.rows.length===0||this.rows.length===1&&this.rows[0]===""},ir.prototype.addText=function(u){this.rows[this.rowIdx]+=u},ir.prototype.backspace=function(){if(!this.isEmpty()){var u=this.rows[this.rowIdx];this.rows[this.rowIdx]=u.substr(0,u.length-1)}};var Ua=function(u,c,f){this.serviceNum=u,this.text="",this.currentWindow=new ir(-1),this.windows=[],this.stream=f,typeof c=="string"&&this.createTextDecoder(c)};Ua.prototype.init=function(u,c){this.startPts=u;for(var f=0;f<8;f++)this.windows[f]=new ir(f),typeof c=="function"&&(this.windows[f].beforeRowOverflow=c)},Ua.prototype.setCurrentWindow=function(u){this.currentWindow=this.windows[u]},Ua.prototype.createTextDecoder=function(u){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(u)}catch(c){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+u+" encoding. "+c})}};var mt=function u(c){c=c||{},u.prototype.init.call(this);var f,d=this,m=c.captionServices||{},T={};Object.keys(m).forEach(function(x){f=m[x],/^SERVICE/.test(x)&&(T[x]=f.encoding)}),this.serviceEncodings=T,this.current708Packet=null,this.services={},this.push=function(x){x.type===3?(d.new708Packet(),d.add708Bytes(x)):(d.current708Packet===null&&d.new708Packet(),d.add708Bytes(x))}};mt.prototype=new At,mt.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},mt.prototype.add708Bytes=function(u){var c=u.ccData,f=c>>>8,d=255&c;this.current708Packet.ptsVals.push(u.pts),this.current708Packet.data.push(f),this.current708Packet.data.push(d)},mt.prototype.push708Packet=function(){var u=this.current708Packet,c=u.data,f=null,d=null,m=0,T=c[m++];for(u.seq=T>>6,u.sizeCode=63&T;m
>5)==7&&d>0&&(f=T=c[m++]),this.pushServiceBlock(f,m,d),d>0&&(m+=d-1)},mt.prototype.pushServiceBlock=function(u,c,f){var d,m=c,T=this.current708Packet.data,x=this.services[u];for(x||(x=this.initService(u,m));m
>5,T.rowLock=(16&d)>>4,T.columnLock=(8&d)>>3,T.priority=7&d,d=f[++u],T.relativePositioning=(128&d)>>7,T.anchorVertical=127&d,d=f[++u],T.anchorHorizontal=d,d=f[++u],T.anchorPoint=(240&d)>>4,T.rowCount=15&d,d=f[++u],T.columnCount=63&d,d=f[++u],T.windowStyle=(56&d)>>3,T.penStyle=7&d,T.virtualRowCount=T.rowCount+1,u},mt.prototype.setWindowAttributes=function(u,c){var f=this.current708Packet.data,d=f[u],m=c.currentWindow.winAttr;return d=f[++u],m.fillOpacity=(192&d)>>6,m.fillRed=(48&d)>>4,m.fillGreen=(12&d)>>2,m.fillBlue=3&d,d=f[++u],m.borderType=(192&d)>>6,m.borderRed=(48&d)>>4,m.borderGreen=(12&d)>>2,m.borderBlue=3&d,d=f[++u],m.borderType+=(128&d)>>5,m.wordWrap=(64&d)>>6,m.printDirection=(48&d)>>4,m.scrollDirection=(12&d)>>2,m.justify=3&d,d=f[++u],m.effectSpeed=(240&d)>>4,m.effectDirection=(12&d)>>2,m.displayEffect=3&d,u},mt.prototype.flushDisplayed=function(u,c){for(var f=[],d=0;d<8;d++)c.windows[d].visible&&!c.windows[d].isempty()&&f.push(c.windows[d].gettext());c.endpts=u,c. `),this.pushCaption(c),c.startPts=u},mt.prototype.pushCaption=function(u){u.text!==""&&(this.trigger("data",{startPts:u.startPts,endPts:u.endPts,text:u.text,stream:"cc708_"+u.serviceNum}),u.,u.startPts=u.endPts)},mt.prototype.displayWindows=function(u,c){var f=this.current708Packet.data[++u],d=this.getPts(u);this.flushDisplayed(d,c);for(var m=0;m<8;m++)f&1<
>4,m.offset=(12&d)>>2,m.penSize=3&d,d=f[++u],m.italics=(128&d)>>7,m.underline=(64&d)>>6,m.edgeType=(56&d)>>3,m.fontStyle=7&d,u},mt.prototype.setPenColor=function(u,c){var f=this.current708Packet.data,d=f[u],m=c.currentWindow.penColor;return d=f[++u],m.fgOpacity=(192&d)>>6,m.fgRed=(48&d)>>4,m.fgGreen=(12&d)>>2,m.fgBlue=3&d,d=f[++u],m.bgOpacity=(192&d)>>6,m.bgRed=(48&d)>>4,m.bgGreen=(12&d)>>2,m.bgBlue=3&d,d=f[++u],m.edgeRed=(48&d)>>4,m.edgeGreen=(12&d)>>2,m.edgeBlue=3&d,u},mt.prototype.setPenLocation=function(u,c){var f=this.current708Packet.data,d=f[u],m=c.currentWindow.penLoc;return c.currentWindow.pendingNewLine=!0,d=f[++u],m.row=15&d,d=f[++u],m.column=63&d,u},mt.prototype.reset=function(u,c){var f=this.getPts(u);return this.flushDisplayed(f,c),this.initService(c.serviceNum,u)};var Zg={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},Ba=function(u){return u===null?"":(u=Zg[u]||u,String.fromCharCode(u))},ja=14,ev=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Cr=function(){for(var u=[],c=ja+1;c--;)u.push("");return u},bt=function u(c,f){u.prototype.init.call(this),this.field_=c||0,this.dataChannel_=f||0,this.name_="CC"+(1+(this.field_<<1|this.datachannel_)),this.setconstants(),this.reset(),this.push=function(d){var m,T,x,q,j;if((m=32639&d.ccData)!==this.lastControlCode_){if((61440&m)==4096?this.lastControlCode_=m:m!==this.PADDING_&&(this.lastControlCode_=null),x=m>>>8,q=255&m,m!==this.PADDING_)if(m===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(m===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(d.pts),this.flushDisplayed(d.pts),T=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=T,this.startPts_=d.pts;else if(m===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(d.pts);else if(m===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(d.pts);else if(m===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(d.pts);else if(m===this.CARRIAGE_RETURN_)this.clearFormatting(d.pts),this.flushDisplayed(d.pts),this.shiftRowsUp_(),this.startPts_=d.pts;else if(m===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(m===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(d.pts),this.displayed_=Cr();else if(m===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Cr();else if(m===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(d.pts),this.displayed_=Cr()),this.mode_="paintOn",this.startPts_=d.pts;else if(this.isSpecialCharacter(x,q))j=Ba((x=(3&x)<<8)|q),this[this.mode_](d.pts,j),this.column_++;else if(this.isExtCharacter(x,q))this.mode_==="popOn"?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),j=Ba((x=(3&x)<<8)|q),this[this.mode_](d.pts,j),this.column_++;else if(this.isMidRowCode(x,q))this.clearFormatting(d.pts),this[this.mode_](d.pts," "),this.column_++,!(14&~q)&&this.addFormatting(d.pts,["i"]),!(1&~q)&&this.addFormatting(d.pts,["u"]);else if(this.isOffsetControlCode(x,q))this.column_+=3&q;else if(this.isPAC(x,q)){var W=ev.indexOf(7968&m);this.mode_==="rollUp"&&(W-this.rollUpRows_+1<0&&(w=this.rolluprows_-1),this.setrollup(d.pts,w)),w!==this.row_&&(this.clearformatting(d.pts),this.row_=w),1&q&&this.formatting_.indexof("u")===-1&&this.addformatting(d.pts,["u"]),!(16&~m)&&(this.column_=4*((14&m)>>1)),this.isColorPAC(q)&&!(14&~q)&&this.addFormatting(d.pts,["i"])}else this.isNormalChar(x)&&(q===0&&(q=null),j=Ba(x),j+=Ba(q),this[this.mode_](d.pts,j),this.column_+=j.length)}else this.lastControlCode_=null}};bt.prototype=new At,bt.prototype.flushDisplayed=function(u){var c=this.displayed_.map(function(f,d){try{return f.trim()}catch{return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+d+"."}),""}},this).join(` `).replace(/^\n+|\n+$/g,"");c.length&&this.trigger("data",{startPts:this.startPts_,endPts:u,text:c,stream:this.name_})},bt.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Cr(),this.nonDisplayed_=Cr(),this.lastControlCode_=null,this.column_=0,this.row_=ja,this.rollUpRows_=2,this.formatting_=[]},bt.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.offset_=23):this.datachannel_===1&&(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_},bt.prototype.isspecialcharacter=function(u,c){return u===this.EXT_&&c>=48&&c<=63},bt.prototype.isextcharacter=function(u,c){return(u===this.ext_+1||u===this.ext_+2)&&c>=32&&c<=63},bt.prototype.ismidrowcode=function(u,c){return u===this.EXT_&&c>=32&&c<=47},bt.prototype.isoffsetcontrolcode=function(u,c){return u===this.OFFSET_&&c>=33&&c<=35},bt.prototype.ispac=function(u,c){return u>=this.BASE_&&u
=64&&c<=127},bt.prototype.iscolorpac=function(u){return u>=64&&u<=79||u>=96&&u<=127},bt.prototype.isnormalchar=function(u){return u>=32&&u<=127},bt.prototype.setrollup=function(u,c){if(this.mode_!=="rollup"&&(this.row_=ja,this.mode_="rollup",this.flushdisplayed(u),this.nondisplayed_=cr(),this.displayed_=cr()),c!==void 0&&c!==this.row_)for(var f=0;f
"},"");this[this.mode_](u,f)},bt.prototype.clearFormatting=function(u){if(this.formatting_.length){var c=this.formatting_.reverse().reduce(function(f,d){return f+""},"");this.formatting_=[],this[this.mode_](u,c)}},bt.prototype.popOn=function(u,c){var f=this.nonDisplayed_[this.row_];f+=c,this.nonDisplayed_[this.row_]=f},bt.prototype.rollUp=function(u,c){var f=this.displayed_[this.row_];f+=c,this.displayed_[this.row_]=f},bt.prototype.shiftRowsUp_=function(){var u;for(u=0;u
c&&(f=-1);Math.abs(c-u)>nv;)u+=f*tv;return u},Zc=function u(c){var f,d;u.prototype.init.call(this),this.type_=c||Jc,this.push=function(m){this.type_!==Jc&&m.type!==this.type_||(d===void 0&&(d=m.dts),m.dts=No(m.dts,d),m.pts=No(m.pts,d),f=m.dts,this.trigger("data",m))},this.flush=function(){d=f,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){d=void 0,f=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Zc.prototype=new At;var qa,ed={TimestampRolloverStream:Zc,handleRollover:No},td=function(u,c,f){var d,m="";for(d=c;d
>>2;Qe*=4,Qe+=3&We[7],be.timeStamp=Qe,q.pts===void 0&&q.dts===void 0&&(q.pts=be.timeStamp,q.dts=be.timeStamp),this.trigger("timestamp",be)}q.frames.push(be),j+=10,j+=W}while(j
>>4>1&&(x+=m[x]+1),T.pid===0)T.type="pat",u(m.subarray(x),T),this.trigger("data",T);else if(T.pid===this.pmtPid)for(T.type="pmt",u(m.subarray(x),T),this.trigger("data",T);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([m,x,T]):this.processPes_(m,x,T)},this.processPes_=function(m,T,x){x.pid===this.programMapTable.video?x.streamType=Gt.H264_STREAM_TYPE:x.pid===this.programMapTable.audio?x.streamType=Gt.ADTS_STREAM_TYPE:x.streamType=this.programMapTable["timed-metadata"][x.pid],x.type="pes",x.data=m.subarray(T),this.trigger("data",x)}},Li.prototype=new At,Li.STREAM_TYPES={h264:27,adts:15},Ga=function(){var u,c=this,f=!1,d={data:[],size:0},m={data:[],size:0},T={data:[],size:0},x=function(j,W){var be,Oe=j[0]<<16|j[1]<<8|j[2];w.data=new Uint8Array,Oe===1&&(W.packetLength=6+(j[4]<<8|j[5]),w.dataalignmentindicator=!!(4&j[6]),192&(be=j[7])&&(w.pts=(14&j[9])<<27|(255&j[10])<<20|(254&j[11])<<12|(255&j[12])<<5|(254&j[13])>>>3,W.pts*=4,W.pts+=(6&j[13])>>>1,W.dts=W.pts,64&be&&(W.dts=(14&j[14])<<27|(255&j[15])<<20|(254&j[16])<<12|(255&j[17])<<5|(254&j[18])>>>3,W.dts*=4,W.dts+=(6&j[18])>>>1)),W.data=j.subarray(9+j[8]))},q=function(j,W,be){var Oe,We=new Uint8Array(j.size),Qe={type:W},rt=0,lt=0,Yt=!1;if(j.data.length&&!(j.size<9)){for(qe.trackid=j.data[0].pid,rt=0;rt
>5,j=(q=1024*(1+(3&c[W+6])))*sv/id[(60&c[W+2])>>>2],c.byteLength-W
>>6&3),channelcount:(1&c[W+2])<<2|(192&c[w+3])>>>6,samplerate:id[(60&c[W+2])>>>2],samplingfrequencyindex:(60&c[W+2])>>>2,samplesize:16,data:c.subarray(W+7+T,W+m)}),f++,W+=m}else typeof be!="number"&&(be=W),W++;typeof be=="number"&&(this.skipWarn_(be,W),be=null),c=c.subarray(W)}},this.flush=function(){f=0,this.trigger("done")},this.reset=function(){c=void 0,this.trigger("reset")},this.endTimeline=function(){c=void 0,this.trigger("endedtimeline")}},za.prototype=new At;var ad,sd=za;ad=function(u){var c=u.byteLength,f=0,d=0;this.length=function(){return 8*c},this.bitsAvailable=function(){return 8*c+d},this.loadWord=function(){var m=u.byteLength-c,T=new Uint8Array(4),x=Math.min(4,c);if(x===0)throw new Error("no bytes available");T.set(u.subarray(m,m+x)),f=new DataView(T.buffer).getUint32(0),d=8*x,c-=x},this.skipBits=function(m){var T;d>m?(f<<=m,d-=m):(m-=d,m-=8*(t=math.floor(m/8)),c-=t,this.loadword(),f<<=m,d-=m)},this.readbits=function(m){var T=Math.min(d,m),x=f>>>32-T;return(d-=T)>0?f<<=t:c>0&&this.loadWord(),(T=m-T)>0?x<
>>m)return f<<=m,d-=m,m;return this.loadWord(),m+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var m=this.skipLeadingZeros();return this.readBits(m+1)-1},this.readExpGolomb=function(){var m=this.readUnsignedExpGolomb();return 1&m?1+m>>>1:-1*(m>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var Xa,Ka,od,ov=ad;Ka=function(){var u,c,f=0;Ka.prototype.init.call(this),this.push=function(d){var m;c?((m=new Uint8Array(c.byteLength+d.data.byteLength)).set(c),m.set(d.data,c.byteLength),c=m):c=d.data;for(var T=c.byteLength;f
3&&this.trigger("data",c.subarray(f+3)),c=null,f=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},Ka.prototype=new At,od={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Xa=function(){var u,c,f,d,m,T,x,q=new Ka;Xa.prototype.init.call(this),u=this,this.push=function(j){j.type==="video"&&(c=j.trackId,f=j.pts,d=j.dts,q.push(j))},q.on("data",function(j){var W={trackId:c,pts:f,dts:d,data:j,nalUnitTypeCode:31&j[0]};switch(W.nalUnitTypeCode){case 5:W.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:W.nalUnitType="sei_rbsp",W.escapedRBSP=m(j.subarray(1));break;case 7:W.nalUnitType="seq_parameter_set_rbsp",W.escapedRBSP=m(j.subarray(1)),W.config=T(W.escapedRBSP);break;case 8:W.nalUnitType="pic_parameter_set_rbsp";break;case 9:W.nalUnitType="access_unit_delimiter_rbsp"}u.trigger("data",W)}),q.on("done",function(){u.trigger("done")}),q.on("partialdone",function(){u.trigger("partialdone")}),q.on("reset",function(){u.trigger("reset")}),q.on("endedtimeline",function(){u.trigger("endedtimeline")}),this.flush=function(){q.flush()},this.partialFlush=function(){q.partialFlush()},this.reset=function(){q.reset()},this.endTimeline=function(){q.endTimeline()},x=function(j,W){var be,Oe=8,We=8;for(be=0;be
=0?f:0,(16&u[c+5])>>4?f+20:f+10},cv=function u(c,f){return c.length-f<10||c[f]!==73||c[f+1]!==68||c[f+2]!==51?f:u(c,f+=ud(c,f))},dv=function(u){var c=cv(u,0);return u.length>=c+2&&!(255&~u[c])&&!(240&~u[c+1])&&(22&u[c+1])==16},ld=function(u){return u[0]<<21|u[1]<<14|u[2]<<7|u[3]},hv=function(u,c,f){var d,m="";for(d=c;d
>5,d=u[c+4]<<3;return 6144&u[c+3]|d|f},mv=function(u,c){return u[c]===73&&u[c+1]===68&&u[c+2]===51?"timed-metadata":!0&u[c]&&!(240&~u[c+1])?"audio":null},gv=function(u){for(var c=0;c+5
>>2];c++}return null},vv=function(u){var c,f,d;c=10,64&u[5]&&(c+=4,c+=ld(u.subarray(10,14)));do{if((f=ld(u.subarray(c+4,c+8)))<1)return null;if(String.fromCharCode(u[c],u[c+1],u[c+2],u[c+3])==="PRIV"){d=u.subarray(c+10,c+f+10);for(var m=0;m
>>2;return x*=4,x+=3&T[7]}break}}c+=10,c+=f}while(c
=3;)if(u[j]!==73||u[j+1]!==68||u[j+2]!==51)if(255&~u[j]||240&~u[j+1])j++;else{if(u.length-j<7||j+(q=ya.parseadtssize(u,j))>u.length)break;T={type:"audio",data:u.subarray(j,j+q),pts:c,dts:c},this.trigger("data",T),j+=q}else{if(u.length-j<10||j+(q=ya.parseid3tagsize(u,j))>u.length)break;m={type:"timed-metadata",data:u.subarray(j,j+q)},this.trigger("data",m),j+=q}d=u.length-j,u=d>0?u.subarray(j):new Uint8Array},this.reset=function(){u=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){u=new Uint8Array,this.trigger("endedtimeline")}},Qa.prototype=new At;var $a,Mi,Ja,xr,yv=Qa,cd=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],dd=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],_v=uv.H264Stream,bv=Ya.isLikelyAacData,Tv=ct.ONE_SECOND_IN_TS,Sv=function(u,c){c.stream=u,this.trigger("log",c)},hd=function(u,c){for(var f=Object.keys(c),d=0;d
=-rt&&j<=qe&&(!w||lt>j)&&(W=Oe,lt=j));return W?W.gop:null},this.alignGopsAtStart_=function(q){var j,W,be,Oe,We,Qe,rt,lt;for(We=q.byteLength,Qe=q.nalCount,rt=q.duration,j=W=0;j
be.pts?j++:(W++,We-=Oe.byteLength,Qe-=Oe.nalCount,rt-=Oe.duration);return W===0?q:W===q.length?null:((lt=q.slice(W)).byteLength=We,lt.duration=rt,lt.nalCount=Qe,lt.pts=lt[0].pts,lt.dts=lt[0].dts,lt)},this.alignGopsAtEnd_=function(q){var j,W,be,Oe,We,Qe,rt;for(j=x.length-1,W=q.length-1,We=null,Qe=!1;j>=0&&W>=0;){if(be=x[j],Oe=q[W],be.pts===Oe.pts){Qe=!0;break}be.pts>Oe.pts?j--:(j===x.length-1&&(We=W),W--)}if(!Qe&&We===null)return null;if((rt=Qe?W:We)===0)return q;var lt=q.slice(rt),Yt=lt.reduce(function(On,ii){return On.byteLength+=ii.byteLength,On.duration+=ii.duration,On.nalCount+=ii.nalCount,On},{byteLength:0,duration:0,nalCount:0});return lt.byteLength=Yt.byteLength,lt.duration=Yt.duration,lt.nalCount=Yt.nalCount,lt.pts=lt[0].pts,lt.dts=lt[0].dts,lt},this.alignGopsWith=function(q){x=q}},$a.prototype=new At,xr=function(u,c){this.numberOfTracks=0,this.metadataStream=c,(u=u||{}).remux!==void 0?this.remuxTracks=!!u.remux:this.remuxTracks=!0,typeof u.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=u.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,xr.prototype.init.call(this),this.push=function(f){return f.text?this.pendingCaptions.push(f):f.frames?this.pendingMetadata.push(f):(this.pendingTracks.push(f.track),this.pendingBytes+=f.boxes.byteLength,f.track.type==="video"&&(this.videoTrack=f.track,this.pendingBoxes.push(f.boxes)),void(f.track.type==="audio"&&(this.audioTrack=f.track,this.pendingBoxes.unshift(f.boxes))))}},xr.prototype=new At,xr.prototype.flush=function(u){var c,f,d,m,T=0,x={captions:[],captionStreams:{},metadata:[],info:{}},q=0;if(this.pendingTracks.length
=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(q=this.videoTrack.timelineStartInfo.pts,dd.forEach(function(j){x.info[j]=this.videoTrack[j]},this)):this.audioTrack&&(q=this.audioTrack.timelineStartInfo.pts,cd.forEach(function(j){x.info[j]=this.audioTrack[j]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?x.type=this.pendingTracks[0].type:x.type="combined",this.emittedTracks+=this.pendingTracks.length,d=Pi.initSegment(this.pendingTracks),x.initSegment=new Uint8Array(d.byteLength),x.initSegment.set(d),x.data=new Uint8Array(this.pendingBytes),m=0;m
=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},xr.prototype.setRemux=function(u){this.remuxTracks=u},Ja=function(u){var c,f,d=this,m=!0;Ja.prototype.init.call(this),u=u||{},this.baseMediaDecodeTime=u.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var T={};this.transmuxPipeline_=T,T.type="aac",T.metadataStream=new ar.MetadataStream,T.aacStream=new yv,T.audioTimestampRolloverStream=new ar.TimestampRolloverStream("audio"),T.timedMetadataTimestampRolloverStream=new ar.TimestampRolloverStream("timed-metadata"),T.adtsStream=new sd,T.coalesceStream=new xr(u,T.metadataStream),T.headOfPipeline=T.aacStream,T.aacStream.pipe(T.audioTimestampRolloverStream).pipe(T.adtsStream),T.aacStream.pipe(T.timedMetadataTimestampRolloverStream).pipe(T.metadataStream).pipe(T.coalesceStream),T.metadataStream.on("timestamp",function(x){T.aacStream.setTimestamp(x.timeStamp)}),T.aacStream.on("data",function(x){x.type!=="timed-metadata"&&x.type!=="audio"||T.audioSegmentStream||(f=f||{timelineStartInfo:{baseMediaDecodeTime:d.baseMediaDecodeTime},codec:"adts",type:"audio"},T.coalesceStream.numberOfTracks++,T.audioSegmentStream=new Mi(f,u),T.audioSegmentStream.on("log",d.getLogTrigger_("audioSegmentStream")),T.audioSegmentStream.on("timingInfo",d.trigger.bind(d,"audioTimingInfo")),T.adtsStream.pipe(T.audioSegmentStream).pipe(T.coalesceStream),d.trigger("trackinfo",{hasAudio:!!f,hasVideo:!!c}))}),T.coalesceStream.on("data",this.trigger.bind(this,"data")),T.coalesceStream.on("done",this.trigger.bind(this,"done")),hd(this,T)},this.setupTsPipeline=function(){var T={};this.transmuxPipeline_=T,T.type="ts",T.metadataStream=new ar.MetadataStream,T.packetStream=new ar.TransportPacketStream,T.parseStream=new ar.TransportParseStream,T.elementaryStream=new ar.ElementaryStream,T.timestampRolloverStream=new ar.TimestampRolloverStream,T.adtsStream=new sd,T.h264Stream=new _v,T.captionStream=new ar.CaptionStream(u),T.coalesceStream=new xr(u,T.metadataStream),T.headOfPipeline=T.packetStream,T.packetStream.pipe(T.parseStream).pipe(T.elementaryStream).pipe(T.timestampRolloverStream),T.timestampRolloverStream.pipe(T.h264Stream),T.timestampRolloverStream.pipe(T.adtsStream),T.timestampRolloverStream.pipe(T.metadataStream).pipe(T.coalesceStream),T.h264Stream.pipe(T.captionStream).pipe(T.coalesceStream),T.elementaryStream.on("data",function(x){var q;if(x.type==="metadata"){for(q=x.tracks.length;q--;)c||x.tracks[q].type!=="video"?!f&&x.tracks[q].type==="audio"&&((f=x.tracks[q]).timelineStartInfo.baseMediaDecodeTime=d.baseMediaDecodeTime):(c=x.tracks[q]).timelineStartInfo.baseMediaDecodeTime=d.baseMediaDecodeTime;c&&!T.videoSegmentStream&&(T.coalesceStream.numberOfTracks++,T.videoSegmentStream=new $a(c,u),T.videoSegmentStream.on("log",d.getLogTrigger_("videoSegmentStream")),T.videoSegmentStream.on("timelineStartInfo",function(j){f&&!u.keepOriginalTimestamps&&(f.timelineStartInfo=j,T.audioSegmentStream.setEarliestDts(j.dts-d.baseMediaDecodeTime))}),T.videoSegmentStream.on("processedGopsInfo",d.trigger.bind(d,"gopInfo")),T.videoSegmentStream.on("segmentTimingInfo",d.trigger.bind(d,"videoSegmentTimingInfo")),T.videoSegmentStream.on("baseMediaDecodeTime",function(j){f&&T.audioSegmentStream.setVideoBaseMediaDecodeTime(j)}),T.videoSegmentStream.on("timingInfo",d.trigger.bind(d,"videoTimingInfo")),T.h264Stream.pipe(T.videoSegmentStream).pipe(T.coalesceStream)),f&&!T.audioSegmentStream&&(T.coalesceStream.numberOfTracks++,T.audioSegmentStream=new Mi(f,u),T.audioSegmentStream.on("log",d.getLogTrigger_("audioSegmentStream")),T.audioSegmentStream.on("timingInfo",d.trigger.bind(d,"audioTimingInfo")),T.audioSegmentStream.on("segmentTimingInfo",d.trigger.bind(d,"audioSegmentTimingInfo")),T.adtsStream.pipe(T.audioSegmentStream).pipe(T.coalesceStream)),d.trigger("trackinfo",{hasAudio:!!f,hasVideo:!!c})}}),T.coalesceStream.on("data",this.trigger.bind(this,"data")),T.coalesceStream.on("id3Frame",function(x){x.dispatchType=T.metadataStream.dispatchType,d.trigger("id3Frame",x)}),T.coalesceStream.on("caption",this.trigger.bind(this,"caption")),T.coalesceStream.on("done",this.trigger.bind(this,"done")),hd(this,T)},this.setBaseMediaDecodeTime=function(T){var x=this.transmuxPipeline_;u.keepOriginalTimestamps||(this.baseMediaDecodeTime=T),f&&(f.timelineStartInfo.dts=void 0,f.timelineStartInfo.pts=void 0,Pn.clearDtsInfo(f),x.audioTimestampRolloverStream&&x.audioTimestampRolloverStream.discontinuity()),c&&(x.videoSegmentStream&&(x.videoSegmentStream.gopCache_=[]),c.timelineStartInfo.dts=void 0,c.timelineStartInfo.pts=void 0,Pn.clearDtsInfo(c),x.captionStream.reset()),x.timestampRolloverStream&&x.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(T){f&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(T)},this.setRemux=function(T){var x=this.transmuxPipeline_;u.remux=T,x&&x.coalesceStream&&x.coalesceStream.setRemux(T)},this.alignGopsWith=function(T){c&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(T)},this.getLogTrigger_=function(T){var x=this;return function(q){q.stream=T,x.trigger("log",q)}},this.push=function(T){if(m){var x=bv(T);x&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!x&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),m=!1}this.transmuxPipeline_.headOfPipeline.push(T)},this.flush=function(){m=!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()}},Ja.prototype=new At;var md,gd,vd,yd,_d,jo,Ev={Transmuxer:Ja},wv=function(u){return u>>>0},kv=function(u){return("00"+u.toString(16)).slice(-2)},Za={toUnsigned:wv,toHexString:kv},Cv=function(u){var c="";return c+=String.fromCharCode(u[0]),c+=String.fromCharCode(u[1]),c+=String.fromCharCode(u[2]),c+=String.fromCharCode(u[3])},Ir=Cv,xv=Za.toUnsigned,Iv=function u(c,f){var d,m,T,x,q,j=[];if(!f.length)return null;for(d=0;d
1?d+m:c.byteLength,T===f[0]&&(f.length===1?j.push(c.subarray(d+8,x)):(q=u(c.subarray(d+8,x),f.slice(1))).length&&(j=j.concat(q))),d=x;return j},yt=Iv,Av=Za.toUnsigned,Pv=pr.getUint64,Ov=function(u){var c={version:u[0],flags:new Uint8Array(u.subarray(1,4))};return c.version===1?c.baseMediaDecodeTime=Pv(u.subarray(4)):c.baseMediaDecodeTime=Av(u[4]<<24|u[5]<<16|u[6]<<8|u[7]),c},bd=ov,dv=function(u){return{isleading:(12&u[0])>>>2,dependsOn:3&u[0],isDependedOn:(192&u[1])>>>6,hasRedundancy:(48&u[1])>>>4,paddingValue:(14&u[1])>>>1,isNonSyncSample:1&u[1],degradationPriority:u[2]<<8|u[3]}},td=dv,lv=function(u){var c,f={version:u[0],flags:new Uint8Array(u.subarray(1,4)),samples:[]},d=new DataView(u.buffer,u.byteOffset,u.byteLength),m=1&f.flags[2],T=4&f.flags[2],x=1&f.flags[1],q=2&f.flags[1],j=4&f.flags[1],W=8&f.flags[1],be=d.getUint32(4),Oe=8;for(m&&(f.dataOffset=d.getInt32(Oe),Oe+=4),T&&be&&(c={flags:Td(u.subarray(Oe,Oe+4))},Oe+=4,x&&(c.duration=d.getUint32(Oe),Oe+=4),q&&(c.size=d.getUint32(Oe),Oe+=4),W&&(f.version===1?c.compositionTimeOffset=d.getInt32(Oe):c.compositionTimeOffset=d.getUint32(Oe),Oe+=4),f.samples.push(c),be--);be--;)c={},x&&(c.duration=d.getUint32(Oe),Oe+=4),q&&(c.size=d.getUint32(Oe),Oe+=4),j&&(c.flags=Td(u.subarray(Oe,Oe+4)),Oe+=4),W&&(f.version===1?c.compositionTimeOffset=d.getInt32(Oe):c.compositionTimeOffset=d.getUint32(Oe),Oe+=4),f.samples.push(c);return f},Sd=Lv,Mv=function(u){var c,f=new DataView(u.buffer,u.byteOffset,u.byteLength),d={version:u[0],flags:new Uint8Array(u.subarray(1,4)),trackId:f.getUint32(4)},m=1&d.flags[2],T=2&d.flags[2],x=8&d.flags[2],q=16&d.flags[2],j=32&d.flags[2],W=65536&d.flags[0],be=131072&d.flags[0];return c=8,m&&(c+=4,d.baseDataOffset=f.getUint32(12),c+=4),T&&(d.sampleDescriptionIndex=f.getUint32(c),c+=4),x&&(d.defaultSampleDuration=f.getUint32(c),c+=4),q&&(d.defaultSampleSize=f.getUint32(c),c+=4),j&&(d.defaultSampleFlags=f.getUint32(c)),W&&(d.durationIsEmpty=!0),!m&&be&&(d.baseDataOffsetIsMoof=!0),d},Ed=Mv,wd=typeof globalThis<"u"?globalthis:typeof window<"u"?window:ae.g!==void 0?Ae.g:typeof self<"u"?self:{},ri=typeof window<"u"?window:wd!==void 0?wd:typeof self<"u"?self:{},rv=di.discardemulationpreventionbytes,nv=fa.captionstream,uv=function(u,c){for(var f=u,d=0;d
0?bd(rt[0]).baseMediaDecodeTime:0,Yt=yt(be,["trun"]);c===Qe&&Yt.length>0&&(q=jv(Yt,lt,We),j=Bv(W,q,Qe),m[Qe]||(m[Qe]={seiNals:[],logs:[]}),m[Qe].seiNals=m[Qe].seiNals.concat(j.seiNals),m[Qe].logs=m[Qe].logs.concat(j.logs))}),m},qv=function(u,c,f){if(c===null)return null;var d=Fv(u,c)[c]||{};return{seiNals:d.seiNals,logs:d.logs,timescale:f}},Hv=function(){var u,c,f,d,m,T,x=!1;this.isInitialized=function(){return x},this.init=function(q){u=new Nv,x=!0,T=!!q&&q.isPartial,u.on("data",function(j){j.startTime=j.startPts/d,j.endTime=j.endPts/d,m.captions.push(j),m.captionStreams[j.stream]=!0}),u.on("log",function(j){m.logs.push(j)})},this.isNewInit=function(q,j){return!(q&&q.length===0||j&&typeof j=="object"&&Object.keys(j).length===0||f===q[0]&&d===j[f])},this.parse=function(q,j,W){var be;if(!this.isInitialized()||!j||!W)return null;if(this.isNewInit(j,W))f=j[0],d=W[f];else if(f===null||!d)return c.push(q),null;for(;c.length>0;){var Oe=c.shift();this.parse(Oe,j,W)}return(be=qv(q,f,d))&&be.logs&&(m.logs=m.logs.concat(be.logs)),be!==null&&be.seiNals?(this.pushNals(be.seiNals),this.flushStream(),m):m.logs.length?{logs:m.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(q){if(!this.isInitialized()||!q||q.length===0)return null;q.forEach(function(j){u.push(j)})},this.flushStream=function(){if(!this.isInitialized())return null;T?u.partialFlush():u.flush()},this.clearParsedCaptions=function(){m.captions=[],m.captionStreams={},m.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;u.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){c=[],f=null,d=null,m?this.clearParsedCaptions():m={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},Vv=Hv,es=Za.toUnsigned,Ni=Za.toHexString,Wv=pr.getUint64;md=function(u){var c={};return yt(u,["moov","trak"]).reduce(function(f,d){var m,T,x,q,j;return(m=yt(d,["tkhd"])[0])&&(T=m[0],q=es(m[x=T===0?12:20]<<24|m[x+1]<<16|m[x+2]<<8|m[x+3]),j=yt(d,["mdia","mdhd"])[0])?(x=(t=j[0])===0?12:20,f[q]=es(j[x]<<24|j[x+1]<<16|j[x+2]<<8|j[x+3]),f):null},c)},gd=function(u,c){var f=yt(c,["moof","traf"]).reduce(function(d,m){var T,x,q=yt(m,["tfhd"])[0],j=es(q[4]<<24|q[5]<<16|q[6]<<8|q[7]),w=u[j]||9e4,be=yt(m,["tfdt"])[0],oe=new DataView(be.buffer,be.byteOffset,be.byteLength);return typeof(T=be[0]===1?Wv(be.subarray(4,12)):Oe.getUint32(4))=="bigint"?x=T/Ri.BigInt(W):typeof T=="number"&&!isNaN(T)&&(x=T/W),x
11?(x.codec+=".",x.codec+=Ni(We[9]),x.codec+=Ni(We[10]),x.codec+=Ni(We[11])):x.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(x.codec)?(We=Qe.subarray(28),Ir(We.subarray(4,8))==="esds"&&We.length>20&&We[19]!==0?(x.codec+="."+Ni(We[19]),x.codec+="."+Ni(We[20]>>>2&63).replace(/^0/,"")):x.codec="mp4a.40.2"):x.codec=x.codec.toLowerCase())}var rt=yt(d,["mdia","mdhd"])[0];rt&&(x.timescale=jo(rt)),f.push(x)}),f};var kd={findBox:yt,parseType:Ir,timescale:md,startTime:gd,compositionStartTime:vd,videoTrackIds:yd,tracks:_d,getTimescaleFromMediaHeader:jo},Cd=function(u){var c=31&u[1];return c<<=8,c|=u[2]},ts=function(u){return!!(64&u[1])},ns=function(u){var c=0;return(48&u[3])>>>4>1&&(c+=u[4]+1),c},Gv=function(u,c){var f=Cd(u);return f===0?"pat":f===c?"pmt":c?"pes":null},zv=function(u){var c=ts(u),f=4+ns(u);return c&&(f+=u[f]+1),(31&u[f+10])<<8|u[f+11]},xv=function(u){var c={},f=ts(u),d=4+ns(u);if(f&&(d+=u[d]+1),1&u[d+5]){var m;m=3+((15&u[d+1])<<8|u[d+2])-4;for(var T=12+((15&u[d+10])<<8|u[d+11]);t
=u.byteLength)return null;var f,d=null;return 192&(f=u[c+7])&&((d={}).pts=(14&u[c+9])<<27|(255&u[c+10])<<20|(254&u[c+11])<<12|(255&u[c+12])<<5|(254&u[c+13])>>>3,d.pts*=4,d.pts+=(6&u[c+13])>>>1,d.dts=d.pts,64&f&&(d.dts=(14&u[c+14])<<27|(255&u[c+15])<<20|(254&u[c+16])<<12|(255&u[c+17])<<5|(254&u[c+18])>>>3,d.dts*=4,d.dts+=(6&u[c+18])>>>1)),d},Fo=function(u){switch(u){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}},Yv=function(u){for(var c=4+ns(u),f=u.subarray(c),d=0,m=0,T=!1;m
3&&Fo(31&f[m+3])==="slice_layer_without_partitioning_rbsp_idr"&&(T=!0),T},$v={parseType:Gv,parsePat:zv,parsePmt:Xv,parsePayloadUnitStartIndicator:ts,parsePesType:Kv,parsePesTime:Qv,videoPacketContainsKeyFrame:Yv},ri=ed.handleRollover,ht={};ht.ts=$v,ht.aac=Ya;var Ar=ct.ONE_SECOND_IN_TS,an=188,Fn=71,Jv=function(u,c){for(var f,d=0,m=an;m
=0;)if(u[q]!==Fn||u[j]!==Fn&&j!==u.byteLength)q--,j--;else{if(d=u.subarray(q,j),ht.ts.parseType(d,c.pid)==="pes"&&(m=ht.ts.parsePesType(d,c.table),T=ht.ts.parsePayloadUnitStartIndicator(d),m==="audio"&&T&&(x=ht.ts.parsePesTime(d))&&(x.type="audio",f.audio.push(x),W=!0)),W)break;q-=an,j-=an}},Zv=function(u,c,f){for(var d,m,T,x,q,j,W,be=0,Oe=an,We=!1,Qe={data:[],size:0};Oe
=0;)if(u[be]!==Fn||u[Oe]!==Fn)be--,Oe--;else{if(d=u.subarray(be,Oe),ht.ts.parseType(d,c.pid)==="pes"&&(m=ht.ts.parsePesType(d,c.table),T=ht.ts.parsePayloadUnitStartIndicator(d),m==="video"&&T&&(x=ht.ts.parsePesTime(d))&&(x.type="video",f.video.push(x),We=!0)),We)break;be-=an,Oe-=an}},ey=function(u,c){if(u.audio&&u.audio.length){var f=c;(f===void 0||isNaN(f))&&(f=u.audio[0].dts),u.audio.forEach(function(T){T.dts=ri(T.dts,f),T.pts=ri(T.pts,f),T.dtsTime=T.dts/Ar,T.ptsTime=T.pts/Ar})}if(u.video&&u.video.length){var d=c;if((d===void 0||isNaN(d))&&(d=u.video[0].dts),u.video.forEach(function(T){T.dts=ri(T.dts,d),T.pts=ri(T.pts,d),T.dtsTime=T.dts/Ar,T.ptsTime=T.pts/Ar}),u.firstKeyFrame){var m=u.firstKeyFrame;m.dts=ri(m.dts,d),m.pts=ri(m.pts,d),m.dtsTime=m.dts/Ar,m.ptsTime=m.pts/Ar}}},ty=function(u){for(var c,f=!1,d=0,m=null,T=null,x=0,q=0;u.length-q>=3;){switch(ht.aac.parseType(u,q)){case"timed-metadata":if(u.length-q<10){f=!0;break}if((x=ht.aac.parseid3tagsize(u,q))>u.length){f=!0;break}T===null&&(c=u.subarray(q,q+x),T=ht.aac.parseAacTimestamp(c)),q+=x;break;case"audio":if(u.length-q<7){f=!0;break}if((x=ht.aac.parseadtssize(u,q))>u.length){f=!0;break}m===null&&(c=u.subarray(q,q+x),m=ht.aac.parseSampleRate(c)),d++,q+=x;break;default:q++}if(f)return null}if(m===null||T===null)return null;var j=Ar/m;return{audio:[{type:"audio",dts:T,pts:T},{type:"audio",dts:T+1024*d*j,pts:T+1024*d*j}]}},ny=function(u){var c={pid:null,table:null},f={};for(var d in Jv(u,c),c.table)if(c.table.hasOwnProperty(d))switch(c.table[d]){case Gt.H264_STREAM_TYPE:f.video=[],Zv(u,c,f),f.video.length===0&&delete f.video;break;case Gt.ADTS_STREAM_TYPE:f.audio=[],xd(u,c,f),f.audio.length===0&&delete f.audio}return f},ry=function(u,c){var f;return(f=ht.aac.isLikelyAacData(u)?ty(u):ny(u))&&(f.audio||f.video)?(ey(f,c),f):null},iy={inspect:ry,parseAudioPes_:xd},ay=function(u,c){c.on("data",function(f){var d=f.initSegment;f.initSegment={data:d.buffer,byteOffset:d.byteOffset,byteLength:d.byteLength};var m=f.data;f.data=m.buffer,u.postMessage({action:"data",segment:f,byteOffset:m.byteOffset,byteLength:m.byteLength},[f.data])}),c.on("done",function(f){u.postMessage({action:"done"})}),c.on("gopInfo",function(f){u.postMessage({action:"gopInfo",gopInfo:f})}),c.on("videoSegmentTimingInfo",function(f){var d={start:{decode:ct.videoTsToSeconds(f.start.dts),presentation:ct.videoTsToSeconds(f.start.pts)},end:{decode:ct.videoTsToSeconds(f.end.dts),presentation:ct.videoTsToSeconds(f.end.pts)},baseMediaDecodeTime:ct.videoTsToSeconds(f.baseMediaDecodeTime)};f.prependedContentDuration&&(d.prependedContentDuration=ct.videoTsToSeconds(f.prependedContentDuration)),u.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:d})}),c.on("audioSegmentTimingInfo",function(f){var d={start:{decode:ct.videoTsToSeconds(f.start.dts),presentation:ct.videoTsToSeconds(f.start.pts)},end:{decode:ct.videoTsToSeconds(f.end.dts),presentation:ct.videoTsToSeconds(f.end.pts)},baseMediaDecodeTime:ct.videoTsToSeconds(f.baseMediaDecodeTime)};f.prependedContentDuration&&(d.prependedContentDuration=ct.videoTsToSeconds(f.prependedContentDuration)),u.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:d})}),c.on("id3Frame",function(f){u.postMessage({action:"id3Frame",id3Frame:f})}),c.on("caption",function(f){u.postMessage({action:"caption",caption:f})}),c.on("trackinfo",function(f){u.postMessage({action:"trackinfo",trackInfo:f})}),c.on("audioTimingInfo",function(f){u.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:ct.videoTsToSeconds(f.start),end:ct.videoTsToSeconds(f.end)}})}),c.on("videoTimingInfo",function(f){u.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:ct.videoTsToSeconds(f.start),end:ct.videoTsToSeconds(f.end)}})}),c.on("log",function(f){u.postMessage({action:"log",log:f})})},Id=function(){function u(f,d){this.options=d||{},this.self=f,this.init()}var c=u.prototype;return c.init=function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Ev.Transmuxer(this.options),ay(this.self,this.transmuxer)},c.pushMp4Captions=function(f){this.captionParser||(this.captionParser=new Vv,this.captionParser.init());var d=new Uint8Array(f.data,f.byteOffset,f.byteLength),m=this.captionParser.parse(d,f.trackIds,f.timescales);this.self.postMessage({action:"mp4Captions",captions:m&&m.captions||[],logs:m&&m.logs||[],data:d.buffer},[d.buffer])},c.probeMp4StartTime=function(f){var d=f.timescales,m=f.data,T=kd.startTime(d,m);this.self.postMessage({action:"probeMp4StartTime",startTime:T,data:m},[m.buffer])},c.probeMp4Tracks=function(f){var d=f.data,m=kd.tracks(d);this.self.postMessage({action:"probeMp4Tracks",tracks:m,data:d},[d.buffer])},c.probeTs=function(f){var d=f.data,m=f.baseStartTime,T=typeof m!="number"||isNaN(m)?void 0:m*ct.ONE_SECOND_IN_TS,x=iy.inspect(d,T),q=null;x&&((q={hasVideo:x.video&&x.video.length===2||!1,hasAudio:x.audio&&x.audio.length===2||!1}).hasVideo&&(q.videoStart=x.video[0].ptsTime),q.hasAudio&&(q.audioStart=x.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:q,data:d},[d.buffer])},c.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions()},c.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions()},c.push=function(f){var d=new Uint8Array(f.data,f.byteOffset,f.byteLength);this.transmuxer.push(d)},c.reset=function(){this.transmuxer.reset()},c.setTimestampOffset=function(f){var d=f.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(ct.secondsToVideoTs(d)))},c.setAudioAppendStart=function(f){this.transmuxer.setAudioAppendStart(Math.ceil(ct.secondsToVideoTs(f.appendStart)))},c.setRemux=function(f){this.transmuxer.setRemux(f.remux)},c.flush=function(f){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})},c.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})},c.alignGopsWith=function(f){this.transmuxer.alignGopsWith(f.gopsToAlignWith.slice())},u}();self.onmessage=function(u){u.data.action==="init"&&u.data.options?this.messageHandlers=new Id(self,u.data.options):(this.messageHandlers||(this.messageHandlers=new Id(self)),u.data&&u.data.action&&u.data.action!=="init"&&this.messageHandlers[u.data.action]&&this.messageHandlers[u.data.action](u.data))}})),Xf=dc(zf),Kf=function(t,i,r){var e=t.data.segment,n=e.type,a=e.initSegment,s=e.captions,o=e.captionStreams,l=e.metadata,h=e.videoFrameDtsTime,g=e.videoFramePtsTime;i.buffer.push({captions:s,captionStreams:o,metadata:l});var b=t.data.segment.boxes||{data:t.data.segment.data},_={type:n,data:new Uint8Array(b.data,b.data.byteOffset,b.data.byteLength),initSegment:new Uint8Array(a.data,a.byteOffset,a.byteLength)};h!==void 0&&(_.videoFrameDtsTime=h),g!==void 0&&(_.videoFramePtsTime=g),r(_)},Qf=function(t){var i=t.transmuxedData,r=t.callback;i.buffer=[],r(i)},Yf=function(t,i){i.gopInfo=t.data.gopInfo},fc=function(t){var i=t.transmuxer,r=t.bytes,e=t.audioAppendStart,n=t.gopsToAlignWith,a=t.remux,s=t.onData,o=t.onTrackInfo,l=t.onAudioTimingInfo,h=t.onVideoTimingInfo,g=t.onVideoSegmentTimingInfo,b=t.onAudioSegmentTimingInfo,_=t.onId3,G=t.onCaptions,ne=t.onDone,_e=t.onEndedTimeline,re=t.onTransmuxerLog,Ue=t.isEndOfTimeline,Ge={buffer:[]},Te=Ue,De=function(Ce){i.currentTransmux===t&&(Ce.data.action==="data"&&Kf(Ce,Ge,s),Ce.data.action==="trackinfo"&&o(Ce.data.trackInfo),Ce.data.action==="gopInfo"&&Yf(Ce,Ge),Ce.data.action==="audioTimingInfo"&&l(Ce.data.audioTimingInfo),Ce.data.action==="videoTimingInfo"&&h(Ce.data.videoTimingInfo),Ce.data.action==="videoSegmentTimingInfo"&&g(Ce.data.videoSegmentTimingInfo),Ce.data.action==="audioSegmentTimingInfo"&&b(Ce.data.audioSegmentTimingInfo),Ce.data.action==="id3Frame"&&_([Ce.data.id3Frame],Ce.data.id3Frame.dispatchType),Ce.data.action==="caption"&&G(Ce.data.caption),Ce.data.action==="endedtimeline"&&(Te=!1,_e()),Ce.data.action==="log"&&re(Ce.data.log),Ce.data.type==="transmuxed"&&(Te||(i.onmessage=null,Qf({transmuxedData:Ge,callback:ne}),mc(i))))};if(i.onmessage=De,e&&i.postMessage({action:"setAudioAppendStart",appendStart:e}),Array.isArray(n)&&i.postMessage({action:"alignGopsWith",gopsToAlignWith:n}),a!==void 0&&i.postMessage({action:"setRemux",remux:a}),r.byteLength){var Se=r instanceof ArrayBuffer?r:r.buffer,Me=r instanceof ArrayBuffer?0:r.byteOffset;i.postMessage({action:"push",data:Se,byteOffset:Me,byteLength:r.byteLength},[Se])}Ue&&i.postMessage({action:"endTimeline"}),i.postMessage({action:"flush"})},mc=function(t){t.currentTransmux=null,t.transmuxQueue.length&&(t.currentTransmux=t.transmuxQueue.shift(),typeof t.currentTransmux=="function"?t.currentTransmux():fc(t.currentTransmux))},gc=function(t,i){t.postMessage({action:i}),mc(t)},vc=function(t,i){if(!i.currentTransmux)return i.currentTransmux=t,void gc(i,t);i.transmuxQueue.push(gc.bind(null,i,t))},$f=function(t){vc("reset",t)},Jf=function(t){vc("endTimeline",t)},yc=function(t){if(!t.transmuxer.currentTransmux)return t.transmuxer.currentTransmux=t,void fc(t);t.transmuxer.transmuxQueue.push(t)},Zf=function(t){var i=new Xf;i.currentTransmux=null,i.transmuxQueue=[];var r=i.terminate;return i.terminate=function(){return i.currentTransmux=null,i.transmuxQueue.length=0,r.call(i)},i.postMessage({action:"init",options:t}),i},To={reset:$f,endTimeline:Jf,transmux:yc,createTransmuxer:Zf},Ca=function(t){var i=t.transmuxer,r=t.endAction||t.action,e=t.callback,n=Ee({},t,{endAction:null,transmuxer:null,callback:null}),a=function l(h){h.data.action===r&&(i.removeEventListener("message",l),h.data.data&&(h.data.data=new Uint8Array(h.data.data,t.byteOffset||0,t.byteLength||h.data.data.byteLength),t.data&&(t.data=h.data.data)),e(h.data))};if(i.addEventListener("message",a),t.data){var s=t.data instanceof ArrayBuffer;n.byteOffset=s?0:t.data.byteOffset,n.byteLength=t.data.byteLength;var o=[s?t.data:t.data.buffer];i.postMessage(n,o)}else i.postMessage(n)},Bn={FAILURE:2,TIMEOUT:-101,ABORTED:-102},So=function(t){t.forEach(function(i){i.abort()})},em=function(t){return{bandwidth:t.bandwidth,bytesReceived:t.bytesReceived||0,roundTripTime:t.roundTripTime||0}},tm=function(t){var i=t.target,r={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-i.requestTime||0};return r.bytesReceived=t.loaded,r.bandwidth=Math.floor(r.bytesReceived/r.roundTripTime*8*1e3),r},Eo=function(t,i){return i.timedout?{status:i.status,message:"HLS request timed-out at URL: "+i.uri,code:Bn.TIMEOUT,xhr:i}:i.aborted?{status:i.status,message:"HLS request aborted at URL: "+i.uri,code:Bn.ABORTED,xhr:i}:t?{status:i.status,message:"HLS request errored at URL: "+i.uri,code:Bn.FAILURE,xhr:i}:i.responseType==="arraybuffer"&&i.response.byteLength===0?{status:i.status,message:"Empty HLS response at URL: "+i.uri,code:Bn.FAILURE,xhr:i}:null},_c=function(t,i,r){return function(e,n){var a=n.response,s=Eo(e,n);if(s)return r(s,t);if(a.byteLength!==16)return r({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:Bn.FAILURE,xhr:n},t);for(var o=new DataView(a),l=new Uint32Array([o.getUint32(0),o.getUint32(4),o.getUint32(8),o.getUint32(12)]),h=0;h
1)return cm("multiple "+r+" codecs found as attributes: "+i[r].join(", ")+". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs."),void(i[r]=null);i[r]=i[r][0]}),i},wc=function(t){var i=0;return t.audio&&i++,t.video&&i++,i},Ci=function(t,i){var r=i.attributes||{},e=xa(dm(i)||[]);if(Ec(t,i)&&!e.audio&&!hm(t,i)){var n=xa(fe(t,r.AUDIO)||[]);n.audio&&(e.audio=n.audio)}return e},Ia=An("PlaylistSelector"),kc=function(t){if(t&&t.playlist){var i=t.playlist;return JSON.stringify({id:i.id,bandwidth:t.bandwidth,width:t.width,height:t.height,codecs:i.attributes&&i.attributes.CODECS||""})}},Aa=function(t,i){if(!t)return"";var r=O().getComputedStyle(t);return r?r[i]:""},Zr=function(t,i){var r=t.slice();t.sort(function(e,n){var a=i(e,n);return a===0?r.indexOf(e)-r.indexOf(n):a})},wo=function(t,i){var r,e;return t.attributes.BANDWIDTH&&(r=t.attributes.BANDWIDTH),r=r||O().Number.MAX_VALUE,i.attributes.BANDWIDTH&&(e=i.attributes.BANDWIDTH),r-(e=e||O().Number.MAX_VALUE)},pm=function(t,i){var r,e;return t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(r=t.attributes.RESOLUTION.width),r=r||O().Number.MAX_VALUE,i.attributes.RESOLUTION&&i.attributes.RESOLUTION.width&&(e=i.attributes.RESOLUTION.width),r===(e=e||O().Number.MAX_VALUE)&&t.attributes.BANDWIDTH&&i.attributes.BANDWIDTH?t.attributes.BANDWIDTH-i.attributes.BANDWIDTH:r-e},Cc=function(t,i,r,e,n,a){if(t){var s={bandwidth:i,width:r,height:e,limitRenditionByPlayerDimensions:n},o=t.playlists;ln.isAudioOnly(t)&&(o=a.getAudioTrackPlaylists_(),s.audioOnly=!0);var l=o.map(function(Ne){var Ye=Ne.attributes&&Ne.attributes.RESOLUTION&&Ne.attributes.RESOLUTION.width,tt=Ne.attributes&&Ne.attributes.RESOLUTION&&Ne.attributes.RESOLUTION.height;return{bandwidth:Ne.attributes&&Ne.attributes.BANDWIDTH||O().Number.MAX_VALUE,width:Ye,height:tt,playlist:Ne}});Zr(l,function(Ne,Ye){return Ne.bandwidth-Ye.bandwidth});var h=(l=l.filter(function(Ne){return!ln.isIncompatible(Ne.playlist)})).filter(function(Ne){return ln.isEnabled(Ne.playlist)});h.length||(h=l.filter(function(Ne){return!ln.isDisabled(Ne.playlist)}));var g=h.filter(function(Ne){return Ne.bandwidth*Ht.BANDWIDTH_VARIANCE
r||Ne.height>e})).filter(function(Ne){return Ne.width===Ue[0].width&&Ne.height===Ue[0].height}),b=Ge[Ge.length-1],Te=Ge.filter(function(Ne){return Ne.bandwidth===b.bandwidth})[0]),a.experimentalLeastPixelDiffSelector){var Me=_e.map(function(Ne){return Ne.pixelDiff=Math.abs(Ne.width-r)+Math.abs(Ne.height-e),Ne});Zr(Me,function(Ne,Ye){return Ne.pixelDiff===Ye.pixelDiff?Ye.bandwidth-Ne.bandwidth:Ne.pixelDiff-Ye.pixelDiff}),De=Me[0]}var Ce=De||Te||Se||_||h[0]||l[0];if(Ce&&Ce.playlist){var ze="sortedPlaylistReps";return De?ze="leastPixelDiffRep":Te?ze="resolutionPlusOneRep":Se?ze="resolutionBestRep":_?ze="bandwidthBestRep":h[0]&&(ze="enabledPlaylistReps"),Ia("choosing "+kc(Ce)+" using "+ze+" with options",s),Ce.playlist}return Ia("could not choose a playlist with options",s),null}},xc=function(){var t=this.useDevicePixelRatio&&O().devicePixelRatio||1;return Cc(this.playlists.master,this.systemBandwidth,parseInt(Aa(this.tech_.el(),"width"),10)*t,parseInt(Aa(this.tech_.el(),"height"),10)*t,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},fm=function(t){var i=-1,r=-1;if(t<0||t>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var e=this.useDevicePixelRatio&&O().devicePixelRatio||1;return i<0&&(i=this.systembandwidth,r=this.systembandwidth),this.systembandwidth>0&&this.systemBandwidth!==r&&(i=t*this.systemBandwidth+(1-t)*i,r=this.systemBandwidth),Cc(this.playlists.master,i,parseInt(Aa(this.tech_.el(),"width"),10)*e,parseInt(Aa(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},mm=function(t){var i=t.master,r=t.currentTime,e=t.bandwidth,n=t.duration,a=t.segmentDuration,s=t.timeUntilRebuffer,o=t.currentTimeline,l=t.syncController,h=i.playlists.filter(function(G){return!ln.isIncompatible(G)}),g=h.filter(ln.isEnabled);g.length||(g=h.filter(function(G){return!ln.isDisabled(G)}));var b=g.filter(ln.hasAttribute.bind(null,"BANDWIDTH")).map(function(G){var ne=l.getSyncPoint(G,n,o,r)?1:2;return{playlist:G,rebufferingImpact:ln.estimateSegmentRequestTime(a,e,G)*ne-s}}),_=b.filter(function(G){return G.rebufferingImpact<=0});return Zr(_,function(G,ne){return wo(ne.playlist,G.playlist)}),_.length?_[0]:(Zr(b,function(G,ne){return G.rebufferingImpact-ne.rebufferingImpact}),b[0]||null)},gm=function(){var t=this,i=this.playlists.master.playlists.filter(ln.isEnabled);return Zr(i,function(r,e){return wo(r,e)}),i.filter(function(r){return!!Ci(t.playlists.master,r).video})[0]||null},vm=function(t){var i,r=0;return t.bytes&&(i=new Uint8Array(t.bytes),t.segments.forEach(function(e){i.set(e,r),r+=e.byteLength})),i},ym=function(t,i,r){if(!t[r]){i.trigger({type:"usage",name:"vhs-608"}),i.trigger({type:"usage",name:"hls-608"});var e=r;/^cc708_/.test(r)&&(e="SERVICE"+r.split("_")[1]);var n=i.textTracks().getTrackById(e);if(n)t[r]=n;else{var a=r,s=r,o=!1,l=(i.options_.vhs&&i.options_.vhs.captionServices||{})[e];l&&(a=l.label,s=l.language,o=l.default),t[r]=i.addRemoteTextTrack({kind:"captions",id:e,default:o,label:a,language:s},!1).track}}},_m=function(t){var i=t.inbandTextTracks,r=t.captionArray,e=t.timestampOffset;if(r){var n=O().WebKitDataCue||O().VTTCue;r.forEach(function(a){var s=a.stream;i[s].addCue(new n(a.startTime+e,a.endTime+e,a.text))})}},bm=function(t){Object.defineProperties(t.frame,{id:{get:function(){return he.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),t.value.key}},value:{get:function(){return he.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),t.value.data}},privateData:{get:function(){return he.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),t.value.data}}})},Tm=function(t){var i=t.inbandTextTracks,r=t.metadataArray,e=t.timestampOffset,n=t.videoDuration;if(r){var a=O().WebKitDataCue||O().VTTCue,s=i.metadataTrack_;if(s&&(r.forEach(function(_){var G=_.cueTime+e;typeof G!="number"||O().isNaN(G)||G<0||!(g<1/0)||_.frames.foreach(function(ne){var _e=new a(G,G,ne.value||ne.url||ne.data||"");_e.frame=ne,_e.value=ne,bm(_e),s.addCue(_e)})}),s.cues&&s.cues.length)){for(var o=s.cues,l=[],h=0;h
=t&&n.endTime<=i&&r.removecue(n)},em=function(t){var i=t.cues;if(i)for(var r=0;r
1&&e.push(i[a]);e.length&&e.forEach(function(s){return t.removeCue(s)})}},wm=function(t,i,r){if(i==null||!t.length)return[];var e,n=Math.ceil((i-r+3)*zi.ONE_SECOND_IN_TS);for(e=0;e
n);e++);return t.slice(e)},km=function(t,i,r){if(!i.length)return t;if(r)return i.slice();for(var e=i[0].pts,n=0;n
=e);n++);return t.slice(0,n).concat(i)},Cm=function(t,i,r,e){for(var n=Math.ceil((i-e)*zi.ONE_SECOND_IN_TS),a=Math.ceil((r-e)*zi.ONE_SECOND_IN_TS),s=t.slice(),o=t.length;o--&&!(t[o].pts<=a););if(o===-1)return s;for(var l=o+1;l--&&!(t[l].pts<=n););return l=Math.max(l,0),s.splice(l,o-l+1),s},xm=function(t,i){if(!t&&!i||!t&&i||t&&!i)return!1;if(t===i)return!0;var r=Object.keys(t).sort(),e=Object.keys(i).sort();if(r.length!==e.length)return!1;for(var n=0;n
r))return a}return e.length===0?0:e[e.length-1]},Ii=1,Am=500,Ac=function(t){return typeof t=="number"&&isFinite(t)},Pa=1/60,Pm=function(t,i,r){return t==="main"&&i&&r?r.hasAudio||r.hasVideo?i.hasVideo&&!r.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.":!i.hasVideo&&r.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},Om=function(t,i,r){var e=i-Ht.BACK_BUFFER_LENGTH;t.length&&(e=Math.max(e,t.start(0)));var n=i-r;return Math.min(n,e)},ei=function(t){var i=t.startOfSegment,r=t.duration,e=t.segment,n=t.part,a=t.playlist,s=a.mediaSequence,o=a.id,l=a.segments,h=l===void 0?[]:l,g=t.mediaIndex,b=t.partIndex,_=t.timeline,G=h.length-1,ne="mediaIndex/partIndex increment";t.getMediaInfoForTime?ne="getMediaInfoForTime ("+t.getMediaInfoForTime+")":t.isSyncRequest&&(ne="getSyncSegmentCandidate (isSyncRequest)"),t.independent&&(ne+=" with independent "+t.independent);var _e=typeof b=="number",re=t.segment.uri?"segment":"pre-segment",Ue=_e?ql({preloadSegment:e})-1:0;return re+" ["+(s+g)+"/"+(s+G)+"]"+(_e?" part ["+b+"/"+Ue+"]":"")+" segment start/end ["+e.start+" => "+e.end+"]"+(_e?" part start/end ["+n.start+" => "+n.end+"]":"")+" startOfSegment ["+i+"] duration ["+r+"] timeline ["+_+"] selected by ["+ne+"] playlist ["+o+"]"},Pc=function(t){return t+"TimingInfo"},Dm=function(t){var i=t.segmentTimeline,r=t.currentTimeline,e=t.startOfSegment,n=t.buffered;return t.overrideCheck||i!==r?i
i&&(i=n)}}),typeof i=="bigint"&&i
r+dr},Mm=function(t,i){if(i!=="hls")return null;var r=Lm({audioTimingInfo:t.audioTimingInfo,videoTimingInfo:t.videoTimingInfo});if(!r)return null;var e=t.playlist.targetDuration,n=Dc({segmentDuration:r,maxDuration:2*e}),a=Dc({segmentDuration:r,maxDuration:e}),s="Segment with index "+t.mediaIndex+" from playlist "+t.playlist.id+" has a duration of "+r+" when the reported duration is "+t.duration+" and the target duration is "+e+". 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 n||a?{severity:n?"warn":"info",message:s}:null},ko=function(t){function i(e,n){var a;if(a=t.call(this)||this,!e)throw new TypeError("Initialization settings are required");if(typeof e.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");return a.bandwidth=e.bandwidth,a.throughput={rate:0,count:0},a.roundTrip=NaN,a.resetStats_(),a.mediaIndex=null,a.partIndex=null,a.hasPlayed_=e.hasPlayed,a.currentTime_=e.currentTime,a.seekable_=e.seekable,a.seeking_=e.seeking,a.duration_=e.duration,a.mediaSource_=e.mediaSource,a.vhs_=e.vhs,a.loaderType_=e.loaderType,a.currentMediaInfo_=void 0,a.startingMediaInfo_=void 0,a.segmentMetadataTrack_=e.segmentMetadataTrack,a.goalBufferLength_=e.goalBufferLength,a.sourceType_=e.sourceType,a.sourceUpdater_=e.sourceUpdater,a.inbandTextTracks_=e.inbandTextTracks,a.state_="INIT",a.timelineChangeController_=e.timelineChangeController,a.shouldSaveSegmentTimingInfo_=!0,a.parse708captions_=e.parse708captions,a.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,a.captionServices_=e.captionServices,a.experimentalExactManifestTimings=e.experimentalExactManifestTimings,a.checkBufferTimeout_=null,a.error_=void 0,a.currentTimeline_=-1,a.pendingSegment_=null,a.xhrOptions_=null,a.pendingSegments_=[],a.audioDisabled_=!1,a.isPendingTimestampOffset_=!1,a.gopBuffer_=[],a.timeMapping_=0,a.safeAppend_=he.browser.IE_VERSION>=11,a.appendInitSegment_={audio:!0,video:!0},a.playlistOfLastInitSegment_={audio:null,video:null},a.callQueue_=[],a.loadQueue_=[],a.metadataQueue_={id3:[],caption:[]},a.waitingOnRemove_=!1,a.quotaExceededErrorRetryTimeout_=null,a.activeInitSegmentId_=null,a.initSegments_={},a.cacheEncryptionKeys_=e.cacheEncryptionKeys,a.keyCache_={},a.decrypter_=e.decrypter,a.syncController_=e.syncController,a.syncPoint_={segmentIndex:0,time:0},a.transmuxer_=a.createTransmuxer_(),a.triggerSyncInfoUpdate_=function(){return a.trigger("syncinfoupdate")},a.syncController_.on("syncinfoupdate",a.triggerSyncInfoUpdate_),a.mediaSource_.addEventListener("sourceopen",function(){a.isEndOfStream_()||(a.ended_=!1)}),a.fetchAtBuffer_=!1,a.logger_=An("SegmentLoader["+a.loaderType_+"]"),Object.defineProperty(w(a),"state",{get:function(){return this.state_},set:function(s){s!==this.state_&&(this.logger_(this.state_+" -> "+s),this.state_=s,this.trigger("statechange"))}}),a.sourceUpdater_.on("ready",function(){a.hasEnoughInfoToAppend_()&&a.processCallQueue_()}),a.loaderType_==="main"&&a.timelineChangeController_.on("pendingtimelinechange",function(){a.hasEnoughInfoToAppend_()&&a.processCallQueue_()}),a.loaderType_==="audio"&&a.timelineChangeController_.on("timelinechange",function(){a.hasEnoughInfoToLoad_()&&a.processLoadQueue_(),a.hasEnoughInfoToAppend_()&&a.processCallQueue_()}),a}y(i,t);var r=i.prototype;return r.createTransmuxer_=function(){return To.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})},r.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0},r.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&O().clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},r.setAudio=function(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},r.abort=function(){this.state==="WAITING"?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)},r.abort_=function(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,O().clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},r.checkForAbort_=function(e){return this.state!=="APPENDING"||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)},r.error=function(e){return e!==void 0&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_},r.endOfStream=function(){this.ended_=!0,this.transmuxer_&&To.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},r.buffered_=function(){var e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return he.createTimeRanges();if(this.loaderType_==="main"){var n=e.hasAudio,a=e.hasVideo,s=e.isMuxed;if(a&&n&&!this.audioDisabled_&&!s)return this.sourceUpdater_.buffered();if(a)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},r.initSegmentForMap=function(e,n){if(n===void 0&&(n=!1),!e)return null;var a=ka(e),s=this.initSegments_[a];return n&&!s&&e.bytes&&(this.initSegments_[a]=s={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),s||e},r.segmentKey=function(e,n){if(n===void 0&&(n=!1),!e)return null;var a=rc(e),s=this.keyCache_[a];this.cacheEncryptionKeys_&&n&&!s&&e.bytes&&(this.keyCache_[a]=s={resolvedUri:e.resolvedUri,bytes:e.bytes});var o={resolvedUri:(s||e).resolvedUri};return s&&(o.bytes=s.bytes),o},r.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},r.load=function(){if(this.monitorBuffer_(),this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}},r.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},r.playlist=function(e,n){if(n===void 0&&(n={}),e){var a=this.playlist_,s=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=n,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));var o=null;if(a&&(a.id?o=a.id:a.uri&&(o=a.uri)),this.logger_("playlist update ["+o+" => "+(e.id||e.uri)+"]"),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!a||a.uri!==e.uri)return this.mediaIndex!==null&&(e.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");var l=e.mediaSequence-a.mediaSequence;if(this.logger_("live window shift ["+l+"]"),this.mediaIndex!==null)if(this.mediaIndex-=l,this.mediaIndex<0)this.mediaindex=null,this.partindex=null;else{var h=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!h.parts||!h.parts.length||!h.parts[this.partIndex])){var g=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=g}}s&&(s.mediaIndex-=l,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(a,e)}},r.pause=function(){this.checkBufferTimeout_&&(O().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},r.paused=function(){return this.checkBufferTimeout_===null},r.resetEverything=function(e){this.ended_=!1,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"}))},r.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},r.resyncLoader=function(){this.transmuxer_&&To.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})},r.remove=function(e,n,a,s){if(a===void 0&&(a=function(){}),s===void 0&&(s=!1),n===1/0&&(n=this.duration_()),n<=e)this.logger_("skipping remove because end ${end} is <= start ${start}");else if(this.sourceUpdater_&&this.getMediaInfo_()){var o=1,l=function(){--o==0&&a()};for(var h in(s||!this.audioDisabled_)&&(o++,this.sourceUpdater_.removeAudio(e,n,l)),(s||this.loaderType_==="main")&&(this.gopBuffer_=Cm(this.gopBuffer_,e,n,this.timeMapping_),o++,this.sourceUpdater_.removeVideo(e,n,l)),this.inbandTextTracks_)xi(e,n,this.inbandTextTracks_[h]);xi(e,n,this.segmentMetadataTrack_),l()}else this.logger_("skipping remove because no source updater or starting media info")},r.monitorBuffer_=function(){this.checkBufferTimeout_&&O().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=O().setTimeout(this.monitorBufferTick_.bind(this),1)},r.monitorBufferTick_=function(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&O().clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=O().setTimeout(this.monitorBufferTick_.bind(this),Am)},r.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var e=this.chooseNextRequest_();!e||(typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}},r.isEndOfStream_=function(e,n,a){if(e===void 0&&(e=this.mediaIndex),n===void 0&&(n=this.playlist_),a===void 0&&(a=this.partIndex),!n||!this.mediaSource_)return!1;var s=typeof e=="number"&&n.segments[e],o=e+1===n.segments.length,l=!s||!s.parts||a+1===s.parts.length;return n.endList&&this.mediaSource_.readyState==="open"&&o&&l},r.chooseNextRequest_=function(){var e=this.buffered_(),n=Bl(e)||0,a=uo(e,this.currentTime_()),s=!this.hasPlayed_()&&a>=1,o=a>=this.goalBufferLength_(),l=this.playlist_.segments;if(!l.length||s||o)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var h={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(h.isSyncRequest)h.mediaIndex=Im(this.currentTimeline_,l,n);else if(this.mediaIndex!==null){var g=l[this.mediaIndex],b=typeof this.partIndex=="number"?this.partIndex:-1;h.startOfSegment=g.end?g.end:n,g.parts&&g.parts[b+1]?(h.mediaIndex=this.mediaIndex,h.partIndex=b+1):h.mediaIndex=this.mediaIndex+1}else{var _=ln.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?n:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),G=_.segmentIndex,ne=_.startTime,_e=_.partIndex;h.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+n:"currentTime "+this.currentTime_(),h.mediaIndex=G,h.startOfSegment=ne,h.partIndex=_e}var re=l[h.mediaIndex],Ue=re&&typeof h.partIndex=="number"&&re.parts&&re.parts[h.partIndex];if(!re||typeof h.partIndex=="number"&&!Ue)return null;if(typeof h.partIndex!="number"&&re.parts&&(h.partIndex=0,Ue=re.parts[0]),!a&&Ue&&!Ue.independent)if(h.partIndex===0){var Ge=l[h.mediaIndex-1],Te=Ge.parts&&Ge.parts.length&&Ge.parts[Ge.parts.length-1];Te&&Te.independent&&(h.mediaIndex-=1,h.partIndex=Ge.parts.length-1,h.independent="previous segment")}else re.parts[h.partIndex-1].independent&&(h.partIndex-=1,h.independent="previous part");var De=this.mediaSource_&&this.mediaSource_.readyState==="ended";return h.mediaIndex>=l.length-1&&De&&!this.seeking_()?null:this.generateSegmentInfo_(h)},r.generateSegmentInfo_=function(e){var n=e.independent,a=e.playlist,s=e.mediaIndex,o=e.startOfSegment,l=e.isSyncRequest,h=e.partIndex,g=e.forceTimestampOffset,b=e.getMediaInfoForTime,_=a.segments[s],G=typeof h=="number"&&_.parts[h],ne={requestId:"segment-loader-"+Math.random(),uri:G&&G.resolvedUri||_.resolvedUri,mediaIndex:s,partIndex:G?h:null,isSyncRequest:l,startOfSegment:o,playlist:a,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:_.timeline,duration:G&&G.duration||_.duration,segment:_,part:G,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:b,independent:n},_e=g!==void 0?g:this.isPendingTimestampOffset_;ne.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:_.timeline,currentTimeline:this.currentTimeline_,startOfSegment:o,buffered:this.buffered_(),overrideCheck:_e});var re=Bl(this.sourceUpdater_.audioBuffered());return typeof re=="number"&&(ne.audioAppendStart=re-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(ne.gopsToAlignWith=wm(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),ne},r.timestampOffsetForSegment_=function(e){return Dm(e)},r.earlyAbortWhenNeeded_=function(e){if(!this.vhs_.tech_.paused()&&this.xhrOptions_.timeout&&this.playlist_.attributes.BANDWIDTH&&!(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)){var n=this.currentTime_(),a=e.bandwidth,s=this.pendingSegment_.duration,o=ln.estimateSegmentRequestTime(s,a,this.playlist_,e.bytesReceived),l=rf(this.buffered_(),n,this.vhs_.tech_.playbackRate())-1;if(!(o<=l)){var h=mm({master:this.vhs_.playlists.master,currentTime:n,bandwidth:a,duration:this.duration_(),segmentDuration:s,timeUntilRebuffer:l,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(h){var g=o-l-h.rebufferingImpact,b=.5;l<=dr&&(b=1),h.playlist&&h.playlist.uri!==this.playlist_.uri&&!(g
"+b+" for "+l),ym(G,a.vhs_.tech_,l),xi(g,b,G[l]),_m({captionArray:_,inbandTextTracks:G,timestampOffset:s})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}},r.handleId3_=function(e,n,a){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(!this.pendingSegment_.hasAppendedData_)return void this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,n,a));var s=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();Sm(this.inbandTextTracks_,a,this.vhs_.tech_),Tm({inbandTextTracks:this.inbandTextTracks_,metadataArray:n,timestampOffset:s,videoDuration:this.duration_()})}},r.processMetadataQueue_=function(){this.metadataQueue_.id3.forEach(function(e){return e()}),this.metadataQueue_.caption.forEach(function(e){return e()}),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]},r.processCallQueue_=function(){var e=this.callQueue_;this.callQueue_=[],e.forEach(function(n){return n()})},r.processLoadQueue_=function(){var e=this.loadQueue_;this.loadQueue_=[],e.forEach(function(n){return n()})},r.hasEnoughInfoToLoad_=function(){if(this.loaderType_!=="audio")return!0;var e=this.pendingSegment_;return!(!e||this.getCurrentMediaInfo_()&&Oc({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},r.getCurrentMediaInfo_=function(e){return e===void 0&&(e=this.pendingSegment_),e&&e.trackInfo||this.currentMediaInfo_},r.getMediaInfo_=function(e){return e===void 0&&(e=this.pendingSegment_),this.getCurrentMediaInfo_(e)||this.startingMediaInfo_},r.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var e=this.pendingSegment_,n=this.getCurrentMediaInfo_();if(!e||!n)return!1;var a=n.hasAudio,s=n.hasVideo,o=n.isMuxed;return!(s&&!e.videoTimingInfo||a&&!this.audioDisabled_&&!o&&!e.audioTimingInfo||Oc({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},r.handleData_=function(e,n){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)){if(this.callQueue_.length||!this.hasEnoughInfoToAppend_())return void this.callQueue_.push(this.handleData_.bind(this,e,n));var a=this.pendingSegment_;if(this.setTimeMapping_(a.timeline),this.updateMediaSecondsLoaded_(a.part||a.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),a.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),a.isFmp4=e.isFmp4,a.timingInfo=a.timingInfo||{},a.isFmp4)this.trigger("fmp4"),a.timingInfo.start=a[Pc(n.type)].start;else{var s,o=this.getCurrentMediaInfo_(),l=this.loaderType_==="main"&&o&&o.hasVideo;l&&(s=a.videoTimingInfo.start),a.timingInfo.start=this.trueSegmentStart_({currentStart:a.timingInfo.start,playlist:a.playlist,mediaIndex:a.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:l,firstVideoFrameTimeForData:s,videoTimingInfo:a.videoTimingInfo,audioTimingInfo:a.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(a,n.type),this.updateSourceBufferTimestampOffset_(a),a.isSyncRequest){this.updateTimingInfoEnd_(a),this.syncController_.saveSegmentTimingInfo({segmentInfo:a,shouldSaveTimelineMapping:this.loaderType_==="main"});var h=this.chooseNextRequest_();if(h.mediaIndex!==a.mediaIndex||h.partIndex!==a.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}a.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(a,n)}}},r.updateAppendInitSegmentStatus=function(e,n){this.loaderType_==="main"&&typeof e.timestampOffset=="number"&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[n]!==e.playlist&&(this.appendInitSegment_[n]=!0)},r.getInitSegmentAndUpdateState_=function(e){var n=e.type,a=e.initSegment,s=e.map,o=e.playlist;if(s){var l=ka(s);if(this.activeInitSegmentId_===l)return null;a=this.initSegmentForMap(s,!0).bytes,this.activeInitSegmentId_=l}return a&&this.appendInitSegment_[n]?(this.playlistOfLastInitSegment_[n]=o,this.appendInitSegment_[n]=!1,this.activeInitSegmentId_=null,a):null},r.handleQuotaExceededError_=function(e,n){var a=this,s=e.segmentInfo,o=e.type,l=e.bytes,h=this.sourceUpdater_.audioBuffered(),g=this.sourceUpdater_.videoBuffered();h.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Er(h).join(", ")),g.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Er(g).join(", "));var b=h.length?h.start(0):0,_=h.length?h.end(h.length-1):0,G=g.length?g.start(0):0,ne=g.length?g.end(g.length-1):0;if(_-b<=ii&&ne-g<=ii)return this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: "+l.byteLength+", audio buffer: "+Er(h).join(", ")+", video buffer: "+Er(g).join(", ")+", "),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:s,type:o,bytes:l}));var _e=this.currentTime_()-Ii;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+_e),this.remove(0,_e,function(){a.logger_("On QUOTA_EXCEEDED_ERR, retrying append in "+Ii+"s"),a.waitingOnRemove_=!1,a.quotaExceededErrorRetryTimeout_=O().setTimeout(function(){a.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),a.quotaExceededErrorRetryTimeout_=null,a.processCallQueue_()},1e3*Ii)},!0)},r.handleAppendError_=function(e,n){var a=e.segmentInfo,s=e.type,o=e.bytes;if(n){if(n.code===Ic)return void this.handleQuotaExceededError_({segmentInfo:a,type:s,bytes:o});this.logger_("Received non QUOTA_EXCEEDED_ERR on append",n),this.error(s+" append of "+o.length+"b failed for segment #"+a.mediaIndex+" in playlist "+a.playlist.id),this.trigger("appenderror")}},r.appendToSourceBuffer_=function(e){var n=e.segmentInfo,a=e.type,s=e.initSegment,o=e.data,l=e.bytes;if(!l){var h=[o],g=o.byteLength;s&&(h.unshift(s),g+=s.byteLength),l=vm({bytes:g,segments:h})}this.sourceUpdater_.appendBuffer({segmentInfo:n,type:a,bytes:l},this.handleAppendError_.bind(this,{segmentInfo:n,type:a,bytes:l}))},r.handleSegmentTimingInfo_=function(e,n,a){if(this.pendingSegment_&&n===this.pendingSegment_.requestId){var s=this.pendingSegment_.segment,o=e+"TimingInfo";s[o]||(s[o]={}),s[o].transmuxerPrependedSeconds=a.prependedContentDuration||0,s[o].transmuxedPresentationStart=a.start.presentation,s[o].transmuxedDecodeStart=a.start.decode,s[o].transmuxedPresentationEnd=a.end.presentation,s[o].transmuxedDecodeEnd=a.end.decode,s[o].baseMediaDecodeTime=a.baseMediaDecodeTime}},r.appendData_=function(e,n){var a=n.type,s=n.data;if(s&&s.byteLength&&(a!=="audio"||!this.audioDisabled_)){var o=this.getInitSegmentAndUpdateState_({type:a,initSegment:n.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:a,initSegment:o,data:s})}},r.loadSegment_=function(e){var n=this;this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(e):this.loadQueue_.push(function(){var a=Ee({},e,{forceTimestampOffset:!0});Ee(e,n.generateSegmentInfo_(a)),n.isPendingTimestampOffset_=!1,n.updateTransmuxerAndRequestSegment_(e)})},r.updateTransmuxerAndRequestSegment_=function(e){var n=this;this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));var a=this.createSimplifiedSegmentObj_(e),s=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),o=this.mediaIndex!==null,l=e.timeline!==this.currentTimeline_&&e.timeline>0,h=s||o&&l;this.logger_("Requesting "+ei(e)),a.map&&!a.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=lm({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:a,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:h,endedTimelineFn:function(){n.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function(g){var b=g.message,_=g.level,G=g.stream;n.logger_(ei(e)+" logged from transmuxer stream "+G+" as a "+_+": "+b)}})},r.trimBackBuffer_=function(e){var n=Om(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);n>0&&this.remove(0,n)},r.createSimplifiedSegmentObj_=function(e){var n=e.segment,a=e.part,s={resolvedUri:a?a.resolvedUri:n.resolvedUri,byterange:a?a.byterange:n.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},o=e.playlist.segments[e.mediaIndex-1];if(o&&o.timeline===n.timeline&&(o.videoTimingInfo?s.baseStartTime=o.videoTimingInfo.transmuxedDecodeEnd:o.audioTimingInfo&&(s.baseStartTime=o.audioTimingInfo.transmuxedDecodeEnd)),n.key){var l=n.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);s.key=this.segmentKey(n.key),s.key.iv=l}return n.map&&(s.map=this.initSegmentForMap(n.map)),s},r.saveTransferStats_=function(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)},r.saveBandwidthRelatedStats_=function(e,n){this.pendingSegment_.byteLength=n.bytesReceived,e
3*e.playlist.targetDuration,l=s&&s.end&&this.currentTime_()-s.end>3*e.playlist.partTargetDuration;if(o||l)return this.logger_("bad "+(o?"segment":"part")+" "+ei(e)),void this.resetEverything();this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}else this.logger_("Throwing away un-appended sync request "+ei(e))},r.recordThroughput_=function(e){if(e.duration
=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},r.stopForError=function(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")},r.segmentRequestFinished_=function(e,n,a){var s=this;if(this.subtitlesTrack_){if(this.saveTransferStats_(n.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===Bn.TIMEOUT&&this.handleTimeout_(),e.code===Bn.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);var o=this.pendingSegment_;this.saveBandwidthRelatedStats_(o.duration,n.stats),n.key&&this.segmentKey(n.key,!0),this.state="APPENDING",this.trigger("appending");var l=o.segment;if(l.map&&(l.map.bytes=n.map.bytes),o.bytes=n.bytes,typeof O().WebVTT!="function"&&typeof this.loadVttJs=="function")return this.state="WAITING_ON_VTTJS",void this.loadVttJs().then(function(){return s.segmentRequestFinished_(e,n,a)},function(){return s.stopForError({message:"Error loading vtt.js"})});l.requested=!0;try{this.parseVTTCues_(o)}catch(h){return void this.stopForError({message:h.message})}if(this.updateTimeMapping_(o,this.syncController_.timelines[o.timeline],this.playlist_),o.cues.length?o.timingInfo={start:o.cues[0].startTime,end:o.cues[o.cues.length-1].endTime}:o.timingInfo={start:o.startOfSegment,end:o.startOfSegment+o.duration},o.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");o.byteLength=o.bytes.byteLength,this.mediaSecondsLoaded+=l.duration,o.cues.forEach(function(h){s.subtitlesTrack_.addCue(s.featuresNativeTextTracks_?new(O()).VTTCue(h.startTime,h.endTime,h.text):h)}),Em(this.subtitlesTrack_),this.handleAppendsDone_()}else this.state="READY"},r.handleData_=function(){},r.updateTimingInfoEnd_=function(){},r.parseVTTCues_=function(e){var n,a=!1;if(typeof O().WebVTT!="function")throw new Um;typeof O().TextDecoder=="function"?n=new(O()).TextDecoder("utf8"):(n=O().WebVTT.StringDecoder(),a=!0);var s=new(O()).WebVTT.Parser(O(),O().vttjs,n);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},s.oncue=e.cues.push.bind(e.cues),s.ontimestampmap=function(h){e.timestampmap=h},s.onparsingerror=function(h){he.log.warn("Error encountered when parsing cues: "+h.message)},e.segment.map){var o=e.segment.map.bytes;a&&(o=Uc(o)),s.parse(o)}var l=e.bytes;a&&(l=Uc(l)),s.parse(l),s.flush()},r.updateTimeMapping_=function(e,n,a){var s=e.segment;if(n){if(!e.cues.length)return void(s.empty=!0);var o=e.timestampmap,l=o.MPEGTS/zi.ONE_SECOND_IN_TS-o.LOCAL+n.mapping;if(e.cues.forEach(function(b){b.startTime+=l,b.endTime+=l}),!a.syncInfo){var h=e.cues[0].startTime,g=e.cues[e.cues.length-1].startTime;a.syncInfo={mediaSequence:a.mediaSequence+e.mediaIndex,time:Math.min(h,g-s.duration)}}}},i}(ko),jm=function(t,i){for(var r=t.cues,e=0;e
=n.adStartTime&&i<=n.adendtime)return n}return null},Fm=function(t,i,r){if(r===void 0&&(r=0),t.segments)for(var e,n=r,a=0;a
=_)&&(s=_,a={time:b,segmentIndex:h.segmentIndex,partIndex:h.partIndex})}}return a}},{name:"Discontinuity",run:function(t,i,r,e,n){var a=null;if(n=n||0,i.discontinuityStarts&&i.discontinuityStarts.length)for(var s=null,o=0;o
=b)&&(s=b,a={time:g.time,segmentIndex:l,partIndex:null})}}return a}},{name:"Playlist",run:function(t,i,r,e,n){return i.syncInfo?{time:i.syncInfo.time,segmentIndex:i.syncInfo.mediaSequence-i.mediaSequence,partIndex:null}:null}}],Hm=function(t){function i(e){var n;return(n=t.call(this)||this).timelines=[],n.discontinuities=[],n.timelineToDatetimeMappings={},n.logger_=An("SyncController"),n}y(i,t);var r=i.prototype;return r.getSyncPoint=function(e,n,a,s){var o=this.runStrategies_(e,n,a,s);return o.length?this.selectSyncPoint_(o,{key:"time",value:s}):null},r.getExpiredTime=function(e,n){if(!e||!e.segments)return null;var a=this.runStrategies_(e,n,e.discontinuitySequence,0);if(!a.length)return null;var s=this.selectSyncPoint_(a,{key:"segmentIndex",value:0});return s.segmentIndex>0&&(s.time*=-1),Math.abs(s.time+Ei({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:s.segmentIndex,endIndex:0}))},r.runStrategies_=function(e,n,a,s){for(var o=[],l=0;l
qm)he.log.warn("Not saving expired segment info. Media sequence gap "+a+" is too large.");else for(var s=a-1;s>=0;s--){var o=e.segments[s];if(o&&o.start!==void 0){n.syncInfo={mediaSequence:e.mediaSequence+s,time:o.start},this.logger_("playlist refresh sync: [time:"+n.syncInfo.time+", mediaSequence: "+n.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}},r.setDateTimeMappingForStart=function(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){var n=e.segments[0],a=n.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[n.timeline]=-a}},r.saveSegmentTimingInfo=function(e){var n=e.segmentInfo,a=e.shouldSaveTimelineMapping,s=this.calculateSegmentTimeMapping_(n,n.timingInfo,a),o=n.segment;s&&(this.saveDiscontinuitySyncInfo_(n),n.playlist.syncInfo||(n.playlist.syncInfo={mediaSequence:n.playlist.mediaSequence+n.mediaIndex,time:o.start}));var l=o.dateTimeObject;o.discontinuity&&a&&l&&(this.timelineToDatetimeMappings[o.timeline]=-l.getTime()/1e3)},r.timestampOffsetForTimeline=function(e){return this.timelines[e]===void 0?null:this.timelines[e].time},r.mappingForTimeline=function(e){return this.timelines[e]===void 0?null:this.timelines[e].mapping},r.calculateSegmentTimeMapping_=function(e,n,a){var s,o,l=e.segment,h=e.part,g=this.timelines[e.timeline];if(typeof e.timestampOffset=="number")g={time:e.startOfSegment,mapping:e.startOfSegment-n.start},a&&(this.timelines[e.timeline]=g,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": [time: "+g.time+"] [mapping: "+g.mapping+"]")),s=e.startOfSegment,o=n.end+g.mapping;else{if(!g)return!1;s=n.start+g.mapping,o=n.end+g.mapping}return h&&(h.start=s,h.end=o),(!l.start||s
g){var b=void 0;b=h<0?a.start-ei({defaultduration:n.targetduration,durationlist:n.segments,startindex:e.mediaindex,endindex:o}):a.end+ei({defaultduration:n.targetduration,durationlist:n.segments,startindex:e.mediaindex+1,endindex:o}),this.discontinuities[l]={time:b,accuracy:g}}}},r.dispose=function(){this.trigger("dispose"),this.off()},i}(he.eventtarget),vm=function(t){function i(){var e;return(e=t.call(this)||this).pendingTimelineChanges_={},e.lastTimelineChanges_={},e}y(i,t);var r=i.prototype;return r.clearPendingTimelineChange=function(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")},r.pendingTimelineChange=function(e){var n=e.type,a=e.from,s=e.to;return typeof a=="number"&&typeof s=="number"&&(this.pendingTimelineChanges_[n]={type:n,from:a,to:s},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[n]},r.lastTimelineChange=function(e){var n=e.type,a=e.from,s=e.to;return typeof a=="number"&&typeof s=="number"&&(this.lastTimelineChanges_[n]={type:n,from:a,to:s},delete this.pendingTimelineChanges_[n],this.trigger("timelinechange")),this.lastTimelineChanges_[n]},r.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},i}(he.EventTarget),Wm=hc(pc(function(){var t=typeof globalThis<"u"?globalthis:typeof window<"u"?window:ae.g!==void 0?Ae.g:typeof self<"u"?self:{};function i(Te,De,Se){return Te(Se={path:De,exports:{},require:function(Me,Ce){return r(Me,Ce??Se.path)}},Se.exports),Se.exports}function r(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var e=i(function(Te){function De(Me,Ce){for(var ze=0;ze
-1},De.trigger=function(Se){var Me=this.listeners[Se];if(Me)if(arguments.length===2)for(var Ce=Me.length,ze=0;ze
>7))^Te]=Te;for(De=Se=0;!ot[De];De^=Me||1,Se=Ut[Se]||1)for(ze=(ze=Se^Se<<1^se<<2^se<<3^se<<4)>>8^255&ze^99,ot[De]=ze,Rt[ze]=De,Ye=16843009*Nt[Ce=Nt[Me=Nt[De]]]^65537*Ce^257*Me^16843008*De,Ne=257*Nt[ze]^16843008*ze,Te=0;Te<4;te++)dt[te][de]=ne=ne<<24^ne>>>8,St[Te][ze]=Ye=Ye<<24^ye>>>8;for(Te=0;Te<5;te++)dt[te]=dt[te].slice(0),st[te]=st[te].slice(0);return tt},g=null,b=function(){function Te(De){g||(g=h()),this._tables=[[g[0][0].slice(),g[0][1].slice(),g[0][2].slice(),g[0][3].slice(),g[0][4].slice()],[g[1][0].slice(),g[1][1].slice(),g[1][2].slice(),g[1][3].slice(),g[1][4].slice()]];var Se,Me,Ce,ze=this._tables[0][4],Ne=this._tables[1],Ye=De.length,tt=1;if(Ye!==4&&Ye!==6&&Ye!==8)throw new Error("Invalid aes key size");var Dt=De.slice(0),St=[];for(this._key=[Dt,St],Se=Ye;Se<4*ye+28;se++)ce=dt[se-1],(se%ye==0||ye===8&&se%ye==4)&&(ce=ze[ce>>>24]<<24^ze[ce>>16&255]<<16^ze[ce>>8&255]<<8^ze[255&ce],se%ye==0&&(ce=ce<<8^ce>>>24^tt<<24,tt=tt<<1^283*(tt>>7))),Dt[Se]=Dt[Se-Ye]^Ce;for(Me=0;Se;Me++,Se--)Ce=Dt[3&Me?Se:Se-4],St[Me]=Se<=4||me<4?ce:ne[0][ze[ce>>>24]]^Ne[1][ze[Ce>>16&255]]^Ne[2][ze[Ce>>8&255]]^Ne[3][ze[255&Ce]]}return Te.prototype.decrypt=function(De,Se,Me,Ce,ze,Ne){var Ye,tt,Dt,St,ot=this._key[1],Rt=De^ot[0],Nt=Ce^ot[1],Ut=Me^ot[2],It=Se^ot[3],La=ot.length/4-2,rr=4,hr=this._tables[1],wr=hr[0],At=hr[1],kr=hr[2],ti=hr[3],pr=hr[4];for(St=0;St
>>24]^At[Nt>>16&255]^kr[Ut>>8&255]^ti[255&It]^ot[rr],tt=wr[Nt>>>24]^At[Ut>>16&255]^kr[It>>8&255]^ti[255&Rt]^ot[rr+1],Dt=wr[Ut>>>24]^At[It>>16&255]^kr[Rt>>8&255]^ti[255&Nt]^ot[rr+2],It=wr[It>>>24]^At[Rt>>16&255]^kr[Nt>>8&255]^ti[255&Ut]^ot[rr+3],rr+=4,Rt=Ye,Nt=tt,Ut=Dt;for(St=0;St<4;st++)ze[(3&-st)+ne]=pr[rt>>>24]<<24^pr[nt>>16&255]<<16^pr[ut>>8&255]<<8^pr[255&it]^ot[rr++],ye=rt,rt=nt,nt=ut,ut=it,it=ye},te}(),_=function(te){function De(){var Me;return(Me=Te.call(this,s)||this).jobs=[],Me.delay=1,Me.timeout_=null,Me}a(De,Te);var Se=De.prototype;return Se.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},Se.push=function(Me){this.jobs.push(Me),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},De}(s),G=function(Te){return Te<<24|(65280&te)<<8|(16711680&te)>>8|Te>>>24},ne=function(Te,De,Se){var Me,Ce,ze,Ne,Ye,tt,Dt,St,ot,Rt=new Int32Array(Te.buffer,Te.byteOffset,Te.byteLength>>2),Nt=new b(Array.prototype.slice.call(De)),Ut=new Uint8Array(Te.byteLength),It=new Int32Array(Ut.buffer);for(Me=Se[0],Ce=Se[1],ze=Se[2],Ne=Se[3],ot=0;ot
=0&&(i="main-desc"),i},Oa=function(t,i){t.abort(),t.pause(),i&&i.activePlaylistLoader&&(i.activePlaylistLoader.pause(),i.activePlaylistLoader=null)},Io=function(t,i){i.activePlaylistLoader=t,t.load()},Xm=function(t,i){return function(){var r=i.segmentLoaders,e=r[t],n=r.main,a=i.mediaTypes[t],s=a.activeTrack(),o=a.getActiveGroup(),l=a.activePlaylistLoader,h=a.lastGroup_;if((!o||!h||o.id!==h.id)&&(a.lastGroup_=o,a.lastTrack_=s,Oa(e,a),o&&!o.isMasterPlaylist)){if(!o.playlistLoader)return void(l&&n.resetEverything());e.resyncLoader(),Io(o.playlistLoader,a)}}},Km=function(t,i){return function(){var r=i.segmentLoaders[t];i.mediaTypes[t].lastGroup_=null,r.abort(),r.pause()}},Qm=function(t,i){return function(){var r=i.masterPlaylistLoader,e=i.segmentLoaders,n=e[t],a=e.main,s=i.mediaTypes[t],o=s.activeTrack(),l=s.getActiveGroup(),h=s.activePlaylistLoader,g=s.lastTrack_;if((!g||!o||g.id!==o.id)&&(s.lastGroup_=l,s.lastTrack_=o,Oa(n,s),l)){if(l.isMasterPlaylist){if(!o||!g||o.id===g.id)return;var b=i.vhs.masterPlaylistController_,_=b.selectPlaylist();return b.media()===_?void 0:(s.logger_("track change. Switching master audio from "+g.id+" to "+o.id),r.pause(),a.resetEverything(),void b.fastQualityChange_(_))}if(t==="AUDIO"){if(!l.playlistLoader)return a.setAudio(!0),void a.resetEverything();n.setAudio(!0),a.setAudio(!1)}if(h===l.playlistLoader)return void Io(l.playlistLoader,s);n.track&&n.track(o),n.resetEverything(),Io(l.playlistLoader,s)}}},Da={AUDIO:function(t,i){return function(){var r=i.segmentLoaders[t],e=i.mediaTypes[t],n=i.blacklistCurrentPlaylist;Oa(r,e);var a=e.activeTrack(),s=e.activeGroup(),o=(s.filter(function(g){return g.default})[0]||s[0]).id,l=e.tracks[o];if(a!==l){for(var h in he.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),e.tracks)e.tracks[h].enabled=e.tracks[h]===l;e.onTrackChanged()}else n({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(t,i){return function(){var r=i.segmentLoaders[t],e=i.mediaTypes[t];he.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),Oa(r,e);var n=e.activeTrack();n&&(n.mode="disabled"),e.onTrackChanged()}}},Fc={AUDIO:function(t,i,r){if(i){var e=r.tech,n=r.requestOptions,a=r.segmentLoaders[t];i.on("loadedmetadata",function(){var s=i.media();a.playlist(s,n),(!e.paused()||s.endList&&e.preload()!=="none")&&a.load()}),i.on("loadedplaylist",function(){a.playlist(i.media(),n),e.paused()||a.load()}),i.on("error",Da[t](t,r))}},SUBTITLES:function(t,i,r){var e=r.tech,n=r.requestOptions,a=r.segmentLoaders[t],s=r.mediaTypes[t];i.on("loadedmetadata",function(){var o=i.media();a.playlist(o,n),a.track(s.activeTrack()),(!e.paused()||o.endList&&e.preload()!=="none")&&a.load()}),i.on("loadedplaylist",function(){a.playlist(i.media(),n),e.paused()||a.load()}),i.on("error",Da[t](t,r))}},Ym={AUDIO:function(t,i){var r=i.vhs,e=i.sourceType,n=i.segmentLoaders[t],a=i.requestOptions,s=i.master.mediaGroups,o=i.mediaTypes[t],l=o.groups,h=o.tracks,g=o.logger_,b=i.masterPlaylistLoader,_=wi(b.master);for(var G in(!s[t]||Object.keys(s[t]).length===0)&&(s[t]={main:{default:{default:!0}}},_&&(s[t].main.default.playlists=b.master.playlists)),s[t])for(var ne in l[G]||(l[G]=[]),s[t][G]){var _e=s[t][G][ne],re=void 0;if(_?(g("AUDIO group '"+G+"' label '"+ne+"' is a master playlist"),_e.isMasterPlaylist=!0,re=null):re=e==="vhs-json"&&_e.playlists?new Jr(_e.playlists[0],r,a):_e.resolvedUri?new Jr(_e.resolvedUri,r,a):_e.playlists&&e==="dash"?new bo(_e.playlists[0],r,a,b):null,_e=he.mergeOptions({id:ne,playlistLoader:re},_e),Fc[t](t,_e.playlistLoader,i),l[G].push(_e),h[ne]===void 0){var Ue=new he.AudioTrack({id:ne,kind:zm(_e),enabled:!1,language:_e.language,default:_e.default,label:ne});h[ne]=Ue}}n.on("error",Da[t](t,i))},SUBTITLES:function(t,i){var r=i.tech,e=i.vhs,n=i.sourceType,a=i.segmentLoaders[t],s=i.requestOptions,o=i.master.mediaGroups,l=i.mediaTypes[t],h=l.groups,g=l.tracks,b=i.masterPlaylistLoader;for(var _ in o[t])for(var G in h[_]||(h[_]=[]),o[t][_])if(!o[t][_][G].forced){var ne=o[t][_][G],_e=void 0;if(n==="hls")_e=new Jr(ne.resolvedUri,e,s);else if(n==="dash"){if(!ne.playlists.filter(function(Ue){return Ue.excludeUntil!==1/0}).length)return;_e=new bo(ne.playlists[0],e,s,b)}else n==="vhs-json"&&(_e=new Jr(ne.playlists?ne.playlists[0]:ne.resolvedUri,e,s));if(ne=he.mergeOptions({id:G,playlistLoader:_e},ne),Fc[t](t,ne.playlistLoader,i),h[_].push(ne),g[G]===void 0){var re=r.addRemoteTextTrack({id:G,kind:"subtitles",default:ne.default&&ne.autoselect,language:ne.language,label:G},!1).track;g[G]=re}}a.on("error",Da[t](t,i))},"CLOSED-CAPTIONS":function(t,i){var r=i.tech,e=i.master.mediaGroups,n=i.mediaTypes[t],a=n.groups,s=n.tracks;for(var o in e[t])for(var l in a[o]||(a[o]=[]),e[t][o]){var h=e[t][o][l];if(/^(?:CC|SERVICE)/.test(h.instreamId)){var g=r.options_.vhs&&r.options_.vhs.captionServices||{},b={label:l,language:h.language,instreamId:h.instreamId,default:h.default&&h.autoselect};if(g[b.instreamId]&&(b=he.mergeOptions(b,g[b.instreamId])),b.default===void 0&&delete b.default,a[o].push(he.mergeOptions({id:l},h)),s[l]===void 0){var _=r.addRemoteTextTrack({id:b.instreamId,kind:"captions",default:b.default,language:b.language,label:b.label},!1).track;s[l]=_}}}}},$m=function t(i,r){for(var e=0;e
1&&wi(i.master))for(var l=0;l
"+n.id;if(!i)return h(g+" as current playlist is not set"),!0;if(n.id===i.id)return!1;var b=!!$r(r,e).length;if(!i.endList)return b||typeof i.partTargetDuration!="number"?(h(g+" as current playlist is live"),!0):(h("not "+g+" as current playlist is live llhls, but currentTime isn't in buffered."),!1);var _=uo(r,e),G=l?Ht.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Ht.MAX_BUFFER_LOW_WATER_LINE;if(o
_e)&&_>=a){var Ue=g+" as forwardBuffer>= bufferLowWaterLine ("+_+">= "+a+")";return l&&(Ue+=" and next bandwidth> current bandwidth ("+ne+"> "+_e+")"),h(Ue),!0}return h("not "+g+" as no switching criteria met"),!1},og=function(t){function i(e){var n;n=t.call(this)||this;var a=e.src,s=e.handleManifestRedirects,o=e.withCredentials,l=e.tech,h=e.bandwidth,g=e.externVhs,b=e.useCueTags,_=e.blacklistDuration,G=e.enableLowInitialPlaylist,ne=e.sourceType,_e=e.cacheEncryptionKeys,re=e.experimentalBufferBasedABR,Ue=e.experimentalLeastPixelDiffSelector,Ge=e.captionServices;if(!a)throw new Error("A non-empty playlist URL or JSON manifest string is required");var Te=e.maxPlaylistRetries;Te==null&&(Te=1/0),nr=g,n.experimentalBufferBasedABR=!!re,n.experimentalLeastPixelDiffSelector=!!Ue,n.withCredentials=o,n.tech_=l,n.vhs_=l.vhs,n.sourceType_=ne,n.useCueTags_=b,n.blacklistDuration=_,n.maxPlaylistRetries=Te,n.enableLowInitialPlaylist=G,n.useCueTags_&&(n.cueTagsTrack_=n.tech_.addTextTrack("metadata","ad-cues"),n.cueTagsTrack_.inBandMetadataTrackDispatchType=""),n.requestOptions_={withCredentials:o,handleManifestRedirects:s,maxPlaylistRetries:Te,timeout:null},n.on("error",n.pauseLoading),n.mediaTypes_=ng(),n.mediaSource=new(O()).MediaSource,n.handleDurationChange_=n.handleDurationChange_.bind(w(n)),n.handleSourceOpen_=n.handleSourceOpen_.bind(w(n)),n.handleSourceEnded_=n.handleSourceEnded_.bind(w(n)),n.mediaSource.addEventListener("durationchange",n.handleDurationChange_),n.mediaSource.addEventListener("sourceopen",n.handleSourceOpen_),n.mediaSource.addEventListener("sourceended",n.handleSourceEnded_),n.seekable_=he.createTimeRanges(),n.hasPlayed_=!1,n.syncController_=new Hm(e),n.segmentMetadataTrack_=l.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,n.decrypter_=new Gm,n.sourceUpdater_=new Nc(n.mediaSource),n.inbandTextTracks_={},n.timelineChangeController_=new Vm;var De={vhs:n.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:Ge,mediaSource:n.mediaSource,currentTime:n.tech_.currentTime.bind(n.tech_),seekable:function(){return n.seekable()},seeking:function(){return n.tech_.seeking()},duration:function(){return n.duration()},hasPlayed:function(){return n.hasPlayed_},goalBufferLength:function(){return n.goalBufferLength()},bandwidth:h,syncController:n.syncController_,decrypter:n.decrypter_,sourceType:n.sourceType_,inbandTextTracks:n.inbandTextTracks_,cacheEncryptionKeys:_e,sourceUpdater:n.sourceUpdater_,timelineChangeController:n.timelineChangeController_,experimentalExactManifestTimings:e.experimentalExactManifestTimings};n.masterPlaylistLoader_=n.sourceType_==="dash"?new bo(a,n.vhs_,n.requestOptions_):new Jr(a,n.vhs_,n.requestOptions_),n.setupMasterPlaylistLoaderListeners_(),n.mainSegmentLoader_=new ko(he.mergeOptions(De,{segmentMetadataTrack:n.segmentMetadataTrack_,loaderType:"main"}),e),n.audioSegmentLoader_=new ko(he.mergeOptions(De,{loaderType:"audio"}),e),n.subtitleSegmentLoader_=new Bm(he.mergeOptions(De,{loaderType:"vtt",featuresNativeTextTracks:n.tech_.featuresNativeTextTracks,loadVttJs:function(){return new Promise(function(Me,Ce){function ze(){l.off("vttjserror",Ne),Me()}function Ne(){l.off("vttjsloaded",ze),Ce()}l.one("vttjsloaded",ze),l.one("vttjserror",Ne),l.addWebVttScript_()})}}),e),n.setupSegmentLoaderListeners_(),n.experimentalBufferBasedABR&&(n.masterPlaylistLoader_.one("loadedplaylist",function(){return n.startABRTimer_()}),n.tech_.on("pause",function(){return n.stopABRTimer_()}),n.tech_.on("play",function(){return n.startABRTimer_()})),ig.forEach(function(Me){n[Me+"_"]=ag.bind(w(n),Me)}),n.logger_=An("MPC"),n.triggeredFmp4Usage=!1,n.tech_.preload()==="none"?(n.loadOnPlay_=function(){n.loadOnPlay_=null,n.masterPlaylistLoader_.load()},n.tech_.one("play",n.loadOnPlay_)):n.masterPlaylistLoader_.load(),n.timeToLoadedData__=-1,n.mainAppendsToLoadedData__=-1,n.audioAppendsToLoadedData__=-1;var Se=n.tech_.preload()==="none"?"play":"loadstart";return n.tech_.one(Se,function(){var Me=Date.now();n.tech_.one("loadeddata",function(){n.timeToLoadedData__=Date.now()-Me,n.mainAppendsToLoadedData__=n.mainSegmentLoader_.mediaAppends,n.audioAppendsToLoadedData__=n.audioSegmentLoader_.mediaAppends})}),n}y(i,t);var r=i.prototype;return r.mainAppendsToLoadedData_=function(){return this.mainAppendsToLoadedData__},r.audioAppendsToLoadedData_=function(){return this.audioAppendsToLoadedData__},r.appendsToLoadedData_=function(){var e=this.mainAppendsToLoadedData_(),n=this.audioAppendsToLoadedData_();return e===-1||n===-1?-1:e+n},r.timeToLoadedData_=function(){return this.timeToLoadedData__},r.checkABR_=function(e){e===void 0&&(e="abr");var n=this.selectPlaylist();n&&this.shouldSwitchToMedia_(n)&&this.switchMedia_(n,e)},r.switchMedia_=function(e,n,a){var s=this.media(),o=s&&(s.id||s.uri),l=e.id||e.uri;o&&o!==l&&(this.logger_("switch media "+o+" -> "+l+" from "+n),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+n})),this.masterPlaylistLoader_.media(e,a)},r.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=O().setInterval(function(){return e.checkABR_()},250)},r.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(O().clearInterval(this.abrTimer_),this.abrTimer_=null)},r.getAudioTrackPlaylists_=function(){var e=this.master(),n=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return n;var a,s=e.mediaGroups.AUDIO,o=Object.keys(s);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)a=this.mediaTypes_.AUDIO.activeTrack();else{var l=s.main||o.length&&s[o[0]];for(var h in l)if(l[h].default){a={label:h};break}}if(!a)return n;var g=[];for(var b in s)if(s[b][a.label]){var _=s[b][a.label];if(_.playlists&&_.playlists.length)g.push.apply(g,_.playlists);else if(_.uri)g.push(_);else if(e.playlists.length)for(var G=0;G
1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},r.shouldSwitchToMedia_=function(e){var n=this.masterPlaylistLoader_.media()||this.masterPlaylistLoader_.pendingMedia_,a=this.tech_.currentTime(),s=this.bufferLowWaterLine(),o=this.bufferHighWaterLine(),l=this.tech_.buffered();return sg({buffered:l,currentTime:a,currentPlaylist:n,nextPlaylist:e,bufferLowWaterLine:s,bufferHighWaterLine:o,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},r.setupSegmentLoaderListeners_=function(){var e=this;this.mainSegmentLoader_.on("bandwidthupdate",function(){e.checkABR_("bandwidthupdate"),e.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",function(){e.experimentalBufferBasedABR&&e.mainSegmentLoader_.load()}),this.experimentalBufferBasedABR||this.mainSegmentLoader_.on("progress",function(){e.trigger("progress")}),this.mainSegmentLoader_.on("error",function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())}),this.mainSegmentLoader_.on("appenderror",function(){e.error=e.mainSegmentLoader_.error_,e.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",function(){e.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",function(){e.error=e.audioSegmentLoader_.error_,e.trigger("error")}),this.mainSegmentLoader_.on("ended",function(){e.logger_("main segment loader ended"),e.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",function(a){e.experimentalBufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},rg))});var n=function(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var a=e.getCodecsOrExclude_();!a||e.sourceUpdater_.addOrChangeSourceBuffers(a)};this.mainSegmentLoader_.on("trackinfo",n),this.audioSegmentLoader_.on("trackinfo",n),this.mainSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",function(){e.logger_("audioSegmentLoader ended"),e.onEndOfStream()})},r.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},r.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},r.smoothQualityChange_=function(e){e===void 0&&(e=this.selectPlaylist()),this.fastQualityChange_(e)},r.fastQualityChange_=function(e){var n=this;e===void 0&&(e=this.selectPlaylist()),e!==this.masterPlaylistLoader_.media()?(this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything(function(){he.browser.IE_VERSION||he.browser.IS_EDGE?n.tech_.setCurrentTime(n.tech_.currentTime()+.04):n.tech_.setCurrentTime(n.tech_.currentTime())})):this.logger_("skipping fastQualityChange because new media is same as old")},r.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()
this.maxPlaylistRetries?1/0:Date.now()+1e3*n,a.excludeUntil=s,e.reason&&(a.lastExcludeReason_=e.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var b=this.selectPlaylist();if(!b)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");var _=e.internal?this.logger_:he.log.warn,G=e.message?" "+e.message:"";_((e.internal?"Internal problem":"Problem")+" encountered with playlist "+a.id+"."+G+" Switching to playlist "+b.id+"."),b.attributes.AUDIO!==a.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),b.attributes.SUBTITLES!==a.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var ne=b.targetDuration/2*1e3||5e3,_e=typeof b.lastRequest=="number"&&Date.now()-b.lastRequest<=ne;return this.switchMedia_(b,"exclude",h||_e)},r.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},r.delegateLoaders_=function(e,n){var a=this,s=[],o=e==="all";(o||e==="main")&&s.push(this.masterPlaylistLoader_);var l=[];(o||e==="audio")&&l.push("AUDIO"),(o||e==="subtitle")&&(l.push("CLOSED-CAPTIONS"),l.push("SUBTITLES")),l.forEach(function(h){var g=a.mediaTypes_[h]&&a.mediaTypes_[h].activePlaylistLoader;g&&s.push(g)}),["main","audio","subtitle"].forEach(function(h){var g=a[h+"SegmentLoader_"];g&&(e===h||e==="all")&&s.push(g)}),s.forEach(function(h){return n.forEach(function(g){typeof h[g]=="function"&&h[g]()})})},r.setCurrentTime=function(e){var n=$r(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?n&&n.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0},r.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:nr.Playlist.duration(e):1/0:0},r.seekable=function(){return this.seekable_},r.onSyncInfoUpdate_=function(){var e;if(this.masterPlaylistLoader_){var n=this.masterPlaylistLoader_.media();if(n){var a=this.syncController_.getExpiredTime(n,this.duration());if(a!==null){var s,o,l=this.masterPlaylistLoader_.master,h=nr.Playlist.seekable(n,a,nr.Playlist.liveEdgeDelay(l,n));h.length===0||this.mediaTypes_.AUDIO.activePlaylistLoader&&(n=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),(a=this.syncController_.getExpiredTime(n,this.duration()))===null||(e=nr.Playlist.seekable(n,a,nr.Playlist.liveEdgeDelay(l,n))).length===0)||(this.seekable_&&this.seekable_.length&&(s=this.seekable_.end(0),o=this.seekable_.start(0)),e?e.start(0)>h.end(0)||h.start(0)>e.end(0)?this.seekable_=h:this.seekable_=he.createTimeRanges([[e.start(0)>h.start(0)?e.start(0):h.start(0),e.end(0)
0&&(s=Math.max(s,a.end(a.length-1))),this.mediaSource.duration!==s&&this.sourceUpdater_.setDuration(s)}},r.dispose=function(){var e=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(function(n){var a=e.mediaTypes_[n].groups;for(var s in a)a[s].forEach(function(o){o.playlistLoader&&o.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()},r.master=function(){return this.masterPlaylistLoader_.master},r.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},r.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,n=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),a=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!n||!a)},r.getCodecsOrExclude_=function(){var e=this,n={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};n.video=n.main;var a=Ci(this.master(),this.media()),s={},o=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(n.main.hasVideo&&(s.video=a.video||n.main.videoCodec||Et),n.main.isMuxed&&(s.video+=","+(a.audio||n.main.audioCodec||$e)),(n.main.hasAudio&&!n.main.isMuxed||n.audio.hasAudio||o)&&(s.audio=a.audio||n.main.audioCodec||n.audio.audioCodec||$e,n.audio.isFmp4=n.main.hasAudio&&!n.main.isMuxed?n.main.isFmp4:n.audio.isFmp4),s.audio||s.video){var l,h=function(ne,_e){return ne?He(_e):Ze(_e)},g={};if(["video","audio"].forEach(function(ne){if(s.hasOwnProperty(ne)&&!h(n[ne].isFmp4,s[ne])){var _e=n[ne].isFmp4?"browser":"muxer";g[_e]=g[_e]||[],g[_e].push(s[ne]),ne==="audio"&&(l=_e)}}),o&&l&&this.media().attributes.AUDIO){var b=this.media().attributes.AUDIO;this.master().playlists.forEach(function(ne){(ne.attributes&&ne.attributes.AUDIO)===b&&ne!==e.media()&&(ne.excludeUntil=1/0)}),this.logger_("excluding audio group "+b+" as "+l+' does not support codec(s): "'+s.audio+'"')}if(!Object.keys(g).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var _=[];if(["video","audio"].forEach(function(ne){var _e=(ee(e.sourceUpdater_.codecs[ne]||"")[0]||{}).type,re=(ee(s[ne]||"")[0]||{}).type;_e&&re&&_e.toLowerCase()!==re.toLowerCase()&&_.push('"'+e.sourceUpdater_.codecs[ne]+'" -> "'+s[ne]+'"')}),_.length)return void this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+_.join(", ")+".",blacklistDuration:1/0,internal:!0})}return s}var G=Object.keys(g).reduce(function(ne,_e){return ne&&(ne+=", "),ne+=_e+' does not support codec(s): "'+g[_e].join(",")+'"'},"")+".";this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:G,blacklistDuration:1/0})}else this.blacklistCurrentPlaylist({playlist:this.media(),message:"Could not determine codecs for playlist.",blacklistDuration:1/0})},r.tryToCreateSourceBuffers_=function(){if(this.mediaSource.readyState==="open"&&!this.sourceUpdater_.hasCreatedSourceBuffers()&&this.areMediaTypesKnown_()){var e=this.getCodecsOrExclude_();if(e){this.sourceUpdater_.createSourceBuffers(e);var n=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(n)}}},r.excludeUnsupportedVariants_=function(){var e=this,n=this.master().playlists,a=[];Object.keys(n).forEach(function(s){var o=n[s];if(a.indexOf(o.id)===-1){a.push(o.id);var l=Ci(e.master,o),h=[];l.audio&&!Ze(l.audio)&&!He(l.audio)&&h.push("audio codec "+l.audio),l.video&&!Ze(l.video)&&!He(l.video)&&h.push("video codec "+l.video),l.text&&l.text==="stpp.ttml.im1t"&&h.push("text codec "+l.text),h.length&&(o.excludeUntil=1/0,e.logger_("excluding "+o.id+" for unsupported: "+h.join(", ")))}})},r.excludeIncompatibleVariants_=function(e){var n=this,a=[],s=this.master().playlists,o=xa(ee(e)),l=wc(o),h=o.video&&ee(o.video)[0]||null,g=o.audio&&ee(o.audio)[0]||null;Object.keys(s).forEach(function(b){var _=s[b];if(a.indexOf(_.id)===-1&&_.excludeUntil!==1/0){a.push(_.id);var G=[],ne=Ci(n.masterPlaylistLoader_.master,_),_e=wc(ne);if(ne.audio||ne.video){if(_e!==l&&G.push('codec count "'+_e+'" !== "'+l+'"'),!n.sourceUpdater_.canChangeType()){var re=ne.video&&ee(ne.video)[0]||null,Ue=ne.audio&&ee(ne.audio)[0]||null;re&&h&&re.type.toLowerCase()!==h.type.toLowerCase()&&G.push('video codec "'+re.type+'" !== "'+h.type+'"'),Ue&&g&&Ue.type.toLowerCase()!==g.type.toLowerCase()&&G.push('audio codec "'+Ue.type+'" !== "'+g.type+'"')}G.length&&(_.excludeUntil=1/0,n.logger_("blacklisting "+_.id+": "+G.join(" && ")))}}})},r.updateAdCues_=function(e){var n=0,a=this.seekable();a.length&&(n=a.start(0)),Fm(e,this.cueTagsTrack_,n)},r.goalBufferLength=function(){var e=this.tech_.currentTime(),n=Ht.GOAL_BUFFER_LENGTH,a=Ht.GOAL_BUFFER_LENGTH_RATE,s=Math.max(n,Ht.MAX_GOAL_BUFFER_LENGTH);return Math.min(n+e*a,s)},r.bufferLowWaterLine=function(){var e=this.tech_.currentTime(),n=Ht.BUFFER_LOW_WATER_LINE,a=Ht.BUFFER_LOW_WATER_LINE_RATE,s=Math.max(n,Ht.MAX_BUFFER_LOW_WATER_LINE),o=Math.max(n,Ht.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(n+e*a,this.experimentalBufferBasedABR?o:s)},r.bufferHighWaterLine=function(){return Ht.BUFFER_HIGH_WATER_LINE},i}(he.EventTarget),ug=function(t,i,r){return function(e){var n=t.master.playlists[i],a=ho(n),s=Ea(n);return e===void 0?s:(e?delete n.disabled:n.disabled=!0,e!==s&&!a&&(r(),e?t.trigger("renditionenabled"):t.trigger("renditiondisabled")),e)}},lg=function(t,i,r){var e=t.masterPlaylistController_,n=e[(t.options_.smoothQualityChange?"smooth":"fast")+"QualityChange_"].bind(e);if(i.attributes){var a=i.attributes.RESOLUTION;this.width=a&&a.width,this.height=a&&a.height,this.bandwidth=i.attributes.BANDWIDTH,this.frameRate=i.attributes["FRAME-RATE"]}this.codecs=Ci(e.master(),i),this.playlist=i,this.id=r,this.enabled=ug(t.playlists,i.id,n)},cg=function(t){t.representations=function(){var i=t.masterPlaylistController_.master(),r=wi(i)?t.masterPlaylistController_.getAudioTrackPlaylists_():i.playlists;return r?r.filter(function(e){return!ho(e)}).map(function(e,n){return new lg(t,e,e.id)}):[]}},qc=["seeking","seeked","pause","playing","error"],dg=function(){function t(r){var e=this;this.masterPlaylistController_=r.masterPlaylistController,this.tech_=r.tech,this.seekable=r.seekable,this.allowSeeksWithinUnsafeLiveWindow=r.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=r.liveRangeSafeTimeDelta,this.media=r.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=An("PlaybackWatcher"),this.logger_("initialize");var n=function(){return e.monitorCurrentTime_()},a=function(){return e.monitorCurrentTime_()},s=function(){return e.techWaiting_()},o=function(){return e.cancelTimer_()},l=this.masterPlaylistController_,h=["main","subtitle","audio"],g={};h.forEach(function(_){g[_]={reset:function(){return e.resetSegmentDownloads_(_)},updateend:function(){return e.checkSegmentDownloads_(_)}},l[_+"SegmentLoader_"].on("appendsdone",g[_].updateend),l[_+"SegmentLoader_"].on("playlistupdate",g[_].reset),e.tech_.on(["seeked","seeking"],g[_].reset)});var b=function(_){["main","audio"].forEach(function(G){l[G+"SegmentLoader_"][_]("appended",e.seekingAppendCheck_)})};this.seekingAppendCheck_=function(){e.fixesBadSeeks_()&&(e.consecutiveUpdates=0,e.lastRecordedTime=e.tech_.currentTime(),b("off"))},this.clearSeekingAppendCheck_=function(){return b("off")},this.watchForBadSeeking_=function(){e.clearSeekingAppendCheck_(),b("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",s),this.tech_.on(qc,o),this.tech_.on("canplay",a),this.tech_.one("play",n),this.dispose=function(){e.clearSeekingAppendCheck_(),e.logger_("dispose"),e.tech_.off("waiting",s),e.tech_.off(qc,o),e.tech_.off("canplay",a),e.tech_.off("play",n),e.tech_.off("seeking",e.watchForBadSeeking_),e.tech_.off("seeked",e.clearSeekingAppendCheck_),h.forEach(function(_){l[_+"SegmentLoader_"].off("appendsdone",g[_].updateend),l[_+"SegmentLoader_"].off("playlistupdate",g[_].reset),e.tech_.off(["seeked","seeking"],g[_].reset)}),e.checkCurrentTimeTimeout_&&O().clearTimeout(e.checkCurrentTimeTimeout_),e.cancelTimer_()}}var i=t.prototype;return i.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&O().clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=O().setTimeout(this.monitorCurrentTime_.bind(this),250)},i.resetSegmentDownloads_=function(r){var e=this.masterPlaylistController_[r+"SegmentLoader_"];this[r+"StalledDownloads_"]>0&&this.logger_("resetting possible stalled download count for "+r+" loader"),this[r+"StalledDownloads_"]=0,this[r+"Buffered_"]=e.buffered_()},i.checkSegmentDownloads_=function(r){var e=this.masterPlaylistController_,n=e[r+"SegmentLoader_"],a=n.buffered_(),s=af(this[r+"Buffered_"],a);this[r+"Buffered_"]=a,s?this.resetSegmentDownloads_(r):(this[r+"StalledDownloads_"]++,this.logger_("found #"+this[r+"StalledDownloads_"]+" "+r+" appends that did not increase buffer (possible stalled download)",{playlistId:n.playlist_&&n.playlist_.id,buffered:Er(a)}),!(this[r+"StalledDownloads_"]<10)&&(this.logger_(r+" loader stalled download exclusion"),this.resetSegmentDownloads_(r),this.tech_.trigger({type:"usage",name:"vhs-"+r+"-download-exclusion"}),r!=="subtitle"&&e.blacklistCurrentPlaylist({message:"Excessive "+r+" segment downloading detected."},1/0)))},i.checkCurrentTime_=function(){if(!this.tech_.paused()&&!this.tech_.seeking()){var r=this.tech_.currentTime(),e=this.tech_.buffered();if(this.lastRecordedTime===r&&(!e.length||r+Un>=e.end(e.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&r===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):r===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=r)}},i.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},i.fixesBadSeeks_=function(){if(!this.tech_.seeking())return!1;var r,e=this.seekable(),n=this.tech_.currentTime();if(this.afterSeekableWindow_(e,n,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(r=e.end(e.length-1)),this.beforeSeekableWindow_(e,n)){var a=e.start(0);r=a+(a===e.end(0)?0:Un)}if(r!==void 0)return this.logger_("Trying to seek outside of seekable at time "+n+" with seekable range "+Ul(e)+". Seeking to "+r+"."),this.tech_.setCurrentTime(r),!0;for(var s=this.masterPlaylistController_.sourceUpdater_,o=this.tech_.buffered(),l=s.audioBuffer?s.audioBuffered():null,h=s.videoBuffer?s.videoBuffered():null,g=this.media(),b=g.partTargetDuration?g.partTargetDuration:2*(g.targetDuration-dr),_=[l,h],G=0;G<_.length;g++)if(_[g]&&uo(_[g],n)
"+n.end(0)+"]. Attempting to resume playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})}},i.techWaiting_=function(){var r=this.seekable(),e=this.tech_.currentTime();if(this.tech_.seeking()||this.timer_!==null)return!0;if(this.beforeSeekableWindow_(r,e)){var n=r.end(r.length-1);return this.logger_("Fell out of live window at time "+e+". Seeking to live point (seekable end) "+n),this.cancelTimer_(),this.tech_.setCurrentTime(n),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var a=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,s=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:a.audioBuffered(),videoBuffered:a.videoBuffered(),currentTime:e}))return this.cancelTimer_(),this.tech_.setCurrentTime(e),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var o=Sa(s,e);if(o.length>0){var l=o.start(0)-e;return this.logger_("Stopped at "+e+", setting timer for "+l+", seeking to "+o.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*l,e),!0}return!1},i.afterSeekableWindow_=function(r,e,n,a){if(a===void 0&&(a=!1),!r.length)return!1;var s=r.end(r.length-1)+Un;return!n.endList&&a&&(s=r.end(r.length-1)+3*n.targetDuration),e>s},i.beforeSeekableWindow_=function(r,e){return!!(r.length&&r.start(0)>0&&e
2)return{start:s,end:o}}return null},t}(),hg={errorInterval:30,getSource:function(t){return t(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},pg=function t(i,r){var e=0,n=0,a=he.mergeOptions(hg,r);i.ready(function(){i.trigger({type:"usage",name:"vhs-error-reload-initialized"}),i.trigger({type:"usage",name:"hls-error-reload-initialized"})});var s=function(){n&&i.currentTime(n)},o=function(b){b!=null&&(n=i.duration()!==1/0&&i.currentTime()||0,i.one("loadedmetadata",s),i.src(b),i.trigger({type:"usage",name:"vhs-error-reload"}),i.trigger({type:"usage",name:"hls-error-reload"}),i.play())},l=function(){return Date.now()-e<1e3*a.errorinterval?(i.trigger({type:"usage",name:"vhs-error-reload-canceled"}),void i.trigger({type:"usage",name:"hls-error-reload-canceled"})):a.getSource&&typeof a.getSource=="function"?(e=Date.now(),a.getSource.call(i,o)):void he.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")},h=function b(){i.off("loadedmetadata",s),i.off("error",l),i.off("dispose",b)},g=function(b){h(),t(i,b)};i.on("error",l),i.on("dispose",h),i.reloadSourceOnError=g},fg=function(t){pg(this,t)},Hc="2.16.0",mg="6.0.1",gg="0.22.1",vg="4.8.0",yg="3.1.3",Wt={PlaylistLoader:Jr,Playlist:ln,utils:Af,STANDARD_PLAYLIST_SELECTOR:xc,INITIAL_PLAYLIST_SELECTOR:gm,lastBandwidthSelector:xc,movingAverageBandwidthSelector:fm,comparePlaylistBandwidth:wo,comparePlaylistResolution:pm,xhr:tc()};Object.keys(Ht).forEach(function(t){Object.defineProperty(Wt,t,{get:function(){return he.log.warn("using Vhs."+t+" is UNSAFE be sure you know what you are doing"),Ht[t]},set:function(i){he.log.warn("using Vhs."+t+" is UNSAFE be sure you know what you are doing"),typeof i!="number"||i<0?he.log.warn("value of Vhs."+t+" must be greater than or equal to 0"):Ht[t]=i}})});var Vc="videojs-vhs",Wc=function(t,i){for(var r=i.media(),e=-1,n=0;n
=g&&l>=g?Math.max(l,b):b}return l},set:function(l){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=l,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var l,h=1/(this.bandwidth||1);return l=this.throughput>0?1/this.throughput:0,Math.floor(1/(h+l))},set:function(){he.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return a.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return a.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return a.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return a.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return a.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return a.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return a.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return a.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return a.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return a.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return a.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return a.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return a.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return Er(a.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return a.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return a.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return a.tech_.name_},enumerable:!0},duration:{get:function(){return a.tech_.duration()},enumerable:!0},master:{get:function(){return a.playlists.master},enumerable:!0},playerDimensions:{get:function(){return a.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return Er(a.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return a.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",function(){a.options_.useBandwidthFromLocalStorage&&wg({bandwidth:a.bandwidth,throughput:Math.round(a.throughput)})}),this.masterPlaylistController_.on("selectedinitialmedia",function(){cg(a)}),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",function(){a.setupEme_()}),this.on(this.masterPlaylistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.masterPlaylistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=O().URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},r.createKeySessions_=function(){var e=this,n=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),Sg({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:n&&n.media(),mainPlaylists:this.playlists.master.playlists}).then(function(){e.logger_("created EME key session"),e.masterPlaylistController_.sourceUpdater_.initializedEme()}).catch(function(a){e.logger_("error while creating EME key session",a),e.player_.error({message:"Failed to initialize media keys for EME",code:3})})},r.handleWaitingForKey_=function(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()},r.setupEme_=function(){var e=this,n=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,a=Eg({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:n&&n.media()});this.player_.tech_.on("keystatuschange",function(s){if(s.status==="output-restricted"){var o=e.masterPlaylistController_.master();if(o&&o.playlists){var l,h=[];o.playlists.forEach(function(g){g&&g.attributes&&g.attributes.RESOLUTION&&g.attributes.RESOLUTION.height>=720&&(!g.excludeUntil||g.excludeUntil<1/0)&&(g.excludeuntil=1/0,h.push(g))}),h.length&&((l=he.log).warn.apply(l,['drm keystatus changed to "output-restricted." Removing the following HD playlists that will most likely fail to play and clearing the buffer. This may be due to HDCP restrictions on the stream and the capabilities of the current device.'].concat(h)),e.masterPlaylistController_.fastQualityChange_())}}}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),he.browser.IE_VERSION!==11&&a?this.createKeySessions_():this.masterPlaylistController_.sourceUpdater_.initializedEme()},r.setupQualityLevels_=function(){var e=this,n=he.players[this.tech_.options_.playerId];!n||!n.qualityLevels||this.qualityLevels_||(this.qualityLevels_=n.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){_g(e.qualityLevels_,e)}),this.playlists.on("mediachange",function(){Wc(e.qualityLevels_,e.playlists)}))},i.version=function(){return{"@videojs/http-streaming":Hc,"mux.js":mg,"mpd-parser":gg,"m3u8-parser":vg,"aes-decrypter":yg}},r.version=function(){return this.constructor.version()},r.canChangeType=function(){return Nc.canChangeType()},r.play=function(){this.masterPlaylistController_.play()},r.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e)},r.duration=function(){return this.masterPlaylistController_.duration()},r.seekable=function(){return this.masterPlaylistController_.seekable()},r.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&O().URL.revokeObjectURL&&(O().URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),t.prototype.dispose.call(this)},r.convertToProgramTime=function(e,n){return Nf({playlist:this.masterPlaylistController_.media(),time:e,callback:n})},r.seekToProgramTime=function(e,n,a,s){return a===void 0&&(a=!0),s===void 0&&(s=2),Uf({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:s,pauseAfterSeek:a,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:n})},i}(he.getComponent("Component")),Ai={name:"videojs-http-streaming",VERSION:Hc,canHandleSource:function(t,i){i===void 0&&(i={});var r=he.mergeOptions(he.options,i);return Ai.canPlayType(t.type,r)},handleSource:function(t,i,r){r===void 0&&(r={});var e=he.mergeOptions(he.options,r);return i.vhs=new Ao(t,i,e),he.hasOwnProperty("hls")||Object.defineProperty(i,"hls",{get:function(){return he.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),i.vhs},configurable:!0}),i.vhs.xhr=tc(),i.vhs.src(t.src,t.type),i.vhs},canPlayType:function(t,i){var r=Lt(t);if(!r)return"";var e=Ai.getOverrideNative(i);return!Wt.supportsTypeNatively(r)||e?"maybe":""},getOverrideNative:function(t){t===void 0&&(t={});var i=t,r=i.vhs,e=r===void 0?{}:r,n=i.hls,a=n===void 0?{}:n,s=!(he.browser.IS_ANY_SAFARI||he.browser.IS_IOS),o=e.overrideNative,l=o===void 0?s:o,h=a.overrideNative;return h!==void 0&&h||l}};He("avc1.4d400d,mp4a.40.2")&&he.getTech("Html5").registerSourceHandler(Ai,0),he.VhsHandler=Ao,Object.defineProperty(he,"HlsHandler",{get:function(){return he.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),Ao},configurable:!0}),he.VhsSourceHandler=Ai,Object.defineProperty(he,"HlsSourceHandler",{get:function(){return he.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),Ai},configurable:!0}),he.Vhs=Wt,Object.defineProperty(he,"Hls",{get:function(){return he.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),Wt},configurable:!0}),he.use||(he.registerComponent("Hls",Wt),he.registerComponent("Vhs",Wt)),he.options.vhs=he.options.vhs||{},he.options.hls=he.options.hls||{},he.getPlugin&&he.getPlugin("reloadSourceOnError")||(he.registerPlugin||he.plugin)("reloadSourceOnError",fg);const Cg=he},288:(Ve,je,Ae)=>{/** * videojs-mux * @version 4.6.6 * @copyright 2022 Mux, Inc. * @license */var Ie;typeof self<"u",ie=function(o){return function(ke){function ie(ye){if(Ee[ye])return Ee[ye].exports;var U=Ee[ye]={i:ye,l:!1,exports:{}};return ke[ye].call(U.exports,U,U.exports,ie),U.l=!0,U.exports}var Ee={};return ie.m=ke,ie.c=Ee,ie.d=function(ye,U,w){ie.o(ye,U)||Object.defineProperty(ye,U,{configurable:!1,enumerable:!0,get:w})},ie.n=function(ye){var U=ye&&ye.__esModule?function(){return ye.default}:function(){return ye};return ie.d(U,"a",U),U},ie.o=function(ye,U){return Object.prototype.hasOwnProperty.call(ye,U)},ie.p="",ie(ie.s=2)}([function(ke,ie,Ee){var ye;typeof self<"u",ye=function(){return function(U){function w(y){if(D[y])return D[y].exports;var A=D[y]={i:y,l:!1,exports:{}};return U[y].call(A.exports,A,A.exports,w),A.l=!0,A.exports}var D={};return w.m=U,w.c=D,w.d=function(y,A,I){w.o(y,A)||Object.defineProperty(y,A,{configurable:!1,enumerable:!0,get:I})},w.n=function(y){var A=y&&y.__esModule?function(){return y.default}:function(){return y};return w.d(A,"a",A),A},w.o=function(y,A){return Object.prototype.hasOwnProperty.call(y,A)},w.p="",w(w.s=18)}([function(U,w,D){(function(y){var A;A=typeof window<"u"?window:y!==void 0?y:typeof self<"u"?self:{},u.exports=a}).call(w,d(20))},function(u,w){function D(J,ee,fe){switch(fe.length){case 0:return J.call(ee);case 1:return J.call(ee,fe[0]);case 2:return J.call(ee,fe[0],fe[1]);case 3:return J.call(ee,fe[0],fe[1],fe[2])}return J.apply(ee,fe)}function y(J,ee){for(var fe=-1,Pe=Array(J);++fe
-1&&J%1==0&&J
-1&&J%1==0&&J<=b}function K(J){var ee=typeof J;return!!J&&(ee=="object"||ee=="function")}function p(J){return!!J&&typeof J=="object"}function v(J){return R(J)?A(J):E(J)}var P,B=9007199254740991,z="[object Arguments]",ce="[object Function]",ae="[object GeneratorFunction]",ge=/^(?:0|[1-9]\d*)$/,ue=Object.prototype,le=ue.hasOwnProperty,pe=ue.toString,se=ue.propertyIsEnumerable,oe=function(J,ee){return function(fe){return J(ee(fe))}}(Object.keys,Object),xe=Math.max,Y=!se.call({valueOf:1},"valueOf"),$=Array.isArray,de=(P=function(J,ee){if(Y||X(ee)||R(ee))H(ee,v(ee),J);else for(var fe in ee)le.call(ee,fe)&&I(J,fe,ee[fe])},M(function(J,ee){var fe=-1,Pe=ee.length,Re=Pe>1?ee[Pe-1]:void 0,Fe=Pe>2?ee[2]:void 0;for(Re=P.length>3&&typeof Re=="function"?(Pe--,Re):void 0,Fe&&V(ee[0],ee[1],Fe)&&(Re=Pe<3?void 0:Re,Pe=1),J=Object(J);++fe
=0||te.toLowerCase().indexOf("x-litix-")===0)&&(E[te]=H.join(": "))}}),E}Object.defineProperty(w,"__esModule",{value:!0}),w.default=y;var A=["x-cdn","content-type"]},function(U,w,D){var y=SyntaxError,A=Function,I=TypeError,E=function(ue){try{return A('"use strict"; return ('+ue+").constructor;")()}catch{}},M=Object.getOwnPropertyDescriptor;if(M)try{M({},"")}catch{M=null}var H=function(){throw new I},te=M?function(){try{return H}catch{try{return M(arguments,"callee").get}catch{return H}}}():H,V=D(43)(),X=Object.getPrototypeOf||function(ue){return ue.__proto__},k={},N=typeof Uint8Array>"u"?void 0:X(Uint8Array),R={"%AggregateError%":typeof AggregateError>"u"?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":V?X([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":k,"%AsyncGenerator%":k,"%AsyncGeneratorFunction%":k,"%AsyncIteratorPrototype%":k,"%Atomics%":typeof Atomics>"u"?void 0:Atomics,"%BigInt%":typeof BigInt>"u"?void 0:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?void 0:Float32Array,"%Float64Array%":typeof Float64Array>"u"?void 0:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?void 0:FinalizationRegistry,"%Function%":A,"%GeneratorFunction%":k,"%Int8Array%":typeof Int8Array>"u"?void 0:Int8Array,"%Int16Array%":typeof Int16Array>"u"?void 0:Int16Array,"%Int32Array%":typeof Int32Array>"u"?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":V?X(X([][Symbol.iterator]())):void 0,"%JSON%":typeof JSON=="object"?JSON:void 0,"%Map%":typeof Map>"u"?void 0:Map,"%MapIteratorPrototype%":typeof Map<"u"&&v?x(new Map()[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?void 0:Promise,"%Proxy%":typeof Proxy>"u"?void 0:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?void 0:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?void 0:Set,"%SetIteratorPrototype%":typeof Set<"u"&&v?x(new Set()[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":V?X(""[Symbol.iterator]()):void 0,"%Symbol%":V?Symbol:void 0,"%SyntaxError%":y,"%ThrowTypeError%":te,"%TypedArray%":N,"%TypeError%":I,"%Uint8Array%":typeof Uint8Array>"u"?void 0:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?void 0:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?void 0:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?void 0:WeakMap,"%WeakRef%":typeof WeakRef>"u"?void 0:WeakRef,"%WeakSet%":typeof WeakSet>"u"?void 0:WeakSet},F=function ue(le){var pe;if(le==="%AsyncFunction%")pe=E("async function () {}");else if(le==="%GeneratorFunction%")pe=E("function* () {}");else if(le==="%AsyncGeneratorFunction%")pe=E("async function* () {}");else if(le==="%AsyncGenerator%"){var se=ue("%AsyncGeneratorFunction%");se&&(pe=se.prototype)}else if(le==="%AsyncIteratorPrototype%"){var oe=ue("%AsyncGenerator%");oe&&(pe=X(oe.prototype))}return R[le]=pe,pe},Z={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},L=D(9),K=D(46),p=L.call(Function.call,Array.prototype.concat),v=L.call(Function.apply,Array.prototype.splice),P=L.call(Function.call,String.prototype.replace),B=L.call(Function.call,String.prototype.slice),z=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!2円)[^\\]|\\.)*?)2円)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ce=/\\(\\)?/g,ae=function(ue){var le=B(ue,0,1),pe=B(ue,-1);if(le==="%"&&pe!=="%")throw new y("invalid intrinsic syntax, expected closing `%`");if(pe==="%"&&le!=="%")throw new y("invalid intrinsic syntax, expected opening `%`");var se=[];return P(ue,z,function(oe,xe,Y,$){se[se.length]=Y?P(,ドルce,"1ドル"):xe||oe}),se},ge=function(ue,le){var pe,se=ue;if(K(Z,se)&&(se="%"+(pe=Z[se])[0]+"%"),K(R,se)){var oe=R[se];if(oe===k&&(oe=F(se)),oe===void 0&&!le)throw new I("intrinsic "+ue+" exists, but is not available. Please file an issue!");return{alias:pe,name:se,value:oe}}throw new y("intrinsic "+ue+" does not exist!")};U.exports=function(ue,le){if(typeof ue!="string"||ue.length===0)throw new I("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof le!="boolean")throw new I('"allowMissing" argument must be a boolean');var pe=ae(ue),se=pe.length>0?pe[0]:"",oe=ge("%"+se+"%",le),xe=oe.name,Y=oe.value,$=!1,de=oe.alias;de&&(se=de[0],v(pe,p([0,1],de)));for(var J=1,ee=!0;J
=pe.length){var Fe=M(Y,fe);Y=(ee=!!Fe)&&"get"in Fe&&!("originalValue"in Fe.get)?Fe.get:Y[fe]}else ee=K(Y,fe),Y=Y[fe];ee&&!$&&(R[xe]=Y)}}return Y}},function(U,w,D){var y=D(45);U.exports=Function.prototype.bind||y},function(U,w,D){var y=String.prototype.replace,A=/%20/g,I={RFC1738:"RFC1738",RFC3986:"RFC3986"};U.exports={default:I.RFC3986,formatters:{RFC1738:function(E){return y.call(E,A,"+")},RFC3986:function(E){return String(E)}},RFC1738:I.RFC1738,RFC3986:I.RFC3986}},function(U,w,D){Object.defineProperty(w,"__esModule",{value:!0}),w.findMediaElement=w.getMuxPlayerId=void 0;var y=D(6),A=function(E){return E&&E.nodeName!==void 0?(E.muxId||(E.muxId=E.id||(0,y.generateShortID)()),E.muxId):E},I=function(E){var M=void 0;return E&&E.nodeName!==void 0?E=A(M=E):M=document.querySelector(E),[M,E,M&&M.nodeName?M.nodeName.toLowerCase():""]};w.getMuxPlayerId=A,w.findMediaElement=I},function(U,w,D){function y(){return(E.default.doNotTrack||E.default.navigator&&(E.default.navigator.doNotTrack||E.default.navigator.msDoNotTrack))==="1"}Object.defineProperty(w,"__esModule",{value:!0}),w.default=y;var A,I=D(0),E=(A=I)&&A.__esModule?A:{default:A}},function(U,w,D){Object.defineProperty(w,"__esModule",{value:!0});var y,A=D(0),I=(y=A)&&y.__esModule?y:{default:y},E={exists:function(){var M=I.default.performance;return(M&&M.timing)!==void 0},domContentLoadedEventEnd:function(){var M=I.default.performance,H=M&&M.timing;return H&&H.domContentLoadedEventEnd},navigationStart:function(){var M=I.default.performance,H=M&&M.timing;return H&&H.navigationStart}};w.default=E},function(U,w,D){Object.defineProperty(w,"__esModule",{value:!0});var y=function(A){var I={};for(var E in A){var M=A[E];M["DATA-ID"].search("io.litix.data.")!==-1&&(I[M["DATA-ID"].replace("io.litix.data.","")]=M.VALUE)}return I};w.default=y},function(U,w,D){var y=D(41),A=D(51),I=D(10);U.exports={formats:I,parse:A,stringify:y}},function(U,w,D){var y=D(10),A=Object.prototype.hasOwnProperty,I=Array.isArray,E=function(){for(var K=[],p=0;p<256;++p)k.push("%"+((p<16?"0":"")+p.tostring(16)).touppercase());return K}(),M=function(K){for(;K.length>1;){var p=K.pop(),v=p.obj[p.prop];if(I(v)){for(var P=[],B=0;B
=48&&ge<=57||ge>=65&&ge<=90||ge>=97&&ge<=122||b===y.rfc1738&&(ge===40||ge===41)?ce+=z.charat(ae):ge<128?ce+=e[ge]:ge<2048?ce+=e[192|ge>>6]+E[128|63&ge]:ge<55296||ge>=57344?ce+=E[224|ge>>12]+E[128|ge>>6&63]+E[128|63&ge]:(ae+=1,ge=65536+((1023&ge)<<10|1023&z.charcodeat(ae)),ce+=e[240|ge>>18]+E[128|ge>>12&63]+E[128|ge>>6&63]+E[128|63&ge])}return ce},N=function(K){for(var p=[{obj:{o:K},prop:"o"}],v=[],P=0;P
=0&&se<=ue.levels.silent))throw"log.setlevel() called with invalid level: "+se;if(ge=se,oe!==!1&&z(se),te.call(ue,se,v),typeof console===R&&se
0||Y.video_source_duration>0)&&(Y.video_source_is_live=!1)),Y.video_source_is_live||$.forEach(function(Pe){Y[Pe]=void 0}),Y.video_source_url=Y.video_source_url||Y.player_source_url,Y.video_source_url){var de=(0,H.extractHostnameAndDomain)(Y.video_source_url),J=A(de,2),ee=J[0],fe=J[1];Y.video_source_domain=fe,Y.video_source_hostname=ee}delete Y.ad_request_id,this.playbackEventDispatcher.send(xe,Y),this.data.view_sequence_number++,this.data.player_sequence_number++,this._restartHeartBeat()},oe.prototype._updateStateData=function(){(0,E.default)(this.data,this.getStateData()),this._updatePlayheadTime(),this._sanitizeData()},oe.prototype._sanitizeData=function(){var xe=this;["player_width","player_height","video_source_width","video_source_height","player_playhead_time","video_source_bitrate"].forEach(function(Y){var $=parseInt(xe.data[Y],10);xe.data[Y]=isNaN($)?void 0:$}),["player_source_url","video_source_url"].forEach(function(Y){if(xe.data[Y]){var $=xe.data[Y].toLowerCase();$.indexOf("data:")!==0&&$.indexOf("blob:")!==0||(xe.data[Y]="MSE style URL")}})},oe.prototype._resetVideoData=function(xe,Y){var $=this;Object.keys(this.data).forEach(function(de){de.indexOf("video_")===0&&delete $.data[de]})},oe.prototype._resetViewData=function(){var xe=this;Object.keys(this.data).forEach(function(Y){Y.indexOf("view_")===0&&delete xe.data[Y]}),this.data.view_sequence_number=1},oe.prototype._resetErrorData=function(xe,Y){delete this.data.player_error_code,delete this.data.player_error_message},oe.prototype._initializeViewData=function(){var xe=this,Y=this.data.view_id=(0,M.generateUUID)(),$=function(){Y===xe.data.view_id&&(0,X.default)(xe.data,"player_view_count",1)};this.data.player_is_paused?this.one("play",$):$()},oe.prototype._restartHeartBeat=function(){var xe=this;te.default.clearTimeout(this._heartBeatTimeout),this.viewErrored||(this._heartBeatTimeout=te.default.setTimeout(function(){xe.data.player_is_paused||xe.emit("hb")},1e4))},oe.prototype.addHLSJS=function(xe){return xe.hlsjs?this.hlsjs?void this.mux.log.warn("An instance of HLS.js is already being monitored for this player."):(this.hlsjs=xe.hlsjs,void(0,k.monitorHlsJs)(this.mux,this.id,xe.hlsjs,{},xe.Hls||te.default.Hls)):void this.mux.log.warn("You must pass a valid hlsjs instance in order to track it.")},oe.prototype.removeHLSJS=function(){this.hlsjs&&((0,k.stopMonitoringHlsJs)(this.hlsjs),this.hlsjs=void 0)},oe.prototype.addDashJS=function(xe){return xe.dashjs?this.dashjs?void this.mux.log.warn("An instance of Dash.js is already being monitored for this player."):(this.dashjs=xe.dashjs,void(0,N.monitorDashJS)(this.mux,this.id,xe.dashjs)):void this.mux.log.warn("You must pass a valid dashjs instance in order to track it.")},oe.prototype.removeDashJS=function(){this.dashjs&&((0,N.stopMonitoringDashJS)(this.dashjs),this.dashjs=void 0)},w.default=oe},function(U,w,D){function y(k){return k&&k.__esModule?k:{default:k}}Object.defineProperty(w,"__esModule",{value:!0}),w.stopMonitoringHlsJs=w.monitorHlsJs=void 0;var A=y(D(7)),I=y(D(13)),E=D(5),M=y(D(14)),H=function(k){if(!k)return{};var N=I.default.navigationStart(),R=k.loading,F=R?R.start:k.trequest,Z=R?R.first:k.tfirst,L=R?R.end:k.tload;return{bytesLoaded:k.total,requestStart:Math.round(N+F),responseStart:Math.round(N+Z),responseEnd:Math.round(N+L)}},te=function(k){if(k&&typeof k.getAllResponseHeaders=="function")return(0,A.default)(k.getAllResponseHeaders())},V=function(k,N,R){var F=arguments[4],Z=k.log,L=k.utils.secondsToMs,K=function(le){var pe=parseInt(F.version),se=void 0;return pe===1&&le.programDateTime!==null&&(se=le.programDateTime),pe===0&&le.pdt!==null&&(se=le.pdt),se};if(I.default.exists()){var p=function(le,pe){return k.emit(N,le,pe)},v=function(le,pe){var se=pe.levels,oe=pe.audioTracks,xe=pe.url,Y=pe.stats,$=pe.networkDetails,de=pe.sessionData,J={},ee={},fe={};fe=(0,M.default)(de),se.forEach(function($e,Et){J[Et]={width:$e.width,height:$e.height,bitrate:$e.bitrate,attrs:$e.attrs}}),oe.forEach(function($e,Et){ee[Et]={name:$e.name,language:$e.lang,bitrate:$e.bitrate}});var Pe=H(Y),Re=Pe.bytesLoaded,Fe=Pe.requestStart,He=Pe.responseStart,Ze=Pe.responseEnd;fe.request_event_type=le,fe.request_bytes_loaded=Re,fe.request_start=Fe,fe.request_response_start=He,fe.request_response_end=Ze,fe.request_type="manifest",fe.request_hostname=(0,E.extractHostname)(xe),fe.request_response_headers=te($),fe.request_rendition_lists={media:J,audio:ee,video:{}},p("requestcompleted",fe)};R.on(F.Events.MANIFEST_LOADED,v);var P=function(le,pe){var se=pe.details,oe=pe.level,xe=pe.networkDetails,Y=pe.stats,$=H(Y),de=$.bytesLoaded,J=$.requestStart,ee=$.responseStart,fe=$.responseEnd,Pe=se.fragments[se.fragments.length-1],Re=K(Pe)+L(Pe.duration);p("requestcompleted",{request_event_type:le,request_bytes_loaded:de,request_start:J,request_response_start:ee,request_response_end:fe,request_current_level:oe,request_type:"manifest",request_hostname:(0,E.extractHostname)(se.url),request_response_headers:te(xe),video_holdback:se.holdBack&&L(se.holdBack),video_part_holdback:se.partHoldBack&&L(se.partHoldBack),video_part_target_duration:se.partTarget&&L(se.partTarget),video_target_duration:se.targetduration&&L(se.targetduration),video_source_is_live:se.live,player_manifest_newest_program_time:isNaN(Re)?void 0:Re})};R.on(F.Events.LEVEL_LOADED,P);var B=function(le,pe){var se=pe.details,oe=pe.networkDetails,xe=pe.stats,Y=H(xe),$=Y.bytesLoaded,de=Y.requestStart,J=Y.responseStart,ee=Y.responseEnd;p("requestcompleted",{request_event_type:le,request_bytes_loaded:,ドルrequest_start:de,request_response_start:J,request_response_end:ee,request_type:"manifest",request_hostname:(0,E.extractHostname)(se.url),request_response_headers:te(oe)})};R.on(F.Events.AUDIO_TRACK_LOADED,B);var z=function(le,pe){var se=pe.stats,oe=pe.networkDetails,xe=pe.frag,Y=H(se),$={request_event_type:le,request_bytes_loaded:Y.bytesLoaded,request_start:Y.requestStart,request_response_start:Y.responseStart,request_response_end:Y.responseEnd,request_hostname:oe?(0,E.extractHostname)(oe.responseURL):void 0,request_response_headers:te(oe),request_media_duration:xe.duration};xe.type==="main"?($.request_type="media",$.request_current_level=xe.level,$.request_video_width=(R.levels[xe.level]||{}).width,$.request_video_height=(R.levels[xe.level]||{}).height):$.request_type=xe.type,p("requestcompleted",$)};R.on(F.Events.FRAG_LOADED,z);var ce=function(le,pe){var se=pe.frag,oe=se.start,xe={currentFragmentPDT:K(se),currentFragmentStart:L(oe)};p("fragmentchange",xe)};R.on(F.Events.FRAG_CHANGED,ce);var ae=function(le,pe){var se=pe.type,oe=pe.details,xe=pe.response,Y=pe.fatal,$=pe.context,de=pe.frag;if(oe===F.ErrorDetails.MANIFEST_LOAD_ERROR||oe===F.ErrorDetails.MANIFEST_LOAD_TIMEOUT||oe===F.ErrorDetails.FRAG_LOAD_ERROR||oe===F.ErrorDetails.FRAG_LOAD_TIMEOUT||oe===F.ErrorDetails.LEVEL_LOAD_ERROR||oe===F.ErrorDetails.LEVEL_LOAD_TIMEOUT){var J=de&&de.url||$&&$.url||"";p("requestfailed",{request_error:oe,request_url:J,request_hostname:(0,E.extractHostname)(J),request_type:oe===F.ErrorDetails.FRAG_LOAD_ERROR||oe===F.ErrorDetails.FRAG_LOAD_TIMEOUT?"media":"manifest",request_error_code:xe&&xe.code,request_error_text:xe&&xe.text})}Y&&p("error",{player_error_code:se,player_error_message:oe})};R.on(F.Events.ERROR,ae);var ge=function(le,pe){var se=pe.frag,oe=se&&se._url||"";p("requestcanceled",{request_cancel:le,request_url:oe,request_type:"media",request_hostname:(0,E.extractHostname)(oe)})};R.on(F.Events.FRAG_LOAD_EMERGENCY_ABORTED,ge);var ue=function(le,pe){var se=pe.level,oe=R.levels[se];if(oe&&oe.attrs&&oe.attrs.BANDWIDTH){var xe=oe.attrs.BANDWIDTH;xe?p("renditionchange",{video_source_bitrate:xe,video_source_width:oe.width,video_source_height:oe.height}):Z.warn("missing BANDWIDTH from HLS manifest parsed by HLS.js")}};R.on(F.Events.LEVEL_SWITCHED,ue),R._stopMuxMonitor=function(){R.off(F.Events.MANIFEST_LOADED,v),R.off(F.Events.LEVEL_LOADED,P),R.off(F.Events.AUDIO_TRACK_LOADED,B),R.off(F.Events.FRAG_LOADED,z),R.off(F.Events.FRAG_CHANGED,ce),R.off(F.Events.ERROR,ae),R.off(F.Events.FRAG_LOAD_EMERGENCY_ABORTED,ge),R.off(F.Events.LEVEL_SWITCHED,ue),R.off(F.Events.DESTROYING,R._stopMuxMonitor),delete R._stopMuxMonitor},R.on(F.Events.DESTROYING,R._stopMuxMonitor)}else Z.warn("performance timing not supported. Not tracking HLS.js.")},X=function(k){k&&typeof k._stopMuxMonitor=="function"&&k._stopMuxMonitor()};w.monitorHlsJs=V,w.stopMonitoringHlsJs=X},function(U,w,D){function y(X){return X&&X.__esModule?X:{default:X}}Object.defineProperty(w,"__esModule",{value:!0}),w.stopMonitoringDashJS=w.monitorDashJS=void 0;var A=y(D(0)),I=y(D(7)),E=D(5),M=function(X,k){if(!X||typeof X.getRequests!="function")return{};var N=X.getRequests({state:"executed"});if(N.length===0)return{};var R=N[N.length-1],F=(0,E.extractHostname)(R.url),Z=R.bytesLoaded,L=new Date(R.requestStartDate).getTime(),K=new Date(R.firstByteDate).getTime(),p=new Date(R.requestEndDate).getTime(),v=isNaN(R.duration)?0:R.duration,P=typeof k.getMetricsFor=="function"?k.getMetricsFor(R.mediaType).HttpList:k.getDashMetrics().getHttpRequests(R.mediaType),B=void 0;return P.length>0&&(B=(0,I.default)(P[P.length-1]._responseHeaders||"")),{requestStart:L,requestResponseStart:K,requestResponseEnd:p,requestBytesLoaded:Z,requestResponseHeaders:B,requestMediaDuration:v,requestHostname:F}},H=function(X,k){var N=k.getQualityFor(X),R=k.getCurrentTrackFor(X).bitrateList;return R?{currentLevel:N,renditionWidth:R[N].width||null,renditionHeight:R[N].height||null,renditionBitrate:R[N].bandwidth}:{}},te=function(X,k,N){var R=X.log;if(N&&N.on){var F=function(ce,ae){return X.emit(k,ce,ae)},Z=function(ce){var ae=ce.type,ge=(ce.data||{}).url;F("requestcompleted",{request_event_type:ae,request_start:0,request_response_start:0,request_response_end:0,request_bytes_loaded:-1,request_type:"manifest",request_hostname:(0,E.extractHostname)(ge)})};N.on("manifestLoaded",Z);var L={},K=function(ce){var ae=ce.type,ge=ce.fragmentModel,ue=(ce.chunk||{}).mediaInfo||{},le=ue.type,pe=ue.bitrateList,se={};(pe=pe||[]).forEach(function(fe,Pe){se[Pe]={},se[Pe].width=fe.width,se[Pe].height=fe.height,se[Pe].bitrate=fe.bandwidth,se[Pe].attrs={}}),le==="video"?L.video=se:le==="audio"?L.audio=se:L.media=se;var oe=M(ge,N),xe=oe.requestStart,Y=oe.requestResponseStart,$=oe.requestResponseEnd,de=oe.requestResponseHeaders,J=oe.requestMediaDuration,ee=oe.requestHostname;F("requestcompleted",{request_event_type:ae,request_start:xe,request_response_start:Y,request_response_end:,ドルrequest_bytes_loaded:-1,request_type:le+"_init",request_response_headers:de,request_hostname:ee,request_media_duration:J,request_rendition_lists:L})};N.on("initFragmentLoaded",K);var p=function(ce){var ae=ce.type,ge=ce.fragmentModel,ue=ce.chunk||{},le=ue.mediaInfo,pe=ue.start,se=(le||{}).type,oe=M(ge,N),xe=oe.requestStart,Y=oe.requestResponseStart,$=oe.requestResponseEnd,de=oe.requestBytesLoaded,J=oe.requestResponseHeaders,ee=oe.requestMediaDuration,fe=oe.requestHostname,Pe=H(se,N),Re=Pe.currentLevel,Fe=Pe.renditionWidth,He=Pe.renditionHeight,Ze=Pe.renditionBitrate;F("requestcompleted",{request_event_type:ae,request_start:xe,request_response_start:Y,request_response_end:,ドルrequest_bytes_loaded:de,request_type:se,request_response_headers:J,request_hostname:fe,request_media_start_time:pe,request_media_duration:ee,request_current_level:Re,request_labeled_bitrate:Ze,request_video_width:Fe,request_video_height:He})};N.on("mediaFragmentLoaded",p);var v={video:void 0,audio:void 0,totalBitrate:void 0},P=function(){if(v.video&&typeof v.video.bitrate=="number"){if(!v.video.width||!v.video.height)return void R.warn("have bitrate info for video but missing width/height");var ce=v.video.bitrate;return v.audio&&typeof v.audio.bitrate=="number"&&(ce+=v.audio.bitrate),ce!==v.totalBitrate?(v.totalBitrate=ce,{video_source_bitrate:ce,video_source_height:v.video.height,video_source_width:v.video.width}):void 0}},B=function(ce,ae,ge){if(typeof ce.newQuality=="number"){var ue=ce.mediaType;if(ue==="audio"||ue==="video"){var le=N.getBitrateInfoListFor(ue).find(function(se){return se.qualityIndex===ce.newQuality});if(!le||typeof le.bitrate!="number")return void R.warn("missing bitrate info for "+ue);v[ue]=le;var pe=P();pe&&F("renditionchange",pe)}}else R.warn("missing evt.newQuality in qualityChangeRendered event",ce)};N.on("qualityChangeRendered",B);var z=function(ce){var ae=ce.error,ge=ce.event,ue=(ge=ge||{}).request||{},le=A.default.event&&A.default.event.currentTarget||{};F("requestfailed",{request_error:ae+"_"+ge.id+"_"+ue.type,request_url:ge.url,request_hostname:(0,E.extractHostname)(ge.url),request_type:ue.mediaType,request_error_code:le.status,request_error_type:le.statusText})};N.on("error",z),N._stopMuxMonitor=function(){N.off("manifestLoaded",Z),N.off("initFragmentLoaded",K),N.off("mediaFragmentLoaded",p),N.off("qualityChangeRendered",B),N.off("error",z),delete N._stopMuxMonitor}}else R.warn("Invalid dash.js player reference. Monitoring blocked.")},V=function(X){X&&typeof X._stopMuxMonitor=="function"&&X._stopMuxMonitor()};w.monitorDashJS=te,w.stopMonitoringDashJS=V},function(U,w,D){Object.defineProperty(w,"__esModule",{value:!0});var y=function(){},A=0;y.prototype.on=function(I,E,M){return E._eventEmitterGuid=E._eventEmitterGuid||++A,this._listeners=this._listeners||{},this._listeners[I]=this._listeners[I]||[],M&&(E=E.bind(M)),this._listeners[I].push(E),E},y.prototype.off=function(I,E){var M=this._listeners&&this._listeners[I];M&&M.forEach(function(H,te){H._eventEmitterGuid===E._eventEmitterGuid&&M.splice(te,1)})},y.prototype.one=function(I,E,M){var H=this;E._eventEmitterGuid=E._eventEmitterGuid||++A;var te=function V(){H.off(I,V),E.apply(M||this,arguments)};te._eventEmitterGuid=E._eventEmitterGuid,this.on(I,te)},y.prototype.emit=function(I,E){var M=this;if(this._listeners){E=E||{};var H=this._listeners["before*"]||[],te=this._listeners[I]||[],V=this._listeners["after"+I]||[],X=function(k,N){(k=k.slice()).forEach(function(R){R.call(M,{type:I},N)})};X(H,E),X(te,E),X(V,E)}},w.default=y},function(U,w,D){Object.defineProperty(w,"__esModule",{value:!0});var y,A=D(0),I=(y=A)&&y.__esModule?y:{default:y},E=function(){this._playbackHeartbeatInterval=null,this._playheadShouldBeProgressing=!1,this.on("playing",function(){this._playheadShouldBeProgressing=!0}),this.on("play",this._startPlaybackHeartbeatInterval),this.on("playing",this._startPlaybackHeartbeatInterval),this.on("adbreakstart",this._startPlaybackHeartbeatInterval),this.on("adplay",this._startPlaybackHeartbeatInterval),this.on("adplaying",this._startPlaybackHeartbeatInterval),this.on("seeking",this._startPlaybackHeartbeatInterval),this.on("devicewake",this._startPlaybackHeartbeatInterval),this.on("viewstart",this._startPlaybackHeartbeatInterval),this.on("rebufferstart",this._startPlaybackHeartbeatInterval),this.on("pause",this._stopPlaybackHeartbeatInterval),this.on("ended",this._stopPlaybackHeartbeatInterval),this.on("viewend",this._stopPlaybackHeartbeatInterval),this.on("error",this._stopPlaybackHeartbeatInterval),this.on("aderror",this._stopPlaybackHeartbeatInterval),this.on("adpause",this._stopPlaybackHeartbeatInterval),this.on("adended",this._stopPlaybackHeartbeatInterval),this.on("adbreakend",this._stopPlaybackHeartbeatInterval),this.on("seeked",function(){this.data.player_is_paused?this._stopPlaybackHeartbeatInterval():this._startPlaybackHeartbeatInterval()}),this.on("timeupdate",function(){this._playbackHeartbeatInterval!==null&&this.emit("playbackheartbeat")}),this.on("devicesleep",function(M,H){this._playbackHeartbeatInterval!==null&&(I.default.clearInterval(this._playbackHeartbeatInterval),this.emit("playbackheartbeatend",{viewer_time:H.viewer_time}),this._playbackHeartbeatInterval=null)})};E.prototype._startPlaybackHeartbeatInterval=function(){var M=this;this._playbackHeartbeatInterval===null&&(this.emit("playbackheartbeat"),this._playbackHeartbeatInterval=I.default.setInterval(function(){M.emit("playbackheartbeat")},this.playbackHeartbeatTime))},E.prototype._stopPlaybackHeartbeatInterval=function(){this._playheadShouldBeProgressing=!1,this._playbackHeartbeatInterval!==null&&(I.default.clearInterval(this._playbackHeartbeatInterval),this.emit("playbackheartbeatend"),this._playbackHeartbeatInterval=null)},w.default=E},function(U,w,D){function y(){var A=this;this.on("viewinit",function(){A.viewErrored=!1}),this.on("error",function(){try{var I=A.errorTranslator({player_error_code:A.data.player_error_code,player_error_message:A.data.player_error_message});I?(A.data.player_error_code=I.player_error_code,A.data.player_error_message=I.player_error_message,A.viewErrored=!0):(delete A.data.player_error_code,delete A.data.player_error_message)}catch(E){A.mux.log.warn("Exception in error translator callback.",E),A.viewErrored=!0}})}Object.defineProperty(w,"__esModule",{value:!0}),w.default=y},function(U,w,D){Object.defineProperty(w,"__esModule",{value:!0});var y,A=D(3),I=(y=A)&&y.__esModule?y:{default:y},E=function(){this._watchTimeTrackerLastCheckedTime=null,this.on("playbackheartbeat",this._updateWatchTime),this.on("playbackheartbeatend",this._clearWatchTimeState)};E.prototype._updateWatchTime=function(M,H){var te=H.viewer_time;this._watchTimeTrackerLastCheckedTime===null&&(this._watchTimeTrackerLastCheckedTime=te),(0,I.default)(this.data,"view_watch_time",te-this._watchTimeTrackerLastCheckedTime),this._watchTimeTrackerLastCheckedTime=te},E.prototype._clearWatchTimeState=function(M,H){this._updateWatchTime(M,H),this._watchTimeTrackerLastCheckedTime=null},w.default=E},function(U,w,D){Object.defineProperty(w,"__esModule",{value:!0});var y,A=D(3),I=(y=A)&&y.__esModule?y:{default:y},E=function(){this._playbackTimeTrackerLastPlayheadPosition=-1,this.on("playbackheartbeat",this._updatePlaybackTime),this.on("playbackheartbeatend",this._clearPlaybackTimeState),this.on("seeking",this._clearPlaybackTimeState)};E.prototype._updatePlaybackTime=function(){var M=this.data.player_playhead_time;if(this._playbackTimeTrackerLastPlayheadPosition>=0&&M>this._playbackTimeTrackerLastPlayheadPosition){var H=M-this._playbackTimeTrackerLastPlayheadPosition;H<=1e3&&(0,i.default)(this.data,"view_content_playback_time",h)}this._playbacktimetrackerlastplayheadposition=m},e.prototype._clearplaybacktimestate=function(){this._updateplaybacktime(),this._playbacktimetrackerlastplayheadposition=-1},w.default=e},function(u,w,d){object.defineproperty(w,"__esmodule",{value:!0});var y=function(){this.on("playbackheartbeat",this._updatePlayheadTime),this.on("playbackheartbeatend",this._updatePlayheadTime),this.on("timeupdate",this._updatePlayheadTime),this.on("destroy",function(){this.off("timeupdate",this._updatePlayheadTime)})};y.prototype._updateMaxPlayheadPosition=function(){this.data.view_max_playhead_position=this.data.view_max_playhead_position===void 0?this.data.player_playhead_time:Math.max(this.data.view_max_playhead_position,this.data.player_playhead_time)},y.prototype._updatePlayheadTime=function(A,I){var E=this,M=function(){E.currentFragmentPDT&&E.currentFragmentStart&&(E.data.player_program_time=E.currentFragmentPDT+E.data.player_playhead_time-E.currentFragmentStart)};if(I&&I.player_playhead_time)this.data.player_playhead_time=I.player_playhead_time,M(),this._updateMaxPlayheadPosition();else if(this.getPlayheadTime){var H=this.getPlayheadTime();H!==void 0&&(this.data.player_playhead_time=H,M(),this._updateMaxPlayheadPosition())}},w.default=y},function(U,w,D){function y(){var M=this;if(!this.disableRebufferTracking){var H=void 0,te=function(){if(H){var V=M.data.viewer_time-H;(0,E.default)(M.data,"view_rebuffer_duration",V),H=M.data.viewer_time}M.data.view_watch_time>=0&&M.data.view_rebuffer_count>0&&(M.data.view_rebuffer_frequency=M.data.view_rebuffer_count/M.data.view_watch_time,M.data.view_rebuffer_percentage=M.data.view_rebuffer_duration/M.data.view_watch_time)};this.on("playbackheartbeat",function(){return te()}),this.on("rebufferstart",function(){H||((0,E.default)(M.data,"view_rebuffer_count",1),H=M.data.viewer_time,M.one("rebufferend",function(){te(),H=void 0}))})}}Object.defineProperty(w,"__esModule",{value:!0}),w.default=y;var A,I=D(3),E=(A=I)&&A.__esModule?A:{default:A}},function(U,w,D){Object.defineProperty(w,"__esModule",{value:!0});var y,A=D(2),I=(y=A)&&y.__esModule?y:{default:y},E=function(){this.disableRebufferTracking||this.disablePlayheadRebufferTracking||(this._lastCheckedTime=null,this._lastPlayheadTime=null,this._lastPlayheadTimeUpdatedTime=null,this.on("playbackheartbeat",this._checkIfRebuffering),this.on("playbackheartbeatend",this._cleanupRebufferTracker),this.on("seeking",function(){this._cleanupRebufferTracker(null,{viewer_time:I.default.now()})}))};E.prototype._checkIfRebuffering=function(M,H){return this.isSeeking||this.isAdBreak||!this._playheadShouldBeProgressing?void this._cleanupRebufferTracker(M,H):this._lastCheckedTime===null?void this._prepareRebufferTrackerState(H.viewer_time):this._lastPlayheadTime!==this.data.player_playhead_time?void this._cleanupRebufferTracker(M,H,!0):(H.viewer_time-this._lastPlayheadTimeUpdatedTime>=this.sustainedRebufferThreshold&&(this._rebuffering||(this._rebuffering=!0,this.emit("rebufferstart",{viewer_time:this._lastPlayheadTimeUpdatedTime}))),void(this._lastCheckedTime=H.viewer_time))},E.prototype._clearRebufferTrackerState=function(){this._lastCheckedTime=null,this._lastPlayheadTime=null,this._lastPlayheadTimeUpdatedTime=null},E.prototype._prepareRebufferTrackerState=function(M){this._lastCheckedTime=M,this._lastPlayheadTime=this.data.player_playhead_time,this._lastPlayheadTimeUpdatedTime=M},E.prototype._cleanupRebufferTracker=function(M,H){var te=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(this._rebuffering)this._rebuffering=!1,this.emit("rebufferend",{viewer_time:H.viewer_time});else{if(this._lastCheckedTime===null)return;var V=this.data.player_playhead_time-this._lastPlayheadTime,X=H.viewer_time-this._lastPlayheadTimeUpdatedTime;V>0&&X-V>this.minimumRebufferDuration&&(this.emit("rebufferstart",{viewer_time:this._lastPlayheadTimeUpdatedTime}),this.emit("rebufferend",{viewer_time:this._lastPlayheadTimeUpdatedTime+X-V}))}te?this._prepareRebufferTrackerState(H.viewer_time):this._clearRebufferTrackerState()},w.default=E},function(U,w,D){Object.defineProperty(w,"__esModule",{value:!0});var y,A=D(2),I=(y=A)&&y.__esModule?y:{default:y},E=function(){this.on("viewinit",function(){var M=this.data,H=M.view_id;if(!M.view_program_changed){var te=function(V,X){var k=X.viewer_time;V.type==="playing"&&this.data.view_time_to_first_frame===void 0?this.calculateTimeToFirstFrame(k||I.default.now(),H):V.type!=="adplaying"||this.data.view_time_to_first_frame!==void 0&&!this.inPrerollPosition()||this.calculateTimeToFirstFrame(k||I.default.now(),H)};this.one("playing",te),this.one("adplaying",te),this.one("viewend",function(){this.off("playing",te),this.off("adplaying",te)})}})};E.prototype.calculateTimeToFirstFrame=function(M,H){H===this.data.view_id&&(this._updateWatchTime(null,{viewer_time:M}),this.data.view_time_to_first_frame=this.data.view_watch_time,(this.data.player_autoplay_on||this.data.video_is_autoplay)&&this.NAVIGATION_START&&(this.data.view_aggregate_startup_time=this.data.view_start+this.data.view_watch_time-this.NAVIGATION_START))},w.default=E},function(U,w,D){function y(){var M=this;this.on("viewinit",function(){this._lastPlayheadPosition=-1});var H=["playing","hb"];["pause","rebufferstart","seeking","error","adbreakstart","hb"].forEach(function(te){M.on(te,function(){if(this._lastPlayheadPosition>=0&&this.data.player_playhead_time>=0&&this._lastPlayerWidth>=0&&this._lastSourceWidth>0&&this._lastPlayerHeight>=0&&this._lastSourceHeight>0){var V=this.data.player_playhead_time-this._lastPlayheadPosition;if(V<0)return void(this._lastPlayheadPosition=-1);var X=Math.min(this._lastPlayerWidth/this._lastSourceWidth,this._lastPlayerHeight/this._lastSourceHeight),k=Math.max(0,X-1),N=Math.max(0,1-X);this.data.view_max_upscale_percentage=Math.max(this.data.view_max_upscale_percentage||0,k),this.data.view_max_downscale_percentage=Math.max(this.data.view_max_downscale_percentage||0,N),(0,E.default)(this.data,"view_total_content_playback_time",V),(0,E.default)(this.data,"view_total_upscaling",k*V),(0,E.default)(this.data,"view_total_downscaling",N*V)}this._lastPlayheadPosition=-1})}),H.forEach(function(te){M.on(te,function(){this._lastPlayheadPosition=this.data.player_playhead_time,this._lastPlayer__esModule",{value:!0}),w.default=y;var" A,I=D(3),E=(A=I)&&A.__esModule?A:{default:A}},function(U,w,D){function y(H){return H&&H.__esModule?H:{default:H}}function A(){this.isSeeking=!1,this.on("seeking",function(H,te){(0,M.default)(this.data,te),this._lastSeekingTime=I.default.now(),this.isSeeking===!1&&(this.isSeeking=!0,this.send("seeking"))}),this.on("seeked",function(){this.isSeeking=!1;var H=this._lastSeekingTime||I.default.now(),te=I.default.now()-H;(0,E.default)(this.data,"view_seek_count",1),(0,E.default)(this.data,"view_seek_duration",te);var V=this.data.view_max_seek_time||0;this.data.view_max_seek_time=Math.max(V,te)}),this.on("viewend",function(){this.isSeeking=!1})}Object.defineProperty(w,"__esModule",{value:!0}),w.default=A;var I=y(D(2)),E=y(D(3)),M=y(D(1))},function(U,w,D){function y(X){return X&&X.__esModule?X:{default:X}}Object.defineProperty(w,"__esModule",{value:!0});var A=function(){function X(k,N){var R=[],F=!0,Z=!1,L=void 0;try{for(var K,p=k[Symbol.iterator]();!(F=(K=p.next()).done)&&(R.push(K.value),!N||R.length!==N);F=!0);}catch(v){Z=!0,L=v}finally{try{!F&&p.return&&p.return()}finally{if(Z)throw L}}return R}return function(k,N){if(Array.isArray(k))return k;if(Symbol.iterator in Object(k))return X(k,N);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),I=y(D(3)),E=D(5),M=y(D(1)),H=function(X,k){X.push(k),X.sort(function(N,R){return N.viewer_time-R.viewer_time})},te=["adbreakstart","adrequest","adresponse","adplay","adplaying","adpause","adended","adbreakend","aderror"],V=function(){var X=this;this.on("viewinit",function(){this.isAdBreak=!1,this._currentAdRequestNumber=0,this._currentAdResponseNumber=0,this._adRequests=[],this._adResponses=[],this._adHasPlayed=!1,this._wouldBeNewAdPlay=!0,this._prerollPlayTime=void 0}),te.forEach(function(N){return X.on(N,X._updateAdData)});var k=function(){X.isAdBreak=!1};this.on("adbreakstart",function(){this.isAdBreak=!0}),this.on("play",k),this.on("playing",k),this.on("viewend",k),this.on("adrequest",function(N,R){R=(0,M.default)({ad_request_id:"generatedAdRequestId"+this._currentAdRequestNumber++},R),H(this._adRequests,R),(0,I.default)(this.data,"view_ad_request_count"),this.inPrerollPosition()&&(this.data.view_preroll_requested=!0,this._adHasPlayed||(0,I.default)(this.data,"view_preroll_request_count"))}),this.on("adresponse",function(N,R){R=(0,M.default)({ad_request_id:"generatedAdRequestId"+this._currentAdResponseNumber++},R),H(this._adResponses,R);var F=this.findAdRequest(R.ad_request_id);F&&(0,I.default)(this.data,"view_ad_request_time",Math.max(0,R.viewer_time-F.viewer_time))}),this.on("adplay",function(N,R){this._adHasPlayed=!0,this._wouldBeNewAdPlay&&(this._wouldBeNewAdPlay=!1,(0,I.default)(this.data,"view_ad_played_count")),this.inPrerollPosition()&&!this.data.view_preroll_played&&(this.data.view_preroll_played=!0,this._adRequests.length>0&&(this.data.view_preroll_request_time=Math.max(0,R.viewer_time-this._adRequests[0].viewer_time)),this.data.view_start&&(this.data.view_startup_preroll_request_time=Math.max(0,R.viewer_time-this.data.view_start)),this._prerollPlayTime=R.viewer_time)}),this.on("adplaying",function(N,R){this.inPrerollPosition()&&this.data.view_preroll_load_time===void 0&&this._prerollPlayTime!==void 0&&(this.data.view_preroll_load_time=R.viewer_time-this._prerollPlayTime,this.data.view_startup_preroll_load_time=R.viewer_time-this._prerollPlayTime)}),this.on("adended",function(){this._wouldBeNewAdPlay=!0}),this.on("aderror",function(){this._wouldBeNewAdPlay=!0})};V.prototype.inPrerollPosition=function(){return this.data.view_content_playback_time===void 0||this.data.view_content_playback_time<=1e3},v.prototype.findadrequest=function(x){for(var k=0;k
3e4&&(this.emit("devicesleep",{viewer_time:X}),(0,I.default)(this.data,{viewer_time:X}),this.send("devicesleep"),this.emit("devicewake",{viewer_time:V}),(0,I.default)(this.data,{viewer_time:V}),this.send("devicewake"))}},function(U,w,D){function y(p){return p&&p.__esModule?p:{default:p}}Object.defineProperty(w,"__esModule",{value:!0});var A=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},I=y(D(0)),E=D(40),M=y(D(4)),H=y(D(53)),te=y(D(12)),V=y(D(54)),X=y(D(17)),k=y(D(55)),N=y(D(1)),R=["env_key","view_id","view_sequence_number","player_sequence_number","beacon_domain","player_playhead_time","viewer_time","mux_api_version","event","video_id","player_instance_id"],F=["viewstart","error","ended","viewend"],Z=function(p,v){var P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.mux=p,this.envKey=v,this.eventQueue=new k.default((0,H.default)(v,P)),this.previousBeaconData=null,this.lastEventTime=null,this.sampleRate=P.sampleRate,this.disableCookies=P.disableCookies,this.respectDoNotTrack=P.respectDoNotTrack;var B=P.platform||{};this.pageLevelData={mux_api_version:this.mux.API_VERSION,mux_embed:this.mux.NAME,mux_embed_version:this.mux.VERSION,viewer_application_name:B.name,viewer_application_version:B.version,viewer_application_engine:B.layout,viewer_device_name:B.product,viewer_device_category:"",viewer_device_manufacturer:B.manufacturer,viewer_os_family:B.os&&B.os.family,viewer_os_architecture:B.os&&B.os.architecture,viewer_os_version:B.os&&B.os.version};var z=(0,V.default)();z&&(this.pageLevelData=(0,N.default)(this.pageLevelData,{viewer_connection_type:z})),I.default!==void 0&&I.default.location&&I.default.location.href&&(this.pageLevelData.page_url=I.default.location.href),this.viewerData=this.disableCookies?{}:(0,E.getAndUpdateViewerData)()};Z.prototype.send=function(p,v){if(p){if(this.respectDoNotTrack&&(0,te.default)())return M.default.info("Not sending `"+p+"` because Do Not Track is enabled");if(!v||(v===void 0?"undefined":A(v))!=="object")return M.default.error("A data object was expected in send() but was not provided");var P=this.disableCookies?{}:(0,E.getAndUpdateSessionData)(),B={};(0,N.default)(B,this.pageLevelData),(0,N.default)(B,v),(0,N.default)(B,P),(0,N.default)(B,this.viewerData),B.event=p,B.env_key=this.envKey,B.user_id&&(B.viewer_user_id=B.user_id,delete B.user_id);var z=B.mux_sample_number>=this.sampleRate,ce=this._deduplicateBeaconData(p,B),ae=(0,X.default)(ce);if(this.lastEventTime=this.mux.utils.now(),z)return M.default.info("Not sending event due to sample rate restriction",p,B,ae);if(this.envKey||M.default.info("Missing environment key (envKey) - beacons will be dropped if the video source is not a valid mux video URL",p,B,ae),!this.rateLimited){if(M.default.info("Sending event",p,B,ae),this.rateLimited=!this.eventQueue.queueEvent(p,ae),this.mux.WINDOW_UNLOADING&&p==="viewend")this.eventQueue.destroy(!0);else if((F.indexOf(p)>=0||this.mux.WINDOW_VISIBLE===!1&&p==="hb")&&this.eventQueue.flushEvents(),this.rateLimited)return B.event="eventrateexceeded",ae=(0,X.default)(B),this.eventQueue.queueEvent(B.event,ae),M.default.error("Beaconing disabled due to rate limit.")}}},Z.prototype.destroy=function(){this.eventQueue.destroy(!1)};var L=function(p,v,P,B){return!(!p||v.indexOf("request_")!==0||v!=="request_response_headers"&&(P===void 0?"undefined":A(P))==="object"&&(B===void 0?"undefined":A(B))==="object"&&Object.keys(P||{}).length===Object.keys(B||{}).length)},K=function(p,v){return p==="renditionchange"&&v.indexOf("video_source_")===0};Z.prototype._deduplicateBeaconData=function(p,v){var P=this,B={},z=v.view_id;if(!z||p==="viewstart"||p==="viewend"||!this.previousBeaconData||this.mux.utils.now()-this.lastEventTime>=6e5)B=(0,N.default)({},v),z&&(this.previousBeaconData=B),z&&p==="viewend"&&(this.previousBeaconData=null);else{var ce=p.indexOf("request")===0;Object.keys(v).forEach(function(ae){var ge=v[ae];(ge!==P.previousBeaconData[ae]||R.indexOf(ae)>-1||L(ce,ae,ge,P.previousBeaconData[ae])||K(p,ae))&&(B[ae]=ge,P.previousBeaconData[ae]=ge)})}return B},w.default=Z},function(U,w,D){function y(k){return k&&k.__esModule?k:{default:k}}Object.defineProperty(w,"__esModule",{value:!0}),w.getAndUpdateSessionData=w.getAndUpdateViewerData=void 0;var A=y(D(15)),I=y(D(52)),E=D(6),M=y(D(2)),H=function(){var k=void 0;try{k=A.default.parse(I.default.get("muxData")||"")}catch{k={}}return k},te=function(k){try{I.default.set("muxData",A.default.stringify(k),{expires:7300})}catch{}},V=function(){var k=H();return k.mux_viewer_id=k.mux_viewer_id||(0,E.generateUUID)(),k.msn=k.msn||Math.random(),te(k),{mux_viewer_id:k.mux_viewer_id,mux_sample_number:k.msn}},X=function(){var k=H(),N=M.default.now();return k.session_start&&(k.sst=k.session_start,delete k.session_start),k.session_id&&(k.sid=k.session_id,delete k.session_id),k.session_expires&&(k.sex=k.session_expires,delete k.session_expires),(!k.sex||k.sex
0?de.join(",")||null:void 0}];else if(H(ge))$e=ge;else{var wn=Object.keys(de);$e=ue?wn.sort(ue):wn}for(var kn=0;kn<$e.length;++kn){var Lt=$e[kn],Xt=typeof Lt=="object"&&Lt.value!==void 0?Lt.value:de[Lt];if(!ce||Xt!==null){var it=H(de)?typeof B=="function"?B(P,Lt):P:P+(le?"."+Lt:"["+Lt+"]");$.set(v,ee);var pt=y();pt.set(Z,$),X(Et,p(Xt,it,B,z,ce,ae,ge,ue,le,pe,se,oe,xe,Y,pt))}}return Et},K=function(p){if(!p)return R;if(p.encoder!==null&&p.encoder!==void 0&&typeof p.encoder!="function")throw new TypeError("Encoder has to be a function.");var v=p.charset||R.charset;if(p.charset!==void 0&&p.charset!=="utf-8"&&p.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var P=I.default;if(p.format!==void 0){if(!E.call(I.formatters,p.format))throw new TypeError("Unknown format option provided.");P=p.format}var B=I.formatters[P],z=R.filter;return(typeof p.filter=="function"||H(p.filter))&&(z=p.filter),{addQueryPrefix:typeof p.addQueryPrefix=="boolean"?p.addQueryPrefix:R.addQueryPrefix,allowDots:p.allowDots===void 0?R.allowDots:!!p.allowDots,charset:v,charsetSentinel:typeof p.charsetSentinel=="boolean"?p.charsetSentinel:R.charsetSentinel,delimiter:p.delimiter===void 0?R.delimiter:p.delimiter,encode:typeof p.encode=="boolean"?p.encode:R.encode,encoder:typeof p.encoder=="function"?p.encoder:R.encoder,encodeValuesOnly:typeof p.encodeValuesOnly=="boolean"?p.encodeValuesOnly:R.encodeValuesOnly,filter:z,format:P,formatter:B,serializeDate:typeof p.serializeDate=="function"?p.serializeDate:R.serializeDate,skipNulls:typeof p.skipNulls=="boolean"?p.skipNulls:R.skipNulls,sort:typeof p.sort=="function"?p.sort:null,strictNullHandling:typeof p.strictNullHandling=="boolean"?p.strictNullHandling:R.strictNullHandling}};U.exports=function(p,v){var P,B=p,z=K(v);typeof z.filter=="function"?B=(0,z.filter)("",B):H(z.filter)&&(P=z.filter);var ce,ae=[];if(typeof B!="object"||B===null)return"";ce=v&&v.arrayFormat in M?v.arrayFormat:v&&"indices"in v?v.indices?"indices":"repeat":"indices";var ge=M[ce];P||(P=Object.keys(B)),z.sort&&P.sort(z.sort);for(var ue=y(),le=0;le
0?oe+se:""}},function(U,w,D){var y=D(8),A=D(47),I=D(49),E=y("%TypeError%"),M=y("%WeakMap%",!0),H=y("%Map%",!0),te=A("WeakMap.prototype.get",!0),V=A("WeakMap.prototype.set",!0),X=A("WeakMap.prototype.has",!0),k=A("Map.prototype.get",!0),N=A("Map.prototype.set",!0),R=A("Map.prototype.has",!0),F=function(p,v){for(var P,B=p;(P=B.next)!==null;B=P)if(P.key===v)return B.next=P.next,P.next=p.next,p.next=P,P},Z=function(p,v){var P=F(p,v);return P&&P.value},L=function(p,v,P){var B=F(p,v);B?B.value=P:p.next={key:v,next:p.next,value:P}},K=function(p,v){return!!F(p,v)};U.exports=function(){var p,v,P,B={assert:function(z){if(!B.has(z))throw new E("Side channel does not contain "+I(z))},get:function(z){if(M&&z&&(typeof z=="object"||typeof z=="function")){if(p)return te(p,z)}else if(H){if(v)return k(v,z)}else if(P)return Z(P,z)},has:function(z){if(M&&z&&(typeof z=="object"||typeof z=="function")){if(p)return X(p,z)}else if(H){if(v)return R(v,z)}else if(P)return K(P,z);return!1},set:function(z,ce){M&&z&&(typeof z=="object"||typeof z=="function")?(p||(p=new M),V(p,z,ce)):H?(v||(v=new H),N(v,z,ce)):(P||(P={key:{},next:null}),L(P,z,ce))}};return B}},function(U,w,D){var y=typeof Symbol<"u"&&symbol,a=d(44);u.exports=function(){return typeof y=="function"&&typeof Symbol=="function"&&typeof y("foo")=="symbol"&&typeof Symbol("bar")=="symbol"&&A()}},function(U,w,D){U.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var y={},A=Symbol("test"),I=Object(A);if(typeof A=="string"||Object.prototype.toString.call(A)!=="[object Symbol]"||Object.prototype.toString.call(I)!=="[object Symbol]")return!1;for(A in y[A]=42,y)return!1;if(typeof Object.keys=="function"&&Object.keys(y).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(y).length!==0)return!1;var E=Object.getOwnPropertySymbols(y);if(E.length!==1||E[0]!==A||!Object.prototype.propertyIsEnumerable.call(y,A))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var M=Object.getOwnPropertyDescriptor(y,A);if(M.value!==42||M.enumerable!==!0)return!1}return!0}},function(U,w,D){var y=Array.prototype.slice,A=Object.prototype.toString;U.exports=function(I){var E=this;if(typeof E!="function"||A.call(E)!=="[object Function]")throw new TypeError("Function.prototype.bind called on incompatible "+E);for(var M,H=y.call(arguments,1),te=function(){if(this instanceof M){var R=E.apply(this,H.concat(y.call(arguments)));return Object(R)===R?R:this}return E.apply(I,H.concat(y.call(arguments)))},V=Math.max(0,E.length-H.length),X=[],k=0;k
-1?A(H):H}},function(U,w,D){var y=D(9),A=D(8),I=A("%Function.prototype.apply%"),E=A("%Function.prototype.call%"),M=A("%Reflect.apply%",!0)||y.call(E,I),H=A("%Object.getOwnPropertyDescriptor%",!0),te=A("%Object.defineProperty%",!0),V=A("%Math.max%");if(te)try{te({},"a",{value:1})}catch{te=null}U.exports=function(k){var N=M(y,E,arguments);return H&&te&&H(N,"length").configurable&&te(N,"length",{value:1+V(0,k.length-(arguments.length-1))}),N};var X=function(){return M(y,I,arguments)};te?te(U.exports,"apply",{value:X}):U.exports.apply=X},function(U,w,D){function y(ve,we){if(ve===1/0||ve===-1/0||ve!=ve||ve&&ve>-1e3&&ve<1e3||xe.call(/e/,we))return we;var et=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof ve=="number"){var S=ve<0?-qn(-ve):qn(ve);if(s!==ve){var C=String(S),Q=Xt.call(we,C.length+1);return it.call(C,et,"$&_")+"."+it.call(it.call(Q,/([0-9]{3})/g,"$&_"),/_$/,"")}}return it.call(we,et,"$&_")}function A(ve,we,et){var S=(et.quoteStyle||we)==="double"?'"':"'";return S+ve+S}function I(ve){return it.call(String(ve),/"/g,""")}function E(ve){return!(Z(ve)!=="[object Array]"||Tt&&typeof ve=="object"&&Tt in ve)}function M(ve){return!(Z(ve)!=="[object Date]"||Tt&&typeof ve=="object"&&Tt in ve)}function H(ve){return!(Z(ve)!=="[object RegExp]"||Tt&&typeof ve=="object"&&Tt in ve)}function te(ve){return!(Z(ve)!=="[object Error]"||Tt&&typeof ve=="object"&&Tt in ve)}function V(ve){return!(Z(ve)!=="[object String]"||Tt&&typeof ve=="object"&&Tt in ve)}function X(ve){return!(Z(ve)!=="[object Number]"||Tt&&typeof ve=="object"&&Tt in ve)}function k(ve){return!(Z(ve)!=="[object Boolean]"||Tt&&typeof ve=="object"&&Tt in ve)}function N(ve){if(bn)return ve&&typeof ve=="object"&&ve instanceof Symbol;if(typeof ve=="symbol")return!0;if(!ve||typeof ve!="object"||!ut)return!1;try{return ut.call(ve),!0}catch{}return!1}function R(ve){if(!ve||typeof ve!="object"||!Hn)return!1;try{return Hn.call(ve),!0}catch{}return!1}function F(ve,we){return cn.call(ve,we)}function Z(ve){return wn.call(ve)}function L(ve){if(ve.name)return ve.name;var we=Lt.call(kn.call(ve),/^function\s*([\w$]+)/);return we?we[1]:null}function K(ve,we){if(ve.indexOf)return ve.indexOf(we);for(var et=0,S=ve.length;et
we.maxStringLength){var et=ve.length-we.maxStringLength,S="... "+et+" more character"+(et>1?"s":"");return ae(Xt.call(ve,0,we.maxStringLength),we)+S}return A(it.call(it.call(ve,/(['\\])/g,"\\1ドル"),/[\x00-\x1f]/g,ge),"single",we)}function ge(ve){var we=ve.charCodeAt(0),et={8:"b",9:"t",10:"n",12:"f",13:"r"}[we];return et?"\\"+et:"\\x"+(we<16?"0":"")+pt.call(we.tostring(16))}function ue(ve){return"Object("+ve+")"}function le(ve){return ve+" { ? }"}function pe(ve,we,et,S){return ve+" ("+we+") {"+(S?xe(et,S):jt.call(et,", "))+"}"}function se(ve){for(var we=0;we
=0)return!1;return!0}function oe(ve,we){var et;if(ve.indent===" ")et=" ";else{if(!(typeof ve.indent=="number"&&ve.indent>0))return null;et=jt.call(Array(ve.indent+1)," ")}return{base:et,prev:jt.call(Array(we+1),et)}}function xe(ve,we){if(ve.length===0)return"";var et=` `+we.prev+we.base;return et+jt.call(ve,","+et)+` `+we.prev}function Y(ve,we){var et=E(ve),S=[];if(et){S.length=ve.length;for(var C=0;C
0))throw new TypeError('option "indent" must be "\\t", an integer> 0, or `null`');if(F(me,"numericSeparator")&&typeof me.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Ke=me.numericSeparator;if(we===void 0)return"undefined";if(we===null)return"null";if(typeof we=="boolean")return we?"true":"false";if(typeof we=="string")return ae(we,me);if(typeof we=="number"){if(we===0)return 1/0/we>0?"0":"-0";var nt=String(we);return Ke?y(we,nt):nt}if(typeof we=="bigint"){var at=String(we)+"n";return Ke?y(we,at):at}var dn=me.depth===void 0?5:me.depth;if(S===void 0&&(S=0),S>=dn&&dn>0&&typeof we=="object")return E(we)?"[Array]":"[Object]";var Mt=oe(me,S);if(C===void 0)C=[];else if(K(C,we)>=0)return"[Circular]";if(typeof we=="function"){var sn=L(we),Gn=Y(we,Q);return"[Function"+(sn?": "+sn:" (anonymous)")+"]"+(Gn.length>0?" { "+jt.call(Gn,", ")+" }":"")}if(N(we)){var hn=bn?it.call(String(we),/^(Symbol\(.*\))_[^)]*$/,"1ドル"):ut.call(we);return typeof we!="object"||bn?hn:ue(hn)}if(ce(we)){for(var pn="<"+jt.call(string(we.nodename)),on=we.attributes||[],vt=0;vt
" ,we.childnodes&&we.childnodes.length&&(pn+="..." ),pn+"<="" "+jt.call(string(we.nodename))+"="">"}if(E(we)){if(we.length===0)return"[]";var Tn=Y(we,Q);return Mt&&!se(Tn)?"["+xe(Tn,Mt)+"]":"[ "+jt.call(Tn,", ")+" ]"}if(te(we)){var Dn=Y(we,Q);return"cause"in we&&!or.call(we,"cause")?"{ ["+String(we)+"] "+jt.call(_t.call("[cause]: "+Q(we.cause),Dn),", ")+" }":Dn.length===0?"["+String(we)+"]":"{ ["+String(we)+"] "+jt.call(Dn,", ")+" }"}if(typeof we=="object"&&Be){if(Wn&&typeof we[Wn]=="function")return we[Wn]();if(Be!=="symbol"&&typeof we.inspect=="function")return we.inspect()}if(p(we)){var Ln=[];return ee.call(we,function(ur,Or){Ln.push(Q(Or,we,!0)+" => "+Q(ur,we))}),pe("Map",J.call(we),Ln,Mt)}if(B(we)){var fn=[];return Fe.call(we,function(ur){fn.push(Q(ur,we))}),pe("Set",Re.call(we),fn,Mt)}if(v(we))return le("WeakMap");if(z(we))return le("WeakSet");if(P(we))return le("WeakRef");if(X(we))return ue(Q(Number(we)));if(R(we))return ue(Q(Hn.call(we)));if(k(we))return ue(Et.call(we));if(V(we))return ue(Q(String(we)));if(!M(we)&&!H(we)){var Mn=Y(we,Q),Fi=wt?wt(we)===Object.prototype:we instanceof Object||we.constructor===Object,si=we instanceof Object?"":"null prototype",qi=!Fi&&Tt&&Object(we)===we&&Tt in we?Xt.call(Z(we),8,-1):si?"Object":"",oi=(Fi||typeof we.constructor!="function"?"":we.constructor.name?we.constructor.name+" ":"")+(qi||si?"["+jt.call(_t.call([],qi||[],si||[]),": ")+"] ":"");return Mn.length===0?oi+"{}":Mt?oi+"{"+xe(Mn,Mt)+"}":oi+"{ "+jt.call(Mn,", ")+" }"}return String(we)};var cn=Object.prototype.hasOwnProperty||function(ve){return ve in this}},function(U,w){},function(U,w,D){var y=D(16),A=Object.prototype.hasOwnProperty,I=Array.isArray,E={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:y.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},M=function(N){return N.replace(/&#(\d+);/g,function(R,F){return String.fromCharCode(parseInt(F,10))})},H=function(N,R){return N&&typeof N=="string"&&R.comma&&N.indexOf(",")>-1?N.split(","):N},te=function(N,R){var F,Z={},L=R.ignoreQueryPrefix?N.replace(/^\?/,""):N,K=R.parameterLimit===1/0?void 0:R.parameterLimit,p=L.split(R.delimiter,K),v=-1,P=R.charset;if(R.charsetSentinel)for(F=0;F
-1&&(z=I(z)?[z]:z),A.call(Z,B)?Z[B]=y.combine(Z[B],z):Z[B]=z}return Z},V=function(N,R,F,Z){for(var L=Z?R:H(R,F),K=N.length-1;K>=0;--K){var p,v=N[K];if(v==="[]"&&F.parseArrays)p=[].concat(L);else{p=F.plainObjects?Object.create(null):{};var P=v.charAt(0)==="["&&v.charAt(v.length-1)==="]"?v.slice(1,-1):v,B=parseInt(P,10);F.parseArrays||P!==""?!isNaN(B)&&v!==P&&String(B)===P&&B>=0&&F.parseArrays&&B<=f.arraylimit?(p=[])[b]=l:p!=="__proto__"&&(p[p]=l):p={0:l}}l=p}return L},X=function(N,R,F,Z){if(N){var L=F.allowDots?N.replace(/\.([^.[]+)/g,"[1ドル]"):N,K=/(\[[^[\]]*])/,p=/(\[[^[\]]*])/g,v=F.depth>0&&K.exec(L),P=v?L.slice(0,v.index):L,B=[];if(P){if(!F.plainObjects&&A.call(Object.prototype,P)&&!F.allowPrototypes)return;B.push(P)}for(var z=0;F.depth>0&&(v=p.exec(L))!==null&&z
1){if(typeof(k=M({path:"/"},te.defaults,k)).expires=="number"){var R=new Date;R.setMilliseconds(R.getMilliseconds()+864e5*k.expires),k.expires=R}try{N=JSON.stringify(X),/^[\{\[]/.test(N)&&(X=N)}catch{}return X=H.write?H.write(X,V):encodeURIComponent(String(X)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),V=(V=(V=encodeURIComponent(String(V))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape),document.cookie=[V,"=",X,k.expires?"; expires="+k.expires.toUTCString():"",k.path?"; path="+k.path:"",k.domain?"; domain="+k.domain:"",k.secure?"; secure":""].join("")}V||(N={});for(var F=document.cookie?document.cookie.split("; "):[],Z=/(%[0-9A-Z]{2})+/g,L=0;L
0&&arguments[0]!==void 0&&arguments[0];this.destroyed=!0,R?this._clearBeaconQueue():this.flushEvents(),A.default.clearTimeout(this._sendTimeout)},N.prototype._clearBeaconQueue=function(){var R=A.default.navigator,F=this._eventQueue.length>this._options.maxBeaconSize?this._eventQueue.length-this._options.maxBeaconSize:0,Z=this._eventQueue.slice(F);F>0&&(0,M.default)(Z[Z.length-1],(0,H.default)({mux_view_message:"event queue truncated"}));var L=this._createPayload(Z);if(R.sendBeacon)R.sendBeacon(this._beaconUrl,L);else if(A.default.XMLHttpRequest){var K=new A.default.XMLHttpRequest;K.open("POST",this._beaconUrl),K.setRequestHeader("Content-Type","application/json"),K.send(L)}else E.default.send(this._beaconUrl,Z[Z.length-1])},N.prototype._sendBeaconQueue=function(){var R=this;if(A.default.XMLHttpRequest&&!this._postInFlight){var F=new A.default.XMLHttpRequest,Z=this._eventQueue.slice(0,this._options.maxBeaconSize);this._eventQueue=this._eventQueue.slice(this._options.maxBeaconSize),this._postInFlight=!0,F.onreadystatechange=function(){F.readyState===4&&(F.status!==200?(R._eventQueue=Z.concat(R._eventQueue),R._failureCount+=1,I.default.info("Error sending beacon: "+F.status),I.default.info(F.responseText)):R._failureCount=0,R._roundTripTime=te.default.now()-K,R._postInFlight=!1)},F.open("POST",this._beaconUrl),F.setRequestHeader("Content-Type","application/json");var L=this._createPayload(Z),K=te.default.now();F.send(L)}},N.prototype._getNextBeaconTime=function(){if(!this._failureCount)return this._options.baseTimeBetweenBeacons;var R=Math.pow(2,this._failureCount-1);return(1+(R*=Math.random()))*this._options.baseTimeBetweenBeacons},N.prototype._startBeaconSending=function(){var R=this;A.default.clearTimeout(this._sendTimeout),this.destroyed||(this._sendTimeout=A.default.setTimeout(function(){R._eventQueue.length&&R._sendBeaconQueue(),R._startBeaconSending()},this._getNextBeaconTime()))},N.prototype._createPayload=function(R){var F=this,Z={transmission_timestamp:Math.round(te.default.now())};this._roundTripTime&&(Z.rtt_ms=Math.round(this._roundTripTime));var L=void 0,K=void 0,p=void 0,v=function(){L=JSON.stringify({metadata:Z,events:K||R}),p=L.length/1024},P=function(){return p<=f._options.maxpayloadkbsize};return v(),P()||(I.default.info("Payload size is too big ("+p+" kb). Removing unnecessary events."),K=R.filter(function(B){return k.indexOf(B.e)===-1}),v()),P()||(I.default.info("Payload size still too big ("+p+" kb). Cropping fields.."),K.forEach(function(B){for(var z in B){var ce=B[z];typeof ce=="string"&&ce.length>51200&&(B[z]=ce.substring(0,51200))}}),v()),L},w.default=N},function(U,w,D){function y(M){return M&&M.__esModule?M:{default:M}}Object.defineProperty(w,"__esModule",{value:!0});var A=y(D(15)),I=y(D(0)),E={send:function(M,H){function te(){V.src=k+(X?"&rc="+X:"")}var V=new Image,X=0,k=M+"?"+A.default.stringify(H);return V.addEventListener("error",function(){X>3||I.default.setTimeout(function(){X++,te()},5e3*X)}),te(),V}};w.default=E},function(U,w,D){function y(){function A(R,F){var Z=F.request_start,L=F.request_response_start,K=F.request_response_end,p=F.request_bytes_loaded;V++;var v=void 0,P=void 0;if(L?(v=L-Z,P=K-L):P=K-Z,P>0&&p>0){var B=p/P*8e3;X++,H+=p,te+=P,this.data.view_min_request_throughput=Math.min(this.data.view_min_request_throughput||1/0,B),this.data.view_average_request_throughput=H/te*8e3,this.data.view_request_count=V,v>0&&(M+=v,this.data.view_max_request_latency=Math.max(this.data.view_max_request_latency||0,v),this.data.view_average_request_latency=M/X)}}function I(R,F){V++,k++,this.data.view_request_count=V,this.data.view_request_failed_count=k}function E(R,F){V++,N++,this.data.view_request_count=V,this.data.view_request_canceled_count=N}var M=0,H=0,te=0,V=0,X=0,k=0,N=0;this.on("requestcompleted",A),this.on("requestfailed",I),this.on("requestcanceled",E)}Object.defineProperty(w,"__esModule",{value:!0}),w.default=y},function(U,w,D){function y(k,N,R){var F=(0,te.findMediaElement)(N),Z=I(F,3),L=Z[0],K=Z[1],p=Z[2],v=k.log,P=k.utils.getComputedStyle,B=k.utils.secondsToMs,z={automaticErrorTracking:!0};if(!L)return v.error("No element was found with the `"+K+"` query selector.");if(p!=="video"&&p!=="audio")return v.error("The element of `"+K+"` was not a media element.");(R=(0,H.default)(z,R)).data=(0,H.default)({player_software:"HTML5 Video Element",player_mux_plugin_name:"VideoElementMonitor",player_mux_plugin_version:"4.9.1"},R.data),R.getPlayheadTime=function(){return B(L.currentTime)},R.getStateData=function(){var ae=this.hlsjs&&this.hlsjs.url,ge=this.dashjs&&A(this.dashjs.getSource==="function")&&this.dashjs.getSource(),ue={player_is_paused:L.paused,player_playhead_time:B(L.currentTime),player_width:parseInt(P(L,"width")),player_height:parseInt(P(L,"height")),player_autoplay_on:L.autoplay,player_preload_on:L.preload,video_poster_url:L.poster,video_source_url:ae||ge||L.currentSrc,video_source_duration:B(L.duration),video_source_height:L.videoHeight,video_source_width:L.videoWidth},le=R.getPlayheadTime();if(L.getStartDate&&le>0){var pe=L.getStartDate();if(pe&&typeof pe.getTime=="function"&&pe.getTime()){var se=pe.getTime();if(ue.player_program_time=se+le,L.seekable.length>0){var oe=se+L.seekable.end(L.seekable.length-1);ue.player_live_edge_program_time=oe}}}return ue},L.mux=L.mux||{},L.mux.deleted=!1,L.mux.emit=function(ae,ge){k.emit(K,ae,ge)};var ce=function(){v.error("The monitor for this video element has already been destroyed.")};L.mux.destroy=function(){Object.keys(L.mux.listeners).forEach(function(ae){L.removeEventListener(ae,L.mux.listeners[ae],!1)}),delete L.mux.listeners,L.mux.destroy=ce,L.mux.swapElement=ce,L.mux.emit=ce,L.mux.addHLSJS=ce,L.mux.addDashJS=ce,L.mux.removeHLSJS=ce,L.mux.removeDashJS=ce,L.mux.deleted=!0,k.emit(K,"destroy")},L.mux.swapElement=function(ae){var ge=(0,te.findMediaElement)(ae),ue=I(ge,3),le=ue[0],pe=ue[1],se=ue[2];return le?se!=="video"&&se!=="audio"?k.log.error("The element of `"+pe+"` was not a media element."):(le.muxId=L.muxId,delete L.muxId,le.mux=le.mux||{},le.mux.listeners=(0,H.default)({},L.mux.listeners),delete L.mux.listeners,Object.keys(le.mux.listeners).forEach(function(oe){L.removeEventListener(oe,le.mux.listeners[oe],!1),le.addEventListener(oe,le.mux.listeners[oe],!1)}),le.mux.swapElement=L.mux.swapElement,le.mux.destroy=L.mux.destroy,delete L.mux,void(L=le)):k.log.error("No element was found with the `"+pe+"` query selector.")},L.mux.addHLSJS=function(ae){k.addHLSJS(K,ae)},L.mux.addDashJS=function(ae){k.addDashJS(K,ae)},L.mux.removeHLSJS=function(){k.removeHLSJS(K)},L.mux.removeDashJS=function(){k.removeDashJS(K)},k.init(K,R),k.emit(K,"playerready"),L.paused||(k.emit(K,"play"),L.readyState>2&&k.emit(K,"playing")),L.mux.listeners={},V.forEach(function(ae){(ae!=="error"||R.automaticErrorTracking)&&(L.mux.listeners[ae]=function(){var ge={};if(ae==="error"){if(!L.error||L.error.code===1)return;ge.player_error_code=L.error.code,ge.player_error_message=X[L.error.code]||L.error.message}k.emit(K,ae,ge)},L.addEventListener(ae,L.mux.listeners[ae],!1))})}Object.defineProperty(w,"__esModule",{value:!0});var A=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(k){return typeof k}:function(k){return k&&typeof Symbol=="function"&&k.constructor===Symbol&&k!==Symbol.prototype?"symbol":typeof k},I=function(){function k(N,R){var F=[],Z=!0,L=!1,K=void 0;try{for(var p,v=N[Symbol.iterator]();!(Z=(p=v.next()).done)&&(F.push(p.value),!R||F.length!==R);Z=!0);}catch(P){L=!0,K=P}finally{try{!Z&&v.return&&v.return()}finally{if(L)throw K}}return F}return function(N,R){if(Array.isArray(N))return N;if(Symbol.iterator in Object(N))return k(N,R);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();w.default=y;var E,M=D(1),H=(E=M)&&E.__esModule?E:{default:E},te=D(11),V=["loadstart","pause","play","playing","seeking","seeked","timeupdate","ratechange","stalled","waiting","error","ended"],X={1:"MEDIA_ERR_ABORTED",2:"MEDIA_ERR_NETWORK",3:"MEDIA_ERR_DECODE",4:"MEDIA_ERR_SRC_NOT_SUPPORTED"}},function(U,w,D){function y(R){return R&&R.__esModule?R:{default:R}}Object.defineProperty(w,"__esModule",{value:!0});var A=y(D(60)),I=y(D(3)),E=y(D(61)),M=y(D(62)),H=y(D(1)),te=y(D(7)),V=D(5),X=y(D(2)),k=y(D(63)),N={};N.safeCall=A.default,N.safeIncrement=I.default,N.getComputedStyle=E.default,N.secondsToMs=M.default,N.assign=H.default,N.headersStringToObject=te.default,N.extractHostnameAndDomain=V.extractHostnameAndDomain,N.extractHostname=V.extractHostname,N.now=X.default.now,N.manifestParser=k.default,w.default=N},function(U,w,D){function y(M,H,te,V){var X=V;if(M&&typeof M[H]=="function")try{X=M[H].apply(M,te)}catch(k){E.default.info("safeCall error",k)}return X}Object.defineProperty(w,"__esModule",{value:!0}),w.default=y;var A,I=D(4),E=(A=I)&&A.__esModule?A:{default:A}},function(U,w,D){function y(H,te){if(H&&te&&E.default&&typeof E.default.getComputedStyle=="function"){var V=void 0;return M&&M.has(H)&&(V=M.get(H)),V||(V=E.default.getComputedStyle(H,null),M&&M.set(H,V)),V.getPropertyValue(te)}}Object.defineProperty(w,"__esModule",{value:!0}),w.default=y;var A,I=D(0),E=(A=I)&&A.__esModule?A:{default:A},M=void 0;E.default&&E.default.WeakMap&&(M=new WeakMap)},function(U,w,D){function y(A){return Math.floor(1e3*A)}Object.defineProperty(w,"__esModule",{value:!0}),w.default=y},function(U,w,D){function y(Z){return Z&&Z.__esModule?Z:{default:Z}}Object.defineProperty(w,"__esModule",{value:!0});var A=y(D(1)),I=y(D(14)),E={TARGET_DURATION:"#EXT-X-TARGETDURATION",PART_INF:"#EXT-X-PART-INF",SERVER_CONTROL:"#EXT-X-SERVER-CONTROL",INF:"#EXTINF",PROGRAM_DATE_TIME:"#EXT-X-PROGRAM-DATE-TIME",VERSION:"#EXT-X-VERSION",SESSION_DATA:"#EXT-X-SESSION-DATA"},M=function(Z){return this.buffer="",this.manifest={segments:[],serverControl:{},sessionData:{}},this.currentUri={},this.process(Z),this.manifest};M.prototype.process=function(Z){var L=void 0;for(this.buffer+=Z,L=this.buffer.indexOf(` `);L>-1;L=this.buffer.indexOf(` `))this.processLine(this.buffer.substring(0,L)),this.buffer=this.buffer.substring(L+1)},M.prototype.processLine=function(Z){var L=Z.indexOf(":"),K=R(Z,L),p=K[0],v=K.length===2?V(K[1]):void 0;if(p[0]!=="#")this.currentUri.uri=p,this.manifest.segments.push(this.currentUri),!this.manifest.targetDuration||"duration"in this.currentUri||(this.currentUri.duration=this.manifest.targetDuration),this.currentUri={};else switch(p){case E.TARGET_DURATION:if(!isFinite(v)||v<0)return;this.manifest.targetduration=v,this.setholdback();break;case E.PART_INF:H(this.manifest,K),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),this.setHoldBack();break;case E.SERVER_CONTROL:H(this.manifest,K),this.setHoldBack();break;case E.INF:v===0?this.currentUri.duration=.01:v>0&&(this.currentUri.duration=v);break;case E.PROGRAM_DATE_TIME:var P=v,B=new Date(P);this.manifest.dateTimeString||(this.manifest.dateTimeString=P,this.manifest.dateTimeObject=B),this.currentUri.dateTimeString=P,this.currentUri.dateTimeObject=B;break;case E.VERSION:H(this.manifest,K);break;case E.SESSION_DATA:var z=F(K[1]),ce=(0,I.default)(z);(0,A.default)(this.manifest.sessionData,ce)}},M.prototype.setHoldBack=function(){var Z=this.manifest,L=Z.serverControl,K=Z.targetDuration,p=Z.partTargetDuration;if(L){var v="holdBack",P="partHoldBack",B=K&&3*K,z=p&&2*p;K&&!L.hasOwnProperty(v)&&(L[v]=B),B&&L[v]
1&&(L[te(K[0])]=V(K[1])),L},k=function(Z){for(var L=Z.split(","),K={},p=0;L.length>p;p++){var v=L[p],P=X(v);K=(0,A.default)(P,K)}return K},N=function(Z){return Z.indexOf("=")>-1},R=function(Z,L){return L===-1?[Z]:[Z.substring(0,L),Z.substring(L+1)]},F=function(Z){var L={};if(Z){var K=Z.search(",");return[Z.slice(0,K),Z.slice(K+1)].forEach(function(p,v){for(var P=p.replace(/['"]+/g,"").split("="),B=0;B
2&&arguments[2]!==void 0?arguments[2]:[],M=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[],H=arguments.length>4&&arguments[4]!==void 0?arguments[4]:function(){return{}},te=!1;A.on("adstart",function(){te=!0}),A.on("adend",function(){te=!1}),A.on("adserror",function(){te=!1});var V=function(){var X=y(I.currentTime()),k=function R(){var F=D.default.utils.now(),Z=y(I.currentTime());if(te){if(Z>X){var L=H();L.viewer_time=F-Math.max(0,Z-X),I.off("timeupdate",R),A.mux.emit("adplaying",L)}}else I.off("timeupdate",R)};I.on("timeupdate",k);var N=function R(){I.off("timeupdate",k),E.forEach(function(F){I.off(F,R)})};E.forEach(function(R){I.on(R,N)})};M.forEach(function(X){I.on(X,V)})}Object.defineProperty(ie,"__esModule",{value:!0}),ie.default=ye;var U,w=Ee(0),D=(U=w)&&U.__esModule?U:{default:U},y=D.default.utils.secondsToMs},function(ke,ie,Ee){function ye(Z){return Z&&Z.__esModule?Z:{default:Z}}function U(Z){var L=Z;return function(K){if(L.IS_IE8)return!1;var p=this,v=p.id();(K=X({automaticErrorTracking:!0},K)).data=X({player_software_name:"Video.js",player_software_version:L.VERSION||"< 4.11",player_mux_plugin_name:"videojs-mux",player_mux_plugin_version:"4.6.6"},K.data),K.getPlayheadTime=function(){return R(p.currentTime())},K.getStateData=function(){var ae=k(p,"videovideoWidth");if(ge===void 0||ae===void 0){var ue=p.el().firstChild;ue&&ue.nodeName.toUpperCase()==="VIDEO"&&(ae=ue.videoHeight,ge=ue.videoWidth)}return{player_is_paused:k(p,"paused"),player_is_fullscreen:k(p,"isFullscreen"),player_autoplay_on:!!k(p,"autoplay"),player_preload_on:k(p,"preload"),player_width:N(p.el(),"width"),player_height:N(p.el(),"height"),player_language_code:k(p,"language"),video_poster_url:k(p,"poster"),video_source_url:k(p,"currentSrc"),video_source_mime_type:k(p,"currentType")&&k(p,"currentType").toLowerCase(),video_source_duration:R(k(p,"duration")||0),video_source_is_live:p.duration()===1/0,video_source_height:ae,video_source_width:ge}},p.mux=function(){V.error("[videojs-mux] The plugin was initialized more than once.")},p.mux.emit=function(ae,ge){y.default.emit(v,ae,ge)},p.mux.addHLSJS=function(ae){y.default.addHLSJS(v,ae)},p.mux.log=V,p.mux.utils=y.default.utils,y.default.init(v,K);var P=!1,B=function(){P||p.mux.emit("playerready"),P=!0};p.ready(function(){p.addClass("vjs-mux"),A.default.setTimeout(B,0)});var z=!1;p.one("play",B),F.forEach(function(ae){(ae!=="error"||K.automaticErrorTracking)&&p.on(ae,function(){if(!z){var ge={};if(ae==="error"){var ue=k(p,"error");if(ue&&ue.code===1)return;ge.player_error_code=ue&&ue.code,ge.player_error_message=ue&&ue.message}p.mux.emit(ae,ge)}})});var ce=!1;p.on("play",function(){ce=!0}),p.on("pause",function(){ce=!1}),p.on("adstart",function(){z=!0,ce&&p.mux.emit("pause"),p.mux.emit("adbreakstart")}),p.on("adend",function(){p.mux.emit("adbreakend"),z=!1,k(p,"paused")||(p.mux.emit("play"),ce=!0,p.onceux&&p.mux.emit("playing"))}),p.ima&&(0,I.default)(p),p.onceux&&(0,H.default)(p),p.ima3&&typeof p.ima3.ready=="function"&&(0,E.default)(p),p.FreeWheelPlugin&&p.FreeWheelPlugin.VERSION&&(0,M.default)(p),p.on("dispose",function(){p.mux.emit("destroy")})}}function w(Z){(Z.registerPlugin||Z.plugin||function(){y.default.log.error("No valid method to register videojs plugin available.")})("mux",U(Z)),(0,te.default)(Z)}Object.defineProperty(ie,"__esModule",{value:!0}),ie.register=w;var D=ye(Ee(3)),y=ye(Ee(0)),A=ye(Ee(4)),I=ye(Ee(6)),E=ye(Ee(7)),M=ye(Ee(8)),H=ye(Ee(9)),te=ye(Ee(10)),V=y.default.log,X=y.default.utils.assign,k=y.default.utils.safeCall,N=y.default.utils.getComputedStyle,R=y.default.utils.secondsToMs,F=["loadstart","pause","play","playing","seeking","seeked","timeupdate","ratechange","stalled","waiting","error","ended"];w(D.default)},function(ke,ie){ke.exports=O},function(ke,ie,Ee){(function(ye){var U;U=typeof window<"u"?window:ye!==void 0?ye:typeof self<"u"?self:{},ke.exports=u}).call(ie,ee(5))},function(ke,ie){var Ee;Ee=function(){return this}();try{Ee=Ee||Function("return this")()||(0,eval)("this")}catch{typeof window=="object"&&(Ee=window)}ke.exports=Ee},function(ke,ie,Ee){function ye(U){var w=function(V){var X=typeof(V=V||{}).getAdData=="function"?V.getAdData():{},k=typeof V.getAd=="function"?V.getAd():{},N=typeof k.getMediaUrl=="function"?k.getMediaUrl():X.mediaUrl,R=U.ima.settings||{},F={};return N&&(F.ad_asset_url=N),R.adTagUrl&&(F.ad_tag_url=R.adTagUrl),F},D=void 0,y=void 0,A=void 0,I=void 0,E=void 0,M=void 0;try{var H=window.google.ima.AdEvent.Type;D=H.LOADED,y=H.STARTED,A=H.COMPLETE,I=H.PAUSED,E=H.RESUMED,M=H.SKIPPED}catch{D="loaded",y="start",A="complete",I="pause",E="resume",M="skip"}var te=0;U.mux.triggerAdRequest=function(){te++,U.mux.emit("adrequest",w())},U.on("adsready",function(){var V=U.ima.addEventListener||function(){};V(D,function(X){var k=w(X);te>0&&(te--,U.mux.emit("adresponse",k)),U.mux.emit("adplay",k)}),V(y,function(X){var k=w(X);U.mux.emit("adplaying",k)}),V(E,function(X){var k=w(X);U.mux.emit("adplay",k),U.mux.emit("adplaying",k)}),V(I,function(X){var k=w(X);U.mux.emit("adpause",k)}),V(A,function(X){var k=w(X);U.mux.emit("adended",k)}),V(M,function(X){var k=w(X);U.mux.emit("adended",k)}),U.on("adserror",function(){te>0&&(te--,U.mux.emit("adresponse")),U.mux.emit("aderror")})})}Object.defineProperty(ie,"__esModule",{value:!0}),ie.default=ye},function(ke,ie,Ee){function ye(A){if(typeof A!="string")return!1;var I=A.split(".").map(function(H){return parseInt(H)}),E=I[0],M=I[1];return E>2||E===2&&M>=3}function U(A){var I=function(){var H=A.ima3.currentAd,te=A.ima3.settings,V={};return H&&(V.ad_asset_url=H.mediaUrl),te&&(V.ad_tag_url=te.serverUrl),V};if(ye(A.ima3.version)){var E=0,M=function(){E>0&&(E--,A.mux.emit("adresponse",I()))};A.on("ads-request",function(){E++,A.mux.emit("adrequest",I())}),A.on("ads-load",function(){M(),A.mux.emit("adplay",I())}),A.on("adserror",function(){M(),A.mux.emit("aderror")}),A.on("ads-play",function(){A.mux.emit("adplay",I())}),A.on("ads-pause",function(){A.mux.emit("adpause",I())}),A.on("ads-ad-ended",function(){A.mux.emit("adended",I())})}A.ima3.ready(function(){if(A.ima3.adPlayer){ye(A.ima3.version)||(A.ima3.adPlayer.on("play",function(){A.mux.emit("adplay")}),A.ima3.adPlayer.on("pause",function(){A.mux.emit("adpause")}),A.ima3.adPlayer.on("ended",function(){A.mux.emit("adended")}));var H=["pause","ended","adserror"],te=["play"];(0,y.default)(A,A.ima3.adPlayer,H,te,I)}else A.mux.log("Legacy IMA3 plugin found, ad events may not track correctly."),A.on("ads-ad-started",function(){A.mux.emit("adplaying",I())}),A.on("ads-play",function(){A.mux.emit("adplaying",I())})})}Object.defineProperty(ie,"__esModule",{value:!0}),ie.brightcoveImaAdsEventsSupported=ye,ie.default=U;var w,D=Ee(1),y=(w=D)&&w.__esModule?w:{default:w}},function(ke,ie,Ee){function ye(U){var w=function(D){var y=U.FreeWheelPlugin,A={};switch(D){case"adplay":case"adplaying":case"adpause":A.ad_asset_url=U.currentSrc()}return y&&(A.ad_tag_url=y.tech.toLowerCase()==="html5"?y.settings.Html5.serverUrl:y.settings.Flash.serverUrl),A};U.on("ads-request",function(){U.mux.emit("adrequest",w("adrequest"))}),U.on("ads-load",function(){U.mux.emit("adresponse",w("adresponse"))}),U.on("adserror",function(){U.mux.emit("aderror")}),U.on("ads-ad-started",function(){U.mux.emit("adplay",w("adplay")),U.mux.emit("adplaying",w("adplaying"))}),U.on("ads-play",function(){U.mux.emit("adplay",w("adplay")),U.mux.emit("adplaying",w("adplaying"))}),U.on("ads-pause",function(){U.mux.emit("adpause",w("adpause"))}),U.on("ads-ad-ended",function(){U.mux.emit("adended",w("adended"))}),U.on("adend",function(){U.mux.emit("play")})}Object.defineProperty(ie,"__esModule",{value:!0}),ie.default=ye},function(ke,ie,Ee){function ye(y){var A=["onceux-linearad-pause","onceux-linearad-skipped","onceux-linearad-complete","adserror"],I=["adstart","onceux-linearad-resume"];(0,D.default)(y,y,A,I),y.on("adstart",function(){y.mux.emit("adplay")}),y.on("onceux-linearad-start",function(E){E.linearAd&&E.linearAd.index>0&&(y.mux.emit("adplay"),y.mux.emit("adplaying"))}),y.on("onceux-linearad-resume",function(){y.mux.emit("adplay")}),y.on("onceux-linearad-pause",function(){y.mux.emit("adpause")}),y.on("onceux-linearad-complete",function(){y.mux.emit("adended")}),y.on("onceux-linearad-skipped",function(){y.mux.emit("adended")})}Object.defineProperty(ie,"__esModule",{value:!0}),ie.default=ye;var U,w=Ee(1),D=(U=w)&&U.__esModule?U:{default:U}},function(ke,ie,Ee){function ye(E){if(!I.get(E)&&(I.set(E,"video.js "+E.VERSION+" initialized"),typeof E.getTech=="function"))for(var M=(E.getTech("Html5")||{}).sourceHandlers,H=0;H
2&&arguments[2]!==void 0?arguments[2]:{});if(R&&typeof R.xhr=="function")try{var F=E.VERSION.split("."),Z=U(F,2),L=Z[0],K=Z[1];L=parseInt(L),K=parseInt(K);var p=L>=7&&K>=4?R.player().id():R.player_.el_.parentNode.id;(0,y.default)(E(p),R.xhr),(0,A.trackRenditionChanges)(E(p))}catch{}return R}})(H)}Object.defineProperty(ie,"__esModule",{value:!0});var U=function(){function E(M,H){var te=[],V=!0,X=!1,k=void 0;try{for(var N,R=M[Symbol.iterator]();!(V=(N=R.next()).done)&&(te.push(N.value),!H||te.length!==H);V=!0);}catch(F){X=!0,k=F}finally{try{!V&&R.return&&R.return()}finally{if(X)throw k}}return te}return function(M,H){if(Array.isArray(M))return M;if(Symbol.iterator in Object(M))return E(M,H);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();ie.default=ye;var w,D=Ee(11),y=(w=D)&&w.__esModule?w:{default:w},A=Ee(13),I=new Map},function(ke,ie,Ee){function ye(y){return y&&y.__esModule?y:{default:y}}function U(y,A){var I=function(M,H,te){var V=(0,w.default)(y,M,H);return function(){try{V()}catch{}try{te()}catch{}}},E=function(M){return function(H){var te=D.default.utils.now();try{M(H)}catch{}try{H.onreadystatechange=I(H,te,H.onreadystatechange||function(){})}catch{}}};A.beforeRequest=function(M){return function(H){var te=M(H);return te.beforeSend=E(te.beforeSend||function(){}),te}}(A.beforeRequest||function(M){return M})}Object.defineProperty(ie,"__esModule",{value:!0}),ie.default=U;var w=ye(Ee(12)),D=ye(Ee(0))},function(ke,ie,Ee){function ye(A,I,E){var M=A.mux.utils.extractHostnameAndDomain,H=A.mux.utils.headersStringToObject,te=function(X){var k=X["content-type"];return k?k.match(/^audio\/mpegurl/i)?"manifest":k.match(/^audio.*/i)?"audio":k.match(/^video.*/)?"video":k.match(/^application\/x-mpegurl/i)||k.match(/^application\/vnd.apple.mpegurl/i)||k.match(/^application\/dash+xml/i)?"manifest":"unknown":"unknown"},V=0;return function(){var X=I.readyState;if(X>=2){if(V=V||y.default.utils.now(),X!==4)return;if(I.status>=200&&I.status<300){var k=y.default.utils.now(),N=I.responseType==="arraybuffer"?I.response.byteLength:I.responseText.length,R=M(I.responseURL),F=U(R,1)[0],Z=H(I.getAllResponseHeaders?I.getAllResponseHeaders():""),L=te(Z),K={request_start:E,request_response_start:V,request_response_end:k,request_bytes_loaded:N,request_hostname:F,request_response_headers:Z,request_type:L};A.mux.emit("requestcompleted",K)}else A.mux.emit("requestfailed")}}}Object.defineProperty(ie,"__esModule",{value:!0});var U=function(){function A(I,E){var M=[],H=!0,te=!1,V=void 0;try{for(var X,k=I[Symbol.iterator]();!(H=(X=k.next()).done)&&(M.push(X.value),!E||M.length!==E);H=!0);}catch(N){te=!0,V=N}finally{try{!H&&k.return&&k.return()}finally{if(te)throw V}}return M}return function(I,E){if(Array.isArray(I))return I;if(Symbol.iterator in Object(I))return A(I,E);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();ie.default=ye;var w,D=Ee(0),y=(w=D)&&w.__esModule?w:{default:w}},function(ke,ie,Ee){Object.defineProperty(ie,"__esModule",{value:!0});var ye=function(w){for(var D=w.textTracks(),y=void 0,A=0;A
{var Ie=Ae(697),O=Ve.exports={WebVTT:Ae(13),VTTCue:Ae(190),VTTRegion:Ae(146)};Ie.vttjs=O,Ie.WebVTT=O.WebVTT;var ke=O.VTTCue,ie=O.VTTRegion,Ee=Ie.VTTCue,ye=Ie.VTTRegion;O.shim=function(){Ie.VTTCue=ke,Ie.VTTRegion=ie},O.restore=function(){Ie.VTTCue=Ee,Ie.VTTRegion=ye},Ie.VTTCue||O.shim()},13:(Ve,je,Ae)=>{var Ie=Ae(675),O=Object.create||function(){function p(){}return function(v){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return p.prototype=v,new p}}();function ke(p,v){this.name="ParsingError",this.code=p.code,this.message=v||p.message}function ie(p){function v(B,z,ce,ae){return 3600*(0|B)+60*(0|z)+(0|ce)+(0|ae)/1e3}var P=p.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return P?P[3]?v(P[1],P[2],P[3].replace(":",""),P[4]):P[1]>59?v(P[1],P[2],0,P[4]):v(0,P[1],P[2],P[4]):null}function Ee(){this.values=O(null)}function ye(p,v,P,B){var z=B?p.split(B):[p];for(var ce in z)if(typeof z[ce]=="string"){var ae=z[ce].split(P);ae.length===2&&v(ae[0].trim(),ae[1].trim())}}function U(p,v,P){var B=p;function z(){var ge=ie(p);if(ge===null)throw new ke(ke.Errors.BadTimeStamp,"Malformed timestamp: "+B);return p=p.replace(/^[^\sa-zA-Z-]+/,""),ge}function ce(ge,ue){var le=new Ee;ye(ge,function(pe,se){switch(pe){case"region":for(var oe=P.length-1;oe>=0;oe--)if(P[oe].id===se){le.set(pe,P[oe].region);break}break;case"vertical":le.alt(pe,se,["rl","lr"]);break;case"line":var xe=se.split(","),Y=xe[0];le.integer(pe,Y),le.percent(pe,Y)&&le.set("snapToLines",!1),le.alt(pe,Y,["auto"]),xe.length===2&&le.alt("lineAlign",xe[1],["start","center","end"]);break;case"position":xe=se.split(","),le.percent(pe,xe[0]),xe.length===2&&le.alt("positionAlign",xe[1],["start","center","end"]);break;case"size":le.percent(pe,se);break;case"align":le.alt(pe,se,["start","center","end","left","right"])}},/:/,/\s/),ue.region=le.get("region",null),ue.vertical=le.get("vertical","");try{ue.line=le.get("line","auto")}catch{}ue.lineAlign=le.get("lineAlign","start"),ue.snapToLines=le.get("snapToLines",!0),ue.size=le.get("size",100);try{ue.align=le.get("align","center")}catch{ue.align=le.get("align","middle")}try{ue.position=le.get("position","auto")}catch{ue.position=le.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},ue.align)}ue.positionAlign=le.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},ue.align)}function ae(){p=p.replace(/^\s+/,"")}if(ae(),v.startTime=z(),ae(),p.substr(0,3)!=="-->")throw new ke(ke.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+B);p=p.substr(3),ae(),v.endTime=z(),ae(),ce(p,v)}ke.prototype=O(Error.prototype),ke.prototype.constructor=ke,ke.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},Ee.prototype={set:function(p,v){!this.get(p)&&v!==""&&(this.values[p]=v)},get:function(p,v,P){return P?this.has(p)?this.values[p]:v[P]:this.has(p)?this.values[p]:v},has:function(p){return p in this.values},alt:function(p,v,P){for(var B=0;B
=0&&v<=100))&&(this.set(p,v),!0)}};var w=Ie.createElement&&Ie.createElement("textarea"),D={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},y={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)"},A={v:"title",lang:"lang"},I={rt:"ruby"};function E(p,v){function P(){if(!v)return null;function Y(de){return v=v.substr(de.length),de}var $=v.match(/^([^<]*)(<[^>]*>?)?/);return Y($[1]?$[1]:$[2])}function B(Y){return w.innerHTML=Y,Y=w.textContent,w.textContent="",Y}function z(Y,$){return!I[$.localName]||I[$.localName]===Y.localName}function ce(Y,$){var de=D[Y];if(!de)return null;var J=p.document.createElement(de),ee=A[Y];return ee&&$&&(J[ee]=$.trim()),J}for(var ae,ge=p.document.createElement("div"),ue=ge,le=[];(ae=P())!==null;)if(ae[0]!=="<")ue.appendchild(p.document.createtextnode(b(ae)));else{if(ae[1]==="/"){le.length&&le[le.length-1]===ae.substr(2).replace(">","")&&(le.pop(),ue=ue.parentNode);continue}var pe,se=ie(ae.substr(1,ae.length-2));if(se){pe=p.document.createProcessingInstruction("timestamp",se),ue.appendChild(pe);continue}var oe=ae.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!oe||!(pe=ce(oe[1],oe[3]))||!z(ue,pe))continue;if(oe[2]){var xe=oe[2].split(".");xe.forEach(function(Y){var $=/^bg_/.test(Y),de=$?Y.slice(3):Y;if(y.hasOwnProperty(de)){var J=$?"background-color":"color",ee=y[de];pe.style[J]=ee}}),pe.className=xe.join(" ")}le.push(oe[1]),ue.appendChild(pe),ue=pe}return ge}var M=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function H(p){for(var v=0;v
=P[0]&&p<=p[1])return!0}return!1}function te(p){var v=[],P="";if(!p||!p.childNodes)return"ltr";function B(ae,ge){for(var ue=ge.childNodes.length-1;ue>=0;ue--)ae.push(ge.childNodes[ue])}function z(ae){if(!ae||!ae.length)return null;var ge=ae.pop(),ue=ge.textContent||ge.innerText;if(ue){var le=ue.match(/^.*(\n|\r)/);return le?(ae.length=0,le[0]):ue}return ge.tagName==="ruby"?z(ae):ge.childNodes?(B(ae,ge),z(ae)):void 0}for(B(v,p);P=z(v);)for(var ce=0;ce
=0&&p.line<=100))return p.line;if(!p.track||!p.track.textTrackList||!p.track.textTrackList.mediaElement)return-1;for(var v=p.track,P=v.textTrackList,B=0,z=0;z
Fe&&(ee=new N(de),Pe=Fe),de=new N(fe)}return ee||fe}var ce=new N(v),ae=v.cue,ge=V(ae),ue=[];if(ae.snapToLines){var le;switch(ae.vertical){case"":ue=["+y","-y"],le="height";break;case"rl":ue=["+x","-x"],le="width";break;case"lr":ue=["-x","+x"],le="width"}var pe=ce.lineHeight,se=pe*Math.round(ge),oe=P[le]+pe,xe=ue[0];Math.abs(se)>oe&&(se=se<0?-1:1,se*=math.ceil(oe/pe)*pe),ge<0&&(se+=ae.vertical===""?p.height:p.width,ue=ue.reverse()),ce.move(xe,se)}else{var Y=ce.lineHeight/P.height*100;switch(ae.lineAlign){case"center":ge-=Y/2;break;case"end":ge-=Y}switch(ae.vertical){case"":v.applyStyles({top:v.formatStyle(ge,"%")});break;case"rl":v.applyStyles({left:v.formatStyle(ge,"%")});break;case"lr":v.applyStyles({right:v.formatStyle(ge,"%")})}ue=["+y","-x","+x","-y"],ce=new N(v)}var $=z(ce,ue);v.move($.toCSSCompatValues(P))}function F(){}X.prototype.applyStyles=function(p,v){for(var P in v=v||this.div,p)p.hasOwnProperty(P)&&(v.style[P]=p[P])},X.prototype.formatStyle=function(p,v){return p===0?0:p+v},k.prototype=O(X.prototype),k.prototype.constructor=k,N.prototype.move=function(p,v){switch(v=v!==void 0?v:this.lineHeight,p){case"+x":this.left+=v,this.right+=v;break;case"-x":this.left-=v,this.right-=v;break;case"+y":this.top+=v,this.bottom+=v;break;case"-y":this.top-=v,this.bottom-=v}},N.prototype.overlaps=function(p){return this.left
p.left&&this.top
p.top},N.prototype.overlapsAny=function(p){for(var v=0;v
=p.top&&this.bottom<=p.bottom&&this.left>=p.left&&this.right<=p.right},n.prototype.overlapsoppositeaxis=function(p,v){switch(v){case"+x":return this.left
p.right;case"+y":return this.top
p.bottom}},N.prototype.intersectPercentage=function(p){return Math.max(0,Math.min(this.right,p.right)-Math.max(this.left,p.left))*Math.max(0,Math.min(this.bottom,p.bottom)-Math.max(this.top,p.top))/(this.height*this.width)},N.prototype.toCSSCompatValues=function(p){return{top:this.top-p.top,bottom:p.bottom-this.bottom,left:this.left-p.left,right:p.right-this.right,height:this.height,width:this.width}},N.getSimpleBoxPosition=function(p){var v=p.div?p.div.offsetHeight:p.tagName?p.offsetHeight:0,P=p.div?p.div.offsetWidth:p.tagName?p.offsetWidth:0,B=p.div?p.div.offsetTop:p.tagName?p.offsetTop:0;return{left:(p=p.div?p.div.getBoundingClientRect():p.tagName?p.getBoundingClientRect():p).left,right:p.right,top:p.top||B,height:p.height||v,bottom:p.bottom||B+(p.height||v),width:p.width||P}},F.StringDecoder=function(){return{decode:function(p){if(!p)return"";if(typeof p!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(p))}}},F.convertCueToDOMTree=function(p,v){return p&&v?E(p,v):null};var Z=.05,L="sans-serif",K="1.5%";F.processCues=function(p,v,P){if(!p||!v||!P)return null;for(;P.firstChild;)P.removeChild(P.firstChild);var B=p.document.createElement("div");function z(le){for(var pe=0;pe
")===-1){v.cue.id=ae;continue}case"CUE":try{U(ae,v.cue,v.regionList)}catch(pe){v.reportOrThrowError(pe),v.cue=null,v.state="BADCUE";continue}v.state="CUETEXT";continue;case"CUETEXT":var le=ae.indexOf("-->")!==-1;if(!ae||le&&(ue=!0)){v.oncue&&v.oncue(v.cue),v.cue=null,v.state="ID";continue}v.cue.text&&(v.cue.text+=` `),v.cue.text+=ae.replace(/\u2028/g,` `).replace(/u2029/g,` `);continue;case"BADCUE":ae||(v.state="ID");continue}}}catch(pe){v.reportOrThrowError(pe),v.state==="CUETEXT"&&v.cue&&v.oncue&&v.oncue(v.cue),v.cue=null,v.state=v.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var p=this;try{if(p.buffer+=p.decoder.decode(),(p.cue||p.state==="HEADER")&&(p.buffer+=` `,p.parse()),p.state==="INITIAL")throw new ke(ke.Errors.BadSignature)}catch(v){p.reportOrThrowError(v)}return p.onflush&&p.onflush(),this}},Ve.exports=F},190:Ve=>{var je="auto",Ae={"":1,lr:1,rl:1},Ie={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function O(Ee){return typeof Ee=="string"&&!!Ae[Ee.toLowerCase()]&&Ee.toLowerCase()}function ke(Ee){return typeof Ee=="string"&&!!Ie[Ee.toLowerCase()]&&Ee.toLowerCase()}function ie(Ee,ye,U){this.hasBeenReset=!1;var w="",D=!1,y=Ee,A=ye,I=U,E=null,M="",H=!0,te="auto",V="start",X="auto",k="auto",N=100,R="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return w},set:function(F){w=""+F}},pauseOnExit:{enumerable:!0,get:function(){return D},set:function(F){D=!!F}},startTime:{enumerable:!0,get:function(){return y},set:function(F){if(typeof F!="number")throw new TypeError("Start time must be set to a number.");y=F,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return A},set:function(F){if(typeof F!="number")throw new TypeError("End time must be set to a number.");A=F,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return I},set:function(F){I=""+F,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return E},set:function(F){E=F,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return M},set:function(F){var Z=O(F);if(Z===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");M=Z,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return H},set:function(F){H=!!F,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return te},set:function(F){if(typeof F!="number"&&F!==je)throw new SyntaxError("Line: an invalid number or illegal string was specified.");te=F,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return V},set:function(F){var Z=ke(F);Z?(V=Z,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return X},set:function(F){if(F<0||f>100)throw new Error("Position must be between 0 and 100.");X=F,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return k},set:function(F){var Z=ke(F);Z?(k=Z,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return N},set:function(F){if(F<0||f>100)throw new Error("Size must be between 0 and 100.");N=F,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return R},set:function(F){var Z=ke(F);if(!Z)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");R=Z,this.hasBeenReset=!0}}}),this.displayState=void 0}ie.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},Ve.exports=ie},146:Ve=>{var je={"":!0,up:!0};function Ae(ke){return typeof ke=="string"&&!!je[ke.toLowerCase()]&&ke.toLowerCase()}function Ie(ke){return typeof ke=="number"&&ke>=0&&ke<=100}function O(){var ke=100,ie=3,Ee=0,ye=100,U=0,w=100,D="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return ke},set:function(y){if(!Ie(y))throw new Error("Width must be between 0 and 100.");ke=y}},lines:{enumerable:!0,get:function(){return ie},set:function(y){if(typeof y!="number")throw new TypeError("Lines must be set to a number.");ie=y}},regionAnchorY:{enumerable:!0,get:function(){return ye},set:function(y){if(!Ie(y))throw new Error("RegionAnchorX must be between 0 and 100.");ye=y}},regionAnchorX:{enumerable:!0,get:function(){return Ee},set:function(y){if(!Ie(y))throw new Error("RegionAnchorY must be between 0 and 100.");Ee=y}},viewportAnchorY:{enumerable:!0,get:function(){return w},set:function(y){if(!Ie(y))throw new Error("ViewportAnchorY must be between 0 and 100.");w=y}},viewportAnchorX:{enumerable:!0,get:function(){return U},set:function(y){if(!Ie(y))throw new Error("ViewportAnchorX must be between 0 and 100.");U=y}},scroll:{enumerable:!0,get:function(){return D},set:function(y){var A=Ae(y);A===!1?console.warn("Scroll: an invalid or illegal string was specified."):D=A}}})}Ve.exports=O},18:(Ve,je,Ae)=>{Ve.exports=Ae(61).default},61:(Ve,je,Ae)=>{Ae.d(je,{default:()=>xe});var Ie=Ae(323),O=Ae(675),ke=Ae.n(O);/*! @name videojs-contrib-quality-levels @version 2.1.0 @license Apache-2.0 */function ie(Y,$){Y.prototype=Object.create($.prototype),Y.prototype.constructor=Y,Y.__proto__=$}function Ee(Y){if(Y===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Y}var ye=function Y($){var de=this;if(Ie.default.browser.IS_IE8)for(var J in de=ke().createElement("custom"),Y.prototype)J!=="constructor"&&(de[J]=Y.prototype[J]);return de.id=$.id,de.label=de.id,de.width=$.width,de.height=$.height,de.bitrate=$.bandwidth,de.enabled_=$.enabled,Object.defineProperty(de,"enabled",{get:function(){return de.enabled_()},set:function(ee){de.enabled_(ee)}}),de},U=function(Y){function $(){var J,ee=Ee(Ee(J=Y.call(this)||this));if(Ie.default.browser.IS_IE8)for(var fe in ee=ke().createElement("custom"),$.prototype)fe!=="constructor"&&(ee[fe]=$.prototype[fe]);return ee.levels_=[],ee.selectedIndex_=-1,Object.defineProperty(ee,"selectedIndex",{get:function(){return ee.selectedIndex_}}),Object.defineProperty(ee,"length",{get:function(){return ee.levels_.length}}),ee||Ee(J)}ie(,ドルY);var de=$.prototype;return de.addQualityLevel=function(J){var ee=this.getQualityLevelById(J.id);if(ee)return ee;var fe=this.levels_.length;return ee=new ye(J),""+fe in this||Object.defineProperty(this,fe,{get:function(){return this.levels_[fe]}}),this.levels_.push(ee),this.trigger({qualityLevel:ee,type:"addqualitylevel"}),ee},de.removeQualityLevel=function(J){for(var ee=null,fe=0,Pe=this.length;fe
fe&&this.selectedIndex_--;break}return ee&&this.trigger({qualityLevel:J,type:"removequalitylevel"}),ee},de.getQualityLevelById=function(J){for(var ee=0,fe=this.length;ee
=0)&&(fe.push(He),J.push(new X(this.player_,{label:He,index:Re,selected:Fe,sortVal:Ze})))}return ee.length>1&&J.push(new X(this.player_,{label:"Auto",index:ee.length,selected:!1,sortVal:99999})),J.sort(function($e,Et){return $e.options_.sortVal
Et.options_.sortVal?-1:0}),J},$}(k),R={},F=Ie.default.registerPlugin||Ie.default.plugin,Z=function(Y,$){if(Y.addClass("vjs-http-source-selector"),console.log("videojs-http-source-selector initialized!"),console.log("player.techName_:"+Y.techName_),Y.techName_!="Html5")return!1;Y.on(["loadedmetadata"],function(de){if(Y.qualityLevels(),Ie.default.log("loadmetadata event"),Y.videojs_http_source_selector_initialized=="undefined"||Y.videojs_http_source_selector_initialized==1)console.log("player.videojs_http_source_selector_initialized == true");else{console.log("player.videojs_http_source_selector_initialized == false"),Y.videojs_http_source_selector_initialized=!0;var J=Y.controlBar,ee=J.getChild("fullscreenToggle").el();J.el().insertBefore(J.addChild("SourceMenuButton").el(),ee)}})},L=function(Y){var $=this;this.ready(function(){Z(,ドルIe.default.mergeOptions(R,Y))}),Ie.default.registerComponent("SourceMenuButton",N),Ie.default.registerComponent("SourceMenuItem",X)};F("httpSourceSelector",L),L.VERSION=E,Ae(810);const K={i8:"0.12.0"};Ae(288);var p=Ae(113),v=Ae.n(p);function P(Y){var ,ドルde;if((de=($=Y.tech_)==null?void 0:$.sourceHandler_)!=null&&de.hls){const J=Y.tech_.sourceHandler_.hls;Y.mux.addHLSJS({hlsjs:J,Hls:v()})}}function B(Y,$){var de,J,ee,fe,Pe;if((de=Y==null?void 0:Y.dataset)!=null&&de.setup){let Re=Y.dataset.setup;Re=JSON.parse(Re),Re&&((ee=(J=Re==null?void 0:Re.plugins)==null?void 0:J.mux)!=null&&ee.data)&&(Re=z(Re),Re=JSON.stringify(Re),Y.dataset.setup=Re)}return(Pe=(fe=$==null?void 0:$.plugins)==null?void 0:fe.mux)!=null&&Pe.data&&($=z($)),$}function z(Y){var $;return Y.plugins.mux.data.player_software_name="vjs-mux-kit-"+(($=Ie.default)==null?void 0:$.VERSION.split(".")[0])+(typeof v()=="function"?"-hlsjs":"-vhs"),Y.plugins.mux.data.player_software_version=K.i8,Y}var ce=Ae(9);const ae={},ge={},ue=Ie.default.registerPlugin||Ie.default.plugin,le=(Y,$)=>{Y.addClass("vjs-vtt-thumbnails"),Y.vttThumbnails=new se(Y,$)},pe=function(Y){this.ready(()=>{le(this,Ie.default.mergeOptions(ae,Y))})};class se{constructor(,ドルde){return this.player=,ドルthis.options=de,this.listenForDurationChange(),this.initializeThumbnails(),this.registeredEvents={},this}src($){this.resetPlugin(),this.options.src=,ドルthis.initializeThumbnails()}detach(){this.resetPlugin()}resetPlugin(){this.thumbnailHolder&&this.thumbnailHolder.parentNode.removeChild(this.thumbnailHolder),this.progressBar&&(this.progressBar.removeEventListener("mouseenter",this.registeredEvents.progressBarMouseEnter),this.progressBar.removeEventListener("mouseleave",this.registeredEvents.progressBarMouseLeave),this.progressBar.removeEventListener("mousemove",this.registeredEvents.progressBarMouseMove)),delete this.registeredEvents.progressBarMouseEnter,delete this.registeredEvents.progressBarMouseLeave,delete this.registeredEvents.progressBarMouseMove,delete this.progressBar,delete this.vttData,delete this.thumbnailHolder,delete this.lastStyle}listenForDurationChange(){this.player.on("durationchange",()=>{})}initializeThumbnails(){if(!this.options.src)return;const $=this.getBaseUrl(),de=this.getFullyQualifiedUrl(this.options.src,$);this.getVttFile(de).then(J=>{this.vttData=this.processVtt(J),this.setupThumbnailElement()})}getBaseUrl(){return[window.location.protocol,"//",window.location.hostname,window.location.port?":"+window.location.port:"",window.location.pathname].join("").split(/([^\/]*)$/gi).shift()}getVttFile($){return new Promise((de,J)=>{const ee=new XMLHttpRequest;ee.data={resolve:de},ee.addEventListener("load",this.vttFileLoaded),ee.open("GET",$),ee.overrideMimeType("text/plain; charset=utf-8"),ee.send()})}vttFileLoaded(){this.data.resolve(this.responseText)}setupThumbnailElement($){let de=null;this.options.showTimestamp||(de=this.player.$(".vjs-mouse-display"));const J=document.createElement("div");J.setAttribute("class","vjs-vtt-thumbnail-display"),this.progressBar=this.player.$(".vjs-progress-control"),this.progressBar.appendChild(J),this.thumbnailHolder=J,de&&!this.options.showTimestamp&&de.classList.add("vjs-hidden"),this.registeredEvents.progressBarMouseEnter=()=>this.onBarMouseenter(),this.registeredEvents.progressBarMouseLeave=()=>this.onBarMouseleave(),this.progressBar.addEventListener("mouseenter",this.registeredEvents.progressBarMouseEnter),this.progressBar.addEventListener("mouseleave",this.registeredEvents.progressBarMouseLeave)}onBarMouseenter(){this.mouseMoveCallback=$=>{this.onBarMousemove($)},this.registeredEvents.progressBarMouseMove=this.mouseMoveCallback,this.progressBar.addEventListener("mousemove",this.registeredEvents.progressBarMouseMove),this.showThumbnailHolder()}onBarMouseleave(){this.registeredEvents.progressBarMouseMove&&this.progressBar.removeEventListener("mousemove",this.registeredEvents.progressBarMouseMove),this.hideThumbnailHolder()}getXCoord(,ドルde){const J=$.getBoundingClientRect(),ee=document.documentElement;return de-(J.left+(window.pageXOffset||ee.scrollLeft||0))}onBarMousemove($){this.updateThumbnailStyle(Ie.default.dom.getPointerPosition(this.progressBar,$).x,this.progressBar.offsetWidth)}getStyleForTime($){for(let de=0;de
=J.start&&$
>1,Fe=de-(fe+Re),He=fe-Re;if(He>0&&Fe>0?this.thumbnailHolder.style.transform="translateX("+(fe-Re)+"px)":He<=0?this.thumbnailholder.style.transform="translatex(0px)":fe<=0&&(this.thumbnailholder.style.transform="translatex("+(de-pe)+"px)"),!this.laststyle||this.laststyle!==ee){this.laststyle=ee;for(const Ze in ee)ee.hasOwnProperty(Ze)&&(this.thumbnailHolder.style[Ze]=ee[Ze])}}processVtt($){const de=[];return $.split(/[\r\n][\r\n]/i).forEach(J=>{if(J.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)){const ee=J.split(/[\r\n]/i),fe=ee[0].split(/ ?--> ?/i),Pe=fe[0],Re=fe[1],Fe=ee[1],He=this.getVttCss(Fe);de.push({start:this.getSecondsFromTimestamp(Pe),end:this.getSecondsFromTimestamp(Re),css:He})}}),de}getFullyQualifiedUrl(,ドルde){return $.indexOf("//")>=0?$:de.indexOf("//")===0?[de.replace(/\/$/gi,""),this.trim(,ドル"/")].join("/"):de.indexOf("//")>0?[this.trim(de,"/"),this.trim(,ドル"/")].join("/"):$}getPropsFromDef($){const de=$.split(/#xywh=/i),J=de[0],ee=de[1].match(/[0-9]+/gi);return{x:ee[0],y:ee[1],w:ee[2],h:ee[3],image:J}}getVttCss($){const de={};let J;if(J=this.options.src.indexOf("//")>=0?this.options.src.split(/([^\/]*)$/gi).shift():this.getBaseUrl()+this.options.src.split(/([^\/]*)$/gi).shift(),!($=this.getFullyQualifiedUrl(,ドルJ)).match(/#xywh=/i))return de.background='url("'+$+'")',de;const ee=this.getPropsFromDef($);return de.background='url("'+ee.image+'") no-repeat -'+ee.x+"px -"+ee.y+"px",de.width=ee.w+"px",de.height=ee.h+"px",de.url=ee.image,de}deconstructTimestamp($){const de=$.split("."),J=de[0].split(":");return{milliseconds:parseInt(de[1],10)||0,seconds:parseInt(J.pop(),10)||0,minutes:parseInt(J.pop(),10)||0,hours:parseInt(J.pop(),10)||0}}getSecondsFromTimestamp($){const de=this.deconstructTimestamp($);return parseInt(3600*de.hours+60*de.minutes+de.seconds+de.milliseconds/1e3,10)}trim(,ドルde){let J=[" ",` `,"\r"," ","\f","\v"," "," "," "," "," "," "," "," "," "," "," "," ","","\u2028","\u2029"," "].join(""),ee=0,fe=0;for($+="",de&&(J=(de+"").replace(/([[\]().?/*{}+$^:])/g,"1ドル")),ee=$.length,fe=0;fe
=0;fe--)if(J.indexOf($.charAt(fe))===-1){$=$.substring(0,fe+1);break}return J.indexOf($.charAt(0))===-1?$:""}}function oe(Y){Y.timelineHoverPreviews=function($){let de=($==null?void 0:$.enabled)||!1,J=($==null?void 0:$.src)||null;return de||typeof Y.vttThumbnails.detach!="function"?typeof Y.vttThumbnails=="function"&&J!==null?(Y.vttThumbnails({src:J}),void(Y.options().timelineHoverPreviewsUrl=J)):typeof Y.vttThumbnails.src=="function"&&J!==null?(Y.vttThumbnails.src(J),void(Y.options().timelineHoverPreviewsUrl=J)):void 0:(Y.vttThumbnails.detach(),void(Y.options().timelineHoverPreviewsUrl=null))}}ue("vttThumbnails",pe),Ie.default.hook("beforesetup",function(Y,$){return $=B(Y,$)}),Ie.default.hook("setup",function(Y){oe(Y),Y.options().timelineHoverPreviewsUrl&&Y.timelineHoverPreviews({enabled:!0,src:Y.options().timelineHoverPreviewsUrl})}),Ie.default.use("video/mux",Y=>({setSource({src:$},de){const{customDomain:J="mux.com",timelineHoverPreviews:ee}=Y.options();if(ee){let fe=`https://image.${J}/${$.split("?",1)[0]}/storyboard.vtt`;Y.timelineHoverPreviews({enabled:!0,src:fe})}de(null,{src:`https://stream.${J}/${$}`,type:"application/x-mpegurl"}),Y.mux&&Y.mux.addHLSJS&&P(Y),ce.setupSubtitlesForPlayer!==void 0&&(0,ce.setupSubtitlesForPlayer)(Y)}}));const xe=Ie.default},893:()=>{},113:()=>{},810:()=>{},9:()=>{},110:Ve=>{function je(){return Ve.exports=je=Object.assign?Object.assign.bind():function(Ae){for(var Ie=1;Ie
{var je=Ve&&Ve.__esModule?()=>Ve.default:()=>Ve;return $t.d(je,{a:je}),je},$t.d=(Ve,je)=>{for(var Ae in je)$t.o(je,Ae)&&!$t.o(Ve,Ae)&&Object.defineProperty(Ve,Ae,{enumerable:!0,get:je[Ae]})},$t.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),$t.o=(Ve,je)=>Object.prototype.hasOwnProperty.call(Ve,je),$t.r=Ve=>{typeof Symbol<"u"&&symbol.tostringtag&&object.defineproperty(ve,symbol.tostringtag,{value:"module"}),object.defineproperty(ve,"__esmodule",{value:!0})},$t(18)})()),sy={class:"flex w-[400px] h-[80px] gap-2 p-4 shadow-lg bg-white rounded relative"},Ey={key:0,class:"flex w-full"},wy={class:"flex flex-col gap-1"},ky={class:"font-bold text-primary-900 line-clamp-1"},Cy={class:"hidden"},xy=["id","data-setup"],Iy=["src"],Ay={key:0,class:"flex items-center justify-center w-full text-primary-900"},Py={class:"flex items-center flex-1 w-full gap-2"},Oy={class:"max-w-[64px] w-full h-full object-cover aspect-video"},Dy=["src"],Ly={class:"flex flex-col gap-1"},My={class:"font-bold text-primary-900 line-clamp-1"},Fy=oy({name:"PlayerStreamlineAudio",__name:"index",setup(Ho){const{player:ai,closePlayerModal:$t}=yy(),{$auth:Ve,$gc:je}=uy(),Ae=_n(),Ie=_n(!1),O=_n(!1),ke=_n(null),ie=_n(null),Ee=_n(null),ye=_n({}),U=_n(null),w=_n("audio-player"),D=_n(null),y=_n(!0),A=_n(),I=_n({autoplay:!1,errorDisplay:!1,timelineHoverPreviews:!1,liveTracker:!1,html5:{hls:{backBufferLength:8}},plugins:{mux:{data:{env_key:"20eeqnvv8vu44mdcg3s85uqb1",player_name:"Match Centre Audio Player",player_version:"1.0.0"}}}}),E=Md(()=>O.value?"play":"pause"),M=Md(()=>{var X;return`${(X=ye.value)==null?void 0:X.playbackID}.m3u8?token=${U.value}&add_audio_only=true`});ly(async()=>{H();const X=await Ve.getUser();ke.value=X.username}),dy(()=>{D.value&&D.value.dispose()});const H=async()=>{const X=await je().videos.web().getAudio(ai.entryID);ye.value={categories:[],date:"",description:X.data.attributes.description,duration:"",entitlements:[],mediaType:X.data.attributes.mediaType,playbackID:X.data.attributes.assetData.playbackIds[0].id,status:X.data.attributes.assetData.status,storybookToken:"",title:X.data.attributes.title,videoID:ai.entryID},I.value={...I.value,plugins:{mux:{video_title:X.data.attributes.title,video_id:X.data.attributes.assetData.playbackIds[0].id}}},ie.value=Rd(!0,600,600,X.data.attributes.imageData.posterImageKey),Ee.value=Rd(!0,600,600,X.data.attributes.imageData.offlineImageKey),(async()=>{const k={videoID:ye.value.videoID,mediaType:ye.value.mediaType},{data:N}=await _y(k);U.value=N.data.attributes.token,await cy(),te()})()},te=()=>{D.value.src=M.value,A.value=Ty(D.value,I.value),y.value=!0,D.value.addEventListener("error",X=>{const k=X.target.error;console.error("Error loading audio player",k.message),y.value=!1,k.code===4&&(Ae.value="No stream is active.")}),setTimeout(()=>{y.value=!1,Ie.value=!0,V()},300)},V=()=>{O.value=!0,A.value.play(),A.value.volume(1)};return(X,k)=>{const N=hy,R=my,F=gy;return Ui(),Bi("section",{class:qo(["fixed -translate-x-1/2 bottom-8 left-1/2 z-[100000]",{"is-playing":Bt(O)}])},[zt("div",Sy,[Bt(Ae)?(Ui(),Bi("div",Ey,[zt("div",wy,[k[3]||(k[3]=zt("p",{class:"text-sm font-light text-gray-400 font-secondary"}," Error Loading Audio ",-1)),zt("p",ky,Nd(Bt(Ae)),1)]),zt("button",{class:"ml-auto text-gray-500",onClick:k[0]||(k[0]=(...Z)=>Bt($t)&&Bt($t)(...Z))},[ji(N,{class:"",pack:"navigation",icon:"close",size:20})])])):(Ui(),Bi(Ud,{key:1},[zt("div",Cy,[py(zt("audio",{id:Bt(w),ref_key:"playerRef",ref:D,class:"video-js",controls:"",preload:"auto",width:"600",height:"120","data-setup":JSON.stringify(Bt(I))},[zt("source",{src:Bt(M),type:"video/mux"},null,8,Iy)],8,xy),[[fy,Bt(U)]])]),Bt(y)?(Ui(),Bi("div",Ay,[ji(R)])):Bt(Ie)?(Ui(),Bi(Ud,{key:1},[zt("button",{class:"text-gray-500",onClick:k[1]||(k[1]=Z=>Bt(O)?(O.value=!1,void A.value.pause()):V())},[ji(N,{icon:Bt(E),size:20,pack:"fan"},null,8,["icon"])]),zt("div",Py,[zt("div",Oy,[zt("img",{class:"object-cover w-full h-full",src:`${Bt(ie)??"https://upload.wikimedia.org/wikipedia/commons/thumb/3/3f/Placeholder_view_vector.svg/991px-Placeholder_view_vector.svg.png"}`},null,8,Dy)]),zt("div",Ly,[k[4]||(k[4]=zt("p",{class:"text-sm font-light text-gray-400 font-secondary"}," Live Audio ",-1)),zt("p",My,Nd(Bt(ye).title),1)])]),zt("button",{class:"ml-auto text-gray-500",onClick:k[2]||(k[2]=(...Z)=>Bt($t)&&Bt($t)(...Z))},[ji(N,{class:"",pack:"navigation",icon:"close",size:20})]),zt("div",{class:qo(["absolute top-0 bottom-0 p-1 m-auto transition-all duration-300 bg-gray-400 rounded-full shadow-lg -right-2.5 h-max w-max",{"scale-[0.7]":!Bt(O)}])},[ji(F,{class:qo(["w-3 h-3 transition-all origin-center",[Bt(O)?"scale-100":"scale-0"]]),"animation-data-path":"/assets/audio-player/now-playing.json","loop-on-start":!0},null,8,["class"])],2)],64)):vy("",!0)],64))])],2)}}});export{Fy as _};
AltStyle
によって変換されたページ
(->オリジナル)
/
アドレス:
モード:
デフォルト
音声ブラウザ
ルビ付き
配色反転
文字拡大
モバイル